summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LGPL_EXCEPTION.txt22
-rw-r--r--LICENSE.FDL450
-rw-r--r--LICENSE.GPL958
-rw-r--r--LICENSE.LGPL514
-rw-r--r--LICENSE.LGPLv3165
-rw-r--r--LICENSE.PREVIEW.COMMERCIAL628
-rw-r--r--README8
-rw-r--r--examples/qt3d/anaglyph-rendering/StereoCamera.qml102
-rw-r--r--examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml76
-rw-r--r--examples/qt3d/anaglyph-rendering/anaglyph-rendering.pro20
-rw-r--r--examples/qt3d/anaglyph-rendering/main.cpp64
-rw-r--r--examples/qt3d/anaglyph-rendering/main.qml227
-rw-r--r--examples/qt3d/anaglyph-rendering/resources.qrc7
-rw-r--r--examples/qt3d/assimp-cpp/assimp-cpp.pro7
-rw-r--r--examples/qt3d/assimp-cpp/main.cpp104
-rw-r--r--examples/qt3d/assimp/assimp.pro9
-rw-r--r--examples/qt3d/assimp/main.cpp4
-rw-r--r--examples/qt3d/bigmodel-qml/bigmodel-qml.pro4
-rw-r--r--examples/qt3d/bigscene-cpp/bigscene-cpp.pro4
-rw-r--r--examples/qt3d/controls/Logo.qml105
-rw-r--r--examples/qt3d/controls/Qt_logo.obj4044
-rw-r--r--examples/qt3d/controls/controls.pro12
-rw-r--r--examples/qt3d/controls/controls.qrc7
-rw-r--r--examples/qt3d/controls/main.cpp (renamed from examples/qt3d/exampleresources/exampleresources.h)24
-rw-r--r--examples/qt3d/controls/main.qml210
-rw-r--r--examples/qt3d/cpp_example/cpp_example.pro9
-rw-r--r--examples/qt3d/cpp_example/main.cpp4
-rw-r--r--examples/qt3d/cylinder-cpp/cylinder-cpp.pro4
-rw-r--r--examples/qt3d/cylinder-qml/cylinder-qml.pro4
-rw-r--r--examples/qt3d/deferred-renderer-cpp/deferred-renderer-cpp.pro6
-rw-r--r--examples/qt3d/deferred-renderer-qml/deferred-renderer-qml.pro6
-rw-r--r--examples/qt3d/deferred-renderer-qml/main.cpp4
-rw-r--r--examples/qt3d/deferred-renderer-qml/main.qml24
-rw-r--r--examples/qt3d/dynamicscene-cpp/dynamicscene-cpp.pro6
-rw-r--r--examples/qt3d/enabled-qml/enabled-qml.pro5
-rw-r--r--examples/qt3d/enabled-qml/main.qml81
-rw-r--r--examples/qt3d/exampleresources/chest.qrc6
-rw-r--r--examples/qt3d/exampleresources/cubemaps.qrc16
-rw-r--r--examples/qt3d/exampleresources/exampleresources.pri17
-rw-r--r--examples/qt3d/exampleresources/exampleresources.pro36
-rw-r--r--examples/qt3d/exampleresources/gltf.qrc16
-rw-r--r--examples/qt3d/exampleresources/houseplants.qrc (renamed from examples/qt3d/exampleresources/example-assets.qrc)48
-rw-r--r--examples/qt3d/exampleresources/metalbarrel.qrc19
-rw-r--r--examples/qt3d/exampleresources/obj.qrc7
-rw-r--r--examples/qt3d/exampleresources/test_scene.qrc5
-rw-r--r--examples/qt3d/exampleresources/textures.qrc7
-rw-r--r--examples/qt3d/examples.pri4
-rw-r--r--examples/qt3d/gltf/gltf.pro10
-rw-r--r--examples/qt3d/gltf/gltf_example.qrc (renamed from examples/qt3d/gltf/gltf.qrc)0
-rw-r--r--examples/qt3d/gltf/main.cpp3
-rw-r--r--examples/qt3d/keyboardinput-qml/keyboardinput-qml.pro5
-rw-r--r--examples/qt3d/loader-qml/loader-qml.pro5
-rw-r--r--examples/qt3d/loader-qml/main.qml20
-rw-r--r--examples/qt3d/materials-cpp/main.cpp2
-rw-r--r--examples/qt3d/materials-cpp/materials-cpp.pro13
-rw-r--r--examples/qt3d/materials/main.cpp4
-rw-r--r--examples/qt3d/materials/materials.pro13
-rw-r--r--examples/qt3d/multiviewport/main.cpp3
-rw-r--r--examples/qt3d/multiviewport/multiviewport.pro9
-rw-r--r--examples/qt3d/playground-qml/main.cpp4
-rw-r--r--examples/qt3d/playground-qml/playground-qml.pro9
-rw-r--r--examples/qt3d/qt3d.pro16
-rw-r--r--examples/qt3d/scene3d/AnimatedEntity.qml20
-rw-r--r--examples/qt3d/scene3d/scene3d.pro5
-rw-r--r--examples/qt3d/shadow-map-qml/main.cpp4
-rw-r--r--examples/qt3d/shadow-map-qml/shaders/es3/ads.frag2
-rw-r--r--examples/qt3d/shadow-map-qml/shadow-map-qml.pro9
-rw-r--r--examples/qt3d/simple-cpp/simple-cpp.pro5
-rw-r--r--examples/qt3d/simple-qml/main.qml21
-rw-r--r--examples/qt3d/simple-qml/simple-qml.pro5
-rw-r--r--examples/qt3d/simple-shaders-qml/main.cpp63
-rw-r--r--examples/qt3d/simple-shaders-qml/main.qml196
-rw-r--r--examples/qt3d/simple-shaders-qml/simple-shader.frag29
-rw-r--r--examples/qt3d/simple-shaders-qml/simple-shader.vert21
-rw-r--r--examples/qt3d/simple-shaders-qml/simple-shaders-qml.pro16
-rw-r--r--examples/qt3d/simple-shaders-qml/simple-shaders-qml.qrc7
-rw-r--r--examples/qt3d/skybox/Skybox.qml66
-rw-r--r--examples/qt3d/skybox/main.cpp4
-rw-r--r--examples/qt3d/skybox/main.qml4
-rw-r--r--examples/qt3d/skybox/skybox.pro9
-rw-r--r--examples/qt3d/tessellation-modes/main.cpp4
-rw-r--r--examples/qt3d/tessellation-modes/tessellation-modes.pro6
-rw-r--r--examples/qt3d/torus-cpp/torus-cpp.pro4
-rw-r--r--examples/qt3d/torus-qml/torus-qml.pro4
-rw-r--r--examples/qt3d/wave/main.cpp4
-rw-r--r--examples/qt3d/wave/wave.pro6
-rw-r--r--examples/qt3d/wireframe/main.cpp4
-rw-r--r--examples/qt3d/wireframe/wireframe.pro9
-rw-r--r--src/core/aspects/qabstractaspect.cpp10
-rw-r--r--src/core/aspects/qabstractaspect_p.h2
-rw-r--r--src/core/aspects/qaspectengine.cpp25
-rw-r--r--src/core/aspects/qaspectengine_p.h2
-rw-r--r--src/core/aspects/qaspectfactory.cpp4
-rw-r--r--src/core/bounds/qaxisalignedboundingbox.cpp5
-rw-r--r--src/core/core-components/qcamera.cpp77
-rw-r--r--src/core/core-components/qcamera_p.h2
-rw-r--r--src/core/core-components/qcameralens.cpp216
-rw-r--r--src/core/core-components/qcameralens.h10
-rw-r--r--src/core/core-components/qcameralens_p.h13
-rw-r--r--src/core/core.pri4
-rw-r--r--src/core/doc/qt3dcore.qdocconf24
-rw-r--r--src/core/doc/src/qt3dcore-index.qdoc1
-rw-r--r--src/core/doc/src/qt3dcore-module.qdoc19
-rw-r--r--src/core/io/qabstractattribute.cpp10
-rw-r--r--src/core/io/qabstractattribute_p.h5
-rw-r--r--src/core/io/qabstractbuffer.cpp10
-rw-r--r--src/core/io/qabstractbuffer_p.h6
-rw-r--r--src/core/jobs/dependencyhandler.cpp56
-rw-r--r--src/core/jobs/dependencyhandler_p.h15
-rw-r--r--src/core/jobs/jobs.pri3
-rw-r--r--src/core/jobs/qabstractaspectjobmanager.cpp5
-rw-r--r--src/core/jobs/qaspectjob.cpp10
-rw-r--r--src/core/jobs/qaspectjob_p.h4
-rw-r--r--src/core/jobs/qaspectjobmanager.cpp58
-rw-r--r--src/core/jobs/qaspectjobmanager.h3
-rw-r--r--src/core/jobs/qaspectjobmanager_p.h6
-rw-r--r--src/core/jobs/qthreadpooler.cpp240
-rw-r--r--src/core/jobs/qthreadpooler_p.h31
-rw-r--r--src/core/jobs/task.cpp60
-rw-r--r--src/core/jobs/task_p.h60
-rw-r--r--src/core/nodes/qbackendnode.cpp13
-rw-r--r--src/core/nodes/qbackendnode_p.h2
-rw-r--r--src/core/nodes/qcomponent.cpp61
-rw-r--r--src/core/nodes/qcomponent_p.h2
-rw-r--r--src/core/nodes/qentity.cpp58
-rw-r--r--src/core/nodes/qentity_p.h2
-rw-r--r--src/core/nodes/qnode.cpp71
-rw-r--r--src/core/nodes/qnode_p.h2
-rw-r--r--src/core/nodes/qnodeid.h3
-rw-r--r--src/core/qbackendscenepropertychange.cpp16
-rw-r--r--src/core/qbackendscenepropertychange_p.h2
-rw-r--r--src/core/qpostman.cpp5
-rw-r--r--src/core/qray3d.cpp359
-rw-r--r--src/core/qray3d.h104
-rw-r--r--src/core/qscene.cpp9
-rw-r--r--src/core/qscenechange.cpp15
-rw-r--r--src/core/qscenechange_p.h2
-rw-r--r--src/core/qscenepropertychange.cpp16
-rw-r--r--src/core/qscenepropertychange_p.h2
-rw-r--r--src/core/resources/qcircularbuffer.qdoc2
-rw-r--r--src/core/resources/qframeallocator.cpp9
-rw-r--r--src/core/resources/qframeallocator_p.h5
-rw-r--r--src/core/resources/qhandle.h3
-rw-r--r--src/core/services/qopenglinformationservice.cpp10
-rw-r--r--src/core/services/qservicelocator.cpp5
-rw-r--r--src/core/services/qsysteminformationservice.cpp15
-rw-r--r--src/core/transforms/qabstracttransform.cpp21
-rw-r--r--src/core/transforms/qabstracttransform.h11
-rw-r--r--src/core/transforms/qabstracttransform_p.h9
-rw-r--r--src/core/transforms/qlookattransform.cpp25
-rw-r--r--src/core/transforms/qlookattransform.h8
-rw-r--r--src/core/transforms/qlookattransform_p.h3
-rw-r--r--src/core/transforms/qmatrixtransform.cpp41
-rw-r--r--src/core/transforms/qmatrixtransform.h12
-rw-r--r--src/core/transforms/qmatrixtransform_p.h2
-rw-r--r--src/core/transforms/qrotatetransform.cpp22
-rw-r--r--src/core/transforms/qrotatetransform.h8
-rw-r--r--src/core/transforms/qrotatetransform_p.h2
-rw-r--r--src/core/transforms/qscaletransform.cpp21
-rw-r--r--src/core/transforms/qscaletransform.h7
-rw-r--r--src/core/transforms/qscaletransform_p.h2
-rw-r--r--src/core/transforms/qtransform.cpp57
-rw-r--r--src/core/transforms/qtransform.h3
-rw-r--r--src/core/transforms/qtransform_p.h3
-rw-r--r--src/core/transforms/qtranslatetransform.cpp22
-rw-r--r--src/core/transforms/qtranslatetransform.h8
-rw-r--r--src/core/transforms/qtranslatetransform_p.h2
-rw-r--r--src/input/qinputaspect.cpp10
-rw-r--r--src/input/qinputaspect_p.h2
-rw-r--r--src/input/qkeyboardcontroller.cpp11
-rw-r--r--src/input/qkeyboardcontroller_p.h2
-rw-r--r--src/input/qkeyboardinput.cpp11
-rw-r--r--src/input/qkeyboardinput_p.h2
-rw-r--r--src/plugins/sceneparsers/assimp/assimphelpers.cpp2
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser.cpp210
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser_p.h1
-rw-r--r--src/quick3d/imports/render/defaults/defaults.pri1
-rw-r--r--src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml145
-rw-r--r--src/quick3d/imports/render/qt3dquick3drenderplugin.cpp17
-rw-r--r--src/quick3d/quick3d/items/quick3dconfiguration.cpp8
-rw-r--r--src/quick3d/quick3d/items/quick3dentity.cpp11
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader.cpp22
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader_p.h2
-rw-r--r--src/quick3d/quick3d/items/quick3dnode.cpp19
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp46
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h4
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator_p_p.h2
-rw-r--r--src/quick3d/quick3d/items/quick3dtransform.cpp16
-rw-r--r--src/quick3d/quick3d/items/quick3dtransform.h5
-rw-r--r--src/quick3d/quick3d/qqmlaspectengine.cpp9
-rw-r--r--src/quick3d/quick3d/qqmlaspectengine_p.h4
-rw-r--r--src/quick3d/quick3d/qt3dquick_global.cpp8
-rw-r--r--src/quick3d/quick3drenderer/items/items.pri10
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dframegraphitem.cpp100
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dparameter.cpp7
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dparameter_p.h2
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drenderpass.cpp35
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drenderpass.h8
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drenderpassfilter.cpp43
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drenderpassfilter.h8
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drendertargetselector.cpp85
-rw-r--r--src/quick3d/quick3drenderer/items/quick3drendertargetselector.h (renamed from src/core/jobs/qthreadpooler_p_p.h)68
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dshaderdata.cpp2
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dshaderdataarray.cpp6
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dstateset.cpp98
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dstateset.h (renamed from src/quick3d/quick3drenderer/items/quick3dframegraphitem.h)31
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dtechniquefilter.cpp42
-rw-r--r--src/quick3d/quick3drenderer/items/quick3dtechniquefilter.h7
-rw-r--r--src/render/backend/attachmentpack.cpp10
-rw-r--r--src/render/backend/attachmentpack_p.h4
-rw-r--r--src/render/backend/framegraph/framegraph.pri8
-rw-r--r--src/render/backend/framegraph/framegraphnode_p.h9
-rw-r--r--src/render/backend/framegraph/nodraw.cpp (renamed from src/core/jobs/jobrunner.cpp)53
-rw-r--r--src/render/backend/framegraph/nodraw_p.h66
-rw-r--r--src/render/backend/framegraph/renderpassfilternode.cpp13
-rw-r--r--src/render/backend/framegraph/renderpassfilternode_p.h3
-rw-r--r--src/render/backend/framegraph/rendertargetselectornode.cpp9
-rw-r--r--src/render/backend/framegraph/rendertargetselectornode_p.h2
-rw-r--r--src/render/backend/framegraph/statesetnode.cpp111
-rw-r--r--src/render/backend/framegraph/statesetnode_p.h73
-rw-r--r--src/render/backend/framegraph/techniquefilternode.cpp13
-rw-r--r--src/render/backend/framegraph/techniquefilternode_p.h4
-rw-r--r--src/render/backend/jobs/renderviewjob.cpp5
-rw-r--r--src/render/backend/jobs/renderviewjobutils.cpp42
-rw-r--r--src/render/backend/jobs/renderviewjobutils_p.h29
-rw-r--r--src/render/backend/qgraphicscontext.cpp47
-rw-r--r--src/render/backend/qgraphicscontext_p.h4
-rw-r--r--src/render/backend/qgraphicshelperes2.cpp1
-rw-r--r--src/render/backend/qgraphicshelpergl2.cpp1
-rw-r--r--src/render/backend/qgraphicshelpergl3.cpp1
-rw-r--r--src/render/backend/qrenderaspect.cpp19
-rw-r--r--src/render/backend/qrenderaspect_p.h2
-rw-r--r--src/render/backend/renderer.cpp29
-rw-r--r--src/render/backend/rendermaterial.cpp1
-rw-r--r--src/render/backend/rendermaterial_p.h2
-rw-r--r--src/render/backend/rendermesh.cpp3
-rw-r--r--src/render/backend/rendermesh_p.h2
-rw-r--r--src/render/backend/renderrenderpass.cpp123
-rw-r--r--src/render/backend/renderrenderpass_p.h3
-rw-r--r--src/render/backend/rendershader.cpp31
-rw-r--r--src/render/backend/rendershader_p.h2
-rw-r--r--src/render/backend/renderstate.cpp97
-rw-r--r--src/render/backend/renderstate_p.h7
-rw-r--r--src/render/backend/rendertexture.cpp14
-rw-r--r--src/render/backend/rendertexture_p.h1
-rw-r--r--src/render/backend/renderview.cpp50
-rw-r--r--src/render/backend/renderview_p.h9
-rw-r--r--src/render/backend/states/blendstate.cpp21
-rw-r--r--src/render/backend/states/blendstate_p.h15
-rw-r--r--src/render/defaults/defaults.pri7
-rw-r--r--src/render/defaults/qdiffusemapmaterial.cpp50
-rw-r--r--src/render/defaults/qdiffusemapmaterial_p.h2
-rw-r--r--src/render/defaults/qdiffusespecularmapmaterial.cpp54
-rw-r--r--src/render/defaults/qdiffusespecularmapmaterial_p.h2
-rw-r--r--src/render/defaults/qforwardrenderer.cpp22
-rw-r--r--src/render/defaults/qforwardrenderer_p.h2
-rw-r--r--src/render/defaults/qnormaldiffusemapalphamaterial.cpp13
-rw-r--r--src/render/defaults/qnormaldiffusemapalphamaterial_p.h2
-rw-r--r--src/render/defaults/qnormaldiffusemapmaterial.cpp66
-rw-r--r--src/render/defaults/qnormaldiffusemapmaterial_p.h2
-rw-r--r--src/render/defaults/qnormaldiffusespecularmapmaterial.cpp77
-rw-r--r--src/render/defaults/qnormaldiffusespecularmapmaterial_p.h2
-rw-r--r--src/render/defaults/qpervertexcolormaterial.cpp10
-rw-r--r--src/render/defaults/qpervertexcolormaterial_p.h2
-rw-r--r--src/render/defaults/qphongmaterial.cpp50
-rw-r--r--src/render/defaults/qphongmaterial_p.h2
-rw-r--r--src/render/defaults/qskyboxentity.cpp284
-rw-r--r--src/render/defaults/qskyboxentity.h (renamed from src/core/jobs/jobrunner_p.h)58
-rw-r--r--src/render/defaults/qskyboxentity_p.h100
-rw-r--r--src/render/doc/qt3drender.qdocconf5
-rw-r--r--src/render/doc/src/qt3drender-module.qdoc18
-rw-r--r--src/render/frontend/framegraph-components/framegraph-components.pri9
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector.cpp17
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.cpp14
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.h2
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qframegraph.cpp73
-rw-r--r--src/render/frontend/framegraph-components/qframegraph_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.cpp93
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.h5
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qframegraphselector.cpp13
-rw-r--r--src/render/frontend/framegraph-components/qframegraphselector_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter.cpp46
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qnodraw.cpp69
-rw-r--r--src/render/frontend/framegraph-components/qnodraw.h (renamed from examples/qt3d/exampleresources/exampleresources.cpp)34
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.cpp54
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.h5
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter_p.h5
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.cpp47
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.h6
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector_p.h3
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.cpp11
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.h2
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod.cpp11
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod_p.h2
-rw-r--r--src/render/frontend/framegraph-components/qstateset.cpp144
-rw-r--r--src/render/frontend/framegraph-components/qstateset.h74
-rw-r--r--src/render/frontend/framegraph-components/qstateset_p.h63
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.cpp56
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.h5
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter_p.h3
-rw-r--r--src/render/frontend/framegraph-components/qviewport.cpp14
-rw-r--r--src/render/frontend/framegraph-components/qviewport_p.h2
-rw-r--r--src/render/frontend/qabstractlight.cpp35
-rw-r--r--src/render/frontend/qabstractlight_p.h2
-rw-r--r--src/render/frontend/qabstractmesh.cpp14
-rw-r--r--src/render/frontend/qabstractmesh_p.h2
-rw-r--r--src/render/frontend/qabstractsceneloader.cpp11
-rw-r--r--src/render/frontend/qabstractsceneloader.h2
-rw-r--r--src/render/frontend/qabstractsceneloader_p.h2
-rw-r--r--src/render/frontend/qabstracttextureimage.cpp94
-rw-r--r--src/render/frontend/qabstracttextureimage_p.h4
-rw-r--r--src/render/frontend/qabstracttextureprovider.cpp174
-rw-r--r--src/render/frontend/qabstracttextureprovider.h21
-rw-r--r--src/render/frontend/qabstracttextureprovider_p.h3
-rw-r--r--src/render/frontend/qalphacoverage.cpp6
-rw-r--r--src/render/frontend/qalphatest.cpp6
-rw-r--r--src/render/frontend/qalphatest.h2
-rw-r--r--src/render/frontend/qannotation.cpp50
-rw-r--r--src/render/frontend/qannotation_p.h2
-rw-r--r--src/render/frontend/qblendequation.cpp6
-rw-r--r--src/render/frontend/qblendequation.h2
-rw-r--r--src/render/frontend/qblendstate.cpp122
-rw-r--r--src/render/frontend/qblendstate.h10
-rw-r--r--src/render/frontend/qcolormask.cpp43
-rw-r--r--src/render/frontend/qcuboidmesh.cpp11
-rw-r--r--src/render/frontend/qcuboidmesh_p.h2
-rw-r--r--src/render/frontend/qcullface.cpp6
-rw-r--r--src/render/frontend/qcullface.h2
-rw-r--r--src/render/frontend/qcylindermesh.cpp6
-rw-r--r--src/render/frontend/qdepthmask.cpp6
-rw-r--r--src/render/frontend/qdepthtest.cpp6
-rw-r--r--src/render/frontend/qdepthtest.h2
-rw-r--r--src/render/frontend/qdirectionallight.cpp11
-rw-r--r--src/render/frontend/qdirectionallight_p.h2
-rw-r--r--src/render/frontend/qdithering.cpp6
-rw-r--r--src/render/frontend/qeffect.cpp16
-rw-r--r--src/render/frontend/qeffect_p.h2
-rw-r--r--src/render/frontend/qfrontface.cpp6
-rw-r--r--src/render/frontend/qfrontface.h2
-rw-r--r--src/render/frontend/qlayer.cpp45
-rw-r--r--src/render/frontend/qlayer_p.h2
-rw-r--r--src/render/frontend/qmaterial.cpp21
-rw-r--r--src/render/frontend/qmaterial_p.h2
-rw-r--r--src/render/frontend/qmesh.cpp14
-rw-r--r--src/render/frontend/qmesh_p.h2
-rw-r--r--src/render/frontend/qopenglfilter.cpp122
-rw-r--r--src/render/frontend/qopenglfilter.h4
-rw-r--r--src/render/frontend/qparameter.cpp15
-rw-r--r--src/render/frontend/qparameter_p.h2
-rw-r--r--src/render/frontend/qparametermapping.cpp83
-rw-r--r--src/render/frontend/qparametermapping.h2
-rw-r--r--src/render/frontend/qparametermapping_p.h2
-rw-r--r--src/render/frontend/qplanemesh.cpp11
-rw-r--r--src/render/frontend/qplanemesh_p.h2
-rw-r--r--src/render/frontend/qpointlight.cpp62
-rw-r--r--src/render/frontend/qpointlight_p.h2
-rw-r--r--src/render/frontend/qpolygonoffset.cpp6
-rw-r--r--src/render/frontend/qrenderattachment.cpp11
-rw-r--r--src/render/frontend/qrenderattachment.h6
-rw-r--r--src/render/frontend/qrenderattachment_p.h2
-rw-r--r--src/render/frontend/qrenderpass.cpp70
-rw-r--r--src/render/frontend/qrenderpass.h4
-rw-r--r--src/render/frontend/qrenderpass_p.h3
-rw-r--r--src/render/frontend/qrenderstate.cpp9
-rw-r--r--src/render/frontend/qrenderstate.h4
-rw-r--r--src/render/frontend/qrenderstate_p.h3
-rw-r--r--src/render/frontend/qrendertarget.cpp11
-rw-r--r--src/render/frontend/qrendertarget_p.h2
-rw-r--r--src/render/frontend/qscissortest.cpp6
-rw-r--r--src/render/frontend/qshaderdata.cpp25
-rw-r--r--src/render/frontend/qshaderdata.h2
-rw-r--r--src/render/frontend/qshaderdata_p.h4
-rw-r--r--src/render/frontend/qshaderprogram.cpp11
-rw-r--r--src/render/frontend/qshaderprogram.h2
-rw-r--r--src/render/frontend/qshaderprogram_p.h2
-rw-r--r--src/render/frontend/qspheremesh.cpp6
-rw-r--r--src/render/frontend/qspotlight.cpp93
-rw-r--r--src/render/frontend/qspotlight_p.h2
-rw-r--r--src/render/frontend/qstenciltest.cpp6
-rw-r--r--src/render/frontend/qstenciltest.h4
-rw-r--r--src/render/frontend/qtechnique.cpp30
-rw-r--r--src/render/frontend/qtechnique.h4
-rw-r--r--src/render/frontend/qtechnique_p.h5
-rw-r--r--src/render/frontend/qtextureimage.cpp45
-rw-r--r--src/render/frontend/qtorusmesh.cpp6
-rw-r--r--src/render/frontend/qwrapmode.cpp18
-rw-r--r--src/render/frontend/qwrapmode.h2
-rw-r--r--src/render/io/abstractsceneparser_p.h2
-rw-r--r--src/render/io/gltfparser.cpp10
-rw-r--r--src/render/io/qattribute.cpp11
-rw-r--r--src/render/io/qattribute_p.h4
-rw-r--r--src/render/io/qbuffer.cpp12
-rw-r--r--src/render/io/qbuffer_p.h3
-rw-r--r--src/render/io/qmeshdata.cpp12
-rw-r--r--src/render/io/qmeshdata_p.h6
-rw-r--r--src/render/render.qrc4
-rw-r--r--src/render/renderlogging.cpp1
-rw-r--r--src/render/renderlogging_p.h1
-rw-r--r--src/render/shaders/es2/pervertexcolor.frag2
-rw-r--r--src/render/shaders/es2/skybox.frag8
-rw-r--r--src/render/shaders/es2/skybox.vert12
-rw-r--r--src/render/shaders/gl3/skybox.frag10
-rw-r--r--src/render/shaders/gl3/skybox.vert14
-rw-r--r--tests/auto/core/core.pro6
-rw-r--r--tests/auto/core/qray3d/qray3d.pro8
-rw-r--r--tests/auto/core/qray3d/tst_qray3d.cpp546
-rw-r--r--tests/auto/core/threadpooler/threadpooler.pro7
-rw-r--r--tests/auto/core/threadpooler/tst_threadpooler.cpp319
-rw-r--r--tests/auto/render/render.pro4
-rw-r--r--tests/auto/render/rendermaterial/rendermaterial.pro9
-rw-r--r--tests/auto/render/rendermaterial/tst_rendermaterial.cpp187
-rw-r--r--tests/auto/render/rendermesh/rendermesh.pro9
-rw-r--r--tests/auto/render/rendermesh/tst_rendermesh.cpp178
-rw-r--r--tests/auto/render/renderrenderpass/tst_renderrenderpass.cpp39
-rw-r--r--tests/auto/shared/util.cpp23
-rw-r--r--tests/auto/shared/util.h23
421 files changed, 13100 insertions, 4483 deletions
diff --git a/LGPL_EXCEPTION.txt b/LGPL_EXCEPTION.txt
deleted file mode 100644
index 7e2e30ff9..000000000
--- a/LGPL_EXCEPTION.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Digia 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 938bb8da9..000000000
--- 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.GPL b/LICENSE.GPL
index 94a9ed024..6dbb032fd 100644
--- a/LICENSE.GPL
+++ b/LICENSE.GPL
@@ -1,674 +1,292 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 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.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, 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
-them if you wish), that you receive source code or can get it if you
+ GNU GENERAL PUBLIC LICENSE
+
+ The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
+ Contact: http://www.qt.io/licensing/
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU General Public License version 2, which is displayed below.
+
+-------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 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.
+
+Preamble
+
+ The licenses for most software are designed to take away your freedom
+to share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software
+--to make sure the software is free for all its users. This General
+Public License applies to most of the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+(Some other Free Software Foundation software is covered by the GNU
+Lesser General Public License instead.) You can apply it to your
+programs, too.
+
+When we speak of free software, we are referring to freedom, 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 or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
+free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone
+to deny you these rights or to ask you to surrender the rights. These
+restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis
+ or for a fee, you must give the recipients all the rights that you
+have. You must make sure that they, too, receive or can get the source
+code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.
+We wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program
+proprietary. To prevent this, we have made it clear that any patent
+must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and
modification follow.
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- 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, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a
+notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+the Program is not restricted, and the output from the Program is
+covered only if its contents constitute a work based on the Program
+(independent of having been made by running the Program). Whether that
+is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's 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 give any other
+recipients of the Program a copy of this License along with the
+Program.
+
+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 Program or any portion of
+it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but does
+ not normally print such an announcement, your work based on the
+ Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+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 Program, 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 Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the
+scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) 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; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your cost
+ of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, 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 executable. However, as a special
+exception, the source code 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.
+
+If distribution of executable or 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 counts as distribution of the
+source code, even though third parties are not compelled to copy the
+source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt otherwise
+to copy, modify, sublicense or distribute the Program 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.
+
+5. 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 Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program 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 to this License.
+
+7. 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 convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU 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
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state 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 program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- 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 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 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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+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 Program at all. For example, if a patent license
+would not permit royalty-free redistribution of the Program 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 Program.
+
+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.
+
+8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program 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.
+
+9. The Free Software Foundation may publish revised and/or new versions
+of the 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 Program
+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 Program does not specify a version
+number of this License, you may choose any version ever published by
+the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, 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
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH
+YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. 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 PROGRAM 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
+PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+END OF TERMS AND CONDITIONS
diff --git a/LICENSE.LGPL b/LICENSE.LGPL
deleted file mode 100644
index 3788d79e2..000000000
--- a/LICENSE.LGPL
+++ /dev/null
@@ -1,514 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
- Contact: http://www.qt-project.org/legal
-
- 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.LGPLv3 b/LICENSE.LGPLv3
new file mode 100644
index 000000000..65c5ca88a
--- /dev/null
+++ b/LICENSE.LGPLv3
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 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.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ 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 that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU 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 as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL
deleted file mode 100644
index c71a330e4..000000000
--- a/LICENSE.PREVIEW.COMMERCIAL
+++ /dev/null
@@ -1,628 +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 Digia USA, Inc. ("Digia"), with its registered office at 32 W.
-Loockerman Street, Suite 201, City of Dover, County of Kent, Delaware 19904,
-U.S.A. 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 Digia. 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 Digia to Licensee in conjunction with this Agreement.
-
-"Party" or "Parties" shall mean Licensee and/or Digia.
-
-
-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 Digia regarding the Licensed Software, Digia
-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 Digia 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 Digia containing Feedback, and
-(iii) sublicense all the foregoing rights to third party licensees and
-customers of Digia 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, Digia grants Licensee the
-right to use the Licensed Software in the manner provided below.
-
-
-4. LICENSES
-
-4.1. Using and Copying
-
-Digia 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
-
-Digia 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. Digia 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, Digia 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, Digia's warranty disclaimer notwithstanding, Digia is held liable to
-Licensee, whether in contract, tort or any other legal theory, based on
-the Licensed Software, Digia's entire liability to Licensee and
-Licensee's exclusive remedy shall be, at Digia'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 Digia all copies of the Licensed Software as originally
-delivered to Licensee. Digia 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 Digia 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 Digia to Licensee
-shall not exceed the total amount Licensee has paid to Digia 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 Digia 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 Digia, which shall not be unreasonably withheld.
-
-10.2 Termination
-
-Digia may terminate the Agreement at any time immediately upon written
-notice by Digia to Licensee if Licensee breaches this Agreement.
-
-Upon termination of this Agreement, Licensee shall return to Digia all
-copies of Licensed Software that were supplied by Digia. 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 Digia 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 Digia 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 Digia 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 Digia 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 Digia Finland Ltd ("Digia"), with its registered office at
-Valimotie 21,FI-00380 Helsinki, Finland and you (either an individual or a
-legal entity) ("Licensee") for the Licensed Software.
-
-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 Digia. 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 Digia to Licensee in conjunction with this Agreement.
-
-"Party" or "Parties" shall mean Licensee and/or Digia.
-
-
-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 Digia regarding the Licensed Software, Digia
-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 Digia 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 Digia containing Feedback, and
-(iii) sublicense all the foregoing rights to third party licensees and
-customers of Digia 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, Digia grants Licensee the
-right to use the Licensed Software in the manner provided below.
-
-
-4. LICENSES
-
-4.1. Using and Copying
-
-Digia 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
-
-Digia 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. Digia 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, Digia 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, Digia's warranty disclaimer notwithstanding, Digia is held liable to
-Licensee, whether in contract, tort or any other legal theory, based on
-the Licensed Software, Digia's entire liability to Licensee and
-Licensee's exclusive remedy shall be, at Digia'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 Digia all copies of the Licensed Software as originally
-delivered to Licensee. Digia 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 Digia 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 Digia to Licensee
-shall not exceed the total amount Licensee has paid to Digia 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 Digia 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 Digia, which shall not be unreasonably withheld.
-
-10.2 Termination
-
-Digia may terminate the Agreement at any time immediately upon written
-notice by Digia to Licensee if Licensee breaches this Agreement.
-
-Upon termination of this Agreement, Licensee shall return to Digia all
-copies of Licensed Software that were supplied by Digia. 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 Digia 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 Digia 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 Digia 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 Digia 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 0b5cc8dd5..284ebb833 100644
--- a/README
+++ b/README
@@ -96,3 +96,11 @@ export to cause the installation rules to place all the files into a sandboxed
install tree, ready for packaging:
INSTALL_ROOT=tmp make install
+
+
+Examples
+========
+
+Some examples require assimp library to parse the content. Go to http://assimp.sourceforge.net/
+and build and install the assimp library. Then configure Qt3D to include assimp and
+run qmake && make.
diff --git a/examples/qt3d/anaglyph-rendering/StereoCamera.qml b/examples/qt3d/anaglyph-rendering/StereoCamera.qml
new file mode 100644
index 000000000..c91d81ddf
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/StereoCamera.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+
+Entity {
+ id: root
+ property real convergence: 2000.0
+ property real eyeSeparation: 35.0
+ property real aspectRatio: _window.width / _window.height
+ property real fieldOfView: 60.0
+ property real nearPlane: 10.0
+ property real farPlane: 10000.0
+
+ property alias viewCenter: eyeLookAt.viewCenter
+ property alias position: eyeLookAt.position
+
+ readonly property real _fov2: Math.tan(fieldOfView * Math.PI / 180 * 0.5)
+ readonly property real top: nearPlane * _fov2
+ readonly property real a: aspectRatio * _fov2 * convergence
+
+ CameraLens {
+ id: leftEyeLens
+ projectionType: CameraLens.FrustumProjection
+ nearPlane : root.nearPlane
+ farPlane : root.farPlane
+ left: -(a - eyeSeparation * 0.5) * nearPlane / convergence
+ right: (a + eyeSeparation * 0.5) * nearPlane / convergence
+ top: root.top
+ bottom: -root.top
+ }
+
+ CameraLens {
+ id: rightEyeLens
+ projectionType: CameraLens.FrustumProjection
+ nearPlane : root.nearPlane
+ farPlane : root.farPlane
+ left: -(a + eyeSeparation * 0.5) * nearPlane / convergence
+ right: (a - eyeSeparation * 0.5) * nearPlane / convergence
+ top: root.top
+ bottom: -root.top
+ }
+
+ Transform {
+ id: eyeTransform
+ LookAt {
+ id: eyeLookAt
+ upVector: Qt.vector3d(0.0, 1.0, 0.0)
+ viewCenter: root.viewCenter
+ position: root.position
+ }
+ }
+
+ property Entity leftCamera: Entity {
+ components: [
+ leftEyeLens,
+ eyeTransform
+ ]
+ }
+
+ property Entity rightCamera: Entity {
+ id: rightCameraEntity
+ components: [
+ rightEyeLens,
+ eyeTransform
+ ]
+ }
+}
diff --git a/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml b/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml
new file mode 100644
index 000000000..46164fc60
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+
+Viewport {
+
+ property alias leftCamera: leftCameraSelector.camera
+ property alias rightCamera: rightCameraSelector.camera
+
+ // ColorMask is reset by default
+ // By default reset to the default if not specified
+ ClearBuffer {
+ buffers: ClearBuffer.ColorDepthBuffer
+ NoDraw {} // We just want to clear the buffers
+ }
+
+ // Draw with left eye
+ CameraSelector {
+ id: leftCameraSelector
+ StateSet {
+ renderStates: [
+ ColorMask { red: true; green: false; blue: false; alpha: false },
+ DepthTest { func: DepthTest.Less }
+ ]
+ }
+ }
+
+ // Draw with right eye
+ ClearBuffer {
+ buffers: ClearBuffer.DepthBuffer
+ CameraSelector {
+ id: rightCameraSelector
+ StateSet {
+ renderStates: [
+ ColorMask { red: false; green: true; blue: true; alpha: false },
+ DepthTest { func: DepthTest.Less }
+ ]
+ }
+ }
+ }
+}
diff --git a/examples/qt3d/anaglyph-rendering/anaglyph-rendering.pro b/examples/qt3d/anaglyph-rendering/anaglyph-rendering.pro
new file mode 100644
index 000000000..2762ec21a
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/anaglyph-rendering.pro
@@ -0,0 +1,20 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+SOURCE += main.cpp
+
+QT += qml quick 3dcore 3drenderer 3dinput 3dquick
+
+OTHER_FILES += *.qml
+
+SOURCES += \
+ main.cpp
+
+RESOURCES += \
+ resources.qrc \
+ ../exampleresources/cubemaps.qrc \
+ ../exampleresources/obj.qrc
+
+DISTFILES += \
+ StereoFrameGraph.qml
diff --git a/examples/qt3d/anaglyph-rendering/main.cpp b/examples/qt3d/anaglyph-rendering/main.cpp
new file mode 100644
index 000000000..4521970f0
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <Qt3DCore/window.h>
+#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
+#include <Qt3DQuick/QQmlAspectEngine>
+
+#include <QGuiApplication>
+#include <QtQml>
+
+int main(int argc, char* argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ Qt3D::Window view;
+ Qt3D::Quick::QQmlAspectEngine engine;
+
+ engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
+ QVariantMap data;
+ data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
+ data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view));
+ engine.aspectEngine()->setData(data);
+ engine.aspectEngine()->initialize();
+ engine.qmlEngine()->rootContext()->setContextProperty("_window", &view);
+ engine.setSource(QUrl("qrc:/main.qml"));
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/qt3d/anaglyph-rendering/main.qml b/examples/qt3d/anaglyph-rendering/main.qml
new file mode 100644
index 000000000..bf1dd211c
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/main.qml
@@ -0,0 +1,227 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+import QtQuick 2.4 as QQ2
+
+Entity {
+ id: root
+
+ components: FrameGraph {
+ StereoFrameGraph {
+ id: stereoFrameGraph
+ leftCamera: stereoCamera.leftCamera
+ rightCamera: stereoCamera.rightCamera
+ }
+ }
+
+ // Camera
+ StereoCamera {
+ id: stereoCamera
+ property real circleRotation: 0
+ readonly property real cameraRadius: obstaclesRepeater.radius - 50
+ readonly property vector3d circlePosition: Qt.vector3d(cameraRadius * Math.cos(circleRotation), 0.0, cameraRadius * Math.sin(circleRotation))
+ readonly property vector3d tan: circlePosition.crossProduct(Qt.vector3d(0, 1, 0).normalized())
+ viewCenter: planeTranslation.translation
+ position: circlePosition.plus(Qt.vector3d(0, 45 * Math.sin(circleRotation * 2), 0)).plus(tan.times(-2))
+
+ QQ2.NumberAnimation {
+ target: stereoCamera
+ property: "circleRotation"
+ from: 0; to: Math.PI * 2
+ duration: 10000
+ loops: QQ2.Animation.Infinite
+ running: true
+ }
+ }
+
+ // Skybox
+ SkyboxEntity {
+ cameraPosition: stereoCamera.position
+ baseName: "qrc:/assets/cubemaps/miramar/miramar"
+ extension: ".webp"
+ }
+
+ // Cylinder
+ Entity {
+ property CylinderMesh cylinder: CylinderMesh {
+ radius: 1
+ length: 3
+ rings: 100
+ slices: 20
+ }
+ property Transform transform: Transform {
+ Scale { id: cylinderScale; scale: 5 }
+ Rotate {
+ id: cylinderRotationTheta
+ angle: 45
+ axis: Qt.vector3d(1, 0, 0)
+ }
+ Rotate {
+ id: cylinderRotationPhi
+ angle: 30
+ axis: Qt.vector3d(1, 0, 0)
+ }
+ }
+ property Material phong: PhongMaterial {}
+
+ QQ2.ParallelAnimation {
+ loops: QQ2.Animation.Infinite
+ running: true
+ QQ2.SequentialAnimation {
+ QQ2.NumberAnimation {
+ target: cylinderScale
+ property: "scale"
+ from: 5; to: 45
+ duration: 2000
+ easing.type: QQ2.Easing.OutInQuad
+ }
+ QQ2.NumberAnimation {
+ target: cylinderScale
+ property: "scale"
+ from: 45; to: 5
+ duration: 2000
+ easing.type: QQ2.Easing.InOutQuart
+ }
+ }
+ QQ2.NumberAnimation {
+ target: cylinderRotationPhi
+ property: "angle"
+ from: 0; to: 360
+ duration: 4000
+ }
+ QQ2.NumberAnimation {
+ target: cylinderRotationTheta
+ property: "angle"
+ from: 0; to: 720
+ duration: 4000
+ }
+ }
+
+ components: [cylinder, transform, phong]
+ }
+
+ // AirPlane
+ Entity {
+ components: [
+ Mesh {
+ source: "assets/obj/toyplane.obj"
+ },
+ Transform {
+ Rotate { // roll
+ id: roll
+ axis : Qt.vector3d(1, 0, 0)
+ angle : 30
+ }
+ Rotate {
+ axis: Qt.vector3d(0, 1, 0)
+ angle: stereoCamera.circleRotation * -2 * 180 / Math.PI + 180
+ }
+ Translate {
+ id: planeTranslation
+ dx: Math.sin(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius
+ dy: 0
+ dz: Math.cos(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius
+ }
+ },
+ PhongMaterial {
+ shininess: 20.0
+ diffuse: "#ba1a02" // Inferno Orange
+ }
+ ]
+
+ QQ2.SequentialAnimation {
+ running: true
+ loops: QQ2.Animation.Infinite
+
+ QQ2.NumberAnimation {
+ target: roll
+ property: "angle"
+ from: 30; to: 45
+ duration: 750
+ }
+ QQ2.NumberAnimation {
+ target: roll
+ property: "angle"
+ from: 45; to: 25
+ duration: 500
+ }
+ QQ2.NumberAnimation {
+ target: roll
+ property: "angle"
+ from: 25; to: 390
+ duration: 800
+ }
+ }
+ }
+
+ // Torus obsctacles
+ NodeInstantiator {
+ id: obstaclesRepeater
+ model: 4
+ readonly property real radius: 130.0;
+ readonly property real det: 1.0 / model
+ delegate: Entity {
+ components: [
+ TorusMesh {
+ radius: 35
+ minorRadius: 5
+ rings: 100
+ slices: 20
+ },
+ Transform {
+ id: transform
+ readonly property real angle: Math.PI * 2.0 * index * obstaclesRepeater.det
+ Rotate {
+ angle: transform.angle * 180 / Math.PI
+ axis: Qt.vector3d(0.0, 1.0, 0.0)
+ }
+ Translate {
+ dx: obstaclesRepeater.radius * Math.cos(transform.angle)
+ dz: obstaclesRepeater.radius * Math.sin(transform.angle)
+ }
+ },
+ PhongMaterial {
+ diffuse: Qt.rgba(Math.abs(Math.cos(transform.angle)), 204 / 255, 75 / 255, 1)
+ specular: "white"
+ shininess: 20.0
+ }
+ ]
+ }
+ }
+}
+
diff --git a/examples/qt3d/anaglyph-rendering/resources.qrc b/examples/qt3d/anaglyph-rendering/resources.qrc
new file mode 100644
index 000000000..e217f138c
--- /dev/null
+++ b/examples/qt3d/anaglyph-rendering/resources.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>StereoCamera.qml</file>
+ <file>StereoFrameGraph.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/assimp-cpp/assimp-cpp.pro b/examples/qt3d/assimp-cpp/assimp-cpp.pro
new file mode 100644
index 000000000..14b2688ca
--- /dev/null
+++ b/examples/qt3d/assimp-cpp/assimp-cpp.pro
@@ -0,0 +1,7 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+QT += widgets 3dcore 3drenderer 3dinput
+
+SOURCES += main.cpp
diff --git a/examples/qt3d/assimp-cpp/main.cpp b/examples/qt3d/assimp-cpp/main.cpp
new file mode 100644
index 000000000..2925626cd
--- /dev/null
+++ b/examples/qt3d/assimp-cpp/main.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFileDialog>
+#include <QApplication>
+
+#include <Qt3DCore/Window>
+#include <Qt3DCore/QCamera>
+#include <Qt3DCore/QEntity>
+#include <Qt3DCore/QAspectEngine>
+#include <Qt3DInput/QInputAspect>
+#include <Qt3DRenderer/QFrameGraph>
+#include <Qt3DRenderer/QSceneLoader>
+#include <Qt3DRenderer/QRenderAspect>
+#include <Qt3DRenderer/QForwardRenderer>
+
+
+int main(int ac, char **av)
+{
+ QApplication app(ac, av);
+
+ Qt3D::Window view;
+
+ Qt3D::QAspectEngine engine;
+ Qt3D::QInputAspect *inputAspect = new Qt3D::QInputAspect();
+ engine.registerAspect(new Qt3D::QRenderAspect());
+ engine.registerAspect(inputAspect);
+ engine.initialize();
+ QVariantMap data;
+ data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
+ data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view));
+ engine.setData(data);
+
+ // Root entity
+ Qt3D::QEntity *sceneRoot = new Qt3D::QEntity();
+
+ // Scene Camera
+ Qt3D::QCamera *basicCamera = new Qt3D::QCamera(sceneRoot);
+ basicCamera->setProjectionType(Qt3D::QCameraLens::PerspectiveProjection);
+ basicCamera->setAspectRatio(view.width() / view.height());
+ basicCamera->setUpVector(QVector3D(0.0f, 1.0f, 0.0f));
+ basicCamera->setViewCenter(QVector3D(0.0f, 3.5f, 0.0f));
+ basicCamera->setPosition(QVector3D(0.0f, 3.5f, 25.0f));
+ basicCamera->setNearPlane(0.001f);
+ basicCamera->setFarPlane(10000.0f);
+ // For camera controls
+ inputAspect->setCamera(basicCamera);
+
+ // Forward Renderer FrameGraph
+ Qt3D::QFrameGraph *frameGraphComponent = new Qt3D::QFrameGraph(sceneRoot);
+ Qt3D::QForwardRenderer *forwardRenderer = new Qt3D::QForwardRenderer();
+ forwardRenderer->setCamera(basicCamera);
+ forwardRenderer->setClearColor(Qt::black);
+ frameGraphComponent->setActiveFrameGraph(forwardRenderer);
+ sceneRoot->addComponent(frameGraphComponent);
+
+ // Scene loader
+ Qt3D::QEntity *sceneLoaderEntity = new Qt3D::QEntity(sceneRoot);
+ Qt3D::QSceneLoader *sceneLoader = new Qt3D::QSceneLoader(sceneLoaderEntity);
+ sceneLoaderEntity->addComponent(sceneLoader);
+
+ QWidget *container = new QWidget();
+ QFileDialog dialog;
+ dialog.setFileMode(QFileDialog::AnyFile);
+ sceneLoader->setSource(dialog.getOpenFileUrl(container, QStringLiteral("Open a scene file")));
+
+ engine.setRootEntity(sceneRoot);
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/qt3d/assimp/assimp.pro b/examples/qt3d/assimp/assimp.pro
index 1db64789d..6742e213a 100644
--- a/examples/qt3d/assimp/assimp.pro
+++ b/examples/qt3d/assimp/assimp.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
SOURCE += main.cpp
@@ -9,7 +11,6 @@ OTHER_FILES += main.qml
SOURCES += \
main.cpp
-include("../exampleresources/exampleresources.pri")
-
RESOURCES += \
- assimp.qrc
+ assimp.qrc \
+ ../exampleresources/test_scene.qrc
diff --git a/examples/qt3d/assimp/main.cpp b/examples/qt3d/assimp/main.cpp
index 7c0858193..d9c0ede88 100644
--- a/examples/qt3d/assimp/main.cpp
+++ b/examples/qt3d/assimp/main.cpp
@@ -34,8 +34,6 @@
**
****************************************************************************/
-#include <exampleresources.h>
-
#include <Qt3DCore/window.h>
#include <Qt3DRenderer/qrenderaspect.h>
#include <Qt3DInput/QInputAspect>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/bigmodel-qml/bigmodel-qml.pro b/examples/qt3d/bigmodel-qml/bigmodel-qml.pro
index 7787217f8..3e5555122 100644
--- a/examples/qt3d/bigmodel-qml/bigmodel-qml.pro
+++ b/examples/qt3d/bigmodel-qml/bigmodel-qml.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
diff --git a/examples/qt3d/bigscene-cpp/bigscene-cpp.pro b/examples/qt3d/bigscene-cpp/bigscene-cpp.pro
index d95efa7a1..9620d485d 100644
--- a/examples/qt3d/bigscene-cpp/bigscene-cpp.pro
+++ b/examples/qt3d/bigscene-cpp/bigscene-cpp.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
diff --git a/examples/qt3d/controls/Logo.qml b/examples/qt3d/controls/Logo.qml
new file mode 100644
index 000000000..7d85ee941
--- /dev/null
+++ b/examples/qt3d/controls/Logo.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+import QtQuick 2.0
+
+Entity {
+ id: sceneRoot
+
+ Camera {
+ id: camera
+ projectionType: CameraLens.PerspectiveProjection
+ fieldOfView: 40
+ aspectRatio: 4/3
+ nearPlane : 0.1
+ farPlane : 1000.0
+ position: Qt.vector3d( 0.0, 0.0, viewCenter_z.value )
+ upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
+ viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
+ }
+
+ Configuration {
+ controlledCamera: camera
+ }
+
+ components: [
+ FrameGraph {
+ activeFrameGraph: ForwardRenderer {
+ camera: camera
+ clearColor: "white"
+ }
+ }
+ ]
+
+ PhongMaterial {
+ id: material
+ ambient: Qt.rgba( color_r.value/255, color_g.value/255, color_b.value/255, 1.0 )
+ diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 )
+ shininess: shining.value
+ }
+
+ Transform {
+ id: logoTransform
+
+ Rotate {
+ id: rotate_x
+ angle: rotation_x.value
+ axis: Qt.vector3d(1, 0, 0)
+ }
+ Rotate {
+ id: rotate_y
+ angle: rotation_y.value
+ axis: Qt.vector3d(0, 1, 0)
+ }
+ Rotate {
+ id: rotate_z
+ angle: rotation_z.value
+ axis: Qt.vector3d(0, 0, 1)
+ }
+ }
+
+ Mesh {
+ id: logoMesh
+ source: "Qt_logo.obj"
+ }
+
+ Entity {
+ id: logoEntity
+ components: [ logoMesh, material, logoTransform ]
+ }
+}
diff --git a/examples/qt3d/controls/Qt_logo.obj b/examples/qt3d/controls/Qt_logo.obj
new file mode 100644
index 000000000..064d9653c
--- /dev/null
+++ b/examples/qt3d/controls/Qt_logo.obj
@@ -0,0 +1,4044 @@
+# Blender v2.73 (sub 0) OBJ File: 'Qt_Logo_cutout2.blend'
+# www.blender.org
+mtllib Qt_Logo_cutout3.mtl
+o Curve.003_path34
+v 0.138516 0.000000 1.118892
+v 0.141317 0.000000 1.119183
+v 0.144144 0.000000 1.119445
+v 0.146999 0.000000 1.119678
+v 0.149884 0.000000 1.119884
+v 0.152797 0.000000 1.120063
+v 0.155742 0.000000 1.120215
+v 0.158718 0.000000 1.120341
+v 0.161726 0.000000 1.120443
+v 0.164767 0.000000 1.120521
+v 0.167842 0.000000 1.120576
+v 0.170952 0.000000 1.120608
+v 0.174098 0.000000 1.120619
+v 0.178149 0.000000 1.120551
+v 0.182248 0.000000 1.120363
+v 0.186394 0.000000 1.120079
+v 0.190587 0.000000 1.119724
+v 0.194828 0.000000 1.119320
+v 0.199116 0.000000 1.118892
+v 0.203452 0.000000 1.118464
+v 0.207836 0.000000 1.118061
+v 0.212268 0.000000 1.117705
+v 0.216748 0.000000 1.117421
+v 0.221277 0.000000 1.117233
+v 0.225853 0.000000 1.117165
+v 0.224591 0.000000 1.117165
+v 0.221022 0.000000 1.117165
+v 0.215477 0.000000 1.117165
+v 0.208284 0.000000 1.117165
+v 0.199774 0.000000 1.117165
+v 0.190275 0.000000 1.117165
+v 0.180118 0.000000 1.117165
+v 0.169632 0.000000 1.117165
+v 0.159145 0.000000 1.117165
+v 0.148988 0.000000 1.117165
+v 0.139489 0.000000 1.117165
+v 0.130979 0.000000 1.117165
+v 0.131158 0.000000 1.117179
+v 0.131333 0.000000 1.117217
+v 0.131506 0.000000 1.117275
+v 0.131677 0.000000 1.117349
+v 0.131847 0.000000 1.117434
+v 0.132015 0.000000 1.117526
+v 0.132185 0.000000 1.117621
+v 0.132354 0.000000 1.117714
+v 0.132525 0.000000 1.117801
+v 0.132698 0.000000 1.117877
+v 0.132873 0.000000 1.117939
+v 0.133052 0.000000 1.117981
+v 0.133501 0.000000 1.118049
+v 0.133954 0.000000 1.118123
+v 0.134409 0.000000 1.118203
+v 0.134866 0.000000 1.118287
+v 0.135325 0.000000 1.118374
+v 0.135784 0.000000 1.118460
+v 0.136243 0.000000 1.118546
+v 0.136702 0.000000 1.118628
+v 0.137159 0.000000 1.118706
+v 0.137614 0.000000 1.118777
+v 0.138067 0.000000 1.118839
+vn 0.000000 1.000000 0.000000
+usemtl SVGMat.004
+s off
+f 38//1 36//1 37//1
+f 38//1 35//1 36//1
+f 38//1 34//1 35//1
+f 38//1 33//1 34//1
+f 38//1 32//1 33//1
+f 38//1 31//1 32//1
+f 38//1 30//1 31//1
+f 38//1 29//1 30//1
+f 38//1 28//1 29//1
+f 38//1 27//1 28//1
+f 38//1 26//1 27//1
+f 38//1 25//1 26//1
+f 38//1 24//1 25//1
+f 39//1 24//1 38//1
+f 40//1 24//1 39//1
+f 40//1 23//1 24//1
+f 41//1 23//1 40//1
+f 42//1 23//1 41//1
+f 42//1 22//1 23//1
+f 43//1 22//1 42//1
+f 44//1 22//1 43//1
+f 45//1 22//1 44//1
+f 45//1 21//1 22//1
+f 46//1 21//1 45//1
+f 47//1 21//1 46//1
+f 48//1 21//1 47//1
+f 49//1 21//1 48//1
+f 50//1 21//1 49//1
+f 51//1 21//1 50//1
+f 51//1 20//1 21//1
+f 52//1 20//1 51//1
+f 53//1 20//1 52//1
+f 54//1 20//1 53//1
+f 55//1 20//1 54//1
+f 56//1 20//1 55//1
+f 56//1 19//1 20//1
+f 57//1 19//1 56//1
+f 58//1 19//1 57//1
+f 59//1 19//1 58//1
+f 60//1 19//1 59//1
+f 1//1 19//1 60//1
+f 2//1 19//1 1//1
+f 2//1 18//1 19//1
+f 3//1 18//1 2//1
+f 3//1 17//1 18//1
+f 4//1 17//1 3//1
+f 5//1 17//1 4//1
+f 5//1 16//1 17//1
+f 6//1 16//1 5//1
+f 7//1 16//1 6//1
+f 7//1 15//1 16//1
+f 8//1 15//1 7//1
+f 9//1 15//1 8//1
+f 9//1 14//1 15//1
+f 10//1 14//1 9//1
+f 11//1 14//1 10//1
+f 11//1 13//1 14//1
+f 12//1 13//1 11//1
+o Curve.001_Mesh
+v 1.604945 -0.182387 1.374372
+v 1.624641 -0.182387 1.318420
+v 1.624641 0.182387 1.318420
+v 1.604945 0.182387 1.374372
+v 1.580433 -0.182387 1.427071
+v 1.580433 0.182387 1.427071
+v -0.847648 -0.182387 0.720939
+v -0.822076 -0.182387 0.768036
+v -0.794690 -0.182387 0.811855
+v -0.765502 -0.182387 0.852402
+v -0.734525 -0.182387 0.889683
+v -0.701772 -0.182387 0.923703
+v -0.667254 -0.182387 0.954468
+v -0.630985 -0.182387 0.981984
+v -0.592977 -0.182387 1.006257
+v -0.553243 -0.182387 1.027292
+v -0.511795 -0.182387 1.045095
+v -0.468646 -0.182387 1.059673
+v -0.423807 -0.182387 1.071030
+v -0.413388 -0.182387 1.117919
+v -0.402043 -0.182387 1.162206
+v -0.389771 -0.182387 1.203891
+v -0.376574 -0.182387 1.242972
+v -0.362454 -0.182387 1.279447
+v -0.347411 -0.182387 1.313315
+v -0.331446 -0.182387 1.344574
+v -0.314560 -0.182387 1.373223
+v -0.296754 -0.182387 1.399261
+v -0.278030 -0.182387 1.422685
+v -0.258387 -0.182387 1.443494
+v -0.237828 -0.182387 1.461687
+v -0.221488 -0.182387 1.473931
+v -0.204283 -0.182387 1.485104
+v -0.186216 -0.182387 1.495208
+v -0.167291 -0.182387 1.504244
+v -0.147509 -0.182387 1.512212
+v -0.126874 -0.182387 1.519115
+v -0.105388 -0.182387 1.524953
+v -0.083055 -0.182387 1.529726
+v -0.059876 -0.182387 1.533437
+v -0.035856 -0.182387 1.536087
+v -0.010996 -0.182387 1.537676
+v 0.014699 -0.182387 1.538205
+v 1.304468 -0.182387 1.652686
+v -1.543393 -0.182387 2.132013
+v -1.543393 -0.182387 1.802300
+v -1.543393 -0.182387 1.434298
+v -1.543393 -0.182387 1.040770
+v -1.543393 -0.182387 0.634479
+v -1.543393 -0.182387 0.228187
+v -1.543393 -0.182387 -0.165341
+v -1.543393 -0.182387 -0.533343
+v -1.543393 -0.182387 -0.863055
+v -1.543393 -0.182387 -1.141716
+v -1.543393 -0.182387 -1.356561
+v -1.543393 -0.182387 -1.494827
+v -1.543393 -0.182387 -1.543752
+v -1.538053 -0.182387 -1.625037
+v -1.522528 -0.182387 -1.701349
+v -1.497558 -0.182387 -1.772077
+v -1.463884 -0.182387 -1.836608
+v -1.422248 -0.182387 -1.894331
+v -1.373390 -0.182387 -1.944634
+v -1.318050 -0.182387 -1.986905
+v -1.256971 -0.182387 -2.020532
+v -1.190891 -0.182387 -2.044903
+v -1.120553 -0.182387 -2.059406
+v -1.046697 -0.182387 -2.063429
+v -0.970064 -0.182387 -2.056361
+v -0.935175 -0.182387 -2.050632
+v -0.836574 -0.182387 -2.034443
+v -0.043291 -0.182387 -1.245338
+v -0.096284 -0.182387 -1.261074
+v -0.151985 -0.182387 -1.273272
+v -0.210411 -0.182387 -1.281925
+v -0.219049 -0.182387 -1.282895
+v -0.227645 -0.182387 -1.283780
+v -0.236197 -0.182387 -1.284580
+v -0.244706 -0.182387 -1.285296
+v -0.253173 -0.182387 -1.285927
+v -0.261597 -0.182387 -1.286474
+v -0.269979 -0.182387 -1.286936
+v -0.278318 -0.182387 -1.287314
+v -0.286614 -0.182387 -1.287608
+v -0.294869 -0.182387 -1.287817
+v -0.303082 -0.182387 -1.287943
+v -0.311252 -0.182387 -1.287985
+v -0.361180 -0.182387 -1.286331
+v -0.409360 -0.182387 -1.281363
+v -0.455776 -0.182387 -1.273071
+v -0.500415 -0.182387 -1.261445
+v -0.543260 -0.182387 -1.246475
+v -0.584298 -0.182387 -1.228152
+v -0.623514 -0.182387 -1.206466
+v -0.660894 -0.182387 -1.181408
+v -0.696421 -0.182387 -1.152968
+v -0.730083 -0.182387 -1.121135
+v -0.761863 -0.182387 -1.085901
+v -0.791747 -0.182387 -1.047255
+v -0.824643 -0.182387 -0.997153
+v -0.854719 -0.182387 -0.942465
+v -0.881969 -0.182387 -0.883201
+v -0.906384 -0.182387 -0.819374
+v -0.927957 -0.182387 -0.750994
+v -0.946680 -0.182387 -0.678073
+v -0.962543 -0.182387 -0.600624
+v -0.975540 -0.182387 -0.518656
+v -0.985663 -0.182387 -0.432183
+v -0.992904 -0.182387 -0.341214
+v -0.997254 -0.182387 -0.245763
+v -0.998706 -0.182387 -0.145841
+v -0.997645 -0.182387 -0.052952
+v -0.994467 -0.182387 0.036208
+v -0.989178 -0.182387 0.121631
+v -0.981784 -0.182387 0.203307
+v -0.972293 -0.182387 0.281231
+v -0.960710 -0.182387 0.355393
+v -0.947042 -0.182387 0.425786
+v -0.931295 -0.182387 0.492402
+v -0.913475 -0.182387 0.555233
+v -0.893590 -0.182387 0.614272
+v -0.871646 -0.182387 0.669510
+v -0.016169 -0.182387 1.061018
+v -0.020694 -0.182387 1.039381
+v 0.021314 -0.182387 1.023258
+v 0.061404 -0.182387 1.004298
+v 0.099588 -0.182387 0.982504
+v 0.135875 -0.182387 0.957879
+v 0.170275 -0.182387 0.930427
+v 0.202799 -0.182387 0.900153
+v 0.233457 -0.182387 0.867059
+v 0.262260 -0.182387 0.831150
+v 0.289217 -0.182387 0.792428
+v 0.314338 -0.182387 0.750899
+v 0.337635 -0.182387 0.706565
+v 0.359117 -0.182387 0.659430
+v 0.378490 -0.182387 0.610163
+v 0.396163 -0.182387 0.558060
+v 0.412138 -0.182387 0.503110
+v 0.426419 -0.182387 0.445305
+v 0.439008 -0.182387 0.384638
+v 0.449909 -0.182387 0.321098
+v 0.459124 -0.182387 0.254677
+v 0.466657 -0.182387 0.185367
+v 0.472510 -0.182387 0.113159
+v 0.476688 -0.182387 0.038043
+v 0.479192 -0.182387 -0.039988
+v 0.480026 -0.182387 -0.120943
+v 0.478892 -0.182387 -0.209136
+v 0.475486 -0.182387 -0.293762
+v 0.469801 -0.182387 -0.374832
+v 0.461829 -0.182387 -0.452356
+v 0.451565 -0.182387 -0.526344
+v 0.438999 -0.182387 -0.596807
+v 0.424126 -0.182387 -0.663755
+v 0.406938 -0.182387 -0.727197
+v 0.387429 -0.182387 -0.787144
+v 0.365590 -0.182387 -0.843607
+v 0.341416 -0.182387 -0.896596
+v 0.314899 -0.182387 -0.946121
+v 0.285433 -0.182387 -0.993262
+v 0.253428 -0.182387 -1.036951
+v 0.218864 -0.182387 -1.077179
+v 0.181722 -0.182387 -1.113937
+v 0.141985 -0.182387 -1.147215
+v 0.099634 -0.182387 -1.177004
+v 0.054650 -0.182387 -1.203293
+v 0.007014 -0.182387 -1.226074
+v -0.683363 -0.182387 -2.009288
+v -0.484644 -0.182387 -1.976661
+v -0.249518 -0.182387 -1.938057
+v 0.012913 -0.182387 -1.894969
+v 0.293547 -0.182387 -1.848894
+v 0.583283 -0.182387 -1.801322
+v 0.873018 -0.182387 -1.753752
+v 1.153652 -0.182387 -1.707676
+v 1.416083 -0.182387 -1.664589
+v 1.651209 -0.182387 -1.625984
+v 1.651209 -0.182387 -1.378124
+v 1.651209 -0.182387 -1.101481
+v 1.290285 -0.182387 0.655661
+v 1.290285 -0.182387 0.632343
+v 1.290285 -0.182387 0.611451
+v 1.276783 -0.182387 0.618072
+v 1.263028 -0.182387 0.624200
+v 1.249080 -0.182387 0.629828
+v 1.235000 -0.182387 0.634956
+v 1.220848 -0.182387 0.639580
+v 1.206685 -0.182387 0.643697
+v 1.192572 -0.182387 0.647303
+v 1.178569 -0.182387 0.650396
+v 1.164738 -0.182387 0.652973
+v 1.151138 -0.182387 0.655030
+v 1.137830 -0.182387 0.656565
+v 1.124875 -0.182387 0.657574
+v 1.124058 -0.182387 0.657620
+v 1.123296 -0.182387 0.657663
+v 1.122580 -0.182387 0.657703
+v 1.121898 -0.182387 0.657740
+v 1.121240 -0.182387 0.657773
+v 1.120596 -0.182387 0.657802
+v 1.119957 -0.182387 0.657828
+v 1.119311 -0.182387 0.657849
+v 1.118648 -0.182387 0.657866
+v 1.117959 -0.182387 0.657879
+v 1.117232 -0.182387 0.657886
+v 1.116459 -0.182387 0.657889
+v 1.108379 -0.182387 0.657669
+v 1.100785 -0.182387 0.657008
+v 1.093652 -0.182387 0.655907
+v 1.086952 -0.182387 0.654363
+v 1.080662 -0.182387 0.652376
+v 1.074757 -0.182387 0.649945
+v 1.069211 -0.182387 0.647069
+v 1.063999 -0.182387 0.643748
+v 1.059095 -0.182387 0.639980
+v 1.054475 -0.182387 0.635764
+v 1.050114 -0.182387 0.631101
+v 1.045986 -0.182387 0.625988
+v 1.041773 -0.182387 0.619568
+v 1.038066 -0.182387 0.611957
+v 1.034837 -0.182387 0.603155
+v 1.032062 -0.182387 0.593160
+v 1.029713 -0.182387 0.581973
+v 1.027764 -0.182387 0.569593
+v 1.026187 -0.182387 0.556018
+v 1.024956 -0.182387 0.541250
+v 1.024046 -0.182387 0.525286
+v 1.023428 -0.182387 0.508127
+v 1.023077 -0.182387 0.489772
+v 1.022966 -0.182387 0.470221
+v 1.022966 -0.182387 0.457888
+v 1.022966 -0.182387 0.423033
+v 1.022966 -0.182387 0.368875
+v 1.022966 -0.182387 0.298629
+v 1.022966 -0.182387 0.215515
+v 1.022966 -0.182387 0.122748
+v 1.022966 -0.182387 0.023547
+v 1.022966 -0.182387 -0.078872
+v 1.022966 -0.182387 -0.181290
+v 1.022966 -0.182387 -0.280492
+v 1.022966 -0.182387 -0.373259
+v 1.022966 -0.182387 -0.456373
+v 1.263622 -0.182387 -0.444411
+v 1.263622 -0.182387 -0.697952
+v 1.022966 -0.182387 -0.716351
+v 1.022966 -0.182387 -1.120478
+v 0.788843 -0.182387 -1.145252
+v 0.693403 -0.182387 -0.739209
+v 0.541780 -0.182387 -0.750073
+v 0.541780 -0.182387 -0.478384
+v 0.648683 -0.182387 -0.472763
+v 0.648683 -0.182387 0.554368
+v 0.649385 -0.182387 0.587227
+v 0.651461 -0.182387 0.618561
+v 0.654864 -0.182387 0.648369
+v 0.659545 -0.182387 0.676652
+v 0.665458 -0.182387 0.703407
+v 0.672554 -0.182387 0.728633
+v 0.680787 -0.182387 0.752329
+v 0.690109 -0.182387 0.774494
+v 0.700473 -0.182387 0.795126
+v 0.711830 -0.182387 0.814225
+v 0.724135 -0.182387 0.831789
+v 0.737338 -0.182387 0.847817
+v 0.749557 -0.182387 0.860433
+v 0.762797 -0.182387 0.871939
+v 0.777034 -0.182387 0.882338
+v 0.792240 -0.182387 0.891632
+v 0.808392 -0.182387 0.899824
+v 0.825461 -0.182387 0.906916
+v 0.843423 -0.182387 0.912910
+v 0.862251 -0.182387 0.917809
+v 0.881920 -0.182387 0.921615
+v 0.902404 -0.182387 0.924331
+v 0.923676 -0.182387 0.925959
+v 0.945710 -0.182387 0.926501
+v 1.651209 -0.182387 0.996532
+v 1.651209 -0.182387 1.100473
+v 1.651209 -0.182387 1.137252
+v 1.648136 -0.182387 1.199239
+v 1.639159 -0.182387 1.259835
+v 1.551467 -0.182387 1.475895
+v 1.518411 -0.182387 1.520223
+v 1.481627 -0.182387 1.559434
+v 1.441478 -0.182387 1.592906
+v 1.398327 -0.182387 1.620021
+v 1.352536 -0.182387 1.640154
+v 0.022624 -0.182387 1.538157
+v 0.030633 -0.182387 1.538012
+v 0.038723 -0.182387 1.537771
+v 0.046893 -0.182387 1.537434
+v 0.055141 -0.182387 1.537002
+v 0.063467 -0.182387 1.536474
+v 0.071868 -0.182387 1.535852
+v 0.080342 -0.182387 1.535135
+v 0.088889 -0.182387 1.534324
+v 0.097506 -0.182387 1.533419
+v 0.106191 -0.182387 1.532421
+v 0.114944 -0.182387 1.531329
+v 0.116533 -0.182387 1.531121
+v 0.121026 -0.182387 1.530532
+v 0.128007 -0.182387 1.529619
+v 0.137061 -0.182387 1.528433
+v 0.147774 -0.182387 1.527030
+v 0.159731 -0.182387 1.525465
+v 0.172517 -0.182387 1.523791
+v 0.185719 -0.182387 1.522063
+v 0.198920 -0.182387 1.520334
+v 0.211706 -0.182387 1.518660
+v 0.223663 -0.182387 1.517095
+v 0.234377 -0.182387 1.515692
+v 0.234377 -0.182387 1.253171
+v 0.228073 -0.182387 1.253593
+v 0.222476 -0.182387 1.253840
+v 0.217488 -0.182387 1.253938
+v 0.213012 -0.182387 1.253913
+v 0.208952 -0.182387 1.253793
+v 0.205209 -0.182387 1.253603
+v 0.201688 -0.182387 1.253370
+v 0.198291 -0.182387 1.253120
+v 0.194921 -0.182387 1.252880
+v 0.191482 -0.182387 1.252676
+v 0.187874 -0.182387 1.252534
+v 0.184003 -0.182387 1.252481
+v 0.183991 -0.182387 1.252481
+v 0.183957 -0.182387 1.252481
+v 0.183904 -0.182387 1.252481
+v 0.183835 -0.182387 1.252481
+v 0.183753 -0.182387 1.252481
+v 0.183662 -0.182387 1.252481
+v 0.183564 -0.182387 1.252481
+v 0.183463 -0.182387 1.252481
+v 0.183363 -0.182387 1.252481
+v 0.183265 -0.182387 1.252481
+v 0.183174 -0.182387 1.252481
+v 0.183092 -0.182387 1.252481
+v 0.179940 -0.182387 1.252501
+v 0.176810 -0.182387 1.252554
+v 0.173706 -0.182387 1.252628
+v 0.170627 -0.182387 1.252712
+v 0.167575 -0.182387 1.252794
+v 0.164552 -0.182387 1.252862
+v 0.161558 -0.182387 1.252904
+v 0.158594 -0.182387 1.252909
+v 0.155663 -0.182387 1.252865
+v 0.152764 -0.182387 1.252761
+v 0.149900 -0.182387 1.252584
+v 0.147071 -0.182387 1.252324
+v 0.146610 -0.182387 1.252296
+v 0.146139 -0.182387 1.252301
+v 0.145661 -0.182387 1.252334
+v 0.145176 -0.182387 1.252385
+v 0.144688 -0.182387 1.252450
+v 0.144198 -0.182387 1.252520
+v 0.143707 -0.182387 1.252589
+v 0.143219 -0.182387 1.252649
+v 0.142734 -0.182387 1.252694
+v 0.142256 -0.182387 1.252718
+v 0.141785 -0.182387 1.252711
+v 0.141324 -0.182387 1.252669
+v 0.141137 -0.182387 1.252646
+v 0.140954 -0.182387 1.252639
+v 0.140774 -0.182387 1.252644
+v 0.140597 -0.182387 1.252657
+v 0.140422 -0.182387 1.252678
+v 0.140248 -0.182387 1.252701
+v 0.140076 -0.182387 1.252724
+v 0.139905 -0.182387 1.252744
+v 0.139734 -0.182387 1.252757
+v 0.139563 -0.182387 1.252762
+v 0.139392 -0.182387 1.252755
+v 0.139220 -0.182387 1.252732
+v 0.130740 -0.182387 1.251386
+v 0.122558 -0.182387 1.249797
+v 0.114677 -0.182387 1.247959
+v 0.107101 -0.182387 1.245871
+v 0.099831 -0.182387 1.243528
+v 0.092870 -0.182387 1.240926
+v 0.086222 -0.182387 1.238063
+v 0.079888 -0.182387 1.234935
+v 0.073872 -0.182387 1.231538
+v 0.068176 -0.182387 1.227869
+v 0.062803 -0.182387 1.223925
+v 0.057755 -0.182387 1.219701
+v 0.049214 -0.182387 1.211217
+v 0.041036 -0.182387 1.201556
+v 0.033220 -0.182387 1.190714
+v 0.025769 -0.182387 1.178687
+v 0.018682 -0.182387 1.165471
+v 0.011959 -0.182387 1.151064
+v 0.005602 -0.182387 1.135461
+v -0.000390 -0.182387 1.118659
+v -0.006016 -0.182387 1.100653
+v -0.011276 -0.182387 1.081441
+v 1.639159 0.182387 1.259835
+v -0.016169 0.182387 1.061018
+v -0.011276 0.182387 1.081441
+v -0.006016 0.182387 1.100653
+v -0.000390 0.182387 1.118659
+v 0.005602 0.182387 1.135461
+v 0.011959 0.182387 1.151064
+v 0.018682 0.182387 1.165471
+v 0.025769 0.182387 1.178687
+v 0.033220 0.182387 1.190714
+v 0.041036 0.182387 1.201556
+v 0.049214 0.182387 1.211217
+v 0.057755 0.182387 1.219701
+v 0.062803 0.182387 1.223925
+v 0.068176 0.182387 1.227869
+v 0.073872 0.182387 1.231538
+v 0.079888 0.182387 1.234935
+v 0.086222 0.182387 1.238063
+v 0.092870 0.182387 1.240926
+v 0.099831 0.182387 1.243528
+v 0.107101 0.182387 1.245871
+v 0.114677 0.182387 1.247959
+v 0.122558 0.182387 1.249797
+v 0.130740 0.182387 1.251386
+v 0.139220 0.182387 1.252732
+v 0.139392 0.182387 1.252755
+v 0.139563 0.182387 1.252762
+v 0.139734 0.182387 1.252757
+v 0.139905 0.182387 1.252744
+v 0.140076 0.182387 1.252724
+v 0.140248 0.182387 1.252701
+v 0.140422 0.182387 1.252678
+v 0.140597 0.182387 1.252657
+v 0.140774 0.182387 1.252644
+v 0.140954 0.182387 1.252639
+v 0.141137 0.182387 1.252646
+v 0.141324 0.182387 1.252669
+v 0.141785 0.182387 1.252711
+v 0.142256 0.182387 1.252718
+v 0.142734 0.182387 1.252694
+v 0.143219 0.182387 1.252649
+v 0.143707 0.182387 1.252589
+v 0.144198 0.182387 1.252520
+v 0.144688 0.182387 1.252450
+v 0.145176 0.182387 1.252385
+v 0.145661 0.182387 1.252334
+v 0.146139 0.182387 1.252301
+v 0.146610 0.182387 1.252296
+v 0.147071 0.182387 1.252324
+v 0.149900 0.182387 1.252584
+v 0.152764 0.182387 1.252761
+v 0.155663 0.182387 1.252865
+v 0.158594 0.182387 1.252909
+v 0.161558 0.182387 1.252904
+v 0.164552 0.182387 1.252862
+v 0.167575 0.182387 1.252794
+v 0.170627 0.182387 1.252712
+v 0.173706 0.182387 1.252628
+v 0.176810 0.182387 1.252554
+v 0.179940 0.182387 1.252501
+v 0.183092 0.182387 1.252481
+v 0.183174 0.182387 1.252481
+v 0.183265 0.182387 1.252481
+v 0.183363 0.182387 1.252481
+v 0.183463 0.182387 1.252481
+v 0.183564 0.182387 1.252481
+v 0.183662 0.182387 1.252481
+v 0.183753 0.182387 1.252481
+v 0.183835 0.182387 1.252481
+v 0.183904 0.182387 1.252481
+v 0.183957 0.182387 1.252481
+v 0.183991 0.182387 1.252481
+v 0.184003 0.182387 1.252481
+v 0.187874 0.182387 1.252534
+v 0.191482 0.182387 1.252676
+v 0.194921 0.182387 1.252880
+v 0.198291 0.182387 1.253120
+v 0.201688 0.182387 1.253370
+v 0.205209 0.182387 1.253603
+v 0.208952 0.182387 1.253793
+v 0.213012 0.182387 1.253913
+v 0.217488 0.182387 1.253938
+v 0.222476 0.182387 1.253840
+v 0.228073 0.182387 1.253593
+v 0.234377 0.182387 1.253171
+v 0.234377 0.182387 1.515692
+v 0.223663 0.182387 1.517095
+v 0.211706 0.182387 1.518660
+v 0.198920 0.182387 1.520334
+v 0.185719 0.182387 1.522063
+v 0.172517 0.182387 1.523791
+v 0.159731 0.182387 1.525465
+v 0.147774 0.182387 1.527030
+v 0.137061 0.182387 1.528433
+v 0.128007 0.182387 1.529619
+v 0.121026 0.182387 1.530532
+v 0.116533 0.182387 1.531121
+v 0.114944 0.182387 1.531329
+v 0.106191 0.182387 1.532421
+v 0.097506 0.182387 1.533419
+v 0.088889 0.182387 1.534324
+v 0.080342 0.182387 1.535135
+v 0.071868 0.182387 1.535852
+v 0.063467 0.182387 1.536474
+v 0.055141 0.182387 1.537002
+v 0.046893 0.182387 1.537434
+v 0.038723 0.182387 1.537771
+v 0.030633 0.182387 1.538012
+v 0.022624 0.182387 1.538157
+v 0.014699 0.182387 1.538205
+v 1.304468 0.182387 1.652686
+v 1.352536 0.182387 1.640154
+v 1.398327 0.182387 1.620021
+v 1.441478 0.182387 1.592906
+v 1.481627 0.182387 1.559434
+v 1.518411 0.182387 1.520223
+v 1.551467 0.182387 1.475895
+v 1.648136 0.182387 1.199239
+v 1.651209 0.182387 1.137252
+v 1.651209 0.182387 1.100473
+v 1.651209 0.182387 0.996532
+v 0.945710 0.182387 0.926501
+v 0.923676 0.182387 0.925959
+v 0.902404 0.182387 0.924331
+v 0.881920 0.182387 0.921615
+v 0.862251 0.182387 0.917809
+v 0.843423 0.182387 0.912910
+v 0.825461 0.182387 0.906916
+v 0.808392 0.182387 0.899824
+v 0.792240 0.182387 0.891632
+v 0.777034 0.182387 0.882338
+v 0.762797 0.182387 0.871939
+v 0.749557 0.182387 0.860433
+v 0.737338 0.182387 0.847817
+v 0.724135 0.182387 0.831789
+v 0.711830 0.182387 0.814225
+v 0.700473 0.182387 0.795126
+v 0.690109 0.182387 0.774494
+v 0.680787 0.182387 0.752329
+v 0.672554 0.182387 0.728633
+v 0.665458 0.182387 0.703407
+v 0.659545 0.182387 0.676652
+v 0.654864 0.182387 0.648369
+v 0.651461 0.182387 0.618561
+v 0.649385 0.182387 0.587227
+v 0.648683 0.182387 0.554368
+v 0.648683 0.182387 -0.472763
+v 0.541780 0.182387 -0.478384
+v 0.541780 0.182387 -0.750073
+v 0.693403 0.182387 -0.739209
+v 0.788843 0.182387 -1.145252
+v 1.022966 0.182387 -1.120478
+v 1.022966 0.182387 -0.716351
+v 1.263622 0.182387 -0.697952
+v 1.263622 0.182387 -0.444411
+v 1.022966 0.182387 -0.456373
+v 1.022966 0.182387 -0.373259
+v 1.022966 0.182387 -0.280492
+v 1.022966 0.182387 -0.181290
+v 1.022966 0.182387 -0.078872
+v 1.022966 0.182387 0.023547
+v 1.022966 0.182387 0.122748
+v 1.022966 0.182387 0.215515
+v 1.022966 0.182387 0.298629
+v 1.022966 0.182387 0.368875
+v 1.022966 0.182387 0.423033
+v 1.022966 0.182387 0.457888
+v 1.022966 0.182387 0.470221
+v 1.023077 0.182387 0.489772
+v 1.023428 0.182387 0.508127
+v 1.024046 0.182387 0.525286
+v 1.024956 0.182387 0.541250
+v 1.026187 0.182387 0.556018
+v 1.027764 0.182387 0.569593
+v 1.029713 0.182387 0.581973
+v 1.032062 0.182387 0.593160
+v 1.034837 0.182387 0.603155
+v 1.038066 0.182387 0.611957
+v 1.041773 0.182387 0.619568
+v 1.045986 0.182387 0.625988
+v 1.050114 0.182387 0.631101
+v 1.054475 0.182387 0.635764
+v 1.059095 0.182387 0.639980
+v 1.063999 0.182387 0.643748
+v 1.069211 0.182387 0.647069
+v 1.074757 0.182387 0.649945
+v 1.080662 0.182387 0.652376
+v 1.086952 0.182387 0.654363
+v 1.093652 0.182387 0.655907
+v 1.100785 0.182387 0.657008
+v 1.108379 0.182387 0.657669
+v 1.116459 0.182387 0.657889
+v 1.117232 0.182387 0.657886
+v 1.117959 0.182387 0.657879
+v 1.118648 0.182387 0.657866
+v 1.119311 0.182387 0.657849
+v 1.119957 0.182387 0.657828
+v 1.120596 0.182387 0.657802
+v 1.121240 0.182387 0.657773
+v 1.121898 0.182387 0.657740
+v 1.122580 0.182387 0.657703
+v 1.123296 0.182387 0.657663
+v 1.124058 0.182387 0.657620
+v 1.124875 0.182387 0.657574
+v 1.137830 0.182387 0.656565
+v 1.151138 0.182387 0.655030
+v 1.164738 0.182387 0.652973
+v 1.178569 0.182387 0.650396
+v 1.192572 0.182387 0.647303
+v 1.206685 0.182387 0.643697
+v 1.220848 0.182387 0.639580
+v 1.235000 0.182387 0.634956
+v 1.249080 0.182387 0.629828
+v 1.263028 0.182387 0.624200
+v 1.276783 0.182387 0.618072
+v 1.290285 0.182387 0.611451
+v 1.290285 0.182387 0.632343
+v 1.290285 0.182387 0.655661
+v 1.651209 0.182387 -1.101481
+v 1.651209 0.182387 -1.378124
+v 1.651209 0.182387 -1.625984
+v 1.416083 0.182387 -1.664589
+v 1.153652 0.182387 -1.707676
+v 0.873018 0.182387 -1.753752
+v 0.583283 0.182387 -1.801322
+v 0.293547 0.182387 -1.848894
+v 0.012913 0.182387 -1.894969
+v -0.249518 0.182387 -1.938057
+v -0.484644 0.182387 -1.976661
+v -0.683363 0.182387 -2.009288
+v -0.836574 0.182387 -2.034443
+v 0.007014 0.182387 -1.226074
+v 0.054650 0.182387 -1.203293
+v 0.099634 0.182387 -1.177004
+v 0.141985 0.182387 -1.147215
+v 0.181722 0.182387 -1.113937
+v 0.218864 0.182387 -1.077179
+v 0.253428 0.182387 -1.036951
+v 0.285433 0.182387 -0.993262
+v 0.314899 0.182387 -0.946121
+v 0.341416 0.182387 -0.896596
+v 0.365590 0.182387 -0.843607
+v 0.387429 0.182387 -0.787144
+v 0.406938 0.182387 -0.727197
+v 0.424126 0.182387 -0.663755
+v 0.438999 0.182387 -0.596807
+v 0.451565 0.182387 -0.526344
+v 0.461829 0.182387 -0.452356
+v 0.469801 0.182387 -0.374832
+v 0.475486 0.182387 -0.293762
+v 0.478892 0.182387 -0.209136
+v 0.480026 0.182387 -0.120943
+v 0.479192 0.182387 -0.039988
+v 0.476688 0.182387 0.038043
+v 0.472510 0.182387 0.113159
+v 0.466657 0.182387 0.185367
+v 0.459124 0.182387 0.254677
+v 0.449909 0.182387 0.321098
+v 0.439008 0.182387 0.384638
+v 0.426419 0.182387 0.445305
+v 0.412138 0.182387 0.503110
+v 0.396163 0.182387 0.558060
+v 0.378490 0.182387 0.610163
+v 0.359117 0.182387 0.659430
+v 0.337635 0.182387 0.706565
+v 0.314338 0.182387 0.750899
+v 0.289217 0.182387 0.792428
+v 0.262260 0.182387 0.831150
+v 0.233457 0.182387 0.867059
+v 0.202799 0.182387 0.900153
+v 0.170275 0.182387 0.930427
+v 0.135875 0.182387 0.957879
+v 0.099588 0.182387 0.982504
+v 0.061404 0.182387 1.004298
+v 0.021314 0.182387 1.023258
+v -0.020694 0.182387 1.039381
+v -0.847648 0.182387 0.720939
+v -0.871646 0.182387 0.669510
+v -0.893590 0.182387 0.614272
+v -0.913475 0.182387 0.555233
+v -0.931295 0.182387 0.492402
+v -0.947042 0.182387 0.425786
+v -0.960710 0.182387 0.355393
+v -0.972293 0.182387 0.281231
+v -0.981784 0.182387 0.203307
+v -0.989178 0.182387 0.121631
+v -0.994467 0.182387 0.036208
+v -0.997645 0.182387 -0.052952
+v -0.998706 0.182387 -0.145841
+v -0.997254 0.182387 -0.245763
+v -0.992904 0.182387 -0.341214
+v -0.985663 0.182387 -0.432183
+v -0.975540 0.182387 -0.518656
+v -0.962543 0.182387 -0.600624
+v -0.946680 0.182387 -0.678073
+v -0.927957 0.182387 -0.750994
+v -0.906384 0.182387 -0.819374
+v -0.881969 0.182387 -0.883201
+v -0.854719 0.182387 -0.942465
+v -0.824643 0.182387 -0.997153
+v -0.791747 0.182387 -1.047255
+v -0.761863 0.182387 -1.085901
+v -0.730083 0.182387 -1.121135
+v -0.696421 0.182387 -1.152968
+v -0.660894 0.182387 -1.181408
+v -0.623514 0.182387 -1.206466
+v -0.584298 0.182387 -1.228152
+v -0.543260 0.182387 -1.246475
+v -0.500415 0.182387 -1.261445
+v -0.455776 0.182387 -1.273071
+v -0.409360 0.182387 -1.281363
+v -0.361180 0.182387 -1.286331
+v -0.311252 0.182387 -1.287985
+v -0.303082 0.182387 -1.287943
+v -0.294869 0.182387 -1.287817
+v -0.286614 0.182387 -1.287608
+v -0.278318 0.182387 -1.287314
+v -0.269979 0.182387 -1.286936
+v -0.261597 0.182387 -1.286474
+v -0.253173 0.182387 -1.285927
+v -0.244706 0.182387 -1.285296
+v -0.236197 0.182387 -1.284580
+v -0.227645 0.182387 -1.283780
+v -0.219049 0.182387 -1.282895
+v -0.210411 0.182387 -1.281925
+v -0.151985 0.182387 -1.273272
+v -0.096284 0.182387 -1.261074
+v -0.043291 0.182387 -1.245338
+v -0.935175 0.182387 -2.050632
+v -0.970064 0.182387 -2.056361
+v -1.046697 0.182387 -2.063429
+v -1.120553 0.182387 -2.059406
+v -1.190891 0.182387 -2.044903
+v -1.256971 0.182387 -2.020532
+v -1.318050 0.182387 -1.986905
+v -1.373390 0.182387 -1.944634
+v -1.422248 0.182387 -1.894331
+v -1.463884 0.182387 -1.836608
+v -1.497558 0.182387 -1.772077
+v -1.522528 0.182387 -1.701349
+v -1.538053 0.182387 -1.625037
+v -1.543393 0.182387 -1.543752
+v -1.543393 0.182387 -1.494827
+v -1.543393 0.182387 -1.356561
+v -1.543393 0.182387 -1.141716
+v -1.543393 0.182387 -0.863055
+v -1.543393 0.182387 -0.533343
+v -1.543393 0.182387 -0.165341
+v -1.543393 0.182387 0.228187
+v -1.543393 0.182387 0.634479
+v -1.543393 0.182387 1.040770
+v -1.543393 0.182387 1.434298
+v -1.543393 0.182387 1.802300
+v -1.543393 0.182387 2.132013
+v -0.010996 0.182387 1.537676
+v -0.035856 0.182387 1.536087
+v -0.059876 0.182387 1.533437
+v -0.083055 0.182387 1.529726
+v -0.105388 0.182387 1.524953
+v -0.126874 0.182387 1.519115
+v -0.147509 0.182387 1.512212
+v -0.167291 0.182387 1.504244
+v -0.186216 0.182387 1.495208
+v -0.204283 0.182387 1.485104
+v -0.221488 0.182387 1.473931
+v -0.237828 0.182387 1.461687
+v -0.258387 0.182387 1.443494
+v -0.278030 0.182387 1.422685
+v -0.296754 0.182387 1.399261
+v -0.314560 0.182387 1.373223
+v -0.331446 0.182387 1.344574
+v -0.347411 0.182387 1.313315
+v -0.362454 0.182387 1.279447
+v -0.376574 0.182387 1.242972
+v -0.389771 0.182387 1.203891
+v -0.402043 0.182387 1.162206
+v -0.413388 0.182387 1.117919
+v -0.423807 0.182387 1.071030
+v -0.468646 0.182387 1.059673
+v -0.511795 0.182387 1.045095
+v -0.553243 0.182387 1.027292
+v -0.592977 0.182387 1.006257
+v -0.630985 0.182387 0.981984
+v -0.667254 0.182387 0.954468
+v -0.701772 0.182387 0.923703
+v -0.734525 0.182387 0.889683
+v -0.765502 0.182387 0.852402
+v -0.794690 0.182387 0.811855
+v -0.822076 0.182387 0.768036
+v 0.973284 -0.182387 0.925691
+v 0.976827 -0.182387 0.925481
+v 0.980386 -0.182387 0.925247
+v 0.983958 -0.182387 0.924990
+v 0.987542 -0.182387 0.924711
+v 1.012237 -0.182387 0.922225
+v 1.036888 -0.182387 0.918973
+v 1.061538 -0.182387 0.914956
+v 1.086227 -0.182387 0.910174
+v 1.111001 -0.182387 0.904626
+v 1.135899 -0.182387 0.898313
+v 1.160964 -0.182387 0.891235
+v 1.186239 -0.182387 0.883391
+v 1.211767 -0.182387 0.874782
+v 1.237589 -0.182387 0.865408
+v 1.263747 -0.182387 0.855268
+v 1.290285 -0.182387 0.844363
+v 1.290285 -0.182387 0.841263
+v 1.290285 -0.182387 0.832502
+v 1.290285 -0.182387 0.818888
+v 1.290285 -0.182387 0.801231
+v 1.290285 -0.182387 0.780339
+v 1.290285 -0.182387 0.757021
+v 1.290285 -0.182387 0.732085
+v 1.290285 -0.182387 0.706341
+v 1.290285 -0.182387 0.680596
+v 1.651209 -0.182387 -0.805648
+v 1.651209 -0.182387 -0.500221
+v 1.651209 -0.182387 -0.194794
+v 1.651209 -0.182387 0.101039
+v 1.651209 -0.182387 0.377682
+v 1.651209 -0.182387 0.625542
+v 1.651209 -0.182387 0.835023
+v 0.949063 -0.182387 0.926488
+v 0.952447 -0.182387 0.926449
+v 0.955859 -0.182387 0.926385
+v 0.959298 -0.182387 0.926295
+v 0.962762 -0.182387 0.926181
+v 0.966249 -0.182387 0.926042
+v 0.969757 -0.182387 0.925878
+v 1.651209 0.182387 -0.805648
+v 1.651209 0.182387 -0.500221
+v 1.651209 0.182387 -0.194794
+v 1.651209 0.182387 0.101039
+v 1.651209 0.182387 0.377682
+v 1.651209 0.182387 0.625542
+v 1.651209 0.182387 0.835023
+v 0.973284 0.182387 0.925691
+v 0.969757 0.182387 0.925878
+v 0.966249 0.182387 0.926042
+v 0.962762 0.182387 0.926181
+v 0.959298 0.182387 0.926295
+v 0.955859 0.182387 0.926385
+v 0.952447 0.182387 0.926449
+v 0.949063 0.182387 0.926488
+v 1.290285 0.182387 0.680596
+v 1.290285 0.182387 0.706341
+v 1.290285 0.182387 0.732085
+v 1.290285 0.182387 0.757021
+v 1.290285 0.182387 0.780339
+v 1.290285 0.182387 0.801231
+v 1.290285 0.182387 0.818888
+v 1.290285 0.182387 0.832502
+v 1.290285 0.182387 0.841263
+v 1.290285 0.182387 0.844363
+v 1.263747 0.182387 0.855268
+v 1.237589 0.182387 0.865408
+v 1.211767 0.182387 0.874782
+v 1.186239 0.182387 0.883391
+v 1.160964 0.182387 0.891235
+v 1.135899 0.182387 0.898313
+v 1.111001 0.182387 0.904626
+v 1.086227 0.182387 0.910174
+v 1.061538 0.182387 0.914956
+v 1.036888 0.182387 0.918973
+v 1.012237 0.182387 0.922225
+v 0.987542 0.182387 0.924711
+v 0.983958 0.182387 0.924990
+v 0.980386 0.182387 0.925247
+v 0.976827 0.182387 0.925481
+v -0.420633 -0.182387 0.609377
+v -0.432883 -0.182387 0.577418
+v -0.444850 -0.182387 0.540341
+v -0.455769 -0.182387 0.499161
+v -0.465641 -0.182387 0.453883
+v -0.474468 -0.182387 0.404507
+v -0.482251 -0.182387 0.351039
+v -0.488992 -0.182387 0.293479
+v -0.494692 -0.182387 0.231832
+v -0.499352 -0.182387 0.166100
+v -0.502975 -0.182387 0.096287
+v -0.505560 -0.182387 0.022395
+v -0.507111 -0.182387 -0.055574
+v -0.507627 -0.182387 -0.137615
+v -0.507096 -0.182387 -0.222158
+v -0.505505 -0.182387 -0.301775
+v -0.502855 -0.182387 -0.376463
+v -0.499150 -0.182387 -0.446221
+v -0.494391 -0.182387 -0.511044
+v -0.488580 -0.182387 -0.570931
+v -0.481720 -0.182387 -0.625878
+v -0.473812 -0.182387 -0.675884
+v -0.464860 -0.182387 -0.720945
+v -0.454864 -0.182387 -0.761058
+v -0.443828 -0.182387 -0.796221
+v -0.431753 -0.182387 -0.826431
+v -0.419682 -0.182387 -0.850800
+v -0.406773 -0.182387 -0.873046
+v -0.393025 -0.182387 -0.893167
+v -0.378438 -0.182387 -0.911165
+v -0.363012 -0.182387 -0.927042
+v -0.346747 -0.182387 -0.940799
+v -0.329644 -0.182387 -0.952436
+v -0.311702 -0.182387 -0.961955
+v -0.292921 -0.182387 -0.969356
+v -0.273302 -0.182387 -0.974642
+v -0.252844 -0.182387 -0.977813
+v -0.231547 -0.182387 -0.978869
+v -0.229829 -0.182387 -0.978862
+v -0.228101 -0.182387 -0.978840
+v -0.226363 -0.182387 -0.978804
+v -0.224615 -0.182387 -0.978755
+v -0.222860 -0.182387 -0.978691
+v -0.221097 -0.182387 -0.978614
+v -0.219327 -0.182387 -0.978523
+v -0.217552 -0.182387 -0.978418
+v -0.215772 -0.182387 -0.978299
+v -0.213988 -0.182387 -0.978168
+v -0.212200 -0.182387 -0.978023
+v -0.210411 -0.182387 -0.977865
+v -0.187470 -0.182387 -0.974624
+v -0.165518 -0.182387 -0.969019
+v -0.144552 -0.182387 -0.961056
+v -0.124571 -0.182387 -0.950738
+v -0.105573 -0.182387 -0.938070
+v -0.087555 -0.182387 -0.923059
+v -0.070516 -0.182387 -0.905708
+v -0.054454 -0.182387 -0.886023
+v -0.039367 -0.182387 -0.864009
+v -0.025253 -0.182387 -0.839671
+v -0.012110 -0.182387 -0.813014
+v 0.000065 -0.182387 -0.784043
+v 0.011252 -0.182387 -0.752004
+v 0.021450 -0.182387 -0.715855
+v 0.030663 -0.182387 -0.675595
+v 0.038893 -0.182387 -0.631220
+v 0.046143 -0.182387 -0.582729
+v 0.052417 -0.182387 -0.530117
+v 0.057717 -0.182387 -0.473383
+v 0.062046 -0.182387 -0.412525
+v 0.065408 -0.182387 -0.347538
+v 0.067806 -0.182387 -0.278422
+v 0.069243 -0.182387 -0.205172
+v 0.069721 -0.182387 -0.127787
+v 0.069238 -0.182387 -0.041715
+v 0.067786 -0.182387 0.039494
+v 0.065364 -0.182387 0.115843
+v 0.061970 -0.182387 0.187334
+v 0.057600 -0.182387 0.253967
+v 0.052252 -0.182387 0.315745
+v 0.045924 -0.182387 0.372668
+v 0.038614 -0.182387 0.424741
+v 0.030318 -0.182387 0.471963
+v 0.021036 -0.182387 0.514336
+v 0.010764 -0.182387 0.551863
+v -0.000501 -0.182387 0.584545
+v -0.012809 -0.182387 0.613863
+v -0.026056 -0.182387 0.640763
+v -0.040242 -0.182387 0.665243
+v -0.055369 -0.182387 0.687302
+v -0.071438 -0.182387 0.706941
+v -0.088450 -0.182387 0.724158
+v -0.106407 -0.182387 0.738952
+v -0.125311 -0.182387 0.751321
+v -0.145162 -0.182387 0.761267
+v -0.165961 -0.182387 0.768786
+v -0.187710 -0.182387 0.773880
+v -0.210411 -0.182387 0.776546
+v -0.211446 -0.182387 0.776607
+v -0.212477 -0.182387 0.776665
+v -0.213505 -0.182387 0.776720
+v -0.214531 -0.182387 0.776771
+v -0.215555 -0.182387 0.776818
+v -0.216578 -0.182387 0.776860
+v -0.217601 -0.182387 0.776896
+v -0.218623 -0.182387 0.776927
+v -0.219646 -0.182387 0.776952
+v -0.220669 -0.182387 0.776970
+v -0.221695 -0.182387 0.776981
+v -0.222722 -0.182387 0.776985
+v -0.245400 -0.182387 0.775607
+v -0.267158 -0.182387 0.771469
+v -0.287989 -0.182387 0.764568
+v -0.307887 -0.182387 0.754899
+v -0.326849 -0.182387 0.742459
+v -0.344867 -0.182387 0.727242
+v -0.361938 -0.182387 0.709246
+v -0.378055 -0.182387 0.688465
+v -0.393214 -0.182387 0.664896
+v -0.407408 -0.182387 0.638535
+v -0.474468 0.182387 0.404507
+v -0.465641 0.182387 0.453883
+v -0.455769 0.182387 0.499161
+v -0.444850 0.182387 0.540341
+v -0.432883 0.182387 0.577418
+v -0.420633 0.182387 0.609377
+v -0.407408 0.182387 0.638535
+v -0.393214 0.182387 0.664896
+v -0.378055 0.182387 0.688465
+v -0.361938 0.182387 0.709246
+v -0.344867 0.182387 0.727242
+v -0.326849 0.182387 0.742459
+v -0.307887 0.182387 0.754899
+v -0.287989 0.182387 0.764568
+v -0.267158 0.182387 0.771469
+v -0.245400 0.182387 0.775607
+v -0.222722 0.182387 0.776985
+v -0.221695 0.182387 0.776981
+v -0.220669 0.182387 0.776970
+v -0.219646 0.182387 0.776952
+v -0.218623 0.182387 0.776927
+v -0.217601 0.182387 0.776896
+v -0.216578 0.182387 0.776860
+v -0.215555 0.182387 0.776818
+v -0.214531 0.182387 0.776771
+v -0.213505 0.182387 0.776720
+v -0.212477 0.182387 0.776665
+v -0.211446 0.182387 0.776607
+v -0.210411 0.182387 0.776546
+v -0.187710 0.182387 0.773880
+v -0.165961 0.182387 0.768786
+v -0.145162 0.182387 0.761267
+v -0.125311 0.182387 0.751321
+v -0.106407 0.182387 0.738952
+v -0.088450 0.182387 0.724158
+v -0.071438 0.182387 0.706941
+v -0.055369 0.182387 0.687302
+v -0.040242 0.182387 0.665243
+v -0.026056 0.182387 0.640763
+v -0.012809 0.182387 0.613863
+v -0.000501 0.182387 0.584545
+v 0.010764 0.182387 0.551863
+v 0.021036 0.182387 0.514336
+v 0.030318 0.182387 0.471963
+v 0.038614 0.182387 0.424741
+v 0.045924 0.182387 0.372668
+v 0.052252 0.182387 0.315745
+v 0.057600 0.182387 0.253967
+v 0.061970 0.182387 0.187334
+v 0.065364 0.182387 0.115843
+v 0.067786 0.182387 0.039494
+v 0.069238 0.182387 -0.041715
+v 0.069721 0.182387 -0.127787
+v 0.069243 0.182387 -0.205172
+v 0.067806 0.182387 -0.278422
+v 0.065408 0.182387 -0.347538
+v 0.062046 0.182387 -0.412525
+v 0.057717 0.182387 -0.473383
+v 0.052417 0.182387 -0.530117
+v 0.046143 0.182387 -0.582729
+v 0.038893 0.182387 -0.631220
+v 0.030663 0.182387 -0.675595
+v 0.021450 0.182387 -0.715855
+v 0.011252 0.182387 -0.752004
+v 0.000065 0.182387 -0.784043
+v -0.012110 0.182387 -0.813014
+v -0.025253 0.182387 -0.839671
+v -0.039367 0.182387 -0.864009
+v -0.054454 0.182387 -0.886023
+v -0.070516 0.182387 -0.905708
+v -0.087555 0.182387 -0.923059
+v -0.105573 0.182387 -0.938070
+v -0.124571 0.182387 -0.950738
+v -0.144552 0.182387 -0.961056
+v -0.165518 0.182387 -0.969019
+v -0.187470 0.182387 -0.974624
+v -0.210411 0.182387 -0.977865
+v -0.212200 0.182387 -0.978023
+v -0.213988 0.182387 -0.978168
+v -0.215772 0.182387 -0.978299
+v -0.217552 0.182387 -0.978418
+v -0.219327 0.182387 -0.978523
+v -0.221097 0.182387 -0.978614
+v -0.222860 0.182387 -0.978691
+v -0.224615 0.182387 -0.978755
+v -0.226363 0.182387 -0.978804
+v -0.228101 0.182387 -0.978840
+v -0.229829 0.182387 -0.978862
+v -0.231547 0.182387 -0.978869
+v -0.252844 0.182387 -0.977813
+v -0.273302 0.182387 -0.974642
+v -0.292921 0.182387 -0.969356
+v -0.311702 0.182387 -0.961955
+v -0.329644 0.182387 -0.952436
+v -0.346747 0.182387 -0.940799
+v -0.363012 0.182387 -0.927042
+v -0.378438 0.182387 -0.911165
+v -0.393025 0.182387 -0.893167
+v -0.406773 0.182387 -0.873046
+v -0.419682 0.182387 -0.850800
+v -0.431753 0.182387 -0.826431
+v -0.443828 0.182387 -0.796221
+v -0.454864 0.182387 -0.761058
+v -0.464860 0.182387 -0.720945
+v -0.473812 0.182387 -0.675884
+v -0.481720 0.182387 -0.625878
+v -0.488580 0.182387 -0.570931
+v -0.494391 0.182387 -0.511044
+v -0.499150 0.182387 -0.446221
+v -0.502855 0.182387 -0.376463
+v -0.505505 0.182387 -0.301775
+v -0.507096 0.182387 -0.222158
+v -0.507627 0.182387 -0.137615
+v -0.507111 0.182387 -0.055574
+v -0.505560 0.182387 0.022395
+v -0.502975 0.182387 0.096287
+v -0.499352 0.182387 0.166100
+v -0.494692 0.182387 0.231832
+v -0.488992 0.182387 0.293479
+v -0.482251 0.182387 0.351039
+vn 0.943300 0.000000 0.332000
+vn 0.906700 0.000000 0.421700
+vn 0.000000 -1.000000 0.000000
+vn 0.970600 0.000000 0.240500
+vn 0.000000 1.000000 0.000000
+vn 0.860000 0.000000 0.510200
+vn 0.050400 0.000000 0.998700
+vn 0.045800 0.000000 0.999000
+vn 0.040200 0.000000 0.999200
+vn 0.032900 0.000000 0.999500
+vn 0.025500 0.000000 0.999700
+vn 0.018000 0.000000 0.999800
+vn 0.010500 0.000000 0.999900
+vn 0.003200 0.000000 1.000000
+vn -0.027200 0.000000 0.999600
+vn -0.086600 0.000000 0.996200
+vn -0.152600 0.000000 0.988300
+vn -0.224600 0.000000 0.974500
+vn -0.301200 0.000000 0.953500
+vn -0.380600 0.000000 0.924700
+vn -0.460300 0.000000 0.887700
+vn -0.537400 0.000000 0.843300
+vn -0.609300 0.000000 0.792900
+vn -0.674000 0.000000 0.738700
+vn -0.730400 0.000000 0.683000
+vn -0.778100 0.000000 0.628200
+vn -0.836000 0.000000 0.548700
+vn -0.899000 0.000000 0.437900
+vn -0.938900 0.000000 0.344300
+vn -0.963500 0.000000 0.267600
+vn -0.978700 0.000000 0.205500
+vn -0.987800 0.000000 0.155500
+vn -0.993300 0.000000 0.115400
+vn -0.996500 0.000000 0.083000
+vn -0.998400 0.000000 0.057000
+vn -0.999400 0.000000 0.036000
+vn -0.999800 0.000000 0.019100
+vn -1.000000 0.000000 0.005700
+vn -1.000000 0.000000 0.000000
+vn 0.049600 0.000000 -0.998800
+vn -0.076200 0.000000 0.997100
+vn -0.105200 0.000000 0.994400
+vn 0.973500 0.000000 0.228800
+vn -0.071500 0.000000 0.997400
+vn 1.000000 0.000000 0.000000
+vn 0.052500 0.000000 -0.998600
+vn 0.999800 0.000000 -0.021400
+vn 0.997800 0.000000 -0.066100
+vn 0.993500 0.000000 -0.113400
+vn 0.986600 0.000000 -0.163300
+vn 0.976400 0.000000 -0.215800
+vn 0.962600 0.000000 -0.270800
+vn 0.944600 0.000000 -0.328200
+vn 0.921800 0.000000 -0.387700
+vn 0.893600 0.000000 -0.448900
+vn 0.859500 0.000000 -0.511100
+vn 0.819000 0.000000 -0.573800
+vn 0.771800 0.000000 -0.635800
+vn 0.718300 0.000000 -0.695700
+vn 0.656000 0.000000 -0.754800
+vn 0.589800 0.000000 -0.807500
+vn 0.521500 0.000000 -0.853200
+vn 0.452300 0.000000 -0.891800
+vn 0.383700 0.000000 -0.923500
+vn 0.316600 0.000000 -0.948600
+vn 0.251800 0.000000 -0.967800
+vn 0.190000 0.000000 -0.981800
+vn 0.131400 0.000000 -0.991300
+vn 0.076300 0.000000 -0.997100
+vn 0.024600 0.000000 -0.999700
+vn 0.998800 0.000000 0.049500
+vn 0.989200 0.000000 0.146500
+vn 0.801600 0.000000 0.597800
+vn 0.729300 0.000000 0.684200
+vn 0.640400 0.000000 0.768100
+vn 0.532000 0.000000 0.846700
+vn 0.402500 0.000000 0.915400
+vn 0.252300 0.000000 0.967700
+vn 0.166000 0.000000 0.986100
+vn -0.997800 0.000000 -0.065600
+vn -0.979900 0.000000 -0.199400
+vn -0.943000 0.000000 -0.332900
+vn -0.886600 0.000000 -0.462600
+vn -0.811000 0.000000 -0.585000
+vn -0.717300 0.000000 -0.696700
+vn -0.607000 0.000000 -0.794700
+vn -0.482300 0.000000 -0.876000
+vn -0.346000 0.000000 -0.938200
+vn -0.201900 0.000000 -0.979400
+vn -0.054400 0.000000 -0.998500
+vn 0.091800 0.000000 -0.995800
+vn 0.162000 0.000000 -0.986800
+vn 0.440300 0.000000 0.897800
+vn 0.406900 0.000000 0.913500
+vn 0.374200 0.000000 0.927300
+vn 0.342200 0.000000 0.939600
+vn 0.310600 0.000000 0.950600
+vn 0.279100 0.000000 0.960300
+vn 0.247600 0.000000 0.968900
+vn 0.215700 0.000000 0.976500
+vn 0.183100 0.000000 0.983100
+vn 0.149600 0.000000 0.988700
+vn 0.114600 0.000000 0.993400
+vn 0.077700 0.000000 0.997000
+vn 0.056000 0.000000 0.998400
+vn 0.056400 0.000000 0.998400
+vn 0.055800 0.000000 0.998400
+vn 0.053400 0.000000 0.998600
+vn -0.003900 0.000000 -1.000000
+vn -0.053000 0.000000 -0.998600
+vn -0.059300 0.000000 -0.998200
+vn -0.065600 0.000000 -0.997800
+vn -0.071700 0.000000 -0.997400
+vn -0.077700 0.000000 -0.997000
+vn -0.100200 0.000000 -0.995000
+vn -0.130800 0.000000 -0.991400
+vn -0.160800 0.000000 -0.987000
+vn -0.190200 0.000000 -0.981800
+vn -0.218500 0.000000 -0.975800
+vn -0.245800 0.000000 -0.969300
+vn -0.271800 0.000000 -0.962400
+vn -0.296400 0.000000 -0.955100
+vn -0.319600 0.000000 -0.947600
+vn -0.341200 0.000000 -0.940000
+vn -0.361400 0.000000 -0.932400
+vn -0.380100 0.000000 -0.924900
+vn -0.011400 0.000000 -0.999900
+vn -0.018900 0.000000 -0.999800
+vn -0.026000 0.000000 -0.999700
+vn -0.033000 0.000000 -0.999500
+vn -0.039800 0.000000 -0.999200
+vn -0.046500 0.000000 -0.998900
+vn -0.970800 0.000000 -0.239800
+vn -0.979100 0.000000 -0.203200
+vn -0.960200 0.000000 -0.279200
+vn -0.985600 0.000000 -0.169100
+vn -0.947000 0.000000 -0.321200
+vn -0.990500 0.000000 -0.137400
+vn -0.930600 0.000000 -0.366000
+vn -0.994100 0.000000 -0.108100
+vn -0.910000 0.000000 -0.414700
+vn -0.996700 0.000000 -0.080800
+vn -0.885200 0.000000 -0.465200
+vn -0.998500 0.000000 -0.055500
+vn -0.855600 0.000000 -0.517600
+vn -0.999500 0.000000 -0.032100
+vn -0.820700 0.000000 -0.571400
+vn -0.999900 0.000000 -0.010300
+vn -0.780100 0.000000 -0.625700
+vn -0.999900 0.000000 0.012900
+vn -0.733600 0.000000 -0.679600
+vn -0.999200 0.000000 0.040200
+vn -0.681300 0.000000 -0.732000
+vn -0.997600 0.000000 0.070000
+vn -0.623700 0.000000 -0.781600
+vn -0.994800 0.000000 0.102300
+vn -0.561500 0.000000 -0.827500
+vn -0.990500 0.000000 0.137400
+vn -0.495700 0.000000 -0.868500
+vn -0.984500 0.000000 0.175600
+vn -0.427500 0.000000 -0.904000
+vn -0.976200 0.000000 0.216900
+vn -0.358300 0.000000 -0.933600
+vn -0.965200 0.000000 0.261500
+vn -0.978800 0.000000 0.204700
+vn -0.950900 0.000000 0.309500
+vn -0.972500 0.000000 0.233000
+vn -0.932700 0.000000 0.360700
+vn -0.964500 0.000000 0.264000
+vn -0.909800 0.000000 0.415100
+vn -0.954500 0.000000 0.298200
+vn -0.881600 0.000000 0.472000
+vn -0.941900 0.000000 0.335900
+vn -0.848000 0.000000 0.530000
+vn -0.926100 0.000000 0.377300
+vn -0.806700 0.000000 0.591000
+vn -0.906200 0.000000 0.422800
+vn -0.758500 0.000000 0.651700
+vn -0.881300 0.000000 0.472600
+vn -0.703400 0.000000 0.710800
+vn -0.850100 0.000000 0.526700
+vn -0.642000 0.000000 0.766700
+vn -0.811200 0.000000 0.584700
+vn -0.575300 0.000000 0.817900
+vn -0.763200 0.000000 0.646100
+vn -0.504600 0.000000 0.863400
+vn -0.704700 0.000000 0.709500
+vn -0.431400 0.000000 0.902100
+vn -0.641800 0.000000 0.766900
+vn -0.357600 0.000000 0.933900
+vn -0.591800 0.000000 0.806100
+vn -0.284700 0.000000 0.958600
+vn -0.541500 0.000000 0.840700
+vn -0.213900 0.000000 0.976800
+vn -0.491700 0.000000 0.870800
+vn -0.146500 0.000000 0.989200
+vn -0.442800 0.000000 0.896600
+vn -0.111600 0.000000 0.993800
+vn -0.395500 0.000000 0.918400
+vn -0.102400 0.000000 0.994700
+vn -0.350100 0.000000 0.936700
+vn -0.093200 0.000000 0.995600
+vn -0.306800 0.000000 0.951800
+vn -0.083800 0.000000 0.996500
+vn -0.265800 0.000000 0.964000
+vn -0.074400 0.000000 0.997200
+vn -0.227100 0.000000 0.973900
+vn -0.064800 0.000000 0.997900
+vn -0.190700 0.000000 0.981600
+vn -0.055100 0.000000 0.998500
+vn -0.156700 0.000000 0.987600
+vn -0.045300 0.000000 0.999000
+vn -0.131700 0.000000 0.991300
+vn -0.035400 0.000000 0.999400
+vn -0.042900 0.000000 0.999100
+vn -0.025400 0.000000 0.999700
+vn 0.028700 0.000000 0.999600
+vn -0.015300 0.000000 0.999900
+vn 0.079200 0.000000 0.996900
+vn -0.005100 0.000000 1.000000
+vn 0.116500 0.000000 0.993200
+vn 0.033100 0.000000 0.999500
+vn 0.131800 0.000000 0.991300
+vn 0.102600 0.000000 0.994700
+vn 0.132600 0.000000 0.991200
+vn 0.175900 0.000000 0.984400
+vn 0.113000 0.000000 0.993600
+vn 0.252000 0.000000 0.967700
+vn 0.078000 0.000000 0.997000
+vn 0.329800 0.000000 0.944000
+vn 0.024500 0.000000 0.999700
+vn 0.407700 0.000000 0.913100
+vn -0.040100 0.000000 0.999200
+vn 0.483900 0.000000 0.875100
+vn -0.120000 0.000000 0.992800
+vn 0.556800 0.000000 0.830600
+vn -0.091700 0.000000 0.995800
+vn 0.624900 0.000000 0.780700
+vn -0.013900 0.000000 0.999900
+vn 0.687100 0.000000 0.726600
+vn 0.048400 0.000000 0.998800
+vn 0.742600 0.000000 0.669800
+vn 0.093000 0.000000 0.995700
+vn 0.791100 0.000000 0.611700
+vn 0.123200 0.000000 0.992400
+vn 0.835900 0.000000 0.548800
+vn 0.138300 0.000000 0.990400
+vn 0.876200 0.000000 0.481900
+vn 0.141500 0.000000 0.989900
+vn 0.908600 0.000000 0.417800
+vn 0.131300 0.000000 0.991300
+vn 0.934000 0.000000 0.357300
+vn 0.106300 0.000000 0.994300
+vn 0.953700 0.000000 0.300900
+vn 0.067100 0.000000 0.997700
+vn 0.968600 0.000000 0.248700
+vn 0.012100 0.000000 0.999900
+vn 0.979700 0.000000 0.200700
+vn -0.060500 0.000000 0.998200
+vn 0.987700 0.000000 0.156600
+vn 0.993200 0.000000 0.116300
+vn -0.061600 0.000000 0.998100
+vn 0.996800 0.000000 0.079300
+vn -0.035800 0.000000 0.999400
+vn 0.999000 0.000000 0.045500
+vn -0.015000 0.000000 0.999900
+vn 0.999900 0.000000 0.014500
+vn 0.001700 0.000000 1.000000
+vn 0.999900 0.000000 -0.011400
+vn 0.014100 0.000000 0.999900
+vn 0.999400 0.000000 -0.035600
+vn 0.022400 0.000000 0.999700
+vn 0.998100 0.000000 -0.061800
+vn 0.026800 0.000000 0.999600
+vn 0.995900 0.000000 -0.090200
+vn 0.027200 0.000000 0.999600
+vn 0.992700 0.000000 -0.120900
+vn 0.023800 0.000000 0.999700
+vn 0.988000 0.000000 -0.154300
+vn 0.017000 0.000000 0.999900
+vn 0.981700 0.000000 -0.190600
+vn 0.006500 0.000000 1.000000
+vn 0.973200 0.000000 -0.230000
+vn 0.000000 0.000000 1.000000
+vn 0.962100 0.000000 -0.272800
+vn 0.947700 0.000000 -0.319200
+vn 0.929300 0.000000 -0.369200
+vn 0.906200 0.000000 -0.422800
+vn 0.878800 0.000000 -0.477200
+vn 0.848000 0.000000 -0.530000
+vn 0.811600 0.000000 -0.584200
+vn 0.769100 0.000000 -0.639100
+vn 0.720400 0.000000 -0.693600
+vn 0.665400 0.000000 -0.746500
+vn 0.604400 0.000000 -0.796700
+vn 0.538200 0.000000 -0.842800
+vn -0.013800 0.000000 0.999900
+vn 0.467900 0.000000 -0.883800
+vn -0.039400 0.000000 0.999200
+vn 0.394700 0.000000 -0.918800
+vn -0.059200 0.000000 0.998200
+vn 0.320100 0.000000 -0.947400
+vn -0.071000 0.000000 0.997500
+vn 0.245500 0.000000 -0.969400
+vn -0.073400 0.000000 0.997300
+vn 0.976200 0.000000 -0.216900
+vn -0.066100 0.000000 0.997800
+vn 0.968700 0.000000 -0.248200
+vn -0.050700 0.000000 0.998700
+vn 0.959300 0.000000 -0.282400
+vn -0.029600 0.000000 0.999600
+vn 0.947400 0.000000 -0.319900
+vn -0.005500 0.000000 1.000000
+vn 0.932600 0.000000 -0.361000
+vn 0.019700 0.000000 0.999800
+vn 0.913900 0.000000 -0.405900
+vn 0.044000 0.000000 0.999000
+vn 0.890600 0.000000 -0.454800
+vn 0.066700 0.000000 0.997800
+vn 0.861500 0.000000 -0.507800
+vn 0.825400 0.000000 -0.564500
+vn -0.129800 0.000000 -0.991500
+vn 0.781100 0.000000 -0.624400
+vn 0.727200 0.000000 -0.686400
+vn 0.662700 0.000000 -0.748900
+vn 0.599600 0.000000 -0.800300
+vn 0.544700 0.000000 -0.838700
+vn 0.488100 0.000000 -0.872800
+vn 0.430900 0.000000 -0.902400
+vn 0.373600 0.000000 -0.927600
+vn 0.317200 0.000000 -0.948400
+vn 0.262200 0.000000 -0.965000
+vn 0.209000 0.000000 -0.977900
+vn 0.158100 0.000000 -0.987400
+vn -0.123800 0.000000 -0.992300
+vn 0.109600 0.000000 -0.994000
+vn -0.114200 0.000000 -0.993500
+vn 0.063800 0.000000 -0.998000
+vn -0.104400 0.000000 -0.994500
+vn 0.020600 0.000000 -0.999800
+vn -0.094500 0.000000 -0.995500
+vn -0.006100 0.000000 -1.000000
+vn -0.084300 0.000000 -0.996400
+vn -0.018100 0.000000 -0.999800
+vn -0.073900 0.000000 -0.997300
+vn -0.029800 0.000000 -0.999600
+vn -0.063200 0.000000 -0.998000
+vn -0.041200 0.000000 -0.999200
+vn -0.052300 0.000000 -0.998600
+vn -0.260100 0.000000 -0.965600
+vn -0.153200 0.000000 -0.988200
+vn -0.366700 0.000000 -0.930400
+vn -0.049500 0.000000 -0.998800
+vn -0.468700 0.000000 -0.883400
+vn 0.004200 0.000000 -1.000000
+vn -0.562500 0.000000 -0.826800
+vn 0.012500 0.000000 -0.999900
+vn -0.645800 0.000000 -0.763500
+vn -0.717200 0.000000 -0.696800
+vn 0.028300 0.000000 -0.999600
+vn -0.776900 0.000000 -0.629600
+vn 0.036300 0.000000 -0.999300
+vn -0.825700 0.000000 -0.564200
+vn 0.044000 0.000000 -0.999000
+vn -0.864900 0.000000 -0.501900
+vn 0.051500 0.000000 -0.998700
+vn -0.896100 0.000000 -0.443900
+vn 0.059000 0.000000 -0.998300
+vn -0.928600 0.000000 -0.371100
+vn 0.066300 0.000000 -0.997800
+vn -0.954100 0.000000 -0.299500
+vn 0.073500 0.000000 -0.997300
+vn -0.970300 0.000000 -0.241800
+vn 0.080800 0.000000 -0.996700
+vn -0.980800 0.000000 -0.194900
+vn 0.088100 0.000000 -0.996100
+vn -0.987700 0.000000 -0.156200
+vn 0.139900 0.000000 -0.990200
+vn -0.992300 0.000000 -0.123900
+vn 0.247400 0.000000 -0.968900
+vn -0.995300 0.000000 -0.096600
+vn 0.355100 0.000000 -0.934800
+vn -0.997300 0.000000 -0.073200
+vn 0.458800 0.000000 -0.888500
+vn -0.998600 0.000000 -0.053000
+vn 0.554800 0.000000 -0.832000
+vn -0.999400 0.000000 -0.035400
+vn 0.640100 0.000000 -0.768300
+vn -0.999800 0.000000 -0.020000
+vn 0.713500 0.000000 -0.700700
+vn -1.000000 0.000000 -0.006300
+vn 0.774800 0.000000 -0.632200
+vn -1.000000 0.000000 0.006300
+vn 0.824900 0.000000 -0.565300
+vn -0.999800 0.000000 0.019900
+vn 0.865100 0.000000 -0.501700
+vn -0.999400 0.000000 0.035000
+vn 0.896900 0.000000 -0.442200
+vn -0.998700 0.000000 0.051800
+vn 0.921900 0.000000 -0.387400
+vn -0.997500 0.000000 0.070700
+vn 0.944100 0.000000 -0.329700
+vn -0.995800 0.000000 0.092100
+vn 0.962400 0.000000 -0.271500
+vn -0.993200 0.000000 0.116300
+vn 0.974800 0.000000 -0.223100
+vn -0.989600 0.000000 0.144000
+vn 0.983200 0.000000 -0.182400
+vn -0.984400 0.000000 0.176000
+vn 0.989000 0.000000 -0.147900
+vn -0.977000 0.000000 0.213000
+vn 0.993000 0.000000 -0.118400
+vn -0.966600 0.000000 0.256300
+vn 0.995700 0.000000 -0.093000
+vn -0.951700 0.000000 0.307200
+vn 0.997500 0.000000 -0.071000
+vn -0.933800 0.000000 0.357900
+vn 0.998700 0.000000 -0.051700
+vn -0.910700 0.000000 0.413100
+vn 0.999400 0.000000 -0.034700
+vn -0.880500 0.000000 0.474100
+vn 0.999800 0.000000 -0.019600
+vn -0.841100 0.000000 0.540900
+vn 1.000000 0.000000 -0.006200
+vn -0.790200 0.000000 0.612900
+vn 1.000000 0.000000 0.005600
+vn -0.725500 0.000000 0.688200
+vn 0.999800 0.000000 0.017900
+vn -0.645200 0.000000 0.764000
+vn 0.999500 0.000000 0.031700
+vn -0.548600 0.000000 0.836100
+vn 0.998900 0.000000 0.047400
+vn -0.437000 0.000000 0.899400
+vn 0.997900 0.000000 0.065400
+vn -0.314500 0.000000 0.949300
+vn 0.996300 0.000000 0.086200
+vn -0.186800 0.000000 0.982400
+vn 0.993900 0.000000 0.110500
+vn -0.060700 0.000000 0.998200
+vn 0.990300 0.000000 0.139000
+vn 0.003700 0.000000 1.000000
+vn 0.984900 0.000000 0.173000
+vn 0.011000 0.000000 0.999900
+vn 0.976800 0.000000 0.214000
+vn 0.017700 0.000000 0.999800
+vn 0.964500 0.000000 0.264000
+vn 0.024300 0.000000 0.999700
+vn 0.945400 0.000000 0.325800
+vn 0.030200 0.000000 0.999500
+vn 0.922000 0.000000 0.387100
+vn 0.035600 0.000000 0.999400
+vn 0.897100 0.000000 0.441800
+vn 0.040900 0.000000 0.999200
+vn 0.865200 0.000000 0.501400
+vn 0.045600 0.000000 0.999000
+vn 0.824700 0.000000 0.565500
+vn 0.049500 0.000000 0.998800
+vn 0.773900 0.000000 0.633300
+vn 0.053200 0.000000 0.998600
+vn 0.711300 0.000000 0.702900
+vn 0.056500 0.000000 0.998400
+vn 0.635800 0.000000 0.771800
+vn 0.059400 0.000000 0.998200
+vn 0.547600 0.000000 0.836800
+vn 0.116600 0.000000 0.993200
+vn 0.447900 0.000000 0.894100
+vn 0.228000 0.000000 0.973700
+vn 0.340000 0.000000 0.940400
+vn 0.000000 -1.000000 0.007100
+vn 0.000000 -1.000000 -0.007300
+vn 0.000000 -1.000000 0.004000
+vn 0.000000 -1.000000 -0.000100
+vn 0.000000 -1.000000 0.000600
+vn 0.000000 -1.000000 -0.000900
+vn 0.000000 -1.000000 -0.000700
+vn 0.000000 -1.000000 0.000100
+vn 0.000000 -1.000000 -0.000200
+vn 0.000000 1.000000 0.000100
+vn 0.000000 1.000000 -0.000100
+vn 0.000000 1.000000 -0.000200
+vn 0.050200 0.000000 0.998700
+vn 0.045500 0.000000 0.999000
+vn 0.039900 0.000000 0.999200
+vn 0.010600 0.000000 0.999900
+vn 0.003300 0.000000 1.000000
+vn -0.086700 0.000000 0.996200
+vn 0.055900 0.000000 0.998400
+vn 0.056200 0.000000 0.998400
+vn 0.053500 0.000000 0.998600
+vn -0.065500 0.000000 -0.997900
+vn -0.011500 0.000000 -0.999900
+vn -0.046400 0.000000 -0.998900
+vn -0.641700 0.000000 0.766900
+vn -0.395500 0.000000 0.918500
+vn -0.102500 0.000000 0.994700
+vn -0.093200 0.000000 0.995700
+vn -0.227000 0.000000 0.973900
+vn -0.064700 0.000000 0.997900
+vn -0.129900 0.000000 0.991500
+vn -0.044800 0.000000 0.999000
+vn 0.080100 0.000000 0.996800
+vn -0.005200 0.000000 1.000000
+vn 0.132700 0.000000 0.991200
+vn 0.130800 0.000000 0.991400
+vn 0.114800 0.000000 0.993400
+vn 0.026300 0.000000 0.999700
+vn -0.120900 0.000000 0.992700
+vn -0.091000 0.000000 0.995800
+vn -0.013200 0.000000 0.999900
+vn 0.123500 0.000000 0.992300
+vn 0.138600 0.000000 0.990300
+vn 0.141900 0.000000 0.989900
+vn 0.131000 0.000000 0.991400
+vn 0.105600 0.000000 0.994400
+vn 0.011500 0.000000 0.999900
+vn -0.060200 0.000000 0.998200
+vn -0.061500 0.000000 0.998100
+vn -0.035900 0.000000 0.999400
+vn 0.022500 0.000000 0.999700
+vn 0.026700 0.000000 0.999600
+vn 0.023900 0.000000 0.999700
+vn 0.006400 0.000000 1.000000
+vn -0.013700 0.000000 0.999900
+vn -0.039300 0.000000 0.999200
+vn -0.059300 0.000000 0.998200
+vn -0.071100 0.000000 0.997500
+vn -0.073300 0.000000 0.997300
+vn -0.066000 0.000000 0.997800
+vn -0.005400 0.000000 1.000000
+vn 0.066800 0.000000 0.997800
+vn 0.317200 0.000000 -0.948300
+vn -0.104500 0.000000 -0.994500
+vn -0.073800 0.000000 -0.997300
+vn -0.063300 0.000000 -0.998000
+vn 0.000000 -1.000000 -0.004600
+vn 0.000000 -1.000000 0.001100
+vn 0.000000 1.000000 0.004400
+vn 0.000000 1.000000 -0.003800
+vn 0.000000 1.000000 -0.000400
+vn 0.004300 0.000000 -1.000000
+vn 0.028200 0.000000 -0.999600
+vn 0.036200 0.000000 -0.999300
+vn 0.058900 0.000000 -0.998300
+vn 0.066400 0.000000 -0.997800
+vn 0.073600 0.000000 -0.997300
+vn 0.003800 0.000000 1.000000
+vn 0.017900 0.000000 0.999800
+vn 0.024100 0.000000 0.999700
+vn 0.030400 0.000000 0.999500
+vn 0.035800 0.000000 0.999400
+vn 0.049600 0.000000 0.998800
+vn 0.053300 0.000000 0.998600
+vn 0.059300 0.000000 0.998200
+usemtl SVGMat.002
+s off
+f 62//2 63//2 64//2
+f 61//3 64//3 66//3
+f 175//4 176//4 110//4
+f 324//4 192//4 323//4
+f 342//5 456//5 63//5
+f 566//6 572//6 577//6
+f 803//6 743//6 744//6
+f 65//7 66//7 572//7
+f 260//8 259//8 655//8
+f 261//9 260//9 654//9
+f 262//10 261//10 653//10
+f 263//11 262//11 652//11
+f 264//12 263//12 651//12
+f 265//13 264//13 650//13
+f 266//14 265//14 649//14
+f 267//15 266//15 648//15
+f 268//16 267//16 647//16
+f 269//17 268//17 646//17
+f 270//18 269//18 645//18
+f 271//19 270//19 644//19
+f 272//20 271//20 643//20
+f 273//21 272//21 642//21
+f 274//22 273//22 641//22
+f 275//23 274//23 640//23
+f 276//24 275//24 639//24
+f 277//25 276//25 638//25
+f 278//26 277//26 637//26
+f 279//27 278//27 636//27
+f 280//28 279//28 635//28
+f 281//29 280//29 634//29
+f 282//30 281//30 633//30
+f 283//31 282//31 632//31
+f 284//32 283//32 631//32
+f 285//33 284//33 630//33
+f 286//34 285//34 629//34
+f 287//35 286//35 628//35
+f 288//36 287//36 627//36
+f 289//37 288//37 626//37
+f 290//38 289//38 625//38
+f 291//39 290//39 624//39
+f 292//40 291//40 623//40
+f 293//40 292//40 622//40
+f 294//40 293//40 621//40
+f 295//40 294//40 620//40
+f 296//40 295//40 619//40
+f 297//40 296//40 618//40
+f 298//40 297//40 617//40
+f 299//40 298//40 616//40
+f 300//40 299//40 615//40
+f 301//40 300//40 614//40
+f 302//40 301//40 613//40
+f 303//40 302//40 612//40
+f 304//41 303//41 611//41
+f 305//40 304//40 610//40
+f 306//42 305//42 609//42
+f 307//40 306//40 608//40
+f 308//43 307//43 607//43
+f 309//44 308//44 606//44
+f 310//45 309//45 605//45
+f 311//46 310//46 604//46
+f 312//47 311//47 603//47
+f 313//46 312//46 602//46
+f 314//48 313//48 601//48
+f 315//49 314//49 600//49
+f 316//50 315//50 599//50
+f 317//51 316//51 598//51
+f 318//52 317//52 597//52
+f 319//53 318//53 596//53
+f 320//54 319//54 595//54
+f 321//55 320//55 594//55
+f 322//56 321//56 593//56
+f 323//57 322//57 592//57
+f 324//58 323//58 591//58
+f 325//59 324//59 590//59
+f 326//60 325//60 589//60
+f 327//61 326//61 588//61
+f 328//62 327//62 587//62
+f 329//63 328//63 586//63
+f 330//64 329//64 585//64
+f 331//65 330//65 584//65
+f 332//66 331//66 583//66
+f 333//67 332//67 582//67
+f 334//68 333//68 581//68
+f 335//69 334//69 580//69
+f 336//70 335//70 579//70
+f 337//71 336//71 578//71
+f 858//4 859//4 338//4
+f 872//46 885//46 886//46
+f 339//46 575//46 574//46
+f 340//72 574//72 573//72
+f 341//73 573//73 456//73
+f 343//74 572//74 571//74
+f 344//75 571//75 570//75
+f 345//76 570//76 569//76
+f 346//77 569//77 568//77
+f 347//78 568//78 567//78
+f 348//79 567//79 566//79
+f 104//80 566//80 809//80
+f 109//40 108//40 806//40
+f 116//40 798//40 797//40
+f 117//81 797//81 796//81
+f 118//82 796//82 795//82
+f 119//83 795//83 794//83
+f 120//84 794//84 793//84
+f 121//85 793//85 792//85
+f 122//86 792//86 791//86
+f 123//87 791//87 790//87
+f 124//88 790//88 789//88
+f 125//89 789//89 788//89
+f 126//90 788//90 787//90
+f 127//91 787//91 786//91
+f 128//92 786//92 785//92
+f 129//93 785//93 784//93
+f 130//93 784//93 686//93
+f 235//93 234//93 680//93
+f 242//40 241//40 673//40
+f 243//40 242//40 672//40
+f 244//94 243//94 671//94
+f 245//95 244//95 670//95
+f 246//96 245//96 669//96
+f 247//97 246//97 668//97
+f 248//98 247//98 667//98
+f 249//99 248//99 666//99
+f 250//100 249//100 665//100
+f 251//101 250//101 664//101
+f 252//102 251//102 663//102
+f 253//103 252//103 662//103
+f 254//104 253//104 661//104
+f 255//105 254//105 660//105
+f 256//106 255//106 659//106
+f 257//107 256//107 658//107
+f 258//108 257//108 657//108
+f 259//109 258//109 656//109
+f 576//6 891//6 909//6
+f 878//110 337//110 577//110
+f 845//111 884//111 893//111
+f 846//112 845//112 892//112
+f 847//113 846//113 924//113
+f 848//114 847//114 923//114
+f 849//115 848//115 922//115
+f 850//116 849//116 921//116
+f 851//117 850//117 920//117
+f 852//118 851//118 919//118
+f 853//119 852//119 918//119
+f 854//120 853//120 917//120
+f 855//121 854//121 916//121
+f 856//122 855//122 915//122
+f 857//123 856//123 914//123
+f 858//124 857//124 913//124
+f 859//125 858//125 912//125
+f 860//126 859//126 911//126
+f 861//127 860//127 910//127
+f 862//40 861//40 909//40
+f 863//40 862//40 908//40
+f 864//40 863//40 907//40
+f 865//40 864//40 906//40
+f 866//40 865//40 905//40
+f 867//40 866//40 904//40
+f 868//40 867//40 903//40
+f 869//40 868//40 902//40
+f 870//40 869//40 901//40
+f 241//40 870//40 900//40
+f 879//128 878//128 899//128
+f 880//129 879//129 898//129
+f 881//130 880//130 897//130
+f 882//131 881//131 896//131
+f 883//132 882//132 895//132
+f 884//133 883//133 894//133
+f 200//134 199//134 716//134
+f 201//135 200//135 715//135
+f 199//136 198//136 717//136
+f 202//137 201//137 714//137
+f 198//138 197//138 718//138
+f 203//139 202//139 713//139
+f 197//140 196//140 719//140
+f 204//141 203//141 712//141
+f 196//142 195//142 720//142
+f 205//143 204//143 711//143
+f 195//144 194//144 721//144
+f 206//145 205//145 710//145
+f 194//146 193//146 722//146
+f 207//147 206//147 709//147
+f 193//148 192//148 723//148
+f 208//149 207//149 708//149
+f 192//150 191//150 724//150
+f 209//151 208//151 707//151
+f 191//152 190//152 725//152
+f 210//153 209//153 706//153
+f 190//154 189//154 726//154
+f 211//155 210//155 705//155
+f 189//156 188//156 727//156
+f 212//157 211//157 704//157
+f 188//158 187//158 728//158
+f 213//159 212//159 703//159
+f 187//160 186//160 729//160
+f 214//161 213//161 702//161
+f 186//162 185//162 730//162
+f 215//163 214//163 701//163
+f 185//164 184//164 731//164
+f 216//165 215//165 700//165
+f 184//166 183//166 457//166
+f 217//167 216//167 699//167
+f 183//168 455//168 458//168
+f 218//169 217//169 698//169
+f 455//170 454//170 459//170
+f 219//171 218//171 697//171
+f 454//172 453//172 460//172
+f 220//173 219//173 696//173
+f 453//174 452//174 461//174
+f 221//175 220//175 695//175
+f 452//176 451//176 462//176
+f 222//177 221//177 694//177
+f 451//178 450//178 463//178
+f 223//179 222//179 693//179
+f 450//180 449//180 464//180
+f 224//181 223//181 692//181
+f 449//182 448//182 465//182
+f 225//183 224//183 691//183
+f 448//184 447//184 466//184
+f 226//185 225//185 690//185
+f 447//186 446//186 467//186
+f 227//187 226//187 689//187
+f 446//188 445//188 468//188
+f 228//189 227//189 688//189
+f 445//190 444//190 469//190
+f 132//191 228//191 687//191
+f 444//192 443//192 470//192
+f 133//193 132//193 783//193
+f 443//194 442//194 471//194
+f 134//195 133//195 782//195
+f 442//196 441//196 472//196
+f 135//197 134//197 781//197
+f 441//198 440//198 473//198
+f 136//199 135//199 780//199
+f 440//200 439//200 474//200
+f 137//201 136//201 779//201
+f 439//202 438//202 475//202
+f 138//203 137//203 778//203
+f 438//204 437//204 476//204
+f 139//205 138//205 777//205
+f 437//206 436//206 477//206
+f 140//207 139//207 776//207
+f 436//208 435//208 478//208
+f 141//209 140//209 775//209
+f 435//210 434//210 479//210
+f 142//211 141//211 774//211
+f 434//212 433//212 480//212
+f 143//213 142//213 773//213
+f 433//214 432//214 481//214
+f 144//215 143//215 772//215
+f 432//216 431//216 482//216
+f 145//217 144//217 771//217
+f 431//218 430//218 483//218
+f 146//219 145//219 770//219
+f 430//220 429//220 484//220
+f 147//221 146//221 769//221
+f 429//222 428//222 485//222
+f 148//223 147//223 768//223
+f 428//224 427//224 486//224
+f 149//225 148//225 767//225
+f 427//226 426//226 487//226
+f 150//227 149//227 766//227
+f 426//228 425//228 488//228
+f 151//229 150//229 765//229
+f 425//230 424//230 489//230
+f 152//231 151//231 764//231
+f 424//232 423//232 490//232
+f 153//233 152//233 763//233
+f 423//234 422//234 491//234
+f 154//235 153//235 762//235
+f 422//236 421//236 492//236
+f 155//237 154//237 761//237
+f 421//238 420//238 493//238
+f 156//239 155//239 760//239
+f 420//240 419//240 494//240
+f 157//241 156//241 759//241
+f 419//242 418//242 495//242
+f 158//243 157//243 758//243
+f 418//244 417//244 496//244
+f 159//245 158//245 757//245
+f 417//246 416//246 497//246
+f 160//247 159//247 756//247
+f 416//248 415//248 498//248
+f 161//249 160//249 755//249
+f 415//250 414//250 499//250
+f 162//251 161//251 754//251
+f 414//252 413//252 500//252
+f 163//253 162//253 753//253
+f 413//254 412//254 501//254
+f 164//255 163//255 752//255
+f 412//256 411//256 502//256
+f 165//257 164//257 751//257
+f 411//258 410//258 503//258
+f 166//259 165//259 750//259
+f 410//260 409//260 504//260
+f 167//261 166//261 749//261
+f 409//238 408//238 505//238
+f 168//262 167//262 748//262
+f 408//263 407//263 506//263
+f 169//264 168//264 747//264
+f 407//265 406//265 507//265
+f 170//266 169//266 746//266
+f 406//267 405//267 508//267
+f 171//268 170//268 745//268
+f 405//269 404//269 509//269
+f 172//270 171//270 744//270
+f 404//271 403//271 510//271
+f 173//272 172//272 743//272
+f 403//273 402//273 511//273
+f 174//274 173//274 742//274
+f 402//275 401//275 512//275
+f 175//276 174//276 741//276
+f 401//277 400//277 513//277
+f 176//278 175//278 740//278
+f 400//279 399//279 514//279
+f 177//280 176//280 739//280
+f 399//281 398//281 515//281
+f 178//282 177//282 738//282
+f 398//283 397//283 516//283
+f 179//284 178//284 737//284
+f 397//285 396//285 517//285
+f 180//286 179//286 736//286
+f 396//285 395//285 518//285
+f 181//287 180//287 735//287
+f 395//285 394//285 519//285
+f 182//288 181//288 734//288
+f 394//285 393//285 520//285
+f 67//289 182//289 733//289
+f 393//285 392//285 521//285
+f 68//290 67//290 732//290
+f 392//285 391//285 522//285
+f 69//291 68//291 844//291
+f 391//285 390//285 523//285
+f 70//292 69//292 843//292
+f 390//285 389//285 524//285
+f 71//293 70//293 842//293
+f 389//285 388//285 525//285
+f 72//294 71//294 841//294
+f 388//285 387//285 526//285
+f 73//295 72//295 840//295
+f 387//285 386//285 527//285
+f 74//296 73//296 839//296
+f 386//285 385//285 528//285
+f 75//297 74//297 838//297
+f 385//298 384//298 529//298
+f 76//299 75//299 837//299
+f 384//300 383//300 530//300
+f 77//301 76//301 836//301
+f 383//302 382//302 531//302
+f 78//303 77//303 835//303
+f 382//304 381//304 532//304
+f 79//305 78//305 834//305
+f 381//306 380//306 533//306
+f 80//307 79//307 833//307
+f 380//308 379//308 534//308
+f 81//309 80//309 832//309
+f 379//310 378//310 535//310
+f 82//311 81//311 831//311
+f 378//312 377//312 536//312
+f 83//313 82//313 830//313
+f 377//314 376//314 537//314
+f 84//315 83//315 829//315
+f 376//316 375//316 538//316
+f 85//317 84//317 828//317
+f 375//318 374//318 539//318
+f 86//319 85//319 827//319
+f 374//320 373//320 540//320
+f 87//321 86//321 826//321
+f 373//40 372//40 541//40
+f 88//322 87//322 825//322
+f 372//323 371//323 542//323
+f 89//324 88//324 824//324
+f 371//323 370//323 543//323
+f 90//325 89//325 823//325
+f 370//323 369//323 544//323
+f 91//326 90//326 822//326
+f 369//323 368//323 545//323
+f 92//327 91//327 821//327
+f 368//323 367//323 546//323
+f 93//328 92//328 820//328
+f 367//323 366//323 547//323
+f 94//329 93//329 819//329
+f 366//323 365//323 548//323
+f 95//330 94//330 818//330
+f 365//323 364//323 549//323
+f 96//331 95//331 817//331
+f 364//323 363//323 550//323
+f 97//332 96//332 816//332
+f 363//323 362//323 551//323
+f 98//333 97//333 815//333
+f 362//323 361//323 552//323
+f 99//334 98//334 814//334
+f 361//323 360//323 553//323
+f 100//335 99//335 813//335
+f 360//336 359//336 554//336
+f 101//337 100//337 812//337
+f 359//338 358//338 555//338
+f 102//339 101//339 811//339
+f 358//340 357//340 556//340
+f 103//341 102//341 810//341
+f 357//342 356//342 557//342
+f 349//343 103//343 565//343
+f 356//344 355//344 558//344
+f 350//345 349//345 564//345
+f 355//346 354//346 559//346
+f 351//347 350//347 563//347
+f 354//348 353//348 560//348
+f 352//349 351//349 562//349
+f 353//350 352//350 561//350
+f 998//4 937//4 938//4
+f 1088//6 1046//6 1047//6
+f 960//351 959//351 1136//351
+f 961//352 960//352 1135//352
+f 959//353 958//353 1137//353
+f 962//354 961//354 1134//354
+f 958//355 957//355 1138//355
+f 963//356 962//356 1133//356
+f 957//357 956//357 1139//357
+f 964//358 963//358 1132//358
+f 956//359 955//359 1140//359
+f 965//341 964//341 1131//341
+f 955//360 954//360 1141//360
+f 966//361 965//361 1130//361
+f 954//362 953//362 1142//362
+f 967//363 966//363 1129//363
+f 953//364 952//364 1143//364
+f 968//365 967//365 1128//365
+f 952//366 951//366 1144//366
+f 969//367 968//367 1127//367
+f 951//368 950//368 1145//368
+f 970//369 969//369 1126//369
+f 950//370 949//370 1146//370
+f 971//371 970//371 1125//371
+f 949//372 948//372 1147//372
+f 972//373 971//373 1124//373
+f 948//374 947//374 1148//374
+f 973//375 972//375 1123//375
+f 947//376 946//376 1149//376
+f 974//377 973//377 1122//377
+f 946//378 945//378 1150//378
+f 975//379 974//379 1121//379
+f 945//380 944//380 1151//380
+f 976//381 975//381 1120//381
+f 944//382 943//382 1152//382
+f 977//383 976//383 1119//383
+f 943//384 942//384 1153//384
+f 978//385 977//385 1118//385
+f 942//386 941//386 1154//386
+f 979//387 978//387 1117//387
+f 941//388 940//388 1155//388
+f 980//389 979//389 1116//389
+f 940//390 939//390 1156//390
+f 981//391 980//391 1115//391
+f 939//392 938//392 1157//392
+f 982//393 981//393 1114//393
+f 938//394 937//394 1158//394
+f 983//395 982//395 1113//395
+f 937//396 936//396 1159//396
+f 984//397 983//397 1112//397
+f 936//398 935//398 1160//398
+f 985//399 984//399 1111//399
+f 935//400 934//400 1161//400
+f 986//401 985//401 1110//401
+f 934//402 933//402 1162//402
+f 987//403 986//403 1109//403
+f 933//404 932//404 1163//404
+f 988//405 987//405 1108//405
+f 932//406 931//406 1164//406
+f 989//407 988//407 1107//407
+f 931//408 930//408 1045//408
+f 990//409 989//409 1106//409
+f 930//410 929//410 1046//410
+f 991//411 990//411 1105//411
+f 929//412 928//412 1047//412
+f 992//413 991//413 1104//413
+f 928//414 927//414 1048//414
+f 993//415 992//415 1103//415
+f 927//416 926//416 1049//416
+f 994//417 993//417 1102//417
+f 926//418 925//418 1050//418
+f 995//419 994//419 1101//419
+f 925//420 1044//420 1051//420
+f 996//421 995//421 1100//421
+f 1044//422 1043//422 1052//422
+f 997//423 996//423 1099//423
+f 1043//424 1042//424 1053//424
+f 998//425 997//425 1098//425
+f 1042//426 1041//426 1054//426
+f 999//427 998//427 1097//427
+f 1041//428 1040//428 1055//428
+f 1000//429 999//429 1096//429
+f 1040//430 1039//430 1056//430
+f 1001//431 1000//431 1095//431
+f 1039//432 1038//432 1057//432
+f 1002//433 1001//433 1094//433
+f 1038//434 1037//434 1058//434
+f 1003//435 1002//435 1093//435
+f 1037//436 1036//436 1059//436
+f 1004//437 1003//437 1092//437
+f 1036//438 1035//438 1060//438
+f 1005//439 1004//439 1091//439
+f 1035//440 1034//440 1061//440
+f 1006//441 1005//441 1090//441
+f 1034//442 1033//442 1062//442
+f 1007//443 1006//443 1089//443
+f 1033//444 1032//444 1063//444
+f 1008//445 1007//445 1088//445
+f 1032//446 1031//446 1064//446
+f 1009//447 1008//447 1087//447
+f 1031//448 1030//448 1065//448
+f 1010//449 1009//449 1086//449
+f 1030//450 1029//450 1066//450
+f 1011//451 1010//451 1085//451
+f 1029//452 1028//452 1067//452
+f 1012//453 1011//453 1084//453
+f 1028//454 1027//454 1068//454
+f 1013//455 1012//455 1083//455
+f 1027//456 1026//456 1069//456
+f 1014//457 1013//457 1082//457
+f 1026//458 1025//458 1070//458
+f 1015//459 1014//459 1081//459
+f 1025//460 1024//460 1071//460
+f 1016//461 1015//461 1080//461
+f 1024//462 1023//462 1072//462
+f 1017//463 1016//463 1079//463
+f 1023//464 1022//464 1073//464
+f 1018//465 1017//465 1078//465
+f 1022//466 1021//466 1074//466
+f 1019//467 1018//467 1077//467
+f 1021//468 1020//468 1075//468
+f 1020//469 1019//469 1076//469
+f 61//2 62//2 64//2
+f 65//3 61//3 66//3
+f 131//4 132//4 133//4
+f 78//4 79//4 80//4
+f 131//4 133//4 134//4
+f 81//4 78//4 80//4
+f 131//4 134//4 135//4
+f 81//4 77//4 78//4
+f 131//4 135//4 136//4
+f 81//4 82//4 77//4
+f 131//4 136//4 137//4
+f 82//4 76//4 77//4
+f 131//4 137//4 138//4
+f 82//4 83//4 76//4
+f 131//4 138//4 139//4
+f 76//4 83//4 75//4
+f 131//4 139//4 140//4
+f 83//4 84//4 75//4
+f 131//4 140//4 141//4
+f 75//4 84//4 107//4
+f 131//4 141//4 142//4
+f 75//4 107//4 74//4
+f 131//4 142//4 143//4
+f 107//4 73//4 74//4
+f 131//4 143//4 144//4
+f 107//4 72//4 73//4
+f 131//4 144//4 145//4
+f 107//4 84//4 85//4
+f 131//4 145//4 146//4
+f 106//4 85//4 86//4
+f 131//4 146//4 147//4
+f 106//4 86//4 87//4
+f 131//4 147//4 148//4
+f 89//4 106//4 88//4
+f 131//4 148//4 149//4
+f 90//4 106//4 89//4
+f 131//4 149//4 150//4
+f 105//4 103//4 104//4
+f 131//4 150//4 151//4
+f 105//4 102//4 103//4
+f 131//4 151//4 152//4
+f 101//4 102//4 105//4
+f 131//4 152//4 153//4
+f 100//4 101//4 105//4
+f 131//4 153//4 154//4
+f 99//4 100//4 105//4
+f 131//4 154//4 155//4
+f 98//4 99//4 105//4
+f 130//4 155//4 156//4
+f 97//4 98//4 105//4
+f 116//4 156//4 157//4
+f 96//4 97//4 105//4
+f 115//4 157//4 158//4
+f 95//4 96//4 105//4
+f 115//4 158//4 159//4
+f 94//4 95//4 105//4
+f 114//4 159//4 160//4
+f 93//4 94//4 105//4
+f 114//4 160//4 161//4
+f 92//4 93//4 105//4
+f 114//4 161//4 162//4
+f 91//4 92//4 105//4
+f 113//4 162//4 163//4
+f 90//4 91//4 105//4
+f 113//4 163//4 164//4
+f 106//4 90//4 105//4
+f 113//4 164//4 165//4
+f 106//4 87//4 88//4
+f 113//4 165//4 166//4
+f 106//4 107//4 85//4
+f 112//4 166//4 167//4
+f 72//4 107//4 71//4
+f 112//4 167//4 168//4
+f 71//4 107//4 108//4
+f 115//4 116//4 157//4
+f 70//4 71//4 108//4
+f 112//4 168//4 169//4
+f 69//4 70//4 108//4
+f 111//4 169//4 170//4
+f 68//4 69//4 108//4
+f 155//4 130//4 131//4
+f 67//4 68//4 108//4
+f 156//4 116//4 117//4
+f 182//4 67//4 108//4
+f 111//4 170//4 171//4
+f 109//4 182//4 108//4
+f 111//4 171//4 172//4
+f 109//4 181//4 182//4
+f 130//4 156//4 117//4
+f 109//4 180//4 181//4
+f 111//4 172//4 173//4
+f 109//4 179//4 180//4
+f 118//4 130//4 117//4
+f 109//4 178//4 179//4
+f 110//4 173//4 174//4
+f 124//4 125//4 126//4
+f 126//4 123//4 124//4
+f 126//4 127//4 122//4
+f 121//4 127//4 128//4
+f 129//4 120//4 128//4
+f 162//4 113//4 114//4
+f 128//4 120//4 121//4
+f 159//4 114//4 115//4
+f 173//4 110//4 111//4
+f 166//4 112//4 113//4
+f 121//4 122//4 127//4
+f 126//4 122//4 123//4
+f 118//4 129//4 130//4
+f 177//4 178//4 109//4
+f 120//4 129//4 119//4
+f 177//4 109//4 110//4
+f 169//4 111//4 112//4
+f 177//4 110//4 176//4
+f 174//4 175//4 110//4
+f 118//4 119//4 129//4
+f 185//4 455//4 183//4
+f 185//4 453//4 454//4
+f 186//4 451//4 452//4
+f 186//4 449//4 450//4
+f 437//4 447//4 448//4
+f 442//4 443//4 446//4
+f 445//4 443//4 444//4
+f 446//4 441//4 442//4
+f 446//4 439//4 440//4
+f 447//4 437//4 438//4
+f 410//4 435//4 436//4
+f 432//4 433//4 434//4
+f 430//4 431//4 432//4
+f 428//4 429//4 430//4
+f 420//4 421//4 422//4
+f 427//470 428//470 430//470
+f 419//4 420//4 422//4
+f 426//471 427//471 430//471
+f 418//4 419//4 422//4
+f 426//4 430//4 432//4
+f 418//471 422//471 423//471
+f 425//472 426//472 432//472
+f 417//4 418//4 423//4
+f 425//473 432//473 434//473
+f 416//4 417//4 423//4
+f 424//474 425//474 434//474
+f 415//4 416//4 423//4
+f 423//475 424//475 434//475
+f 448//4 436//4 437//4
+f 446//4 440//4 441//4
+f 446//4 443//4 445//4
+f 186//4 448//4 449//4
+f 186//4 452//4 453//4
+f 185//4 183//4 184//4
+f 229//4 132//4 131//4
+f 454//4 455//4 185//4
+f 229//4 230//4 132//4
+f 453//4 185//4 186//4
+f 132//4 230//4 231//4
+f 448//4 186//4 187//4
+f 232//4 132//4 231//4
+f 382//4 187//4 188//4
+f 232//4 233//4 132//4
+f 373//4 188//4 189//4
+f 233//4 228//4 132//4
+f 373//4 189//4 190//4
+f 233//4 227//4 228//4
+f 450//4 451//4 186//4
+f 226//4 227//4 233//4
+f 373//4 190//4 191//4
+f 225//4 226//4 233//4
+f 325//4 191//4 192//4
+f 225//4 233//4 234//4
+f 436//4 448//4 187//4
+f 224//4 225//4 234//4
+f 323//4 192//4 193//4
+f 308//4 224//4 234//4
+f 322//4 193//4 194//4
+f 223//4 224//4 308//4
+f 438//4 439//4 447//4
+f 222//4 223//4 308//4
+f 320//4 194//4 195//4
+f 221//4 222//4 308//4
+f 447//4 439//4 446//4
+f 220//4 221//4 308//4
+f 318//4 195//4 196//4
+f 220//4 308//4 219//4
+f 410//4 436//4 187//4
+f 219//4 308//4 310//4
+f 317//4 196//4 197//4
+f 218//4 219//4 310//4
+f 411//4 434//4 435//4
+f 217//4 310//4 216//4
+f 413//4 423//4 434//4
+f 216//4 310//4 215//4
+f 414//476 415//476 423//476
+f 215//4 310//4 214//4
+f 413//4 414//4 423//4
+f 310//4 311//4 214//4
+f 412//4 413//4 434//4
+f 214//4 311//4 213//4
+f 411//4 412//4 434//4
+f 213//4 311//4 212//4
+f 410//4 411//4 435//4
+f 212//4 311//4 211//4
+f 409//4 410//4 187//4
+f 211//4 311//4 312//4
+f 404//4 409//4 187//4
+f 210//4 211//4 312//4
+f 407//4 408//4 409//4
+f 209//4 210//4 312//4
+f 406//4 407//4 409//4
+f 208//4 209//4 312//4
+f 405//4 406//4 409//4
+f 307//4 235//4 236//4
+f 404//4 405//4 409//4
+f 307//4 236//4 237//4
+f 315//4 197//4 198//4
+f 239//4 237//4 238//4
+f 403//4 404//4 187//4
+f 307//4 237//4 239//4
+f 402//4 403//4 187//4
+f 307//4 239//4 240//4
+f 401//4 402//4 187//4
+f 240//4 241//4 242//4
+f 400//4 401//4 187//4
+f 240//4 242//4 243//4
+f 399//4 400//4 187//4
+f 292//4 243//4 244//4
+f 398//4 399//4 187//4
+f 292//4 244//4 245//4
+f 397//4 398//4 187//4
+f 291//4 245//4 246//4
+f 396//4 397//4 187//4
+f 291//4 246//4 247//4
+f 395//477 396//477 187//477
+f 290//4 247//4 248//4
+f 394//4 395//4 187//4
+f 289//4 248//4 249//4
+f 393//4 394//4 187//4
+f 289//4 249//4 250//4
+f 392//4 393//4 187//4
+f 288//4 250//4 251//4
+f 391//4 392//4 187//4
+f 287//4 251//4 252//4
+f 390//4 391//4 187//4
+f 286//4 252//4 253//4
+f 389//477 390//477 187//477
+f 286//4 253//4 254//4
+f 388//4 389//4 187//4
+f 284//4 254//4 255//4
+f 387//4 388//4 187//4
+f 284//4 255//4 256//4
+f 386//478 387//478 187//478
+f 284//4 256//4 257//4
+f 385//4 386//4 187//4
+f 284//4 257//4 258//4
+f 384//4 385//4 187//4
+f 284//4 258//4 259//4
+f 383//4 384//4 187//4
+f 283//4 259//4 260//4
+f 382//4 383//4 187//4
+f 283//4 260//4 261//4
+f 313//4 198//4 199//4
+f 283//4 261//4 262//4
+f 373//4 374//4 188//4
+f 283//4 262//4 263//4
+f 188//4 381//4 382//4
+f 283//4 263//4 264//4
+f 188//4 380//4 381//4
+f 283//477 264//477 265//477
+f 188//4 374//4 375//4
+f 283//4 265//4 266//4
+f 380//4 188//4 379//4
+f 283//4 266//4 267//4
+f 379//4 188//4 378//4
+f 283//4 267//4 268//4
+f 378//4 188//4 377//4
+f 283//4 268//4 269//4
+f 377//4 188//4 376//4
+f 282//4 269//4 270//4
+f 313//4 199//4 200//4
+f 282//4 270//4 271//4
+f 376//4 188//4 375//4
+f 277//4 271//4 272//4
+f 313//4 314//4 198//4
+f 276//4 272//4 273//4
+f 313//4 200//4 201//4
+f 275//4 273//4 274//4
+f 104//4 371//4 372//4
+f 276//4 273//4 275//4
+f 104//4 370//4 371//4
+f 277//4 272//4 276//4
+f 104//4 369//4 370//4
+f 278//4 271//4 277//4
+f 104//4 366//4 367//4
+f 281//4 271//4 278//4
+f 104//4 365//4 366//4
+f 281//4 278//4 279//4
+f 104//4 364//4 365//4
+f 281//4 279//4 280//4
+f 104//4 367//4 368//4
+f 282//4 271//4 281//4
+f 104//4 361//4 362//4
+f 283//4 269//4 282//4
+f 104//4 362//4 363//4
+f 284//4 259//4 283//4
+f 104//4 103//4 349//4
+f 285//4 254//4 284//4
+f 104//4 349//4 350//4
+f 286//4 254//4 285//4
+f 104//4 350//4 351//4
+f 287//4 252//4 286//4
+f 104//4 351//4 352//4
+f 288//4 251//4 287//4
+f 104//4 352//4 353//4
+f 289//4 250//4 288//4
+f 104//4 353//4 354//4
+f 290//4 248//4 289//4
+f 104//4 354//4 355//4
+f 291//4 247//4 290//4
+f 104//4 355//4 356//4
+f 292//4 245//4 291//4
+f 104//4 356//4 357//4
+f 293//4 243//4 292//4
+f 104//4 357//4 358//4
+f 294//4 243//4 293//4
+f 104//4 358//4 359//4
+f 295//4 243//4 294//4
+f 104//4 359//4 360//4
+f 296//4 243//4 295//4
+f 104//4 360//4 361//4
+f 297//4 243//4 296//4
+f 104//4 363//4 364//4
+f 298//4 243//4 297//4
+f 104//4 368//4 369//4
+f 304//4 243//4 298//4
+f 334//4 104//4 372//4
+f 304//4 300//4 301//4
+f 337//4 343//4 104//4
+f 304//4 299//4 300//4
+f 104//4 347//4 348//4
+f 304//4 301//4 302//4
+f 104//4 346//4 347//4
+f 304//4 302//4 303//4
+f 104//4 345//4 346//4
+f 298//4 299//4 304//4
+f 104//4 344//4 345//4
+f 240//4 243//4 304//4
+f 104//4 343//4 344//4
+f 240//4 304//4 305//4
+f 337//4 65//4 343//4
+f 307//4 305//4 306//4
+f 337//4 61//4 65//4
+f 240//4 305//4 307//4
+f 337//4 62//4 61//4
+f 308//4 235//4 307//4
+f 337//4 342//4 62//4
+f 234//4 235//4 308//4
+f 337//4 341//4 342//4
+f 310//4 308//4 309//4
+f 337//4 340//4 341//4
+f 217//4 218//4 310//4
+f 337//4 339//4 340//4
+f 208//4 312//4 207//4
+f 337//4 338//4 339//4
+f 312//4 206//4 207//4
+f 336//4 337//4 104//4
+f 312//4 313//4 206//4
+f 335//4 336//4 104//4
+f 206//4 313//4 205//4
+f 334//4 335//4 104//4
+f 313//4 204//4 205//4
+f 333//4 334//4 372//4
+f 313//4 203//4 204//4
+f 332//4 333//4 372//4
+f 313//4 202//4 203//4
+f 373//4 332//4 372//4
+f 313//4 201//4 202//4
+f 373//4 331//4 332//4
+f 314//4 315//4 198//4
+f 373//4 330//4 331//4
+f 315//4 316//4 197//4
+f 373//4 329//4 330//4
+f 316//4 317//4 197//4
+f 373//4 328//4 329//4
+f 317//4 318//4 196//4
+f 373//4 327//4 328//4
+f 318//4 319//4 195//4
+f 373//4 326//4 327//4
+f 319//4 320//4 195//4
+f 373//4 325//4 326//4
+f 320//4 321//4 194//4
+f 373//4 191//4 325//4
+f 321//4 322//4 194//4
+f 325//4 192//4 324//4
+f 322//4 323//4 193//4
+f 62//5 342//5 63//5
+f 730//6 731//6 457//6
+f 681//6 687//6 688//6
+f 458//6 730//6 457//6
+f 681//6 688//6 689//6
+f 458//6 459//6 730//6
+f 681//6 689//6 690//6
+f 459//6 460//6 730//6
+f 680//6 690//6 691//6
+f 730//6 460//6 729//6
+f 685//6 686//6 687//6
+f 729//6 460//6 461//6
+f 606//6 691//6 692//6
+f 729//6 461//6 462//6
+f 684//6 685//6 687//6
+f 463//6 729//6 462//6
+f 606//6 692//6 693//6
+f 464//6 729//6 463//6
+f 683//6 684//6 687//6
+f 465//6 729//6 464//6
+f 606//6 693//6 694//6
+f 465//6 728//6 729//6
+f 606//6 694//6 695//6
+f 466//6 475//6 476//6
+f 682//6 683//6 687//6
+f 473//6 467//6 472//6
+f 606//6 695//6 696//6
+f 470//6 468//6 469//6
+f 604//6 696//6 697//6
+f 467//6 468//6 470//6
+f 604//6 697//6 698//6
+f 471//6 467//6 470//6
+f 681//6 682//6 687//6
+f 472//6 467//6 471//6
+f 604//6 698//6 699//6
+f 473//6 474//6 467//6
+f 604//6 699//6 700//6
+f 474//6 466//6 467//6
+f 604//6 700//6 701//6
+f 474//6 475//6 466//6
+f 603//6 701//6 702//6
+f 466//6 476//6 465//6
+f 603//6 702//6 703//6
+f 476//6 477//6 465//6
+f 680//6 681//6 690//6
+f 477//6 728//6 465//6
+f 603//6 703//6 704//6
+f 477//6 478//6 728//6
+f 602//6 704//6 705//6
+f 478//6 479//6 728//6
+f 602//6 705//6 706//6
+f 479//6 480//6 728//6
+f 602//6 706//6 707//6
+f 480//6 481//6 728//6
+f 602//6 707//6 708//6
+f 481//6 482//6 728//6
+f 602//6 708//6 709//6
+f 482//6 483//6 728//6
+f 601//6 709//6 710//6
+f 728//6 483//6 484//6
+f 606//6 679//6 680//6
+f 728//6 484//6 485//6
+f 607//6 678//6 679//6
+f 728//6 485//6 486//6
+f 607//6 677//6 678//6
+f 728//6 486//6 487//6
+f 675//6 676//6 677//6
+f 728//6 487//6 488//6
+f 607//6 675//6 677//6
+f 489//6 728//6 488//6
+f 672//6 673//6 674//6
+f 490//6 728//6 489//6
+f 671//6 672//6 674//6
+f 491//6 728//6 490//6
+f 610//6 671//6 674//6
+f 492//6 728//6 491//6
+f 610//6 616//6 671//6
+f 493//6 728//6 492//6
+f 671//6 617//6 618//6
+f 494//6 728//6 493//6
+f 619//6 671//6 618//6
+f 495//6 728//6 494//6
+f 620//6 621//6 671//6
+f 496//6 728//6 495//6
+f 671//6 621//6 622//6
+f 497//6 728//6 496//6
+f 670//6 671//6 622//6
+f 498//6 728//6 497//6
+f 669//6 670//6 622//6
+f 499//6 728//6 498//6
+f 623//6 669//6 622//6
+f 500//6 728//6 499//6
+f 623//6 668//6 669//6
+f 501//6 728//6 500//6
+f 623//6 667//6 668//6
+f 502//6 728//6 501//6
+f 623//6 624//6 667//6
+f 503//6 728//6 502//6
+f 667//6 624//6 666//6
+f 504//6 728//6 503//6
+f 666//6 624//6 625//6
+f 509//6 728//6 504//6
+f 665//6 666//6 625//6
+f 510//6 728//6 509//6
+f 664//6 665//6 625//6
+f 512//6 728//6 511//6
+f 626//6 664//6 625//6
+f 514//6 728//6 513//6
+f 626//6 663//6 664//6
+f 515//6 728//6 514//6
+f 626//6 627//6 663//6
+f 517//6 728//6 516//6
+f 663//6 627//6 662//6
+f 518//479 728//479 517//479
+f 662//6 627//6 628//6
+f 520//6 728//6 519//6
+f 661//6 662//6 628//6
+f 521//6 728//6 520//6
+f 660//6 661//6 628//6
+f 522//6 728//6 521//6
+f 629//6 660//6 628//6
+f 506//6 504//6 505//6
+f 629//6 630//6 660//6
+f 507//6 504//6 506//6
+f 660//6 630//6 659//6
+f 508//6 504//6 507//6
+f 631//6 654//6 655//6
+f 509//6 504//6 508//6
+f 631//6 653//6 654//6
+f 510//6 511//6 728//6
+f 631//6 652//6 653//6
+f 513//6 728//6 512//6
+f 631//6 651//6 652//6
+f 728//6 515//6 516//6
+f 631//6 650//6 651//6
+f 518//6 519//6 728//6
+f 648//480 649//480 631//480
+f 522//6 523//6 728//6
+f 647//6 648//6 631//6
+f 523//479 524//479 728//479
+f 646//6 647//6 631//6
+f 524//6 525//6 728//6
+f 645//6 631//6 632//6
+f 525//6 526//6 728//6
+f 644//6 632//6 643//6
+f 526//481 527//481 728//481
+f 643//6 637//6 642//6
+f 527//6 528//6 728//6
+f 639//6 640//6 641//6
+f 528//6 529//6 728//6
+f 635//6 633//6 634//6
+f 529//6 530//6 728//6
+f 635//6 636//6 633//6
+f 530//6 531//6 728//6
+f 633//6 636//6 643//6
+f 531//6 727//6 728//6
+f 643//6 636//6 637//6
+f 532//6 727//6 531//6
+f 638//6 641//6 642//6
+f 533//6 727//6 532//6
+f 638//6 639//6 641//6
+f 534//6 727//6 533//6
+f 642//6 637//6 638//6
+f 535//6 727//6 534//6
+f 643//6 632//6 633//6
+f 536//6 727//6 535//6
+f 644//6 645//6 632//6
+f 537//6 727//6 536//6
+f 645//6 646//6 631//6
+f 723//6 724//6 589//6
+f 631//479 649//479 650//479
+f 723//6 591//6 722//6
+f 630//6 631//6 655//6
+f 591//6 592//6 722//6
+f 656//6 630//6 655//6
+f 593//6 721//6 592//6
+f 656//6 657//6 630//6
+f 590//6 723//6 589//6
+f 630//6 657//6 658//6
+f 724//6 725//6 540//6
+f 659//6 630//6 658//6
+f 540//6 726//6 727//6
+f 619//6 620//6 671//6
+f 539//6 727//6 538//6
+f 610//6 613//6 614//6
+f 727//6 537//6 538//6
+f 610//6 614//6 615//6
+f 540//6 727//6 539//6
+f 610//6 612//6 613//6
+f 725//6 726//6 540//6
+f 610//6 615//6 616//6
+f 724//6 540//6 589//6
+f 610//6 611//6 612//6
+f 594//6 720//6 721//6
+f 671//6 616//6 617//6
+f 595//6 596//6 720//6
+f 609//6 610//6 674//6
+f 597//6 719//6 596//6
+f 607//6 609//6 674//6
+f 582//6 540//6 541//6
+f 607//6 608//6 609//6
+f 599//6 718//6 598//6
+f 607//6 674//6 675//6
+f 566//6 542//6 543//6
+f 606//6 607//6 679//6
+f 566//6 543//6 544//6
+f 691//6 606//6 680//6
+f 566//6 544//6 545//6
+f 604//6 605//6 606//6
+f 566//6 547//6 548//6
+f 604//6 606//6 696//6
+f 566//6 548//6 549//6
+f 603//6 604//6 701//6
+f 566//6 549//6 550//6
+f 601//6 710//6 711//6
+f 566//6 546//6 547//6
+f 601//6 711//6 712//6
+f 566//6 552//6 553//6
+f 602//6 603//6 704//6
+f 566//6 551//6 552//6
+f 601//6 712//6 713//6
+f 564//6 565//6 566//6
+f 601//6 713//6 714//6
+f 563//6 564//6 566//6
+f 601//6 714//6 715//6
+f 562//6 563//6 566//6
+f 601//6 602//6 709//6
+f 561//6 562//6 566//6
+f 716//6 601//6 715//6
+f 560//6 561//6 566//6
+f 716//6 717//6 601//6
+f 559//6 560//6 566//6
+f 601//6 717//6 600//6
+f 558//6 559//6 566//6
+f 600//6 717//6 599//6
+f 557//6 558//6 566//6
+f 599//6 717//6 718//6
+f 556//6 557//6 566//6
+f 598//6 718//6 597//6
+f 555//6 556//6 566//6
+f 597//6 718//6 719//6
+f 554//6 555//6 566//6
+f 596//6 719//6 720//6
+f 553//6 554//6 566//6
+f 595//6 720//6 594//6
+f 550//6 551//6 566//6
+f 594//6 721//6 593//6
+f 545//6 546//6 566//6
+f 721//6 722//6 592//6
+f 541//6 542//6 566//6
+f 566//6 567//6 568//6
+f 566//6 569//6 570//6
+f 566//6 571//6 572//6
+f 577//6 66//6 64//6
+f 577//6 63//6 456//6
+f 577//6 573//6 574//6
+f 575//6 576//6 577//6
+f 577//6 574//6 575//6
+f 577//6 64//6 63//6
+f 566//6 570//6 571//6
+f 569//6 566//6 568//6
+f 723//6 590//6 591//6
+f 566//6 577//6 578//6
+f 588//6 589//6 540//6
+f 566//6 578//6 579//6
+f 587//6 588//6 540//6
+f 566//6 579//6 580//6
+f 586//6 587//6 540//6
+f 541//6 580//6 581//6
+f 585//6 586//6 540//6
+f 456//6 573//6 577//6
+f 584//6 585//6 540//6
+f 541//6 581//6 582//6
+f 583//6 584//6 540//6
+f 540//6 582//6 583//6
+f 577//6 572//6 66//6
+f 580//6 541//6 566//6
+f 832//6 833//6 834//6
+f 783//6 687//6 686//6
+f 831//6 834//6 835//6
+f 782//6 783//6 686//6
+f 830//6 835//6 836//6
+f 781//6 782//6 686//6
+f 829//6 836//6 837//6
+f 780//6 781//6 686//6
+f 831//6 832//6 834//6
+f 779//6 780//6 686//6
+f 807//6 837//6 838//6
+f 778//6 779//6 686//6
+f 807//6 838//6 839//6
+f 777//6 778//6 686//6
+f 830//6 831//6 835//6
+f 776//6 777//6 686//6
+f 807//6 839//6 840//6
+f 775//6 776//6 686//6
+f 829//6 830//6 836//6
+f 774//6 775//6 686//6
+f 828//6 829//6 837//6
+f 773//6 774//6 686//6
+f 807//6 840//6 841//6
+f 772//6 773//6 686//6
+f 807//6 828//6 837//6
+f 771//6 772//6 686//6
+f 807//6 827//6 828//6
+f 770//6 771//6 686//6
+f 807//6 808//6 827//6
+f 769//6 770//6 686//6
+f 827//6 808//6 826//6
+f 768//6 769//6 686//6
+f 808//6 824//6 825//6
+f 767//6 768//6 686//6
+f 809//6 565//6 810//6
+f 766//6 767//6 686//6
+f 809//6 810//6 811//6
+f 765//6 766//6 686//6
+f 809//6 566//6 565//6
+f 764//6 765//6 686//6
+f 809//6 811//6 812//6
+f 763//6 764//6 686//6
+f 809//6 812//6 813//6
+f 762//6 763//6 686//6
+f 809//6 813//6 814//6
+f 761//6 762//6 686//6
+f 809//6 814//6 815//6
+f 760//6 761//6 686//6
+f 809//6 815//6 816//6
+f 784//6 760//6 686//6
+f 809//6 816//6 817//6
+f 784//6 759//6 760//6
+f 809//6 817//6 818//6
+f 784//6 797//6 759//6
+f 809//6 818//6 819//6
+f 759//6 798//6 758//6
+f 809//6 819//6 820//6
+f 758//6 799//6 757//6
+f 809//6 820//6 821//6
+f 800//6 755//6 756//6
+f 809//6 821//6 822//6
+f 800//6 754//6 755//6
+f 808//6 822//6 823//6
+f 800//6 753//6 754//6
+f 808//6 823//6 824//6
+f 800//6 801//6 753//6
+f 806//6 841//6 842//6
+f 753//6 801//6 752//6
+f 806//6 842//6 843//6
+f 752//6 801//6 751//6
+f 806//6 843//6 844//6
+f 751//6 801//6 750//6
+f 806//6 844//6 732//6
+f 750//6 801//6 749//6
+f 806//6 732//6 733//6
+f 799//6 756//6 757//6
+f 805//6 733//6 734//6
+f 749//6 801//6 802//6
+f 805//6 734//6 735//6
+f 748//6 749//6 802//6
+f 805//6 735//6 736//6
+f 796//6 784//6 785//6
+f 805//6 736//6 737//6
+f 794//6 785//6 786//6
+f 805//6 737//6 738//6
+f 747//6 748//6 802//6
+f 804//6 738//6 739//6
+f 746//6 802//6 803//6
+f 804//6 739//6 740//6
+f 793//6 786//6 787//6
+f 804//6 740//6 741//6
+f 745//6 746//6 803//6
+f 804//6 741//6 742//6
+f 841//6 806//6 807//6
+f 808//6 809//6 822//6
+f 733//6 805//6 806//6
+f 826//6 808//6 825//6
+f 792//6 787//6 788//6
+f 788//6 789//6 790//6
+f 788//6 791//6 792//6
+f 786//6 793//6 794//6
+f 785//6 795//6 796//6
+f 759//6 797//6 798//6
+f 802//6 746//6 747//6
+f 758//6 798//6 799//6
+f 785//6 794//6 795//6
+f 788//6 790//6 791//6
+f 796//6 797//6 784//6
+f 742//6 803//6 804//6
+f 804//6 805//6 738//6
+f 787//6 792//6 793//6
+f 756//6 799//6 800//6
+f 742//6 743//6 803//6
+f 744//6 745//6 803//6
+f 343//7 65//7 572//7
+f 654//482 260//482 655//482
+f 653//483 261//483 654//483
+f 652//484 262//484 653//484
+f 651//11 263//11 652//11
+f 650//12 264//12 651//12
+f 649//13 265//13 650//13
+f 648//485 266//485 649//485
+f 647//486 267//486 648//486
+f 646//16 268//16 647//16
+f 645//487 269//487 646//487
+f 644//18 270//18 645//18
+f 643//19 271//19 644//19
+f 642//20 272//20 643//20
+f 641//21 273//21 642//21
+f 640//22 274//22 641//22
+f 639//23 275//23 640//23
+f 638//24 276//24 639//24
+f 637//25 277//25 638//25
+f 636//26 278//26 637//26
+f 635//27 279//27 636//27
+f 634//28 280//28 635//28
+f 633//29 281//29 634//29
+f 632//30 282//30 633//30
+f 631//31 283//31 632//31
+f 630//32 284//32 631//32
+f 629//33 285//33 630//33
+f 628//34 286//34 629//34
+f 627//35 287//35 628//35
+f 626//36 288//36 627//36
+f 625//37 289//37 626//37
+f 624//38 290//38 625//38
+f 623//39 291//39 624//39
+f 622//40 292//40 623//40
+f 621//40 293//40 622//40
+f 620//40 294//40 621//40
+f 619//40 295//40 620//40
+f 618//40 296//40 619//40
+f 617//40 297//40 618//40
+f 616//40 298//40 617//40
+f 615//40 299//40 616//40
+f 614//40 300//40 615//40
+f 613//40 301//40 614//40
+f 612//40 302//40 613//40
+f 611//40 303//40 612//40
+f 610//41 304//41 611//41
+f 609//40 305//40 610//40
+f 608//42 306//42 609//42
+f 607//40 307//40 608//40
+f 606//43 308//43 607//43
+f 605//44 309//44 606//44
+f 604//45 310//45 605//45
+f 603//46 311//46 604//46
+f 602//47 312//47 603//47
+f 601//46 313//46 602//46
+f 600//48 314//48 601//48
+f 599//49 315//49 600//49
+f 598//50 316//50 599//50
+f 597//51 317//51 598//51
+f 596//52 318//52 597//52
+f 595//53 319//53 596//53
+f 594//54 320//54 595//54
+f 593//55 321//55 594//55
+f 592//56 322//56 593//56
+f 591//57 323//57 592//57
+f 590//58 324//58 591//58
+f 589//59 325//59 590//59
+f 588//60 326//60 589//60
+f 587//61 327//61 588//61
+f 586//62 328//62 587//62
+f 585//63 329//63 586//63
+f 584//64 330//64 585//64
+f 583//65 331//65 584//65
+f 582//66 332//66 583//66
+f 581//67 333//67 582//67
+f 580//68 334//68 581//68
+f 579//69 335//69 580//69
+f 578//70 336//70 579//70
+f 577//71 337//71 578//71
+f 338//4 337//4 878//4
+f 877//4 862//4 863//4
+f 338//473 878//473 879//473
+f 877//4 863//4 864//4
+f 338//4 879//4 880//4
+f 877//4 864//4 865//4
+f 338//4 880//4 881//4
+f 877//4 866//4 867//4
+f 338//4 881//4 882//4
+f 877//4 865//4 866//4
+f 338//4 882//4 883//4
+f 876//4 870//4 241//4
+f 338//4 883//4 884//4
+f 871//4 241//4 240//4
+f 338//4 884//4 845//4
+f 871//4 872//4 241//4
+f 338//4 845//4 846//4
+f 241//4 872//4 873//4
+f 338//4 846//4 847//4
+f 874//4 241//4 873//4
+f 338//4 847//4 848//4
+f 875//4 241//4 874//4
+f 338//4 848//4 849//4
+f 876//4 241//4 875//4
+f 338//4 849//4 850//4
+f 869//4 870//4 876//4
+f 338//4 850//4 851//4
+f 869//4 876//4 868//4
+f 338//4 851//4 852//4
+f 876//4 877//4 868//4
+f 338//4 852//4 853//4
+f 877//4 867//4 868//4
+f 338//4 853//4 854//4
+f 861//4 862//4 877//4
+f 338//4 854//4 855//4
+f 338//4 861//4 877//4
+f 338//4 855//4 856//4
+f 338//4 860//4 861//4
+f 338//4 856//4 857//4
+f 338//4 859//4 860//4
+f 338//4 857//4 858//4
+f 888//46 875//46 874//46
+f 891//46 877//46 876//46
+f 575//46 339//46 338//46
+f 338//46 576//46 575//46
+f 876//46 890//46 891//46
+f 873//46 887//46 888//46
+f 876//46 889//46 890//46
+f 891//46 576//46 338//46
+f 888//46 889//46 875//46
+f 887//46 873//46 872//46
+f 885//46 871//46 240//46
+f 675//46 239//46 238//46
+f 238//46 676//46 675//46
+f 240//46 674//46 885//46
+f 872//46 886//46 887//46
+f 877//46 891//46 338//46
+f 888//46 874//46 873//46
+f 675//46 240//46 239//46
+f 240//46 675//46 674//46
+f 876//46 875//46 889//46
+f 872//46 871//46 885//46
+f 340//46 339//46 574//46
+f 341//72 340//72 573//72
+f 342//73 341//73 456//73
+f 344//74 343//74 571//74
+f 345//75 344//75 570//75
+f 346//76 345//76 569//76
+f 347//77 346//77 568//77
+f 348//78 347//78 567//78
+f 104//79 348//79 566//79
+f 105//80 104//80 809//80
+f 799//40 115//40 114//40
+f 799//40 798//40 116//40
+f 114//40 800//40 799//40
+f 112//40 802//40 801//40
+f 110//40 804//40 803//40
+f 109//40 806//40 805//40
+f 105//40 809//40 808//40
+f 109//40 805//40 804//40
+f 106//40 808//40 807//40
+f 808//40 106//40 105//40
+f 807//40 108//40 107//40
+f 804//40 110//40 109//40
+f 802//40 112//40 111//40
+f 799//40 116//40 115//40
+f 801//40 113//40 112//40
+f 807//40 107//40 106//40
+f 803//40 111//40 110//40
+f 801//40 800//40 114//40
+f 111//40 803//40 802//40
+f 806//40 108//40 807//40
+f 801//40 114//40 113//40
+f 117//40 116//40 797//40
+f 118//81 117//81 796//81
+f 119//82 118//82 795//82
+f 120//83 119//83 794//83
+f 121//84 120//84 793//84
+f 122//85 121//85 792//85
+f 123//86 122//86 791//86
+f 124//87 123//87 790//87
+f 125//88 124//88 789//88
+f 126//89 125//89 788//89
+f 127//90 126//90 787//90
+f 128//91 127//91 786//91
+f 129//92 128//92 785//92
+f 130//93 129//93 784//93
+f 131//93 130//93 686//93
+f 682//93 232//93 231//93
+f 681//93 234//93 233//93
+f 677//93 237//93 236//93
+f 681//93 233//93 232//93
+f 678//93 236//93 235//93
+f 677//93 676//93 238//93
+f 236//93 678//93 677//93
+f 235//93 680//93 679//93
+f 232//93 682//93 681//93
+f 230//93 684//93 683//93
+f 131//93 686//93 685//93
+f 685//93 229//93 131//93
+f 683//93 231//93 230//93
+f 677//93 238//93 237//93
+f 235//93 679//93 678//93
+f 231//93 683//93 682//93
+f 230//93 229//93 685//93
+f 681//93 680//93 234//93
+f 230//93 685//93 684//93
+f 672//40 242//40 673//40
+f 671//40 243//40 672//40
+f 670//94 244//94 671//94
+f 669//95 245//95 670//95
+f 668//96 246//96 669//96
+f 667//97 247//97 668//97
+f 666//98 248//98 667//98
+f 665//99 249//99 666//99
+f 664//100 250//100 665//100
+f 663//101 251//101 664//101
+f 662//102 252//102 663//102
+f 661//103 253//103 662//103
+f 660//104 254//104 661//104
+f 659//105 255//105 660//105
+f 658//488 256//488 659//488
+f 657//489 257//489 658//489
+f 656//106 258//106 657//106
+f 655//490 259//490 656//490
+f 891//6 908//6 909//6
+f 899//6 577//6 576//6
+f 891//6 907//6 908//6
+f 898//480 899//480 576//480
+f 891//6 906//6 907//6
+f 897//6 898//6 576//6
+f 891//6 904//6 905//6
+f 896//6 897//6 576//6
+f 891//6 905//6 906//6
+f 895//6 896//6 576//6
+f 890//6 900//6 901//6
+f 894//6 895//6 576//6
+f 890//6 673//6 900//6
+f 893//6 894//6 576//6
+f 890//6 901//6 902//6
+f 892//6 893//6 576//6
+f 891//6 902//6 903//6
+f 924//6 892//6 576//6
+f 891//6 903//6 904//6
+f 923//6 924//6 576//6
+f 885//6 674//6 673//6
+f 922//6 923//6 576//6
+f 886//6 885//6 673//6
+f 921//6 922//6 576//6
+f 887//6 886//6 673//6
+f 920//6 921//6 576//6
+f 888//6 887//6 673//6
+f 919//6 920//6 576//6
+f 889//6 888//6 673//6
+f 918//6 919//6 576//6
+f 890//6 889//6 673//6
+f 917//6 918//6 576//6
+f 891//6 890//6 902//6
+f 916//6 917//6 576//6
+f 576//6 909//6 910//6
+f 915//6 916//6 576//6
+f 576//6 910//6 911//6
+f 914//6 915//6 576//6
+f 576//6 911//6 912//6
+f 913//6 914//6 576//6
+f 576//6 912//6 913//6
+f 899//110 878//110 577//110
+f 892//111 845//111 893//111
+f 924//112 846//112 892//112
+f 923//491 847//491 924//491
+f 922//114 848//114 923//114
+f 921//115 849//115 922//115
+f 920//116 850//116 921//116
+f 919//117 851//117 920//117
+f 918//118 852//118 919//118
+f 917//119 853//119 918//119
+f 916//120 854//120 917//120
+f 915//121 855//121 916//121
+f 914//122 856//122 915//122
+f 913//123 857//123 914//123
+f 912//124 858//124 913//124
+f 911//125 859//125 912//125
+f 910//126 860//126 911//126
+f 909//127 861//127 910//127
+f 908//40 862//40 909//40
+f 907//40 863//40 908//40
+f 906//40 864//40 907//40
+f 905//40 865//40 906//40
+f 904//40 866//40 905//40
+f 903//40 867//40 904//40
+f 902//40 868//40 903//40
+f 901//40 869//40 902//40
+f 900//40 870//40 901//40
+f 673//40 241//40 900//40
+f 898//492 879//492 899//492
+f 897//129 880//129 898//129
+f 896//130 881//130 897//130
+f 895//131 882//131 896//131
+f 894//132 883//132 895//132
+f 893//493 884//493 894//493
+f 715//134 200//134 716//134
+f 714//135 201//135 715//135
+f 716//136 199//136 717//136
+f 713//137 202//137 714//137
+f 717//138 198//138 718//138
+f 712//139 203//139 713//139
+f 718//140 197//140 719//140
+f 711//141 204//141 712//141
+f 719//142 196//142 720//142
+f 710//143 205//143 711//143
+f 720//144 195//144 721//144
+f 709//145 206//145 710//145
+f 721//146 194//146 722//146
+f 708//147 207//147 709//147
+f 722//148 193//148 723//148
+f 707//149 208//149 708//149
+f 723//150 192//150 724//150
+f 706//151 209//151 707//151
+f 724//152 191//152 725//152
+f 705//153 210//153 706//153
+f 725//154 190//154 726//154
+f 704//155 211//155 705//155
+f 726//156 189//156 727//156
+f 703//157 212//157 704//157
+f 727//158 188//158 728//158
+f 702//159 213//159 703//159
+f 728//160 187//160 729//160
+f 701//161 214//161 702//161
+f 729//162 186//162 730//162
+f 700//163 215//163 701//163
+f 730//164 185//164 731//164
+f 699//165 216//165 700//165
+f 731//166 184//166 457//166
+f 698//167 217//167 699//167
+f 457//168 183//168 458//168
+f 697//169 218//169 698//169
+f 458//170 455//170 459//170
+f 696//171 219//171 697//171
+f 459//172 454//172 460//172
+f 695//173 220//173 696//173
+f 460//174 453//174 461//174
+f 694//175 221//175 695//175
+f 461//176 452//176 462//176
+f 693//177 222//177 694//177
+f 462//178 451//178 463//178
+f 692//179 223//179 693//179
+f 463//180 450//180 464//180
+f 691//181 224//181 692//181
+f 464//182 449//182 465//182
+f 690//183 225//183 691//183
+f 465//184 448//184 466//184
+f 689//185 226//185 690//185
+f 466//186 447//186 467//186
+f 688//187 227//187 689//187
+f 467//188 446//188 468//188
+f 687//189 228//189 688//189
+f 468//494 445//494 469//494
+f 783//191 132//191 687//191
+f 469//192 444//192 470//192
+f 782//193 133//193 783//193
+f 470//194 443//194 471//194
+f 781//195 134//195 782//195
+f 471//196 442//196 472//196
+f 780//197 135//197 781//197
+f 472//198 441//198 473//198
+f 779//199 136//199 780//199
+f 473//495 440//495 474//495
+f 778//496 137//496 779//496
+f 474//202 439//202 475//202
+f 777//497 138//497 778//497
+f 475//204 438//204 476//204
+f 776//205 139//205 777//205
+f 476//206 437//206 477//206
+f 775//207 140//207 776//207
+f 477//498 436//498 478//498
+f 774//499 141//499 775//499
+f 478//210 435//210 479//210
+f 773//211 142//211 774//211
+f 479//212 434//212 480//212
+f 772//213 143//213 773//213
+f 480//500 433//500 481//500
+f 771//215 144//215 772//215
+f 481//501 432//501 482//501
+f 770//217 145//217 771//217
+f 482//218 431//218 483//218
+f 769//219 146//219 770//219
+f 483//502 430//502 484//502
+f 768//503 147//503 769//503
+f 484//222 429//222 485//222
+f 767//223 148//223 768//223
+f 485//504 428//504 486//504
+f 766//225 149//225 767//225
+f 486//505 427//505 487//505
+f 765//227 150//227 766//227
+f 487//506 426//506 488//506
+f 764//229 151//229 765//229
+f 488//230 425//230 489//230
+f 763//231 152//231 764//231
+f 489//507 424//507 490//507
+f 762//233 153//233 763//233
+f 490//234 423//234 491//234
+f 761//235 154//235 762//235
+f 491//508 422//508 492//508
+f 760//237 155//237 761//237
+f 492//509 421//509 493//509
+f 759//239 156//239 760//239
+f 493//510 420//510 494//510
+f 758//241 157//241 759//241
+f 494//242 419//242 495//242
+f 757//243 158//243 758//243
+f 495//244 418//244 496//244
+f 756//245 159//245 757//245
+f 496//511 417//511 497//511
+f 755//247 160//247 756//247
+f 497//512 416//512 498//512
+f 754//249 161//249 755//249
+f 498//513 415//513 499//513
+f 753//251 162//251 754//251
+f 499//514 414//514 500//514
+f 752//253 163//253 753//253
+f 500//515 413//515 501//515
+f 751//255 164//255 752//255
+f 501//256 412//256 502//256
+f 750//257 165//257 751//257
+f 502//516 411//516 503//516
+f 749//259 166//259 750//259
+f 503//517 410//517 504//517
+f 748//261 167//261 749//261
+f 504//238 409//238 505//238
+f 747//262 168//262 748//262
+f 505//518 408//518 506//518
+f 746//264 169//264 747//264
+f 506//519 407//519 507//519
+f 745//266 170//266 746//266
+f 507//267 406//267 508//267
+f 744//268 171//268 745//268
+f 508//269 405//269 509//269
+f 743//270 172//270 744//270
+f 509//271 404//271 510//271
+f 742//272 173//272 743//272
+f 510//520 403//520 511//520
+f 741//274 174//274 742//274
+f 511//521 402//521 512//521
+f 740//276 175//276 741//276
+f 512//277 401//277 513//277
+f 739//278 176//278 740//278
+f 513//522 400//522 514//522
+f 738//280 177//280 739//280
+f 514//281 399//281 515//281
+f 737//282 178//282 738//282
+f 515//523 398//523 516//523
+f 736//284 179//284 737//284
+f 516//285 397//285 517//285
+f 735//286 180//286 736//286
+f 517//285 396//285 518//285
+f 734//287 181//287 735//287
+f 518//285 395//285 519//285
+f 733//288 182//288 734//288
+f 519//285 394//285 520//285
+f 732//289 67//289 733//289
+f 520//285 393//285 521//285
+f 844//290 68//290 732//290
+f 521//285 392//285 522//285
+f 843//291 69//291 844//291
+f 522//285 391//285 523//285
+f 842//292 70//292 843//292
+f 523//285 390//285 524//285
+f 841//293 71//293 842//293
+f 524//285 389//285 525//285
+f 840//294 72//294 841//294
+f 525//285 388//285 526//285
+f 839//295 73//295 840//295
+f 526//285 387//285 527//285
+f 838//296 74//296 839//296
+f 527//285 386//285 528//285
+f 837//297 75//297 838//297
+f 528//524 385//524 529//524
+f 836//299 76//299 837//299
+f 529//525 384//525 530//525
+f 835//301 77//301 836//301
+f 530//526 383//526 531//526
+f 834//303 78//303 835//303
+f 531//527 382//527 532//527
+f 833//305 79//305 834//305
+f 532//528 381//528 533//528
+f 832//307 80//307 833//307
+f 533//529 380//529 534//529
+f 831//309 81//309 832//309
+f 534//310 379//310 535//310
+f 830//311 82//311 831//311
+f 535//312 378//312 536//312
+f 829//313 83//313 830//313
+f 536//530 377//530 537//530
+f 828//315 84//315 829//315
+f 537//316 376//316 538//316
+f 827//317 85//317 828//317
+f 538//318 375//318 539//318
+f 826//319 86//319 827//319
+f 539//531 374//531 540//531
+f 825//321 87//321 826//321
+f 540//40 373//40 541//40
+f 824//322 88//322 825//322
+f 541//323 372//323 542//323
+f 823//324 89//324 824//324
+f 542//323 371//323 543//323
+f 822//325 90//325 823//325
+f 543//323 370//323 544//323
+f 821//326 91//326 822//326
+f 544//323 369//323 545//323
+f 820//327 92//327 821//327
+f 545//323 368//323 546//323
+f 819//328 93//328 820//328
+f 546//323 367//323 547//323
+f 818//329 94//329 819//329
+f 547//323 366//323 548//323
+f 817//330 95//330 818//330
+f 548//323 365//323 549//323
+f 816//331 96//331 817//331
+f 549//323 364//323 550//323
+f 815//532 97//532 816//532
+f 550//323 363//323 551//323
+f 814//333 98//333 815//333
+f 551//323 362//323 552//323
+f 813//334 99//334 814//334
+f 552//323 361//323 553//323
+f 812//335 100//335 813//335
+f 553//336 360//336 554//336
+f 811//337 101//337 812//337
+f 554//338 359//338 555//338
+f 810//339 102//339 811//339
+f 555//533 358//533 556//533
+f 565//341 103//341 810//341
+f 556//342 357//342 557//342
+f 564//343 349//343 565//343
+f 557//344 356//344 558//344
+f 563//345 350//345 564//345
+f 558//534 355//534 559//534
+f 562//347 351//347 563//347
+f 559//535 354//535 560//535
+f 561//349 352//349 562//349
+f 560//350 353//350 561//350
+f 1012//4 1044//4 925//4
+f 1013//4 1014//4 1043//4
+f 1020//4 1040//4 1041//4
+f 1029//4 1033//4 1039//4
+f 1038//4 1036//4 1037//4
+f 1038//4 1039//4 1035//4
+f 1031//4 1032//4 1033//4
+f 1029//536 1030//536 1031//536
+f 1039//4 1028//4 1029//4
+f 1039//4 1026//4 1027//4
+f 1039//4 1024//4 1025//4
+f 1040//4 1022//4 1023//4
+f 1040//4 1020//4 1021//4
+f 1041//4 1018//4 1019//4
+f 1041//4 1016//4 1017//4
+f 1016//4 1042//4 1015//4
+f 1044//4 1012//4 1013//4
+f 926//4 1010//4 1011//4
+f 927//4 1008//4 1009//4
+f 929//4 1006//4 1007//4
+f 931//4 1004//4 1005//4
+f 933//4 1002//4 1003//4
+f 935//4 1000//4 1001//4
+f 937//4 998//4 999//4
+f 939//4 996//4 997//4
+f 941//4 994//4 995//4
+f 943//4 992//4 993//4
+f 992//4 944//4 991//4
+f 946//4 988//4 989//4
+f 948//4 986//4 987//4
+f 949//4 984//4 985//4
+f 984//4 951//4 983//4
+f 953//4 980//4 981//4
+f 975//4 978//4 979//4
+f 978//4 976//4 977//4
+f 954//4 974//4 975//4
+f 954//4 972//4 973//4
+f 954//4 970//4 971//4
+f 954//4 955//4 969//4
+f 955//4 966//4 967//4
+f 955//4 964//4 965//4
+f 955//4 962//4 963//4
+f 956//4 960//4 961//4
+f 957//4 958//4 959//4
+f 960//4 956//4 957//4
+f 965//4 966//4 955//4
+f 981//4 952//4 953//4
+f 952//4 982//4 951//4
+f 985//4 948//4 949//4
+f 988//4 946//4 947//4
+f 989//4 990//4 945//4
+f 993//4 942//4 943//4
+f 995//4 940//4 941//4
+f 997//4 938//4 939//4
+f 999//4 936//4 937//4
+f 1001//4 934//4 935//4
+f 1003//4 932//4 933//4
+f 1005//4 930//4 931//4
+f 1007//4 928//4 929//4
+f 1009//4 926//4 927//4
+f 1013//4 1043//4 1044//4
+f 1023//4 1039//4 1040//4
+f 1038//4 1035//4 1036//4
+f 1029//537 1031//537 1033//537
+f 1039//4 1027//4 1028//4
+f 1039//4 1023//4 1024//4
+f 1041//4 1019//4 1020//4
+f 1041//4 1042//4 1016//4
+f 925//4 1011//4 1012//4
+f 928//4 1007//4 1008//4
+f 932//4 1003//4 1004//4
+f 936//4 999//4 1000//4
+f 940//4 995//4 996//4
+f 943//4 944//4 992//4
+f 947//4 987//4 988//4
+f 949//4 950//4 984//4
+f 953//4 954//4 980//4
+f 978//4 975//4 976//4
+f 954//4 971//4 972//4
+f 969//4 955//4 968//4
+f 955//4 963//4 964//4
+f 957//4 959//4 960//4
+f 961//4 955//4 956//4
+f 981//4 982//4 952//4
+f 987//4 947//4 948//4
+f 945//4 990//4 991//4
+f 996//4 939//4 940//4
+f 1000//4 935//4 936//4
+f 1004//4 931//4 932//4
+f 1008//4 927//4 928//4
+f 1043//4 1014//4 1042//4
+f 1035//4 1039//4 1034//4
+f 1039//473 1025//473 1026//473
+f 1041//4 1017//4 1018//4
+f 926//4 1009//4 1010//4
+f 933//4 934//4 1002//4
+f 941//4 942//4 994//4
+f 948//4 985//4 986//4
+f 954//4 975//4 979//4
+f 954//4 969//4 970//4
+f 955//4 961//4 962//4
+f 955//4 967//4 968//4
+f 989//4 945//4 946//4
+f 997//4 998//4 938//4
+f 1005//4 1006//4 930//4
+f 1039//473 1033//473 1034//473
+f 1040//4 1021//4 1022//4
+f 929//4 930//4 1006//4
+f 994//4 942//4 993//4
+f 980//4 954//4 979//4
+f 973//4 974//4 954//4
+f 944//4 945//4 991//4
+f 1011//4 925//4 926//4
+f 1015//4 1042//4 1014//4
+f 984//4 950//4 951//4
+f 951//4 982//4 983//4
+f 934//4 1001//4 1002//4
+f 1090//6 1164//6 1045//6
+f 1092//6 1162//6 1163//6
+f 1093//6 1094//6 1161//6
+f 1095//6 1096//6 1159//6
+f 1098//6 1156//6 1157//6
+f 1100//6 1154//6 1155//6
+f 1101//6 1102//6 1153//6
+f 1103//6 1104//6 1151//6
+f 1107//6 1148//6 1149//6
+f 1109//6 1110//6 1147//6
+f 1111//6 1144//6 1145//6
+f 1114//6 1142//6 1143//6
+f 1126//6 1140//6 1141//6
+f 1135//6 1138//6 1139//6
+f 1138//6 1136//6 1137//6
+f 1139//6 1134//6 1135//6
+f 1140//6 1132//6 1133//6
+f 1140//6 1130//6 1131//6
+f 1140//6 1128//6 1129//6
+f 1140//6 1126//6 1127//6
+f 1141//6 1124//6 1125//6
+f 1141//6 1122//6 1123//6
+f 1141//6 1120//6 1121//6
+f 1117//6 1118//6 1119//6
+f 1120//6 1116//6 1117//6
+f 1142//6 1114//6 1115//6
+f 1144//6 1112//6 1113//6
+f 1145//6 1146//6 1111//6
+f 1147//6 1108//6 1109//6
+f 1149//6 1106//6 1107//6
+f 1106//6 1150//6 1105//6
+f 1151//6 1152//6 1103//6
+f 1154//6 1100//6 1101//6
+f 1156//6 1098//6 1099//6
+f 1157//6 1158//6 1097//6
+f 1159//6 1160//6 1095//6
+f 1162//6 1092//6 1093//6
+f 1164//6 1090//6 1091//6
+f 1045//6 1046//6 1089//6
+f 1047//6 1048//6 1087//6
+f 1049//6 1084//6 1085//6
+f 1051//6 1082//6 1083//6
+f 1053//6 1080//6 1081//6
+f 1053//6 1054//6 1079//6
+f 1054//6 1076//6 1077//6
+f 1054//6 1055//6 1075//6
+f 1055//6 1072//6 1073//6
+f 1056//6 1070//6 1071//6
+f 1056//6 1068//6 1069//6
+f 1065//6 1066//6 1067//6
+f 1063//538 1064//538 1065//538
+f 1061//539 1062//539 1063//539
+f 1056//6 1060//6 1061//6
+f 1057//6 1058//6 1059//6
+f 1060//6 1056//6 1057//6
+f 1056//480 1069//480 1070//480
+f 1081//6 1052//6 1053//6
+f 1083//6 1050//6 1051//6
+f 1085//6 1086//6 1049//6
+f 1087//6 1088//6 1047//6
+f 1091//6 1163//6 1164//6
+f 1161//6 1094//6 1160//6
+f 1099//6 1155//6 1156//6
+f 1153//6 1102//6 1152//6
+f 1108//6 1147//6 1148//6
+f 1113//6 1143//6 1144//6
+f 1133//6 1134//6 1140//6
+f 1138//6 1135//6 1136//6
+f 1140//6 1131//6 1132//6
+f 1140//6 1127//6 1128//6
+f 1141//6 1123//6 1124//6
+f 1117//6 1119//6 1120//6
+f 1141//6 1115//6 1116//6
+f 1144//6 1111//6 1112//6
+f 1148//6 1107//6 1108//6
+f 1105//6 1150//6 1104//6
+f 1155//6 1099//6 1100//6
+f 1097//6 1158//6 1096//6
+f 1163//6 1091//6 1092//6
+f 1089//6 1046//6 1088//6
+f 1050//6 1083//6 1084//6
+f 1053//6 1079//6 1080//6
+f 1054//6 1075//6 1076//6
+f 1055//6 1056//6 1072//6
+f 1056//6 1067//6 1068//6
+f 1061//6 1063//6 1065//6
+f 1057//6 1059//6 1060//6
+f 1061//6 1067//6 1056//6
+f 1082//6 1051//6 1052//6
+f 1049//6 1086//6 1048//6
+f 1093//6 1161//6 1162//6
+f 1101//6 1153//6 1154//6
+f 1147//6 1110//6 1146//6
+f 1140//6 1134//6 1139//6
+f 1140//6 1129//6 1130//6
+f 1141//6 1121//6 1122//6
+f 1143//6 1113//6 1114//6
+f 1149//6 1150//6 1106//6
+f 1157//6 1097//6 1098//6
+f 1045//6 1089//6 1090//6
+f 1052//6 1081//6 1082//6
+f 1075//6 1055//6 1074//6
+f 1061//540 1065//540 1067//540
+f 1056//6 1071//6 1072//6
+f 1084//6 1049//6 1050//6
+f 1160//6 1094//6 1095//6
+f 1115//6 1141//6 1142//6
+f 1141//6 1125//6 1126//6
+f 1111//6 1146//6 1110//6
+f 1096//6 1158//6 1159//6
+f 1079//6 1054//6 1078//6
+f 1073//6 1074//6 1055//6
+f 1048//6 1086//6 1087//6
+f 1116//6 1120//6 1141//6
+f 1104//6 1150//6 1151//6
+f 1078//6 1054//6 1077//6
+f 1152//6 1102//6 1103//6
+f 1135//351 960//351 1136//351
+f 1134//352 961//352 1135//352
+f 1136//353 959//353 1137//353
+f 1133//354 962//354 1134//354
+f 1137//355 958//355 1138//355
+f 1132//541 963//541 1133//541
+f 1138//357 957//357 1139//357
+f 1131//358 964//358 1132//358
+f 1139//359 956//359 1140//359
+f 1130//341 965//341 1131//341
+f 1140//360 955//360 1141//360
+f 1129//542 966//542 1130//542
+f 1141//362 954//362 1142//362
+f 1128//543 967//543 1129//543
+f 1142//364 953//364 1143//364
+f 1127//365 968//365 1128//365
+f 1143//366 952//366 1144//366
+f 1126//367 969//367 1127//367
+f 1144//368 951//368 1145//368
+f 1125//544 970//544 1126//544
+f 1145//370 950//370 1146//370
+f 1124//545 971//545 1125//545
+f 1146//372 949//372 1147//372
+f 1123//546 972//546 1124//546
+f 1147//374 948//374 1148//374
+f 1122//375 973//375 1123//375
+f 1148//376 947//376 1149//376
+f 1121//377 974//377 1122//377
+f 1149//378 946//378 1150//378
+f 1120//379 975//379 1121//379
+f 1150//380 945//380 1151//380
+f 1119//381 976//381 1120//381
+f 1151//382 944//382 1152//382
+f 1118//383 977//383 1119//383
+f 1152//384 943//384 1153//384
+f 1117//385 978//385 1118//385
+f 1153//386 942//386 1154//386
+f 1116//387 979//387 1117//387
+f 1154//388 941//388 1155//388
+f 1115//389 980//389 1116//389
+f 1155//390 940//390 1156//390
+f 1114//391 981//391 1115//391
+f 1156//392 939//392 1157//392
+f 1113//393 982//393 1114//393
+f 1157//394 938//394 1158//394
+f 1112//395 983//395 1113//395
+f 1158//396 937//396 1159//396
+f 1111//397 984//397 1112//397
+f 1159//398 936//398 1160//398
+f 1110//399 985//399 1111//399
+f 1160//400 935//400 1161//400
+f 1109//401 986//401 1110//401
+f 1161//402 934//402 1162//402
+f 1108//403 987//403 1109//403
+f 1162//404 933//404 1163//404
+f 1107//405 988//405 1108//405
+f 1163//406 932//406 1164//406
+f 1106//407 989//407 1107//407
+f 1164//408 931//408 1045//408
+f 1105//409 990//409 1106//409
+f 1045//410 930//410 1046//410
+f 1104//411 991//411 1105//411
+f 1046//412 929//412 1047//412
+f 1103//413 992//413 1104//413
+f 1047//414 928//414 1048//414
+f 1102//415 993//415 1103//415
+f 1048//416 927//416 1049//416
+f 1101//417 994//417 1102//417
+f 1049//418 926//418 1050//418
+f 1100//419 995//419 1101//419
+f 1050//420 925//420 1051//420
+f 1099//421 996//421 1100//421
+f 1051//422 1044//422 1052//422
+f 1098//423 997//423 1099//423
+f 1052//424 1043//424 1053//424
+f 1097//425 998//425 1098//425
+f 1053//426 1042//426 1054//426
+f 1096//427 999//427 1097//427
+f 1054//428 1041//428 1055//428
+f 1095//429 1000//429 1096//429
+f 1055//430 1040//430 1056//430
+f 1094//431 1001//431 1095//431
+f 1056//432 1039//432 1057//432
+f 1093//433 1002//433 1094//433
+f 1057//434 1038//434 1058//434
+f 1092//435 1003//435 1093//435
+f 1058//436 1037//436 1059//436
+f 1091//437 1004//437 1092//437
+f 1059//438 1036//438 1060//438
+f 1090//439 1005//439 1091//439
+f 1060//440 1035//440 1061//440
+f 1089//441 1006//441 1090//441
+f 1061//547 1034//547 1062//547
+f 1088//443 1007//443 1089//443
+f 1062//444 1033//444 1063//444
+f 1087//445 1008//445 1088//445
+f 1063//548 1032//548 1064//548
+f 1086//447 1009//447 1087//447
+f 1064//549 1031//549 1065//549
+f 1085//449 1010//449 1086//449
+f 1065//550 1030//550 1066//550
+f 1084//451 1011//451 1085//451
+f 1066//551 1029//551 1067//551
+f 1083//453 1012//453 1084//453
+f 1067//454 1028//454 1068//454
+f 1082//455 1013//455 1083//455
+f 1068//456 1027//456 1069//456
+f 1081//457 1014//457 1082//457
+f 1069//552 1026//552 1070//552
+f 1080//459 1015//459 1081//459
+f 1070//553 1025//553 1071//553
+f 1079//461 1016//461 1080//461
+f 1071//462 1024//462 1072//462
+f 1078//463 1017//463 1079//463
+f 1072//554 1023//554 1073//554
+f 1077//465 1018//465 1078//465
+f 1073//466 1022//466 1074//466
+f 1076//467 1019//467 1077//467
+f 1074//468 1021//468 1075//468
+f 1075//469 1020//469 1076//469
+o Curve_path22
+v 0.138516 0.000000 1.118892
+v 0.138067 0.000000 1.118845
+v 0.137614 0.000000 1.118798
+v 0.137159 0.000000 1.118750
+v 0.136702 0.000000 1.118701
+v 0.136243 0.000000 1.118652
+v 0.135784 0.000000 1.118602
+v 0.135325 0.000000 1.118550
+v 0.134866 0.000000 1.118497
+v 0.134409 0.000000 1.118442
+v 0.133954 0.000000 1.118385
+v 0.133501 0.000000 1.118326
+v 0.133052 0.000000 1.118264
+v 0.133501 0.000000 1.118326
+v 0.133954 0.000000 1.118385
+v 0.134409 0.000000 1.118442
+v 0.134866 0.000000 1.118497
+v 0.135325 0.000000 1.118550
+v 0.135784 0.000000 1.118602
+v 0.136243 0.000000 1.118652
+v 0.136702 0.000000 1.118701
+v 0.137159 0.000000 1.118750
+v 0.137614 0.000000 1.118798
+v 0.138067 0.000000 1.118845
+vn 0.000000 0.000000 1.000000
+vn 0.000000 1.000000 0.000000
+usemtl SVGMat.001
+s off
+f 1176//555 1178//555 1177//555
+f 1176//555 1179//555 1178//555
+f 1175//555 1179//555 1176//555
+f 1175//555 1180//555 1179//555
+f 1174//556 1180//556 1175//556
+f 1174//556 1181//556 1180//556
+f 1173//556 1181//556 1174//556
+f 1173//556 1182//556 1181//556
+f 1172//556 1182//556 1173//556
+f 1172//556 1183//556 1182//556
+f 1171//556 1183//556 1172//556
+f 1171//556 1184//556 1183//556
+f 1170//555 1184//555 1171//555
+f 1170//555 1185//555 1184//555
+f 1169//555 1185//555 1170//555
+f 1169//555 1186//555 1185//555
+f 1168//555 1186//555 1169//555
+f 1168//555 1187//555 1186//555
+f 1167//556 1187//556 1168//556
+f 1167//556 1188//556 1187//556
+f 1166//556 1188//556 1167//556
+f 1166//556 1165//556 1188//556
diff --git a/examples/qt3d/controls/controls.pro b/examples/qt3d/controls/controls.pro
new file mode 100644
index 000000000..7b6500a98
--- /dev/null
+++ b/examples/qt3d/controls/controls.pro
@@ -0,0 +1,12 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+QT += qml quick
+
+SOURCES += main.cpp
+
+RESOURCES += controls.qrc
+
+OTHER_FILES += main.qml \
+ Logo.qml
diff --git a/examples/qt3d/controls/controls.qrc b/examples/qt3d/controls/controls.qrc
new file mode 100644
index 000000000..9ff739d07
--- /dev/null
+++ b/examples/qt3d/controls/controls.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>Logo.qml</file>
+ <file>Qt_logo.obj</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/exampleresources.h b/examples/qt3d/controls/main.cpp
index c2d75873d..89744b04d 100644
--- a/examples/qt3d/exampleresources/exampleresources.h
+++ b/examples/qt3d/controls/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
@@ -34,15 +34,19 @@
**
****************************************************************************/
-#ifndef QT3D_EXAMPLERESOURCES_H
-#define QT3D_EXAMPLERESOURCES_H
+#include <QGuiApplication>
+#include <QQuickView>
-#include <QResource>
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
-#define QT3D_XSTRINGIFY(s) QT3D_STRINGIFY(s)
-#define QT3D_STRINGIFY(s) #s
+ QQuickView view;
-bool initializeAssetResources( const QString& fileName );
-
-#endif // QT3D_EXAMPLERESOURCES_H
+ view.resize(520, 500);
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:/main.qml"));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/qt3d/controls/main.qml b/examples/qt3d/controls/main.qml
new file mode 100644
index 000000000..00874cc9a
--- /dev/null
+++ b/examples/qt3d/controls/main.qml
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Scene3D 2.0
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ id: main
+
+ property real rotationValue: 0
+
+ Scene3D {
+ id: scene3D
+ width: Math.min(parent.width, parent.height) - 100
+ height: width
+ anchors.verticalCenter: parent.verticalCenter
+ focus: true
+ aspects: "input"
+
+ Logo {
+ id: watch
+ }
+ }
+
+ ColumnLayout {
+ id: colorLayout
+ anchors.left: scene3D.right
+ anchors.leftMargin: 5
+ anchors.right: parent.right
+ anchors.rightMargin: 15
+ anchors.top: scene3D.top
+ spacing: 5
+
+ Text { text: "Appearance"; font.bold: true }
+ Text { text: "Ambient color RGB" }
+ RowLayout {
+ Text { text: "R" }
+ Slider {
+ id: color_r
+ Layout.fillWidth: true
+ minimumValue: 0
+ maximumValue: 255
+ value: 128
+ }
+ }
+ RowLayout {
+ Text { text: "G" }
+ Slider {
+ id: color_g
+ Layout.fillWidth: true
+ minimumValue: 0
+ maximumValue: 255
+ value: 195
+ }
+ }
+ RowLayout {
+ Text { text: "B" }
+ Slider {
+ id: color_b
+ Layout.fillWidth: true
+ minimumValue: 0
+ maximumValue: 255
+ value: 66
+ }
+ }
+ Text { text: "Shininess" }
+ Slider {
+ id: shining
+ Layout.fillWidth: true
+ minimumValue: 30
+ maximumValue: 90
+ value: 50
+ }
+ }
+
+ ColumnLayout {
+ id: transformLayout
+ anchors.left: scene3D.right
+ anchors.leftMargin: 5
+ anchors.right: parent.right
+ anchors.rightMargin: 15
+ anchors.top: colorLayout.bottom
+ anchors.topMargin: 10
+ spacing: 5
+
+ Text { text: "Item transform"; font.bold: true }
+ Text { text: "Rotation" }
+ RowLayout {
+ Text { text: "X" }
+ Slider {
+ id: rotation_x
+ Layout.fillWidth: true
+ minimumValue: 45
+ maximumValue: 135
+ value: rotationValue + 90
+ }
+ }
+ RowLayout {
+ Text { text: "Y" }
+ Slider {
+ id: rotation_y
+ Layout.fillWidth: true
+ minimumValue: 135
+ maximumValue: 225
+ value: rotationValue + 180
+ }
+ }
+ RowLayout {
+ Text { text: "Z" }
+ Slider {
+ id: rotation_z
+ Layout.fillWidth: true
+ minimumValue: -45
+ maximumValue: 45
+ value: rotationValue
+ }
+ }
+
+ RowLayout {
+ CheckBox {id: animation; text: "Animation"; checked: false}
+ }
+ }
+
+ ColumnLayout {
+ id: cameraLayout
+ anchors.left: scene3D.right
+ anchors.leftMargin: 5
+ anchors.right: parent.right
+ anchors.rightMargin: 15
+ anchors.top: transformLayout.bottom
+ anchors.topMargin: 10
+ spacing: 5
+
+ Text { text: "Camera"; font.bold: true }
+ Text { text: "View Center Z" }
+ Slider {
+ id: viewCenter_z
+ Layout.fillWidth: true
+ minimumValue: -12
+ maximumValue: -4
+ value: -7.5
+ }
+ }
+
+ SequentialAnimation {
+ running: true
+ paused: !animation.checked
+ loops: Animation.Infinite
+
+ NumberAnimation {
+ target: main
+ property: "rotationValue"
+ easing.type: Easing.OutQuad
+ duration: 1000
+ from: 0
+ to: 45
+ }
+ NumberAnimation {
+ target: main
+ property: "rotationValue"
+ easing.type: Easing.InOutQuad
+ duration: 1000
+ from: 45
+ to: -45
+ }
+ NumberAnimation {
+ target: main
+ property: "rotationValue"
+ easing.type: Easing.InQuad
+ duration: 1000
+ from: -45
+ to: 0
+ }
+ }
+}
diff --git a/examples/qt3d/cpp_example/cpp_example.pro b/examples/qt3d/cpp_example/cpp_example.pro
index 943f81533..f84366baf 100644
--- a/examples/qt3d/cpp_example/cpp_example.pro
+++ b/examples/qt3d/cpp_example/cpp_example.pro
@@ -1,9 +1,12 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
-include("../exampleresources/exampleresources.pri")
-
SOURCES += main.cpp
+RESOURCES += \
+ ../exampleresources/test_scene.qrc \
+ ../exampleresources/gltf.qrc
diff --git a/examples/qt3d/cpp_example/main.cpp b/examples/qt3d/cpp_example/main.cpp
index df20ba030..014e8d958 100644
--- a/examples/qt3d/cpp_example/main.cpp
+++ b/examples/qt3d/cpp_example/main.cpp
@@ -36,8 +36,6 @@
#include <QGuiApplication>
-#include <exampleresources.h>
-
#include <Qt3DCore/window.h>
#include <Qt3DCore/qcamera.h>
#include <Qt3DCore/qentity.h>
@@ -73,8 +71,6 @@ int main(int ac, char **av)
{
QGuiApplication app(ac, av);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
diff --git a/examples/qt3d/cylinder-cpp/cylinder-cpp.pro b/examples/qt3d/cylinder-cpp/cylinder-cpp.pro
index 5ad940ff1..eeefc5c22 100644
--- a/examples/qt3d/cylinder-cpp/cylinder-cpp.pro
+++ b/examples/qt3d/cylinder-cpp/cylinder-cpp.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
diff --git a/examples/qt3d/cylinder-qml/cylinder-qml.pro b/examples/qt3d/cylinder-qml/cylinder-qml.pro
index 218ab62b5..0514d67de 100644
--- a/examples/qt3d/cylinder-qml/cylinder-qml.pro
+++ b/examples/qt3d/cylinder-qml/cylinder-qml.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
diff --git a/examples/qt3d/deferred-renderer-cpp/deferred-renderer-cpp.pro b/examples/qt3d/deferred-renderer-cpp/deferred-renderer-cpp.pro
index eaebea4ed..5f26c32c9 100644
--- a/examples/qt3d/deferred-renderer-cpp/deferred-renderer-cpp.pro
+++ b/examples/qt3d/deferred-renderer-cpp/deferred-renderer-cpp.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
gbuffer.h \
deferredrenderer.h \
diff --git a/examples/qt3d/deferred-renderer-qml/deferred-renderer-qml.pro b/examples/qt3d/deferred-renderer-qml/deferred-renderer-qml.pro
index 2b1329c2e..92e55cdb0 100644
--- a/examples/qt3d/deferred-renderer-qml/deferred-renderer-qml.pro
+++ b/examples/qt3d/deferred-renderer-qml/deferred-renderer-qml.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
diff --git a/examples/qt3d/deferred-renderer-qml/main.cpp b/examples/qt3d/deferred-renderer-qml/main.cpp
index 0ad35ff6c..533bea16b 100644
--- a/examples/qt3d/deferred-renderer-qml/main.cpp
+++ b/examples/qt3d/deferred-renderer-qml/main.cpp
@@ -40,8 +40,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -49,8 +47,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/deferred-renderer-qml/main.qml b/examples/qt3d/deferred-renderer-qml/main.qml
index c30c57fd4..d70619baa 100644
--- a/examples/qt3d/deferred-renderer-qml/main.qml
+++ b/examples/qt3d/deferred-renderer-qml/main.qml
@@ -138,14 +138,14 @@ Entity {
property Transform transform : Transform {
Translate{ dx: -10; dy: 0; dz : 5
id: sphere1Translate
- QQ2.SequentialAnimation {
- loops: QQ2.Animation.Infinite
- running: false
- QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: 6; duration: 2000 }
- QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: -10; duration: 2000 }
- }
}
}
+ QQ2.SequentialAnimation {
+ loops: QQ2.Animation.Infinite
+ running: false
+ QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: 6; duration: 2000 }
+ QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: -10; duration: 2000 }
+ }
property PointLight light : PointLight {
color : "green"
@@ -201,14 +201,14 @@ Entity {
property Transform transform : Transform {
Translate{ id: light3Translate; dx: 2; dy: 2; dz : 7
- QQ2.SequentialAnimation {
- loops: QQ2.Animation.Infinite
- running: true
- QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: 6; duration: 1000; easing.type: QQ2.Easing.InOutQuad }
- QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: -6; duration: 1000; easing.type: QQ2.Easing.InOutQuint }
- }
}
}
+ QQ2.SequentialAnimation {
+ loops: QQ2.Animation.Infinite
+ running: true
+ QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: 6; duration: 1000; easing.type: QQ2.Easing.InOutQuad }
+ QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: -6; duration: 1000; easing.type: QQ2.Easing.InOutQuint }
+ }
components: [
sphereMesh,
diff --git a/examples/qt3d/dynamicscene-cpp/dynamicscene-cpp.pro b/examples/qt3d/dynamicscene-cpp/dynamicscene-cpp.pro
index 715460121..543ee8557 100644
--- a/examples/qt3d/dynamicscene-cpp/dynamicscene-cpp.pro
+++ b/examples/qt3d/dynamicscene-cpp/dynamicscene-cpp.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
-include("../exampleresources/exampleresources.pri")
-
SOURCES += \
main.cpp \
examplescene.cpp \
diff --git a/examples/qt3d/enabled-qml/enabled-qml.pro b/examples/qt3d/enabled-qml/enabled-qml.pro
index 3608f4199..ec733fd90 100644
--- a/examples/qt3d/enabled-qml/enabled-qml.pro
+++ b/examples/qt3d/enabled-qml/enabled-qml.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += 3dcore 3drenderer 3dquick qml
SOURCES += \
diff --git a/examples/qt3d/enabled-qml/main.qml b/examples/qt3d/enabled-qml/main.qml
index 9342ba6c9..031759556 100644
--- a/examples/qt3d/enabled-qml/main.qml
+++ b/examples/qt3d/enabled-qml/main.qml
@@ -127,49 +127,50 @@ Entity {
Translate {
id: translate
+ }
+ }
- QQ2.SequentialAnimation {
- running: true
- loops: QQ2.Animation.Infinite
- QQ2.NumberAnimation {
- target: translate; property: "dx"
- from: 0; to: 5;
- duration: 550
- easing.type: QQ2.Easing.InOutQuad
- }
- QQ2.NumberAnimation {
- target: translate; property: "dy"
- from: 0; to: 5;
- duration: 650
- easing.type: QQ2.Easing.InOutQuad
- }
- QQ2.NumberAnimation {
- target: translate; property: "dz"
- from: 0; to: 5;
- duration: 350
- easing.type: QQ2.Easing.InOutQuad
- }
- QQ2.NumberAnimation {
- target: translate; property: "dx"
- from: 5; to: 0;
- duration: 550
- easing.type: QQ2.Easing.InOutQuad
- }
- QQ2.NumberAnimation {
- target: translate; property: "dy"
- from: 5; to: 0;
- duration: 350
- easing.type: QQ2.Easing.InOutQuad
- }
- QQ2.NumberAnimation {
- target: translate; property: "dz"
- from: 5; to: 0;
- duration: 650
- easing.type: QQ2.Easing.InOutQuad
- }
- }
+ QQ2.SequentialAnimation {
+ running: true
+ loops: QQ2.Animation.Infinite
+ QQ2.NumberAnimation {
+ target: translate; property: "dx"
+ from: 0; to: 5;
+ duration: 550
+ easing.type: QQ2.Easing.InOutQuad
+ }
+ QQ2.NumberAnimation {
+ target: translate; property: "dy"
+ from: 0; to: 5;
+ duration: 650
+ easing.type: QQ2.Easing.InOutQuad
+ }
+ QQ2.NumberAnimation {
+ target: translate; property: "dz"
+ from: 0; to: 5;
+ duration: 350
+ easing.type: QQ2.Easing.InOutQuad
+ }
+ QQ2.NumberAnimation {
+ target: translate; property: "dx"
+ from: 5; to: 0;
+ duration: 550
+ easing.type: QQ2.Easing.InOutQuad
+ }
+ QQ2.NumberAnimation {
+ target: translate; property: "dy"
+ from: 5; to: 0;
+ duration: 350
+ easing.type: QQ2.Easing.InOutQuad
+ }
+ QQ2.NumberAnimation {
+ target: translate; property: "dz"
+ from: 5; to: 0;
+ duration: 650
+ easing.type: QQ2.Easing.InOutQuad
}
}
+
components: [sphereMesh, material, layer, transform]
}
diff --git a/examples/qt3d/exampleresources/chest.qrc b/examples/qt3d/exampleresources/chest.qrc
new file mode 100644
index 000000000..86fac221b
--- /dev/null
+++ b/examples/qt3d/exampleresources/chest.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/chest/Chest.obj</file>
+ <file>assets/chest/diffuse.webp</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/cubemaps.qrc b/examples/qt3d/exampleresources/cubemaps.qrc
new file mode 100644
index 000000000..2c36602ae
--- /dev/null
+++ b/examples/qt3d/exampleresources/cubemaps.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/cubemaps/miramar/miramar_negx.webp</file>
+ <file>assets/cubemaps/miramar/miramar_negy.webp</file>
+ <file>assets/cubemaps/miramar/miramar_negz.webp</file>
+ <file>assets/cubemaps/miramar/miramar_posx.webp</file>
+ <file>assets/cubemaps/miramar/miramar_posy.webp</file>
+ <file>assets/cubemaps/miramar/miramar_posz.webp</file>
+ <file>assets/cubemaps/night/night_negx.webp</file>
+ <file>assets/cubemaps/night/night_negy.webp</file>
+ <file>assets/cubemaps/night/night_negz.webp</file>
+ <file>assets/cubemaps/night/night_posx.webp</file>
+ <file>assets/cubemaps/night/night_posy.webp</file>
+ <file>assets/cubemaps/night/night_posz.webp</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/exampleresources.pri b/examples/qt3d/exampleresources/exampleresources.pri
deleted file mode 100644
index 0bd8a17f5..000000000
--- a/examples/qt3d/exampleresources/exampleresources.pri
+++ /dev/null
@@ -1,17 +0,0 @@
-INCLUDEPATH += $$PWD
-
-EXAMPLERESOURCESLIB=exampleresources
-
-win32 {
- build_pass {
- CONFIG(debug, debug|release) {
- LIBS += $$shadowed($$PWD)/debug/$${QMAKE_PREFIX_STATICLIB}$${EXAMPLERESOURCESLIB}.$${QMAKE_EXTENSION_STATICLIB}
- } else {
- LIBS += $$shadowed($$PWD)/release/$${QMAKE_PREFIX_STATICLIB}$${EXAMPLERESOURCESLIB}.$${QMAKE_EXTENSION_STATICLIB}
- }
- }
-} else {
- LIBS += $$shadowed($$PWD)/$${QMAKE_PREFIX_STATICLIB}$${EXAMPLERESOURCESLIB}.$${QMAKE_EXTENSION_STATICLIB}
-}
-
-unset(EXAMPLERESOURCESLIB)
diff --git a/examples/qt3d/exampleresources/exampleresources.pro b/examples/qt3d/exampleresources/exampleresources.pro
deleted file mode 100644
index 90c733046..000000000
--- a/examples/qt3d/exampleresources/exampleresources.pro
+++ /dev/null
@@ -1,36 +0,0 @@
-TEMPLATE = lib
-CONFIG += static
-
-SOURCES += exampleresources.cpp
-
-HEADERS += exampleresources.h
-
-DEFINES += ASSETS=$$shadowed($$PWD)/
-
-#
-# Generate the RCC (binary resource) file for all of our assets.
-# We can't use RESOURCES here, as the resources are not in a subdir,
-# of each example
-#
-load(resources)
-RCC_BINARY_SOURCES += example-assets.qrc
-asset_builder.commands = $$QMAKE_RCC -binary ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
-asset_builder.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
-asset_builder.input = RCC_BINARY_SOURCES
-asset_builder.output = ${QMAKE_FILE_IN_BASE}.qrb
-asset_builder.CONFIG += no_link target_predeps
-QMAKE_EXTRA_COMPILERS += asset_builder
-
-OTHER_FILES += \
- example-assets.qrc \
- assets/gltf/duck/* \
- assets/gltf/rambler/* \
- assets/gltf/SuperMurdoch/* \
- assets/gltf/wine/* \
- assets/obj/* \
- assets/textures/pattern_09/* \
- assets/chest/* \
- assets/houseplants/* \
- assets/metalbarrel/* \
- assets/cubemaps/miramar/* \
- assets/cubemaps/night/*
diff --git a/examples/qt3d/exampleresources/gltf.qrc b/examples/qt3d/exampleresources/gltf.qrc
new file mode 100644
index 000000000..ecc727504
--- /dev/null
+++ b/examples/qt3d/exampleresources/gltf.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/gltf/wine/_2004_old_vine_zinfandel_btl_xlg.jpg</file>
+ <file>assets/gltf/wine/artezin_bottle.jpg</file>
+ <file>assets/gltf/wine/wine.bin</file>
+ <file>assets/gltf/wine/wine.dae</file>
+ <file>assets/gltf/wine/wine.json</file>
+ <file>assets/gltf/wine/wine0FS.glsl</file>
+ <file>assets/gltf/wine/wine0VS.glsl</file>
+ <file>assets/gltf/wine/wine2FS.glsl</file>
+ <file>assets/gltf/wine/wine2VS.glsl</file>
+ <file>assets/gltf/wine/wine4FS.glsl</file>
+ <file>assets/gltf/wine/wine4VS.glsl</file>
+ <file>assets/gltf/wine/Wood_Cherry_Original_.jpg</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/example-assets.qrc b/examples/qt3d/exampleresources/houseplants.qrc
index ccfac6563..faa47dc90 100644
--- a/examples/qt3d/exampleresources/example-assets.qrc
+++ b/examples/qt3d/exampleresources/houseplants.qrc
@@ -1,23 +1,5 @@
<RCC>
<qresource prefix="/">
- <file>assets/gltf/wine/_2004_old_vine_zinfandel_btl_xlg.jpg</file>
- <file>assets/gltf/wine/artezin_bottle.jpg</file>
- <file>assets/gltf/wine/wine.bin</file>
- <file>assets/gltf/wine/wine.dae</file>
- <file>assets/gltf/wine/wine.json</file>
- <file>assets/gltf/wine/wine0FS.glsl</file>
- <file>assets/gltf/wine/wine0VS.glsl</file>
- <file>assets/gltf/wine/wine2FS.glsl</file>
- <file>assets/gltf/wine/wine2VS.glsl</file>
- <file>assets/gltf/wine/wine4FS.glsl</file>
- <file>assets/gltf/wine/wine4VS.glsl</file>
- <file>assets/gltf/wine/Wood_Cherry_Original_.jpg</file>
- <file>assets/test_scene.dae</file>
- <file>assets/obj/ball.obj</file>
- <file>assets/obj/trefoil.obj</file>
- <file>assets/obj/toyplane.obj</file>
- <file>assets/chest/Chest.obj</file>
- <file>assets/chest/diffuse.webp</file>
<file>assets/houseplants/bamboo_normal.webp</file>
<file>assets/houseplants/bamboo.webp</file>
<file>assets/houseplants/cover_normal.webp</file>
@@ -67,35 +49,5 @@
<file>assets/houseplants/triangle-pot.obj</file>
<file>assets/houseplants/triangle-shrub.obj</file>
<file>assets/houseplants/triangle-spikes.obj</file>
- <file>assets/metalbarrel/diffus_black.webp</file>
- <file>assets/metalbarrel/diffus_blue.webp</file>
- <file>assets/metalbarrel/diffus_green.webp</file>
- <file>assets/metalbarrel/diffus_red.webp</file>
- <file>assets/metalbarrel/diffus_rust.webp</file>
- <file>assets/metalbarrel/diffus_stainless_steel.webp</file>
- <file>assets/metalbarrel/diffus_yellow.webp</file>
- <file>assets/metalbarrel/metal_barrel.obj</file>
- <file>assets/metalbarrel/normal_hard_bumps.webp</file>
- <file>assets/metalbarrel/normal_middle_bumps.webp</file>
- <file>assets/metalbarrel/normal_no_bumps.webp</file>
- <file>assets/metalbarrel/normal_soft_bumps.webp</file>
- <file>assets/metalbarrel/specular_rust.webp</file>
- <file>assets/metalbarrel/specular_stainless_steel.webp</file>
- <file>assets/metalbarrel/specular.webp</file>
- <file>assets/textures/pattern_09/specular.webp</file>
- <file>assets/textures/pattern_09/normal.webp</file>
- <file>assets/textures/pattern_09/diffuse.webp</file>
- <file>assets/cubemaps/miramar/miramar_negx.webp</file>
- <file>assets/cubemaps/miramar/miramar_negy.webp</file>
- <file>assets/cubemaps/miramar/miramar_negz.webp</file>
- <file>assets/cubemaps/miramar/miramar_posx.webp</file>
- <file>assets/cubemaps/miramar/miramar_posy.webp</file>
- <file>assets/cubemaps/miramar/miramar_posz.webp</file>
- <file>assets/cubemaps/night/night_negx.webp</file>
- <file>assets/cubemaps/night/night_negy.webp</file>
- <file>assets/cubemaps/night/night_negz.webp</file>
- <file>assets/cubemaps/night/night_posx.webp</file>
- <file>assets/cubemaps/night/night_posy.webp</file>
- <file>assets/cubemaps/night/night_posz.webp</file>
</qresource>
</RCC>
diff --git a/examples/qt3d/exampleresources/metalbarrel.qrc b/examples/qt3d/exampleresources/metalbarrel.qrc
new file mode 100644
index 000000000..43381ba51
--- /dev/null
+++ b/examples/qt3d/exampleresources/metalbarrel.qrc
@@ -0,0 +1,19 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/metalbarrel/diffus_black.webp</file>
+ <file>assets/metalbarrel/diffus_blue.webp</file>
+ <file>assets/metalbarrel/diffus_green.webp</file>
+ <file>assets/metalbarrel/diffus_red.webp</file>
+ <file>assets/metalbarrel/diffus_rust.webp</file>
+ <file>assets/metalbarrel/diffus_stainless_steel.webp</file>
+ <file>assets/metalbarrel/diffus_yellow.webp</file>
+ <file>assets/metalbarrel/metal_barrel.obj</file>
+ <file>assets/metalbarrel/normal_hard_bumps.webp</file>
+ <file>assets/metalbarrel/normal_middle_bumps.webp</file>
+ <file>assets/metalbarrel/normal_no_bumps.webp</file>
+ <file>assets/metalbarrel/normal_soft_bumps.webp</file>
+ <file>assets/metalbarrel/specular_rust.webp</file>
+ <file>assets/metalbarrel/specular_stainless_steel.webp</file>
+ <file>assets/metalbarrel/specular.webp</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/obj.qrc b/examples/qt3d/exampleresources/obj.qrc
new file mode 100644
index 000000000..952fd59d0
--- /dev/null
+++ b/examples/qt3d/exampleresources/obj.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/obj/ball.obj</file>
+ <file>assets/obj/trefoil.obj</file>
+ <file>assets/obj/toyplane.obj</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/test_scene.qrc b/examples/qt3d/exampleresources/test_scene.qrc
new file mode 100644
index 000000000..3ac240b7c
--- /dev/null
+++ b/examples/qt3d/exampleresources/test_scene.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/test_scene.dae</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/exampleresources/textures.qrc b/examples/qt3d/exampleresources/textures.qrc
new file mode 100644
index 000000000..ef70706a5
--- /dev/null
+++ b/examples/qt3d/exampleresources/textures.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>assets/textures/pattern_09/specular.webp</file>
+ <file>assets/textures/pattern_09/normal.webp</file>
+ <file>assets/textures/pattern_09/diffuse.webp</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/examples.pri b/examples/qt3d/examples.pri
new file mode 100644
index 000000000..6e2f67dcc
--- /dev/null
+++ b/examples/qt3d/examples.pri
@@ -0,0 +1,4 @@
+TEMPLATE = app
+
+target.path = $$[QT_INSTALL_EXAMPLES]/qt3d/$$TARGET
+INSTALLS += target
diff --git a/examples/qt3d/gltf/gltf.pro b/examples/qt3d/gltf/gltf.pro
index d2ac810a9..5b75283ae 100644
--- a/examples/qt3d/gltf/gltf.pro
+++ b/examples/qt3d/gltf/gltf.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
@@ -13,4 +13,6 @@ OTHER_FILES += \
main.qml
RESOURCES += \
- gltf.qrc
+ gltf_example.qrc \
+ ../exampleresources/gltf.qrc \
+ ../exampleresources/obj.qrc
diff --git a/examples/qt3d/gltf/gltf.qrc b/examples/qt3d/gltf/gltf_example.qrc
index c24519313..c24519313 100644
--- a/examples/qt3d/gltf/gltf.qrc
+++ b/examples/qt3d/gltf/gltf_example.qrc
diff --git a/examples/qt3d/gltf/main.cpp b/examples/qt3d/gltf/main.cpp
index a65d56218..523ee4396 100644
--- a/examples/qt3d/gltf/main.cpp
+++ b/examples/qt3d/gltf/main.cpp
@@ -34,7 +34,6 @@
**
****************************************************************************/
-#include <exampleresources.h>
#include <Qt3DCore/window.h>
#include <Qt3DRenderer/qrenderaspect.h>
#include <Qt3DInput/QInputAspect>
@@ -47,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/keyboardinput-qml/keyboardinput-qml.pro b/examples/qt3d/keyboardinput-qml/keyboardinput-qml.pro
index 29e821655..510aa6505 100644
--- a/examples/qt3d/keyboardinput-qml/keyboardinput-qml.pro
+++ b/examples/qt3d/keyboardinput-qml/keyboardinput-qml.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += 3dcore 3drenderer 3dquick 3dinput quick qml
SOURCES += \
diff --git a/examples/qt3d/loader-qml/loader-qml.pro b/examples/qt3d/loader-qml/loader-qml.pro
index c4f4b38cf..2e99deb91 100644
--- a/examples/qt3d/loader-qml/loader-qml.pro
+++ b/examples/qt3d/loader-qml/loader-qml.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
diff --git a/examples/qt3d/loader-qml/main.qml b/examples/qt3d/loader-qml/main.qml
index 9857a5eaa..fa3e8ff5a 100644
--- a/examples/qt3d/loader-qml/main.qml
+++ b/examples/qt3d/loader-qml/main.qml
@@ -118,16 +118,16 @@ Entity {
Rotate {
id: sphereRotation
axis: Qt.vector3d(0, 1, 0)
- QQ2.NumberAnimation {
- target: sphereRotation
- property: "angle"
- duration: 10000
- from: 0
- to: 360
-
- loops: QQ2.Animation.Infinite
- running: true
- }
}
}
+ QQ2.NumberAnimation {
+ target: sphereRotation
+ property: "angle"
+ duration: 10000
+ from: 0
+ to: 360
+
+ loops: QQ2.Animation.Infinite
+ running: true
+ }
}
diff --git a/examples/qt3d/materials-cpp/main.cpp b/examples/qt3d/materials-cpp/main.cpp
index 3704ffcdf..2e5a4834b 100644
--- a/examples/qt3d/materials-cpp/main.cpp
+++ b/examples/qt3d/materials-cpp/main.cpp
@@ -53,13 +53,11 @@
#include "planeentity.h"
#include "rotatingtrefoilknot.h"
#include "barrel.h"
-#include "exampleresources.h"
#include "houseplant.h"
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
Qt3D::Window view;
Qt3D::QAspectEngine engine;
diff --git a/examples/qt3d/materials-cpp/materials-cpp.pro b/examples/qt3d/materials-cpp/materials-cpp.pro
index 351ed82f8..47dee515d 100644
--- a/examples/qt3d/materials-cpp/materials-cpp.pro
+++ b/examples/qt3d/materials-cpp/materials-cpp.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
planeentity.h \
renderableentity.h \
@@ -20,3 +20,10 @@ SOURCES += \
barrel.cpp \
rotatingtrefoilknot.cpp \
houseplant.cpp
+
+RESOURCES += \
+ ../exampleresources/chest.qrc \
+ ../exampleresources/houseplants.qrc \
+ ../exampleresources/metalbarrel.qrc \
+ ../exampleresources/obj.qrc \
+ ../exampleresources/textures.qrc
diff --git a/examples/qt3d/materials/main.cpp b/examples/qt3d/materials/main.cpp
index 20b518734..e27bbdaff 100644
--- a/examples/qt3d/materials/main.cpp
+++ b/examples/qt3d/materials/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/materials/materials.pro b/examples/qt3d/materials/materials.pro
index 23d4d38a8..d8b5f1b88 100644
--- a/examples/qt3d/materials/materials.pro
+++ b/examples/qt3d/materials/materials.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
@@ -15,4 +15,9 @@ OTHER_FILES += \
HousePlant.qml
RESOURCES += \
- materials.qrc
+ materials.qrc \
+ ../exampleresources/chest.qrc \
+ ../exampleresources/houseplants.qrc \
+ ../exampleresources/metalbarrel.qrc \
+ ../exampleresources/obj.qrc \
+ ../exampleresources/textures.qrc
diff --git a/examples/qt3d/multiviewport/main.cpp b/examples/qt3d/multiviewport/main.cpp
index ca9ea8abe..666aa1434 100644
--- a/examples/qt3d/multiviewport/main.cpp
+++ b/examples/qt3d/multiviewport/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
int main(int ac, char **av)
@@ -49,7 +47,6 @@ int main(int ac, char **av)
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
- initializeAssetResources("../exampleresources/example-assets.qrb");
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect);
engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
diff --git a/examples/qt3d/multiviewport/multiviewport.pro b/examples/qt3d/multiviewport/multiviewport.pro
index d7ed38b6d..93b678598 100644
--- a/examples/qt3d/multiviewport/multiviewport.pro
+++ b/examples/qt3d/multiviewport/multiviewport.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
@@ -13,4 +13,5 @@ OTHER_FILES += \
main.qml
RESOURCES += \
- multiviewport.qrc
+ multiviewport.qrc \
+ ../exampleresources/test_scene.qrc
diff --git a/examples/qt3d/playground-qml/main.cpp b/examples/qt3d/playground-qml/main.cpp
index 890776d22..6ec4c6097 100644
--- a/examples/qt3d/playground-qml/main.cpp
+++ b/examples/qt3d/playground-qml/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/playground-qml/playground-qml.pro b/examples/qt3d/playground-qml/playground-qml.pro
index ed48e137f..5a8a8d5f8 100644
--- a/examples/qt3d/playground-qml/playground-qml.pro
+++ b/examples/qt3d/playground-qml/playground-qml.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dquick qml quick 3dinput
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
@@ -25,4 +25,5 @@ OTHER_FILES += \
AnimatedDiffuseMaterial.qml
RESOURCES += \
- playground-qml.qrc
+ playground-qml.qrc \
+ ../exampleresources/gltf.qrc \
diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro
index d47fd5bb8..5882ad38b 100644
--- a/examples/qt3d/qt3d.pro
+++ b/examples/qt3d/qt3d.pro
@@ -1,7 +1,6 @@
TEMPLATE = subdirs
SUBDIRS += \
- exampleresources \
playground-qml \
simple-qml \
simple-cpp \
@@ -28,16 +27,11 @@ SUBDIRS += \
dynamicscene-cpp \
scene3d \
enabled-qml \
- skybox
+ skybox \
+ controls \
+ anaglyph-rendering \
+ simple-shaders-qml
# TODO Port the old examples to new APIs
#SUBDIRS += qt3d
-#qtHaveModule(qml): SUBDIRS += quick3d
-
-# Make all other subdirs depend on exampleresources
-for(subdir, SUBDIRS) {
- !equals(subdir, exampleresources) {
- $${subdir}.depends += exampleresources
- }
-}
-
+qtHaveModule(widgets): SUBDIRS += assimp-cpp
diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml
index 8c44fde0d..72d9787d6 100644
--- a/examples/qt3d/scene3d/AnimatedEntity.qml
+++ b/examples/qt3d/scene3d/AnimatedEntity.qml
@@ -118,18 +118,18 @@ Entity {
Rotate {
id: sphereRotation
axis: Qt.vector3d(0, 1, 0)
- QQ2.NumberAnimation {
- target: sphereRotation
- property: "angle"
- duration: 10000
- from: 0
- to: 360
-
- loops: QQ2.Animation.Infinite
- running: true
- }
}
}
+ QQ2.NumberAnimation {
+ target: sphereRotation
+ property: "angle"
+ duration: 10000
+ from: 0
+ to: 360
+
+ loops: QQ2.Animation.Infinite
+ running: true
+ }
Entity {
id: sphereEntity
diff --git a/examples/qt3d/scene3d/scene3d.pro b/examples/qt3d/scene3d/scene3d.pro
index 9df4a2bcf..1295d7cce 100644
--- a/examples/qt3d/scene3d/scene3d.pro
+++ b/examples/qt3d/scene3d/scene3d.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += qml quick 3dinput
SOURCES += \
diff --git a/examples/qt3d/shadow-map-qml/main.cpp b/examples/qt3d/shadow-map-qml/main.cpp
index 31836bf9d..2357106c7 100644
--- a/examples/qt3d/shadow-map-qml/main.cpp
+++ b/examples/qt3d/shadow-map-qml/main.cpp
@@ -43,14 +43,10 @@
#include <QQmlContext>
#include <QQmlEngine>
-#include <exampleresources.h>
-
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/shadow-map-qml/shaders/es3/ads.frag b/examples/qt3d/shadow-map-qml/shaders/es3/ads.frag
index 2074f0274..8a59268ac 100644
--- a/examples/qt3d/shadow-map-qml/shaders/es3/ads.frag
+++ b/examples/qt3d/shadow-map-qml/shaders/es3/ads.frag
@@ -12,7 +12,7 @@ uniform vec3 kd; // Diffuse reflectivity
uniform vec3 ks; // Specular reflectivity
uniform float shininess; // Specular shininess factor
-uniform sampler2DShadow shadowMapTexture;
+uniform highp sampler2DShadow shadowMapTexture;
in vec4 positionInLightSpace;
diff --git a/examples/qt3d/shadow-map-qml/shadow-map-qml.pro b/examples/qt3d/shadow-map-qml/shadow-map-qml.pro
index 7d7670022..1ae0cb409 100644
--- a/examples/qt3d/shadow-map-qml/shadow-map-qml.pro
+++ b/examples/qt3d/shadow-map-qml/shadow-map-qml.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
SOURCES += \
main.cpp
@@ -18,4 +18,5 @@ OTHER_FILES += \
GroundPlane.qml
RESOURCES += \
- shadow-map-qml.qrc
+ shadow-map-qml.qrc \
+ ../exampleresources/obj.qrc
diff --git a/examples/qt3d/simple-cpp/simple-cpp.pro b/examples/qt3d/simple-cpp/simple-cpp.pro
index c7f008ae9..0097f0cf2 100644
--- a/examples/qt3d/simple-cpp/simple-cpp.pro
+++ b/examples/qt3d/simple-cpp/simple-cpp.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += 3dcore 3drenderer 3dinput
SOURCES += \
diff --git a/examples/qt3d/simple-qml/main.qml b/examples/qt3d/simple-qml/main.qml
index 7896766c5..c82bafaa3 100644
--- a/examples/qt3d/simple-qml/main.qml
+++ b/examples/qt3d/simple-qml/main.qml
@@ -106,19 +106,20 @@ Entity {
Rotate {
id: sphereRotation
axis: Qt.vector3d(0, 1, 0)
- QQ2.NumberAnimation {
- target: sphereRotation
- property: "angle"
- duration: 10000
- from: 0
- to: 360
-
- loops: QQ2.Animation.Infinite
- running: true
- }
}
}
+ QQ2.NumberAnimation {
+ target: sphereRotation
+ property: "angle"
+ duration: 10000
+ from: 0
+ to: 360
+
+ loops: QQ2.Animation.Infinite
+ running: true
+ }
+
Entity {
id: sphereEntity
components: [ sphereMesh, material, sphereTransform ]
diff --git a/examples/qt3d/simple-qml/simple-qml.pro b/examples/qt3d/simple-qml/simple-qml.pro
index 0df3ee3e6..fb9c491ed 100644
--- a/examples/qt3d/simple-qml/simple-qml.pro
+++ b/examples/qt3d/simple-qml/simple-qml.pro
@@ -1,4 +1,7 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
diff --git a/examples/qt3d/simple-shaders-qml/main.cpp b/examples/qt3d/simple-shaders-qml/main.cpp
new file mode 100644
index 000000000..1141958fd
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <Qt3DCore/window.h>
+#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
+#include <Qt3DQuick/QQmlAspectEngine>
+
+#include <QGuiApplication>
+
+int main(int argc, char* argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ Qt3D::Window view;
+ Qt3D::Quick::QQmlAspectEngine engine;
+
+ engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
+ engine.aspectEngine()->initialize();
+ QVariantMap data;
+ data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
+ data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view));
+ engine.aspectEngine()->setData(data);
+ engine.setSource(QUrl("qrc:/main.qml"));
+
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/qt3d/simple-shaders-qml/main.qml b/examples/qt3d/simple-shaders-qml/main.qml
new file mode 100644
index 000000000..22b6322be
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/main.qml
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+import QtQuick 2.2 as QQ2
+
+Entity {
+ id: sceneRoot
+
+ Camera {
+ id: camera
+ projectionType: CameraLens.PerspectiveProjection
+ fieldOfView: 45
+ aspectRatio: 16/9
+ nearPlane : 0.1
+ farPlane : 1000.0
+ position: Qt.vector3d( 0.0, 0.0, -40.0 )
+ upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
+ viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
+ }
+
+ Configuration {
+ controlledCamera: camera
+ }
+
+ components: [
+ FrameGraph {
+ activeFrameGraph: ForwardRenderer {
+ clearColor: Qt.rgba(0, 0.5, 1, 1)
+ camera: camera
+ }
+ }
+ ]
+
+ TorusMesh {
+ id: torusMesh
+ radius: 5
+ minorRadius: 1
+ rings: 100
+ slices: 20
+ }
+
+ Entity {
+ id: torusEntityInlineShader
+
+ property Transform transform: Transform {
+ Translate { translation: Qt.vector3d(-2.0, 0.0, 0.0) }
+ Rotate {
+ angle: 45
+ axis: Qt.vector3d(1, 0, 0)
+ }
+ }
+
+ // Shader defined inline
+ property Material material: Material {
+
+ parameters: Parameter { name: "finalColor"; value: "#e76140" /* Inferno Orange */ }
+
+ effect: Effect {
+ techniques: [
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.Desktop
+ majorVersion: 3
+ minorVersion: 2
+ profile: OpenGLFilter.Core
+ }
+
+ renderPasses: RenderPass {
+ shaderProgram: ShaderProgram {
+
+ vertexShaderCode: "
+ #version 150
+
+ in vec3 vertexPosition;
+ in vec3 vertexNormal;
+
+ out vec3 position;
+ out vec3 normal;
+
+ uniform mat4 modelView;
+ uniform mat3 modelViewNormal;
+ uniform mat4 mvp;
+
+ void main()
+ {
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+ }
+ "
+
+ fragmentShaderCode: "
+ #version 150
+
+ in vec3 normal;
+ in vec3 position;
+
+ uniform vec3 finalColor;
+
+ out vec4 fragColor;
+
+ void main()
+ {
+ vec3 n = normalize(normal);
+ vec3 s = normalize(vec3(1.0, 0.0, 1.0) - position);
+ vec3 v = normalize(-position);
+ float diffuse = max(dot(s, n), 0.0);
+ fragColor = vec4(diffuse * finalColor, 1.0);
+ }
+ "
+
+ } // ShaderProgram
+ } // RenderPass
+ } // Technique
+ ] // techniques
+ } // Effect
+ } // Material
+
+ components: [ torusMesh, material, transform ]
+ }
+
+ Entity {
+ id: torusEntitySeparateShader
+
+ property Transform transform: Transform {
+ Translate { translation: Qt.vector3d(2.0, 0.0, 0.0) }
+ Rotate {
+ angle: 15
+ axis: Qt.vector3d(1, 0, 0)
+ }
+ }
+
+ // Shader defined in a separate file
+ property Material material: Material {
+
+ parameters: Parameter { name: "finalColor"; value: "yellow" }
+
+ effect: Effect {
+ techniques: [
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.Desktop
+ majorVersion: 3
+ minorVersion: 2
+ profile: OpenGLFilter.Core
+ }
+
+ renderPasses: RenderPass {
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/simple-shader.vert")
+ fragmentShaderCode: loadSource("qrc:/simple-shader.frag")
+ } // ShaderProgram
+ } // RenderPass
+ } // Technique
+ ] // techniques
+ } // Effect
+ } // Material
+
+ components: [ torusMesh, material, transform ]
+ }
+}
diff --git a/examples/qt3d/simple-shaders-qml/simple-shader.frag b/examples/qt3d/simple-shaders-qml/simple-shader.frag
new file mode 100644
index 000000000..330899070
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/simple-shader.frag
@@ -0,0 +1,29 @@
+#version 150
+
+in vec3 normal;
+in vec3 position;
+in vec2 texCoord;
+
+uniform vec3 finalColor;
+
+out vec4 fragColor;
+
+void main()
+{
+ vec3 n = normalize(normal);
+ vec3 s = normalize(vec3(1.0, 0.0, 1.0) - position);
+ vec3 v = normalize(-position);
+
+ float diffuse = max(dot(s, n), 0.0);
+
+ if (diffuse > 0.95)
+ diffuse = 1.0;
+ else if (diffuse > 0.5)
+ diffuse = 0.5;
+ else if (diffuse > 0.25)
+ diffuse = 0.25;
+ else
+ diffuse = 0.1;
+
+ fragColor = vec4(diffuse * finalColor, 1.0);
+}
diff --git a/examples/qt3d/simple-shaders-qml/simple-shader.vert b/examples/qt3d/simple-shaders-qml/simple-shader.vert
new file mode 100644
index 000000000..ab8e4a0af
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/simple-shader.vert
@@ -0,0 +1,21 @@
+#version 150
+
+in vec3 vertexPosition;
+in vec3 vertexNormal;
+in vec2 vertexTexCoord;
+
+out vec3 position;
+out vec3 normal;
+out vec2 texCoord;
+
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+void main()
+{
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+ texCoord = vertexTexCoord;
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/examples/qt3d/simple-shaders-qml/simple-shaders-qml.pro b/examples/qt3d/simple-shaders-qml/simple-shaders-qml.pro
new file mode 100644
index 000000000..97242a3f8
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/simple-shaders-qml.pro
@@ -0,0 +1,16 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
+
+SOURCES += \
+ main.cpp
+
+OTHER_FILES += \
+ main.qml \
+ simple-shader.vert \
+ simple-shader.frag
+
+RESOURCES += \
+ simple-shaders-qml.qrc
diff --git a/examples/qt3d/simple-shaders-qml/simple-shaders-qml.qrc b/examples/qt3d/simple-shaders-qml/simple-shaders-qml.qrc
new file mode 100644
index 000000000..d0469bcb4
--- /dev/null
+++ b/examples/qt3d/simple-shaders-qml/simple-shaders-qml.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>simple-shader.frag</file>
+ <file>simple-shader.vert</file>
+ </qresource>
+</RCC>
diff --git a/examples/qt3d/skybox/Skybox.qml b/examples/qt3d/skybox/Skybox.qml
index e8dfc29d1..49d269bf5 100644
--- a/examples/qt3d/skybox/Skybox.qml
+++ b/examples/qt3d/skybox/Skybox.qml
@@ -40,7 +40,7 @@ import Qt3D.Render 2.0
Entity {
property alias cameraPosition: cameraTranslate.translation;
- property string sourceDirectory: "qrc:/assets/cubemaps/miramar/miramar";
+ property string sourceDirectory: "";
property string extension: ".webp"
property TextureCubeMap skyboxTexture: TextureCubeMap {
@@ -61,63 +61,14 @@ Entity {
ShaderProgram {
id: gl3SkyboxShader
-
- vertexShaderCode: "
- #version 140
-
- in vec3 vertexPosition;
- out vec3 texCoord0;
-
- uniform mat4 mvp;
- uniform mat4 inverseProjectionMatrix;
- uniform mat4 inverseModelView;
-
- void main()
- {
- texCoord0 = vertexPosition.xyz;
- gl_Position = vec4(mvp * vec4(vertexPosition, 1.0)).xyww;
- }
- "
- fragmentShaderCode: "
- #version 140
-
- in vec3 texCoord0;
- out vec4 fragColor;
- uniform samplerCube skyboxTexture;
-
- void main()
- {
- fragColor = texture(skyboxTexture, texCoord0);
- }
- "
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/skybox.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/skybox.frag")
}
ShaderProgram {
id: gl2es2SkyboxShader
-
- vertexShaderCode: "
- attribute vec3 vertexPosition;
- varying vec3 texCoord0;
-
- uniform mat4 mvp;
- uniform mat4 inverseProjectionMatrix;
- uniform mat4 inverseModelView;
-
- void main()
- {
- texCoord0 = vertexPosition.xyz;
- gl_Position = vec4(mvp * vec4(vertexPosition, 1.0)).xyww;
- }
- "
- fragmentShaderCode: "
- varying highp vec3 texCoord0;
- uniform samplerCube skyboxTexture;
-
- void main()
- {
- gl_FragColor = textureCube(skyboxTexture, texCoord0);
- }
- "
+ vertexShaderCode: loadSource("qrc:/shaders/es2/skybox.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/skybox.frag")
}
CuboidMesh {
@@ -129,15 +80,12 @@ Entity {
Transform {
id: transform
- Translate { id: cameraTranslate; }
+ Translate { id: cameraTranslate }
}
Material {
id: skyboxMaterial
-
- parameters: [
- Parameter { name: "skyboxTexture"; value: skyboxTexture}
- ]
+ parameters: Parameter { name: "skyboxTexture"; value: skyboxTexture}
effect: Effect {
techniques: [
diff --git a/examples/qt3d/skybox/main.cpp b/examples/qt3d/skybox/main.cpp
index 698403872..318b5181f 100644
--- a/examples/qt3d/skybox/main.cpp
+++ b/examples/qt3d/skybox/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/skybox/main.qml b/examples/qt3d/skybox/main.qml
index 83bb663cf..fbb3c90d0 100644
--- a/examples/qt3d/skybox/main.qml
+++ b/examples/qt3d/skybox/main.qml
@@ -60,8 +60,10 @@ Entity {
}
// So that the camera is rendered always at the same position as the camera
- Skybox {
+ SkyboxEntity {
cameraPosition: basicCamera.position
+ baseName: "qrc:/assets/cubemaps/miramar/miramar"
+ extension: ".webp"
}
Configuration {
diff --git a/examples/qt3d/skybox/skybox.pro b/examples/qt3d/skybox/skybox.pro
index c58d7f90e..faedf35b9 100644
--- a/examples/qt3d/skybox/skybox.pro
+++ b/examples/qt3d/skybox/skybox.pro
@@ -1,11 +1,12 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
RESOURCES += \
- skybox.qrc
+ skybox.qrc \
+ ../exampleresources/cubemaps.qrc
SOURCES += \
main.cpp
diff --git a/examples/qt3d/tessellation-modes/main.cpp b/examples/qt3d/tessellation-modes/main.cpp
index ed9ae1e44..df1ba87de 100644
--- a/examples/qt3d/tessellation-modes/main.cpp
+++ b/examples/qt3d/tessellation-modes/main.cpp
@@ -41,8 +41,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -50,8 +48,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/tessellation-modes/tessellation-modes.pro b/examples/qt3d/tessellation-modes/tessellation-modes.pro
index 683dd7f9f..e26560a25 100644
--- a/examples/qt3d/tessellation-modes/tessellation-modes.pro
+++ b/examples/qt3d/tessellation-modes/tessellation-modes.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
tessellatedquadmesh.h
diff --git a/examples/qt3d/torus-cpp/torus-cpp.pro b/examples/qt3d/torus-cpp/torus-cpp.pro
index 5ad940ff1..eeefc5c22 100644
--- a/examples/qt3d/torus-cpp/torus-cpp.pro
+++ b/examples/qt3d/torus-cpp/torus-cpp.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput
diff --git a/examples/qt3d/torus-qml/torus-qml.pro b/examples/qt3d/torus-qml/torus-qml.pro
index 060164fa9..ebe943ae5 100644
--- a/examples/qt3d/torus-qml/torus-qml.pro
+++ b/examples/qt3d/torus-qml/torus-qml.pro
@@ -1,4 +1,6 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
diff --git a/examples/qt3d/wave/main.cpp b/examples/qt3d/wave/main.cpp
index 6130cc708..b30248031 100644
--- a/examples/qt3d/wave/main.cpp
+++ b/examples/qt3d/wave/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/wave/wave.pro b/examples/qt3d/wave/wave.pro
index 05c937cb6..a3ce0989e 100644
--- a/examples/qt3d/wave/wave.pro
+++ b/examples/qt3d/wave/wave.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dquick 3dinput qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
diff --git a/examples/qt3d/wireframe/main.cpp b/examples/qt3d/wireframe/main.cpp
index ecad579c9..e869a2fb4 100644
--- a/examples/qt3d/wireframe/main.cpp
+++ b/examples/qt3d/wireframe/main.cpp
@@ -39,8 +39,6 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DQuick/QQmlAspectEngine>
-#include <exampleresources.h>
-
#include <QGuiApplication>
#include <QtQml>
@@ -48,8 +46,6 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
- initializeAssetResources("../exampleresources/example-assets.qrb");
-
Qt3D::Window view;
Qt3D::Quick::QQmlAspectEngine engine;
diff --git a/examples/qt3d/wireframe/wireframe.pro b/examples/qt3d/wireframe/wireframe.pro
index 2b2fd991a..c7276a095 100644
--- a/examples/qt3d/wireframe/wireframe.pro
+++ b/examples/qt3d/wireframe/wireframe.pro
@@ -1,9 +1,9 @@
-TEMPLATE = app
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
QT += 3dcore 3drenderer 3dinput 3dquick qml quick
-include("../exampleresources/exampleresources.pri")
-
HEADERS += \
SOURCES += \
@@ -17,4 +17,5 @@ OTHER_FILES += \
TrefoilKnot.qml
RESOURCES += \
- wireframe.qrc
+ wireframe.qrc \
+ ../exampleresources/obj.qrc
diff --git a/src/core/aspects/qabstractaspect.cpp b/src/core/aspects/qabstractaspect.cpp
index 1de4069e4..94e52c086 100644
--- a/src/core/aspects/qabstractaspect.cpp
+++ b/src/core/aspects/qabstractaspect.cpp
@@ -52,14 +52,17 @@ static QByteArray className(const QMetaObject &obj)
namespace Qt3D {
-QAbstractAspectPrivate::QAbstractAspectPrivate(QAbstractAspect *qq)
+/*!
+ \class Qt3D::QAbstractAspectPrivate
+ \internal
+*/
+QAbstractAspectPrivate::QAbstractAspectPrivate()
: QObjectPrivate()
, m_root(Q_NULLPTR)
, m_aspectManager(Q_NULLPTR)
, m_jobManager(Q_NULLPTR)
, m_arbiter(Q_NULLPTR)
{
- q_ptr = qq;
}
QAbstractAspectPrivate *QAbstractAspectPrivate::get(QAbstractAspect *aspect)
@@ -73,12 +76,13 @@ QAbstractAspectPrivate *QAbstractAspectPrivate::get(QAbstractAspect *aspect)
\brief QAbstractAspect is the base class for aspects that provide a vertical slice of behavior.
*/
QAbstractAspect::QAbstractAspect(AspectType aspectType, QObject *parent)
- : QObject(*new QAbstractAspectPrivate(this), parent)
+ : QObject(*new QAbstractAspectPrivate, parent)
{
Q_D(QAbstractAspect);
d->m_aspectType = aspectType;
}
+/*! \internal */
QAbstractAspect::QAbstractAspect(QAbstractAspectPrivate &dd, QObject *parent)
: QObject(dd, parent)
{
diff --git a/src/core/aspects/qabstractaspect_p.h b/src/core/aspects/qabstractaspect_p.h
index 14cd1b95d..2ef8f82f3 100644
--- a/src/core/aspects/qabstractaspect_p.h
+++ b/src/core/aspects/qabstractaspect_p.h
@@ -55,7 +55,7 @@ class QChangeArbiter;
class QT3DCORE_PRIVATE_EXPORT QAbstractAspectPrivate : public QObjectPrivate
{
public:
- QAbstractAspectPrivate(QAbstractAspect *qq);
+ QAbstractAspectPrivate();
Q_DECLARE_PUBLIC(QAbstractAspect)
diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp
index 1c16c4bf4..1ef1d803a 100644
--- a/src/core/aspects/qaspectengine.cpp
+++ b/src/core/aspects/qaspectengine.cpp
@@ -55,13 +55,15 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAspectEnginePrivate::QAspectEnginePrivate(QAspectEngine *qq)
+/*!
+ \class Qt3D::QAspectEnginePrivate
+ \internal
+*/
+QAspectEnginePrivate::QAspectEnginePrivate()
: QObjectPrivate()
- , m_postman(new QPostman())
- , m_scene(new QScene(qq))
+ , m_postman(Q_NULLPTR)
+ , m_scene(Q_NULLPTR)
{
- q_ptr = qq;
- m_postman->setScene(m_scene);
qRegisterMetaType<Qt3D::QAbstractAspect *>();
qRegisterMetaType<Qt3D::QObserverInterface *>();
qRegisterMetaType<Qt3D::QEntity *>();
@@ -69,7 +71,7 @@ QAspectEnginePrivate::QAspectEnginePrivate(QAspectEngine *qq)
}
QAspectEngine::QAspectEngine(QObject *parent)
- : QObject(*new QAspectEnginePrivate(this), parent)
+ : QObject(*new QAspectEnginePrivate, parent)
{
// Don't show any debug output from Qt3D. If you need to enable additional logging
// for debugging use a rules file as explained in the QLoggingCategory documentation.
@@ -77,21 +79,32 @@ QAspectEngine::QAspectEngine(QObject *parent)
qCDebug(Aspects) << Q_FUNC_INFO;
Q_D(QAspectEngine);
+ d->m_scene = new QScene(this);
+ d->m_postman = new QPostman(this);
+ d->m_postman->setScene(d->m_scene);
d->m_aspectThread = new QAspectThread(this);
d->m_aspectThread->waitForStart(QThread::HighestPriority);
}
+/*! \internal */
QAspectEngine::QAspectEngine(QAspectEnginePrivate &dd, QObject *parent)
: QObject(dd, parent)
{
Q_D(QAspectEngine);
+ d->m_scene = new QScene(this);
+ d->m_postman = new QPostman(this);
+ d->m_postman->setScene(d->m_scene);
d->m_aspectThread = new QAspectThread(this);
d->m_aspectThread->waitForStart(QThread::HighestPriority);
}
QAspectEngine::~QAspectEngine()
{
+ Q_D(QAspectEngine);
shutdown();
+ delete d->m_aspectThread;
+ delete d->m_postman;
+ delete d->m_scene;
}
void QAspectEngine::initNodeTree(QNode *node) const
diff --git a/src/core/aspects/qaspectengine_p.h b/src/core/aspects/qaspectengine_p.h
index adab34245..d2f2da88e 100644
--- a/src/core/aspects/qaspectengine_p.h
+++ b/src/core/aspects/qaspectengine_p.h
@@ -55,7 +55,7 @@ class QSceneInterface;
class QAspectEnginePrivate : public QObjectPrivate
{
public:
- QAspectEnginePrivate(QAspectEngine *qq);
+ QAspectEnginePrivate();
Q_DECLARE_PUBLIC(QAspectEngine)
diff --git a/src/core/aspects/qaspectfactory.cpp b/src/core/aspects/qaspectfactory.cpp
index 9c049c66c..04e902acf 100644
--- a/src/core/aspects/qaspectfactory.cpp
+++ b/src/core/aspects/qaspectfactory.cpp
@@ -54,6 +54,10 @@ QT3DCORESHARED_EXPORT void qt3d_QAspectFactoryPrivate_addDefaultFactory(const QS
defaultFactories->insert(name, factory);
}
+/*!
+ \class Qt3D::QAspectFactoryPrivate
+ \internal
+*/
QAspectFactoryPrivate::QAspectFactoryPrivate()
: m_factories(*defaultFactories)
{
diff --git a/src/core/bounds/qaxisalignedboundingbox.cpp b/src/core/bounds/qaxisalignedboundingbox.cpp
index f539173b0..21bb55bb4 100644
--- a/src/core/bounds/qaxisalignedboundingbox.cpp
+++ b/src/core/bounds/qaxisalignedboundingbox.cpp
@@ -84,8 +84,9 @@ void QAxisAlignedBoundingBox::update(const QVector<QVector3D> &points)
QDebug operator<<(QDebug dbg, const QAxisAlignedBoundingBox &c)
{
- dbg.nospace() << "AABB ( min:" << c.minPoint() << ", max:" << c.maxPoint() << ")";
- return dbg.space();
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "AABB ( min:" << c.minPoint() << ", max:" << c.maxPoint() << ')';
+ return dbg;
}
} //namespace Qt3D
diff --git a/src/core/core-components/qcamera.cpp b/src/core/core-components/qcamera.cpp
index 6ca15a7bc..76d208cc9 100644
--- a/src/core/core-components/qcamera.cpp
+++ b/src/core/core-components/qcamera.cpp
@@ -41,16 +41,28 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QCameraPrivate::QCameraPrivate(QCamera *qq)
- : QEntityPrivate(qq)
+/*!
+ \class Qt3D::QCameraPrivate
+ \internal
+*/
+QCameraPrivate::QCameraPrivate()
+ : QEntityPrivate()
, m_lens(new QCameraLens())
, m_transform(new QTransform())
, m_lookAt(new QLookAtTransform())
{
}
+/*!
+ \qmltype Camera
+ \instantiates Qt3D::QCamera
+ \inherits Entity
+ \inqmlmodule Qt3D
+ \since 5.5
+*/
+
QCamera::QCamera(QNode *parent) :
- QEntity(*new QCameraPrivate(this), parent)
+ QEntity(*new QCameraPrivate, parent)
{
QObject::connect(d_func()->m_lens, SIGNAL(projectionTypeChanged()), this, SIGNAL(projectionMatrixChanged()));
QObject::connect(d_func()->m_lens, SIGNAL(nearPlaneChanged()), this, SIGNAL(nearPlaneChanged()));
@@ -70,6 +82,7 @@ QCamera::QCamera(QNode *parent) :
addComponent(d_func()->m_transform);
}
+/*! \internal */
QCamera::QCamera(QCameraPrivate &dd, QNode *parent)
: QEntity(dd, parent)
{
@@ -235,6 +248,15 @@ void QCamera::setProjectionType(QCameraLens::ProjectionType type)
d->m_lens->setProjectionType(type);
}
+/*!
+ \qmlproperty enumeration Qt3D::Camera::projectionType
+
+ Holds the type of the camera projection (orthogonal or perspective).
+
+ \value CameraLens.OrthogonalProjection Orthogonal projection
+ \value CameraLens.PerspectiveProjection Perspective projection
+*/
+
QCameraLens::ProjectionType QCamera::projectionType() const
{
Q_D(const QCamera);
@@ -247,6 +269,10 @@ void QCamera::setNearPlane(float nearPlane)
d->m_lens->setNearPlane(nearPlane);
}
+/*!
+ \qmlproperty float Qt3D::Camera::nearPlane
+*/
+
float QCamera::nearPlane() const
{
Q_D(const QCamera);
@@ -259,6 +285,10 @@ void QCamera::setFarPlane(float farPlane)
d->m_lens->setFarPlane(farPlane);
}
+/*!
+ \qmlproperty float Qt3D::Camera::farPlane
+*/
+
float QCamera::farPlane() const
{
Q_D(const QCamera);
@@ -271,6 +301,10 @@ void QCamera::setFieldOfView(float fieldOfView)
d->m_lens->setFieldOfView(fieldOfView);
}
+/*!
+ \qmlproperty float Qt3D::Camera::fieldOfView
+*/
+
float QCamera::fieldOfView() const
{
Q_D(const QCamera);
@@ -283,6 +317,10 @@ void QCamera::setAspectRatio(float aspectRatio)
d->m_lens->setAspectRatio(aspectRatio);
}
+/*!
+ \qmlproperty float Qt3D::Camera::aspectRatio
+*/
+
float QCamera::aspectRatio() const
{
Q_D(const QCamera);
@@ -295,6 +333,10 @@ void QCamera::setLeft(float left)
d->m_lens->setLeft(left);
}
+/*!
+ \qmlproperty float Qt3D::Camera::left
+*/
+
float QCamera::left() const
{
Q_D(const QCamera);
@@ -307,6 +349,10 @@ void QCamera::setRight(float right)
d->m_lens->setRight(right);
}
+/*!
+ \qmlproperty float Qt3D::Camera::right
+*/
+
float QCamera::right() const
{
Q_D(const QCamera);
@@ -319,6 +365,10 @@ void QCamera::setBottom(float bottom)
d->m_lens->setBottom(bottom);
}
+/*!
+ \qmlproperty float Qt3D::Camera::bottom
+*/
+
float QCamera::bottom() const
{
Q_D(const QCamera);
@@ -331,12 +381,21 @@ void QCamera::setTop(float top)
d->m_lens->setTop(top);
}
+/*!
+ \qmlproperty float Qt3D::Camera::top
+*/
+
float QCamera::top() const
{
Q_D(const QCamera);
return d->m_lens->top();
}
+/*!
+ \qmlproperty matrix4x4 Qt3D::Camera::projectionMatrix
+ \readonly
+*/
+
QMatrix4x4 QCamera::projectionMatrix() const
{
Q_D(const QCamera);
@@ -349,6 +408,10 @@ void QCamera::setPosition(const QVector3D &position)
d->m_lookAt->setPosition(position);
}
+/*!
+ \qmlproperty vector3d Qt3D::Camera::position
+*/
+
QVector3D QCamera::position() const
{
Q_D(const QCamera);
@@ -362,6 +425,10 @@ void QCamera::setUpVector(const QVector3D &upVector)
d->m_lookAt->setUpVector(upVector);
}
+/*!
+ \qmlproperty vector3d Qt3D::Camera::upVector
+*/
+
QVector3D QCamera::upVector() const
{
Q_D(const QCamera);
@@ -374,6 +441,10 @@ void QCamera::setViewCenter(const QVector3D &viewCenter)
d->m_lookAt->setViewCenter(viewCenter);
}
+/*!
+ \qmlproperty vector3d Qt3D::Camera::viewCenter
+*/
+
QVector3D QCamera::viewCenter() const
{
Q_D(const QCamera);
diff --git a/src/core/core-components/qcamera_p.h b/src/core/core-components/qcamera_p.h
index e0b4c332d..1b6e5a85c 100644
--- a/src/core/core-components/qcamera_p.h
+++ b/src/core/core-components/qcamera_p.h
@@ -49,7 +49,7 @@ namespace Qt3D {
class QT3DCORESHARED_EXPORT QCameraPrivate : public QEntityPrivate
{
public:
- QCameraPrivate(QCamera *qq);
+ QCameraPrivate();
Q_DECLARE_PUBLIC(QCamera)
diff --git a/src/core/core-components/qcameralens.cpp b/src/core/core-components/qcameralens.cpp
index d299a5096..5fc43e5c3 100644
--- a/src/core/core-components/qcameralens.cpp
+++ b/src/core/core-components/qcameralens.cpp
@@ -41,8 +41,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QCameraLensPrivate::QCameraLensPrivate(QCameraLens *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QCameraLensPrivate
+ \internal
+*/
+QCameraLensPrivate::QCameraLensPrivate()
+ : QComponentPrivate()
, m_projectionType(QCameraLens::OrthogonalProjection)
, m_nearPlane(0.1f)
, m_farPlane(1024.0f)
@@ -55,9 +59,8 @@ QCameraLensPrivate::QCameraLensPrivate(QCameraLens *qq)
{
}
-
QCameraLens::QCameraLens(QNode *parent)
- : QComponent(*new QCameraLensPrivate(this), parent)
+ : QComponent(*new QCameraLensPrivate, parent)
{
Q_D(QCameraLens);
d->updateProjectionMatrix();
@@ -79,6 +82,13 @@ void QCameraLens::copy(const QNode *ref)
d_func()->m_projectionMatrix = lens->d_func()->m_projectionMatrix;
}
+/*! \class Qt3D::QCameraLens
+ *
+ * \brief Qt3D::QCameraLens specifies the projection matrix that will be used to
+ * define a Camera for a 3D scene.
+ *
+ * \since 5.5
+ */
QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
@@ -86,6 +96,13 @@ QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent)
d->updateOrthogonalProjection();
}
+/*!
+ * Sets the lens' projection type \a projectionType.
+ *
+ * \note Qt3D::QCameraLens::Frustum and
+ * Qt3D::QCameraLens::PerspectiveProjection are two different ways of
+ * specifying the same projection.
+ */
void QCameraLens::setProjectionType(QCameraLens::ProjectionType projectionType)
{
Q_D(QCameraLens);
@@ -96,15 +113,22 @@ void QCameraLens::setProjectionType(QCameraLens::ProjectionType projectionType)
}
}
+/*!
+ * Returns the lens' projection type.
+ */
QCameraLens::ProjectionType QCameraLens::projectionType() const
{
Q_D(const QCameraLens);
return d->m_projectionType;
}
-void QCameraLens::setOrthographicProjection( float left, float right,
- float bottom, float top,
- float nearPlane, float farPlane )
+/*!
+ * Defines an orthographic projection based on \a left, \a right, \a bottom, \a
+ * top, \a nearPlane, \a farPlane.
+ */
+void QCameraLens::setOrthographicProjection(float left, float right,
+ float bottom, float top,
+ float nearPlane, float farPlane)
{
Q_D(QCameraLens);
bool block = blockNotifications(true);
@@ -119,8 +143,33 @@ void QCameraLens::setOrthographicProjection( float left, float right,
d->updateProjectionMatrix();
}
-void QCameraLens::setPerspectiveProjection( float fieldOfView, float aspectRatio,
- float nearPlane, float farPlane )
+/*!
+ * Defines an orthographic projection based on \a left, \a right, \a bottom, \a
+ * top, \a nearPlane, \a farPlane.
+ */
+void QCameraLens::setFrustumProjection(float left, float right,
+ float bottom, float top,
+ float nearPlane, float farPlane)
+{
+ Q_D(QCameraLens);
+ bool block = blockNotifications(true);
+ setLeft(left);
+ setRight(right);
+ setBottom(bottom);
+ setTop(top);
+ setNearPlane(nearPlane);
+ setFarPlane(farPlane);
+ setProjectionType(FrustumProjection);
+ blockNotifications(block);
+ d->updateProjectionMatrix();
+}
+
+/*!
+ * Defines a perspective projection based on \a fieldOfView, \a aspectRatio, \a
+ * nearPlane, \a farPlane.
+ */
+void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio,
+ float nearPlane, float farPlane)
{
Q_D(QCameraLens);
bool block = blockNotifications(true);
@@ -133,6 +182,10 @@ void QCameraLens::setPerspectiveProjection( float fieldOfView, float aspectRatio
d->updateProjectionMatrix();
}
+/*!
+ * Sets the projection's near plane to \a nearPlane. This triggers a projection
+ * matrix update.
+ */
void QCameraLens::setNearPlane(float nearPlane)
{
Q_D(QCameraLens);
@@ -143,12 +196,19 @@ void QCameraLens::setNearPlane(float nearPlane)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the projection's near plane.
+ */
float QCameraLens::nearPlane() const
{
Q_D(const QCameraLens);
return d->m_nearPlane;
}
+/*!
+ * Sets the projection's far plane to \a farPlane. This triggers a projection
+ * matrix update.
+ */
void QCameraLens::setFarPlane(float farPlane)
{
Q_D(QCameraLens);
@@ -159,12 +219,22 @@ void QCameraLens::setFarPlane(float farPlane)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the projection's far plane.
+ */
float QCameraLens::farPlane() const
{
Q_D(const QCameraLens);
return d->m_farPlane;
}
+/*!
+ * Sets the projection's field of view to \a fieldOfView degrees. This triggers
+ * a projection matrix update.
+ *
+ * \note this has no effect if the projection type is not
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setFieldOfView(float fieldOfView)
{
Q_D(QCameraLens);
@@ -175,12 +245,25 @@ void QCameraLens::setFieldOfView(float fieldOfView)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the projection's field of view in degrees.
+ *
+ * \note: The return value may be undefined if the projection type is not
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::fieldOfView() const
{
Q_D(const QCameraLens);
return d->m_fieldOfView;
}
+/*!
+ * Sets the projection's aspect ratio to \a aspectRatio. This triggers a projection
+ * matrix update.
+ *
+ * \note this has no effect if the projection type is not
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setAspectRatio(float aspectRatio)
{
Q_D(QCameraLens);
@@ -191,12 +274,25 @@ void QCameraLens::setAspectRatio(float aspectRatio)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the projection's aspect ratio.
+ *
+ * \note: The return value may be undefined if the projection type is not
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::aspectRatio() const
{
Q_D(const QCameraLens);
return d->m_aspectRatio;
}
+/*!
+ * Sets the projection's lower left window coordinate to \a left. This
+ * triggers a projection matrix update.
+ *
+ * \note this has no effect if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setLeft(float left)
{
Q_D(QCameraLens);
@@ -207,12 +303,25 @@ void QCameraLens::setLeft(float left)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the lower left window coordinate of the projection.
+ *
+ * \note The return value may be undefined if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::left() const
{
Q_D(const QCameraLens);
return d->m_left;
}
+/*!
+ * Sets the projection's upper right window coordinate to \a right. This triggers
+ * a projection matrix update.
+ *
+ * \note this has no effect if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setRight(float right)
{
Q_D(QCameraLens);
@@ -223,12 +332,25 @@ void QCameraLens::setRight(float right)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the upper right window coordinate of the projection.
+ *
+ * \note The return value may be undefined if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::right() const
{
Q_D(const QCameraLens);
return d->m_right;
}
+/*!
+ * Sets the projection's bottom window coordinate to \a bottom. This triggers a
+ * projection matrix update.
+ *
+ * \note this has no effect if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setBottom(float bottom)
{
Q_D(QCameraLens);
@@ -239,12 +361,25 @@ void QCameraLens::setBottom(float bottom)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the bottom window coordinate of the projection.
+ *
+ * \note The return value may be undefined if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::bottom() const
{
Q_D(const QCameraLens);
return d->m_bottom;
}
+/*!
+ * Sets the projection's top window coordinate to \a top. This triggers a
+ * projection matrix update.
+ *
+ * \note this has no effect if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
void QCameraLens::setTop(float top)
{
Q_D(QCameraLens);
@@ -255,12 +390,21 @@ void QCameraLens::setTop(float top)
d->updateProjectionMatrix();
}
+/*!
+ * Returns the bottom window coordinate of the projection.
+ *
+ * \note The return value may be undefined if the projection type is
+ * Qt3D::QCameraLens::PerspectiveProjection.
+ */
float QCameraLens::top() const
{
Q_D(const QCameraLens);
return d->m_top;
}
+/*!
+ * Returns the projection matrix.
+ */
QMatrix4x4 QCameraLens::projectionMatrix() const
{
Q_D(const QCameraLens);
@@ -269,4 +413,58 @@ QMatrix4x4 QCameraLens::projectionMatrix() const
} // Qt3D
+/*!
+ \qmltype CameraLens
+ \instantiates Qt3D::QCameraLens
+ \inqmlmodule Qt3D
+ \inherits Component3D
+ \since 5.5
+*/
+
+/*!
+ \qmlproperty enumeration Qt3D::CameraLens::projectionType
+
+ Holds the type of the camera projection (orthogonal or perspective).
+
+ \value CameraLens.OrthogonalProjection Orthogonal projection
+ \value CameraLens.PerspectiveProjection Perspective projection
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::nearPlane
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::farPlane
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::fieldOfView
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::aspectRatio
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::left
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::right
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::bottom
+*/
+
+/*!
+ \qmlproperty float Qt3D::CameraLens::top
+*/
+
+/*!
+ \qmlproperty matrix4x4 Qt3D::CameraLens::projectionMatrix
+ \readonly
+*/
+
QT_END_NAMESPACE
diff --git a/src/core/core-components/qcameralens.h b/src/core/core-components/qcameralens.h
index 8e1c69fed..0e871cc6b 100644
--- a/src/core/core-components/qcameralens.h
+++ b/src/core/core-components/qcameralens.h
@@ -53,8 +53,6 @@ class QCameraLensPrivate;
class QT3DCORESHARED_EXPORT QCameraLens : public QComponent
{
Q_OBJECT
-
- Q_ENUMS( ProjectionType )
Q_PROPERTY(ProjectionType projectionType READ projectionType WRITE setProjectionType NOTIFY projectionTypeChanged)
Q_PROPERTY(float nearPlane READ nearPlane WRITE setNearPlane NOTIFY nearPlaneChanged)
Q_PROPERTY(float farPlane READ farPlane WRITE setFarPlane NOTIFY farPlaneChanged)
@@ -71,8 +69,10 @@ public:
enum ProjectionType {
OrthogonalProjection,
- PerspectiveProjection
+ PerspectiveProjection,
+ FrustumProjection
};
+ Q_ENUM(ProjectionType)
void setProjectionType(ProjectionType projectionType);
ProjectionType projectionType() const;
@@ -107,6 +107,10 @@ public:
float bottom, float top,
float nearPlane, float farPlane);
+ void setFrustumProjection(float left, float right,
+ float bottom, float top,
+ float nearPlane, float farPlane);
+
void setPerspectiveProjection(float fieldOfView, float aspect,
float nearPlane, float farPlane);
diff --git a/src/core/core-components/qcameralens_p.h b/src/core/core-components/qcameralens_p.h
index f0c810357..ec3b43c63 100644
--- a/src/core/core-components/qcameralens_p.h
+++ b/src/core/core-components/qcameralens_p.h
@@ -51,7 +51,7 @@ namespace Qt3D {
class QT3DCORESHARED_EXPORT QCameraLensPrivate : public QComponentPrivate
{
public:
- QCameraLensPrivate(QCameraLens *qq);
+ QCameraLensPrivate();
inline void updateProjectionMatrix()
{
@@ -62,6 +62,9 @@ public:
case QCameraLens::PerspectiveProjection:
updatePerpectiveProjection();
break;
+ case QCameraLens::FrustumProjection:
+ updateFrustumProjection();
+ break;
}
}
@@ -98,6 +101,14 @@ private:
m_projectionMatrix.ortho(m_left, m_right, m_bottom, m_top, m_nearPlane, m_farPlane);
Q_EMIT q->projectionMatrixChanged();
}
+
+ inline void updateFrustumProjection()
+ {
+ Q_Q(QCameraLens);
+ m_projectionMatrix.setToIdentity();
+ m_projectionMatrix.frustum(m_left, m_right, m_bottom, m_top, m_nearPlane, m_farPlane);
+ Q_EMIT q->projectionMatrixChanged();
+ }
};
} // namespace Qt3D
diff --git a/src/core/core.pri b/src/core/core.pri
index c44e09c64..32bd30bc9 100644
--- a/src/core/core.pri
+++ b/src/core/core.pri
@@ -40,6 +40,7 @@ HEADERS += \
$$PWD/qlockableobserverinterface_p.h \
$$PWD/qchangearbiter_p.h \
$$PWD/qbackendnodefactory.h \
+ $$PWD/qray3d.h \
$$PWD/qt3dcore_global_p.h
SOURCES += \
@@ -57,4 +58,5 @@ SOURCES += \
$$PWD/qpostman.cpp \
$$PWD/qscene.cpp \
$$PWD/qbackendscenepropertychange.cpp \
- $$PWD/qbackendnodefactory.cpp
+ $$PWD/qbackendnodefactory.cpp \
+ $$PWD/qray3d.cpp
diff --git a/src/core/doc/qt3dcore.qdocconf b/src/core/doc/qt3dcore.qdocconf
index a1a90a31b..db2848ae8 100644
--- a/src/core/doc/qt3dcore.qdocconf
+++ b/src/core/doc/qt3dcore.qdocconf
@@ -18,23 +18,41 @@ qhp.Qt3DCore.filterAttributes = qt3dcore $QT_VERSION qtrefdoc
qhp.Qt3DCore.customFilters.Qt.name = Qt3DCore $QT_VERSION
qhp.Qt3DCore.customFilters.Qt.filterAttributes = qt3dcore $QT_VERSION
-qhp.Qt3DCore.subprojects = classes
+qhp.Qt3DCore.subprojects = classes qmltypes
+
qhp.Qt3DCore.subprojects.classes.title = C++ Classes
qhp.Qt3DCore.subprojects.classes.indexTitle = Qt3D Core C++ Classes
qhp.Qt3DCore.subprojects.classes.selectors = class fake:headerfile
qhp.Qt3DCore.subprojects.classes.sortPages = true
+qhp.Qt3DCore.subprojects.qmltypes.title = QML Types
+qhp.Qt3DCore.subprojects.qmltypes.indexTitle = Qt3D Core QML Types
+qhp.Qt3DCore.subprojects.qmltypes.selectors = qmlclass
+qhp.Qt3DCore.subprojects.qmltypes.sortPages = true
+
tagfile = ../../../doc/qt3dcore/qt3dcore.tags
depends += qtcore qtqml qtquick qtdoc qt3drender
-headerdirs += ..
-sourcedirs += ..
+headerdirs += .. \
+ ../../plugins \
+ ../../quick3d/quick3d
+
+sourcedirs += .. \
+ ../../plugins \
+ ../../quick3d/quick3d
+
exampledirs += src/snippets
#excludedirs +=
imagedirs += images
+Cpp.ignoretokens += QT3DCORE_PRIVATE_EXPORT \
+ QT3DCORESHARED_EXPORT
+
+Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY
+
navigation.landingpage = "Qt3D Core"
navigation.cppclassespage = "Qt3D Core C++ Classes"
+navigation.qmltypespage = "Qt3D Core QML Types"
diff --git a/src/core/doc/src/qt3dcore-index.qdoc b/src/core/doc/src/qt3dcore-index.qdoc
index 184068337..b2908264b 100644
--- a/src/core/doc/src/qt3dcore-index.qdoc
+++ b/src/core/doc/src/qt3dcore-index.qdoc
@@ -58,6 +58,7 @@
\list
\li \l {Qt3D Core C++ Classes}
+ \li \l {Qt3D Core QML Types}
\li \l {Qt3D Examples}
\endlist
diff --git a/src/core/doc/src/qt3dcore-module.qdoc b/src/core/doc/src/qt3dcore-module.qdoc
index 20cef4e80..d664b8bf6 100644
--- a/src/core/doc/src/qt3dcore-module.qdoc
+++ b/src/core/doc/src/qt3dcore-module.qdoc
@@ -40,7 +40,7 @@
\brief The Qt3D Core module contains functionality to support near-realtime simulation systems.
\ingroup modules
- \qtvariable qt3dcore
+ \qtvariable 3dcore
The Qt3D Core module provides the foundations and core types used for near-realtime
simulations built on the Qt3D framework.
@@ -50,6 +50,21 @@
\namespace Qt3D
\inmodule Qt3DCore
- The Qt3D namespace contains classes and types that are in the foundation of the Qt3D simulation
+ \brief Contains classes and types that are the foundation of the Qt3D simulation
+ framework, as well as classes that provide the ability to render using the Qt3D
framework.
*/
+
+/*!
+ \qmlmodule Qt3D 2.0
+ \title Qt3D Core QML Types
+ \ingroup qmlmodules
+
+ \brief Provides core Qt3D QML types.
+
+ To import and use the module's QML types, use the following statement:
+
+ \badcode
+ import Qt3D 2.0
+ \endcode
+*/
diff --git a/src/core/io/qabstractattribute.cpp b/src/core/io/qabstractattribute.cpp
index c18961a63..17ed41bf6 100644
--- a/src/core/io/qabstractattribute.cpp
+++ b/src/core/io/qabstractattribute.cpp
@@ -42,11 +42,15 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAbstractAttributePrivate::QAbstractAttributePrivate(QAbstractAttribute *qq)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QAbstractAttributePrivate
+ \internal
+*/
+QAbstractAttributePrivate::QAbstractAttributePrivate()
{
}
+/*! \internal */
QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QAbstractBufferPtr buf, int type, uint count, uint offset, uint stride)
: d_ptr(&dd)
{
@@ -60,7 +64,7 @@ QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QAbstractB
}
QAbstractAttribute::QAbstractAttribute(QAbstractBufferPtr buf, int type, uint count, uint offset, uint stride)
- : d_ptr(new QAbstractAttributePrivate(this))
+ : d_ptr(new QAbstractAttributePrivate)
{
Q_D(QAbstractAttribute);
d->m_buffer = buf;
diff --git a/src/core/io/qabstractattribute_p.h b/src/core/io/qabstractattribute_p.h
index 947dd2703..526a8d81d 100644
--- a/src/core/io/qabstractattribute_p.h
+++ b/src/core/io/qabstractattribute_p.h
@@ -43,7 +43,6 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QAbstractAttribute;
class QAbstractBuffer;
typedef QSharedPointer<QAbstractBuffer> QAbstractBufferPtr;
@@ -51,10 +50,8 @@ typedef QSharedPointer<QAbstractBuffer> QAbstractBufferPtr;
class QT3DCORESHARED_EXPORT QAbstractAttributePrivate
{
public:
- QAbstractAttributePrivate(QAbstractAttribute *qq);
+ QAbstractAttributePrivate();
- Q_DECLARE_PUBLIC(QAbstractAttribute)
- QAbstractAttribute *q_ptr;
int m_type;
uint m_count;
uint m_stride;
diff --git a/src/core/io/qabstractbuffer.cpp b/src/core/io/qabstractbuffer.cpp
index b162549e9..9337b923f 100644
--- a/src/core/io/qabstractbuffer.cpp
+++ b/src/core/io/qabstractbuffer.cpp
@@ -41,13 +41,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAbstractBufferPrivate::QAbstractBufferPrivate(QAbstractBuffer *qq)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QAbstractBufferPrivate
+ \internal
+*/
+QAbstractBufferPrivate::QAbstractBufferPrivate()
{
}
QAbstractBuffer::QAbstractBuffer()
- : d_ptr(new QAbstractBufferPrivate(this))
+ : d_ptr(new QAbstractBufferPrivate)
{
}
@@ -55,6 +58,7 @@ QAbstractBuffer::~QAbstractBuffer()
{
}
+/*! \internal */
QAbstractBuffer::QAbstractBuffer(QAbstractBufferPrivate &dd)
: d_ptr(&dd)
{
diff --git a/src/core/io/qabstractbuffer_p.h b/src/core/io/qabstractbuffer_p.h
index 68d04bce7..a393df4dd 100644
--- a/src/core/io/qabstractbuffer_p.h
+++ b/src/core/io/qabstractbuffer_p.h
@@ -44,15 +44,11 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QAbstractBuffer;
-
class QT3DCORESHARED_EXPORT QAbstractBufferPrivate
{
public:
- QAbstractBufferPrivate(QAbstractBuffer *qq);
+ QAbstractBufferPrivate();
- Q_DECLARE_PUBLIC(QAbstractBuffer)
- QAbstractBuffer *q_ptr;
QByteArray m_data;
};
diff --git a/src/core/jobs/dependencyhandler.cpp b/src/core/jobs/dependencyhandler.cpp
index 9778ede58..a805638fe 100644
--- a/src/core/jobs/dependencyhandler.cpp
+++ b/src/core/jobs/dependencyhandler.cpp
@@ -47,13 +47,13 @@ namespace {
struct ByDepender {
typedef bool result_type;
- bool operator()(const QSharedPointer<TaskInterface> &lhs, const QSharedPointer<TaskInterface> &rhs) const Q_DECL_NOTHROW
- { return Op<QSharedPointer<TaskInterface> >()(lhs, rhs); }
+ bool operator()(const RunnableInterface *lhs, const RunnableInterface *rhs) const Q_DECL_NOTHROW
+ { return Op<const RunnableInterface *>()(lhs, rhs); }
- bool operator()(const QSharedPointer<TaskInterface> &lhs, const Dependency &rhs) const Q_DECL_NOTHROW
+ bool operator()(const RunnableInterface *lhs, const Dependency &rhs) const Q_DECL_NOTHROW
{ return operator()(lhs, rhs.depender); }
- bool operator()(const Dependency &lhs, const QSharedPointer<TaskInterface> &rhs) const Q_DECL_NOTHROW
+ bool operator()(const Dependency &lhs, const RunnableInterface *rhs) const Q_DECL_NOTHROW
{ return operator()(lhs.depender, rhs); }
bool operator()(const Dependency &lhs, const Dependency &rhs) const Q_DECL_NOTHROW
@@ -62,12 +62,29 @@ namespace {
struct DependeeEquals : std::unary_function<Dependency, bool>
{
- QSharedPointer<TaskInterface> dependee;
- explicit DependeeEquals(QSharedPointer<TaskInterface> dependee)
- : dependee(qMove(dependee)) {}
+ const RunnableInterface *dependee;
+ QVector<RunnableInterface *> *freedList;
+ explicit DependeeEquals(const RunnableInterface *dependee, QVector<RunnableInterface *> *freedList)
+ : dependee(qMove(dependee)), freedList(qMove(freedList)) {}
bool operator()(const Dependency &candidate) const
{
- return dependee == candidate.dependee;
+ if (dependee == candidate.dependee) {
+ if (!candidate.depender->reserved())
+ freedList->append(candidate.depender);
+ return true;
+ }
+ return false;
+ }
+ };
+
+ struct DependerEquals : std::unary_function<Dependency, bool>
+ {
+ const RunnableInterface *depender;
+ explicit DependerEquals(const RunnableInterface *depender)
+ : depender(qMove(depender)) {}
+ bool operator()(const Dependency &candidate) const
+ {
+ return depender == candidate.depender;
}
};
@@ -91,7 +108,7 @@ void DependencyHandler::addDependencies(QVector<Dependency> dependencies)
{
std::sort(dependencies.begin(), dependencies.end(), ByDependerThenDependee());
- const QMutexLocker locker(&m_mutex);
+ const QMutexLocker locker(m_mutex);
QVector<Dependency> newDependencyMap;
newDependencyMap.reserve(dependencies.size() + m_dependencyMap.size());
@@ -101,9 +118,9 @@ void DependencyHandler::addDependencies(QVector<Dependency> dependencies)
m_dependencyMap.swap(newDependencyMap); // commit
}
-bool DependencyHandler::hasDependency(const QSharedPointer<TaskInterface> &depender)
+bool DependencyHandler::hasDependency(const RunnableInterface *depender)
{
- const QMutexLocker locker(&m_mutex);
+ // The caller has to set the mutex, which is QThreadPooler::enqueueTasks
return std::binary_search(m_dependencyMap.begin(), m_dependencyMap.end(),
depender, ByDepender<std::less>());
@@ -113,13 +130,22 @@ bool DependencyHandler::hasDependency(const QSharedPointer<TaskInterface> &depen
* Removes all the entries on the m_dependencyMap that have given task as a dependee,
* i.e. entries where the dependency is on the given task.
*/
-void DependencyHandler::freeDependencies(const QSharedPointer<TaskInterface> &dependee)
+QVector<RunnableInterface *> DependencyHandler::freeDependencies(const RunnableInterface *task)
{
- const QMutexLocker locker(&m_mutex);
+ // The caller has to set the mutex, which is QThreadPooler::taskFinished
+
+ m_dependencyMap.erase(std::remove_if(m_dependencyMap.begin(),
+ m_dependencyMap.end(),
+ DependerEquals(task)),
+ m_dependencyMap.end());
- m_dependencyMap.erase(std::remove_if(m_dependencyMap.begin(), m_dependencyMap.end(),
- DependeeEquals(dependee)),
+ QVector<RunnableInterface *> freedList;
+ m_dependencyMap.erase(std::remove_if(m_dependencyMap.begin(),
+ m_dependencyMap.end(),
+ DependeeEquals(task, &freedList)),
m_dependencyMap.end());
+
+ return freedList;
}
} // namespace Qt3D
diff --git a/src/core/jobs/dependencyhandler_p.h b/src/core/jobs/dependencyhandler_p.h
index 0d2aafaa6..288ee20b3 100644
--- a/src/core/jobs/dependencyhandler_p.h
+++ b/src/core/jobs/dependencyhandler_p.h
@@ -49,18 +49,18 @@ namespace Qt3D {
struct Dependency
{
Dependency() {}
- Dependency(QSharedPointer<TaskInterface> depender, QSharedPointer<TaskInterface> dependee)
+ Dependency(RunnableInterface *depender, RunnableInterface *dependee)
: depender(qMove(depender)),
dependee(qMove(dependee)) {}
- QSharedPointer<TaskInterface> depender;
- QSharedPointer<TaskInterface> dependee;
+ RunnableInterface *depender;
+ RunnableInterface *dependee;
};
} // namespace Qt3D
template <>
-class QTypeInfo<Qt3D::Dependency> : public QTypeInfoMerger<Qt3D::Dependency, QSharedPointer<Qt3D::TaskInterface> > {};
+class QTypeInfo<Qt3D::Dependency> : public QTypeInfoMerger<Qt3D::Dependency, Qt3D::RunnableInterface *> {};
namespace Qt3D {
@@ -80,14 +80,15 @@ public:
DependencyHandler();
void addDependencies(QVector<Dependency> dependencies);
- bool hasDependency(const QSharedPointer<TaskInterface> &depender);
- void freeDependencies(const QSharedPointer<TaskInterface> &dependee);
+ bool hasDependency(const RunnableInterface *depender);
+ QVector<RunnableInterface *> freeDependencies(const RunnableInterface *task);
+ void setMutex(QMutex *mutex) { m_mutex = mutex; }
private:
Q_DISABLE_COPY(DependencyHandler)
QVector<Dependency> m_dependencyMap;
- mutable QMutex m_mutex;
+ QMutex *m_mutex;
};
} // namespace Qt3D
diff --git a/src/core/jobs/jobs.pri b/src/core/jobs/jobs.pri
index b6def7aa8..d21d21975 100644
--- a/src/core/jobs/jobs.pri
+++ b/src/core/jobs/jobs.pri
@@ -3,7 +3,6 @@ SOURCES += \
$$PWD/qaspectjob.cpp \
$$PWD/qaspectjobmanager.cpp \
$$PWD/qabstractaspectjobmanager.cpp \
- $$PWD/jobrunner.cpp \
$$PWD/qthreadpooler.cpp \
$$PWD/task.cpp \
$$PWD/dependencyhandler.cpp
@@ -26,9 +25,7 @@ HEADERS += \
$$PWD/qaspectjobmanager_p.h \
$$PWD/qabstractaspectjobmanager_p.h \
$$PWD/dependencyhandler_p.h \
- $$PWD/jobrunner_p.h \
$$PWD/task_p.h \
- $$PWD/qthreadpooler_p_p.h \
$$PWD/qthreadpooler_p.h
INCLUDEPATH += $$PWD
diff --git a/src/core/jobs/qabstractaspectjobmanager.cpp b/src/core/jobs/qabstractaspectjobmanager.cpp
index 393c36897..bfd9e1638 100644
--- a/src/core/jobs/qabstractaspectjobmanager.cpp
+++ b/src/core/jobs/qabstractaspectjobmanager.cpp
@@ -41,11 +41,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
+/*!
+ \class Qt3D::QAbstractAspectJobManagerPrivate
+ \internal
+*/
QAbstractAspectJobManager::QAbstractAspectJobManager(QObject *parent)
: QObject(*new QAbstractAspectJobManagerPrivate, parent)
{
}
+/*! \internal */
QAbstractAspectJobManager::QAbstractAspectJobManager(QAbstractAspectJobManagerPrivate &dd, QObject *parent)
: QObject(dd, parent)
{
diff --git a/src/core/jobs/qaspectjob.cpp b/src/core/jobs/qaspectjob.cpp
index e2f9eff6f..9f12adb9c 100644
--- a/src/core/jobs/qaspectjob.cpp
+++ b/src/core/jobs/qaspectjob.cpp
@@ -41,16 +41,20 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAspectJobPrivate::QAspectJobPrivate(QAspectJob *qq)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QAspectJobPrivate
+ \internal
+*/
+QAspectJobPrivate::QAspectJobPrivate()
{
}
QAspectJob::QAspectJob()
- : d_ptr(new QAspectJobPrivate(this))
+ : d_ptr(new QAspectJobPrivate)
{
}
+/*! \internal */
QAspectJob::QAspectJob(QAspectJobPrivate &dd)
: d_ptr(&dd)
{
diff --git a/src/core/jobs/qaspectjob_p.h b/src/core/jobs/qaspectjob_p.h
index 1517f5100..d1fdac44c 100644
--- a/src/core/jobs/qaspectjob_p.h
+++ b/src/core/jobs/qaspectjob_p.h
@@ -49,11 +49,9 @@ class QAspectJob;
class QAspectJobPrivate
{
public:
- QAspectJobPrivate(QAspectJob *qq);
+ QAspectJobPrivate();
- Q_DECLARE_PUBLIC(QAspectJob)
QVector<QWeakPointer<QAspectJob> > m_dependencies;
- QAspectJob *q_ptr;
};
} // Qt3D
diff --git a/src/core/jobs/qaspectjobmanager.cpp b/src/core/jobs/qaspectjobmanager.cpp
index 1ad7e8116..1488eed21 100644
--- a/src/core/jobs/qaspectjobmanager.cpp
+++ b/src/core/jobs/qaspectjobmanager.cpp
@@ -50,7 +50,9 @@
#include <QAtomicInt>
#include <QDebug>
#include <QThread>
-
+#include <QCoreApplication>
+#include <QtCore/QFuture>
+#include <QtCore/QFutureWatcher>
QT_BEGIN_NAMESPACE
@@ -99,17 +101,25 @@ void SynchronizedJob::run(ThreadWeaver::JobPointer self, ThreadWeaver::Thread *t
} // anonymous
#endif
-QAspectJobManagerPrivate::QAspectJobManagerPrivate(QAspectJobManager *qq)
+/*!
+ \class Qt3D::QAspectJobManagerPrivate
+ \internal
+*/
+QAspectJobManagerPrivate::QAspectJobManagerPrivate()
: QAbstractAspectJobManagerPrivate()
- , q_ptr(qq)
#ifdef THREAD_WEAVER
, m_weaver(Q_NULLPTR)
#endif
{
}
+QAspectJobManagerPrivate::~QAspectJobManagerPrivate()
+{
+ delete m_dependencyHandler;
+}
+
QAspectJobManager::QAspectJobManager(QObject *parent)
- : QAbstractAspectJobManager(*new QAspectJobManagerPrivate(this), parent)
+ : QAbstractAspectJobManager(*new QAspectJobManagerPrivate, parent)
{
Q_D(QAspectJobManager);
#ifdef THREAD_WEAVER
@@ -117,13 +127,12 @@ QAspectJobManager::QAspectJobManager(QObject *parent)
d->m_weaver->setMaximumNumberOfThreads(QThread::idealThreadCount());
#else
d->m_threadPooler = new QThreadPooler(this);
- d->m_threadPooler->setMaxThreadCount(QThread::idealThreadCount());
-
d->m_dependencyHandler = new DependencyHandler();
d->m_threadPooler->setDependencyHandler(d->m_dependencyHandler);
#endif
}
+/*! \internal */
QAspectJobManager::QAspectJobManager(QAspectJobManagerPrivate &dd, QObject *parent)
: QAbstractAspectJobManager(dd, parent)
{
@@ -133,9 +142,8 @@ QAspectJobManager::QAspectJobManager(QAspectJobManagerPrivate &dd, QObject *pare
d->m_weaver->setMaximumNumberOfThreads(QThread::idealThreadCount());
#else
d->m_threadPooler = new QThreadPooler(this);
- d->m_threadPooler->setMaxThreadCount(QThread::idealThreadCount());
-
d->m_dependencyHandler = new DependencyHandler();
+ d->m_threadPooler->setDependencyHandler(d->m_dependencyHandler);
#endif
}
@@ -177,24 +185,27 @@ void QAspectJobManager::enqueueJobs(const QVector<QAspectJobPtr> &jobQueue)
}
#else
// Convert QJobs to Tasks
- QHash<QAspectJob *, QSharedPointer<AspectTask>> tasksMap;
+ QHash<QAspectJob *, AspectTaskRunnable *> tasksMap;
+ QVector<RunnableInterface *> taskList;
Q_FOREACH (const QAspectJobPtr &job, jobQueue) {
- QSharedPointer<AspectTask> task = QSharedPointer<AspectTask>::create();
+ AspectTaskRunnable *task = new AspectTaskRunnable();
task->m_job = job;
tasksMap.insert(job.data(), task);
+
+ taskList << task;
}
// Resolve dependencies
QVector<Dependency> dependencyList;
- Q_FOREACH (const QAspectJobPtr &job, jobQueue) {
+ Q_FOREACH (const QSharedPointer<QAspectJob> &job, jobQueue) {
const QVector<QWeakPointer<QAspectJob> > &deps = job->dependencies();
Q_FOREACH (const QWeakPointer<QAspectJob> &dep, deps) {
- QSharedPointer<AspectTask> taskDependee = tasksMap.value(dep.data());
+ AspectTaskRunnable *taskDependee = tasksMap.value(dep.data());
if (taskDependee) {
- QSharedPointer<AspectTask> taskDepender = tasksMap.value(job.data());
+ AspectTaskRunnable *taskDepender = tasksMap.value(job.data());
dependencyList.append(Dependency(taskDepender, taskDependee));
taskDepender->setDependencyHandler(d->m_dependencyHandler);
taskDependee->setDependencyHandler(d->m_dependencyHandler);
@@ -203,10 +214,7 @@ void QAspectJobManager::enqueueJobs(const QVector<QAspectJobPtr> &jobQueue)
}
d->m_dependencyHandler->addDependencies(qMove(dependencyList));
- Q_FOREACH (const QAspectJobPtr &job, jobQueue) {
- QSharedPointer<AspectTask> task = tasksMap.value(job.data());
- d->m_threadPooler->enqueueTask(task);
- }
+ d->m_threadPooler->mapDependables(taskList);
#endif
}
@@ -216,7 +224,9 @@ void QAspectJobManager::waitForAllJobs()
#ifdef THREAD_WEAVER
d->m_weaver->finish();
#else
- d->m_threadPooler->flush();
+ QFutureWatcher<void> futureWatcher;
+ futureWatcher.setFuture(d->m_threadPooler->future());
+ futureWatcher.waitForFinished();
#endif
}
@@ -235,15 +245,19 @@ void QAspectJobManager::waitForPerThreadFunction(JobFunction func, void *arg)
d->m_weaver->finish();
#else
- const int threadCount = d->m_threadPooler->maxThreadCount();
+ const int threadCount = QThread::idealThreadCount();
QAtomicInt atomicCount(threadCount);
+ QVector<RunnableInterface *> taskList;
for (int i = 0; i < threadCount; ++i) {
- QSharedPointer<SynchronizedTask> syncTask(new SynchronizedTask(func, arg, &atomicCount));
- d->m_threadPooler->enqueueTask(syncTask);
+ SyncTaskRunnable *syncTask = new SyncTaskRunnable(func, arg, &atomicCount);
+ taskList << syncTask;
}
- d->m_threadPooler->flush();
+ QFuture<void> future = d->m_threadPooler->mapDependables(taskList);
+ QFutureWatcher<void> futureWatcher;
+ futureWatcher.setFuture(future);
+ futureWatcher.waitForFinished();
#endif
}
diff --git a/src/core/jobs/qaspectjobmanager.h b/src/core/jobs/qaspectjobmanager.h
index d260b1baa..d2436d29c 100644
--- a/src/core/jobs/qaspectjobmanager.h
+++ b/src/core/jobs/qaspectjobmanager.h
@@ -39,6 +39,7 @@
#include <Qt3DCore/qabstractaspectjobmanager.h>
#include <Qt3DCore/qt3dcore_global.h>
+#include <Qt3DCore/private/qt3dcore_global_p.h>
#include <Qt3DCore/qaspectjob.h>
@@ -50,7 +51,7 @@ namespace Qt3D {
class QAspectJobManagerPrivate;
-class QAspectJobManager : public QAbstractAspectJobManager
+class QT3DCORE_PRIVATE_EXPORT QAspectJobManager : public QAbstractAspectJobManager
{
Q_OBJECT
public:
diff --git a/src/core/jobs/qaspectjobmanager_p.h b/src/core/jobs/qaspectjobmanager_p.h
index 5ea9cc54a..4d6e1feb3 100644
--- a/src/core/jobs/qaspectjobmanager_p.h
+++ b/src/core/jobs/qaspectjobmanager_p.h
@@ -57,10 +57,10 @@ class QAspectJobManager;
class QAspectJobManagerPrivate : public QAbstractAspectJobManagerPrivate
{
public:
- QAspectJobManagerPrivate(QAspectJobManager *qq);
+ QAspectJobManagerPrivate();
+ ~QAspectJobManagerPrivate();
Q_DECLARE_PUBLIC(QAspectJobManager)
- QAspectJobManager *q_ptr;
#ifdef THREAD_WEAVER
// Owned by QAspectJobManager via QObject parent-child
@@ -69,8 +69,6 @@ public:
QThreadPooler *m_threadPooler;
DependencyHandler *m_dependencyHandler;
- QMutex *m_syncMutex;
- QWaitCondition m_syncFinished;
};
} // Qt3D
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp
index e187e8bff..5e1c2749d 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -35,227 +35,133 @@
****************************************************************************/
#include "qthreadpooler_p.h"
-#include "qthreadpooler_p_p.h"
-#include "jobrunner_p.h"
#include "dependencyhandler_p.h"
+
+#include <QtCore/QThreadPool>
#include <QDebug>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-QThreadPoolerPrivate::QThreadPoolerPrivate(QThreadPooler *qq)
- : QObjectPrivate(),
+/*!
+ \class Qt3D::QThreadPoolerPrivate
+ \internal
+*/
+QThreadPooler::QThreadPooler(QObject *parent)
+ : QObject(parent),
+ m_futureInterface(Q_NULLPTR),
m_mutex(new QMutex(QMutex::NonRecursive)),
- m_runningThreads(0)
+ m_taskCount(0)
{
- q_ptr = qq;
}
-QThreadPoolerPrivate::~QThreadPoolerPrivate()
+QThreadPooler::~QThreadPooler()
{
- Q_FOREACH (QSharedPointer<TaskInterface> task, m_taskQueue)
- task->setDependencyHandler(Q_NULLPTR);
- delete m_dependencyHandler;
+ // Wait till all tasks are finished before deleting mutex
+ QMutexLocker locker(m_mutex);
+ locker.unlock();
delete m_mutex;
}
-void QThreadPoolerPrivate::shutdown()
-{
- m_jobFinished.wakeAll();
-
- // When shutting down a signal is send for jobrunners to exit run() loop
- // on next round. Sometimes the jobrunner is busy doing still the clean up
- // tasks and isn't waiting the release of WaitCondition. Repeat the waking
- // process max tryOuts.
- const int tryOuts = 2;
-
- Q_FOREACH (JobRunner *jr, m_workers) {
- if (!jr->isFinished()) {
- for (int i = 0; i < tryOuts; i++) {
- m_jobAvailable.wakeAll();
- if (jr->wait(100))
- break;
- }
- }
- }
-}
-
-
-bool QThreadPoolerPrivate::isQueueEmpty()
-{
- return m_taskQueue.isEmpty();
-}
-
-void QThreadPoolerPrivate::incRunningThreads()
-{
- m_runningThreads += 1;
-}
-
-void QThreadPoolerPrivate::decRunningThreads()
+void QThreadPooler::setDependencyHandler(DependencyHandler *handler)
{
- m_runningThreads -= 1;
-
- // Sanity check
- if (m_runningThreads < 0)
- m_runningThreads = 0;
+ m_dependencyHandler = handler;
+ m_dependencyHandler->setMutex(m_mutex);
}
-void QThreadPoolerPrivate::createRunners(int threadCount)
+void QThreadPooler::enqueueTasks(QVector<RunnableInterface *> &tasks)
{
- Q_Q(QThreadPooler);
-
- for (int i = 0; i < threadCount; i++) {
- JobRunner *jr = new JobRunner(q);
+ // The caller have to set the mutex
- jr->setMutex(m_mutex);
- jr->setWaitConditions(&(m_jobAvailable));
- jr->start();
-
- m_workers.append(jr);
+ for (QVector<RunnableInterface *>::iterator it = tasks.begin();
+ it != tasks.end(); it++) {
+ if (!m_dependencyHandler->hasDependency((*it)) && !(*it)->reserved()) {
+ (*it)->setReserved(true);
+ (*it)->setPooler(this);
+ QThreadPool::globalInstance()->start((*it));
+ }
}
}
-int QThreadPoolerPrivate::maxThreadCount() const
-{
- return m_maxThreadCount;
-}
-
-void QThreadPoolerPrivate::setMaxThreadCount(int threadCount)
-{
-
- m_maxThreadCount = threadCount;
- createRunners(m_maxThreadCount);
-}
-
-/////////////////////////////////////////////////
-
-QThreadPooler::QThreadPooler(QObject *parent)
- : QObject(*new QThreadPoolerPrivate(this), parent)
-{
-}
-
-QThreadPooler::~QThreadPooler()
-{
- Q_D(QThreadPooler);
-
- emit shuttingDown();
- d->m_jobAvailable.wakeAll();
-
- d->shutdown();
-}
-
-int QThreadPooler::maxThreadCount() const
-{
- Q_D(const QThreadPooler);
-
- const QMutexLocker locker(d->m_mutex);
-
- return d->maxThreadCount();
-}
-
-void QThreadPooler::setMaxThreadCount(int threadCount)
-{
- Q_D(QThreadPooler);
-
- const QMutexLocker locker(d->m_mutex);
-
- d->setMaxThreadCount(threadCount);
-}
-
-QSharedPointer<TaskInterface> QThreadPooler::nextTask()
+void QThreadPooler::taskFinished(RunnableInterface *task)
{
- Q_D(QThreadPooler);
+ const QMutexLocker locker(m_mutex);
- const QMutexLocker locker(d->m_mutex);
+ release();
- QSharedPointer<TaskInterface> task;
- int queueSize = d->m_taskQueue.size();
- for (int i = 0; i < queueSize; i++) {
- const QSharedPointer<TaskInterface> &candidate = d->m_taskQueue.at(i);
- if (!hasDependencies(candidate)) {
- task = candidate;
- // Increment running thread counter before removing item from queue
- // so that isIdle test keeps up
- d->incRunningThreads();
- d->m_taskQueue.removeAt(i);
+ QVector<RunnableInterface *> freedTasks;
+ if (task->dependencyHandler())
+ freedTasks = m_dependencyHandler->freeDependencies(task);
+ if (freedTasks.size())
+ enqueueTasks(freedTasks);
- break;
+ if (currentCount() == 0) {
+ if (m_futureInterface) {
+ m_futureInterface->reportFinished();
+ delete m_futureInterface;
}
+ m_futureInterface = Q_NULLPTR;
}
-
- return task;
}
-bool QThreadPooler::hasDependencies(const QSharedPointer<TaskInterface> &task)
+QFuture<void> QThreadPooler::mapDependables(QVector<RunnableInterface *> &taskQueue)
{
- DependencyHandler *handler = task->dependencyHandler();
- if (handler)
- return handler->hasDependency(task);
-
- return false;
-}
+ const QMutexLocker locker(m_mutex);
-void QThreadPooler::enqueueTask(const QSharedPointer<TaskInterface> &task)
-{
- Q_D(QThreadPooler);
+ if (!m_futureInterface)
+ m_futureInterface = new QFutureInterface<void>();
+ if (taskQueue.size())
+ m_futureInterface->reportStarted();
- const QMutexLocker locker(d->m_mutex);
+ acquire(taskQueue.size());
+ enqueueTasks(taskQueue);
- d->m_taskQueue.append(task);
- d->m_jobAvailable.wakeAll();
+ return QFuture<void>(m_futureInterface);
}
-void QThreadPooler::flush()
+QFuture<void> QThreadPooler::future()
{
- Q_D(QThreadPooler);
-
- const QMutexLocker locker(d->m_mutex);
-
-#ifdef QT_NO_DEBUG
- const int waitTime = 50;
-#else
- const int waitTime = 500;
-#endif
+ const QMutexLocker locker(m_mutex);
- while (!isIdling()) {
- if (d->m_jobFinished.wait(d->m_mutex, waitTime) == false)
- d->m_jobAvailable.wakeAll();
- }
+ if (!m_futureInterface)
+ return QFuture<void>();
+ else
+ return QFuture<void>(m_futureInterface);
}
-bool QThreadPooler::isIdling()
+void QThreadPooler::acquire(int add)
{
- Q_D(QThreadPooler);
+ // The caller have to set the mutex
- return d->isQueueEmpty() && d->m_runningThreads == 0;
+ forever {
+ int localCount = m_taskCount.load();
+ if (m_taskCount.testAndSetOrdered(localCount, localCount + add))
+ return;
+ }
}
-void QThreadPooler::startRunning()
+void QThreadPooler::release()
{
- Q_D(QThreadPooler);
-
- const QMutexLocker locker(d->m_mutex);
-
- d->incRunningThreads();
-}
+ // The caller have to set the mutex
-void QThreadPooler::stopRunning()
-{
- Q_D(QThreadPooler);
+ forever {
+ int localCount = m_taskCount.load();
- const QMutexLocker locker(d->m_mutex);
+ // Task counter going below zero means coding errors somewhere.
+ Q_ASSERT(localCount > 0);
- d->decRunningThreads();
- d->m_jobFinished.wakeAll();
+ if (m_taskCount.testAndSetOrdered(localCount, localCount - 1))
+ return;
+ }
}
-void QThreadPooler::setDependencyHandler(DependencyHandler *handler)
+int QThreadPooler::currentCount()
{
- Q_D(QThreadPooler);
+ // The caller have to set the mutex
- d->setDependencyHandler(handler);
+ return m_taskCount.load();
}
} // namespace Qt3D
diff --git a/src/core/jobs/qthreadpooler_p.h b/src/core/jobs/qthreadpooler_p.h
index 6579e6283..4a0a189a6 100644
--- a/src/core/jobs/qthreadpooler_p.h
+++ b/src/core/jobs/qthreadpooler_p.h
@@ -41,15 +41,14 @@
#include "dependencyhandler_p.h"
#include <QtCore/QObject>
-#include <QtCore/QWaitCondition>
#include <QtCore/QSharedPointer>
+#include <QtCore/QFutureInterface>
+#include <QtCore/QFuture>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QThreadPoolerPrivate;
-
class QThreadPooler : public QObject
{
Q_OBJECT
@@ -58,25 +57,23 @@ public:
explicit QThreadPooler(QObject *parent = 0);
~QThreadPooler();
- int maxThreadCount() const;
- void setMaxThreadCount(int threadCount);
- QSharedPointer<TaskInterface> nextTask();
- void enqueueTask(const QSharedPointer<TaskInterface> &task);
- void flush();
- void startRunning();
- void stopRunning();
- void setDependencyHandler(DependencyHandler *handler);
+ QFuture<void> mapDependables(QVector<RunnableInterface *> &taskQueue);
+ void taskFinished(RunnableInterface *task);
+ QFuture<void> future();
-signals:
- void shuttingDown();
+ void setDependencyHandler(DependencyHandler *handler);
private:
- void manageThreads();
- bool hasDependencies(const QSharedPointer<TaskInterface> &task);
- bool isIdling();
+ void enqueueTasks(QVector<RunnableInterface *> &tasks);
+ void acquire(int add);
+ void release();
+ int currentCount();
private:
- Q_DECLARE_PRIVATE(QThreadPooler)
+ QFutureInterface<void> *m_futureInterface;
+ QMutex *m_mutex;
+ DependencyHandler *m_dependencyHandler;
+ QAtomicInt m_taskCount;
};
} // namespace Qt3D
diff --git a/src/core/jobs/task.cpp b/src/core/jobs/task.cpp
index 87ddd57a5..8cfc365fa 100644
--- a/src/core/jobs/task.cpp
+++ b/src/core/jobs/task.cpp
@@ -35,8 +35,8 @@
****************************************************************************/
#include "task_p.h"
-#include "jobrunner_p.h"
#include "dependencyhandler_p.h"
+#include "qthreadpooler_p.h"
#include <QMutexLocker>
@@ -46,75 +46,59 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-
-TaskInterface::~TaskInterface()
+RunnableInterface::~RunnableInterface()
{
}
// Aspect task
-AspectTask::AspectTask()
- : m_dependencyHandler(0)
+AspectTaskRunnable::AspectTaskRunnable()
+ : m_dependencyHandler(0),
+ m_reserved(false)
{
}
-AspectTask::~AspectTask()
+AspectTaskRunnable::~AspectTaskRunnable()
{
}
-void AspectTask::run(QSharedPointer<TaskInterface> self, JobRunner *jr)
+void AspectTaskRunnable::run()
{
- Q_UNUSED(self);
- Q_UNUSED(jr);
if (m_job)
m_job->run();
- // Cleanup stuff
- // For now at least dependecies.
- if (m_dependencyHandler)
- m_dependencyHandler->freeDependencies(self);
-}
-
-void AspectTask::run()
-{
+ if (m_pooler)
+ m_pooler->taskFinished(this);
}
-void AspectTask::setDependencyHandler(DependencyHandler *handler)
+void AspectTaskRunnable::setDependencyHandler(DependencyHandler *handler)
{
m_dependencyHandler = handler;
}
-DependencyHandler *AspectTask::dependencyHandler()
+DependencyHandler *AspectTaskRunnable::dependencyHandler()
{
return m_dependencyHandler;
}
// Synchronized task
-SynchronizedTask::SynchronizedTask(QAbstractAspectJobManager::JobFunction func,
+SyncTaskRunnable::SyncTaskRunnable(QAbstractAspectJobManager::JobFunction func,
void *arg, QAtomicInt *atomicCount)
: m_func(func),
m_arg(arg),
- m_atomicCount(atomicCount)
+ m_atomicCount(atomicCount),
+ m_pooler(Q_NULLPTR),
+ m_reserved(false)
{
}
-SynchronizedTask::~SynchronizedTask()
+SyncTaskRunnable::~SyncTaskRunnable()
{
}
-void SynchronizedTask::run()
+void SyncTaskRunnable::run()
{
- m_func(m_arg);
-}
-
-void SynchronizedTask::run(QSharedPointer<TaskInterface> self, JobRunner *jr)
-{
- Q_UNUSED(self);
- Q_UNUSED(jr);
- Q_ASSERT(m_func);
- Q_ASSERT(jr);
-
// Call the function
m_func(m_arg);
@@ -123,20 +107,22 @@ void SynchronizedTask::run(QSharedPointer<TaskInterface> self, JobRunner *jr)
// Wait for the other worker threads to be done
while (m_atomicCount->load() > 0)
- jr->yieldCurrentThread();
+ QThread::currentThread()->yieldCurrentThread();
+
+ if (m_pooler)
+ m_pooler->taskFinished(this);
}
-void SynchronizedTask::setDependencyHandler(DependencyHandler *handler)
+void SyncTaskRunnable::setDependencyHandler(DependencyHandler *handler)
{
Q_UNUSED(handler);
}
-DependencyHandler *SynchronizedTask::dependencyHandler()
+DependencyHandler *SyncTaskRunnable::dependencyHandler()
{
return Q_NULLPTR;
}
-
} // namespace Qt3D {
QT_END_NAMESPACE
diff --git a/src/core/jobs/task_p.h b/src/core/jobs/task_p.h
index cde8f90eb..ea8547303 100644
--- a/src/core/jobs/task_p.h
+++ b/src/core/jobs/task_p.h
@@ -42,7 +42,8 @@
#include <QtCore/QtGlobal>
#include <QtCore/QThread>
#include <QtCore/QSharedPointer>
-#include <QtCore/QWaitCondition>
+
+#include <QtCore/QRunnable>
QT_BEGIN_NAMESPACE
@@ -50,13 +51,13 @@ namespace Qt3D {
class JobRunner;
class DependencyHandler;
+class QThreadPooler;
-class TaskInterface
+class RunnableInterface : public QRunnable
{
public:
- virtual ~TaskInterface();
+ virtual ~RunnableInterface();
- virtual void run(QSharedPointer<TaskInterface> self, JobRunner *jr) = 0;
virtual void run() = 0;
virtual void setDependencyHandler(DependencyHandler *) = 0;
@@ -64,54 +65,71 @@ public:
virtual int id() = 0;
virtual void setId(int id) = 0;
+
+ virtual void setReserved(bool reserved) = 0;
+ virtual bool reserved() = 0;
+
+ virtual void setPooler(QThreadPooler *pooler) = 0;
};
-class AspectTask : public TaskInterface
+class AspectTaskRunnable : public RunnableInterface
{
public:
- AspectTask();
- ~AspectTask();
+ AspectTaskRunnable();
+ ~AspectTaskRunnable();
- int id() Q_DECL_OVERRIDE { return m_id; }
- void setId(int id) Q_DECL_OVERRIDE { m_id = id; }
+ void run();
void setDependencyHandler(DependencyHandler *handler) Q_DECL_OVERRIDE;
DependencyHandler *dependencyHandler() Q_DECL_OVERRIDE;
+ void setPooler(QThreadPooler *pooler) Q_DECL_OVERRIDE { m_pooler = pooler; }
+
+ void setReserved(bool reserved) Q_DECL_OVERRIDE { m_reserved = reserved; }
+ bool reserved() Q_DECL_OVERRIDE { return m_reserved; }
+
+ int id() Q_DECL_OVERRIDE { return m_id; }
+ void setId(int id) Q_DECL_OVERRIDE { m_id = id; }
+
public:
QSharedPointer<QAspectJob> m_job;
-protected:
- void run(QSharedPointer<TaskInterface> self, JobRunner *jr) Q_DECL_OVERRIDE;
- void run() Q_DECL_OVERRIDE;
-
private:
DependencyHandler *m_dependencyHandler;
+ QThreadPooler *m_pooler;
+ bool m_reserved;
+
int m_id; // For testing purposes for now
};
-class SynchronizedTask : public TaskInterface
+class SyncTaskRunnable : public RunnableInterface
{
public:
- explicit SynchronizedTask(QAbstractAspectJobManager::JobFunction func, void *arg,
+ explicit SyncTaskRunnable(QAbstractAspectJobManager::JobFunction func, void *arg,
QAtomicInt *atomicCount);
- ~SynchronizedTask();
+ ~SyncTaskRunnable();
- int id() Q_DECL_OVERRIDE { return m_id; }
- void setId(int id) Q_DECL_OVERRIDE { m_id = id; }
+ void run();
void setDependencyHandler(DependencyHandler *handler) Q_DECL_OVERRIDE;
DependencyHandler *dependencyHandler() Q_DECL_OVERRIDE;
-protected:
- void run(QSharedPointer<TaskInterface> self, JobRunner *jr) Q_DECL_OVERRIDE;
- void run() Q_DECL_OVERRIDE;
+ void setPooler(QThreadPooler *pooler) Q_DECL_OVERRIDE { m_pooler = pooler; }
+
+ void setReserved(bool reserved) Q_DECL_OVERRIDE { m_reserved = reserved; }
+ bool reserved() Q_DECL_OVERRIDE { return m_reserved; }
+
+ int id() Q_DECL_OVERRIDE { return m_id; }
+ void setId(int id) Q_DECL_OVERRIDE { m_id = id; }
private:
QAbstractAspectJobManager::JobFunction m_func;
void *m_arg;
QAtomicInt *m_atomicCount;
+ QThreadPooler *m_pooler;
+ bool m_reserved;
+
int m_id;
};
diff --git a/src/core/nodes/qbackendnode.cpp b/src/core/nodes/qbackendnode.cpp
index f1d926305..a897f6f04 100644
--- a/src/core/nodes/qbackendnode.cpp
+++ b/src/core/nodes/qbackendnode.cpp
@@ -44,8 +44,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QBackendNodePrivate::QBackendNodePrivate(QBackendNode *qq, QBackendNode::Mode mode)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QBackendNodePrivate
+ \internal
+*/
+QBackendNodePrivate::QBackendNodePrivate(QBackendNode::Mode mode)
+ : q_ptr(Q_NULLPTR)
, m_mode(mode)
, m_factory(Q_NULLPTR)
, m_arbiter(Q_NULLPTR)
@@ -79,8 +83,9 @@ QBackendNodePrivate *QBackendNodePrivate::get(QBackendNode *n)
}
QBackendNode::QBackendNode(QBackendNode::Mode mode)
- : d_ptr(new QBackendNodePrivate(this, mode))
+ : d_ptr(new QBackendNodePrivate(mode))
{
+ d_ptr->q_ptr = this;
}
QBackendNode::~QBackendNode()
@@ -123,9 +128,11 @@ QBackendNode *QBackendNode::createBackendNode(QNode *frontend) const
return d->m_factory->createBackendNode(frontend);
}
+/*! \internal */
QBackendNode::QBackendNode(QBackendNodePrivate &dd)
: d_ptr(&dd)
{
+ d_ptr->q_ptr = this;
}
void QBackendNode::notifyObservers(const QSceneChangePtr &e)
diff --git a/src/core/nodes/qbackendnode_p.h b/src/core/nodes/qbackendnode_p.h
index b433c3f3a..104c4b4cd 100644
--- a/src/core/nodes/qbackendnode_p.h
+++ b/src/core/nodes/qbackendnode_p.h
@@ -56,7 +56,7 @@ class QT3DCORE_PRIVATE_EXPORT QBackendNodePrivate
, public QObservableInterface
{
public:
- QBackendNodePrivate(QBackendNode *qq, QBackendNode::Mode mode);
+ QBackendNodePrivate(QBackendNode::Mode mode);
void setFactory(const QBackendNodeFactory *factory);
void setArbiter(QLockableObserverInterface *arbiter) Q_DECL_OVERRIDE;
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp
index 815775e5b..d9a99d50d 100644
--- a/src/core/nodes/qcomponent.cpp
+++ b/src/core/nodes/qcomponent.cpp
@@ -45,8 +45,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QComponentPrivate::QComponentPrivate(QComponent *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QComponentPrivate
+ \internal
+*/
+QComponentPrivate::QComponentPrivate()
+ : QNodePrivate()
, m_shareable(true)
, m_enabled(true)
{
@@ -81,12 +85,32 @@ void QComponentPrivate::removeEntity(QEntity *entity)
}
/*!
+ \class Qt3D::QComponent
+ \inmodule Qt3DCore
+ \inherits Qt3D::QNode
+ \since 5.5
+
+ \brief The base class of scene nodes that can be aggregated by Qt3D::QEntity
+ instances as a component.
+
+ A Qt3D::QComponent provides a vertical slice of behavior that can be assigned to and
+ sometimes shared across Qt3D::QEntity instances.
+
+ Qt3D::QComponent subclasses are often aggregated in groups that impart useful
+ behavior to the aggregating entity. For example, to have an Entity that gets
+ drawn by the Qt3D renderer aspect, an entity would most likely aggregate
+ Qt3D::QTransform, Qt3D::QMesh, and Qt3D::QMaterial components.
+
+ \sa Qt3D::QEntity
+*/
+
+/*!
Constructs a new QComponent instance with \a parent as the parent.
\note a QComponent should never be instanced directly,
instance one of the subclasses instead.
- */
+*/
QComponent::QComponent(QNode *parent)
- : QNode(*new QComponentPrivate(this), parent)
+ : QNode(*new QComponentPrivate, parent)
{
}
@@ -101,7 +125,7 @@ QComponent::~QComponent()
/*!
Returns whether the QComponent is shareable across entities or not.
- */
+*/
bool QComponent::shareable() const
{
Q_D(const QComponent);
@@ -110,7 +134,7 @@ bool QComponent::shareable() const
/*!
Returns whether the QComponent is enabled or not.
- */
+*/
bool QComponent::isEnabled() const
{
Q_D(const QComponent);
@@ -124,7 +148,7 @@ bool QComponent::isEnabled() const
\note the interpretation of what enabled means is aspect-dependent. Even if
enabled is set to false, some aspects may still consider the component in
some manner. This is documented on a class by class basis.
- */
+*/
void QComponent::setEnabled(bool enabled)
{
Q_D(QComponent);
@@ -136,7 +160,7 @@ void QComponent::setEnabled(bool enabled)
/*!
The QComponent can be shared across several entities if \a shareable is true.
- */
+*/
void QComponent::setShareable(bool shareable)
{
Q_D(QComponent);
@@ -155,14 +179,15 @@ void QComponent::copy(const QNode *ref)
}
/*!
- * Returns a QVector containing all the entities that reference this component.
- */
+ Returns a QVector containing all the entities that reference this component.
+*/
QVector<QEntity *> QComponent::entities() const
{
Q_D(const QComponent);
return d->m_entities;
}
+/*! \internal */
QComponent::QComponent(QComponentPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
@@ -170,4 +195,20 @@ QComponent::QComponent(QComponentPrivate &dd, QNode *parent)
} // namespace Qt3D
+/*!
+ \qmltype Component3D
+ \instantiates Qt3D::QComponent
+ \inqmlmodule Qt3D
+ \inherits Node
+ \since 5.5
+*/
+
+/*!
+ \qmlproperty bool Qt3D::Component3D::shareable
+*/
+
+/*!
+ \qmlproperty bool Qt3D::Component3D::enabled
+*/
+
QT_END_NAMESPACE
diff --git a/src/core/nodes/qcomponent_p.h b/src/core/nodes/qcomponent_p.h
index 473d17d39..cc4849375 100644
--- a/src/core/nodes/qcomponent_p.h
+++ b/src/core/nodes/qcomponent_p.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QT3DCORESHARED_EXPORT QComponentPrivate : public QNodePrivate
{
public:
- explicit QComponentPrivate(QComponent *qq);
+ QComponentPrivate();
void addEntity(QEntity *entity);
void removeEntity(QEntity *entity);
diff --git a/src/core/nodes/qentity.cpp b/src/core/nodes/qentity.cpp
index 0e8c596d0..e0aff9466 100644
--- a/src/core/nodes/qentity.cpp
+++ b/src/core/nodes/qentity.cpp
@@ -51,13 +51,39 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QEntityPrivate::QEntityPrivate(QEntity *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QEntityPrivate
+ \internal
+*/
+QEntityPrivate::QEntityPrivate()
+ : QNodePrivate()
, m_enabled(true)
{}
+/*!
+ \class Qt3D::QEntity
+ \inmodule Qt3DCore
+ \inherits Qt3D::QNode
+ \since 5.5
+
+ \brief Qt3D::QEntity is a Qt3D::QNode subclass that can aggregate several
+ Qt3D::QComponent instances that will specify its behavior.
+
+ By itself a Qt3D::QEntity is an empty shell. The behavior of a Qt3D::QEntity
+ object is defined by the Qt3D::QComponent objects it references. Each Qt3D
+ backend aspect will be able to interpret and process an Entity by
+ recognizing which components it is made up of. One aspect may decide to only
+ process entities composed of a single Qt3D::QTransform component whilst
+ another may focus on Qt3D::QMouseInput.
+
+ \sa Qt3D::QComponent, Qt3D::QTransform
+*/
+
+/*!
+ Constructs a new Qt3D::QEntity instance with \a parent as parent.
+*/
QEntity::QEntity(QNode *parent)
- : QNode(*new QEntityPrivate(this), parent)
+ : QNode(*new QEntityPrivate, parent)
{
}
@@ -71,11 +97,16 @@ QEntity::~QEntity()
removeAllComponents();
}
+/*! \internal */
QEntity::QEntity(QEntityPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
}
+/*!
+ Copies all the properties and components of the Qt3D::QEntity \a ref to the
+ current instance.
+*/
void QEntity::copy(const QNode *ref)
{
QNode::copy(ref);
@@ -89,12 +120,21 @@ void QEntity::copy(const QNode *ref)
}
}
+/*!
+ Returns the list of Qt3D::QComponent instances the entity is referencing.
+*/
QList<QComponent *> QEntity::components() const
{
Q_D(const QEntity);
return d->m_components;
}
+/*!
+ Adds a new reference to the component \a comp.
+
+ \note If the Qt3D::QComponent has no parent, the Qt3D::QEntity will set
+ itself as its parent thereby taking ownership of the component.
+*/
void QEntity::addComponent(QComponent *comp)
{
Q_D(QEntity);
@@ -125,6 +165,9 @@ void QEntity::addComponent(QComponent *comp)
static_cast<QComponentPrivate *>(QComponentPrivate::get(comp))->addEntity(this);
}
+/*!
+ Removes the reference to \a comp.
+*/
void QEntity::removeComponent(QComponent *comp)
{
Q_CHECK_PTR(comp);
@@ -149,6 +192,9 @@ void QEntity::removeComponent(QComponent *comp)
d->m_components.removeOne(comp);
}
+/*!
+ Remove all references to the components.
+*/
void QEntity::removeAllComponents()
{
Q_D(const QEntity);
@@ -156,6 +202,12 @@ void QEntity::removeAllComponents()
removeComponent(comp);
}
+/*!
+ Returns the parent Qt3D::QEntity instance of this entity. If the
+ immediate parent isn't a Qt3D::QEntity, this function traverses up the
+ scene hierarchy until a parent Qt3D::QEntity is found. If no
+ Qt3D::QEntity parent can be found, returns null.
+*/
QEntity *QEntity::parentEntity() const
{
QNode *parentNode = QNode::parentNode();
diff --git a/src/core/nodes/qentity_p.h b/src/core/nodes/qentity_p.h
index 1b70a9ed5..b28d0c391 100644
--- a/src/core/nodes/qentity_p.h
+++ b/src/core/nodes/qentity_p.h
@@ -48,7 +48,7 @@ namespace Qt3D {
class QT3DCORESHARED_EXPORT QEntityPrivate : public QNodePrivate
{
public :
- QEntityPrivate(QEntity *qq);
+ QEntityPrivate();
Q_DECLARE_PUBLIC(QEntity)
diff --git a/src/core/nodes/qnode.cpp b/src/core/nodes/qnode.cpp
index c9b780dd7..d6472cfd6 100644
--- a/src/core/nodes/qnode.cpp
+++ b/src/core/nodes/qnode.cpp
@@ -54,7 +54,11 @@ namespace Qt3D {
QHash<QNodeId, QNode *> QNodePrivate::m_clonesLookupTable = QHash<QNodeId, QNode *>();
-QNodePrivate::QNodePrivate(QNode *qq)
+/*!
+ \class Qt3D::QNodePrivate
+ \internal
+*/
+QNodePrivate::QNodePrivate()
: QObjectPrivate()
, m_changeArbiter(Q_NULLPTR)
, m_scene(Q_NULLPTR)
@@ -63,7 +67,6 @@ QNodePrivate::QNodePrivate(QNode *qq)
, m_propertyChangesSetup(false)
, m_signals(this)
{
- q_ptr = qq;
}
// Called by QEvent::childAdded (main thread)
@@ -205,8 +208,16 @@ void QNodePrivate::setArbiter(QLockableObserverInterface *arbiter)
registerNotifiedProperties();
}
-void QNode::sceneChangeEvent(const QSceneChangePtr &)
+/*!
+ Called when one or more backend aspects sends a notification \a change to the
+ current Qt3D::QNode instance.
+
+ \note This method should be reimplemented in your subclasses to properly
+ handle the \a change.
+*/
+void QNode::sceneChangeEvent(const QSceneChangePtr &change)
{
+ Q_UNUSED(change);
qWarning() << Q_FUNC_INFO << "sceneChangeEvent should have been subclassed";
}
@@ -283,19 +294,56 @@ void QNodePrivate::nodePtrDeleter(QNode *q)
p->deleteLater();
}
+
+/*!
+ \class Qt3D::QNode
+ \inherits QObject
+
+ \inmodule Qt3DCore
+ \since 5.5
+
+ \brief Qt3D::QNode is the base class of all Qt3D node classes used to build a
+ Qt3D scene.
+
+ The owernship of Qt3D::QNode is determined by the QObject parent/child
+ relationship between nodes. By itself a Qt3D::QNode has no visual appearance
+ and no particular meaning, it is there as a way of building a node based tree
+ structure.
+
+ Each Qt3D::QNode instance has a unique id that allows it to be recognizable
+ from other instances.
+
+ When properties are defined on a Qt3D::QNode subclass, their NOTIFY signal
+ will automatically generate notifications that the Qt3D backend aspects will
+ receive.
+
+ \sa Qt3D::QEntity, Qt3D::QComponent
+*/
+
+/*!
+ Creates a new Qt3D::QNode instance with parent \a parent.
+*/
QNode::QNode(QNode *parent)
- : QObject(*new QNodePrivate(this), parent)
+ : QObject(*new QNodePrivate, parent)
{
// We rely on QEvent::childAdded to be triggered on the parent
// So we don't actually need to invoke a method or anything
// to add ourselve with the parent
}
+/*! \internal */
QNode::QNode(QNodePrivate &dd, QNode *parent)
: QObject(dd, parent)
{
}
+/*!
+ Copies all the attributes from \a ref to the current Qt3D::QNode instance.
+
+ \note When subclassing Qt3D::QNode you should reimplement this method and
+ always call the copy method on the base class. This will ensure that when cloned,
+ the Qt3D::QNode is properly initialized.
+*/
void QNode::copy(const QNode *ref)
{
if (ref)
@@ -306,12 +354,18 @@ QNode::~QNode()
{
}
+/*!
+ Returns the id that uniquely identifies the Qt3D::QNode instance.
+*/
const QNodeId QNode::id() const
{
Q_D(const QNode);
return d->m_id;
}
+/*!
+ Returns the immediate Qt3D::QNode parent, null if the node has no parent.
+*/
QNode *QNode::parentNode() const
{
return qobject_cast<QNode*>(parent());
@@ -319,7 +373,6 @@ QNode *QNode::parentNode() const
/*!
Returns \c true if aspect notifications are blocked; otherwise returns \c false.
-
Notifications are not blocked by default.
\sa blockNotifications()
@@ -349,6 +402,11 @@ bool QNode::blockNotifications(bool block)
return previous;
}
+/*!
+ Returns a clone of \a node. All the children of \a node are cloned as well.
+
+ \note This is the only way to create two nodes with the same id.
+*/
QNode *QNode::clone(QNode *node)
{
static int clearLock = 0;
@@ -409,6 +467,9 @@ bool QNode::event(QEvent *e)
return QObject::event(e);
}
+/*!
+ Returns a pointer to the Qt3D::QNode instance's scene.
+*/
QSceneInterface *QNode::scene() const
{
Q_D(const QNode);
diff --git a/src/core/nodes/qnode_p.h b/src/core/nodes/qnode_p.h
index 67f999f3e..7e654bf7a 100644
--- a/src/core/nodes/qnode_p.h
+++ b/src/core/nodes/qnode_p.h
@@ -54,7 +54,7 @@ class QAspectEngine;
class QT3DCORESHARED_EXPORT QNodePrivate : public QObjectPrivate, public QObservableInterface
{
public:
- QNodePrivate(QNode *qq);
+ QNodePrivate();
void setScene(QSceneInterface *scene);
QSceneInterface *scene() const;
diff --git a/src/core/nodes/qnodeid.h b/src/core/nodes/qnodeid.h
index 77ea96ff3..ec1e6ce07 100644
--- a/src/core/nodes/qnodeid.h
+++ b/src/core/nodes/qnodeid.h
@@ -92,8 +92,9 @@ private:
QT3DCORESHARED_EXPORT QDebug operator<<(QDebug d, const QNodeId &id);
#endif
-inline uint qHash(const QNodeId &id, uint) Q_DECL_NOTHROW
+inline uint qHash(const QNodeId &id, uint seed = 0) Q_DECL_NOTHROW
{
+ Q_UNUSED(seed);
return id.id();
}
diff --git a/src/core/qbackendscenepropertychange.cpp b/src/core/qbackendscenepropertychange.cpp
index 7d33414f7..86c334d42 100644
--- a/src/core/qbackendscenepropertychange.cpp
+++ b/src/core/qbackendscenepropertychange.cpp
@@ -43,8 +43,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QBackendScenePropertyChangePrivate::QBackendScenePropertyChangePrivate(QBackendScenePropertyChange *qq)
- : QScenePropertyChangePrivate(qq)
+/*!
+ \class Qt3D::QBackendScenePropertyChange
+*/
+
+/*!
+ \class Qt3D::QBackendScenePropertyChangePrivate
+ \internal
+*/
+QBackendScenePropertyChangePrivate::QBackendScenePropertyChangePrivate()
+ : QScenePropertyChangePrivate()
{
}
@@ -53,7 +61,7 @@ QBackendScenePropertyChangePrivate::~QBackendScenePropertyChangePrivate()
}
QBackendScenePropertyChange::QBackendScenePropertyChange(ChangeFlag type, const QNodeId &subjectId, QSceneChange::Priority priority)
- : QScenePropertyChange(*new QBackendScenePropertyChangePrivate(this), type, Observable, subjectId, priority)
+ : QScenePropertyChange(*new QBackendScenePropertyChangePrivate, type, Observable, subjectId, priority)
{
}
@@ -74,11 +82,13 @@ QNodeId QBackendScenePropertyChange::targetNode() const
return d->m_targetUuid;
}
+/*! \internal */
QBackendScenePropertyChange::QBackendScenePropertyChange(QBackendScenePropertyChangePrivate &dd)
: QScenePropertyChange(dd)
{
}
+/*! \internal */
QBackendScenePropertyChange::QBackendScenePropertyChange(QBackendScenePropertyChangePrivate &dd, ChangeFlag type, const QNodeId &subjectId, QSceneChange::Priority priority)
: QScenePropertyChange(dd, type, Observable, subjectId, priority)
{
diff --git a/src/core/qbackendscenepropertychange_p.h b/src/core/qbackendscenepropertychange_p.h
index fb8982024..392fa507a 100644
--- a/src/core/qbackendscenepropertychange_p.h
+++ b/src/core/qbackendscenepropertychange_p.h
@@ -49,7 +49,7 @@ class QBackendScenePropertyChange;
class QBackendScenePropertyChangePrivate : public QScenePropertyChangePrivate
{
public:
- QBackendScenePropertyChangePrivate(QBackendScenePropertyChange *qq);
+ QBackendScenePropertyChangePrivate();
virtual ~QBackendScenePropertyChangePrivate();
Q_DECLARE_PUBLIC(QBackendScenePropertyChange)
diff --git a/src/core/qpostman.cpp b/src/core/qpostman.cpp
index 88054586e..d9a8738f7 100644
--- a/src/core/qpostman.cpp
+++ b/src/core/qpostman.cpp
@@ -49,11 +49,10 @@ namespace Qt3D {
class QPostmanPrivate : public QObjectPrivate
{
public:
- QPostmanPrivate(QPostman *qq)
+ QPostmanPrivate()
: QObjectPrivate()
, m_scene(Q_NULLPTR)
{
- q_ptr = qq;
}
Q_DECLARE_PUBLIC(QPostman)
@@ -61,7 +60,7 @@ public:
};
QPostman::QPostman(QObject *parent)
- : QObject(*new QPostmanPrivate(this), parent)
+ : QObject(*new QPostmanPrivate, parent)
{
qRegisterMetaType<QSceneChangePtr >("QSceneChangePtr");
}
diff --git a/src/core/qray3d.cpp b/src/core/qray3d.cpp
new file mode 100644
index 000000000..109fbc41b
--- /dev/null
+++ b/src/core/qray3d.cpp
@@ -0,0 +1,359 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qray3d.h"
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+/*!
+ \class QRay3D
+ \brief The QRay3D class defines a directional line in 3D space extending through an origin point.
+ \since 5.5
+ \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 \b t then the origin() point is at
+ \b t = 0, the point origin() + direction() is at \b t = 1,
+ and the point origin() - direction() is at \b t = -1.
+ The point() method can be used to obtain the position of a point
+ within this one-dimensional co-ordinate system. The projectedDistance()
+ 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 (0, 0, 1).
+*/
+QRay3D::QRay3D()
+ : m_direction(0.0f, 0.0f, 1.0f)
+{
+}
+
+/*!
+ \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
+*/
+QRay3D::QRay3D(const QVector3D &origin, const QVector3D &direction)
+ : m_origin(origin)
+ , m_direction(direction)
+{}
+
+QRay3D::~QRay3D()
+{
+}
+
+/*!
+ \fn QVector3D QRay3D::origin() const
+
+ Returns the origin of this ray. The default value is (0, 0, 0).
+
+ \sa setOrigin(), direction()
+*/
+QVector3D QRay3D::origin() const
+{
+ return m_origin;
+}
+
+/*!
+ \fn void QRay3D::setOrigin(const QVector3D &value)
+
+ Sets the origin point of this ray to \a value.
+
+ \sa origin(), setDirection()
+ */
+void QRay3D::setOrigin(const QVector3D &value)
+{
+ m_origin = value;
+}
+
+/*!
+ \fn QVector3D QRay3D::direction() const
+
+ Returns the direction vector of this ray. The default value is (0, 0, 1).
+
+ \sa setDirection(), origin()
+*/
+QVector3D QRay3D::direction() const
+{
+ return m_direction;
+}
+
+/*!
+ \fn void QRay3D::setDirection(const QVector3D &direction)
+
+ Sets the direction vector of this ray to \a direction.
+
+ \sa direction(), setOrigin()
+*/
+void QRay3D::setDirection(const QVector3D &value)
+{
+ if (value.isNull())
+ return;
+
+ m_direction = value;
+}
+
+QVector3D QRay3D::point(float t) const
+{
+ return m_origin + t * m_direction;
+}
+
+QRay3D &QRay3D::transform(const QMatrix4x4 &matrix)
+{
+ m_origin = matrix * m_origin;
+ m_direction = matrix.mapVector(m_direction);
+
+ return *this;
+}
+
+QRay3D QRay3D::transformed(const QMatrix4x4 &matrix) const
+{
+ return QRay3D(matrix * m_origin, matrix.mapVector(m_direction));
+}
+
+bool QRay3D::operator==(const QRay3D &other) const
+{
+ return m_origin == other.origin() && m_direction == other.direction();
+}
+
+bool QRay3D::operator!=(const QRay3D &other) const
+{
+ return !(*this == other);
+}
+
+/*!
+ 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;
+ const float dot = QVector3D::dotProduct(ppVec, m_direction);
+ if (qFuzzyIsNull(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 actually the same, but with
+ different origin() points or an inverted direction().
+*/
+bool QRay3D::contains(const QRay3D &ray) const
+{
+ const float 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(float 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 projectedDistance(), distance()
+*/
+
+/*!
+ 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()
+*/
+float QRay3D::projectedDistance(const QVector3D &point) const
+{
+ Q_ASSERT(!m_direction.isNull());
+
+ 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 projectedDistance()
+*/
+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()
+*/
+float QRay3D::distance(const QVector3D &point) const
+{
+ float t = projectedDistance(point);
+ return (point - (m_origin + t * m_direction)).length();
+}
+
+/*!
+ \fn QRay3D &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)
+{
+ QDebugStateSaver saver(dbg);
+ 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;
+}
+
+#endif
+
+#ifndef QT_NO_DATASTREAM
+
+/*!
+ \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;
+}
+
+/*!
+ \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
+
+} // namespace Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/core/qray3d.h b/src/core/qray3d.h
new file mode 100644
index 000000000..3734e69b6
--- /dev/null
+++ b/src/core/qray3d.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_QRAY3D_H
+#define QT3D_QRAY3D_H
+
+#include <Qt3DCore/qt3dcore_global.h>
+#include <QtGui/qvector3d.h>
+#include <QtGui/qmatrix4x4.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QT3DCORESHARED_EXPORT QRay3D
+{
+public:
+ QRay3D();
+ explicit QRay3D(const QVector3D &origin, const QVector3D &direction = QVector3D(0.0f, 0.0f, 1.0f));
+ virtual ~QRay3D();
+
+ 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(float t) const;
+ float projectedDistance(const QVector3D &point) const;
+
+ QVector3D project(const QVector3D &vector) const;
+
+ float distance(const QVector3D &point) const;
+
+ QRay3D &transform(const QMatrix4x4 &matrix);
+ QRay3D transformed(const QMatrix4x4 &matrix) const;
+
+ bool operator==(const QRay3D &other) const;
+ bool operator!=(const QRay3D &other) const;
+
+private:
+ QVector3D m_origin;
+ QVector3D m_direction;
+};
+
+#ifndef QT_NO_DEBUG_STREAM
+QT3DCORESHARED_EXPORT QDebug operator<<(QDebug dbg, const Qt3D::QRay3D &ray);
+#endif
+
+#ifndef QT_NO_DATASTREAM
+QT3DCORESHARED_EXPORT QDataStream &operator<<(QDataStream &stream, const Qt3D::QRay3D &ray);
+QT3DCORESHARED_EXPORT QDataStream &operator>>(QDataStream &stream, Qt3D::QRay3D &ray);
+#endif
+
+} // namespace Qt3D
+
+QT_END_NAMESPACE
+
+inline bool qFuzzyCompare(const Qt3D::QRay3D &ray1, const Qt3D::QRay3D &ray2)
+{
+ return qFuzzyCompare(ray1.origin(), ray2.origin()) &&
+ qFuzzyCompare(ray1.direction(), ray2.direction());
+}
+
+Q_DECLARE_METATYPE(Qt3D::QRay3D)
+
+#endif // QT3D_QRAY3D_H
diff --git a/src/core/qscene.cpp b/src/core/qscene.cpp
index a4a9733fc..cf3329b25 100644
--- a/src/core/qscene.cpp
+++ b/src/core/qscene.cpp
@@ -49,15 +49,12 @@ namespace Qt3D {
class QScenePrivate
{
public:
- QScenePrivate(QAspectEngine *engine, QScene *qq)
- : q_ptr(qq)
- , m_engine(engine)
+ QScenePrivate(QAspectEngine *engine)
+ : m_engine(engine)
, m_arbiter(Q_NULLPTR)
{
}
- Q_DECLARE_PUBLIC(QScene)
- QScene *q_ptr;
QAspectEngine *m_engine;
QHash<QNodeId, QNode *> m_nodeLookupTable;
QMultiHash<QNodeId, QNodeId> m_componentToEntities;
@@ -70,7 +67,7 @@ public:
QScene::QScene(QAspectEngine *engine)
- : d_ptr(new QScenePrivate(engine, this))
+ : d_ptr(new QScenePrivate(engine))
{
}
diff --git a/src/core/qscenechange.cpp b/src/core/qscenechange.cpp
index 20218f04c..9c278d8b5 100644
--- a/src/core/qscenechange.cpp
+++ b/src/core/qscenechange.cpp
@@ -58,8 +58,12 @@ namespace Qt3D {
\value AllChanges Allows an observer to monitor for any of the above changes.
*/
-QSceneChangePrivate::QSceneChangePrivate(QSceneChange *qq)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QSceneChangePrivate
+ \internal
+*/
+QSceneChangePrivate::QSceneChangePrivate()
+ : q_ptr(Q_NULLPTR)
{
}
@@ -68,8 +72,9 @@ QSceneChangePrivate::~QSceneChangePrivate()
}
QSceneChange::QSceneChange(ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, QSceneChange::Priority priority)
- : d_ptr(new QSceneChangePrivate(this))
+ : d_ptr(new QSceneChangePrivate)
{
+ d_ptr->q_ptr = this;
Q_D(QSceneChange);
d->m_type = type;
d->m_priority = priority;
@@ -83,14 +88,18 @@ QSceneChange::~QSceneChange()
delete d_ptr;
}
+/*! \internal */
QSceneChange::QSceneChange(QSceneChangePrivate &dd)
: d_ptr(&dd)
{
+ d_ptr->q_ptr = this;
}
+/*! \internal */
QSceneChange::QSceneChange(QSceneChangePrivate &dd, ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, QSceneChange::Priority priority)
: d_ptr(&dd)
{
+ d_ptr->q_ptr = this;
Q_D(QSceneChange);
d->m_type = type;
d->m_priority = priority;
diff --git a/src/core/qscenechange_p.h b/src/core/qscenechange_p.h
index b903b1035..d8dce5912 100644
--- a/src/core/qscenechange_p.h
+++ b/src/core/qscenechange_p.h
@@ -49,7 +49,7 @@ class QNodeId;
class QSceneChangePrivate
{
public :
- QSceneChangePrivate(QSceneChange *qq);
+ QSceneChangePrivate();
virtual ~QSceneChangePrivate();
Q_DECLARE_PUBLIC(QSceneChange)
diff --git a/src/core/qscenepropertychange.cpp b/src/core/qscenepropertychange.cpp
index 9daac1bd0..44c8ddcac 100644
--- a/src/core/qscenepropertychange.cpp
+++ b/src/core/qscenepropertychange.cpp
@@ -42,11 +42,19 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
+/*!
+ \class Qt3D::QScenePropertyChange
+*/
+
QFrameAllocator *QScenePropertyChangePrivate::m_allocator = new QFrameAllocator(128, sizeof(QScenePropertyChange), sizeof(QScenePropertyChangePrivate) * 2);
QMutex QScenePropertyChangePrivate::m_mutex;
-QScenePropertyChangePrivate::QScenePropertyChangePrivate(QScenePropertyChange *qq)
- : QSceneChangePrivate(qq)
+/*!
+ \class Qt3D::QScenePropertyChangePrivate
+ \internal
+*/
+QScenePropertyChangePrivate::QScenePropertyChangePrivate()
+ : QSceneChangePrivate()
{
}
@@ -68,15 +76,17 @@ void QScenePropertyChangePrivate::operator delete(void *ptr, size_t size)
}
QScenePropertyChange::QScenePropertyChange(ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, QSceneChange::Priority priority)
- : QSceneChange(*new QScenePropertyChangePrivate(this), type, observableType, subjectId, priority)
+ : QSceneChange(*new QScenePropertyChangePrivate, type, observableType, subjectId, priority)
{
}
+/*! \internal */
QScenePropertyChange::QScenePropertyChange(QScenePropertyChangePrivate &dd)
: QSceneChange(dd)
{
}
+/*! \internal */
QScenePropertyChange::QScenePropertyChange(QScenePropertyChangePrivate &dd, ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, QSceneChange::Priority priority)
: QSceneChange(dd, type, observableType, subjectId, priority)
{
diff --git a/src/core/qscenepropertychange_p.h b/src/core/qscenepropertychange_p.h
index 309413593..ea88c8f7a 100644
--- a/src/core/qscenepropertychange_p.h
+++ b/src/core/qscenepropertychange_p.h
@@ -51,7 +51,7 @@ class QFrameAllocator;
class QScenePropertyChangePrivate : public QSceneChangePrivate
{
public:
- QScenePropertyChangePrivate(QScenePropertyChange *qq);
+ QScenePropertyChangePrivate();
virtual ~QScenePropertyChangePrivate();
static void *operator new(size_t size);
diff --git a/src/core/resources/qcircularbuffer.qdoc b/src/core/resources/qcircularbuffer.qdoc
index 02b5bba27..080eeab98 100644
--- a/src/core/resources/qcircularbuffer.qdoc
+++ b/src/core/resources/qcircularbuffer.qdoc
@@ -184,7 +184,7 @@
support \c operator==(). These requirements are documented on a
per-function basis.
- QCircularBuffer provides \l{STL-Style Iterators} (\l {Qt3D::QCircularBuffer::}{const_iterator)
+ QCircularBuffer provides \l{STL-Style Iterators} (\l {Qt3D::QCircularBuffer::}{const_iterator})
and \l {Qt3D::QCircularBuffer::}{iterator}). In practice, these are rarely used,
because you can use indexes into the QCircularBuffer.
diff --git a/src/core/resources/qframeallocator.cpp b/src/core/resources/qframeallocator.cpp
index 5b8c9aaf5..c62e7ad0d 100644
--- a/src/core/resources/qframeallocator.cpp
+++ b/src/core/resources/qframeallocator.cpp
@@ -49,13 +49,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QFrameAllocatorPrivate::QFrameAllocatorPrivate(QFrameAllocator *qq)
- : q_ptr(qq)
+/*!
+ \class Qt3D::QFrameAllocatorPrivate
+ \internal
+*/
+QFrameAllocatorPrivate::QFrameAllocatorPrivate()
{
}
QFrameAllocator::QFrameAllocator(uint maxObjectSize, uint alignment, uint pageSize)
- : d_ptr(new QFrameAllocatorPrivate(this))
+ : d_ptr(new QFrameAllocatorPrivate)
{
Q_ASSERT(alignment && pageSize && pageSize < UCHAR_MAX);
Q_D(QFrameAllocator);
diff --git a/src/core/resources/qframeallocator_p.h b/src/core/resources/qframeallocator_p.h
index dbf68ea63..990066138 100644
--- a/src/core/resources/qframeallocator_p.h
+++ b/src/core/resources/qframeallocator_p.h
@@ -91,7 +91,7 @@ private:
class QFrameAllocatorPrivate
{
public:
- QFrameAllocatorPrivate(QFrameAllocator *qq);
+ QFrameAllocatorPrivate();
inline void *allocateAtChunk(uint allocatorIndex)
{
@@ -108,9 +108,6 @@ public:
return (targetSize + m_alignment - 1) / m_alignment - 1;
}
- Q_DECLARE_PUBLIC(QFrameAllocator)
- QFrameAllocator *q_ptr;
-
uint m_maxObjectSize;
uint m_alignment;
QVector<QFixedFrameAllocator> m_allocatorPool;
diff --git a/src/core/resources/qhandle.h b/src/core/resources/qhandle.h
index e64b9d6ca..64957f145 100644
--- a/src/core/resources/qhandle.h
+++ b/src/core/resources/qhandle.h
@@ -104,12 +104,13 @@ private:
template <typename T, uint INDEXBITS>
QDebug operator<<(QDebug dbg, const QHandle<T, INDEXBITS> &h)
{
+ QDebugStateSaver saver(dbg);
QString binNumber = QString::number(h.handle(), 2).rightJustified(32, QChar::fromLatin1('0'));
dbg.nospace() << "index = " << h.index()
<< " magic/counter = " << h.counter()
<< " m_handle = " << h.handle()
<< " = " << binNumber;
- return dbg.space();
+ return dbg;
}
} // Qt3D
diff --git a/src/core/services/qopenglinformationservice.cpp b/src/core/services/qopenglinformationservice.cpp
index 593bc62af..e651d9fbe 100644
--- a/src/core/services/qopenglinformationservice.cpp
+++ b/src/core/services/qopenglinformationservice.cpp
@@ -42,6 +42,11 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
/*!
+ \class Qt3D::QOpenGLInformationServicePrivate
+ \internal
+*/
+
+/*!
\class Qt3D::QOpenGLInformationService
\inmodule Qt3DCore
\brief Interface for a Qt3D OpenGL information service
@@ -53,8 +58,9 @@ namespace Qt3D {
*/
/*!
- Creates an instance of QOpenGLInformationService. This constructor is protected
- so only subclasses can instantiate a QOpenGLInformationService object.
+ Creates an instance of QOpenGLInformationService, with a \a description for
+ the new service. This constructor is protected so only subclasses can
+ instantiate a QOpenGLInformationService object.
*/
QOpenGLInformationService::QOpenGLInformationService(const QString &description)
: QAbstractServiceProvider(QServiceLocator::OpenGLInformation, description)
diff --git a/src/core/services/qservicelocator.cpp b/src/core/services/qservicelocator.cpp
index 65421f69f..3d7dfad4f 100644
--- a/src/core/services/qservicelocator.cpp
+++ b/src/core/services/qservicelocator.cpp
@@ -43,11 +43,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
+/*!
+ \class Qt3D::QAbstractServiceProvider
+*/
+
QAbstractServiceProvider::QAbstractServiceProvider(int type, const QString &description)
: d_ptr(new QAbstractServiceProviderPrivate(type, description))
{
}
+/*! \internal */
QAbstractServiceProvider::QAbstractServiceProvider(QAbstractServiceProviderPrivate &dd)
: d_ptr(&dd)
{
diff --git a/src/core/services/qsysteminformationservice.cpp b/src/core/services/qsysteminformationservice.cpp
index 9194fd1b8..df2869986 100644
--- a/src/core/services/qsysteminformationservice.cpp
+++ b/src/core/services/qsysteminformationservice.cpp
@@ -42,6 +42,16 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
/*!
+ \class Qt3D::QAbstractServiceProviderPrivate
+ \internal
+*/
+
+/*!
+ \class Qt3D::QSystemInformationServicePrivate
+ \internal
+*/
+
+/*!
\class Qt3D::QSystemInformationService
\inmodule Qt3DCore
\brief Interface for a Qt3D system information service
@@ -51,8 +61,9 @@ namespace Qt3D {
*/
/*!
- Creates an instance of QSystemInformationService. This constructor is protected
- so only subclasses can instantiate a QSystemInformationService object.
+ Creates an instance of QSystemInformationService, with a \a description for
+ the new service. This constructor is protected so only subclasses can
+ instantiate a QSystemInformationService object.
*/
QSystemInformationService::QSystemInformationService(const QString &description)
: QAbstractServiceProvider(*new QSystemInformationServicePrivate(description))
diff --git a/src/core/transforms/qabstracttransform.cpp b/src/core/transforms/qabstracttransform.cpp
index 27240d574..2a4d97ff4 100644
--- a/src/core/transforms/qabstracttransform.cpp
+++ b/src/core/transforms/qabstracttransform.cpp
@@ -41,22 +41,23 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAbstractTransformPrivate::QAbstractTransformPrivate(QAbstractTransform *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QAbstractTransformPrivate
+ \internal
+*/
+QAbstractTransformPrivate::QAbstractTransformPrivate()
+ : QObjectPrivate()
{
}
-QAbstractTransform::QAbstractTransform(QNode *parent)
- : QNode(*new QAbstractTransformPrivate(this), parent)
+QAbstractTransform::QAbstractTransform(QObject *parent)
+ : QObject(*new QAbstractTransformPrivate, parent)
{
}
-QAbstractTransform::~QAbstractTransform()
-{
-}
-
-QAbstractTransform::QAbstractTransform(QAbstractTransformPrivate &dd, QNode *parent)
- : QNode(dd, parent)
+/*! \internal */
+QAbstractTransform::QAbstractTransform(QAbstractTransformPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
{
}
diff --git a/src/core/transforms/qabstracttransform.h b/src/core/transforms/qabstracttransform.h
index c634a4b6f..091ab2bf4 100644
--- a/src/core/transforms/qabstracttransform.h
+++ b/src/core/transforms/qabstracttransform.h
@@ -37,7 +37,7 @@
#ifndef QT3D_QABSTRACT_TRANSFORM_H
#define QT3D_QABSTRACT_TRANSFORM_H
-#include <Qt3DCore/qnode.h>
+#include <QtCore/qobject.h>
#include <Qt3DCore/qt3dcore_global.h>
#include <QMatrix4x4>
@@ -47,25 +47,24 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
class QAbstractTransformPrivate;
-
-class QT3DCORESHARED_EXPORT QAbstractTransform : public QNode
+class QT3DCORESHARED_EXPORT QAbstractTransform : public QObject
{
Q_OBJECT
Q_PROPERTY(QMatrix4x4 transformMatrix READ transformMatrix NOTIFY transformMatrixChanged)
public:
- explicit QAbstractTransform(QNode *parent = 0);
- virtual ~QAbstractTransform();
+ explicit QAbstractTransform(QObject *parent = Q_NULLPTR);
virtual QMatrix4x4 transformMatrix() const = 0;
Q_SIGNALS:
void transformMatrixChanged();
protected:
- QAbstractTransform(QAbstractTransformPrivate &dd, QNode *parent = 0);
+ QAbstractTransform(QAbstractTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QAbstractTransform)
+ Q_DISABLE_COPY(QAbstractTransform)
};
} // namespace Qt3D
diff --git a/src/core/transforms/qabstracttransform_p.h b/src/core/transforms/qabstracttransform_p.h
index 1c27904f7..ceb15bc11 100644
--- a/src/core/transforms/qabstracttransform_p.h
+++ b/src/core/transforms/qabstracttransform_p.h
@@ -37,20 +37,17 @@
#ifndef QT3D_QABSTRACTTRANSFORM_P_H
#define QT3D_QABSTRACTTRANSFORM_P_H
-#include <private/qnode_p.h>
-#include <Qt3DCore/qt3dcore_global.h>
+#include <private/qobject_p.h>
#include <Qt3DCore/qabstracttransform.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QAbstractTransform;
-
-class QT3DCORESHARED_EXPORT QAbstractTransformPrivate : public QNodePrivate
+class QAbstractTransformPrivate : public QObjectPrivate
{
public:
- QAbstractTransformPrivate(QAbstractTransform *qq);
+ QAbstractTransformPrivate();
Q_DECLARE_PUBLIC(QAbstractTransform)
};
diff --git a/src/core/transforms/qlookattransform.cpp b/src/core/transforms/qlookattransform.cpp
index 2ee8d544c..cea39ac81 100644
--- a/src/core/transforms/qlookattransform.cpp
+++ b/src/core/transforms/qlookattransform.cpp
@@ -41,29 +41,24 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QLookAtTransformPrivate::QLookAtTransformPrivate(QLookAtTransform *qq)
- : QAbstractTransformPrivate(qq)
+/*!
+ \class Qt3D::QLookAtTransformPrivate
+ \internal
+*/
+QLookAtTransformPrivate::QLookAtTransformPrivate()
+ : QAbstractTransformPrivate()
, m_matrixDirty(true)
{
}
-QLookAtTransform::QLookAtTransform(QNode *parent)
- : QAbstractTransform(*new QLookAtTransformPrivate(this), parent)
-{
-}
-void QLookAtTransform::copy(const QNode *ref)
+QLookAtTransform::QLookAtTransform(QObject *parent)
+ : QAbstractTransform(*new QLookAtTransformPrivate, parent)
{
- QAbstractTransform::copy(ref);
- const QLookAtTransform *transform = static_cast<const QLookAtTransform*>(ref);
- d_func()->m_matrix = transform->d_func()->m_matrix;
- d_func()->m_position = transform->d_func()->m_position;
- d_func()->m_upVector = transform->d_func()->m_upVector;
- d_func()->m_viewCenter = transform->d_func()->m_viewCenter;
- d_func()->m_viewVector = transform->d_func()->m_viewVector;
}
-QLookAtTransform::QLookAtTransform(QLookAtTransformPrivate &dd, QNode *parent)
+/*! \internal */
+QLookAtTransform::QLookAtTransform(QLookAtTransformPrivate &dd, QObject *parent)
: QAbstractTransform(dd, parent)
{
}
diff --git a/src/core/transforms/qlookattransform.h b/src/core/transforms/qlookattransform.h
index 079e51c84..df1f8790c 100644
--- a/src/core/transforms/qlookattransform.h
+++ b/src/core/transforms/qlookattransform.h
@@ -38,7 +38,6 @@
#define QT3D_QLOOKATTRANSFORM_H
#include <Qt3DCore/qabstracttransform.h>
-#include <Qt3DCore/qt3dcore_global.h>
#include <QVector3D>
@@ -57,7 +56,7 @@ class QT3DCORESHARED_EXPORT QLookAtTransform : public Qt3D::QAbstractTransform
Q_PROPERTY(QVector3D viewVector READ viewVector NOTIFY viewVectorChanged)
public:
- explicit QLookAtTransform(QNode *parent = 0);
+ explicit QLookAtTransform(QObject *parent = Q_NULLPTR);
QMatrix4x4 transformMatrix() const Q_DECL_OVERRIDE;
@@ -80,12 +79,11 @@ Q_SIGNALS:
void viewVectorChanged();
protected:
- QLookAtTransform(QLookAtTransformPrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QLookAtTransform(QLookAtTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
- QT3D_CLONEABLE(QLookAtTransform)
Q_DECLARE_PRIVATE(QLookAtTransform)
+ Q_DISABLE_COPY(QLookAtTransform)
};
} // namespace Qt3D
diff --git a/src/core/transforms/qlookattransform_p.h b/src/core/transforms/qlookattransform_p.h
index a46332bf9..095e46e54 100644
--- a/src/core/transforms/qlookattransform_p.h
+++ b/src/core/transforms/qlookattransform_p.h
@@ -43,10 +43,11 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
+class QLookAtTransform;
class QLookAtTransformPrivate : public QAbstractTransformPrivate
{
public :
- QLookAtTransformPrivate(QLookAtTransform *qq);
+ QLookAtTransformPrivate();
Q_DECLARE_PUBLIC(QLookAtTransform)
diff --git a/src/core/transforms/qmatrixtransform.cpp b/src/core/transforms/qmatrixtransform.cpp
index 8ccf8a5bb..298b85c1a 100644
--- a/src/core/transforms/qmatrixtransform.cpp
+++ b/src/core/transforms/qmatrixtransform.cpp
@@ -41,33 +41,31 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QMatrixTransformPrivate::QMatrixTransformPrivate(QMatrixTransform *qq)
- : QAbstractTransformPrivate(qq)
+/*!
+ \class Qt3D::QMatrixTransformPrivate
+ \internal
+*/
+QMatrixTransformPrivate::QMatrixTransformPrivate()
+ : QAbstractTransformPrivate()
{
}
-QMatrixTransform::QMatrixTransform(QMatrixTransformPrivate &dd, QNode *parent)
- : QAbstractTransform(dd, parent)
-{
-}
-void QMatrixTransform::copy(const QNode *ref)
+QMatrixTransform::QMatrixTransform(QObject *parent)
+ : QAbstractTransform(*new QMatrixTransformPrivate, parent)
{
- QAbstractTransform::copy(ref);
- const QMatrixTransform *matrix = static_cast<const QMatrixTransform*>(ref);
- d_func()->m_matrix = matrix->d_func()->m_matrix;
}
-QMatrixTransform::QMatrixTransform(QNode *parent)
- : QAbstractTransform(*new QMatrixTransformPrivate(this), parent)
+QMatrixTransform::QMatrixTransform(const QMatrix4x4 &m, QObject *parent)
+ : QAbstractTransform(*new QMatrixTransformPrivate, parent)
{
+ Q_D(QMatrixTransform);
+ d->m_matrix = m;
}
-QMatrixTransform::QMatrixTransform(const QMatrix4x4& m, QNode *parent)
- : QAbstractTransform(*new QMatrixTransformPrivate(this), parent)
+QMatrixTransform::QMatrixTransform(QMatrixTransformPrivate &dd, QObject *parent)
+ : QAbstractTransform(dd, parent)
{
- Q_D(QMatrixTransform);
- d->m_matrix = m;
}
QMatrix4x4 QMatrixTransform::matrix() const
@@ -93,4 +91,15 @@ QMatrix4x4 QMatrixTransform::transformMatrix() const
} // namespace Qt3D
+/*!
+ \qmltype MatrixTransform
+ \inqmlmodule Qt3D
+ \since 5.5
+ \instantiates Qt3D::QMatrixTransform
+*/
+
+/*!
+ \qmlproperty matrix4x4 Qt3D::MatrixTransform::matrix
+*/
+
QT_END_NAMESPACE
diff --git a/src/core/transforms/qmatrixtransform.h b/src/core/transforms/qmatrixtransform.h
index 34427314f..4ab92c417 100644
--- a/src/core/transforms/qmatrixtransform.h
+++ b/src/core/transforms/qmatrixtransform.h
@@ -38,9 +38,6 @@
#define QT3D_QMATRIXTRANSFORM_H
#include <Qt3DCore/qabstracttransform.h>
-#include <Qt3DCore/qt3dcore_global.h>
-
-#include <QMatrix4x4>
QT_BEGIN_NAMESPACE
@@ -53,8 +50,8 @@ class QT3DCORESHARED_EXPORT QMatrixTransform : public Qt3D::QAbstractTransform
Q_OBJECT
Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged)
public:
- explicit QMatrixTransform(QNode *parent = 0);
- QMatrixTransform(const QMatrix4x4& m, QNode *parent = 0);
+ explicit QMatrixTransform(QObject *parent = Q_NULLPTR);
+ QMatrixTransform(const QMatrix4x4 &m, QObject *parent = Q_NULLPTR);
QMatrix4x4 matrix() const;
void setMatrix(const QMatrix4x4 &matrix);
@@ -65,12 +62,11 @@ Q_SIGNALS:
void matrixChanged();
protected:
- QMatrixTransform(QMatrixTransformPrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QMatrixTransform(QMatrixTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
- QT3D_CLONEABLE(QMatrixTransform)
Q_DECLARE_PRIVATE(QMatrixTransform)
+ Q_DISABLE_COPY(QMatrixTransform)
};
} // namespace Qt3D
diff --git a/src/core/transforms/qmatrixtransform_p.h b/src/core/transforms/qmatrixtransform_p.h
index 5278f0fe4..d2896523a 100644
--- a/src/core/transforms/qmatrixtransform_p.h
+++ b/src/core/transforms/qmatrixtransform_p.h
@@ -48,7 +48,7 @@ class QMatrixTransform;
class QMatrixTransformPrivate : public QAbstractTransformPrivate
{
public:
- QMatrixTransformPrivate(QMatrixTransform *qq);
+ QMatrixTransformPrivate();
Q_DECLARE_PUBLIC(QMatrixTransform)
QMatrix4x4 m_matrix;
diff --git a/src/core/transforms/qrotatetransform.cpp b/src/core/transforms/qrotatetransform.cpp
index f92ac45bd..264b0b5bc 100644
--- a/src/core/transforms/qrotatetransform.cpp
+++ b/src/core/transforms/qrotatetransform.cpp
@@ -48,8 +48,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRotateTransformPrivate::QRotateTransformPrivate(QRotateTransform *qq)
- : QAbstractTransformPrivate(qq)
+/*!
+ \class Qt3D::QRotateTransformPrivate
+ \internal
+*/
+QRotateTransformPrivate::QRotateTransformPrivate()
+ : QAbstractTransformPrivate()
, m_angleDeg(0)
, m_axis(0.0f, 1.0f, 0.0f)
{
@@ -63,20 +67,14 @@ void QRotateTransformPrivate::updateMatrix()
m_matrix = m;
}
-void QRotateTransform::copy(const QNode *ref)
-{
- QAbstractTransform::copy(ref);
- const QRotateTransform *transform = static_cast<const QRotateTransform*>(ref);
- d_func()->m_axis = transform->d_func()->m_axis;
- d_func()->m_angleDeg = transform->d_func()->m_angleDeg;
-}
-QRotateTransform::QRotateTransform(QNode *parent)
- : QAbstractTransform(*new QRotateTransformPrivate(this), parent)
+QRotateTransform::QRotateTransform(QObject *parent)
+ : QAbstractTransform(*new QRotateTransformPrivate, parent)
{
}
-QRotateTransform::QRotateTransform(QRotateTransformPrivate &dd, QNode *parent)
+/*! \internal */
+QRotateTransform::QRotateTransform(QRotateTransformPrivate &dd, QObject *parent)
: QAbstractTransform(dd, parent)
{
}
diff --git a/src/core/transforms/qrotatetransform.h b/src/core/transforms/qrotatetransform.h
index 661304d09..649da06c2 100644
--- a/src/core/transforms/qrotatetransform.h
+++ b/src/core/transforms/qrotatetransform.h
@@ -38,7 +38,6 @@
#define QT3D_QROTATETRANSFORM_H
#include <Qt3DCore/qabstracttransform.h>
-#include <Qt3DCore/qt3dcore_global.h>
#include <QVector3D>
@@ -56,7 +55,7 @@ class QT3DCORESHARED_EXPORT QRotateTransform : public QAbstractTransform
Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
public:
- explicit QRotateTransform(QNode *parent = 0);
+ explicit QRotateTransform(QObject *parent = Q_NULLPTR);
float angleDeg() const;
float angleRad() const;
@@ -73,12 +72,11 @@ Q_SIGNALS:
void angleChanged();
protected:
- QRotateTransform(QRotateTransformPrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QRotateTransform(QRotateTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QRotateTransform)
- QT3D_CLONEABLE(QRotateTransform)
+ Q_DISABLE_COPY(QRotateTransform)
};
} // namespace Qt3D
diff --git a/src/core/transforms/qrotatetransform_p.h b/src/core/transforms/qrotatetransform_p.h
index b6b5d0077..77ba49c09 100644
--- a/src/core/transforms/qrotatetransform_p.h
+++ b/src/core/transforms/qrotatetransform_p.h
@@ -48,7 +48,7 @@ class QRotateTransform;
class QRotateTransformPrivate : public QAbstractTransformPrivate
{
public:
- QRotateTransformPrivate(QRotateTransform *qq);
+ QRotateTransformPrivate();
QMatrix4x4 m_matrix;
diff --git a/src/core/transforms/qscaletransform.cpp b/src/core/transforms/qscaletransform.cpp
index 6fa5b6243..f102fe373 100644
--- a/src/core/transforms/qscaletransform.cpp
+++ b/src/core/transforms/qscaletransform.cpp
@@ -42,25 +42,24 @@ QT_BEGIN_NAMESPACE
namespace Qt3D
{
-QScaleTransformPrivate::QScaleTransformPrivate(QScaleTransform *qq)
- : QAbstractTransformPrivate(qq)
+/*!
+ \class Qt3D::QScaleTransformPrivate
+ \internal
+*/
+QScaleTransformPrivate::QScaleTransformPrivate()
+ : QAbstractTransformPrivate()
, m_scale3D(1.0f, 1.0f, 1.0f)
{
}
-void QScaleTransform::copy(const QNode *ref)
-{
- QAbstractTransform::copy(ref);
- const QScaleTransform *transform = static_cast<const QScaleTransform*>(ref);
- d_func()->m_scale3D = transform->d_func()->m_scale3D;
-}
-QScaleTransform::QScaleTransform(QNode *parent) :
- QAbstractTransform(*new QScaleTransformPrivate(this), parent)
+QScaleTransform::QScaleTransform(QObject *parent)
+ : QAbstractTransform(*new QScaleTransformPrivate, parent)
{
}
-QScaleTransform::QScaleTransform(QScaleTransformPrivate &dd, QNode *parent)
+/*! \internal */
+QScaleTransform::QScaleTransform(QScaleTransformPrivate &dd, QObject *parent)
: QAbstractTransform(dd, parent)
{
}
diff --git a/src/core/transforms/qscaletransform.h b/src/core/transforms/qscaletransform.h
index 35fa1b802..42518f5a8 100644
--- a/src/core/transforms/qscaletransform.h
+++ b/src/core/transforms/qscaletransform.h
@@ -52,7 +52,7 @@ class QT3DCORESHARED_EXPORT QScaleTransform : public QAbstractTransform
Q_PROPERTY(float scale READ scale WRITE setScale NOTIFY scaleChanged)
public:
- explicit QScaleTransform(QNode *parent = 0);
+ explicit QScaleTransform(QObject *parent = Q_NULLPTR);
QVector3D scale3D() const;
void setScale3D(const QVector3D &scale3D);
@@ -67,12 +67,11 @@ Q_SIGNALS:
void scaleChanged();
protected:
- QScaleTransform(QScaleTransformPrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QScaleTransform(QScaleTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QScaleTransform)
- QT3D_CLONEABLE(QScaleTransform)
+ Q_DISABLE_COPY(QScaleTransform)
};
} // Qt3D
diff --git a/src/core/transforms/qscaletransform_p.h b/src/core/transforms/qscaletransform_p.h
index ff2c321e7..ccd979306 100644
--- a/src/core/transforms/qscaletransform_p.h
+++ b/src/core/transforms/qscaletransform_p.h
@@ -47,7 +47,7 @@ class QScaleTransform;
class QScaleTransformPrivate : public QAbstractTransformPrivate
{
public:
- QScaleTransformPrivate(QScaleTransform *qq);
+ QScaleTransformPrivate();
Q_DECLARE_PUBLIC(QScaleTransform)
QVector3D m_scale3D;
diff --git a/src/core/transforms/qtransform.cpp b/src/core/transforms/qtransform.cpp
index 6ac1403b9..f9700b60f 100644
--- a/src/core/transforms/qtransform.cpp
+++ b/src/core/transforms/qtransform.cpp
@@ -44,12 +44,25 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QTransformPrivate::QTransformPrivate(QTransform *qq)
- : QComponentPrivate(qq),
+/*!
+ \class Qt3D::QTransformPrivate
+ \internal
+*/
+QTransformPrivate::QTransformPrivate()
+ : QComponentPrivate(),
m_transformsDirty(false)
{
}
+void QTransformPrivate::_q_transformDestroyed(QObject *obj)
+{
+ QAbstractTransform *transform = static_cast<QAbstractTransform *>(obj);
+ if (m_transforms.removeOne(transform)) {
+ emit q_func()->transformsChanged();
+ _q_update();
+ }
+}
+
void QTransformPrivate::_q_update()
{
if (!m_transformsDirty)
@@ -59,46 +72,51 @@ void QTransformPrivate::_q_update()
QMatrix4x4 QTransformPrivate::applyTransforms() const
{
- if (!m_transforms.isEmpty()) {
- QMatrix4x4 matrix;
- Q_FOREACH (const QAbstractTransform *t, m_transforms)
- matrix = t->transformMatrix() * matrix;
- return matrix;
- }
- return QMatrix4x4();
+ QMatrix4x4 matrix;
+ Q_FOREACH (const QAbstractTransform *t, m_transforms)
+ matrix = t->transformMatrix() * matrix;
+ return matrix;
}
QTransform::QTransform(QNode *parent)
- : Qt3D::QComponent(*new QTransformPrivate(this), parent)
+ : QComponent(*new QTransformPrivate, parent)
{
}
QTransform::QTransform(QList<QAbstractTransform *> transforms, QNode *parent)
- : Qt3D::QComponent(*new QTransformPrivate(this), parent)
+ : QComponent(*new QTransformPrivate, parent)
{
Q_FOREACH (QAbstractTransform *t, transforms)
addTransform(t);
}
QTransform::QTransform(QAbstractTransform *transform, QNode *parent)
- : Qt3D::QComponent(*new QTransformPrivate(this), parent)
+ : QComponent(*new QTransformPrivate, parent)
{
addTransform(transform);
}
+/*! \internal */
QTransform::QTransform(QTransformPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
}
+QTransform::~QTransform()
+{
+ Q_D(QTransform);
+ // boost destruction by avoiding _q_update()-s
+ d->m_transforms.clear();
+}
+
void QTransform::copy(const QNode *ref)
{
QComponent::copy(ref);
const QTransform *transform = static_cast<const QTransform *>(ref);
- d_func()->m_matrix = transform->d_func()->m_matrix;
- Q_FOREACH (QAbstractTransform *t, transform->d_func()->m_transforms)
- addTransform(qobject_cast<QAbstractTransform *>(QNode::clone(t)));
+ // We need to copy the matrix with all the pending
+ // transformations applied
+ d_func()->m_matrix = transform->matrix();
}
QList<QAbstractTransform *> QTransform::transforms() const
@@ -110,16 +128,23 @@ QList<QAbstractTransform *> QTransform::transforms() const
void QTransform::addTransform(QAbstractTransform *transform)
{
Q_D(QTransform);
+ if (transform == Q_NULLPTR || d->m_transforms.contains(transform))
+ return;
d->m_transforms.append(transform);
QObject::connect(transform, SIGNAL(transformMatrixChanged()), this, SLOT(_q_update()));
+ QObject::connect(transform, SIGNAL(destroyed(QObject*)), this, SLOT(_q_transformDestroyed(QObject*)));
+ emit transformsChanged();
d->_q_update();
}
void QTransform::removeTransform(QAbstractTransform *transform)
{
Q_D(QTransform);
- d->m_transforms.removeOne(transform);
+ if (!d->m_transforms.removeOne(transform))
+ return;
QObject::disconnect(transform, SIGNAL(transformMatrixChanged()), this, SLOT(_q_update()));
+ QObject::disconnect(transform, SIGNAL(destroyed(QObject*)), this, SLOT(_q_transformDestroyed(QObject*)));
+ emit transformsChanged();
d->_q_update();
}
diff --git a/src/core/transforms/qtransform.h b/src/core/transforms/qtransform.h
index 9cb8741d6..722dcf688 100644
--- a/src/core/transforms/qtransform.h
+++ b/src/core/transforms/qtransform.h
@@ -57,6 +57,7 @@ public:
explicit QTransform(QNode *parent = 0);
QTransform(QList<QAbstractTransform *> transforms, QNode *parent = 0);
QTransform(QAbstractTransform *transform, QNode *parent = 0);
+ ~QTransform();
QList<QAbstractTransform *> transforms() const;
void addTransform(QAbstractTransform *xform);
@@ -66,6 +67,7 @@ public:
Q_SIGNALS:
void matrixChanged();
+ void transformsChanged();
protected:
QTransform(QTransformPrivate &dd, QNode *parent = 0);
@@ -74,6 +76,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QTransform)
QT3D_CLONEABLE(QTransform)
+ Q_PRIVATE_SLOT(d_func(), void _q_transformDestroyed(QObject *obj))
Q_PRIVATE_SLOT(d_func(), void _q_update())
};
diff --git a/src/core/transforms/qtransform_p.h b/src/core/transforms/qtransform_p.h
index c233f7ad7..4c2f95d20 100644
--- a/src/core/transforms/qtransform_p.h
+++ b/src/core/transforms/qtransform_p.h
@@ -49,8 +49,9 @@ class QTransformPrivate : public QComponentPrivate
Q_DECLARE_PUBLIC(QTransform)
public:
- QTransformPrivate(QTransform *qq);
+ QTransformPrivate();
+ void _q_transformDestroyed(QObject *obj);
void _q_update();
QMatrix4x4 applyTransforms() const;
diff --git a/src/core/transforms/qtranslatetransform.cpp b/src/core/transforms/qtranslatetransform.cpp
index d0b6f38af..6c7dc0896 100644
--- a/src/core/transforms/qtranslatetransform.cpp
+++ b/src/core/transforms/qtranslatetransform.cpp
@@ -42,25 +42,23 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QTranslateTransformPrivate::QTranslateTransformPrivate(QTranslateTransform *qq)
- : QAbstractTransformPrivate(qq)
+/*!
+ \class Qt3D::QTranslateTransformPrivate
+ \internal
+*/
+QTranslateTransformPrivate::QTranslateTransformPrivate()
+ : QAbstractTransformPrivate()
{
}
-QTranslateTransform::QTranslateTransform(QNode *parent)
- : QAbstractTransform(*new QTranslateTransformPrivate(this), parent)
-{
-}
-void QTranslateTransform::copy(const QNode *ref)
+QTranslateTransform::QTranslateTransform(QObject *parent)
+ : QAbstractTransform(*new QTranslateTransformPrivate, parent)
{
- QAbstractTransform::copy(ref);
- const QTranslateTransform *transform = static_cast<const QTranslateTransform*>(ref);
- d_func()->m_translation = transform->d_func()->m_translation;
}
-
-QTranslateTransform::QTranslateTransform(QTranslateTransformPrivate &dd, QNode *parent)
+/*! \internal */
+QTranslateTransform::QTranslateTransform(QTranslateTransformPrivate &dd, QObject *parent)
: QAbstractTransform(dd, parent)
{
}
diff --git a/src/core/transforms/qtranslatetransform.h b/src/core/transforms/qtranslatetransform.h
index c3ddfbd50..4bf3b4c61 100644
--- a/src/core/transforms/qtranslatetransform.h
+++ b/src/core/transforms/qtranslatetransform.h
@@ -38,7 +38,6 @@
#define QT3D_QTRANSLATETRANSFORM_H
#include <Qt3DCore/qabstracttransform.h>
-#include <Qt3DCore/qt3dcore_global.h>
#include <QVector3D>
@@ -58,7 +57,7 @@ class QT3DCORESHARED_EXPORT QTranslateTransform : public QAbstractTransform
Q_PROPERTY(QVector3D translation READ translation WRITE setTranslation NOTIFY translateChanged)
public:
- explicit QTranslateTransform(QNode *parent = 0);
+ explicit QTranslateTransform(QObject *parent = Q_NULLPTR);
float dx() const;
float dy() const;
@@ -79,12 +78,11 @@ Q_SIGNALS:
void translateChanged();
protected:
- QTranslateTransform(QTranslateTransformPrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QTranslateTransform(QTranslateTransformPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QTranslateTransform)
- QT3D_CLONEABLE(QTranslateTransform)
+ Q_DISABLE_COPY(QTranslateTransform)
};
} // namespace Qt3D
diff --git a/src/core/transforms/qtranslatetransform_p.h b/src/core/transforms/qtranslatetransform_p.h
index 58bf11b33..6b9d5e8ab 100644
--- a/src/core/transforms/qtranslatetransform_p.h
+++ b/src/core/transforms/qtranslatetransform_p.h
@@ -47,7 +47,7 @@ class QTranslateTransform;
class QTranslateTransformPrivate : public QAbstractTransformPrivate
{
public:
- QTranslateTransformPrivate(QTranslateTransform *qq);
+ QTranslateTransformPrivate();
Q_DECLARE_PUBLIC(QTranslateTransform)
QVector3D m_translation;
diff --git a/src/input/qinputaspect.cpp b/src/input/qinputaspect.cpp
index f769ab3af..fc7fb8e8c 100644
--- a/src/input/qinputaspect.cpp
+++ b/src/input/qinputaspect.cpp
@@ -50,8 +50,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QInputAspectPrivate::QInputAspectPrivate(QInputAspect *qq)
- : QAbstractAspectPrivate(qq)
+/*!
+ \class Qt3D::QInputAspectPrivate
+ \internal
+*/
+QInputAspectPrivate::QInputAspectPrivate()
+ : QAbstractAspectPrivate()
, m_inputHandler(new Input::InputHandler())
, m_cameraController(new Input::CameraController())
{
@@ -59,7 +63,7 @@ QInputAspectPrivate::QInputAspectPrivate(QInputAspect *qq)
}
QInputAspect::QInputAspect(QObject *parent)
- : QAbstractAspect(*new QInputAspectPrivate(this), parent)
+ : QAbstractAspect(*new QInputAspectPrivate, parent)
{
registerBackendType<QKeyboardController>(QBackendNodeFunctorPtr(new Input::KeyboardControllerFunctor(d_func()->m_inputHandler)));
registerBackendType<QKeyboardInput>(QBackendNodeFunctorPtr(new Input::KeyboardInputFunctor(d_func()->m_inputHandler)));
diff --git a/src/input/qinputaspect_p.h b/src/input/qinputaspect_p.h
index 0faf4860f..3b618a147 100644
--- a/src/input/qinputaspect_p.h
+++ b/src/input/qinputaspect_p.h
@@ -55,7 +55,7 @@ class InputHandler;
class QInputAspectPrivate : public QAbstractAspectPrivate
{
public:
- QInputAspectPrivate(QInputAspect *qq);
+ QInputAspectPrivate();
Q_DECLARE_PUBLIC(QInputAspect)
Input::InputHandler *m_inputHandler;
diff --git a/src/input/qkeyboardcontroller.cpp b/src/input/qkeyboardcontroller.cpp
index 6dc9d64bd..69e93b479 100644
--- a/src/input/qkeyboardcontroller.cpp
+++ b/src/input/qkeyboardcontroller.cpp
@@ -44,13 +44,17 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QKeyboardControllerPrivate::QKeyboardControllerPrivate(QKeyboardController *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QKeyboardControllerPrivate
+ \internal
+*/
+QKeyboardControllerPrivate::QKeyboardControllerPrivate()
+ : QNodePrivate()
{
}
QKeyboardController::QKeyboardController(QNode *parent)
- : QNode(*new QKeyboardControllerPrivate(this), parent)
+ : QNode(*new QKeyboardControllerPrivate, parent)
{
}
@@ -60,6 +64,7 @@ QKeyboardInput *QKeyboardController::activeInput() const
return d->m_activeInput;
}
+/*! \internal */
QKeyboardController::QKeyboardController(QKeyboardControllerPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/input/qkeyboardcontroller_p.h b/src/input/qkeyboardcontroller_p.h
index a6f18a6b4..a5888d648 100644
--- a/src/input/qkeyboardcontroller_p.h
+++ b/src/input/qkeyboardcontroller_p.h
@@ -49,7 +49,7 @@ class QKeyboardInput;
class QKeyboardControllerPrivate : public QNodePrivate
{
public:
- QKeyboardControllerPrivate(QKeyboardController *qq);
+ QKeyboardControllerPrivate();
Q_DECLARE_PUBLIC(QKeyboardController)
QKeyboardInput *m_activeInput;
diff --git a/src/input/qkeyboardinput.cpp b/src/input/qkeyboardinput.cpp
index a6dfc1241..e7030799d 100644
--- a/src/input/qkeyboardinput.cpp
+++ b/src/input/qkeyboardinput.cpp
@@ -43,8 +43,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QKeyboardInputPrivate::QKeyboardInputPrivate(QKeyboardInput *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QKeyboardInputPrivate
+ \internal
+*/
+QKeyboardInputPrivate::QKeyboardInputPrivate()
+ : QComponentPrivate()
, m_controller(Q_NULLPTR)
, m_focus(false)
{
@@ -55,10 +59,11 @@ QKeyboardInputPrivate::QKeyboardInputPrivate(QKeyboardInput *qq)
Constructs a new QKeyboardInput instance with parent \a parent.
*/
QKeyboardInput::QKeyboardInput(QNode *parent)
- : QComponent(*new QKeyboardInputPrivate(this), parent)
+ : QComponent(*new QKeyboardInputPrivate, parent)
{
}
+/*! \internal */
QKeyboardInput::QKeyboardInput(QKeyboardInputPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
diff --git a/src/input/qkeyboardinput_p.h b/src/input/qkeyboardinput_p.h
index 969708955..3f5a7edee 100644
--- a/src/input/qkeyboardinput_p.h
+++ b/src/input/qkeyboardinput_p.h
@@ -49,7 +49,7 @@ class QKeyboardController;
class QKeyboardInputPrivate : public QComponentPrivate
{
public:
- QKeyboardInputPrivate(QKeyboardInput *qq);
+ QKeyboardInputPrivate();
Q_DECLARE_PUBLIC(QKeyboardInput)
QKeyboardController *m_controller;
diff --git a/src/plugins/sceneparsers/assimp/assimphelpers.cpp b/src/plugins/sceneparsers/assimp/assimphelpers.cpp
index 9ad5847e7..345bb79bc 100644
--- a/src/plugins/sceneparsers/assimp/assimphelpers.cpp
+++ b/src/plugins/sceneparsers/assimp/assimphelpers.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
namespace AssimpHelper {
/*!
- * \class AssimpIOStream
+ * \class Qt3D::AssimpHelper::AssimpIOStream
*
* \internal
*
diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp
index 79610acee..5f16f977a 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp
@@ -43,11 +43,14 @@
#include <Qt3DCore/qcameralens.h>
#include <private/qabstractmesh_p.h>
#include <Qt3DRenderer/qparameter.h>
+#include <Qt3DRenderer/qeffect.h>
#include <Qt3DRenderer/qmesh.h>
#include <Qt3DRenderer/qmaterial.h>
#include <Qt3DRenderer/qbuffer.h>
#include <Qt3DRenderer/qattribute.h>
#include <Qt3DRenderer/qtexture.h>
+#include <Qt3DRenderer/qdiffusemapmaterial.h>
+#include <Qt3DRenderer/qdiffusespecularmapmaterial.h>
#include <Qt3DRenderer/qphongmaterial.h>
#include <QFileInfo>
#include <QColor>
@@ -60,16 +63,15 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
/*!
- * \class AssimpParser
- * \namespace Qt3D
- * \since 5.5
- *
- * \brief Provides a generic way of loading various 3D assets
- * format into a Qt3D scene.
- *
- * It should be noted that Assimp aiString is explicitly defined to be UTF-8.
- *
- * \sa GLTFParser
+ \class Qt3D::AssimpParser
+ \since 5.5
+
+ \brief Provides a generic way of loading various 3D assets
+ format into a Qt3D scene.
+
+ It should be noted that Assimp aiString is explicitly defined to be UTF-8.
+
+ \sa GLTFParser
*/
Q_LOGGING_CATEGORY(AssimpParserLog, "Qt3D.AssimpParser")
@@ -112,8 +114,81 @@ const QString TANGENT_ATTRIBUTE_NAME = QMeshData::defaultTangentAttributeName();
const QString TEXTCOORD_ATTRIBUTE_NAME = QMeshData::defaultTextureCoordinateAttributeName();
const QString COLOR_ATTRIBUTE_NAME = QMeshData::defaultColorAttributeName();
+/*!
+ * Returns a QMatrix4x4 from \a matrix;
+ */
+QMatrix4x4 aiMatrix4x4ToQMatrix4x4(const aiMatrix4x4 &matrix) Q_DECL_NOEXCEPT
+{
+ return QMatrix4x4(matrix.a1, matrix.a2, matrix.a3, matrix.a4,
+ matrix.b1, matrix.b2, matrix.b3, matrix.b4,
+ matrix.c1, matrix.c2, matrix.c3, matrix.c4,
+ matrix.d1, matrix.d2, matrix.d3, matrix.d4);
+}
+
+/*!
+ * Returns a QString from \a str;
+ */
+static inline QString aiStringToQString(const aiString &str)
+{
+ return QString::fromUtf8(str.data, int(str.length));
+}
+
+QMaterial *createBestApproachingMaterial(const aiMaterial *assimpMaterial) Q_DECL_NOEXCEPT
+{
+ aiString path; // unused but necessary
+ const bool hasDiffuseTexture = (assimpMaterial->GetTexture(aiTextureType_DIFFUSE, 0, &path) == AI_SUCCESS);
+ const bool hasSpecularTexture = (assimpMaterial->GetTexture(aiTextureType_SPECULAR, 0, &path) == AI_SUCCESS);
+
+ if (hasDiffuseTexture && hasSpecularTexture)
+ return new QDiffuseSpecularMapMaterial();
+ if (hasDiffuseTexture)
+ return new QDiffuseMapMaterial();
+ return new QPhongMaterial();
+}
+
+QString texturePath(const aiString &path)
+{
+ QString p = aiStringToQString(path);
+ if (p.startsWith('/'))
+ p.remove(0, 1);
+ return p;
+}
+
+/*!
+ * Returns the Qt3D::QParameter with named \a name if contained by the material
+ * \a material. If the material doesn't contain the named parameter, a new
+ * Qt3D::QParameter is created and inserted into the material.
+ */
+QParameter *findNamedParameter(const QString &name, QMaterial *material)
+{
+ // Does the material contain the parameter ?
+ foreach (QParameter *p , material->parameters())
+ if (p->name() == name)
+ return p;
+
+ // Does the material's effect contain the parameter ?
+ if (material->effect()) {
+ const QEffect *e = material->effect();
+ foreach (QParameter *p, e->parameters())
+ if (p->name() == name)
+ return p;
+ }
+
+ // Create and add parameter to material
+ QParameter *p = new QParameter(material);
+ p->setName(name);
+ material->addParameter(p);
+ return p;
+}
+
+void setParameterValue(const QString &name, QMaterial *material, const QVariant &value)
+{
+ QParameter *p = findNamedParameter(name, material);
+ p->setValue(value);
}
+} // anonymous
+
QStringList AssimpParser::assimpSupportedFormatsList = AssimpParser::assimpSupportedFormats();
/*!
@@ -230,7 +305,7 @@ private:
};
/*!
- * Initialized a new instance of AssimpParser.
+ * Constructor. Initializes a new instance of AssimpParser.
*/
AssimpParser::AssimpParser() : AbstractSceneParser(),
m_sceneParsed(false),
@@ -239,7 +314,7 @@ AssimpParser::AssimpParser() : AbstractSceneParser(),
}
/*!
- * Cleans the parser properly before destruction.
+ * Destructor. Cleans the parser properly before destroying it.
*/
AssimpParser::~AssimpParser()
{
@@ -247,7 +322,7 @@ AssimpParser::~AssimpParser()
}
/*!
- * Return true if the provided \a path has a suffix supported
+ * Returns \c true if the provided \a path has a suffix supported
* by the Assimp Assets importer.
*/
bool AssimpParser::isAssimpPath(const QString &path)
@@ -261,19 +336,8 @@ bool AssimpParser::isAssimpPath(const QString &path)
}
/*!
- * Returns a QMatrix4x4 from \a matrix;
- */
-QMatrix4x4 AssimpParser::aiMatrix4x4ToQMatrix4x4(const aiMatrix4x4 &matrix)
-{
- return QMatrix4x4(matrix.a1, matrix.a2, matrix.a3, matrix.a4,
- matrix.b1, matrix.b2, matrix.b3, matrix.b4,
- matrix.c1, matrix.c2, matrix.c3, matrix.c4,
- matrix.d1, matrix.d2, matrix.d3, matrix.d4);
-}
-
-/*!
- * Sets the \a path used by the parser to load the asset file.
- * If the file is valid, this will trigger the parsing of the file.
+ * Sets the \a source used by the parser to load the asset file.
+ * If the file is valid, this will trigger parsing of the file.
*/
void AssimpParser::setSource(const QUrl &source)
{
@@ -288,7 +352,7 @@ void AssimpParser::setSource(const QUrl &source)
}
/*!
- * Returns true if the extension of \a path is supported by
+ * Returns \c true if the extension of \a source is supported by
* the assimp parser.
*/
bool AssimpParser::isExtensionSupported(const QUrl &source) const
@@ -302,7 +366,7 @@ bool AssimpParser::isExtensionSupported(const QUrl &source) const
* node specified by \a id. If \a id is empty, the scene is assumed to be
* the root node of the scene.
*
- * Returns Q_NULLPTR if \a id was specified but not node matching it can be found.
+ * Returns \c Q_NULLPTR if \a id was specified but no node matching it was found.
*/
QEntity *AssimpParser::scene(const QString &id)
{
@@ -327,7 +391,7 @@ QEntity *AssimpParser::scene(const QString &id)
/*!
* Returns a Node from the scene identified by \a id.
- * Returns Q_NULLPTR if no node can be found.
+ * Returns \c Q_NULLPTR if the node was not found.
*/
QEntity *AssimpParser::node(const QString &id)
{
@@ -346,14 +410,16 @@ QEntity *AssimpParser::node(aiNode *node)
if (node == Q_NULLPTR)
return Q_NULLPTR;
QEntity *entityNode = new QEntity();
+ entityNode->setObjectName(aiStringToQString(node->mName));
// Add Meshes to the node
for (uint i = 0; i < node->mNumMeshes; i++) {
uint meshIdx = node->mMeshes[i];
AssimpMesh * mesh = m_scene->m_meshes[meshIdx];
// mesh material
- if (m_scene->m_materials.contains(meshIdx))
- entityNode->addComponent(m_scene->m_materials[meshIdx]);
+ uint materialIndex = m_scene->m_aiScene->mMeshes[meshIdx]->mMaterialIndex;
+ if (m_scene->m_materials.contains(materialIndex))
+ entityNode->addComponent(m_scene->m_materials[materialIndex]);
// mesh
entityNode->addComponent(mesh);
}
@@ -369,7 +435,7 @@ QEntity *AssimpParser::node(aiNode *node)
}
// Add Transformations
- QMatrix4x4 qTransformMatrix = AssimpParser::aiMatrix4x4ToQMatrix4x4(node->mTransformation);
+ const QMatrix4x4 qTransformMatrix = aiMatrix4x4ToQMatrix4x4(node->mTransformation);
QTransform *transform = new QTransform(new QMatrixTransform(qTransformMatrix));
entityNode->addComponent(transform);
@@ -384,7 +450,7 @@ QEntity *AssimpParser::node(aiNode *node)
/*!
* Reads the scene file pointed by \a path and launches the parsing of
- * the scene using Assimp after having cleaned up previously saved values
+ * the scene using Assimp, after having cleaned up previously saved values
* from eventual previous parsings.
*/
void AssimpParser::readSceneFile(const QString &path)
@@ -404,7 +470,8 @@ void AssimpParser::readSceneFile(const QString &path)
aiProcess_SortByPType|
aiProcess_Triangulate|
aiProcess_JoinIdenticalVertices|
- aiProcess_GenSmoothNormals);
+ aiProcess_GenSmoothNormals|
+ aiProcess_FlipUVs);
if (m_scene->m_aiScene == Q_NULLPTR) {
qCWarning(AssimpParserLog) << "Assimp scene import failed";
return ;
@@ -413,7 +480,7 @@ void AssimpParser::readSceneFile(const QString &path)
}
/*!
- * Cleans the various dictionnaries holding the scenes infos.
+ * Cleans the various dictionaries holding the scene's information.
*/
void AssimpParser::cleanup()
{
@@ -423,7 +490,7 @@ void AssimpParser::cleanup()
}
/*!
- * Parses the the aiScene provided py Assimp and convert Assimp
+ * Parses the aiScene provided py Assimp and converts Assimp
* values to Qt3D values.
*/
void AssimpParser::parse()
@@ -448,13 +515,15 @@ void AssimpParser::parse()
}
/*!
- * Converts the provided Assimp aiMaterial \a material to a Qt3D material.
- * \sa Material and adds its to a dictionary of materials.
+ * Converts the provided Assimp aiMaterial identified by \a materialIndex to a
+ * Qt3D material and adds it to a dictionary of materials.
+ * \sa Material
*/
void AssimpParser::loadMaterial(uint materialIndex)
{
- QMaterial *material = new QPhongMaterial();
+ // Generates default material based on what the assimp material contains
aiMaterial *assimpMaterial = m_scene->m_aiScene->mMaterials[materialIndex];
+ QMaterial *material = createBestApproachingMaterial(assimpMaterial);
// Material Name
copyMaterialName(material, assimpMaterial);
copyMaterialColorProperties(material, assimpMaterial);
@@ -464,14 +533,13 @@ void AssimpParser::loadMaterial(uint materialIndex)
// Add textures to materials dict
copyMaterialTextures(material, assimpMaterial);
- // TO DO : Set Material Effect and Technique
-
- m_scene->m_materials[materialIndex] = material;
+ m_scene->m_materials.insert(materialIndex, material);
}
/*!
* Converts the Assimp aiMesh mesh identified by \a meshIndex to a QMeshData
- * \sa QMeshData and adds it to a dictionary of meshes.
+ * and adds it to a dictionary of meshes.
+ * \sa QMeshData
*/
void AssimpParser::loadMesh(uint meshIndex)
{
@@ -480,9 +548,6 @@ void AssimpParser::loadMesh(uint meshIndex)
// Primitive are always triangles with the current Assimp's configuration
QMeshDataPtr meshData(new QMeshData(QMeshData::Triangles));
- // Mesh Name
- QString meshName = QString::fromUtf8(mesh->mName.data);
-
// Vertices and Normals always present with the current Assimp's configuration
aiVector3D *vertices = mesh->mVertices;
aiVector3D *normals = mesh->mNormals;
@@ -603,15 +668,17 @@ void AssimpParser::loadMesh(uint meshIndex)
meshData->computeBoundsFromAttribute(VERTICES_ATTRIBUTE_NAME);
AssimpMesh *storedMesh = new AssimpMesh();
+ storedMesh->setObjectName(aiStringToQString(mesh->mName));
storedMesh->setData(meshData);
m_scene->m_meshes[meshIndex] = storedMesh;
- qCDebug(AssimpParserLog) << Q_FUNC_INFO << " Mesh " << meshName << " Vertices " << mesh->mNumVertices << " Faces " << mesh->mNumFaces << " Indices " << indices;
+ qCDebug(AssimpParserLog) << Q_FUNC_INFO << " Mesh " << aiStringToQString(mesh->mName)
+ << " Vertices " << mesh->mNumVertices << " Faces " << mesh->mNumFaces << " Indices " << indices;
}
/*!
* Converts the provided Assimp aiTexture at \a textureIndex to a Texture and
- * adds it ot a dictionary of textures.
+ * adds it to a dictionary of textures.
* \sa Texture
*/
void AssimpParser::loadEmbeddedTexture(uint textureIndex)
@@ -663,7 +730,7 @@ void AssimpParser::loadCamera(uint cameraIndex)
QEntity *camera = new QEntity();
QCameraLens *lens = new QCameraLens();
- lens->setObjectName(QString::fromUtf8(assimpCamera->mName.data));
+ lens->setObjectName(aiStringToQString(assimpCamera->mName));
lens->setPerspectiveProjection(qRadiansToDegrees(assimpCamera->mHorizontalFOV),
qMax(assimpCamera->mAspect, 1.0f),
assimpCamera->mClipPlaneNear,
@@ -696,41 +763,41 @@ void AssimpParser::copyMaterialName(QMaterial *material, aiMaterial *assimpMater
if (assimpMaterial->Get(AI_MATKEY_NAME, name) == aiReturn_SUCCESS) {
// May not be necessary
// Kept for debug purposes at the moment
- material->setObjectName(QString::fromUtf8(name.data));
+ material->setObjectName(aiStringToQString(name));
qCDebug(AssimpParserLog) << Q_FUNC_INFO << "Assimp Material " << material->objectName();
}
}
/*!
- * Fills \a material color properties with \a assimpMaterial color properties;
+ * Fills \a material color properties with \a assimpMaterial color properties.
*/
void AssimpParser::copyMaterialColorProperties(QMaterial *material, aiMaterial *assimpMaterial)
{
aiColor3D color;
if (assimpMaterial->Get(AI_MATKEY_COLOR_DIFFUSE, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_DIFFUSE_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_DIFFUSE_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
if (assimpMaterial->Get(AI_MATKEY_COLOR_SPECULAR, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_SPECULAR_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_SPECULAR_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
if (assimpMaterial->Get(AI_MATKEY_COLOR_AMBIENT, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_AMBIENT_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_AMBIENT_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
if (assimpMaterial->Get(AI_MATKEY_COLOR_EMISSIVE, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_EMISSIVE_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_EMISSIVE_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
if (assimpMaterial->Get(AI_MATKEY_COLOR_TRANSPARENT, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_TRANSPARENT_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_TRANSPARENT_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
if (assimpMaterial->Get(AI_MATKEY_COLOR_REFLECTIVE, color) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_REFLECTIVE_COLOR, QColor::fromRgbF(color.r, color.g, color.b)));
+ setParameterValue(ASSIMP_MATERIAL_REFLECTIVE_COLOR, material, QColor::fromRgbF(color.r, color.g, color.b));
}
/*!
- * Retrieves a\a material bool property;
+ * Retrieves a \a material bool property.
*/
void AssimpParser::copyMaterialBoolProperties(QMaterial *material, aiMaterial *assimpMaterial)
{
int value;
if (assimpMaterial->Get(AI_MATKEY_TWOSIDED, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_IS_TWOSIDED, (value == 0) ? false : true));
+ setParameterValue(ASSIMP_MATERIAL_IS_TWOSIDED, material, (value == 0) ? false : true);
if (assimpMaterial->Get(AI_MATKEY_ENABLE_WIREFRAME, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_IS_WIREFRAME, (value == 0) ? false : true));
+ setParameterValue(ASSIMP_MATERIAL_IS_WIREFRAME, material, (value == 0) ? false : true);
}
void AssimpParser::copyMaterialShadingModel(QMaterial *material, aiMaterial *assimpMaterial)
@@ -766,8 +833,7 @@ void AssimpParser::copyMaterialTextures(QMaterial *material, aiMaterial *assimpM
aiTextureType_OPACITY,
aiTextureType_REFLECTION,
aiTextureType_SHININESS,
- aiTextureType_SPECULAR,
- /*aiTextureType_UNKNOWN*/};
+ aiTextureType_SPECULAR};
if (m_scene->m_textureToParameterName.isEmpty()) {
m_scene->m_textureToParameterName.insert(aiTextureType_AMBIENT, ASSIMP_MATERIAL_AMBIENT_TEXTURE);
@@ -786,38 +852,38 @@ void AssimpParser::copyMaterialTextures(QMaterial *material, aiMaterial *assimpM
for (unsigned int i = 0; i < sizeof(textureType)/sizeof(textureType[0]); i++) {
aiString path;
if (assimpMaterial->GetTexture(textureType[i], 0, &path) == AI_SUCCESS) {
- QString fullPath = m_sceneDir.absoluteFilePath(QString::fromUtf8(path.data));
+ QString fullPath = m_sceneDir.absoluteFilePath(texturePath(path));
// Load texture if not already loaded
if (!m_scene->m_materialTextures.contains(fullPath)) {
QAbstractTextureProvider *tex = new QTexture2D();
QTextureImage *texImage = new QTextureImage();
- texImage->setSource(fullPath);
+ texImage->setSource(QUrl::fromLocalFile(fullPath));
tex->addTextureImage(texImage);
m_scene->m_materialTextures.insert(fullPath, tex);
qCDebug(AssimpParserLog) << Q_FUNC_INFO << " Loaded Texture " << fullPath;
}
- material->addParameter(new QParameter(m_scene->m_textureToParameterName[textureType[i]],
- m_scene->m_materialTextures[fullPath]));
+ setParameterValue(m_scene->m_textureToParameterName[textureType[i]],
+ material, QVariant::fromValue(m_scene->m_materialTextures[fullPath]));
}
}
}
/*!
- * Retrieves a\a material float property.
+ * Retrieves a \a material float property.
*/
void AssimpParser::copyMaterialFloatProperties(QMaterial *material, aiMaterial *assimpMaterial)
{
float value = 0;
if (assimpMaterial->Get(AI_MATKEY_OPACITY, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_OPACITY, value));
+ setParameterValue(ASSIMP_MATERIAL_OPACITY, material, value);
if (assimpMaterial->Get(AI_MATKEY_SHININESS, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_SHININESS, value));
+ setParameterValue(ASSIMP_MATERIAL_SHININESS, material, value);
if (assimpMaterial->Get(AI_MATKEY_SHININESS_STRENGTH, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_SHININESS_STRENGTH, value));
+ setParameterValue(ASSIMP_MATERIAL_SHININESS_STRENGTH, material, value);
if (assimpMaterial->Get(AI_MATKEY_REFRACTI, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_REFRACTI, value));
+ setParameterValue(ASSIMP_MATERIAL_REFRACTI, material, value);
if (assimpMaterial->Get(AI_MATKEY_REFLECTIVITY, value) == aiReturn_SUCCESS)
- material->addParameter(new QParameter(ASSIMP_MATERIAL_REFLECTIVITY, value));
+ setParameterValue(ASSIMP_MATERIAL_REFLECTIVITY, material, value);
}
AssimpMesh::AssimpMesh(QNode *parent)
diff --git a/src/plugins/sceneparsers/assimp/assimpparser_p.h b/src/plugins/sceneparsers/assimp/assimpparser_p.h
index d24472522..b0267d472 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser_p.h
+++ b/src/plugins/sceneparsers/assimp/assimpparser_p.h
@@ -85,7 +85,6 @@ public:
private:
static bool isAssimpPath(const QString &path);
static QStringList assimpSupportedFormats();
- static QMatrix4x4 aiMatrix4x4ToQMatrix4x4(const aiMatrix4x4 &matrix);
QEntity *node(aiNode *node);
diff --git a/src/quick3d/imports/render/defaults/defaults.pri b/src/quick3d/imports/render/defaults/defaults.pri
index 797dd09f0..4e871abc3 100644
--- a/src/quick3d/imports/render/defaults/defaults.pri
+++ b/src/quick3d/imports/render/defaults/defaults.pri
@@ -13,3 +13,4 @@ QML_FILES = \
$$PWD/qml/NormalDiffuseSpecularMapMaterial.qml \
$$PWD/qml/ForwardRenderer.qml \
$$PWD/qml/PerVertexColorMaterial.qml \
+ $$PWD/qml/SkyboxEntity.qml \
diff --git a/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml b/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml
new file mode 100644
index 000000000..2f0c54600
--- /dev/null
+++ b/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+
+Entity {
+
+ property alias cameraPosition: cameraTranslate.translation;
+ property string baseName: "";
+ property string extension: ".png"
+
+ property TextureCubeMap skyboxTexture: TextureCubeMap {
+ generateMipMaps: false
+ magnificationFilter: Texture.Linear
+ minificationFilter: Texture.Linear
+ wrapMode {
+ x: WrapMode.ClampToEdge
+ y: WrapMode.ClampToEdge
+ }
+ TextureImage { cubeMapFace: Texture.CubeMapPositiveX; source: baseName + "_posx" + extension }
+ TextureImage { cubeMapFace: Texture.CubeMapPositiveY; source: baseName + "_posy" + extension }
+ TextureImage { cubeMapFace: Texture.CubeMapPositiveZ; source: baseName + "_posz" + extension }
+ TextureImage { cubeMapFace: Texture.CubeMapNegativeX; source: baseName + "_negx" + extension }
+ TextureImage { cubeMapFace: Texture.CubeMapNegativeY; source: baseName + "_negy" + extension }
+ TextureImage { cubeMapFace: Texture.CubeMapNegativeZ; source: baseName + "_negz" + extension }
+ }
+
+ ShaderProgram {
+ id: gl3SkyboxShader
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/skybox.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/skybox.frag")
+ }
+
+ ShaderProgram {
+ id: gl2es2SkyboxShader
+ vertexShaderCode: loadSource("qrc:/shaders/es2/skybox.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/skybox.frag")
+ }
+
+ CuboidMesh {
+ id: cuboidMesh
+ yzMeshResolution: Qt.size(2, 2)
+ xzMeshResolution: Qt.size(2, 2)
+ xyMeshResolution: Qt.size(2, 2)
+ }
+
+ Transform {
+ id: transform
+ Translate { id: cameraTranslate }
+ }
+
+ Material {
+ id: skyboxMaterial
+ parameters: Parameter { name: "skyboxTexture"; value: skyboxTexture}
+
+ effect: Effect {
+ techniques: [
+ // GL3 Technique
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.Desktop
+ profile: OpenGLFilter.Core
+ majorVersion: 3
+ minorVersion: 1
+ }
+ renderPasses: RenderPass {
+ shaderProgram: gl3SkyboxShader
+ renderStates: [
+ // cull front faces
+ CullFace { mode: CullFace.Front },
+ DepthTest { func: DepthTest.LessOrEqual }
+ ]
+ }
+ },
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.Desktop
+ profile: OpenGLFilter.None
+ majorVersion: 2
+ minorVersion: 0
+ }
+ renderPasses: RenderPass {
+ shaderProgram: gl2es2SkyboxShader
+ renderStates: [
+ CullFace { mode: CullFace.Front },
+ DepthTest { func: DepthTest.LessOrEqual }
+ ]
+ }
+ },
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.ES
+ profile: OpenGLFilter.None
+ majorVersion: 2
+ minorVersion: 0
+ }
+ renderPasses: RenderPass {
+ shaderProgram: gl2es2SkyboxShader
+ renderStates: [
+ CullFace { mode: CullFace.Front },
+ DepthTest { func: DepthTest.LessOrEqual }
+ ]
+ }
+ }
+ ]
+ }
+ }
+
+ components: [cuboidMesh, skyboxMaterial, transform]
+}
+
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
index 0a1250f75..4c3959c93 100644
--- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
+++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
@@ -85,6 +85,7 @@
#include <Qt3DRenderer/qpolygonoffset.h>
#include <Qt3DRenderer/qcolormask.h>
#include <Qt3DRenderer/qshaderdata.h>
+#include <Qt3DRenderer/qnodraw.h>
#include <Qt3DQuickRenderer/quick3dtechnique.h>
#include <Qt3DQuickRenderer/quick3dmaterial.h>
#include <Qt3DQuickRenderer/quick3dtechniquefilter.h>
@@ -96,11 +97,12 @@
#include <Qt3DQuickRenderer/quick3dtexture.h>
#include <Qt3DQuickRenderer/private/shaderpropertyparser_p.h>
#include <Qt3DQuickRenderer/quick3drenderpass.h>
-#include <Qt3DQuickRenderer/quick3dframegraphitem.h>
#include <Qt3DQuickRenderer/quick3dsortmethod.h>
#include <Qt3DQuickRenderer/quick3dparameter.h>
#include <Qt3DQuickRenderer/quick3dshaderdata.h>
#include <Qt3DQuickRenderer/quick3dshaderdataarray.h>
+#include <Qt3DQuickRenderer/quick3dstateset.h>
+#include <Qt3DQuickRenderer/quick3drendertargetselector.h>
static void initResources()
{
@@ -122,7 +124,9 @@ static const struct {
{ "NormalDiffuseSpecularMapMaterial", 2, 0 },
{ "PerVertexColorMaterial", 2, 0 },
// FrameGraphs
- { "ForwardRenderer", 2, 0 }
+ { "ForwardRenderer", 2, 0 },
+ // Entities
+ { "SkyboxEntity", 2, 0 }
};
QVariantList Quick3DShaderDataArrayToVariantListConverter(Qt3D::Render::Quick::Quick3DShaderDataArray *array)
@@ -173,6 +177,8 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
qmlRegisterExtendedType<Qt3D::QTextureCubeMapArray, Qt3D::Render::Quick::Quick3DTextureExtension>(uri, 2, 0, "TextureCubeMapArray");
qmlRegisterExtendedType<Qt3D::QTexture2DMultisample, Qt3D::Render::Quick::Quick3DTextureExtension>(uri, 2, 0, "Texture2DMultisample");
qmlRegisterExtendedType<Qt3D::QTexture2DMultisampleArray, Qt3D::Render::Quick::Quick3DTextureExtension>(uri, 2, 0, "Texture2DMultisampleArray");
+ qmlRegisterExtendedType<Qt3D::QTextureRectangle, Qt3D::Render::Quick::Quick3DTextureExtension>(uri, 2, 0, "TextureRectangle");
+ qmlRegisterExtendedType<Qt3D::QTextureBuffer, Qt3D::Render::Quick::Quick3DTextureExtension>(uri, 2, 0, "TextureBuffer");
qmlRegisterUncreatableType<Qt3D::QAbstractTextureImage>(uri, 2, 0, "QAbstractTextureImage", QStringLiteral("QAbstractTextureImage is abstract"));
qmlRegisterType<Qt3D::QTextureImage>(uri, 2, 0, "TextureImage");
@@ -200,9 +206,11 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
qmlRegisterExtendedType<Qt3D::QRenderPassFilter, Qt3D::Render::Quick::Quick3DRenderPassFilter>(uri, 2, 0, "RenderPassFilter");
qmlRegisterExtendedType<Qt3D::QTechniqueFilter, Qt3D::Render::Quick::Quick3DTechniqueFilter>(uri, 2, 0, "TechniqueFilter");
qmlRegisterExtendedType<Qt3D::QViewport, Qt3D::Render::Quick::Quick3DViewport>(uri, 2, 0, "Viewport");
- qmlRegisterType<Qt3D::QRenderTargetSelector>(uri, 2, 0, "RenderTargetSelector");
+ qmlRegisterExtendedType<Qt3D::QRenderTargetSelector, Qt3D::Render::Quick::Quick3DRenderTargetSelector>(uri, 2, 0, "RenderTargetSelector");
qmlRegisterType<Qt3D::QClearBuffer>(uri, 2, 0, "ClearBuffer");
- qmlRegisterExtendedUncreatableType<Qt3D::QFrameGraphNode, Qt3D::Render::Quick::Quick3DFrameGraphItem>(uri, 2, 0, "FrameGraphNode", QStringLiteral("FrameGraphNode is a base class"));
+ qmlRegisterUncreatableType<Qt3D::QFrameGraphNode>(uri, 2, 0, "FrameGraphNode", QStringLiteral("FrameGraphNode is a base class"));
+ qmlRegisterExtendedType<Qt3D::QStateSet, Qt3D::Render::Quick::Quick3DStateSet>(uri, 2, 0, "StateSet");
+ qmlRegisterType<Qt3D::QNoDraw>(uri, 2, 0, "NoDraw");
qmlRegisterType<Qt3D::QFrameGraph>(uri, 2, 0, "FrameGraph");
// RenderTarget
@@ -216,6 +224,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
// RenderStates
qmlRegisterUncreatableType<Qt3D::QRenderState>(uri, 2, 0, "RenderState", QStringLiteral("QRenderState is a base class"));
qmlRegisterType<Qt3D::QBlendState>(uri, 2, 0, "BlendState");
+ qmlRegisterType<Qt3D::QBlendStateSeparate>(uri, 2, 0, "BlendStateSeparate");
qmlRegisterType<Qt3D::QBlendEquation>(uri, 2, 0, "BlendEquation");
qmlRegisterType<Qt3D::QAlphaTest>(uri, 2, 0, "AlphaTest");
qmlRegisterType<Qt3D::QDepthTest>(uri, 2, 0, "DepthTest");
diff --git a/src/quick3d/quick3d/items/quick3dconfiguration.cpp b/src/quick3d/quick3d/items/quick3dconfiguration.cpp
index 5e205cb6e..2ee792af7 100644
--- a/src/quick3d/quick3d/items/quick3dconfiguration.cpp
+++ b/src/quick3d/quick3d/items/quick3dconfiguration.cpp
@@ -50,6 +50,11 @@ namespace Qt3D {
namespace Quick {
+/*!
+ \qmltype Configuration
+ \inqmlmodule Qt3D
+ \since 5.5
+*/
Quick3DConfiguration::Quick3DConfiguration(QObject *parent)
: QObject(parent)
, m_camera(Q_NULLPTR)
@@ -65,6 +70,9 @@ void Quick3DConfiguration::setControlledCamera(QCamera *camera)
}
}
+/*!
+ \qmlproperty Camera Qt3D::Configuration::controlledCamera
+*/
QCamera *Quick3DConfiguration::controlledCamera() const
{
return m_camera;
diff --git a/src/quick3d/quick3d/items/quick3dentity.cpp b/src/quick3d/quick3d/items/quick3dentity.cpp
index d98c7c826..c00eb0899 100644
--- a/src/quick3d/quick3d/items/quick3dentity.cpp
+++ b/src/quick3d/quick3d/items/quick3dentity.cpp
@@ -43,11 +43,22 @@ namespace Qt3D {
namespace Quick {
+/*!
+ \qmltype Entity
+ \inherits Node
+ \inqmlmodule Qt3D
+ \since 5.5
+*/
+
Quick3DEntity::Quick3DEntity(QObject *parent)
: QObject(parent)
{
}
+/*!
+ \qmlproperty list<Component3D> Qt3D::Entity::components
+ \readonly
+*/
QQmlListProperty<QComponent> Quick3DEntity::componentList()
{
return QQmlListProperty<Qt3D::QComponent>(this, 0,
diff --git a/src/quick3d/quick3d/items/quick3dentityloader.cpp b/src/quick3d/quick3d/items/quick3dentityloader.cpp
index f15ad8d18..224c6e6d2 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader.cpp
+++ b/src/quick3d/quick3d/items/quick3dentityloader.cpp
@@ -75,17 +75,29 @@ private:
Quick3DEntityLoader *m_loader;
};
+/*!
+ \qmltype EntityLoader
+ \inqmlmodule Qt3D
+ \since 5.5
+*/
Quick3DEntityLoader::Quick3DEntityLoader(QNode *parent)
- : QEntity(*new Quick3DEntityLoaderPrivate(this), parent)
+ : QEntity(*new Quick3DEntityLoaderPrivate, parent)
{
}
+/*!
+ \qmlproperty QtQml::QtObject Qt3D::EntityLoader::entity
+ \readonly
+*/
QObject *Quick3DEntityLoader::entity() const
{
Q_D(const Quick3DEntityLoader);
return d->m_entity;
}
+/*!
+ \qmlproperty url Qt3D::EntityLoader::source
+*/
QUrl Quick3DEntityLoader::source() const
{
Q_D(const Quick3DEntityLoader);
@@ -114,8 +126,12 @@ void Quick3DEntityLoader::copy(const QNode *ref)
d_func()->m_entity->setParent(this);
}
-Quick3DEntityLoaderPrivate::Quick3DEntityLoaderPrivate(Quick3DEntityLoader *qq)
- : QEntityPrivate(qq),
+/*!
+ \class Qt3D::Quick::Quick3DEntityLoaderPrivate
+ \internal
+*/
+Quick3DEntityLoaderPrivate::Quick3DEntityLoaderPrivate()
+ : QEntityPrivate(),
m_incubator(Q_NULLPTR),
m_context(Q_NULLPTR),
m_component(Q_NULLPTR),
diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p.h
index 2026e3796..b00eecc7a 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader_p.h
+++ b/src/quick3d/quick3d/items/quick3dentityloader_p.h
@@ -59,7 +59,7 @@ class Quick3DEntityLoaderIncubator;
class Quick3DEntityLoaderPrivate : public QEntityPrivate
{
public:
- Quick3DEntityLoaderPrivate(Quick3DEntityLoader *qq);
+ Quick3DEntityLoaderPrivate();
Q_DECLARE_PUBLIC(Quick3DEntityLoader)
diff --git a/src/quick3d/quick3d/items/quick3dnode.cpp b/src/quick3d/quick3d/items/quick3dnode.cpp
index 44e41c2f7..3a93e0211 100644
--- a/src/quick3d/quick3d/items/quick3dnode.cpp
+++ b/src/quick3d/quick3d/items/quick3dnode.cpp
@@ -43,11 +43,25 @@ namespace Qt3D {
namespace Quick {
+/*!
+ \qmltype Node
+ \inqmlmodule Qt3D
+ \since 5.5
+
+ \brief A base QML type that other types inherit. It cannot be directly
+ created.
+*/
+
Quick3DNode::Quick3DNode(QObject *parent)
: QObject(parent)
{
}
+/*!
+ \qmlproperty list<QtQml::QtObject> Qt3D::Node::data
+ \default
+*/
+
QQmlListProperty<QObject> Quick3DNode::data()
{
return QQmlListProperty<QObject>(this, 0,
@@ -57,6 +71,11 @@ QQmlListProperty<QObject> Quick3DNode::data()
Quick3DNode::clearData);
}
+/*!
+ \qmlproperty list<Node> Qt3D::Node::childNodes
+ \readonly
+*/
+
QQmlListProperty<QNode> Quick3DNode::childNodes()
{
return QQmlListProperty<QNode>(this, 0,
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
index 4684bd212..43c5b0f9e 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
@@ -50,8 +50,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
namespace Quick {
-Quick3DNodeInstantiatorPrivate::Quick3DNodeInstantiatorPrivate(QNode *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::Quick::Quick3DNodeInstantiatorPrivate
+ \internal
+*/
+Quick3DNodeInstantiatorPrivate::Quick3DNodeInstantiatorPrivate()
+ : QNodePrivate()
, m_componentComplete(true)
, m_effectiveReset(false)
, m_active(true)
@@ -192,12 +196,12 @@ void Quick3DNodeInstantiatorPrivate::makeModel()
/*!
\qmltype NodeInstantiator
\instantiates Quick3DNodeInstantiator
- \inqmlmodule Quick3D
- \brief Dynamically creates nodes
+ \inqmlmodule Qt3D
+ \brief Dynamically creates nodes.
\since 5.5
- A NodeInstantiator can be used to control the dynamic creation of nodes, or to dynamically
- create multiple objects from a template.
+ A NodeInstantiator can be used to control the dynamic creation of nodes,
+ or to dynamically create multiple objects from a template.
The NodeInstantiator element will manage the objects it creates. Those
objects are parented to the Instantiator and can also be deleted by the
@@ -208,7 +212,7 @@ void Quick3DNodeInstantiatorPrivate::makeModel()
*/
Quick3DNodeInstantiator::Quick3DNodeInstantiator(QNode *parent)
- : QNode(*(new Quick3DNodeInstantiatorPrivate(this)), parent)
+ : QNode(*new Quick3DNodeInstantiatorPrivate, parent)
{
}
@@ -217,7 +221,7 @@ Quick3DNodeInstantiator::~Quick3DNodeInstantiator()
}
/*!
- \qmlsignal Quick3D::NodeInstantiator::objectAdded(int index, QtObject node)
+ \qmlsignal Qt3D::NodeInstantiator::objectAdded(int index, QtObject node)
This signal is emitted when a node is added to the NodeInstantiator. The \a index
parameter holds the index which the node has been given, and the \a node
@@ -227,7 +231,7 @@ Quick3DNodeInstantiator::~Quick3DNodeInstantiator()
*/
/*!
- \qmlsignal Quick3D::NodeInstantiator::objectRemoved(int index, QtObject object)
+ \qmlsignal Qt3D::NodeInstantiator::objectRemoved(int index, QtObject object)
This signal is emitted when an object is removed from the Instantiator. The \a index
parameter holds the index which the object had been given, and the \a object
@@ -239,13 +243,13 @@ Quick3DNodeInstantiator::~Quick3DNodeInstantiator()
The corresponding handler is \c onObjectRemoved.
*/
/*!
- \qmlproperty bool Quick3D::NodeInstantiator::active
+ \qmlproperty bool Qt3D::NodeInstantiator::active
- When active is true, and the delegate component is ready, the Instantiator will
- create objects according to the model. When active is false, no objects
+ When active is \c true, and the delegate component is ready, the Instantiator will
+ create objects according to the model. When active is \c false, no objects
will be created and any previously created objects will be destroyed.
- Default is true.
+ Default is \c true.
*/
bool Quick3DNodeInstantiator::isActive() const
{
@@ -264,7 +268,7 @@ void Quick3DNodeInstantiator::setActive(bool newVal)
}
/*!
- \qmlproperty bool Quick3D::NodeInstantiator::asynchronous
+ \qmlproperty bool Qt3D::NodeInstantiator::asynchronous
When asynchronous is true the Instantiator will attempt to create objects
asynchronously. This means that objects may not be available immediately,
@@ -291,7 +295,8 @@ void Quick3DNodeInstantiator::setAsync(bool newVal)
/*!
- \qmlproperty int Quick3D::NodeInstantiator::count
+ \qmlproperty int Qt3D::NodeInstantiator::count
+ \readonly
The number of objects the Instantiator is currently managing.
*/
@@ -303,7 +308,7 @@ int Quick3DNodeInstantiator::count() const
}
/*!
- \qmlproperty QtQml::Component Quick3D::NodeInstantiator::delegate
+ \qmlproperty QtQml::Component Qt3D::NodeInstantiator::delegate
\default
The component used to create all objects.
@@ -340,13 +345,13 @@ void Quick3DNodeInstantiator::setDelegate(QQmlComponent *c)
}
/*!
- \qmlproperty variant Quick3D::NodeInstantiator::model
+ \qmlproperty variant Qt3D::NodeInstantiator::model
This property can be set to any of the supported \l {qml-data-models}{data models}:
\list
\li A number that indicates the number of delegates to be created by the repeater
- \li A model (e.g. a ListModel item, or a QAbstractItemModel subclass)
+ \li A model (for example, a ListModel item or a QAbstractItemModel subclass)
\li A string list
\li An object list
\endlist
@@ -415,7 +420,8 @@ void Quick3DNodeInstantiator::setModel(const QVariant &v)
}
/*!
- \qmlproperty QtQml::QtObject Quick3D::NodeInstantiator::object
+ \qmlproperty QtQml::QtObject Qt3D::NodeInstantiator::object
+ \readonly
This is a reference to the first created object, intended as a convenience
for the case where only one object has been created.
@@ -429,7 +435,7 @@ QObject *Quick3DNodeInstantiator::object() const
}
/*!
- \qmlmethod QtQml::QtObject Quick3D::NodeInstantiator::objectAt
+ \qmlmethod QtQml::QtObject Qt3D::NodeInstantiator::objectAt(int index)
Returns a reference to the object with the given \a index.
*/
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
index e4171b303..1dd0d0022 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
@@ -85,8 +85,8 @@ public:
QObject *object() const;
Q_INVOKABLE QObject *objectAt(int index) const;
- void classBegin();
- void componentComplete();
+ void classBegin() Q_DECL_OVERRIDE;
+ void componentComplete() Q_DECL_OVERRIDE;
Q_SIGNALS:
void modelChanged();
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p_p.h
index 274fa752d..30b8c84d8 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p_p.h
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p_p.h
@@ -54,7 +54,7 @@ class Quick3DNodeInstantiatorPrivate : public QNodePrivate
Q_DECLARE_PUBLIC(Quick3DNodeInstantiator)
public:
- Quick3DNodeInstantiatorPrivate(QNode *qq);
+ Quick3DNodeInstantiatorPrivate();
~Quick3DNodeInstantiatorPrivate();
void clear();
diff --git a/src/quick3d/quick3d/items/quick3dtransform.cpp b/src/quick3d/quick3d/items/quick3dtransform.cpp
index 867e8bf51..56556d491 100644
--- a/src/quick3d/quick3d/items/quick3dtransform.cpp
+++ b/src/quick3d/quick3d/items/quick3dtransform.cpp
@@ -43,11 +43,27 @@ namespace Qt3D {
namespace Quick {
+/*!
+ \qmltype Transform
+ \inqmlmodule Qt3D
+ \since 5.5
+*/
Quick3DTransform::Quick3DTransform(QObject *parent)
: QObject(parent)
{
+ Q_ASSERT(qobject_cast<Qt3D::QTransform *>(parent) != Q_NULLPTR);
+ QObject::connect(parent, SIGNAL(transformsChanged()), this, SIGNAL(transformsChanged()));
}
+/*!
+ \qmlproperty matrix4x4 Qt3D::Transform::matrix
+ \readonly
+*/
+
+/*!
+ \qmlproperty list<QAbstractTransform> Qt3D::Transform::transforms
+ \default
+*/
QQmlListProperty<QAbstractTransform> Quick3DTransform::transformList()
{
return QQmlListProperty<QAbstractTransform>(this, 0,
diff --git a/src/quick3d/quick3d/items/quick3dtransform.h b/src/quick3d/quick3d/items/quick3dtransform.h
index 2d7f9aa10..57d350203 100644
--- a/src/quick3d/quick3d/items/quick3dtransform.h
+++ b/src/quick3d/quick3d/items/quick3dtransform.h
@@ -53,7 +53,7 @@ namespace Quick {
class QT3DQUICKSHARED_EXPORT Quick3DTransform : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3D::QAbstractTransform> transforms READ transformList)
+ Q_PROPERTY(QQmlListProperty<Qt3D::QAbstractTransform> transforms READ transformList NOTIFY transformsChanged)
Q_CLASSINFO("DefaultProperty", "transforms")
public:
explicit Quick3DTransform(QObject *parent = 0);
@@ -61,6 +61,9 @@ public:
inline QTransform *parentTransform() const { return qobject_cast<Qt3D::QTransform *>(parent()); }
+Q_SIGNALS:
+ void transformsChanged();
+
private:
static void qmlAppendTransform(QQmlListProperty<Qt3D::QAbstractTransform> *list, Qt3D::QAbstractTransform *bar);
static QAbstractTransform* transformAt(QQmlListProperty<Qt3D::QAbstractTransform> *list, int index);
diff --git a/src/quick3d/quick3d/qqmlaspectengine.cpp b/src/quick3d/quick3d/qqmlaspectengine.cpp
index e5320377d..a05143f23 100644
--- a/src/quick3d/quick3d/qqmlaspectengine.cpp
+++ b/src/quick3d/quick3d/qqmlaspectengine.cpp
@@ -47,9 +47,12 @@ namespace Qt3D {
namespace Quick {
-QQmlAspectEnginePrivate::QQmlAspectEnginePrivate(QQmlAspectEngine *qq)
+/*!
+ \class Qt3D::Quick::QQmlAspectEnginePrivate
+ \internal
+*/
+QQmlAspectEnginePrivate::QQmlAspectEnginePrivate()
: QObjectPrivate()
- , q_ptr(qq)
, m_qmlEngine(new QQmlEngine())
, m_aspectEngine(new QAspectEngine())
, m_component(Q_NULLPTR)
@@ -57,7 +60,7 @@ QQmlAspectEnginePrivate::QQmlAspectEnginePrivate(QQmlAspectEngine *qq)
}
QQmlAspectEngine::QQmlAspectEngine(QObject *parent)
- : QObject(*new QQmlAspectEnginePrivate(this), parent)
+ : QObject(*new QQmlAspectEnginePrivate, parent)
{
}
diff --git a/src/quick3d/quick3d/qqmlaspectengine_p.h b/src/quick3d/quick3d/qqmlaspectengine_p.h
index 09ede1326..d79589a3e 100644
--- a/src/quick3d/quick3d/qqmlaspectengine_p.h
+++ b/src/quick3d/quick3d/qqmlaspectengine_p.h
@@ -51,10 +51,10 @@ namespace Quick {
class QQmlAspectEnginePrivate : public QObjectPrivate
{
public:
- QQmlAspectEnginePrivate(QQmlAspectEngine *qq);
+ QQmlAspectEnginePrivate();
Q_DECLARE_PUBLIC(QQmlAspectEngine)
- QQmlAspectEngine *q_ptr;
+
QScopedPointer<QQmlEngine> m_qmlEngine;
QScopedPointer<QAspectEngine> m_aspectEngine;
QQmlComponent *m_component;
diff --git a/src/quick3d/quick3d/qt3dquick_global.cpp b/src/quick3d/quick3d/qt3dquick_global.cpp
index a17654bd9..6bb0513ca 100644
--- a/src/quick3d/quick3d/qt3dquick_global.cpp
+++ b/src/quick3d/quick3d/qt3dquick_global.cpp
@@ -258,10 +258,9 @@ public:
return QMatrix4x4();
}
- static QMatrix4x4 matrix4x4FromObject(QQmlV4Handle object, QV8Engine *e, bool *ok)
+ static QMatrix4x4 matrix4x4FromObject(QQmlV4Handle object, QV4::ExecutionEngine *v4, bool *ok)
{
if (ok) *ok = false;
- QV4::ExecutionEngine *v4 = QV8Engine::getV4(e);
QV4::Scope scope(v4);
QV4::ScopedArrayObject array(scope, object);
if (!array)
@@ -613,9 +612,8 @@ public:
return false;
}
- bool variantFromJsObject(int type, QQmlV4Handle object, QV8Engine *e, QVariant *v)
+ bool variantFromJsObject(int type, QQmlV4Handle object, QV4::ExecutionEngine *v4, QVariant *v) Q_DECL_OVERRIDE
{
- QV4::ExecutionEngine *v4 = QV8Engine::getV4(e);
QV4::Scope scope(v4);
#ifndef QT_NO_DEBUG
QV4::ScopedObject obj(scope, object);
@@ -624,7 +622,7 @@ public:
bool ok = false;
switch (type) {
case QMetaType::QMatrix4x4:
- *v = QVariant::fromValue(matrix4x4FromObject(object, e, &ok));
+ *v = QVariant::fromValue(matrix4x4FromObject(object, v4, &ok));
default: break;
}
diff --git a/src/quick3d/quick3drenderer/items/items.pri b/src/quick3d/quick3drenderer/items/items.pri
index b3b1c742a..35fa140d3 100644
--- a/src/quick3d/quick3drenderer/items/items.pri
+++ b/src/quick3d/quick3drenderer/items/items.pri
@@ -10,12 +10,13 @@ HEADERS += \
$$PWD/shaderpropertyparser_p.h \
$$PWD/quick3dtexture.h \
$$PWD/quick3drenderpass.h \
- $$PWD/quick3dframegraphitem.h \
$$PWD/quick3dsortmethod.h \
$$PWD/quick3dparameter_p.h \
$$PWD/quick3dparameter.h \
$$PWD/quick3dshaderdata.h \
- $$PWD/quick3dshaderdataarray.h
+ $$PWD/quick3dshaderdataarray.h \
+ $$PWD/quick3dstateset.h \
+ $$PWD/quick3drendertargetselector.h
SOURCES += \
$$PWD/quick3drenderpassfilter.cpp \
@@ -29,10 +30,11 @@ SOURCES += \
$$PWD/shaderpropertyparser.cpp \
$$PWD/quick3dtexture.cpp \
$$PWD/quick3drenderpass.cpp \
- $$PWD/quick3dframegraphitem.cpp \
$$PWD/quick3dsortmethod.cpp \
$$PWD/quick3dparameter.cpp \
$$PWD/quick3dshaderdata.cpp \
- $$PWD/quick3dshaderdataarray.cpp
+ $$PWD/quick3dshaderdataarray.cpp \
+ $$PWD/quick3dstateset.cpp \
+ $$PWD/quick3drendertargetselector.cpp
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3drenderer/items/quick3dframegraphitem.cpp b/src/quick3d/quick3drenderer/items/quick3dframegraphitem.cpp
deleted file mode 100644
index c2c53b83b..000000000
--- a/src/quick3d/quick3drenderer/items/quick3dframegraphitem.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "quick3dframegraphitem.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3D {
-
-namespace Render {
-
-namespace Quick {
-
-Quick3DFrameGraphItem::Quick3DFrameGraphItem(QObject *parent)
- : QObject(parent)
-{
-}
-
-QQmlListProperty<QFrameGraphNode> Quick3DFrameGraphItem::frameGraphChildrenList()
-{
- return QQmlListProperty<QFrameGraphNode>(this, 0,
- &Quick3DFrameGraphItem::apprendFrameGraphItem,
- &Quick3DFrameGraphItem::frameGraphItemsCount,
- &Quick3DFrameGraphItem::frameGraphItemAt,
- &Quick3DFrameGraphItem::clearFrameGraphItemList);
-}
-
-void Quick3DFrameGraphItem::apprendFrameGraphItem(QQmlListProperty<QFrameGraphNode> *list, QFrameGraphNode *item)
-{
- Quick3DFrameGraphItem *fg = qobject_cast<Quick3DFrameGraphItem *>(list->object);
- if (fg)
- return fg->parentFrameGraphItem()->appendFrameGraphNode(item);
-}
-
-QFrameGraphNode *Quick3DFrameGraphItem::frameGraphItemAt(QQmlListProperty<QFrameGraphNode> *list, int index)
-{
- Quick3DFrameGraphItem *fg = qobject_cast<Quick3DFrameGraphItem *>(list->object);
- if (fg)
- return fg->parentFrameGraphItem()->frameGraphChildren().at(index);
- return Q_NULLPTR;
-}
-
-int Quick3DFrameGraphItem::frameGraphItemsCount(QQmlListProperty<QFrameGraphNode> *list)
-{
- Quick3DFrameGraphItem *fg = qobject_cast<Quick3DFrameGraphItem *>(list->object);
- if (fg)
- return fg->parentFrameGraphItem()->frameGraphChildren().count();
- return -1;
-}
-
-void Quick3DFrameGraphItem::clearFrameGraphItemList(QQmlListProperty<QFrameGraphNode> *list)
-{
- Quick3DFrameGraphItem *fg = qobject_cast<Quick3DFrameGraphItem *>(list->object);
- if (fg) {
- Q_FOREACH (QFrameGraphNode *item, fg->parentFrameGraphItem()->frameGraphChildren())
- fg->parentFrameGraphItem()->removeFrameGraphNode(item);
- }
-}
-
-} // Quick
-
-} // Render
-
-} // Qt3D
-
-QT_END_NAMESPACE
-
diff --git a/src/quick3d/quick3drenderer/items/quick3dparameter.cpp b/src/quick3d/quick3drenderer/items/quick3dparameter.cpp
index 576b0a07e..6f3b66212 100644
--- a/src/quick3d/quick3drenderer/items/quick3dparameter.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3dparameter.cpp
@@ -54,8 +54,8 @@ const int qjsValueTypeId = qMetaTypeId<QJSValue>();
}
-Quick3DParameterPrivate::Quick3DParameterPrivate(Quick3DParameter *qq)
- : QParameterPrivate(qq)
+Quick3DParameterPrivate::Quick3DParameterPrivate()
+ : QParameterPrivate()
{
}
@@ -71,10 +71,11 @@ void Quick3DParameterPrivate::setValue(const QVariant &value)
}
Quick3DParameter::Quick3DParameter(QNode *parent)
- : QParameter(*new Quick3DParameterPrivate(this), parent)
+ : QParameter(*new Quick3DParameterPrivate, parent)
{
}
+/*! \internal */
Quick3DParameter::Quick3DParameter(Quick3DParameterPrivate &dd, QNode *parent)
: QParameter(dd, parent)
{
diff --git a/src/quick3d/quick3drenderer/items/quick3dparameter_p.h b/src/quick3d/quick3drenderer/items/quick3dparameter_p.h
index c0ccfe03b..bc715b49c 100644
--- a/src/quick3d/quick3drenderer/items/quick3dparameter_p.h
+++ b/src/quick3d/quick3drenderer/items/quick3dparameter_p.h
@@ -52,7 +52,7 @@ class Quick3DParameter;
class Quick3DParameterPrivate : public QParameterPrivate
{
public:
- Quick3DParameterPrivate(Quick3DParameter *qq);
+ Quick3DParameterPrivate();
Q_DECLARE_PUBLIC(Quick3DParameter)
diff --git a/src/quick3d/quick3drenderer/items/quick3drenderpass.cpp b/src/quick3d/quick3drenderer/items/quick3drenderpass.cpp
index 0977f9583..8dfc483e1 100644
--- a/src/quick3d/quick3drenderer/items/quick3drenderpass.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3drenderpass.cpp
@@ -78,6 +78,15 @@ QQmlListProperty<QRenderState> Quick3DRenderPass::renderStateList()
&Quick3DRenderPass::clearRenderStates);
}
+QQmlListProperty<QParameter> Quick3DRenderPass::parameterList()
+{
+ return QQmlListProperty<Qt3D::QParameter>(this, 0,
+ &Quick3DRenderPass::appendParameter,
+ &Quick3DRenderPass::parametersCount,
+ &Quick3DRenderPass::parameterAt,
+ &Quick3DRenderPass::clearParameterList);
+}
+
void Quick3DRenderPass::appendAnnotation(QQmlListProperty<QAnnotation> *list, QAnnotation *annotation)
{
Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object);
@@ -153,6 +162,32 @@ void Quick3DRenderPass::clearRenderStates(QQmlListProperty<QRenderState> *list)
rPass->parentRenderPass()->removeRenderState(s);
}
+void Quick3DRenderPass::appendParameter(QQmlListProperty<QParameter> *list, QParameter *param)
+{
+ Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object);
+ rPass->parentRenderPass()->addParameter(param);
+}
+
+QParameter *Quick3DRenderPass::parameterAt(QQmlListProperty<QParameter> *list, int index)
+{
+ Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object);
+ return rPass->parentRenderPass()->parameters().at(index);
+}
+
+int Quick3DRenderPass::parametersCount(QQmlListProperty<QParameter> *list)
+{
+ Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object);
+ return rPass->parentRenderPass()->parameters().count();
+}
+
+void Quick3DRenderPass::clearParameterList(QQmlListProperty<QParameter> *list)
+{
+ Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object);
+ Q_FOREACH (QParameter *p, rPass->parentRenderPass()->parameters())
+ rPass->parentRenderPass()->removeParameter(p);
+}
+
+
} // Quick
} // Render
diff --git a/src/quick3d/quick3drenderer/items/quick3drenderpass.h b/src/quick3d/quick3drenderer/items/quick3drenderpass.h
index 438f276d1..5e968870d 100644
--- a/src/quick3d/quick3drenderer/items/quick3drenderpass.h
+++ b/src/quick3d/quick3drenderer/items/quick3drenderpass.h
@@ -56,12 +56,15 @@ class QT3DQUICKRENDERERSHARED_EXPORT Quick3DRenderPass : public QObject
Q_PROPERTY(QQmlListProperty<Qt3D::QAnnotation> annotations READ annotationList)
Q_PROPERTY(QQmlListProperty<Qt3D::QParameterMapping> bindings READ bindingList)
Q_PROPERTY(QQmlListProperty<Qt3D::QRenderState> renderStates READ renderStateList)
+ Q_PROPERTY(QQmlListProperty<Qt3D::QParameter> parameters READ parameterList)
public:
explicit Quick3DRenderPass(QObject *parent = 0);
QQmlListProperty<Qt3D::QAnnotation> annotationList();
QQmlListProperty<Qt3D::QParameterMapping> bindingList();
QQmlListProperty<Qt3D::QRenderState> renderStateList();
+ QQmlListProperty<Qt3D::QParameter> parameterList();
+
inline QRenderPass *parentRenderPass() const { return qobject_cast<QRenderPass *>(parent()); }
private:
@@ -79,6 +82,11 @@ private:
static QRenderState *renderStateAt(QQmlListProperty<Qt3D::QRenderState> *list, int index);
static int renderStateCount(QQmlListProperty<Qt3D::QRenderState> *list);
static void clearRenderStates(QQmlListProperty<Qt3D::QRenderState> *list);
+
+ static void appendParameter(QQmlListProperty<QParameter> *list, QParameter *param);
+ static QParameter *parameterAt(QQmlListProperty<QParameter> *list, int index);
+ static int parametersCount(QQmlListProperty<QParameter> *list);
+ static void clearParameterList(QQmlListProperty<QParameter> *list);
};
} // Quick
diff --git a/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.cpp b/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.cpp
index 85e849fa9..3b31f696b 100644
--- a/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.cpp
@@ -52,10 +52,20 @@ Quick3DRenderPassFilter::Quick3DRenderPassFilter(QObject *parent)
QQmlListProperty<QAnnotation> Quick3DRenderPassFilter::includeList()
{
return QQmlListProperty<Qt3D::QAnnotation>(this, 0,
- &Quick3DRenderPassFilter::appendInclude,
- &Quick3DRenderPassFilter::includesCount,
- &Quick3DRenderPassFilter::includeAt,
- &Quick3DRenderPassFilter::clearIncludes);
+ &Quick3DRenderPassFilter::appendInclude,
+ &Quick3DRenderPassFilter::includesCount,
+ &Quick3DRenderPassFilter::includeAt,
+ &Quick3DRenderPassFilter::clearIncludes);
+}
+
+QQmlListProperty<QParameter> Quick3DRenderPassFilter::parameterList()
+{
+ return QQmlListProperty<Qt3D::QParameter>(this, 0,
+ &Quick3DRenderPassFilter::appendParameter,
+ &Quick3DRenderPassFilter::parametersCount,
+ &Quick3DRenderPassFilter::parameterAt,
+ &Quick3DRenderPassFilter::clearParameterList);
+
}
void Quick3DRenderPassFilter::appendInclude(QQmlListProperty<QAnnotation> *list, QAnnotation *annotation)
@@ -92,6 +102,31 @@ void Quick3DRenderPassFilter::clearIncludes(QQmlListProperty<QAnnotation> *list)
}
}
+void Quick3DRenderPassFilter::appendParameter(QQmlListProperty<QParameter> *list, QParameter *param)
+{
+ Quick3DRenderPassFilter *rPassFilter = qobject_cast<Quick3DRenderPassFilter *>(list->object);
+ rPassFilter->parentRenderPassFilter()->addParameter(param);
+}
+
+QParameter *Quick3DRenderPassFilter::parameterAt(QQmlListProperty<QParameter> *list, int index)
+{
+ Quick3DRenderPassFilter *rPassFilter = qobject_cast<Quick3DRenderPassFilter *>(list->object);
+ return rPassFilter->parentRenderPassFilter()->parameters().at(index);
+}
+
+int Quick3DRenderPassFilter::parametersCount(QQmlListProperty<QParameter> *list)
+{
+ Quick3DRenderPassFilter *rPassFilter = qobject_cast<Quick3DRenderPassFilter *>(list->object);
+ return rPassFilter->parentRenderPassFilter()->parameters().count();
+}
+
+void Quick3DRenderPassFilter::clearParameterList(QQmlListProperty<QParameter> *list)
+{
+ Quick3DRenderPassFilter *rPassFilter = qobject_cast<Quick3DRenderPassFilter *>(list->object);
+ Q_FOREACH (QParameter *p, rPassFilter->parentRenderPassFilter()->parameters())
+ rPassFilter->parentRenderPassFilter()->removeParameter(p);
+}
+
} // Quick
} // Render
diff --git a/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.h b/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.h
index ae0c32bc8..4b22568ad 100644
--- a/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.h
+++ b/src/quick3d/quick3drenderer/items/quick3drenderpassfilter.h
@@ -54,10 +54,13 @@ class QT3DQUICKRENDERERSHARED_EXPORT Quick3DRenderPassFilter : public QObject
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<Qt3D::QAnnotation> includes READ includeList)
+ Q_PROPERTY(QQmlListProperty<Qt3D::QParameter> parameters READ parameterList)
+
public:
explicit Quick3DRenderPassFilter(QObject *parent = 0);
QQmlListProperty<Qt3D::QAnnotation> includeList();
+ QQmlListProperty<Qt3D::QParameter> parameterList();
inline QRenderPassFilter *parentRenderPassFilter() const { return qobject_cast<Qt3D::QRenderPassFilter*>(parent()); }
@@ -66,6 +69,11 @@ private:
static QAnnotation *includeAt(QQmlListProperty<QAnnotation> *list, int index);
static int includesCount(QQmlListProperty<QAnnotation> *list);
static void clearIncludes(QQmlListProperty<QAnnotation> *list);
+
+ static void appendParameter(QQmlListProperty<QParameter> *list, QParameter *param);
+ static QParameter *parameterAt(QQmlListProperty<QParameter> *list, int index);
+ static int parametersCount(QQmlListProperty<QParameter> *list);
+ static void clearParameterList(QQmlListProperty<QParameter> *list);
};
} // Quick
diff --git a/src/quick3d/quick3drenderer/items/quick3drendertargetselector.cpp b/src/quick3d/quick3drenderer/items/quick3drendertargetselector.cpp
new file mode 100644
index 000000000..808d05a46
--- /dev/null
+++ b/src/quick3d/quick3drenderer/items/quick3drendertargetselector.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3drendertargetselector.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+namespace Quick {
+
+Quick3DRenderTargetSelector::Quick3DRenderTargetSelector(QObject *parent)
+ : QObject(parent)
+{
+}
+
+Quick3DRenderTargetSelector::~Quick3DRenderTargetSelector()
+{
+}
+
+QVariantList Quick3DRenderTargetSelector::drawBuffers() const
+{
+ // Converts RenderAttachmentType to int
+ QVariantList l;
+ Q_FOREACH (const QRenderAttachment::RenderAttachmentType &b, parentRenderTargetSelector()->drawBuffers())
+ l.append(static_cast<int>(b));
+ return l;
+}
+
+void Quick3DRenderTargetSelector::setDrawBuffers(const QVariantList &buffers)
+{
+ if (buffers != drawBuffers()) {
+
+ // Converts int to RenderAttachmentType
+ QList<QRenderAttachment::RenderAttachmentType> drawBuffersList;
+ Q_FOREACH (const QVariant &buf, buffers)
+ drawBuffersList.append(static_cast<QRenderAttachment::RenderAttachmentType>(buf.toInt()));
+
+ parentRenderTargetSelector()->setDrawBuffers(drawBuffersList);
+ emit drawBuffersChanged();
+ }
+}
+
+} // Quick
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/core/jobs/qthreadpooler_p_p.h b/src/quick3d/quick3drenderer/items/quick3drendertargetselector.h
index 0057acc36..e801dd811 100644
--- a/src/core/jobs/qthreadpooler_p_p.h
+++ b/src/quick3d/quick3drenderer/items/quick3drendertargetselector.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
@@ -34,60 +34,46 @@
**
****************************************************************************/
-#ifndef QT3D_QTHREADPOOLER_P_H
-#define QT3D_QTHREADPOOLER_P_H
+#ifndef QT3D_RENDER_QUICK_QUICK3DRENDERTARGETSELECTOR_H
+#define QT3D_RENDER_QUICK_QUICK3DRENDERTARGETSELECTOR_H
-#include "jobrunner_p.h"
-#include "dependencyhandler_p.h"
-
-#include <QtCore/QtGlobal>
-#include <private/qobject_p.h>
+#include <Qt3DQuickRenderer/qt3dquickrenderer_global.h>
+#include <Qt3DRenderer/qrenderattachment.h>
+#include <Qt3DRenderer/qrendertargetselector.h>
+#include <QQmlListProperty>
+#include <QVariantList>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QThreadPooler;
+namespace Render {
+
+namespace Quick {
-class QThreadPoolerPrivate : public QObjectPrivate
+class QT3DQUICKRENDERERSHARED_EXPORT Quick3DRenderTargetSelector : public QObject
{
+ Q_OBJECT
+ Q_PROPERTY(QVariantList drawBuffers READ drawBuffers WRITE setDrawBuffers NOTIFY drawBuffersChanged)
public:
- QThreadPoolerPrivate(QThreadPooler *qq);
- ~QThreadPoolerPrivate();
-
- bool isQueueEmpty();
-
- void incRunningThreads();
- void decRunningThreads();
+ explicit Quick3DRenderTargetSelector(QObject *parent = 0);
+ ~Quick3DRenderTargetSelector();
- inline void setDependencyHandler(DependencyHandler *handler)
- {
- m_dependencyHandler = handler;
- }
+ inline QRenderTargetSelector *parentRenderTargetSelector() const { return qobject_cast<QRenderTargetSelector *>(parent()); }
- void createRunners(int threadCount);
- void shutdown();
+ QVariantList drawBuffers() const;
+ void setDrawBuffers(const QVariantList &drawBuffers);
- int maxThreadCount() const;
- void setMaxThreadCount(int threadCount);
-
- Q_DECLARE_PUBLIC(QThreadPooler)
+Q_SIGNALS:
+ void drawBuffersChanged();
+};
-private:
- QList<JobRunner *> m_workers;
- QVector<QSharedPointer<TaskInterface> > m_taskQueue;
+} // Quick
- QWaitCondition m_jobAvailable;
- QWaitCondition m_jobFinished;
- QMutex *m_mutex;
- int m_runningThreads;
- int m_maxThreadCount;
- DependencyHandler *m_dependencyHandler;
-};
+} // Render
-}
+} // Qt3D
QT_END_NAMESPACE
-#endif // QT3D_QTHREADPOOLER_P_H
-
+#endif // QUICK3DRENDERTARGETSELECTOR_H
diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdata.cpp b/src/quick3d/quick3drenderer/items/quick3dshaderdata.cpp
index 1efc3b679..58587ba2e 100644
--- a/src/quick3d/quick3drenderer/items/quick3dshaderdata.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3dshaderdata.cpp
@@ -94,7 +94,7 @@ public:
};
Quick3DShaderData::Quick3DShaderData(QNode *parent)
- : QShaderData(*new QShaderDataPrivate(this, PropertyReaderInterfacePtr(new Quick3DShaderDataPropertyReader()))
+ : QShaderData(*new QShaderDataPrivate(PropertyReaderInterfacePtr(new Quick3DShaderDataPropertyReader()))
, parent)
{
}
diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.cpp b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.cpp
index 47ab0f231..2b636a319 100644
--- a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.cpp
@@ -48,15 +48,15 @@ namespace Quick {
class Quick3DShaderDataArrayPrivate : public QNodePrivate
{
public:
- Quick3DShaderDataArrayPrivate(Quick3DShaderDataArray *qq)
- : QNodePrivate(qq)
+ Quick3DShaderDataArrayPrivate()
+ : QNodePrivate()
{}
QList<QShaderData *> m_values;
};
Quick3DShaderDataArray::Quick3DShaderDataArray(QNode *parent)
- : QNode(*new Quick3DShaderDataArrayPrivate(this), parent)
+ : QNode(*new Quick3DShaderDataArrayPrivate, parent)
{
}
diff --git a/src/quick3d/quick3drenderer/items/quick3dstateset.cpp b/src/quick3d/quick3drenderer/items/quick3dstateset.cpp
new file mode 100644
index 000000000..fe51cb495
--- /dev/null
+++ b/src/quick3d/quick3drenderer/items/quick3dstateset.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dstateset.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+namespace Quick {
+
+Quick3DStateSet::Quick3DStateSet(QObject *parent)
+ : QObject(parent)
+{
+}
+
+Quick3DStateSet::~Quick3DStateSet()
+{
+}
+
+QQmlListProperty<QRenderState> Quick3DStateSet::renderStateList()
+{
+ return QQmlListProperty<Qt3D::QRenderState>(this, 0,
+ &Quick3DStateSet::appendRenderState,
+ &Quick3DStateSet::renderStateCount,
+ &Quick3DStateSet::renderStateAt,
+ &Quick3DStateSet::clearRenderStates);
+
+}
+
+void Quick3DStateSet::appendRenderState(QQmlListProperty<QRenderState> *list, QRenderState *state)
+{
+ Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object);
+ stateSet->parentStateSet()->addRenderState(state);
+}
+
+QRenderState *Quick3DStateSet::renderStateAt(QQmlListProperty<QRenderState> *list, int index)
+{
+ Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object);
+ return stateSet->parentStateSet()->renderStates().at(index);
+}
+
+int Quick3DStateSet::renderStateCount(QQmlListProperty<QRenderState> *list)
+{
+ Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object);
+ return stateSet->parentStateSet()->renderStates().count();
+}
+
+void Quick3DStateSet::clearRenderStates(QQmlListProperty<QRenderState> *list)
+{
+ Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object);
+ Q_FOREACH (QRenderState *s, stateSet->parentStateSet()->renderStates())
+ stateSet->parentStateSet()->removeRenderState(s);
+}
+
+} // Quick
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
diff --git a/src/quick3d/quick3drenderer/items/quick3dframegraphitem.h b/src/quick3d/quick3drenderer/items/quick3dstateset.h
index 56cdf4afb..6a352b21a 100644
--- a/src/quick3d/quick3drenderer/items/quick3dframegraphitem.h
+++ b/src/quick3d/quick3drenderer/items/quick3dstateset.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
@@ -34,11 +34,11 @@
**
****************************************************************************/
-#ifndef QT3D_RENDER_QUICK_QUICK3DFRAMEGRAPHITEM_H
-#define QT3D_RENDER_QUICK_QUICK3DFRAMEGRAPHITEM_H
+#ifndef QT3D_RENDER_QUICK_QUICK3DSTATESET_H
+#define QT3D_RENDER_QUICK_QUICK3DSTATESET_H
#include <Qt3DQuickRenderer/qt3dquickrenderer_global.h>
-#include <Qt3DRenderer/qframegraphnode.h>
+#include <Qt3DRenderer/qstateset.h>
#include <QQmlListProperty>
QT_BEGIN_NAMESPACE
@@ -49,23 +49,22 @@ namespace Render {
namespace Quick {
-class QT3DQUICKRENDERERSHARED_EXPORT Quick3DFrameGraphItem : public QObject
+class QT3DQUICKRENDERERSHARED_EXPORT Quick3DStateSet : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3D::QFrameGraphNode> frameGraphChildren READ frameGraphChildrenList)
- Q_CLASSINFO("DefaultProperty", "frameGraphChildren")
-
+ Q_PROPERTY(QQmlListProperty<Qt3D::QRenderState> renderStates READ renderStateList CONSTANT)
public:
- explicit Quick3DFrameGraphItem(QObject *parent = 0);
+ explicit Quick3DStateSet(QObject *parent = 0);
+ ~Quick3DStateSet();
- inline QFrameGraphNode *parentFrameGraphItem() const { return qobject_cast<QFrameGraphNode *>(parent()); }
- QQmlListProperty<QFrameGraphNode> frameGraphChildrenList();
+ QQmlListProperty<Qt3D::QRenderState> renderStateList();
+ inline QStateSet *parentStateSet() const { return qobject_cast<QStateSet *>(parent()); }
private:
- static void apprendFrameGraphItem(QQmlListProperty<QFrameGraphNode> *list, QFrameGraphNode *item);
- static QFrameGraphNode *frameGraphItemAt(QQmlListProperty<QFrameGraphNode> *list, int index);
- static int frameGraphItemsCount(QQmlListProperty<QFrameGraphNode> *list);
- static void clearFrameGraphItemList(QQmlListProperty<QFrameGraphNode> *list);
+ static void appendRenderState(QQmlListProperty<Qt3D::QRenderState> *list, QRenderState *state);
+ static QRenderState *renderStateAt(QQmlListProperty<Qt3D::QRenderState> *list, int index);
+ static int renderStateCount(QQmlListProperty<Qt3D::QRenderState> *list);
+ static void clearRenderStates(QQmlListProperty<Qt3D::QRenderState> *list);
};
} // Quick
@@ -76,4 +75,4 @@ private:
QT_END_NAMESPACE
-#endif // QT3D_RENDER_QUICK_QUICK3DFRAMEGRAPHITEM_H
+#endif // QT3D_RENDER_QUICK_QUICK3DSTATESET_H
diff --git a/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.cpp b/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.cpp
index 9fb91ea90..978a8486f 100644
--- a/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.cpp
+++ b/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.cpp
@@ -52,10 +52,19 @@ Quick3DTechniqueFilter::Quick3DTechniqueFilter(QObject *parent)
QQmlListProperty<Qt3D::QAnnotation> Quick3DTechniqueFilter::requireList()
{
return QQmlListProperty<Qt3D::QAnnotation>(this, 0,
- &Quick3DTechniqueFilter::appendRequire,
- &Quick3DTechniqueFilter::requiresCount,
- &Quick3DTechniqueFilter::requireAt,
- &Quick3DTechniqueFilter::clearRequires);
+ &Quick3DTechniqueFilter::appendRequire,
+ &Quick3DTechniqueFilter::requiresCount,
+ &Quick3DTechniqueFilter::requireAt,
+ &Quick3DTechniqueFilter::clearRequires);
+}
+
+QQmlListProperty<QParameter> Quick3DTechniqueFilter::parameterList()
+{
+ return QQmlListProperty<Qt3D::QParameter>(this, 0,
+ &Quick3DTechniqueFilter::appendParameter,
+ &Quick3DTechniqueFilter::parametersCount,
+ &Quick3DTechniqueFilter::parameterAt,
+ &Quick3DTechniqueFilter::clearParameterList);
}
void Quick3DTechniqueFilter::appendRequire(QQmlListProperty<QAnnotation> *list, QAnnotation *criterion)
@@ -92,6 +101,31 @@ void Quick3DTechniqueFilter::clearRequires(QQmlListProperty<QAnnotation> *list)
}
}
+void Quick3DTechniqueFilter::appendParameter(QQmlListProperty<QParameter> *list, QParameter *param)
+{
+ Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object);
+ techniqueFilter->parentTechniqueFilter()->addParameter(param);
+}
+
+QParameter *Quick3DTechniqueFilter::parameterAt(QQmlListProperty<QParameter> *list, int index)
+{
+ Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object);
+ return techniqueFilter->parentTechniqueFilter()->parameters().at(index);
+}
+
+int Quick3DTechniqueFilter::parametersCount(QQmlListProperty<QParameter> *list)
+{
+ Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object);
+ return techniqueFilter->parentTechniqueFilter()->parameters().count();
+}
+
+void Quick3DTechniqueFilter::clearParameterList(QQmlListProperty<QParameter> *list)
+{
+ Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object);
+ Q_FOREACH (QParameter *p, techniqueFilter->parentTechniqueFilter()->parameters())
+ techniqueFilter->parentTechniqueFilter()->removeParameter(p);
+}
+
} // Quick
} // Render
diff --git a/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.h b/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.h
index cadc83cff..849c4c4f2 100644
--- a/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.h
+++ b/src/quick3d/quick3drenderer/items/quick3dtechniquefilter.h
@@ -55,10 +55,13 @@ class QT3DQUICKRENDERERSHARED_EXPORT Quick3DTechniqueFilter : public QObject
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<Qt3D::QAnnotation> requires READ requireList)
+ Q_PROPERTY(QQmlListProperty<Qt3D::QParameter> parameters READ parameterList)
public:
explicit Quick3DTechniqueFilter(QObject *parent = 0);
+
QQmlListProperty<Qt3D::QAnnotation> requireList();
+ QQmlListProperty<Qt3D::QParameter> parameterList();
inline QTechniqueFilter *parentTechniqueFilter() const { return qobject_cast<Qt3D::QTechniqueFilter*>(parent()); }
@@ -68,6 +71,10 @@ private:
static int requiresCount(QQmlListProperty<QAnnotation> *list);
static void clearRequires(QQmlListProperty<QAnnotation> *list);
+ static void appendParameter(QQmlListProperty<QParameter> *list, QParameter *param);
+ static QParameter *parameterAt(QQmlListProperty<QParameter> *list, int index);
+ static int parametersCount(QQmlListProperty<QParameter> *list);
+ static void clearParameterList(QQmlListProperty<QParameter> *list);
};
} // Quick
diff --git a/src/render/backend/attachmentpack.cpp b/src/render/backend/attachmentpack.cpp
index 03bd723e3..95bdb3c0c 100644
--- a/src/render/backend/attachmentpack.cpp
+++ b/src/render/backend/attachmentpack.cpp
@@ -56,6 +56,16 @@ QVector<Attachment> AttachmentPack::attachments() const
return m_attachments;
}
+QList<QRenderAttachment::RenderAttachmentType> AttachmentPack::drawBuffers() const
+{
+ return m_drawBuffers;
+}
+
+void AttachmentPack::setDrawBuffers(const QList<QRenderAttachment::RenderAttachmentType> &drawBuffers)
+{
+ m_drawBuffers = drawBuffers;
+}
+
Attachment::Attachment()
: m_mipLevel(0)
, m_layer(0)
diff --git a/src/render/backend/attachmentpack_p.h b/src/render/backend/attachmentpack_p.h
index c2fcb34e4..74c5d6430 100644
--- a/src/render/backend/attachmentpack_p.h
+++ b/src/render/backend/attachmentpack_p.h
@@ -64,9 +64,13 @@ public:
void addAttachment(const Attachment &attachment);
QVector<Attachment> attachments() const;
+ QList<QRenderAttachment::RenderAttachmentType> drawBuffers() const;
+
+ void setDrawBuffers(const QList<QRenderAttachment::RenderAttachmentType> &drawBuffers);
private:
QVector<Attachment> m_attachments;
+ QList<QRenderAttachment::RenderAttachmentType> m_drawBuffers;
};
} // Render
diff --git a/src/render/backend/framegraph/framegraph.pri b/src/render/backend/framegraph/framegraph.pri
index 129a73a61..51dfdc88e 100644
--- a/src/render/backend/framegraph/framegraph.pri
+++ b/src/render/backend/framegraph/framegraph.pri
@@ -10,7 +10,9 @@ HEADERS += \
$$PWD/clearbuffer_p.h \
$$PWD/sortmethod_p.h \
$$PWD/sortcriterion_p.h \
- $$PWD/framegraphsubtreeselector_p.h
+ $$PWD/framegraphsubtreeselector_p.h \
+ $$PWD/statesetnode_p.h \
+ $$PWD/nodraw_p.h
SOURCES += \
$$PWD/cameraselectornode.cpp \
@@ -24,6 +26,8 @@ SOURCES += \
$$PWD/clearbuffer.cpp \
$$PWD/sortmethod.cpp \
$$PWD/sortcriterion.cpp \
- $$PWD/framegraphsubtreeselector.cpp
+ $$PWD/framegraphsubtreeselector.cpp \
+ $$PWD/statesetnode.cpp \
+ $$PWD/nodraw.cpp
INCLUDEPATH += $$PWD
diff --git a/src/render/backend/framegraph/framegraphnode_p.h b/src/render/backend/framegraph/framegraphnode_p.h
index a36857ce2..b17401ede 100644
--- a/src/render/backend/framegraph/framegraphnode_p.h
+++ b/src/render/backend/framegraph/framegraphnode_p.h
@@ -67,7 +67,9 @@ public:
Viewport,
ClearBuffer,
SortMethod,
- SubtreeSelector
+ SubtreeSelector,
+ StateSet,
+ NoDraw
};
FrameGraphNodeType nodeType() const { return m_nodeType; }
@@ -143,8 +145,9 @@ protected:
backend->setFrameGraphManager(m_manager);
backend->setHandle(handle);
backend->setPeer(f);
- if (qobject_cast<QFrameGraphNode *>(n->parentNode()))
- backend->setParentHandle(m_manager->lookupHandle(n->parentNode()->id()));
+ QFrameGraphNode *parentFGNode = static_cast<QFrameGraphNode *>(n)->parentFrameGraphNode();
+ if (parentFGNode)
+ backend->setParentHandle(m_manager->lookupHandle(parentFGNode->id()));
return backend;
}
return static_cast<Backend *>(*m_manager->data(handle));
diff --git a/src/core/jobs/jobrunner.cpp b/src/render/backend/framegraph/nodraw.cpp
index ab5555585..bffc1a8fc 100644
--- a/src/core/jobs/jobrunner.cpp
+++ b/src/render/backend/framegraph/nodraw.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
@@ -34,58 +34,37 @@
**
****************************************************************************/
-#include "jobrunner_p.h"
-#include "qthreadpooler_p.h"
-
-#include <QtCore/QThread>
-#include <QtCore/QMutexLocker>
-#include <QtCore/QAtomicInt>
+#include "nodraw_p.h"
+#include <Qt3DRenderer/qnodraw.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-JobRunner::JobRunner(QThreadPooler *parent)
- : QThread(parent),
- m_abort(0),
- m_pooler(parent),
- m_jobAvailable(Q_NULLPTR),
- m_mutex(Q_NULLPTR)
-{
- QObject::connect(parent, SIGNAL(shuttingDown()), this, SLOT(shutDown()));
-}
+namespace Render {
-JobRunner::~JobRunner()
+NoDraw::NoDraw()
+ : FrameGraphNode(FrameGraphNode::NoDraw)
{
- shutDown();
}
-void JobRunner::run()
+NoDraw::~NoDraw()
{
- Q_ASSERT(m_jobAvailable != Q_NULLPTR);
-
- while (!m_abort.load()) {
- if (const QSharedPointer<TaskInterface> task = m_pooler->nextTask()) {
- task->run(task, this);
- m_pooler->stopRunning();
- } else {
- suspend();
- }
- }
}
-void JobRunner::suspend()
+void NoDraw::updateFromPeer(QNode *peer)
{
- const QMutexLocker locker(m_mutex);
-
- m_jobAvailable->wait(m_mutex);
+ QNoDraw *noDraw = static_cast<QNoDraw *>(peer);
+ setEnabled(noDraw->isEnabled());
}
-void JobRunner::shutDown()
+void NoDraw::sceneChangeEvent(const QSceneChangePtr &e)
{
- m_abort.store(1);
+ Q_UNUSED(e);
}
-} // namespace Qt3D
+} // Render
+
+} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/backend/framegraph/nodraw_p.h b/src/render/backend/framegraph/nodraw_p.h
new file mode 100644
index 000000000..1d9a53a1c
--- /dev/null
+++ b/src/render/backend/framegraph/nodraw_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <Qt3DRenderer/private/framegraphnode_p.h>
+
+#ifndef QT3D_RENDER_NODRAW_H
+#define QT3D_RENDER_NODRAW_H
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+class NoDraw : public FrameGraphNode
+{
+public:
+ NoDraw();
+ ~NoDraw();
+
+ void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
+
+protected:
+ void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
+};
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_RENDER_NODRAW_H
diff --git a/src/render/backend/framegraph/renderpassfilternode.cpp b/src/render/backend/framegraph/renderpassfilternode.cpp
index 7c3431047..dd2e87060 100644
--- a/src/render/backend/framegraph/renderpassfilternode.cpp
+++ b/src/render/backend/framegraph/renderpassfilternode.cpp
@@ -38,6 +38,7 @@
#include "qannotation.h"
#include "qrenderpassfilter.h"
#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRenderer/qparameter.h>
QT_BEGIN_NAMESPACE
@@ -53,9 +54,12 @@ void RenderPassFilter::updateFromPeer(QNode *peer)
{
QRenderPassFilter *filter = static_cast<QRenderPassFilter *>(peer);
m_filters.clear();
+ m_parameterPack.clear();
setEnabled(filter->isEnabled());
Q_FOREACH (QAnnotation *criterion, filter->includes())
appendFilter(criterion);
+ Q_FOREACH (QParameter *p, filter->parameters())
+ m_parameterPack.appendParameter(p->id());
}
QList<QNodeId> RenderPassFilter::filters() const
@@ -74,6 +78,11 @@ void RenderPassFilter::removeFilter(const QNodeId &criterionId)
m_filters.removeOne(criterionId);
}
+QList<QNodeId> RenderPassFilter::parameters() const
+{
+ return m_parameterPack.parameters();
+}
+
void RenderPassFilter::sceneChangeEvent(const QSceneChangePtr &e)
{
QScenePropertyChangePtr propertyChange = qSharedPointerCast<QScenePropertyChange>(e);
@@ -88,11 +97,15 @@ void RenderPassFilter::sceneChangeEvent(const QSceneChangePtr &e)
case NodeAdded: {
if (propertyChange->propertyName() == QByteArrayLiteral("include"))
appendFilter(propertyChange->value().value<QAnnotation *>());
+ else if (propertyChange->propertyName() == QByteArrayLiteral("parameter"))
+ m_parameterPack.appendParameter(propertyChange->value().value<QNodeId>());
}
break;
case NodeRemoved: {
if (propertyChange->propertyName() == QByteArrayLiteral("include"))
removeFilter(propertyChange->value().value<QNodeId>());
+ else if (propertyChange->propertyName() == QByteArrayLiteral("parameter"))
+ m_parameterPack.removeParameter(propertyChange->value().value<QNodeId>());
}
break;
default:
diff --git a/src/render/backend/framegraph/renderpassfilternode_p.h b/src/render/backend/framegraph/renderpassfilternode_p.h
index 3fdf2257d..80e577cc9 100644
--- a/src/render/backend/framegraph/renderpassfilternode_p.h
+++ b/src/render/backend/framegraph/renderpassfilternode_p.h
@@ -38,6 +38,7 @@
#define QT3D_RENDER_RENDERPASSFILTER_H
#include <Qt3DRenderer/private/framegraphnode_p.h>
+#include <Qt3DRenderer/private/parameterpack_p.h>
#include <QList>
QT_BEGIN_NAMESPACE
@@ -60,12 +61,14 @@ public:
void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
QList<QNodeId> filters() const;
+ QList<QNodeId> parameters() const;
void appendFilter(QAnnotation *criterion);
void removeFilter(const QNodeId &criterionId);
void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
private:
QList<QNodeId> m_filters;
+ ParameterPack m_parameterPack;
};
} // namespace Render
diff --git a/src/render/backend/framegraph/rendertargetselectornode.cpp b/src/render/backend/framegraph/rendertargetselectornode.cpp
index 59dd1c5a4..d8f696913 100644
--- a/src/render/backend/framegraph/rendertargetselectornode.cpp
+++ b/src/render/backend/framegraph/rendertargetselectornode.cpp
@@ -42,6 +42,7 @@
#include <Qt3DRenderer/qrendertarget.h>
#include <Qt3DCore/qscenepropertychange.h>
#include <Qt3DRenderer/private/renderlogging_p.h>
+#include <Qt3DRenderer/qrenderattachment.h>
QT_BEGIN_NAMESPACE
@@ -60,6 +61,7 @@ void RenderTargetSelector::updateFromPeer(QNode *peer)
if (selector->target() != Q_NULLPTR)
m_renderTargetUuid = selector->target()->id();
setEnabled(selector->isEnabled());
+ m_drawBuffers = selector->drawBuffers();
}
void RenderTargetSelector::sceneChangeEvent(const QSceneChangePtr &e)
@@ -71,6 +73,8 @@ void RenderTargetSelector::sceneChangeEvent(const QSceneChangePtr &e)
m_renderTargetUuid = propertyChange->value().value<QNodeId>();
else if (propertyChange->propertyName() == QByteArrayLiteral("enabled"))
setEnabled(propertyChange->value().toBool());
+ else if (propertyChange->propertyName() == QByteArrayLiteral("drawBuffers"))
+ m_drawBuffers = propertyChange->value().value<QList<Qt3D::QRenderAttachment::RenderAttachmentType> >();
}
}
@@ -79,6 +83,11 @@ QNodeId RenderTargetSelector::renderTargetUuid() const
return m_renderTargetUuid;
}
+QList<QRenderAttachment::RenderAttachmentType> RenderTargetSelector::drawBuffers() const
+{
+ return m_drawBuffers;
+}
+
} // Render
} // Qt3D
diff --git a/src/render/backend/framegraph/rendertargetselectornode_p.h b/src/render/backend/framegraph/rendertargetselectornode_p.h
index 0b6089ae0..adbd8b041 100644
--- a/src/render/backend/framegraph/rendertargetselectornode_p.h
+++ b/src/render/backend/framegraph/rendertargetselectornode_p.h
@@ -55,9 +55,11 @@ public:
void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
QNodeId renderTargetUuid() const;
+ QList<QRenderAttachment::RenderAttachmentType> drawBuffers() const;
private:
QNodeId m_renderTargetUuid;
+ QList<QRenderAttachment::RenderAttachmentType> m_drawBuffers;
};
} // Render
diff --git a/src/render/backend/framegraph/statesetnode.cpp b/src/render/backend/framegraph/statesetnode.cpp
new file mode 100644
index 000000000..181e31fa4
--- /dev/null
+++ b/src/render/backend/framegraph/statesetnode.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "statesetnode_p.h"
+
+#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRenderer/qstateset.h>
+#include <Qt3DRenderer/private/renderstate_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+StateSetNode::StateSetNode()
+ : FrameGraphNode(FrameGraphNode::StateSet)
+{
+}
+
+StateSetNode::~StateSetNode()
+{
+}
+
+void StateSetNode::updateFromPeer(QNode *peer)
+{
+ QStateSet *stateSet = static_cast<QStateSet*>(peer);
+
+ setEnabled(stateSet->isEnabled());
+ Q_FOREACH (QRenderState *renderState, stateSet->renderStates())
+ appendRenderState(renderState->id(), RenderState::getOrCreateBackendState(renderState));
+}
+
+QList<RenderState *> StateSetNode::renderStates() const
+{
+ return m_renderStates.values();
+}
+
+void StateSetNode::sceneChangeEvent(const QSceneChangePtr &e)
+{
+ QScenePropertyChangePtr propertyChange = qSharedPointerCast<QScenePropertyChange>(e);
+ switch (e->type()) {
+ case NodeAdded: {
+ if (propertyChange->propertyName() == QByteArrayLiteral("renderState")) {
+ QNodePtr nodePtr = propertyChange->value().value<QNodePtr>();
+ QRenderState *renderState = static_cast<QRenderState *>(nodePtr.data());
+ appendRenderState(renderState->id(), RenderState::getOrCreateBackendState(renderState));
+ }
+ }
+ break;
+
+ case NodeRemoved: {
+ if (propertyChange->propertyName() == QByteArrayLiteral("renderState"))
+ removeRenderState(propertyChange->value().value<QNodeId>());
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+void StateSetNode::appendRenderState(const QNodeId &id, RenderState *renderState)
+{
+ if (!m_renderStates.contains(id))
+ m_renderStates[id] = renderState;
+}
+
+void StateSetNode::removeRenderState(const QNodeId &renderStateId)
+{
+ m_renderStates.remove(renderStateId);
+}
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/render/backend/framegraph/statesetnode_p.h b/src/render/backend/framegraph/statesetnode_p.h
new file mode 100644
index 000000000..af6de5e8c
--- /dev/null
+++ b/src/render/backend/framegraph/statesetnode_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_RENDER_STATESETNODE_H
+#define QT3D_RENDER_STATESETNODE_H
+
+#include <Qt3DRenderer/private/framegraphnode_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+class StateSetNode : public FrameGraphNode
+{
+public:
+ StateSetNode();
+ ~StateSetNode();
+
+ void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
+
+ QList<RenderState *> renderStates() const;
+
+protected:
+ void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
+
+ void appendRenderState(const QNodeId &id, RenderState *renderState);
+ void removeRenderState(const QNodeId &renderStateId);
+
+ QHash<QNodeId, RenderState *> m_renderStates;
+};
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_RENDER_STATESETNODE_H
diff --git a/src/render/backend/framegraph/techniquefilternode.cpp b/src/render/backend/framegraph/techniquefilternode.cpp
index c9256ea87..9f8bd3c78 100644
--- a/src/render/backend/framegraph/techniquefilternode.cpp
+++ b/src/render/backend/framegraph/techniquefilternode.cpp
@@ -39,6 +39,7 @@
#include "qtechniquefilter.h"
#include <Qt3DRenderer/private/managers_p.h>
#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRenderer/qparameter.h>
QT_BEGIN_NAMESPACE
@@ -54,11 +55,19 @@ void TechniqueFilter::updateFromPeer(QNode *peer)
{
QTechniqueFilter *filter = static_cast<QTechniqueFilter *>(peer);
m_filters.clear();
+ m_parameterPack.clear();
Q_FOREACH (QAnnotation *criterion, filter->criteria())
appendFilter(criterion);
+ Q_FOREACH (QParameter *p, filter->parameters())
+ m_parameterPack.appendParameter(p->id());
setEnabled(filter->isEnabled());
}
+QList<QNodeId> TechniqueFilter::parameters() const
+{
+ return m_parameterPack.parameters();
+}
+
QList<QNodeId> TechniqueFilter::filters() const
{
return m_filters;
@@ -89,11 +98,15 @@ void TechniqueFilter::sceneChangeEvent(const QSceneChangePtr &e)
case NodeAdded: {
if (propertyChange->propertyName() == QByteArrayLiteral("require"))
appendFilter(propertyChange->value().value<QAnnotation *>());
+ else if (propertyChange->propertyName() == QByteArrayLiteral("parameter"))
+ m_parameterPack.appendParameter(propertyChange->value().value<QNodeId>());
}
break;
case NodeRemoved: {
if (propertyChange->propertyName() == QByteArrayLiteral("require"))
removeFilter(propertyChange->value().value<QNodeId>());
+ else if (propertyChange->propertyName() == QByteArrayLiteral("parameter"))
+ m_parameterPack.removeParameter(propertyChange->value().value<QNodeId>());
}
break;
default:
diff --git a/src/render/backend/framegraph/techniquefilternode_p.h b/src/render/backend/framegraph/techniquefilternode_p.h
index 1d4338d37..af32e991c 100644
--- a/src/render/backend/framegraph/techniquefilternode_p.h
+++ b/src/render/backend/framegraph/techniquefilternode_p.h
@@ -38,6 +38,7 @@
#define QT3D_RENDER_TECHNIQUEFILTER_H
#include <Qt3DRenderer/private/framegraphnode_p.h>
+#include <Qt3DRenderer/private/parameterpack_p.h>
#include <QList>
#include <QString>
@@ -62,6 +63,8 @@ public:
TechniqueFilter();
void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
+ QList<QNodeId> parameters() const;
+
QList<QNodeId> filters() const;
void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
@@ -70,6 +73,7 @@ private:
void removeFilter(const QNodeId &criterionId);
QList<QNodeId> m_filters;
+ ParameterPack m_parameterPack;
};
} // Render
diff --git a/src/render/backend/jobs/renderviewjob.cpp b/src/render/backend/jobs/renderviewjob.cpp
index c263a66b8..9115b90ed 100644
--- a/src/render/backend/jobs/renderviewjob.cpp
+++ b/src/render/backend/jobs/renderviewjob.cpp
@@ -67,8 +67,9 @@ void RenderViewJob::run()
setRenderViewConfigFromFrameGraphLeafNode(renderView, m_fgLeaf);
// Build RenderCommand should perform the culling as we have no way to determine
- // if a child has a mesh in the view frustrum while its parent isn't contained in it.
- renderView->buildRenderCommands(m_renderer->renderSceneRoot());
+ // if a child has a mesh in the view frustum while its parent isn't contained in it.
+ if (!renderView->noDraw())
+ renderView->buildRenderCommands(m_renderer->renderSceneRoot());
// Sorts RenderCommand
renderView->sort();
diff --git a/src/render/backend/jobs/renderviewjobutils.cpp b/src/render/backend/jobs/renderviewjobutils.cpp
index 8093b87df..231b0c1bd 100644
--- a/src/render/backend/jobs/renderviewjobutils.cpp
+++ b/src/render/backend/jobs/renderviewjobutils.cpp
@@ -56,6 +56,7 @@
#include <Qt3DRenderer/private/shadervariables_p.h>
#include <Qt3DRenderer/private/managers_p.h>
#include <Qt3DRenderer/private/rendershaderdata_p.h>
+#include <Qt3DRenderer/private/statesetnode_p.h>
QT_BEGIN_NAMESPACE
@@ -111,7 +112,8 @@ void setRenderViewConfigFromFrameGraphLeafNode(RenderView *rv, const FrameGraphN
case FrameGraphNode::RenderTarget: {
// Can be set once and we take render target nearest to the leaf node
- QNodeId renderTargetUid = static_cast<const RenderTargetSelector *>(node)->renderTargetUuid();
+ const RenderTargetSelector *targetSelector = static_cast<const RenderTargetSelector *>(node);
+ QNodeId renderTargetUid = targetSelector->renderTargetUuid();
HTarget renderTargetHandle = renderer->renderTargetManager()->lookupHandle(renderTargetUid);
if (rv->renderTargetHandle().isNull()) {
rv->setRenderTargetHandle(renderTargetHandle);
@@ -119,11 +121,17 @@ void setRenderViewConfigFromFrameGraphLeafNode(RenderView *rv, const FrameGraphN
RenderTarget *renderTarget = renderer->renderTargetManager()->data(renderTargetHandle);
if (renderTarget) {
// Add renderTarget Handle and build renderCommand AttachmentPack
+
+ // Copy draw buffers list
+ rv->setDrawBuffers(targetSelector->drawBuffers());
+
+ // Copy attachments
Q_FOREACH (const QNodeId &attachmentId, renderTarget->renderAttachments()) {
RenderAttachment *attachment = renderer->attachmentManager()->lookupResource(attachmentId);
if (attachment)
rv->addRenderAttachment(attachment->attachment());
}
+
}
}
break;
@@ -164,6 +172,18 @@ void setRenderViewConfigFromFrameGraphLeafNode(RenderView *rv, const FrameGraphN
// in a prior step to build the list of RenderViewJobs
break;
+ case FrameGraphNode::StateSet: {
+ const Render::StateSetNode *rStateSet = static_cast<const Render::StateSetNode *>(node);
+ // Create global RenderStateSet for renderView
+ rv->setStateSet(buildRenderStateSet(rStateSet->renderStates(), rv->allocator()));
+ break;
+ }
+
+ case FrameGraphNode::NoDraw: {
+ rv->setNoDraw(true);
+ break;
+ }
+
default:
// Should never get here
qCWarning(Backend) << "Unhandled FrameGraphNode type";
@@ -290,7 +310,7 @@ ParameterInfoList::iterator findParamInfo(ParameterInfoList *params, const QStri
return it;
}
-static void addParametersForIds(ParameterInfoList *params, ParameterManager *manager,
+void addParametersForIds(ParameterInfoList *params, ParameterManager *manager,
const QList<QNodeId> &parameterIds)
{
Q_FOREACH (const QNodeId &paramId, parameterIds) {
@@ -317,24 +337,16 @@ void parametersFromMaterialEffectTechnique(ParameterInfoList *infoList,
//
// That way a user can override defaults in Effect's and Techniques on a
// object manner and a Technique can override global defaults from the Effect.
- if (material)
- addParametersForIds(infoList, manager, material->parameters());
-
- if (technique)
- addParametersForIds(infoList, manager, technique->parameters());
-
- if (effect)
- addParametersForIds(infoList, manager, effect->parameters());
+ parametersFromParametersProvider(infoList, manager, material);
+ parametersFromParametersProvider(infoList, manager, technique);
+ parametersFromParametersProvider(infoList, manager, effect);
}
-RenderStateSet *buildRenderStateSet(RenderRenderPass *pass, QFrameAllocator *allocator)
+RenderStateSet *buildRenderStateSet(const QList<RenderState*> &states, QFrameAllocator *allocator)
{
- if (!pass || pass->renderStates().isEmpty())
- return Q_NULLPTR;
-
RenderStateSet *stateSet = allocator->allocate<RenderStateSet>();
- Q_FOREACH (RenderState *renderState, pass->renderStates()) {
+ Q_FOREACH (RenderState *renderState, states) {
stateSet->addState(renderState);
}
diff --git a/src/render/backend/jobs/renderviewjobutils_p.h b/src/render/backend/jobs/renderviewjobutils_p.h
index 6c2f64562..9bfe0fa8f 100644
--- a/src/render/backend/jobs/renderviewjobutils_p.h
+++ b/src/render/backend/jobs/renderviewjobutils_p.h
@@ -38,7 +38,7 @@
#define QT3D_RENDERVIEWJOBUTILS_P_H
#include <Qt3DRenderer/qt3drenderer_global.h>
-
+#include <Qt3DCore/qnodeid.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
@@ -63,6 +63,7 @@ class Renderer;
class ShaderDataManager;
struct ShaderUniform;
class RenderShaderData;
+class RenderState;
Q_AUTOTEST_EXPORT void setRenderViewConfigFromFrameGraphLeafNode(RenderView *rv,
const FrameGraphNode *fgLeaf);
@@ -79,8 +80,8 @@ Q_AUTOTEST_EXPORT RenderRenderPassList findRenderPassesForTechnique(Renderer *re
struct ParameterInfo
{
ParameterInfo(const QString &name = QString(), const QVariant &value = QVariant())
- : name(name)
- , value(value)
+ : name(name)
+ , value(value)
{}
QString name;
@@ -100,10 +101,26 @@ Q_AUTOTEST_EXPORT void parametersFromMaterialEffectTechnique(ParameterInfoList *
RenderEffect *effect,
RenderTechnique *technique);
+Q_AUTOTEST_EXPORT void parametersFromRenderPass(ParameterInfoList *infoList,
+ ParameterManager *manager,
+ RenderRenderPass *pass);
+
+Q_AUTOTEST_EXPORT void addParametersForIds(ParameterInfoList *params, ParameterManager *manager,
+ const QList<QNodeId> &parameterIds);
+
+template<class T>
+void parametersFromParametersProvider(ParameterInfoList *infoList,
+ ParameterManager *manager,
+ T *pass)
+{
+ if (pass)
+ addParametersForIds(infoList, manager, pass->parameters());
+}
+
Q_AUTOTEST_EXPORT ParameterInfoList::iterator findParamInfo(ParameterInfoList *infoList,
const QString &name);
-Q_AUTOTEST_EXPORT RenderStateSet *buildRenderStateSet(RenderRenderPass *pass,
+Q_AUTOTEST_EXPORT RenderStateSet *buildRenderStateSet(const QList<RenderState*> &states,
QFrameAllocator *allocator);
@@ -113,8 +130,8 @@ struct Q_AUTOTEST_EXPORT UniformBlockValueBuilder
~UniformBlockValueBuilder();
void buildActiveUniformNameValueMapHelper(const QString &blockName,
- const QString &qmlPropertyName,
- const QVariant &value);
+ const QString &qmlPropertyName,
+ const QVariant &value);
void buildActiveUniformNameValueMapStructHelper(RenderShaderData *rShaderData,
const QString &blockName,
const QString &qmlPropertyName = QString());
diff --git a/src/render/backend/qgraphicscontext.cpp b/src/render/backend/qgraphicscontext.cpp
index 3b0df7691..9860bc63a 100644
--- a/src/render/backend/qgraphicscontext.cpp
+++ b/src/render/backend/qgraphicscontext.cpp
@@ -132,7 +132,7 @@ void QGraphicsContext::initialize()
qCDebug(Backend) << "VAO support = " << m_supportsVAO;
}
-bool QGraphicsContext::beginDrawing(QSurface *surface, const QColor &clearColor)
+bool QGraphicsContext::beginDrawing(QSurface *surface, const QColor &color)
{
Q_ASSERT(surface);
Q_ASSERT(m_gl);
@@ -156,7 +156,7 @@ bool QGraphicsContext::beginDrawing(QSurface *surface, const QColor &clearColor)
initialize();
}
- m_gl->functions()->glClearColor(clearColor.redF(), clearColor.greenF(), clearColor.blueF(), clearColor.alphaF());
+ clearColor(color);
if (m_activeShader)
m_activeShader = NULL;
@@ -203,6 +203,10 @@ void QGraphicsContext::setViewport(const QRectF &viewport)
return;
} else {
renderTargetSize = m_surface->size();
+ if (m_surface->surfaceClass() == QSurface::Window) {
+ int dpr = static_cast<QWindow *>(m_surface)->devicePixelRatio();
+ renderTargetSize *= dpr;
+ }
}
// Qt3D 0------------------> 1 OpenGL 1^
@@ -324,13 +328,14 @@ void QGraphicsContext::activateRenderTarget(RenderTarget *renderTarget, const At
}
m_activeFBO = fboId;
m_glHelper->bindFrameBufferObject(m_activeFBO);
+ // Set active drawBuffers
+ activateDrawBuffers(attachments);
}
void QGraphicsContext::bindFrameBufferAttachmentHelper(GLuint fboId, const AttachmentPack &attachments)
{
// Set FBO attachments
- int drawBuffers[QRenderAttachment::ColorAttachment15 + 1];
- int i = 0;
+
QSize fboSize;
Q_FOREACH (const Attachment &attachment, attachments.attachments()) {
RenderTexture *rTex = m_renderer->textureManager()->lookupResource(attachment.m_textureUuid);
@@ -342,23 +347,40 @@ void QGraphicsContext::bindFrameBufferAttachmentHelper(GLuint fboId, const Attac
else
fboSize = QSize(qMin(fboSize.width(), glTex->width()), qMin(fboSize.width(), glTex->width()));
m_glHelper->bindFrameBufferAttachment(glTex, attachment);
- if (attachment.m_type <= QRenderAttachment::ColorAttachment15)
- drawBuffers[i++] = attachment.m_type;
}
}
}
+ m_renderTargetsSize.insert(fboId, fboSize);
+}
+
+void QGraphicsContext::activateDrawBuffers(const AttachmentPack &attachments)
+{
+ int activeDrawBuffers[QRenderAttachment::ColorAttachment15 + 1];
+ int i = 0;
+
+ const QList<QRenderAttachment::RenderAttachmentType> &drawBuffers = attachments.drawBuffers();
+
+ // If drawBuffers is empty, use all the attachments as draw buffers
+ if (drawBuffers.isEmpty()) {
+ Q_FOREACH (const Attachment &attachment, attachments.attachments())
+ if (attachment.m_type <= QRenderAttachment::ColorAttachment15)
+ activeDrawBuffers[i++] = attachment.m_type;
+ } else {
+ Q_FOREACH (const QRenderAttachment::RenderAttachmentType drawBuffer, drawBuffers)
+ if (drawBuffer <= QRenderAttachment::ColorAttachment15)
+ activeDrawBuffers[i++] = drawBuffer;
+ }
+
if (m_glHelper->checkFrameBufferComplete()) {
if (i > 1) {// We need MRT
if (m_glHelper->supportsFeature(QGraphicsHelperInterface::MRT)) {
// Set up MRT, glDrawBuffers...
- m_glHelper->drawBuffers(i, drawBuffers);
+ m_glHelper->drawBuffers(i, activeDrawBuffers);
}
- qDebug() << "FBO Complete";
}
} else {
qWarning() << "FBO incomplete";
}
- m_renderTargetsSize.insert(fboId, fboSize);
}
@@ -628,9 +650,14 @@ GLuint QGraphicsContext::boundFrameBufferObject()
return m_glHelper->boundFrameBufferObject();
}
+void QGraphicsContext::clearColor(const QColor &color)
+{
+ m_gl->functions()->glClearColor(color.redF(), color.greenF(), color.blueF(), color.alphaF());
+}
+
/*!
\internal
- \returns a texture unit for a texture, -1 if all texture units are assigned.
+ Returns a texture unit for a texture, -1 if all texture units are assigned.
Tries to use the texture unit with the texture that hasn't been used for the longest time
if the texture happens not to be already pinned on a texture unit.
*/
diff --git a/src/render/backend/qgraphicscontext_p.h b/src/render/backend/qgraphicscontext_p.h
index 6cae74612..33eaff7a3 100644
--- a/src/render/backend/qgraphicscontext_p.h
+++ b/src/render/backend/qgraphicscontext_p.h
@@ -90,7 +90,7 @@ public:
int id() const; // unique, small integer ID of this context
- bool beginDrawing(QSurface *surface, const QColor &clearColor);
+ bool beginDrawing(QSurface *surface, const QColor &color);
void clearBackBuffer(QClearBuffer::BufferType buffers);
void endDrawing(bool swapBuffers);
@@ -178,6 +178,7 @@ public:
void enableAlphaCoverage();
void disableAlphaCoverage();
GLuint boundFrameBufferObject();
+ void clearColor(const QColor &color);
// Helper methods
static GLint elementType(GLint type);
@@ -197,6 +198,7 @@ private:
void resolveHighestOpenGLFunctions();
void bindFrameBufferAttachmentHelper(GLuint fboId, const AttachmentPack &attachments);
+ void activateDrawBuffers(const AttachmentPack &attachments);
bool m_initialized;
const unsigned int m_id;
diff --git a/src/render/backend/qgraphicshelperes2.cpp b/src/render/backend/qgraphicshelperes2.cpp
index 37cac786d..04fe7130d 100644
--- a/src/render/backend/qgraphicshelperes2.cpp
+++ b/src/render/backend/qgraphicshelperes2.cpp
@@ -159,6 +159,7 @@ QVector<ShaderAttribute> QGraphicsHelperES2::programAttributesAndLocations(GLuin
QVector<ShaderAttribute> attributes;
GLint nbrActiveAttributes = 0;
m_funcs->glGetProgramiv(programId, GL_ACTIVE_ATTRIBUTES, &nbrActiveAttributes);
+ attributes.reserve(nbrActiveAttributes);
for (GLint i = 0; i < nbrActiveAttributes; i++) {
ShaderAttribute attribute;
QByteArray attributeName(256, '\0');
diff --git a/src/render/backend/qgraphicshelpergl2.cpp b/src/render/backend/qgraphicshelpergl2.cpp
index e047e14a7..2adae7861 100644
--- a/src/render/backend/qgraphicshelpergl2.cpp
+++ b/src/render/backend/qgraphicshelpergl2.cpp
@@ -152,6 +152,7 @@ QVector<ShaderAttribute> QGraphicsHelperGL2::programAttributesAndLocations(GLuin
QVector<ShaderAttribute> attributes;
GLint nbrActiveAttributes = 0;
m_funcs->glGetProgramiv(programId, GL_ACTIVE_ATTRIBUTES, &nbrActiveAttributes);
+ attributes.reserve(nbrActiveAttributes);
for (GLint i = 0; i < nbrActiveAttributes; i++) {
ShaderAttribute attribute;
QByteArray attributeName(256, '\0');
diff --git a/src/render/backend/qgraphicshelpergl3.cpp b/src/render/backend/qgraphicshelpergl3.cpp
index cd2a5033b..f82335ae4 100644
--- a/src/render/backend/qgraphicshelpergl3.cpp
+++ b/src/render/backend/qgraphicshelpergl3.cpp
@@ -164,6 +164,7 @@ QVector<ShaderAttribute> QGraphicsHelperGL3::programAttributesAndLocations(GLuin
QVector<ShaderAttribute> attributes;
GLint nbrActiveAttributes = 0;
m_funcs->glGetProgramiv(programId, GL_ACTIVE_ATTRIBUTES, &nbrActiveAttributes);
+ attributes.reserve(nbrActiveAttributes);
for (GLint i = 0; i < nbrActiveAttributes; i++) {
ShaderAttribute attribute;
QByteArray attributeName(256, '\0');
diff --git a/src/render/backend/qrenderaspect.cpp b/src/render/backend/qrenderaspect.cpp
index ec81f3684..3a98ccc07 100644
--- a/src/render/backend/qrenderaspect.cpp
+++ b/src/render/backend/qrenderaspect.cpp
@@ -61,6 +61,8 @@
#include <Qt3DRenderer/qtexture.h>
#include <Qt3DRenderer/qeffect.h>
#include <Qt3DRenderer/qshaderdata.h>
+#include <Qt3DRenderer/qstateset.h>
+#include <Qt3DRenderer/qnodraw.h>
#include <Qt3DCore/qcameralens.h>
#include <Qt3DRenderer/private/cameraselectornode_p.h>
@@ -89,6 +91,8 @@
#include <Qt3DRenderer/private/updateworldtransformjob_p.h>
#include <Qt3DRenderer/private/framecleanupjob_p.h>
#include <Qt3DRenderer/private/rendertextureimage_p.h>
+#include <Qt3DRenderer/private/statesetnode_p.h>
+#include <Qt3DRenderer/private/nodraw_p.h>
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qtransform.h>
#include <Qt3DCore/qnodevisitor.h>
@@ -112,8 +116,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderAspectPrivate::QRenderAspectPrivate(QRenderAspect::RenderType type, QRenderAspect *qq)
- : QAbstractAspectPrivate(qq)
+/*!
+ \class Qt3D::QRenderAspectPrivate
+ \internal
+*/
+QRenderAspectPrivate::QRenderAspectPrivate(QRenderAspect::RenderType type)
+ : QAbstractAspectPrivate()
, m_renderer(new Render::Renderer(type))
, m_surfaceEventFilter(new Render::PlatformSurfaceFilter(m_renderer))
, m_surface(Q_NULLPTR)
@@ -160,7 +168,7 @@ void QRenderAspectPrivate::setSurface(QSurface *surface)
}
QRenderAspect::QRenderAspect(QObject *parent)
- : QAbstractAspect(*new QRenderAspectPrivate(Threaded, this), parent)
+ : QAbstractAspect(*new QRenderAspectPrivate(Threaded), parent)
{
// Won't return until the private RenderThread in Renderer has been created
// The Renderer is set to wait the surface with a wait condition
@@ -169,11 +177,12 @@ QRenderAspect::QRenderAspect(QObject *parent)
}
QRenderAspect::QRenderAspect(QRenderAspect::RenderType type, QObject *parent)
- : QAbstractAspect(*new QRenderAspectPrivate(type, this), parent)
+ : QAbstractAspect(*new QRenderAspectPrivate(type), parent)
{
registerBackendTypes();
}
+/*! \internal */
QRenderAspect::QRenderAspect(QRenderAspectPrivate &dd, QObject *parent)
: QAbstractAspect(dd, parent)
@@ -213,6 +222,8 @@ void QRenderAspect::registerBackendTypes()
registerBackendType<QParameter>(QBackendNodeFunctorPtr(new Render::RenderNodeFunctor<Render::RenderParameter, Render::ParameterManager>(d->m_renderer->parameterManager())));
registerBackendType<QShaderData>(QBackendNodeFunctorPtr(new Render::RenderShaderDataFunctor(d->m_renderer->shaderDataManager())));
registerBackendType<QAbstractTextureImage>(QBackendNodeFunctorPtr(new Render::RenderTextureImageFunctor(d->m_renderer->textureManager(), d->m_renderer->textureImageManager(), d->m_renderer->textureDataManager())));
+ registerBackendType<QStateSet>(QBackendNodeFunctorPtr(new Render::FrameGraphNodeFunctor<Render::StateSetNode, QStateSet>(d->m_renderer->frameGraphManager())));
+ registerBackendType<QNoDraw>(QBackendNodeFunctorPtr(new Render::FrameGraphNodeFunctor<Render::NoDraw, QNoDraw>(d->m_renderer->frameGraphManager())));
}
void QRenderAspect::renderInitialize(QOpenGLContext *context)
diff --git a/src/render/backend/qrenderaspect_p.h b/src/render/backend/qrenderaspect_p.h
index 302e2be44..3ef3c9326 100644
--- a/src/render/backend/qrenderaspect_p.h
+++ b/src/render/backend/qrenderaspect_p.h
@@ -57,7 +57,7 @@ class Renderer;
class QRenderAspectPrivate : public QAbstractAspectPrivate
{
- QRenderAspectPrivate(QRenderAspect::RenderType type, QRenderAspect *qq);
+ QRenderAspectPrivate(QRenderAspect::RenderType type);
Q_DECLARE_PUBLIC(QRenderAspect)
diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp
index d6c06c397..78805c47e 100644
--- a/src/render/backend/renderer.cpp
+++ b/src/render/backend/renderer.cpp
@@ -188,6 +188,7 @@ void Renderer::buildDefaultTechnique()
m_defaultRenderStateSet = new RenderStateSet;
m_defaultRenderStateSet->addState(DepthTest::getOrCreate(GL_LESS));
m_defaultRenderStateSet->addState(CullFace::getOrCreate(GL_BACK));
+ m_defaultRenderStateSet->addState(ColorMask::getOrCreate(true, true, true, true));
//basicPass->setStateSet(m_defaultRenderStateSet);
m_defaultTechnique->addPass(basicPass);
@@ -522,6 +523,7 @@ void Renderer::enqueueRenderView(Render::RenderView *renderView, int submitOrder
{
// qDebug() << Q_FUNC_INFO << QThread::currentThread();
m_renderQueues->queueRenderView(renderView, submitOrder);
+
if (m_renderQueues->isFrameQueueComplete()) {
// We can increment the currentProcessingFrameIndex here
// That index will then be used by RenderViewJobs to know which QFrameAllocator to use
@@ -594,8 +596,9 @@ void Renderer::submitRenderViews(int maxFrameCount)
if (renderViewsCount <= 0)
continue;
+ QColor previousClearColor = renderViews.first()->clearColor();
// Bail out if we cannot make the OpenGL context current (e.g. if the window has been destroyed)
- if (!m_graphicsContext->beginDrawing(m_surface, renderViews.first()->clearColor())) {
+ if (!m_graphicsContext->beginDrawing(m_surface, previousClearColor)) {
qDeleteAll(renderViews);
m_renderQueues->popFrameQueue();
break;
@@ -606,18 +609,33 @@ void Renderer::submitRenderViews(int maxFrameCount)
defaultFboId = m_graphicsContext->boundFrameBufferObject();
}
+ // Reset state to the default state
+ m_graphicsContext->setCurrentStateSet(m_defaultRenderStateSet);
+
qCDebug(Memory) << Q_FUNC_INFO << "rendering frame " << renderViews.last()->frameIndex() << " Queue " << m_renderQueues->queuedFrames();
for (int i = 0; i < renderViewsCount; i++) {
+ // Initialize QGraphicsContext for drawing
+ // If the RenderView has a RenderStateSet defined
+ if (renderViews[i]->stateSet())
+ m_graphicsContext->setCurrentStateSet(renderViews[i]->stateSet());
+
// Set RenderTarget ...
// Activate RenderTarget
m_graphicsContext->activateRenderTarget(m_renderTargetManager->data(renderViews[i]->renderTargetHandle()),
renderViews[i]->attachmentPack(), defaultFboId);
+
+ // Set clear color if different
+ if (previousClearColor != renderViews[i]->clearColor()) {
+ previousClearColor = renderViews[i]->clearColor();
+ m_graphicsContext->clearColor(previousClearColor);
+ }
+
// Clear BackBuffer
m_graphicsContext->clearBackBuffer(renderViews[i]->clearBuffer());
// Set the Viewport
m_graphicsContext->setViewport(renderViews[i]->viewport());
- // Initialize QGraphicsContext for drawing
+ // TO DO only if the renderView doesn't contain a NoDraw
executeCommands(renderViews.at(i)->commands());
frameElapsed = timer.elapsed() - frameElapsed;
@@ -756,10 +774,9 @@ void Renderer::executeCommands(const QVector<RenderCommand *> &commands)
//// Draw Calls
// Set state
+ RenderStateSet *globalState = m_graphicsContext->currentStateSet();
if (command->m_stateSet != Q_NULLPTR)
m_graphicsContext->setCurrentStateSet(command->m_stateSet);
- else
- m_graphicsContext->setCurrentStateSet(m_defaultRenderStateSet);
// All Uniforms for a pass are stored in the QUniformPack of the command
// Uniforms for Effect, Material and Technique should already have been correctly resolved
@@ -784,6 +801,10 @@ void Renderer::executeCommands(const QVector<RenderCommand *> &commands)
m_graphicsContext->drawArrays(primType, 0, primCount);
}
+ // Reset state if overridden by pass state
+ if (command->m_stateSet != Q_NULLPTR)
+ m_graphicsContext->setCurrentStateSet(globalState);
+
int err = m_graphicsContext->openGLContext()->functions()->glGetError();
if (err)
qCWarning(Rendering) << "GL error after drawing mesh:" << QString::number(err, 16);
diff --git a/src/render/backend/rendermaterial.cpp b/src/render/backend/rendermaterial.cpp
index d38fa698e..29c0ec3dd 100644
--- a/src/render/backend/rendermaterial.cpp
+++ b/src/render/backend/rendermaterial.cpp
@@ -55,6 +55,7 @@ namespace Render {
RenderMaterial::RenderMaterial()
: QBackendNode()
, m_textureProvider(Q_NULLPTR)
+ , m_enabled(true)
{
}
diff --git a/src/render/backend/rendermaterial_p.h b/src/render/backend/rendermaterial_p.h
index 0dc29768b..eb648c83b 100644
--- a/src/render/backend/rendermaterial_p.h
+++ b/src/render/backend/rendermaterial_p.h
@@ -59,7 +59,7 @@ class RenderTechnique;
class RenderEffect;
class MaterialManager;
-class RenderMaterial : public QBackendNode
+class Q_AUTOTEST_EXPORT RenderMaterial : public QBackendNode
{
public:
RenderMaterial();
diff --git a/src/render/backend/rendermesh.cpp b/src/render/backend/rendermesh.cpp
index 1fcd65dd4..839de8853 100644
--- a/src/render/backend/rendermesh.cpp
+++ b/src/render/backend/rendermesh.cpp
@@ -57,6 +57,7 @@ namespace Render {
/*!
* \class RenderMesh
+ * \internal
*
* Monitor a frontend Mesh for source changes. If the source is changed,
* the QMeshData returned is either a valid QMeshData corresponding to the source
@@ -70,6 +71,7 @@ RenderMesh::RenderMesh()
: QBackendNode()
, m_meshDirty(true)
, m_meshDataManager(Q_NULLPTR)
+ , m_enabled(true)
{
}
@@ -109,6 +111,7 @@ void RenderMesh::sceneChangeEvent(const QSceneChangePtr &e)
QMeshData *RenderMesh::meshData() const
{
+ Q_ASSERT(m_meshDataManager);
return m_meshDataManager->data(m_meshDataHandle);
}
diff --git a/src/render/backend/rendermesh_p.h b/src/render/backend/rendermesh_p.h
index 0a7f5e1fc..600c141a8 100644
--- a/src/render/backend/rendermesh_p.h
+++ b/src/render/backend/rendermesh_p.h
@@ -62,7 +62,7 @@ class RenderEntity;
class RenderMaterial;
class RenderTechnique;
-class RenderMesh : public QBackendNode
+class Q_AUTOTEST_EXPORT RenderMesh : public QBackendNode
{
public:
RenderMesh();
diff --git a/src/render/backend/renderrenderpass.cpp b/src/render/backend/renderrenderpass.cpp
index 21d573651..85828c14e 100644
--- a/src/render/backend/renderrenderpass.cpp
+++ b/src/render/backend/renderrenderpass.cpp
@@ -40,23 +40,11 @@
#include <Qt3DRenderer/qparametermapping.h>
#include <Qt3DRenderer/qrenderstate.h>
#include <Qt3DRenderer/qrenderpass.h>
-
-#include <Qt3DRenderer/qalphacoverage.h>
-#include <Qt3DRenderer/qalphatest.h>
-#include <Qt3DRenderer/qblendequation.h>
-#include <Qt3DRenderer/qblendstate.h>
-#include <Qt3DRenderer/qcolormask.h>
-#include <Qt3DRenderer/qcullface.h>
-#include <Qt3DRenderer/qdepthmask.h>
-#include <Qt3DRenderer/qdepthtest.h>
-#include <Qt3DRenderer/qdithering.h>
-#include <Qt3DRenderer/qfrontface.h>
-#include <Qt3DRenderer/qpolygonoffset.h>
-#include <Qt3DRenderer/qscissortest.h>
-#include <Qt3DRenderer/qstenciltest.h>
+#include <Qt3DRenderer/qparameter.h>
// TODO: Rename this include to something more descriptive
#include <Qt3DRenderer/private/blendstate_p.h>
+#include <Qt3DRenderer/private/renderstate_p.h>
#include <Qt3DCore/qscenepropertychange.h>
@@ -66,75 +54,6 @@ namespace Qt3D {
namespace Render {
-RenderState *getOrCreateBackendState(QRenderState *renderState)
-{
- switch (renderState->type()) {
- case QRenderState::AlphaTest: {
- QAlphaTest *alphaTest = static_cast<QAlphaTest *>(renderState);
- return AlphaFunc::getOrCreate(alphaTest->func(), alphaTest->clamp());
- }
- case QRenderState::BlendEquation: {
- QBlendEquation *blendEquation = static_cast<QBlendEquation *>(renderState);
- return BlendEquation::getOrCreate(blendEquation->mode());
- }
- case QRenderState::BlendState: {
- QBlendState *blendState = static_cast<QBlendState *>(renderState);
- // TO DO : Handle Alpha here as weel
- return BlendState::getOrCreate(blendState->srcRGB(), blendState->dstRGB());
- }
- case QRenderState::CullFace: {
- QCullFace *cullFace = static_cast<QCullFace *>(renderState);
- return CullFace::getOrCreate(cullFace->mode());
- }
- case QRenderState::DepthMask: {
- QDepthMask *depthMask = static_cast<QDepthMask *>(renderState);
- return DepthMask::getOrCreate(depthMask->mask());
- }
- case QRenderState::DepthTest: {
- QDepthTest *depthTest = static_cast<QDepthTest *>(renderState);
- return DepthTest::getOrCreate(depthTest->func());
- }
- case QRenderState::Dithering: {
- return Dithering::getOrCreate();
- }
- case QRenderState::FrontFace: {
- QFrontFace *frontFace = static_cast<QFrontFace *>(renderState);
- return FrontFace::getOrCreate(frontFace->direction());
- }
- case QRenderState::ScissorTest: {
- QScissorTest *scissorTest = static_cast<QScissorTest *>(renderState);
- return ScissorTest::getOrCreate(scissorTest->left(),
- scissorTest->bottom(),
- scissorTest->width(),
- scissorTest->height());
- }
- case QRenderState::StencilTest: {
- QStencilTest *stencilTest = static_cast<QStencilTest *>(renderState);
- return StencilTest::getOrCreate(stencilTest->mask(),
- stencilTest->func(),
- stencilTest->faceMode());
- }
- case QRenderState::AlphaCoverage: {
- return AlphaCoverage::getOrCreate();
- }
- case QRenderState::PolygonOffset: {
- QPolygonOffset *polygonOffset = static_cast<QPolygonOffset *>(renderState);
- return PolygonOffset::getOrCreate(polygonOffset->factor(),
- polygonOffset->units());
- }
- case QRenderState::ColorMask: {
- QColorMask *colorMask = static_cast<QColorMask *>(renderState);
- return ColorMask::getOrCreate(colorMask->isRed(),
- colorMask->isGreen(),
- colorMask->isBlue(),
- colorMask->isAlpha());
- }
- default:
- qFatal("Should not happen");
- return Q_NULLPTR;
- }
-}
-
RenderRenderPass::RenderRenderPass()
: QBackendNode()
{
@@ -153,6 +72,8 @@ void RenderRenderPass::updateFromPeer(QNode *peer)
{
QRenderPass *pass = static_cast<QRenderPass *>(peer);
+ m_parameterPack.clear();
+
if (pass->shaderProgram() != Q_NULLPTR)
m_shaderUuid = pass->shaderProgram()->id();
// The RenderPass clones frontend bindings in case the frontend ever removes them
@@ -162,7 +83,9 @@ void RenderRenderPass::updateFromPeer(QNode *peer)
Q_FOREACH (QAnnotation *c, pass->annotations())
appendAnnotation(c->id());
Q_FOREACH (QRenderState *renderState, pass->renderStates())
- appendRenderState(renderState->id(), getOrCreateBackendState(renderState));
+ appendRenderState(renderState->id(), RenderState::getOrCreateBackendState(renderState));
+ Q_FOREACH (QParameter *p, pass->parameters())
+ m_parameterPack.appendParameter(p->id());
}
void RenderRenderPass::sceneChangeEvent(const QSceneChangePtr &e)
@@ -173,16 +96,16 @@ void RenderRenderPass::sceneChangeEvent(const QSceneChangePtr &e)
case NodeAdded: {
if (propertyChange->propertyName() == QByteArrayLiteral("annotation")) {
appendAnnotation(propertyChange->value().value<QNodeId>());
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("shaderProgram")) {
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("shaderProgram")) {
m_shaderUuid = propertyChange->value().value<QNodeId>();
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("binding")) {
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("binding")) {
appendBinding(RenderParameterMapping(propertyChange->value().value<QParameterMapping *>()));
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("renderState")) {
- QRenderState *renderState = propertyChange->value().value<QRenderState *>();
- appendRenderState(renderState->id(), getOrCreateBackendState(renderState));
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("renderState")) {
+ QNodePtr nodePtr = propertyChange->value().value<QNodePtr>();
+ QRenderState *renderState = static_cast<QRenderState *>(nodePtr.data());
+ appendRenderState(renderState->id(), RenderState::getOrCreateBackendState(renderState));
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("parameter")) {
+ m_parameterPack.appendParameter(propertyChange->value().value<QNodeId>());
}
break;
}
@@ -190,15 +113,14 @@ void RenderRenderPass::sceneChangeEvent(const QSceneChangePtr &e)
case NodeRemoved: {
if (propertyChange->propertyName() == QByteArrayLiteral("annotation")) {
removeAnnotation(propertyChange->value().value<QNodeId>());
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("shaderProgram")) {
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("shaderProgram")) {
m_shaderUuid = QNodeId();
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("binding")) {
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("binding")) {
removeBinding(propertyChange->value().value<QNodeId>());
- }
- else if (propertyChange->propertyName() == QByteArrayLiteral("renderState")) {
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("renderState")) {
removeRenderState(propertyChange->value().value<QNodeId>());
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("parameter")) {
+ m_parameterPack.removeParameter(propertyChange->value().value<QNodeId>());
}
break;
}
@@ -228,6 +150,11 @@ QList<RenderState *> RenderRenderPass::renderStates() const
return m_renderStates.values();
}
+QList<QNodeId> RenderRenderPass::parameters() const
+{
+ return m_parameterPack.parameters();
+}
+
void RenderRenderPass::appendAnnotation(const QNodeId &annotationId)
{
if (!m_annotationList.contains(annotationId))
diff --git a/src/render/backend/renderrenderpass_p.h b/src/render/backend/renderrenderpass_p.h
index 87ddf272a..1e9b8ecfd 100644
--- a/src/render/backend/renderrenderpass_p.h
+++ b/src/render/backend/renderrenderpass_p.h
@@ -40,6 +40,7 @@
#include <Qt3DRenderer/qt3drenderer_global.h>
#include <Qt3DRenderer/private/renderparametermapping_p.h>
+#include <Qt3DRenderer/private/parameterpack_p.h>
#include <Qt3DCore/private/qabstractaspect_p.h>
#include <Qt3DCore/qbackendnode.h>
#include <Qt3DCore/qnodeid.h>
@@ -74,6 +75,7 @@ public:
QList<RenderParameterMapping> bindings() const;
QList<QNodeId> annotations() const;
QList<RenderState *> renderStates() const;
+ QList<QNodeId> parameters() const;
private:
void appendAnnotation(const QNodeId &criterionId);
@@ -89,6 +91,7 @@ private:
QHash<QNodeId, RenderParameterMapping> m_bindings;
QHash<QNodeId, RenderState *> m_renderStates;
QList<QNodeId> m_annotationList;
+ ParameterPack m_parameterPack;
};
} // Render
diff --git a/src/render/backend/rendershader.cpp b/src/render/backend/rendershader.cpp
index d4a3cbd70..b8c01f334 100644
--- a/src/render/backend/rendershader.cpp
+++ b/src/render/backend/rendershader.cpp
@@ -40,6 +40,7 @@
#include <QFile>
#include <QOpenGLContext>
#include <QOpenGLShaderProgram>
+#include <QMutexLocker>
#include <qshaderprogram.h>
#include <Qt3DRenderer/private/qgraphicscontext_p.h>
#include <Qt3DRenderer/private/attachmentpack_p.h>
@@ -55,6 +56,7 @@ RenderShader::RenderShader()
, m_program(Q_NULLPTR)
, m_isLoaded(false)
, m_dna(0)
+ , m_mutex(new QMutex())
{
m_shaderCode.resize(static_cast<int>(QShaderProgram::Compute) + 1);
}
@@ -63,6 +65,7 @@ RenderShader::~RenderShader()
{
// TO DO: ShaderProgram is leaked as of now
// Fix that taking care that they may be shared given a same dna
+ delete m_mutex;
}
void RenderShader::cleanup()
@@ -226,7 +229,11 @@ void RenderShader::updateUniforms(QGraphicsContext *ctx, const QUniformPack &pac
void RenderShader::setFragOutputs(const QHash<QString, int> &fragOutputs)
{
- m_fragOutputs = fragOutputs;
+ {
+ QMutexLocker lock(m_mutex);
+ m_fragOutputs = fragOutputs;
+ }
+ updateDNA();
}
static QOpenGLShader::ShaderType shaderType(QShaderProgram::ShaderType type)
@@ -292,12 +299,22 @@ QOpenGLShaderProgram* RenderShader::createDefaultProgram()
void RenderShader::updateDNA()
{
- m_dna = qHash(m_shaderCode[QShaderProgram::Vertex]
- + m_shaderCode[QShaderProgram::TessellationControl]
- + m_shaderCode[QShaderProgram::TessellationEvaluation]
- + m_shaderCode[QShaderProgram::Geometry]
- + m_shaderCode[QShaderProgram::Fragment]
- + m_shaderCode[QShaderProgram::Compute]);
+ uint codeHash = qHash(m_shaderCode[QShaderProgram::Vertex]
+ + m_shaderCode[QShaderProgram::TessellationControl]
+ + m_shaderCode[QShaderProgram::TessellationEvaluation]
+ + m_shaderCode[QShaderProgram::Geometry]
+ + m_shaderCode[QShaderProgram::Fragment]
+ + m_shaderCode[QShaderProgram::Compute]);
+
+ QMutexLocker locker(m_mutex);
+ uint attachmentHash = 0;
+ QHash<QString, int>::const_iterator it = m_fragOutputs.begin();
+ QHash<QString, int>::const_iterator end = m_fragOutputs.end();
+ while (it != end) {
+ attachmentHash += ::qHash(it.value()) + ::qHash(it.key());
+ ++it;
+ }
+ m_dna = codeHash + attachmentHash;
}
void RenderShader::initializeUniforms(const QVector<ShaderUniform> &uniformsDescription)
diff --git a/src/render/backend/rendershader_p.h b/src/render/backend/rendershader_p.h
index 23d5a8672..18bd6b232 100644
--- a/src/render/backend/rendershader_p.h
+++ b/src/render/backend/rendershader_p.h
@@ -45,6 +45,7 @@
QT_BEGIN_NAMESPACE
class QOpenGLShaderProgram;
+class QMutex;
namespace Qt3D {
@@ -108,6 +109,7 @@ private:
bool m_isLoaded;
ProgramDNA m_dna;
+ QMutex *m_mutex;
void updateDNA();
diff --git a/src/render/backend/renderstate.cpp b/src/render/backend/renderstate.cpp
index 84c1e250f..c92601d6e 100644
--- a/src/render/backend/renderstate.cpp
+++ b/src/render/backend/renderstate.cpp
@@ -45,6 +45,20 @@
#include <Qt3DRenderer/private/qgraphicscontext_p.h>
#include <Qt3DRenderer/private/blendstate_p.h>
+#include <Qt3DRenderer/qalphacoverage.h>
+#include <Qt3DRenderer/qalphatest.h>
+#include <Qt3DRenderer/qblendequation.h>
+#include <Qt3DRenderer/qblendstate.h>
+#include <Qt3DRenderer/qcolormask.h>
+#include <Qt3DRenderer/qcullface.h>
+#include <Qt3DRenderer/qdepthmask.h>
+#include <Qt3DRenderer/qdepthtest.h>
+#include <Qt3DRenderer/qdithering.h>
+#include <Qt3DRenderer/qfrontface.h>
+#include <Qt3DRenderer/qpolygonoffset.h>
+#include <Qt3DRenderer/qscissortest.h>
+#include <Qt3DRenderer/qstenciltest.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3D {
@@ -101,9 +115,13 @@ void RenderStateSet::apply(QGraphicsContext *gc)
StateMaskSet invOurState = ~stateMask();
// generate a mask for each set bit in previous, where we do not have
// the corresponding bit set.
+
StateMaskSet stateToReset = 0;
- if (previousStates)
+ if (previousStates) {
stateToReset = previousStates->stateMask() & invOurState;
+ qCDebug(RenderStates) << "previous states " << QString::number(previousStates->stateMask(), 2);
+ }
+ qCDebug(RenderStates) << " current states " << QString::number(stateMask(), 2) << "inverse " << QString::number(invOurState, 2) << " -> states to change: " << QString::number(stateToReset, 2);
resetMasked(stateToReset, gc);
@@ -133,6 +151,11 @@ StateMaskSet RenderStateSet::stateMask() const
return m_stateMask;
}
+void RenderStateSet::merge(RenderStateSet *other)
+{
+ m_stateMask |= other->stateMask();
+}
+
void RenderStateSet::resetMasked(StateMaskSet maskOfStatesToReset, QGraphicsContext *gc)
{
// TO DO -> Call gcHelper methods instead of raw GL
@@ -197,6 +220,78 @@ bool RenderStateSet::contains(RenderState *ds) const
return m_states.contains(ds);
}
+RenderState *RenderState::getOrCreateBackendState(QRenderState *renderState)
+{
+ switch (renderState->type()) {
+ case QRenderState::AlphaTest: {
+ QAlphaTest *alphaTest = static_cast<QAlphaTest *>(renderState);
+ return AlphaFunc::getOrCreate(alphaTest->func(), alphaTest->clamp());
+ }
+ case QRenderState::BlendEquation: {
+ QBlendEquation *blendEquation = static_cast<QBlendEquation *>(renderState);
+ return BlendEquation::getOrCreate(blendEquation->mode());
+ }
+ case QRenderState::BlendState: {
+ QBlendState *blendState = static_cast<QBlendState *>(renderState);
+ return BlendState::getOrCreate(blendState->srcRGB(), blendState->dstRGB());
+ }
+ case QRenderState::BlendStateSeparate: {
+ QBlendState *blendState = static_cast<QBlendState *>(renderState);
+ return BlendStateSeparate::getOrCreate(blendState->srcRGB(), blendState->dstRGB(), blendState->srcAlpha(), blendState->dstAlpha());
+ }
+ case QRenderState::CullFace: {
+ QCullFace *cullFace = static_cast<QCullFace *>(renderState);
+ return CullFace::getOrCreate(cullFace->mode());
+ }
+ case QRenderState::DepthMask: {
+ QDepthMask *depthMask = static_cast<QDepthMask *>(renderState);
+ return DepthMask::getOrCreate(depthMask->mask());
+ }
+ case QRenderState::DepthTest: {
+ QDepthTest *depthTest = static_cast<QDepthTest *>(renderState);
+ return DepthTest::getOrCreate(depthTest->func());
+ }
+ case QRenderState::Dithering: {
+ return Dithering::getOrCreate();
+ }
+ case QRenderState::FrontFace: {
+ QFrontFace *frontFace = static_cast<QFrontFace *>(renderState);
+ return FrontFace::getOrCreate(frontFace->direction());
+ }
+ case QRenderState::ScissorTest: {
+ QScissorTest *scissorTest = static_cast<QScissorTest *>(renderState);
+ return ScissorTest::getOrCreate(scissorTest->left(),
+ scissorTest->bottom(),
+ scissorTest->width(),
+ scissorTest->height());
+ }
+ case QRenderState::StencilTest: {
+ QStencilTest *stencilTest = static_cast<QStencilTest *>(renderState);
+ return StencilTest::getOrCreate(stencilTest->mask(),
+ stencilTest->func(),
+ stencilTest->faceMode());
+ }
+ case QRenderState::AlphaCoverage: {
+ return AlphaCoverage::getOrCreate();
+ }
+ case QRenderState::PolygonOffset: {
+ QPolygonOffset *polygonOffset = static_cast<QPolygonOffset *>(renderState);
+ return PolygonOffset::getOrCreate(polygonOffset->factor(),
+ polygonOffset->units());
+ }
+ case QRenderState::ColorMask: {
+ QColorMask *colorMask = static_cast<QColorMask *>(renderState);
+ return ColorMask::getOrCreate(colorMask->isRed(),
+ colorMask->isGreen(),
+ colorMask->isBlue(),
+ colorMask->isAlpha());
+ }
+ default:
+ qFatal("Should not happen");
+ return Q_NULLPTR;
+ }
+}
+
} // Render
} // namespace Qt3D
diff --git a/src/render/backend/renderstate_p.h b/src/render/backend/renderstate_p.h
index 38b858362..231c1b534 100644
--- a/src/render/backend/renderstate_p.h
+++ b/src/render/backend/renderstate_p.h
@@ -44,6 +44,9 @@
QT_BEGIN_NAMESPACE
namespace Qt3D {
+
+class QRenderState;
+
namespace Render {
class QGraphicsContext;
@@ -76,6 +79,7 @@ public:
virtual StateMaskSet mask() const = 0;
+ static RenderState *getOrCreateBackendState(QRenderState *renderState);
protected:
};
@@ -98,7 +102,7 @@ public:
void apply(QGraphicsContext* gc);
StateMaskSet stateMask() const;
-
+ void merge(RenderStateSet *other);
void resetMasked(StateMaskSet maskOfStatesToReset, QGraphicsContext* gc);
private:
/**
@@ -114,6 +118,7 @@ private:
RenderStateSet* m_cachedPrevious;
QList<RenderState*> m_cachedDeltaStates;
+
};
} // Render
diff --git a/src/render/backend/rendertexture.cpp b/src/render/backend/rendertexture.cpp
index 4e9d7e2c0..92a1960d9 100644
--- a/src/render/backend/rendertexture.cpp
+++ b/src/render/backend/rendertexture.cpp
@@ -74,6 +74,7 @@ RenderTexture::RenderTexture()
, m_isDirty(false)
, m_filtersAndWrapUpdated(false)
, m_dataUploadRequired(false)
+ , m_unique(false)
, m_lock(new QMutex())
, m_textureDNA(0)
, m_textureManager(Q_NULLPTR)
@@ -111,6 +112,7 @@ void RenderTexture::cleanup()
m_isDirty = false;
m_filtersAndWrapUpdated = false;
m_dataUploadRequired = false;
+ m_unique = false;
m_textureDNA = 0;
m_textureImages.clear();
m_textureManager = Q_NULLPTR;
@@ -141,6 +143,7 @@ void RenderTexture::updateFromPeer(QNode *peer)
m_comparisonFunction = texture->comparisonFunction();
m_comparisonMode = texture->comparisonMode();
m_layers = texture->maximumLayers();
+ m_unique = texture->isUnique();
}
}
@@ -347,6 +350,8 @@ void RenderTexture::updateDNA()
if (img)
m_textureDNA += img->dna();
}
+ if (m_unique) // Ensures uniqueness by adding unique QNode id to the dna
+ m_textureDNA += qHash(peerUuid());
}
// RenderThread
@@ -403,7 +408,7 @@ void RenderTexture::sceneChangeEvent(const QSceneChangePtr &e)
} else if (propertyChange->propertyName() == QByteArrayLiteral("depth")) {
setSize(m_width, m_height, propertyChange->value().toInt());
} else if (propertyChange->propertyName() == QByteArrayLiteral("mipmaps")) {
- bool oldMipMaps = m_generateMipMaps;
+ const bool oldMipMaps = m_generateMipMaps;
m_generateMipMaps = propertyChange->value().toBool();
m_isDirty |= (oldMipMaps != m_generateMipMaps);
} else if (propertyChange->propertyName() == QByteArrayLiteral("minificationFilter")) {
@@ -445,9 +450,14 @@ void RenderTexture::sceneChangeEvent(const QSceneChangePtr &e)
m_comparisonMode = propertyChange->value().value<QAbstractTextureProvider::ComparisonMode>();
m_filtersAndWrapUpdated |= (oldComparisonMode != m_comparisonMode);
} else if (propertyChange->propertyName() == QByteArrayLiteral("maximumLayers")) {
- int oldLayers = m_layers;
+ const int oldLayers = m_layers;
m_layers = propertyChange->value().toInt();
m_isDirty |= (oldLayers != m_layers);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("unique")) {
+ const bool oldUnique = m_unique;
+ m_unique = propertyChange->value().toBool();
+ // Will force a DNA update
+ m_filtersAndWrapUpdated |= (oldUnique != m_unique);
}
}
break;
diff --git a/src/render/backend/rendertexture_p.h b/src/render/backend/rendertexture_p.h
index d5bc1514d..052c00b36 100644
--- a/src/render/backend/rendertexture_p.h
+++ b/src/render/backend/rendertexture_p.h
@@ -123,6 +123,7 @@ private:
bool m_filtersAndWrapUpdated;
bool m_dataUploadRequired;
bool m_formatWasSpecified;
+ bool m_unique;
QMutex *m_lock;
TextureDNA m_textureDNA;
diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp
index 6ed9761b8..20f2f7cfa 100644
--- a/src/render/backend/renderview.cpp
+++ b/src/render/backend/renderview.cpp
@@ -250,7 +250,8 @@ RenderView::RenderView()
, m_clearColor(Q_NULLPTR)
, m_viewport(Q_NULLPTR)
, m_clearBuffer(QClearBuffer::None)
- , m_commands()
+ , m_stateSet(Q_NULLPTR)
+ , m_noDraw(false)
{
}
@@ -282,6 +283,9 @@ RenderView::~RenderView()
m_allocator->deallocate<QColor>(m_clearColor);
// Deallocate m_data
m_allocator->deallocate<InnerData>(m_data);
+ // Deallocate m_stateSet
+ if (m_stateSet)
+ m_allocator->deallocate<RenderStateSet>(m_stateSet);
}
// We need to overload the delete operator so that when the Renderer deletes the list of RenderViews, each RenderView
@@ -372,6 +376,24 @@ void RenderView::buildRenderCommands(RenderEntity *node)
effect = m_renderer->effectManager()->lookupResource(material->effect());
RenderTechnique *technique = findTechniqueForEffect(m_renderer, this, effect);
+ ParameterInfoList parameters;
+ // Order set:
+ // 1 Pass Filter
+ // 2 Technique Filter
+ // 3 Material
+ // 4 Effect
+ // 5 Technique
+ // 6 RenderPass
+
+ // Add Parameters define in techniqueFilter and passFilter
+ // passFilter have priority over techniqueFilter
+ if (m_data->m_passFilter)
+ parametersFromParametersProvider(&parameters, m_renderer->parameterManager(),
+ m_data->m_passFilter);
+ if (m_data->m_techniqueFilter)
+ parametersFromParametersProvider(&parameters, m_renderer->parameterManager(),
+ m_data->m_techniqueFilter);
+
RenderRenderPassList passes;
if (technique) {
passes = findRenderPassesForTechnique(m_renderer, this, technique);
@@ -382,21 +404,35 @@ void RenderView::buildRenderCommands(RenderEntity *node)
passes << m_renderer->renderPassManager()->data(m_renderer->defaultRenderPassHandle());
}
- // Get the parameters for our selected rendering setup
- ParameterInfoList parameters;
+ // Get the parameters for our selected rendering setup (override what was defined in the technique/pass filter)
parametersFromMaterialEffectTechnique(&parameters, m_renderer->parameterManager(), material, effect, technique);
// 1 RenderCommand per RenderPass pass on an Entity with a Mesh
Q_FOREACH (RenderRenderPass *pass, passes) {
+
+ // Add the RenderRenderPass Parameters
+ ParameterInfoList globalParameter = parameters;
+ parametersFromParametersProvider(&globalParameter, m_renderer->parameterManager(), pass);
+
RenderCommand *command = m_allocator->allocate<RenderCommand>();
command->m_depth = m_data->m_eyePos.distanceToPoint(node->worldBoundingVolume()->center());
command->m_meshData = mesh->meshDataHandle();
command->m_instancesCount = 0;
-
- // TODO: Build the state set for a render pass only once per-pass. Not once per rendercommand and pass.
- command->m_stateSet = buildRenderStateSet(pass, m_allocator);
- if (command->m_stateSet != Q_NULLPTR)
+ command->m_stateSet = Q_NULLPTR;
+ command->m_changeCost = 0;
+ // For RenderPass based states we use the globally set RenderState
+ // if no renderstates are defined as part of the pass. That means:
+ // RenderPass { renderStates: [] } will use the states defined by
+ // StateSet in the FrameGraph
+ if (!pass->renderStates().isEmpty())
+ command->m_stateSet = buildRenderStateSet(pass->renderStates(), m_allocator);
+ if (command->m_stateSet != Q_NULLPTR) {
+ // Merge per pass stateset with global stateset
+ // so that the local stateset only overrides
+ if (m_stateSet != Q_NULLPTR)
+ command->m_stateSet->merge(m_stateSet);
command->m_changeCost = m_renderer->defaultRenderState()->changeCost(command->m_stateSet);
+ }
setShaderAndUniforms(command, pass, parameters, *(node->worldTransform()));
buildSortingKey(command);
m_commands.append(command);
diff --git a/src/render/backend/renderview_p.h b/src/render/backend/renderview_p.h
index 44c59b8c5..67bb57cef 100644
--- a/src/render/backend/renderview_p.h
+++ b/src/render/backend/renderview_p.h
@@ -126,6 +126,12 @@ public:
inline void setTechniqueFilter(const TechniqueFilter *filter) { m_data->m_techniqueFilter = filter; }
inline const TechniqueFilter *techniqueFilter() const { return m_data->m_techniqueFilter; }
+ inline RenderStateSet *stateSet() const { return m_stateSet; }
+ void setStateSet(RenderStateSet *stateSet) { m_stateSet = stateSet; }
+
+ inline bool noDraw() const { return m_noDraw; }
+ void setNoDraw(bool noDraw) { m_noDraw = noDraw; }
+
// TODO: Get rid of this overly complex memory management by splitting out the
// InnerData as a RenderViewConfig struct. This can be created by setRenderViewConfigFromFrameGraphLeafNode
// and passed along with the RenderView to the functions that populate the renderview
@@ -179,6 +185,7 @@ public:
int frameIndex() const { return m_frameIndex; }
void addRenderAttachment(Attachment attachment) { m_attachmentPack.addAttachment(attachment); }
+ void setDrawBuffers(const QList<QRenderAttachment::RenderAttachmentType> &drawBuffers) { m_attachmentPack.setDrawBuffers(drawBuffers); }
const AttachmentPack &attachmentPack() const;
void setRenderTargetHandle(HTarget renderTargetHandle) { m_renderTarget = renderTargetHandle; }
@@ -221,6 +228,8 @@ private:
HTarget m_renderTarget;
AttachmentPack m_attachmentPack;
QClearBuffer::BufferType m_clearBuffer;
+ RenderStateSet *m_stateSet;
+ bool m_noDraw;
int m_frameIndex;
// We do not use pointers to RenderNodes or Drawable's here so that the
diff --git a/src/render/backend/states/blendstate.cpp b/src/render/backend/states/blendstate.cpp
index b9d9ab398..7ccc78d3c 100644
--- a/src/render/backend/states/blendstate.cpp
+++ b/src/render/backend/states/blendstate.cpp
@@ -66,11 +66,6 @@ void BlendState::apply(QGraphicsContext* gc) const
gc->openGLContext()->functions()->glBlendFunc( m_1, m_2 );
}
-StateMaskSet BlendState::mask() const
-{
- return BlendStateMask;
-}
-
BlendState *BlendState::getOrCreate(GLenum src, GLenum dst)
{
BlendState bs(src, dst);
@@ -268,6 +263,22 @@ ColorMask *ColorMask::getOrCreate(GLboolean red, GLboolean green, GLboolean blue
return getOrCreateImpl(ColorMask(red, green, blue, alpha));
}
+void BlendStateSeparate::apply(QGraphicsContext *gc) const
+{
+ gc->openGLContext()->functions()->glEnable(GL_BLEND);
+ gc->openGLContext()->functions()->glBlendFuncSeparate(m_1, m_2, m_3, m_4);
+}
+
+BlendStateSeparate *BlendStateSeparate::getOrCreate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+ return getOrCreateImpl(BlendStateSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha));
+}
+
+BlendStateSeparate::BlendStateSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+ : GenericState4<BlendStateSeparate, GLenum, GLenum, GLenum, GLenum>(srcRGB, dstRGB, srcAlpha, dstAlpha)
+{
+}
+
} // Render
} // Qt3D
diff --git a/src/render/backend/states/blendstate_p.h b/src/render/backend/states/blendstate_p.h
index 3488d0d27..dd2d01aeb 100644
--- a/src/render/backend/states/blendstate_p.h
+++ b/src/render/backend/states/blendstate_p.h
@@ -52,13 +52,26 @@ class Q_AUTOTEST_EXPORT BlendState : public GenericState2<BlendState, GLenum, GL
{
public:
virtual void apply(QGraphicsContext *gc) const Q_DECL_OVERRIDE;
- virtual StateMaskSet mask() const Q_DECL_OVERRIDE;
+ virtual StateMaskSet mask() const Q_DECL_OVERRIDE
+ { return BlendStateMask; }
static BlendState *getOrCreate(GLenum src, GLenum dst);
private:
BlendState(GLenum src, GLenum dst);
};
+class Q_AUTOTEST_EXPORT BlendStateSeparate : public GenericState4<BlendStateSeparate, GLenum, GLenum, GLenum, GLenum>
+{
+public:
+ virtual void apply(QGraphicsContext *gc) const Q_DECL_OVERRIDE;
+ virtual StateMaskSet mask() const Q_DECL_OVERRIDE
+ { return BlendStateMask; }
+
+ static BlendStateSeparate *getOrCreate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+private:
+ BlendStateSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+};
+
class Q_AUTOTEST_EXPORT BlendEquation : public GenericState1<BlendEquation, GLenum>
{
public:
diff --git a/src/render/defaults/defaults.pri b/src/render/defaults/defaults.pri
index 9657f3a88..fb2c04a08 100644
--- a/src/render/defaults/defaults.pri
+++ b/src/render/defaults/defaults.pri
@@ -16,7 +16,9 @@ HEADERS += \
$$PWD/qforwardrenderer.h \
$$PWD/qforwardrenderer_p.h \
$$PWD/qpervertexcolormaterial.h \
- $$PWD/qpervertexcolormaterial_p.h
+ $$PWD/qpervertexcolormaterial_p.h \
+ $$PWD/qskyboxentity.h \
+ $$PWD/qskyboxentity_p.h
SOURCES += \
$$PWD/qphongmaterial.cpp \
@@ -26,4 +28,5 @@ SOURCES += \
$$PWD/qnormaldiffusemapalphamaterial.cpp \
$$PWD/qdiffusespecularmapmaterial.cpp \
$$PWD/qforwardrenderer.cpp \
- $$PWD/qpervertexcolormaterial.cpp
+ $$PWD/qpervertexcolormaterial.cpp \
+ $$PWD/qskyboxentity.cpp
diff --git a/src/render/defaults/qdiffusemapmaterial.cpp b/src/render/defaults/qdiffusemapmaterial.cpp
index 431cf88d4..3cdbfacf7 100644
--- a/src/render/defaults/qdiffusemapmaterial.cpp
+++ b/src/render/defaults/qdiffusemapmaterial.cpp
@@ -52,8 +52,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QDiffuseMapMaterialPrivate::QDiffuseMapMaterialPrivate(QDiffuseMapMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QDiffuseMapMaterialPrivate
+ \internal
+*/
+QDiffuseMapMaterialPrivate::QDiffuseMapMaterialPrivate()
+ : QMaterialPrivate()
, m_diffuseMapEffect(new QEffect())
, m_diffuseTexture(new QTexture2D())
, m_ambientParameter(new QParameter(QStringLiteral("ka"), QColor::fromRgbF(0.05f, 0.05f, 0.05f, 1.0f)))
@@ -149,7 +153,7 @@ void QDiffuseMapMaterialPrivate::init()
Constructs a new Qt3D::QDiffuseMapMaterial instance with parent object \a parent.
*/
QDiffuseMapMaterial::QDiffuseMapMaterial(QNode *parent)
- : QMaterial(*new QDiffuseMapMaterialPrivate(this), parent)
+ : QMaterial(*new QDiffuseMapMaterialPrivate, parent)
{
Q_D(QDiffuseMapMaterial);
QObject::connect(d->m_ambientParameter, SIGNAL(valueChanged()), this, SIGNAL(ambientChanged()));
@@ -160,6 +164,9 @@ QDiffuseMapMaterial::QDiffuseMapMaterial(QNode *parent)
d->init();
}
+/*!
+ Destroys the QDiffuseMapMaterial instance.
+*/
QDiffuseMapMaterial::~QDiffuseMapMaterial()
{
}
@@ -167,8 +174,8 @@ QDiffuseMapMaterial::~QDiffuseMapMaterial()
/*!
\property Qt3D::QDiffuseMapMaterial::ambient
- Holds the current QColor ambient value.
- */
+ Holds the current ambient color.
+*/
QColor QDiffuseMapMaterial::ambient() const
{
@@ -177,10 +184,10 @@ QColor QDiffuseMapMaterial::ambient() const
}
/*!
- \property QDiffuseMapMaterial::specular
+ \property Qt3D::QDiffuseMapMaterial::specular
- Holds the current QColor specular value.
- */
+ Holds the current specular color.
+*/
QColor QDiffuseMapMaterial::specular() const
{
Q_D(const QDiffuseMapMaterial);
@@ -188,10 +195,10 @@ QColor QDiffuseMapMaterial::specular() const
}
/*!
- \property QDiffuseMapMaterial::shininess
+ \property Qt3D::QDiffuseMapMaterial::shininess
Holds the current shininess as a float value.
- */
+*/
float QDiffuseMapMaterial::shininess() const
{
Q_D(const QDiffuseMapMaterial);
@@ -199,15 +206,19 @@ float QDiffuseMapMaterial::shininess() const
}
/*!
- \property QAbstractTextureProvider *QDiffuseMapMaterial::diffuse
+ \property Qt3D::QDiffuseMapMaterial::diffuse
Holds the current QTexture used as the diffuse map.
- \note By default, the diffuse texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the diffuse texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QDiffuseMapMaterial::diffuse() const
{
Q_D(const QDiffuseMapMaterial);
@@ -215,10 +226,11 @@ QAbstractTextureProvider *QDiffuseMapMaterial::diffuse() const
}
/*!
- \property QDiffuseMapMaterial::textureScale
+ \property Qt3D::QDiffuseMapMaterial::textureScale
- Holds the current texture scale.
- */
+ Holds the current texture scale as a float value.
+
+*/
float QDiffuseMapMaterial::textureScale() const
{
Q_D(const QDiffuseMapMaterial);
diff --git a/src/render/defaults/qdiffusemapmaterial_p.h b/src/render/defaults/qdiffusemapmaterial_p.h
index d3005e201..7bda02b57 100644
--- a/src/render/defaults/qdiffusemapmaterial_p.h
+++ b/src/render/defaults/qdiffusemapmaterial_p.h
@@ -55,7 +55,7 @@ class QDiffuseMapMaterial;
class QDiffuseMapMaterialPrivate : public QMaterialPrivate
{
- QDiffuseMapMaterialPrivate(QDiffuseMapMaterial *qq);
+ QDiffuseMapMaterialPrivate();
void init();
diff --git a/src/render/defaults/qdiffusespecularmapmaterial.cpp b/src/render/defaults/qdiffusespecularmapmaterial.cpp
index 109057740..55786f692 100644
--- a/src/render/defaults/qdiffusespecularmapmaterial.cpp
+++ b/src/render/defaults/qdiffusespecularmapmaterial.cpp
@@ -53,8 +53,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QDiffuseSpecularMapMaterialPrivate::QDiffuseSpecularMapMaterialPrivate(QDiffuseSpecularMapMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QDiffuseSpecularMapMaterialPrivate
+ \internal
+*/
+QDiffuseSpecularMapMaterialPrivate::QDiffuseSpecularMapMaterialPrivate()
+ : QMaterialPrivate()
, m_diffuseSpecularMapEffect(new QEffect())
, m_diffuseTexture(new QTexture2D())
, m_specularTexture(new QTexture2D())
@@ -154,10 +158,10 @@ void QDiffuseSpecularMapMaterialPrivate::init()
*/
/*!
- Constructs a new Qt3D::QDiffuseSpecularMapMaterial instance with parent object \a parent.
+ Constructs a new Qt3D::QDiffuseSpecularMapMaterial instance with parent object \a parent.
*/
QDiffuseSpecularMapMaterial::QDiffuseSpecularMapMaterial(QNode *parent)
- : QMaterial(*new QDiffuseSpecularMapMaterialPrivate(this), parent)
+ : QMaterial(*new QDiffuseSpecularMapMaterialPrivate, parent)
{
Q_D(QDiffuseSpecularMapMaterial);
QObject::connect(d->m_ambientParameter, SIGNAL(valueChanged()), this, SIGNAL(ambientChanged()));
@@ -168,6 +172,9 @@ QDiffuseSpecularMapMaterial::QDiffuseSpecularMapMaterial(QNode *parent)
d->init();
}
+/*!
+ Destroys the QDiffuseSpecularMapMaterial instance.
+*/
QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial()
{
}
@@ -175,7 +182,7 @@ QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial()
/*!
\property Qt3D::QDiffuseSpecularMapMaterial::ambient
- Holds the current QColor ambient value.
+ Holds the current ambient color.
*/
QColor QDiffuseSpecularMapMaterial::ambient() const
{
@@ -184,15 +191,19 @@ QColor QDiffuseSpecularMapMaterial::ambient() const
}
/*!
- \property *QDiffuseSpecularMapMaterial::diffuse
+ \property Qt3D::QDiffuseSpecularMapMaterial::diffuse
Holds the current diffuse map texture.
- \note By default the diffuse texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the diffuse texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QDiffuseSpecularMapMaterial::diffuse() const
{
Q_D(const QDiffuseSpecularMapMaterial);
@@ -204,11 +215,15 @@ QAbstractTextureProvider *QDiffuseSpecularMapMaterial::diffuse() const
Holds the current specular map texture.
- \note By default the specular texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the specular texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QDiffuseSpecularMapMaterial::specular() const
{
Q_D(const QDiffuseSpecularMapMaterial);
@@ -219,8 +234,7 @@ QAbstractTextureProvider *QDiffuseSpecularMapMaterial::specular() const
\property Qt3D::QDiffuseSpecularMapMaterial::shininess
Holds the current shininess as a float value.
-
- */
+*/
float QDiffuseSpecularMapMaterial::shininess() const
{
Q_D(const QDiffuseSpecularMapMaterial);
@@ -230,8 +244,8 @@ float QDiffuseSpecularMapMaterial::shininess() const
/*!
\property Qt3D::QDiffuseSpecularMapMaterial::textureScale
- Holds the current texture scale.
- */
+ Holds the current texture scale as a float value.
+*/
float QDiffuseSpecularMapMaterial::textureScale() const
{
Q_D(const QDiffuseSpecularMapMaterial);
diff --git a/src/render/defaults/qdiffusespecularmapmaterial_p.h b/src/render/defaults/qdiffusespecularmapmaterial_p.h
index 00d8edc1d..72ab20e83 100644
--- a/src/render/defaults/qdiffusespecularmapmaterial_p.h
+++ b/src/render/defaults/qdiffusespecularmapmaterial_p.h
@@ -56,7 +56,7 @@ class QDiffuseSpecularMapMaterial;
class QDiffuseSpecularMapMaterialPrivate : public QMaterialPrivate
{
public:
- QDiffuseSpecularMapMaterialPrivate(QDiffuseSpecularMapMaterial *qq);
+ QDiffuseSpecularMapMaterialPrivate();
void init();
diff --git a/src/render/defaults/qforwardrenderer.cpp b/src/render/defaults/qforwardrenderer.cpp
index feb8af0ad..a7167ca5d 100644
--- a/src/render/defaults/qforwardrenderer.cpp
+++ b/src/render/defaults/qforwardrenderer.cpp
@@ -46,8 +46,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QForwardRendererPrivate::QForwardRendererPrivate(QForwardRenderer *qq)
- : QTechniqueFilterPrivate(qq)
+/*!
+ \class Qt3D::QForwardRendererPrivate
+ \internal
+*/
+QForwardRendererPrivate::QForwardRendererPrivate()
+ : QTechniqueFilterPrivate()
, m_viewport(new QViewport())
, m_cameraSelector(new QCameraSelector())
, m_clearBuffer(new QClearBuffer())
@@ -91,11 +95,10 @@ void QForwardRendererPrivate::init()
*/
/*!
- \fn Qt3D::QForwardRenderer::QForwardRenderer(QNode *parent)
Constructs a new Qt3D::QForwardRenderer instance with parent object \a parent.
*/
QForwardRenderer::QForwardRenderer(QNode *parent)
- : QTechniqueFilter(*new QForwardRendererPrivate(this), parent)
+ : QTechniqueFilter(*new QForwardRendererPrivate, parent)
{
Q_D(QForwardRenderer);
QObject::connect(d->m_viewport, SIGNAL(clearColorChanged()), this, SIGNAL(clearColorChanged()));
@@ -104,6 +107,9 @@ QForwardRenderer::QForwardRenderer(QNode *parent)
d->init();
}
+/*!
+ Destroys the QForwardRenderer instance.
+*/
QForwardRenderer::~QForwardRenderer()
{
}
@@ -124,7 +130,7 @@ void QForwardRenderer::setClearColor(const QColor &clearColor)
Sets the camera which should be used to render the scene to \a camera.
\note A camera is a QEntity having a QCameraLens as one of its components.
- */
+*/
void QForwardRenderer::setCamera(QEntity *camera)
{
Q_D(QForwardRenderer);
@@ -146,7 +152,7 @@ QRectF QForwardRenderer::viewportRect() const
\property Qt3D::QForwardRenderer::clearColor
Holds the current clearColor.
- */
+*/
QColor QForwardRenderer::clearColor() const
{
Q_D(const QForwardRenderer);
@@ -157,7 +163,9 @@ QColor QForwardRenderer::clearColor() const
\property Qt3D::QForwardRenderer::camera
Holds the current QEntity camera used to render the scene.
- */
+
+ \note A camera is a QEntity that has a QCameraLens as one of its components.
+*/
QEntity *QForwardRenderer::camera() const
{
Q_D(const QForwardRenderer);
diff --git a/src/render/defaults/qforwardrenderer_p.h b/src/render/defaults/qforwardrenderer_p.h
index d9566fa5c..e0762e9c8 100644
--- a/src/render/defaults/qforwardrenderer_p.h
+++ b/src/render/defaults/qforwardrenderer_p.h
@@ -51,7 +51,7 @@ class QCameraSelector;
class QForwardRendererPrivate: public QTechniqueFilterPrivate
{
public:
- QForwardRendererPrivate(QForwardRenderer *qq);
+ QForwardRendererPrivate();
QViewport *m_viewport;
QCameraSelector *m_cameraSelector;
diff --git a/src/render/defaults/qnormaldiffusemapalphamaterial.cpp b/src/render/defaults/qnormaldiffusemapalphamaterial.cpp
index 30ee3684d..6854e7f1d 100644
--- a/src/render/defaults/qnormaldiffusemapalphamaterial.cpp
+++ b/src/render/defaults/qnormaldiffusemapalphamaterial.cpp
@@ -56,8 +56,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QNormalDiffuseMapAlphaMaterialPrivate::QNormalDiffuseMapAlphaMaterialPrivate(QNormalDiffuseMapAlphaMaterial *qq)
- : QNormalDiffuseMapMaterialPrivate(qq)
+/*!
+ \class Qt3D::QNormalDiffuseMapAlphaMaterialPrivate
+ \internal
+*/
+QNormalDiffuseMapAlphaMaterialPrivate::QNormalDiffuseMapAlphaMaterialPrivate()
+ : QNormalDiffuseMapMaterialPrivate()
, m_alphaCoverage(new QAlphaCoverage())
, m_depthTest(new QDepthTest())
{
@@ -145,10 +149,13 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init()
Constructs a new Qt3D::QNormalDiffuseMapAlphaMaterial instance with parent object \a parent.
*/
QNormalDiffuseMapAlphaMaterial::QNormalDiffuseMapAlphaMaterial(QNode *parent)
- : QNormalDiffuseMapMaterial(*new QNormalDiffuseMapAlphaMaterialPrivate(this), parent)
+ : QNormalDiffuseMapMaterial(*new QNormalDiffuseMapAlphaMaterialPrivate, parent)
{
}
+/*!
+ Destroys the QNormalDiffuseMapAlphaMaterial instance.
+*/
QNormalDiffuseMapAlphaMaterial::~QNormalDiffuseMapAlphaMaterial()
{
}
diff --git a/src/render/defaults/qnormaldiffusemapalphamaterial_p.h b/src/render/defaults/qnormaldiffusemapalphamaterial_p.h
index fb5fb5c73..bc3444fc6 100644
--- a/src/render/defaults/qnormaldiffusemapalphamaterial_p.h
+++ b/src/render/defaults/qnormaldiffusemapalphamaterial_p.h
@@ -51,7 +51,7 @@ class QDepthTest;
class QNormalDiffuseMapAlphaMaterialPrivate: public QNormalDiffuseMapMaterialPrivate
{
public:
- QNormalDiffuseMapAlphaMaterialPrivate(QNormalDiffuseMapAlphaMaterial *qq);
+ QNormalDiffuseMapAlphaMaterialPrivate();
void init() Q_DECL_OVERRIDE;
diff --git a/src/render/defaults/qnormaldiffusemapmaterial.cpp b/src/render/defaults/qnormaldiffusemapmaterial.cpp
index 314916198..136e3d94a 100644
--- a/src/render/defaults/qnormaldiffusemapmaterial.cpp
+++ b/src/render/defaults/qnormaldiffusemapmaterial.cpp
@@ -53,8 +53,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QNormalDiffuseMapMaterialPrivate::QNormalDiffuseMapMaterialPrivate(QNormalDiffuseMapMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QNormalDiffuseMapMaterialPrivate
+ \internal
+*/
+QNormalDiffuseMapMaterialPrivate::QNormalDiffuseMapMaterialPrivate()
+ : QMaterialPrivate()
, m_normalDiffuseEffect(new QEffect())
, m_diffuseTexture(new QTexture2D())
, m_normalTexture(new QTexture2D())
@@ -158,7 +162,7 @@ void QNormalDiffuseMapMaterialPrivate::init()
Constructs a new Qt3D::QNormalDiffuseMapMaterial instance with parent object \a parent.
*/
QNormalDiffuseMapMaterial::QNormalDiffuseMapMaterial(QNode *parent)
- : QMaterial(*new QNormalDiffuseMapMaterialPrivate(this), parent)
+ : QMaterial(*new QNormalDiffuseMapMaterialPrivate, parent)
{
Q_D(QNormalDiffuseMapMaterial);
QObject::connect(d->m_ambientParameter, SIGNAL(valueChanged()), this, SIGNAL(ambientChanged()));
@@ -170,6 +174,7 @@ QNormalDiffuseMapMaterial::QNormalDiffuseMapMaterial(QNode *parent)
d->init();
}
+/*! \internal */
QNormalDiffuseMapMaterial::QNormalDiffuseMapMaterial(QNormalDiffuseMapMaterialPrivate &dd, QNode *parent)
: QMaterial(dd, parent)
{
@@ -183,15 +188,18 @@ QNormalDiffuseMapMaterial::QNormalDiffuseMapMaterial(QNormalDiffuseMapMaterialPr
d->init();
}
+/*!
+ Destroys the QNormalDiffuseMapMaterial instance.
+*/
QNormalDiffuseMapMaterial::~QNormalDiffuseMapMaterial()
{
}
/*!
- \property QNormalDiffuseMapMaterial::ambient
+ \property Qt3D::QNormalDiffuseMapMaterial::ambient
- Holds the current QColor ambient value.
- */
+ Holds the current ambient color.
+*/
QColor QNormalDiffuseMapMaterial::ambient() const
{
Q_D(const QNormalDiffuseMapMaterial);
@@ -199,10 +207,10 @@ QColor QNormalDiffuseMapMaterial::ambient() const
}
/*!
- \property QNormalDiffuseMapMaterial::specular
+ \property Qt3D::QNormalDiffuseMapMaterial::specular
- Holds the current QColor specular value.
- */
+ Holds the current specular color.
+*/
QColor QNormalDiffuseMapMaterial::specular() const
{
Q_D(const QNormalDiffuseMapMaterial);
@@ -210,15 +218,19 @@ QColor QNormalDiffuseMapMaterial::specular() const
}
/*!
- \property *QNormalDiffuseMapMaterial::diffuse
+ \property Qt3D::QNormalDiffuseMapMaterial::diffuse
Holds the current diffuse map texture.
- \note By default the diffuse texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the diffuse texture has these properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap modeM
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QNormalDiffuseMapMaterial::diffuse() const
{
Q_D(const QNormalDiffuseMapMaterial);
@@ -226,14 +238,18 @@ QAbstractTextureProvider *QNormalDiffuseMapMaterial::diffuse() const
}
/*!
- \property *QNormalDiffuseMapMaterial::normal
+ \property Qt3D::QNormalDiffuseMapMaterial::normal
Holds the current normal map texture.
- \note By default the normal texture has linear minification
- and magnification filters, the wrap mode is repeat and maximum anisotropy
- is set to 16.0.
- */
+ By default, the normal texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QNormalDiffuseMapMaterial::normal() const
{
Q_D(const QNormalDiffuseMapMaterial);
@@ -241,10 +257,10 @@ QAbstractTextureProvider *QNormalDiffuseMapMaterial::normal() const
}
/*!
- \property QNormalDiffuseMapMaterial::shininess
+ \property Qt3D::QNormalDiffuseMapMaterial::shininess
Holds the current shininess as a float value.
- */
+*/
float QNormalDiffuseMapMaterial::shininess() const
{
Q_D(const QNormalDiffuseMapMaterial);
@@ -252,10 +268,10 @@ float QNormalDiffuseMapMaterial::shininess() const
}
/*!
- \property QNormalDiffuseMapMaterial::textureScale
+ \property Qt3D::QNormalDiffuseMapMaterial::textureScale
- Holds the current texture scale.
- */
+ Holds the current texture scale as a float value.
+*/
float QNormalDiffuseMapMaterial::textureScale() const
{
Q_D(const QNormalDiffuseMapMaterial);
diff --git a/src/render/defaults/qnormaldiffusemapmaterial_p.h b/src/render/defaults/qnormaldiffusemapmaterial_p.h
index 2b92a3158..ccf986074 100644
--- a/src/render/defaults/qnormaldiffusemapmaterial_p.h
+++ b/src/render/defaults/qnormaldiffusemapmaterial_p.h
@@ -56,7 +56,7 @@ class QNormalDiffuseMapMaterial;
class QNormalDiffuseMapMaterialPrivate: public QMaterialPrivate
{
public:
- QNormalDiffuseMapMaterialPrivate(QNormalDiffuseMapMaterial *qq);
+ QNormalDiffuseMapMaterialPrivate();
virtual void init();
diff --git a/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp
index 57b422cff..3e30bee27 100644
--- a/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp
+++ b/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp
@@ -52,8 +52,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QNormalDiffuseSpecularMapMaterialPrivate::QNormalDiffuseSpecularMapMaterialPrivate(QNormalDiffuseSpecularMapMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QNormalDiffuseSpecularMapMaterialPrivate
+ \internal
+*/
+QNormalDiffuseSpecularMapMaterialPrivate::QNormalDiffuseSpecularMapMaterialPrivate()
+ : QMaterialPrivate()
, m_normalDiffuseSpecularEffect(new QEffect())
, m_diffuseTexture(new QTexture2D())
, m_normalTexture(new QTexture2D())
@@ -164,7 +168,7 @@ void QNormalDiffuseSpecularMapMaterialPrivate::init()
Constructs a new Qt3D::QNormalDiffuseSpecularMapMaterial instance with parent object \a parent.
*/
QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNode *parent)
- : QMaterial(*new QNormalDiffuseSpecularMapMaterialPrivate(this), parent)
+ : QMaterial(*new QNormalDiffuseSpecularMapMaterialPrivate, parent)
{
Q_D(QNormalDiffuseSpecularMapMaterial);
QObject::connect(d->m_ambientParameter, SIGNAL(valueChanged()), this, SIGNAL(ambientChanged()));
@@ -176,7 +180,7 @@ QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNode *pare
d->init();
}
-
+/*! \internal */
QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNormalDiffuseSpecularMapMaterialPrivate &dd, QNode *parent)
: QMaterial(dd, parent)
{
@@ -190,15 +194,18 @@ QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNormalDiff
d->init();
}
+/*!
+ Destroys the Qt3D::QNormalDiffuseSpecularMapMaterial instance.
+*/
QNormalDiffuseSpecularMapMaterial::~QNormalDiffuseSpecularMapMaterial()
{
}
/*!
- \property NormalDiffuseSpecularMapMaterial::ambient
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::ambient
- Holds the current QColor ambient value.
- */
+ Holds the current ambient color.
+*/
QColor QNormalDiffuseSpecularMapMaterial::ambient() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
@@ -206,15 +213,19 @@ QColor QNormalDiffuseSpecularMapMaterial::ambient() const
}
/*!
- \property *QNormalDiffuseSpecularMapMaterial::diffuse
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::diffuse
Holds the current diffuse map texture.
- \note By default the diffuse texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the diffuse texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::diffuse() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
@@ -222,14 +233,18 @@ QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::diffuse() const
}
/*!
- \property QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::normal
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::normal
Holds the current normal map texture.
- \note By default the normal texture has linear minification
- and magnification filters, the wrap mode is repeat and maximum anisotropy
- is set to 16.0.
- */
+ By default, the normal texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::normal() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
@@ -237,15 +252,19 @@ QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::normal() const
}
/*!
- \property *QNormalDiffuseSpecularMapMaterial::specular
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::specular
Holds the current specular map texture.
- \note By default the specular texture has a linear
- magnification filter, a linear mipmap linear minification filter,
- the wrap mode is repeat, the maximum anisotropy is set to 16.0
- and mipmapping is enabled.
- */
+ By default, the specular texture has the following properties:
+
+ \list
+ \li Linear minification and magnification filters
+ \li Linear mipmap with mipmapping enabled
+ \li Repeat wrap mode
+ \li Maximum anisotropy of 16.0
+ \endlist
+*/
QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::specular() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
@@ -253,10 +272,10 @@ QAbstractTextureProvider *QNormalDiffuseSpecularMapMaterial::specular() const
}
/*!
- \property QNormalDiffuseSpecularMapMaterial::shininess
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::shininess
Holds the current shininess as a float value.
- */
+*/
float QNormalDiffuseSpecularMapMaterial::shininess() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
@@ -264,10 +283,10 @@ float QNormalDiffuseSpecularMapMaterial::shininess() const
}
/*!
- \property QNormalDiffuseSpecularMapMaterial::textureScale
+ \property Qt3D::QNormalDiffuseSpecularMapMaterial::textureScale
- Holds the current texture scale.
- */
+ Holds the current texture scale as a float value.
+*/
float QNormalDiffuseSpecularMapMaterial::textureScale() const
{
Q_D(const QNormalDiffuseSpecularMapMaterial);
diff --git a/src/render/defaults/qnormaldiffusespecularmapmaterial_p.h b/src/render/defaults/qnormaldiffusespecularmapmaterial_p.h
index b18401078..82187eabc 100644
--- a/src/render/defaults/qnormaldiffusespecularmapmaterial_p.h
+++ b/src/render/defaults/qnormaldiffusespecularmapmaterial_p.h
@@ -56,7 +56,7 @@ class QNormalDiffuseSpecularMapMaterial;
class QNormalDiffuseSpecularMapMaterialPrivate : public QMaterialPrivate
{
public:
- QNormalDiffuseSpecularMapMaterialPrivate(QNormalDiffuseSpecularMapMaterial *qq);
+ QNormalDiffuseSpecularMapMaterialPrivate();
void init();
diff --git a/src/render/defaults/qpervertexcolormaterial.cpp b/src/render/defaults/qpervertexcolormaterial.cpp
index e2bc66f86..c1c68ce0e 100644
--- a/src/render/defaults/qpervertexcolormaterial.cpp
+++ b/src/render/defaults/qpervertexcolormaterial.cpp
@@ -51,8 +51,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate(QPerVertexColorMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QPerVertexColorMaterialPrivate
+ \internal
+*/
+QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate()
+ : QMaterialPrivate()
, m_vertexEffect(new QEffect())
, m_lightPositionParameter(new QParameter(QStringLiteral("lightPosition"), QVector4D(1.0f, 1.0f, 0.0f, 1.0f)))
, m_lightIntensityParameter(new QParameter(QStringLiteral("lightIntensity"), QVector3D(1.0f, 1.0f, 1.0f)))
@@ -91,7 +95,7 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate(QPerVertexColorMa
Constructs a new QPerVertexColorMaterial instance with parent object \a parent.
*/
QPerVertexColorMaterial::QPerVertexColorMaterial(QNode *parent)
- : QMaterial(*new QPerVertexColorMaterialPrivate(this), parent)
+ : QMaterial(*new QPerVertexColorMaterialPrivate, parent)
{
Q_D(QPerVertexColorMaterial);
d->init();
diff --git a/src/render/defaults/qpervertexcolormaterial_p.h b/src/render/defaults/qpervertexcolormaterial_p.h
index 72a5d5b22..8fdd4ce95 100644
--- a/src/render/defaults/qpervertexcolormaterial_p.h
+++ b/src/render/defaults/qpervertexcolormaterial_p.h
@@ -55,7 +55,7 @@ class QPerVertexColorMaterial;
class QPerVertexColorMaterialPrivate : public QMaterialPrivate
{
public:
- QPerVertexColorMaterialPrivate(QPerVertexColorMaterial *qq);
+ QPerVertexColorMaterialPrivate();
void init();
diff --git a/src/render/defaults/qphongmaterial.cpp b/src/render/defaults/qphongmaterial.cpp
index a6e336776..43e9f298c 100644
--- a/src/render/defaults/qphongmaterial.cpp
+++ b/src/render/defaults/qphongmaterial.cpp
@@ -51,8 +51,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QPhongMaterialPrivate::QPhongMaterialPrivate(QPhongMaterial *qq)
- : QMaterialPrivate(qq)
+/*!
+ \class Qt3D::QPhongMaterialPrivate
+ \internal
+*/
+QPhongMaterialPrivate::QPhongMaterialPrivate()
+ : QMaterialPrivate()
, m_phongEffect(new QEffect())
, m_ambientParameter(new QParameter(QStringLiteral("ka"), QColor::fromRgbF(0.05f, 0.05f, 0.05f, 1.0f)))
, m_diffuseParameter(new QParameter(QStringLiteral("kd"), QColor::fromRgbF(0.7f, 0.7f, 0.7f, 1.0f)))
@@ -97,7 +101,7 @@ QPhongMaterialPrivate::QPhongMaterialPrivate(QPhongMaterial *qq)
Constructs a new QPhongMaterial instance with parent object \a parent.
*/
QPhongMaterial::QPhongMaterial(QNode *parent)
- : QMaterial(*new QPhongMaterialPrivate(this), parent)
+ : QMaterial(*new QPhongMaterialPrivate, parent)
{
Q_D(QPhongMaterial);
QObject::connect(d->m_ambientParameter, SIGNAL(valueChanged()), this, SIGNAL(ambientChanged()));
@@ -110,16 +114,16 @@ QPhongMaterial::QPhongMaterial(QNode *parent)
/*!
\fn Qt3D::QPhongMaterial::~QPhongMaterial()
- Destroys the QPhongMaterial
+ Destroys the QPhongMaterial.
*/
QPhongMaterial::~QPhongMaterial()
{
}
/*!
- \fn QColor Qt3D::QPhongMaterial::ambient() const
+ \property Qt3D::QPhongMaterial::ambient
- Returns the ambient color.
+ Holds the ambient color.
*/
QColor QPhongMaterial::ambient() const
{
@@ -128,9 +132,9 @@ QColor QPhongMaterial::ambient() const
}
/*!
- \fn QColor Qt3D::QPhongMaterial::diffuse() const
+ \property Qt3D::QPhongMaterial::diffuse
- Returns the diffuse color.
+ Holds the diffuse color.
*/
QColor QPhongMaterial::diffuse() const
{
@@ -139,9 +143,9 @@ QColor QPhongMaterial::diffuse() const
}
/*!
- \fn QColor Qt3D::QPhongMaterial::specular() const
+ \property QColor Qt3D::QPhongMaterial::specular
- Returns the specular color.
+ Holds the specular color.
*/
QColor QPhongMaterial::specular() const
{
@@ -150,9 +154,9 @@ QColor QPhongMaterial::specular() const
}
/*!
- \fn Qt3D::QPhongMaterial::shininess() const
+ \property Qt3D::QPhongMaterial::shininess
- Returns the shininess exponent.
+ Holds the shininess exponent.
*/
float QPhongMaterial::shininess() const
{
@@ -160,44 +164,24 @@ float QPhongMaterial::shininess() const
return d->m_shininessParameter->value().toFloat();
}
-/*!
- \fn Qt3D::QPhongMaterial::setAmbient(const QColor &ambient)
-
- Sets the current ambient color to \a ambient.
-*/
void QPhongMaterial::setAmbient(const QColor &ambient)
{
Q_D(QPhongMaterial);
- d->m_shininessParameter->setValue(ambient);
+ d->m_ambientParameter->setValue(ambient);
}
-/*!
- \fn Qt3D::QPhongMaterial::setDiffuse(const QColor &diffuse)
-
- Sets the current diffuse color to \a diffuse.
-*/
void QPhongMaterial::setDiffuse(const QColor &diffuse)
{
Q_D(QPhongMaterial);
d->m_diffuseParameter->setValue(diffuse);
}
-/*!
- \fn Qt3D::QPhongMaterial::setSpecular(const QColor &specular)
-
- Sets the current specular color to \a specular.
-*/
void QPhongMaterial::setSpecular(const QColor &specular)
{
Q_D(QPhongMaterial);
d->m_specularParameter->setValue(specular);
}
-/*!
- \fn Qt3D::QPhongMaterial::setShininess(float shininess)
-
- Sets the current shininess exponent to \a shininess.
-*/
void QPhongMaterial::setShininess(float shininess)
{
Q_D(QPhongMaterial);
diff --git a/src/render/defaults/qphongmaterial_p.h b/src/render/defaults/qphongmaterial_p.h
index b59f6c229..be6af94cd 100644
--- a/src/render/defaults/qphongmaterial_p.h
+++ b/src/render/defaults/qphongmaterial_p.h
@@ -55,7 +55,7 @@ class QPhongMaterial;
class QPhongMaterialPrivate : public QMaterialPrivate
{
public:
- QPhongMaterialPrivate(QPhongMaterial *qq);
+ QPhongMaterialPrivate();
void init();
diff --git a/src/render/defaults/qskyboxentity.cpp b/src/render/defaults/qskyboxentity.cpp
new file mode 100644
index 000000000..457fa746a
--- /dev/null
+++ b/src/render/defaults/qskyboxentity.cpp
@@ -0,0 +1,284 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qskyboxentity.h"
+#include "qskyboxentity_p.h"
+
+#include <Qt3DCore/qtransform.h>
+#include <Qt3DRenderer/qeffect.h>
+#include <Qt3DRenderer/qtexture.h>
+#include <Qt3DRenderer/qmaterial.h>
+#include <Qt3DRenderer/qcullface.h>
+#include <Qt3DRenderer/qdepthtest.h>
+#include <Qt3DRenderer/qparameter.h>
+#include <Qt3DRenderer/qtechnique.h>
+#include <Qt3DRenderer/qcuboidmesh.h>
+#include <Qt3DRenderer/qrenderpass.h>
+#include <Qt3DRenderer/qopenglfilter.h>
+#include <Qt3DRenderer/qshaderprogram.h>
+#include <Qt3DCore/qtranslatetransform.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+
+/*!
+ * \class Qt3D::QSkyboxEntityPrivate
+ * \internal
+ */
+QSkyboxEntityPrivate::QSkyboxEntityPrivate()
+ : QEntityPrivate()
+ , m_effect(new QEffect())
+ , m_material(new QMaterial())
+ , m_skyboxTexture(new QTextureCubeMap())
+ , m_gl3Shader(new QShaderProgram())
+ , m_gl2es2Shader(new QShaderProgram())
+ , m_gl2Technique(new QTechnique())
+ , m_es2Technique(new QTechnique())
+ , m_gl3Technique(new QTechnique())
+ , m_gl2RenderPass(new QRenderPass())
+ , m_es2RenderPass(new QRenderPass())
+ , m_gl3RenderPass(new QRenderPass())
+ , m_mesh(new QCuboidMesh())
+ , m_transform(new QTransform())
+ , m_translate(new QTranslateTransform())
+ , m_textureParameter(new QParameter(QStringLiteral("skyboxTexture"), m_skyboxTexture))
+ , m_posXImage(new QTextureImage())
+ , m_posYImage(new QTextureImage())
+ , m_posZImage(new QTextureImage())
+ , m_negXImage(new QTextureImage())
+ , m_negYImage(new QTextureImage())
+ , m_negZImage(new QTextureImage())
+ , m_extension(QStringLiteral(".png"))
+{
+}
+
+/*!
+ * \internal
+ */
+void QSkyboxEntityPrivate::init()
+{
+ m_gl3Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/skybox.vert"))));
+ m_gl3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/skybox.frag"))));
+ m_gl2es2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.vert"))));
+ m_gl2es2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.frag"))));
+
+ m_gl3Technique->openGLFilter()->setApi(QOpenGLFilter::Desktop);
+ m_gl3Technique->openGLFilter()->setMajorVersion(3);
+ m_gl3Technique->openGLFilter()->setMajorVersion(1);
+ m_gl3Technique->openGLFilter()->setProfile(QOpenGLFilter::Core);
+
+ m_gl2Technique->openGLFilter()->setApi(QOpenGLFilter::Desktop);
+ m_gl2Technique->openGLFilter()->setMajorVersion(2);
+ m_gl2Technique->openGLFilter()->setMajorVersion(0);
+ m_gl2Technique->openGLFilter()->setProfile(QOpenGLFilter::None);
+
+ m_es2Technique->openGLFilter()->setApi(QOpenGLFilter::ES);
+ m_es2Technique->openGLFilter()->setMajorVersion(2);
+ m_es2Technique->openGLFilter()->setMajorVersion(0);
+ m_es2Technique->openGLFilter()->setProfile(QOpenGLFilter::None);
+
+ m_gl3RenderPass->setShaderProgram(m_gl3Shader);
+ m_gl2RenderPass->setShaderProgram(m_gl2es2Shader);
+ m_es2RenderPass->setShaderProgram(m_gl2es2Shader);
+
+ QCullFace *cullFront = new QCullFace();
+ cullFront->setMode(QCullFace::Front);
+ QDepthTest *depthTest = new QDepthTest();
+ depthTest->setFunc(QDepthTest::LessOrEqual);
+
+ m_gl3RenderPass->addRenderState(cullFront);
+ m_gl3RenderPass->addRenderState(depthTest);
+ m_gl2RenderPass->addRenderState(cullFront);
+ m_gl2RenderPass->addRenderState(depthTest);
+ m_es2RenderPass->addRenderState(cullFront);
+ m_es2RenderPass->addRenderState(depthTest);
+
+ m_gl3Technique->addPass(m_gl3RenderPass);
+ m_gl2Technique->addPass(m_gl2RenderPass);
+ m_es2Technique->addPass(m_es2RenderPass);
+
+ m_effect->addTechnique(m_gl3Technique);
+ m_effect->addTechnique(m_gl2Technique);
+ m_effect->addTechnique(m_es2Technique);
+
+ m_material->setEffect(m_effect);
+ m_material->addParameter(m_textureParameter);
+
+ m_transform->addTransform(m_translate);
+
+ m_mesh->setXYMeshResolution(QSize(2, 2));
+ m_mesh->setXZMeshResolution(QSize(2, 2));
+ m_mesh->setYZMeshResolution(QSize(2, 2));
+
+ m_posXImage->setCubeMapFace(QTextureCubeMap::CubeMapPositiveX);
+ m_posYImage->setCubeMapFace(QTextureCubeMap::CubeMapPositiveY);
+ m_posZImage->setCubeMapFace(QTextureCubeMap::CubeMapPositiveZ);
+ m_negXImage->setCubeMapFace(QTextureCubeMap::CubeMapNegativeX);
+ m_negYImage->setCubeMapFace(QTextureCubeMap::CubeMapNegativeY);
+ m_negZImage->setCubeMapFace(QTextureCubeMap::CubeMapNegativeZ);
+
+ m_skyboxTexture->setMagnificationFilter(QTextureCubeMap::Linear);
+ m_skyboxTexture->setMinificationFilter(QTextureCubeMap::Linear);
+ m_skyboxTexture->setGenerateMipMaps(false);
+ m_skyboxTexture->setWrapMode(QTextureWrapMode(QTextureWrapMode::ClampToEdge));
+
+ m_skyboxTexture->addTextureImage(m_posXImage);
+ m_skyboxTexture->addTextureImage(m_posYImage);
+ m_skyboxTexture->addTextureImage(m_posZImage);
+ m_skyboxTexture->addTextureImage(m_negXImage);
+ m_skyboxTexture->addTextureImage(m_negYImage);
+ m_skyboxTexture->addTextureImage(m_negZImage);
+
+ q_func()->addComponent(m_mesh);
+ q_func()->addComponent(m_material);
+ q_func()->addComponent(m_transform);
+}
+
+/*!
+ * \internal
+ */
+void QSkyboxEntityPrivate::reloadTexture()
+{
+ m_posXImage->setSource(QUrl(m_baseName + QStringLiteral("_posx") + m_extension));
+ m_posYImage->setSource(QUrl(m_baseName + QStringLiteral("_posy") + m_extension));
+ m_posZImage->setSource(QUrl(m_baseName + QStringLiteral("_posz") + m_extension));
+ m_negXImage->setSource(QUrl(m_baseName + QStringLiteral("_negx") + m_extension));
+ m_negYImage->setSource(QUrl(m_baseName + QStringLiteral("_negy") + m_extension));
+ m_negZImage->setSource(QUrl(m_baseName + QStringLiteral("_negz") + m_extension));
+}
+
+/*!
+ * \class Qt3D::QSkyboxEntity
+ *
+ * \brief Qt3D::QSkyboxEntity is a convenience Qt3D::QEntity subclass that can
+ * be used to insert a skybox in a 3D scene.
+ *
+ * By specifying a base name and an extension, Qt3D::QSkyboxEntity
+ * will take care of building a TextureCubeMap to be rendered at runtime. The
+ * images in the source directory should match the pattern:
+ * \b base name + * "_posx|_posy|_posz|_negx|_negy|_negz" + extension
+ *
+ * By default the extension defaults to .png.
+ *
+ * \note Please note that you shouldn't try to render skybox with an
+ * orthographic projection.
+ *
+ * \since 5.5
+ */
+
+/*!
+ * Constructs a new Qt3D::QSkyboxEntity object with \a parent as parent.
+ */
+QSkyboxEntity::QSkyboxEntity(QNode *parent)
+ : QEntity(*new QSkyboxEntityPrivate, parent)
+{
+ d_func()->init();
+}
+
+QSkyboxEntity::~QSkyboxEntity()
+{
+}
+
+/*!
+ * Sets the base name to \a baseName.
+ */
+void QSkyboxEntity::setBaseName(const QString &baseName)
+{
+ Q_D(QSkyboxEntity);
+ if (baseName != d->m_baseName) {
+ d->m_baseName = baseName;
+ emit sourceDirectoryChanged();
+ d->reloadTexture();
+ }
+}
+/*!
+ * Returns the base name.
+ */
+QString QSkyboxEntity::baseName() const
+{
+ Q_D(const QSkyboxEntity);
+ return d->m_baseName;
+}
+
+/*!
+ * Sets the extension to \a extension.
+ */
+void QSkyboxEntity::setExtension(const QString &extension)
+{
+ Q_D(QSkyboxEntity);
+ if (extension != d->m_extension) {
+ d->m_extension = extension;
+ emit extensionChanged();
+ d->reloadTexture();
+ }
+}
+
+/*!
+ * Returns the extension
+ */
+QString QSkyboxEntity::extension() const
+{
+ Q_D(const QSkyboxEntity);
+ return d->m_extension;
+}
+
+/*!
+ * Sets the camera position to \a cameraPosition.
+ */
+void QSkyboxEntity::setCameraPosition(const QVector3D &cameraPosition)
+{
+ Q_D(QSkyboxEntity);
+ if (cameraPosition != d->m_position) {
+ d->m_position = cameraPosition;
+ d->m_translate->setTranslation(d->m_position);
+ emit cameraPositionChanged();
+ }
+}
+
+/*!
+ * Returns the camera postion.
+ */
+QVector3D QSkyboxEntity::cameraPosition() const
+{
+ Q_D(const QSkyboxEntity);
+ return d->m_position;
+}
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/core/jobs/jobrunner_p.h b/src/render/defaults/qskyboxentity.h
index 14b5213e9..f2e7a76cb 100644
--- a/src/core/jobs/jobrunner_p.h
+++ b/src/render/defaults/qskyboxentity.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
@@ -34,55 +34,45 @@
**
****************************************************************************/
-#ifndef QT3D_JOBRUNNER_P_H
-#define QT3D_JOBRUNNER_P_H
+#ifndef QT3D_RENDER_QSKYBOXENTITY_H
+#define QT3D_RENDER_QSKYBOXENTITY_H
-#include "qaspectjobmanager.h"
-#include "task_p.h"
-
-#include <QtCore/QThread>
-#include <QtCore/QWaitCondition>
-#include <QtCore/QAtomicInt>
+#include <Qt3DCore/qentity.h>
+#include <Qt3DRenderer/qt3drenderer_global.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QThreadPooler;
+class QSkyboxEntityPrivate;
-class JobRunner : public QThread
+class QT3DRENDERERSHARED_EXPORT QSkyboxEntity : public QEntity
{
Q_OBJECT
-
public:
- explicit JobRunner(QThreadPooler *parent = 0);
- ~JobRunner();
+ explicit QSkyboxEntity(QNode *parent = 0);
+ ~QSkyboxEntity();
- void run() Q_DECL_OVERRIDE;
+ void setBaseName(const QString &path);
+ QString baseName() const;
- inline void setWaitConditions(QWaitCondition *jobAvailable)
- {
- m_jobAvailable = jobAvailable;
- }
- inline void setMutex(QMutex *mutex) { m_mutex = mutex; }
+ void setExtension(const QString &extension);
+ QString extension() const;
-private:
- void suspend();
+ void setCameraPosition(const QVector3D &cameraPosition);
+ QVector3D cameraPosition() const;
-private:
- QAtomicInt m_abort;
- QThreadPooler *m_pooler;
+Q_SIGNALS:
+ void sourceDirectoryChanged();
+ void extensionChanged();
+ void cameraPositionChanged();
- QWaitCondition *m_jobAvailable;
- QMutex *m_mutex; // For waiting next available job
-
-private Q_SLOTS:
- void shutDown();
+private:
+ Q_DECLARE_PRIVATE(QSkyboxEntity)
};
-} // namespace Qt3D
+} // Qt3D
QT_END_NAMESPACE
-#endif // QT3D_JOBRUNNER_P_H
-
+#endif // QT3D_RENDER_QSKYBOXENTITY_H
diff --git a/src/render/defaults/qskyboxentity_p.h b/src/render/defaults/qskyboxentity_p.h
new file mode 100644
index 000000000..a377dd520
--- /dev/null
+++ b/src/render/defaults/qskyboxentity_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_RENDER_QSKYBOXENTITY_P_H
+#define QT3D_RENDER_QSKYBOXENTITY_P_H
+
+#include <Qt3DCore/private/qentity_p.h>
+#include <QVector3D>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QTranslateTransform;
+class QTextureCubeMap;
+class QShaderProgram;
+class QSkyboxEntity;
+class QTextureImage;
+class QCuboidMesh;
+class QRenderPass;
+class QTechnique;
+class QTransform;
+class QParameter;
+class QMaterial;
+class QEffect;
+
+class QSkyboxEntityPrivate : public QEntityPrivate
+{
+ QSkyboxEntityPrivate();
+
+ void init();
+ void reloadTexture();
+
+ Q_DECLARE_PUBLIC(QSkyboxEntity)
+
+ QEffect *m_effect;
+ QMaterial *m_material;
+ QTextureCubeMap *m_skyboxTexture;
+ QShaderProgram *m_gl3Shader;
+ QShaderProgram *m_gl2es2Shader;
+ QTechnique *m_gl2Technique;
+ QTechnique *m_es2Technique;
+ QTechnique *m_gl3Technique;
+ QRenderPass *m_gl2RenderPass;
+ QRenderPass *m_es2RenderPass;
+ QRenderPass *m_gl3RenderPass;
+ QCuboidMesh *m_mesh;
+ QTransform *m_transform;
+ QTranslateTransform *m_translate;
+ QParameter *m_textureParameter;
+ QTextureImage *m_posXImage;
+ QTextureImage *m_posYImage;
+ QTextureImage *m_posZImage;
+ QTextureImage *m_negXImage;
+ QTextureImage *m_negYImage;
+ QTextureImage *m_negZImage;
+ QString m_extension;
+ QString m_baseName;
+ QVector3D m_position;
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_RENDER_QSKYBOXENTITY_P_H
+
diff --git a/src/render/doc/qt3drender.qdocconf b/src/render/doc/qt3drender.qdocconf
index fd896f36e..95b8e7888 100644
--- a/src/render/doc/qt3drender.qdocconf
+++ b/src/render/doc/qt3drender.qdocconf
@@ -35,7 +35,10 @@ exampledirs += ../../../examples/qt3d \
imagedirs += images
-Cpp.ignoretokens += QT3DRENDERERSHARED_EXPORT
+Cpp.ignoretokens += QT3DRENDERERSHARED_EXPORT \
+ QT3DRENDERERSHARED_PRIVATE_EXPORT
+
+Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY
navigation.landingpage = "Qt3D Render"
navigation.cppclassespage = "Qt3D Render C++ Classes"
diff --git a/src/render/doc/src/qt3drender-module.qdoc b/src/render/doc/src/qt3drender-module.qdoc
index dd2f22a3b..1deb4bff8 100644
--- a/src/render/doc/src/qt3drender-module.qdoc
+++ b/src/render/doc/src/qt3drender-module.qdoc
@@ -40,16 +40,24 @@
\brief The Qt3D Render module contains functionality to support 2D and 3D rendering using Qt3D.
\ingroup modules
- \qtvariable qt3drender
+ \qtvariable 3drender
The Qt3D Render module provides an aspect, components, and other supporting types necessary
to implement 2D and 3D rendering as part of the Qt3D framework.
+
+ Classes, types, and functions are declared under the \l [Qt3DCore]{Qt3D} namespace.
*/
/*!
- \namespace Qt3D
- \inmodule Qt3DRender
+ \qmlmodule Qt3D.Render 2.0
+ \title Qt3D Render QML Types
+ \ingroup qmlmodules
+
+ \brief Provides Qt3D QML types for rendering.
+
+ To import and use the module's QML types, use the following statement:
- The Qt3D namespace contains user-visible classes and types that provide the ability to render
- using the Qt3D framework.
+ \badcode
+ import Qt3D.Render 2.0
+ \endcode
*/
diff --git a/src/render/frontend/framegraph-components/framegraph-components.pri b/src/render/frontend/framegraph-components/framegraph-components.pri
index 0aadd035d..b26f70185 100644
--- a/src/render/frontend/framegraph-components/framegraph-components.pri
+++ b/src/render/frontend/framegraph-components/framegraph-components.pri
@@ -22,7 +22,10 @@ HEADERS += \
$$PWD/qframegraphnode.h \
$$PWD/qframegraphnode_p.h \
$$PWD/qframegraphselector.h \
- $$PWD/qframegraphselector_p.h
+ $$PWD/qframegraphselector_p.h \
+ $$PWD/qstateset.h \
+ $$PWD/qstateset_p.h \
+ $$PWD/qnodraw.h
SOURCES += \
$$PWD/qframegraph.cpp \
@@ -36,6 +39,8 @@ SOURCES += \
$$PWD/qsortmethod.cpp \
$$PWD/qsortcriterion.cpp \
$$PWD/qframegraphnode.cpp \
- $$PWD/qframegraphselector.cpp
+ $$PWD/qframegraphselector.cpp \
+ $$PWD/qstateset.cpp \
+ $$PWD/qnodraw.cpp
INCLUDEPATH += $$PWD
diff --git a/src/render/frontend/framegraph-components/qcameraselector.cpp b/src/render/frontend/framegraph-components/qcameraselector.cpp
index acd6711a2..b4dc83727 100644
--- a/src/render/frontend/framegraph-components/qcameraselector.cpp
+++ b/src/render/frontend/framegraph-components/qcameraselector.cpp
@@ -44,13 +44,22 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
+/*!
+ \class Qt3D::CameraSelector
+*/
+
+/*! \internal */
QCameraSelector::QCameraSelector(QCameraSelectorPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
}
-QCameraSelectorPrivate::QCameraSelectorPrivate(Qt3D::QCameraSelector *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QCameraSelectorPrivate
+ \internal
+*/
+QCameraSelectorPrivate::QCameraSelectorPrivate()
+ : QFrameGraphNodePrivate()
, m_camera(Q_NULLPTR)
{}
@@ -58,15 +67,13 @@ void QCameraSelector::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
const QCameraSelector *other = static_cast<const QCameraSelector*>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, other->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
if (other->d_func()->m_camera)
setCamera(qobject_cast<QEntity *>(QNode::clone(other->d_func()->m_camera)));
}
QCameraSelector::QCameraSelector(Qt3D::QNode *parent)
- : QFrameGraphNode(*new QCameraSelectorPrivate(this), parent)
+ : QFrameGraphNode(*new QCameraSelectorPrivate, parent)
{}
void QCameraSelector::setCamera(QEntity *camera)
diff --git a/src/render/frontend/framegraph-components/qcameraselector_p.h b/src/render/frontend/framegraph-components/qcameraselector_p.h
index 3f143a83d..1ef076557 100644
--- a/src/render/frontend/framegraph-components/qcameraselector_p.h
+++ b/src/render/frontend/framegraph-components/qcameraselector_p.h
@@ -49,7 +49,7 @@ class QCameraSelector;
class QCameraSelectorPrivate : public QFrameGraphNodePrivate
{
public:
- QCameraSelectorPrivate(QCameraSelector *qq);
+ QCameraSelectorPrivate();
Q_DECLARE_PUBLIC(QCameraSelector)
QEntity *m_camera;
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.cpp b/src/render/frontend/framegraph-components/qclearbuffer.cpp
index 48df3b945..e6fc20a84 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.cpp
+++ b/src/render/frontend/framegraph-components/qclearbuffer.cpp
@@ -42,8 +42,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QClearBufferPrivate::QClearBufferPrivate(QClearBuffer *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QClearBufferPrivate
+ \internal
+*/
+QClearBufferPrivate::QClearBufferPrivate()
+ : QFrameGraphNodePrivate()
, m_buffersType(QClearBuffer::None)
{
}
@@ -53,16 +57,14 @@ void QClearBuffer::copy(const QNode *ref)
QFrameGraphNode::copy(ref);
const QClearBuffer *b = static_cast<const QClearBuffer*>(ref);
d_func()->m_buffersType = b->d_func()->m_buffersType;
-
- Q_FOREACH (QFrameGraphNode *fgChild, b->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
}
QClearBuffer::QClearBuffer(QNode *parent)
- : QFrameGraphNode(*new QClearBufferPrivate(this), parent)
+ : QFrameGraphNode(*new QClearBufferPrivate, parent)
{
}
+/*! \internal */
QClearBuffer::QClearBuffer(QClearBufferPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.h b/src/render/frontend/framegraph-components/qclearbuffer.h
index 8e6991577..1559511d3 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.h
+++ b/src/render/frontend/framegraph-components/qclearbuffer.h
@@ -48,7 +48,6 @@ class QClearBufferPrivate;
class QT3DRENDERERSHARED_EXPORT QClearBuffer : public QFrameGraphNode
{
Q_OBJECT
- Q_ENUMS(BufferType)
Q_PROPERTY(BufferType buffers READ buffers WRITE setBuffers NOTIFY buffersChanged)
public:
explicit QClearBuffer(QNode *parent = 0);
@@ -63,6 +62,7 @@ public:
ColorDepthStencilBuffer = ColorBuffer | DepthStencilBuffer,
AllBuffers = 0xFFFFFFFF
};
+ Q_ENUM(BufferType)
void setBuffers(BufferType buffers);
BufferType buffers() const;
diff --git a/src/render/frontend/framegraph-components/qclearbuffer_p.h b/src/render/frontend/framegraph-components/qclearbuffer_p.h
index 14ad5244e..f78b89429 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer_p.h
+++ b/src/render/frontend/framegraph-components/qclearbuffer_p.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QClearBufferPrivate : public QFrameGraphNodePrivate
{
public:
- QClearBufferPrivate(QClearBuffer *qq);
+ QClearBufferPrivate();
Q_DECLARE_PUBLIC(QClearBuffer)
QClearBuffer::BufferType m_buffersType;
diff --git a/src/render/frontend/framegraph-components/qframegraph.cpp b/src/render/frontend/framegraph-components/qframegraph.cpp
index 0b5482ae5..543313ba8 100644
--- a/src/render/frontend/framegraph-components/qframegraph.cpp
+++ b/src/render/frontend/framegraph-components/qframegraph.cpp
@@ -44,13 +44,44 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QFrameGraphPrivate::QFrameGraphPrivate(QFrameGraph *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QFrameGraphPrivate
+ \internal
+*/
+QFrameGraphPrivate::QFrameGraphPrivate()
+ : QComponentPrivate()
, m_activeFrameGraph(Q_NULLPTR)
{
}
+/*!
+ \class FrameGraph
+ \inmodule Qt3DRender
+ \since 5.3
+
+ \brief Defines the rendering method to be used by the renderer
+
+ FrameGraph is the Component that has an activeFrameGraph property
+ that should reference the root FrameGraphItem of a frame graph
+ tree. The Entity that contains a FrameGraph property defines the
+ rendering method to be used by the renderer.
+
+ \note Only one FrameGraph can be active at any moment.
+ */
+
+/*!
+ \qmltype FrameGraph
+ \instantiates Qt3D::QFrameGraph
+ \inherits Component3D
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For OpenGL ...
+*/
+
+/*! \fn void Qt3D::QFrameGraph::copy(const QNode *ref)
+ Copies the \a ref instance into this one.
+ */
void QFrameGraph::copy(const QNode *ref)
{
QComponent::copy(ref);
@@ -59,30 +90,30 @@ void QFrameGraph::copy(const QNode *ref)
}
/*!
- * \class Qt3D::QFrameGraph
- * \inmodule Qt3DRender
- * \brief Component that has an activeFrameGraph property that should
- * reference the root FrameGraphItem of a frame graph tree. The Entity
- * that contains a FrameGraph property defines the rendering method to
- * be used by the renderer.
- *
- * Note that only a single FrameGraph can be active at any moment.
- *
- * \since 5.3
- */
-
+ \fn Qt3D::QFrameGraph::QFrameGraph(QNode *parent)
+ Constructs a new QFrameGraph with the specified \a parent.
+*/
QFrameGraph::QFrameGraph(QNode *parent)
- : QComponent(*new QFrameGraphPrivate(this), parent)
+ : QComponent(*new QFrameGraphPrivate, parent)
{
}
+/*! \internal */
QFrameGraph::QFrameGraph(QFrameGraphPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
}
/*!
- * Returns the current activeFrameGraph root node.
+ \qmlproperty Qt3D.Render::FrameGraphNode Qt3D.Render::FrameGraph::activeFrameGraph
+
+ Holds the current activeFrameGraph root node.
+*/
+
+/*!
+ \property Qt3D::QFrameGraph::activeFrameGraph
+
+ Holds the current activeFrameGraph root node.
*/
QFrameGraphNode *QFrameGraph::activeFrameGraph() const
{
@@ -90,22 +121,16 @@ QFrameGraphNode *QFrameGraph::activeFrameGraph() const
return d->m_activeFrameGraph;
}
-/*!
- * Sets the root node \a activeFrameGraph of the FrameGraph.
- */
void QFrameGraph::setActiveFrameGraph(QFrameGraphNode *activeFrameGraph)
{
Q_D(QFrameGraph);
if (activeFrameGraph != d->m_activeFrameGraph) {
- d->m_activeFrameGraph = activeFrameGraph;
- emit activeFrameGraphChanged();
if (!activeFrameGraph->parent())
activeFrameGraph->setParent(this);
- if (d->m_changeArbiter != Q_NULLPTR) {
- // TO DO : Add QChangeArbiterNotification
- }
+ d->m_activeFrameGraph = activeFrameGraph;
+ emit activeFrameGraphChanged();
}
}
diff --git a/src/render/frontend/framegraph-components/qframegraph_p.h b/src/render/frontend/framegraph-components/qframegraph_p.h
index fd1d056b8..c4963a4ea 100644
--- a/src/render/frontend/framegraph-components/qframegraph_p.h
+++ b/src/render/frontend/framegraph-components/qframegraph_p.h
@@ -50,7 +50,7 @@ class QFrameGraphNode;
class QFrameGraphPrivate : public QComponentPrivate
{
public:
- QFrameGraphPrivate(QFrameGraph *qq);
+ QFrameGraphPrivate();
Q_DECLARE_PUBLIC(QFrameGraph)
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp
index 6a70ddb32..2f81b786e 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.cpp
+++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp
@@ -37,65 +37,82 @@
#include "qframegraphnode.h"
#include "qframegraphnode_p.h"
-/*!
- * \class Qt3D::QFrameGraphNode
- *
- * \brief Base class of all FrameGraph configuration nodes.
- *
- * This is an abstract class so it cannot be instanced directly
- * but rather through one of its subclasses.
- *
- * \since 5.3
- */
-
QT_BEGIN_NAMESPACE
namespace Qt3D {
-QFrameGraphNodePrivate::QFrameGraphNodePrivate(QFrameGraphNode *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QFrameGraphNodePrivate
+ \internal
+*/
+QFrameGraphNodePrivate::QFrameGraphNodePrivate()
+ : QNodePrivate()
, m_enabled(true)
{
}
-void QFrameGraphNode::copy(const QNode *ref)
-{
- QNode::copy(ref);
-}
+/*!
+ \class QFrameGraphNode
+ \inmodule Qt3DRender
+ \since 5.5
+
+ \brief Base class of all FrameGraph configuration nodes.
+
+ This is an abstract class so it cannot be instanced directly
+ but rather through one of its subclasses.
+ */
+
+/*!
+ \qmltype FrameGraphNode
+ \inqmlmodule Qt3D.Render
+ \instantiates QFrameGraphNode
+ \inherits Node
+ \since 5.5
+ \qmlabstract
+*/
+
+/*!
+ The constructor creates an instance with the specified \a parent.
+ */
QFrameGraphNode::QFrameGraphNode(QNode *parent)
- : QNode(*new QFrameGraphNodePrivate(this), parent)
+ : QNode(*new QFrameGraphNodePrivate, parent)
{
}
-QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent)
- : QNode(dd, parent)
+/*!
+ Returns a pointer to the parent.
+ */
+QFrameGraphNode *QFrameGraphNode::parentFrameGraphNode() const
{
-}
+ QFrameGraphNode *parentFGNode = Q_NULLPTR;
+ QNode *parentN = parentNode();
-void QFrameGraphNode::appendFrameGraphNode(QFrameGraphNode *item)
-{
- Q_D(QFrameGraphNode);
- if (!d->m_fgChildren.contains(item)) {
- if (!item->parent())
- item->setParent(this);
- d->m_fgChildren.append(item);
+ while (parentN) {
+ if ((parentFGNode = qobject_cast<QFrameGraphNode *>(parentN)) != Q_NULLPTR)
+ break;
+ parentN = parentN->parentNode();
}
+ return parentFGNode;
}
-void QFrameGraphNode::removeFrameGraphNode(QFrameGraphNode *item)
+/*! \internal */
+QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent)
+ : QNode(dd, parent)
{
- Q_D(QFrameGraphNode);
- if (!d->m_fgChildren.contains(item)) {
- d->m_fgChildren.removeOne(item);
- }
}
-QList<QFrameGraphNode *> QFrameGraphNode::frameGraphChildren() const
-{
- Q_D(const QFrameGraphNode);
- return d->m_fgChildren;
-}
+/*!
+ \qmlproperty bool Qt3D.Render::FrameGraphNode::enabled
+
+ Holds whether the frame graph node is enabled or disabled.
+*/
+
+/*!
+ \property Qt3D::QFrameGraphNode::enabled
+
+ Holds whether the frame graph node is enabled or disabled.
+*/
bool QFrameGraphNode::isEnabled() const
{
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.h b/src/render/frontend/framegraph-components/qframegraphnode.h
index b6f8bf1f4..7fb5e4dfa 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.h
+++ b/src/render/frontend/framegraph-components/qframegraphnode.h
@@ -54,16 +54,13 @@ class QT3DRENDERERSHARED_EXPORT QFrameGraphNode : public QNode
public:
explicit QFrameGraphNode(QNode *parent = 0);
- void appendFrameGraphNode(QFrameGraphNode *item);
- void removeFrameGraphNode(QFrameGraphNode *item);
- QList<QFrameGraphNode *> frameGraphChildren() const;
+ QFrameGraphNode *parentFrameGraphNode() const;
bool isEnabled() const;
void setEnabled(bool enabled);
protected:
QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
Q_SIGNALS:
void enabledChanged();
diff --git a/src/render/frontend/framegraph-components/qframegraphnode_p.h b/src/render/frontend/framegraph-components/qframegraphnode_p.h
index ecf4f6b78..02cfc5be1 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode_p.h
+++ b/src/render/frontend/framegraph-components/qframegraphnode_p.h
@@ -50,7 +50,7 @@ class QFrameGraphNode;
class QFrameGraphNodePrivate : public QNodePrivate
{
public:
- QFrameGraphNodePrivate(QFrameGraphNode *qq);
+ QFrameGraphNodePrivate();
Q_DECLARE_PUBLIC(QFrameGraphNode)
bool m_enabled;
diff --git a/src/render/frontend/framegraph-components/qframegraphselector.cpp b/src/render/frontend/framegraph-components/qframegraphselector.cpp
index 3bd2cc398..75a20efa8 100644
--- a/src/render/frontend/framegraph-components/qframegraphselector.cpp
+++ b/src/render/frontend/framegraph-components/qframegraphselector.cpp
@@ -41,8 +41,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QFrameGraphSelectorPrivate::QFrameGraphSelectorPrivate(QFrameGraphSelector *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QFrameGraphSelectorPrivate
+ \internal
+*/
+QFrameGraphSelectorPrivate::QFrameGraphSelectorPrivate()
+ : QFrameGraphNodePrivate()
{
}
@@ -61,7 +65,7 @@ QFrameGraphSelectorPrivate::QFrameGraphSelectorPrivate(QFrameGraphSelector *qq)
Constructs a new Qt3D::QFrameGraphSelector instance using \a parent as parent.
*/
QFrameGraphSelector::QFrameGraphSelector(QNode *parent)
- : QFrameGraphNode(*new QFrameGraphSelectorPrivate(this), parent)
+ : QFrameGraphNode(*new QFrameGraphSelectorPrivate, parent)
{
}
@@ -91,9 +95,6 @@ void QFrameGraphSelector::setSelectionFunctor(QFrameGraphSelectorFunctorPtr func
void QFrameGraphSelector::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
- const QFrameGraphSelector *other = static_cast<const QFrameGraphSelector*>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, other->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
}
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qframegraphselector_p.h b/src/render/frontend/framegraph-components/qframegraphselector_p.h
index e1a6857bc..28228dcdb 100644
--- a/src/render/frontend/framegraph-components/qframegraphselector_p.h
+++ b/src/render/frontend/framegraph-components/qframegraphselector_p.h
@@ -50,7 +50,7 @@ typedef QSharedPointer<QFrameGraphSelectorFunctor> QFrameGraphSelectorFunctorPtr
class QFrameGraphSelectorPrivate : public QFrameGraphNodePrivate
{
public:
- QFrameGraphSelectorPrivate(QFrameGraphSelector *qq);
+ QFrameGraphSelectorPrivate();
QFrameGraphSelectorFunctorPtr m_selectionFunctor;
diff --git a/src/render/frontend/framegraph-components/qlayerfilter.cpp b/src/render/frontend/framegraph-components/qlayerfilter.cpp
index 9ba19cd7e..cfccfb987 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter.cpp
+++ b/src/render/frontend/framegraph-components/qlayerfilter.cpp
@@ -42,30 +42,66 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QLayerFilterPrivate::QLayerFilterPrivate(QLayerFilter *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QLayerFilterPrivate
+ \internal
+*/
+QLayerFilterPrivate::QLayerFilterPrivate()
+ : QFrameGraphNodePrivate()
{
}
+/*!
+ \class QLayerFilter
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief The QLayerFilter class provides ...
+*/
+
+/*!
+ \qmltype LayerFilter
+ \instantiates Qt3D::QLayerFilter
+ \inherits FrameGraphNode
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For ...
+*/
+
+/*! \fn void Qt3D::QLayerFilter::copy(const QNode *ref)
+ Copies the \a ref instance into this one.
+ */
void QLayerFilter::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
const QLayerFilter *layer = static_cast<const QLayerFilter*>(ref);
d_func()->m_layers = layer->d_func()->m_layers;
- Q_FOREACH (QFrameGraphNode *fgChild, layer->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
}
+
+/*! \fn Qt3D::QLayerFilter::QLayerFilter(QNode *parent)
+ Constructs a new QLayerFilter with the specified \a parent.
+ */
QLayerFilter::QLayerFilter(QNode *parent)
- : QFrameGraphNode(*new QLayerFilterPrivate(this), parent)
+ : QFrameGraphNode(*new QLayerFilterPrivate, parent)
{
}
+/*! \internal */
QLayerFilter::QLayerFilter(QLayerFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
}
+/*!
+ \property Qt3D::QLayerFilter::layers
+
+ */
+
+/*!
+ \qmlproperty stringlist Qt3D.Render::LayerFilter::layers
+
+*/
+
void QLayerFilter::setLayers(const QStringList &layers)
{
Q_D(QLayerFilter);
diff --git a/src/render/frontend/framegraph-components/qlayerfilter_p.h b/src/render/frontend/framegraph-components/qlayerfilter_p.h
index 6fd69bfa3..d998652e4 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter_p.h
+++ b/src/render/frontend/framegraph-components/qlayerfilter_p.h
@@ -49,7 +49,7 @@ class QLayerFilter;
class QT3DRENDERERSHARED_EXPORT QLayerFilterPrivate : public QFrameGraphNodePrivate
{
public:
- explicit QLayerFilterPrivate(QLayerFilter *qq);
+ QLayerFilterPrivate();
Q_DECLARE_PUBLIC(QLayerFilter)
QStringList m_layers;
diff --git a/src/render/frontend/framegraph-components/qnodraw.cpp b/src/render/frontend/framegraph-components/qnodraw.cpp
new file mode 100644
index 000000000..0c11f5b34
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qnodraw.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qnodraw.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+/*!
+ * \class Qt3D::QNoDraw::QNoDraw
+ *
+ * \brief When a Qt3D::QNoDraw node is present in a FrameGraph branch, this
+ * prevents the renderer from rendering any primitive.
+ *
+ * Qt3D::QNoDraw should be used when the FrameGraph needs to set up some render
+ * states or clear some buffers without requiring any mesh to be drawn. It has
+ * the same effect as having a Qt3D::QRenderPassFilter that matches none of
+ * available Qt3D::QRenderPass instances of the scene without the overhead cost
+ * of actually performing the filtering.
+ *
+ * \since 5.5
+ */
+
+QNoDraw::QNoDraw(QNode *parent)
+ : QFrameGraphNode(parent)
+{
+}
+
+QNoDraw::~QNoDraw()
+{
+}
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/examples/qt3d/exampleresources/exampleresources.cpp b/src/render/frontend/framegraph-components/qnodraw.h
index 6249f5bdd..99174573b 100644
--- a/examples/qt3d/exampleresources/exampleresources.cpp
+++ b/src/render/frontend/framegraph-components/qnodraw.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
@@ -34,16 +34,28 @@
**
****************************************************************************/
-#include "exampleresources.h"
+#ifndef QT3D_QNODRAW_H
+#define QT3D_QNODRAW_H
-#include <QDebug>
+#include <Qt3DRenderer/qframegraphnode.h>
-bool initializeAssetResources( const QString& fileName )
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QT3DRENDERERSHARED_EXPORT QNoDraw : public QFrameGraphNode
{
- QString assetPath = QStringLiteral( QT3D_XSTRINGIFY( ASSETS ) ) + fileName;
- qDebug() << "assetPath =" << assetPath;
- bool b = QResource::registerResource( assetPath );
- if ( !b )
- qDebug() << "Failed to load assets";
- return b;
-}
+ Q_OBJECT
+public:
+ explicit QNoDraw(QNode *parent = 0);
+ ~QNoDraw();
+
+private:
+ QT3D_CLONEABLE(QNoDraw)
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QNODRAW_H
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
index 5f22b90f2..85fddc7b6 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
@@ -37,17 +37,24 @@
#include "qrenderpassfilter.h"
#include "qrenderpassfilter_p.h"
-#include "qannotation.h"
#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRenderer/qannotation.h>
+#include <Qt3DRenderer/qparameter.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
+/*!
+ \class Qt3D::QRenderPassFilterPrivate
+ \internal
+*/
+
QRenderPassFilter::QRenderPassFilter(QNode *parent)
- : QFrameGraphNode(*new QRenderPassFilterPrivate(this), parent)
+ : QFrameGraphNode(*new QRenderPassFilterPrivate, parent)
{}
+/*! \internal */
QRenderPassFilter::QRenderPassFilter(QRenderPassFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
@@ -97,12 +104,51 @@ void QRenderPassFilter::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
const QRenderPassFilter *other = static_cast<const QRenderPassFilter*>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, other->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
Q_FOREACH (QAnnotation *c, other->d_func()->m_includeList)
addInclude(qobject_cast<QAnnotation *>(QNode::clone(c)));
}
+void QRenderPassFilter::addParameter(QParameter *parameter)
+{
+ Q_D(QRenderPassFilter);
+ if (!d->m_parameters.contains(parameter)) {
+ d->m_parameters.append(parameter);
+
+ // We need to add it as a child of the current node if it has been declared inline
+ // Or not previously added as a child of the current node so that
+ // 1) The backend gets notified about it's creation
+ // 2) When the current node is destroyed, the child parameters get destroyed as well
+ if (!parameter->parent())
+ parameter->setParent(this);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ }
+}
+
+void QRenderPassFilter::removeParameter(QParameter *parameter)
+{
+ Q_D(QRenderPassFilter);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ d->m_parameters.removeOne(parameter);
+}
+
+QList<QParameter *> QRenderPassFilter::parameters() const
+{
+ Q_D(const QRenderPassFilter);
+ return d->m_parameters;
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.h b/src/render/frontend/framegraph-components/qrenderpassfilter.h
index a7ff6ee03..27848d19f 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.h
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.h
@@ -48,6 +48,7 @@ namespace Qt3D {
class QRenderPassFilterPrivate;
class QAnnotation;
+class QParameter;
class QT3DRENDERERSHARED_EXPORT QRenderPassFilter : public QFrameGraphNode
{
@@ -60,6 +61,10 @@ public:
void addInclude(QAnnotation *criterion);
void removeInclude(QAnnotation *criterion);
+ void addParameter(QParameter *p);
+ void removeParameter(QParameter *p);
+ QList<QParameter *> parameters() const;
+
protected:
QRenderPassFilter(QRenderPassFilterPrivate &dd, QNode *parent = 0);
void copy(const QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter_p.h b/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
index 7fcba6e6e..a849bf0c2 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
@@ -48,13 +48,14 @@ class QRenderPassFilter;
class QRenderPassFilterPrivate : public QFrameGraphNodePrivate
{
public:
- QRenderPassFilterPrivate(QRenderPassFilter *qq)
- : QFrameGraphNodePrivate(qq)
+ QRenderPassFilterPrivate()
+ : QFrameGraphNodePrivate()
{}
Q_DECLARE_PUBLIC(QRenderPassFilter)
QString m_renderPassName;
QList<QAnnotation *> m_includeList;
+ QList<QParameter *> m_parameters;
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.cpp b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
index ff250b4e2..fd5a58640 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.cpp
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
@@ -44,8 +44,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderTargetSelectorPrivate::QRenderTargetSelectorPrivate(QRenderTargetSelector *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QRenderTargetSelectorPrivate
+ \internal
+*/
+QRenderTargetSelectorPrivate::QRenderTargetSelectorPrivate()
+ : QFrameGraphNodePrivate()
, m_target(Q_NULLPTR)
{
}
@@ -55,15 +59,13 @@ void QRenderTargetSelector::copy(const QNode *ref)
QFrameGraphNode::copy(ref);
const QRenderTargetSelector *other = static_cast<const QRenderTargetSelector*>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, other->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
if (other->d_func()->m_target)
setTarget(qobject_cast<QRenderTarget *>(QNode::clone(other->d_func()->m_target)));
}
QRenderTargetSelector::QRenderTargetSelector(QNode *parent)
- : QFrameGraphNode(*new QRenderTargetSelectorPrivate(this), parent)
+ : QFrameGraphNode(*new QRenderTargetSelectorPrivate, parent)
{
}
@@ -86,6 +88,41 @@ QRenderTarget *QRenderTargetSelector::target() const
return d->m_target;
}
+/*!
+ * \internal
+ * Sets the draw buffers \a buffers to be used. The draw buffers should be
+ * matching the Qt3D::QRenderAttachment::RenderAttachmentType
+ * defined in the attachments of the Qt3D::QRenderTarget associated to the
+ * Qt3D::QRenderTargetSelector instance.
+ *
+ * \note At render time, if no draw buffer has been specified, the renderer will
+ * default to using all the attachments' draw buffers.
+ *
+ */
+void QRenderTargetSelector::setDrawBuffers(const QList<QRenderAttachment::RenderAttachmentType> &buffers)
+{
+ Q_D(QRenderTargetSelector);
+ if (buffers != d->m_drawBuffers) {
+ d->m_drawBuffers = buffers;
+
+ if (d->m_changeArbiter) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, id()));
+ change->setPropertyName("drawBuffers");
+ change->setValue(QVariant::fromValue(d->m_drawBuffers));
+ d->notifyObservers(change);
+ }
+ }
+}
+
+/*!
+ * Returns the list of draw buffers for the current Qt3D::QRenderTargetSelector instance.
+ */
+QList<QRenderAttachment::RenderAttachmentType> QRenderTargetSelector::drawBuffers() const
+{
+ Q_D(const QRenderTargetSelector);
+ return d->m_drawBuffers;
+}
+
QRenderTargetSelector::QRenderTargetSelector(QRenderTargetSelectorPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.h b/src/render/frontend/framegraph-components/qrendertargetselector.h
index b467673bc..f98f05f8f 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.h
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.h
@@ -40,6 +40,7 @@
#include <Qt3DRenderer/qt3drenderer_global.h>
#include <Qt3DCore/qnode.h>
#include <Qt3DRenderer/qframegraphnode.h>
+#include <Qt3DRenderer/qrenderattachment.h>
QT_BEGIN_NAMESPACE
@@ -58,6 +59,9 @@ public:
void setTarget(QRenderTarget *target);
QRenderTarget *target() const;
+ void setDrawBuffers(const QList<QRenderAttachment::RenderAttachmentType> &buffers);
+ QList<QRenderAttachment::RenderAttachmentType> drawBuffers() const;
+
Q_SIGNALS:
void targetChanged();
@@ -74,4 +78,6 @@ private:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QList<Qt3D::QRenderAttachment::RenderAttachmentType>)
+
#endif // QT3D_QRENDERTARGETSELECTOR_H
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector_p.h b/src/render/frontend/framegraph-components/qrendertargetselector_p.h
index 195dc6938..10a27ee3a 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector_p.h
+++ b/src/render/frontend/framegraph-components/qrendertargetselector_p.h
@@ -49,10 +49,11 @@ class QRenderTarget;
class QRenderTargetSelectorPrivate : public QFrameGraphNodePrivate
{
public:
- QRenderTargetSelectorPrivate(QRenderTargetSelector *qq);
+ QRenderTargetSelectorPrivate();
Q_DECLARE_PUBLIC(QRenderTargetSelector)
QRenderTarget *m_target;
+ QList<QRenderAttachment::RenderAttachmentType> m_drawBuffers;
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.cpp b/src/render/frontend/framegraph-components/qsortcriterion.cpp
index f7381ec6d..85b5cd9fa 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.cpp
+++ b/src/render/frontend/framegraph-components/qsortcriterion.cpp
@@ -42,8 +42,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QSortCriterionPrivate::QSortCriterionPrivate(QSortCriterion *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QSortCriterionPrivate
+ \internal
+*/
+QSortCriterionPrivate::QSortCriterionPrivate()
+ : QNodePrivate()
, m_sort(QSortCriterion::StateChangeCost)
{
}
@@ -56,7 +60,7 @@ void QSortCriterion::copy(const QNode *ref)
}
QSortCriterion::QSortCriterion(QNode *parent)
- : QNode(*new QSortCriterionPrivate(this), parent)
+ : QNode(*new QSortCriterionPrivate, parent)
{
}
@@ -76,6 +80,7 @@ void QSortCriterion::setSort(QSortCriterion::SortType &sort)
}
}
+/*! \internal */
QSortCriterion::QSortCriterion(QSortCriterionPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.h b/src/render/frontend/framegraph-components/qsortcriterion.h
index f8934c952..ef413eeb5 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.h
+++ b/src/render/frontend/framegraph-components/qsortcriterion.h
@@ -49,7 +49,6 @@ class QSortCriterionPrivate;
class QT3DRENDERERSHARED_EXPORT QSortCriterion : public QNode
{
Q_OBJECT
- Q_ENUMS(SortType)
Q_PROPERTY(Qt3D::QSortCriterion::SortType sort READ sort WRITE setSort NOTIFY sortChanged)
public:
explicit QSortCriterion(QNode *parent = 0);
@@ -59,6 +58,7 @@ public:
BackToFront = (1 << 1),
Material = (1 << 2)
};
+ Q_ENUM(SortType)
SortType sort() const;
void setSort(SortType &sort);
diff --git a/src/render/frontend/framegraph-components/qsortcriterion_p.h b/src/render/frontend/framegraph-components/qsortcriterion_p.h
index 7e9d963ec..7e75c9a59 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion_p.h
+++ b/src/render/frontend/framegraph-components/qsortcriterion_p.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QSortCriterionPrivate : public QNodePrivate
{
public:
- QSortCriterionPrivate(QSortCriterion *qq);
+ QSortCriterionPrivate();
Q_DECLARE_PUBLIC(QSortCriterion)
QSortCriterion::SortType m_sort;
diff --git a/src/render/frontend/framegraph-components/qsortmethod.cpp b/src/render/frontend/framegraph-components/qsortmethod.cpp
index 08725b6f6..4f70dd7cd 100644
--- a/src/render/frontend/framegraph-components/qsortmethod.cpp
+++ b/src/render/frontend/framegraph-components/qsortmethod.cpp
@@ -44,8 +44,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QSortMethodPrivate::QSortMethodPrivate(QSortMethod *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QSortMethodPrivate
+ \internal
+*/
+QSortMethodPrivate::QSortMethodPrivate()
+ : QFrameGraphNodePrivate()
{
}
@@ -58,10 +62,11 @@ void QSortMethod::copy(const QNode *ref)
}
QSortMethod::QSortMethod(QNode *parent)
- : QFrameGraphNode(*new QSortMethodPrivate(this), parent)
+ : QFrameGraphNode(*new QSortMethodPrivate, parent)
{
}
+/*! \internal */
QSortMethod::QSortMethod(QSortMethodPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
diff --git a/src/render/frontend/framegraph-components/qsortmethod_p.h b/src/render/frontend/framegraph-components/qsortmethod_p.h
index 3fc6e55d6..4ee604463 100644
--- a/src/render/frontend/framegraph-components/qsortmethod_p.h
+++ b/src/render/frontend/framegraph-components/qsortmethod_p.h
@@ -49,7 +49,7 @@ class QSortCriterion;
class QSortMethodPrivate : public QFrameGraphNodePrivate
{
public:
- QSortMethodPrivate(QSortMethod *qq);
+ QSortMethodPrivate();
Q_DECLARE_PUBLIC(QSortMethod)
QList<QSortCriterion *> m_criteria;
};
diff --git a/src/render/frontend/framegraph-components/qstateset.cpp b/src/render/frontend/framegraph-components/qstateset.cpp
new file mode 100644
index 000000000..6f5149b87
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qstateset.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qstateset.h"
+#include "qstateset_p.h"
+
+#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRenderer/qrenderstate.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+QStateSetPrivate::QStateSetPrivate()
+ : QFrameGraphNodePrivate()
+{
+}
+
+/*!
+ * \class Qt3D::QStateSet
+ *
+ * \brief The Qt3D::QStateSet FrameGraph node offers a way of specifying a set
+ * of Qt3D::QRenderState to be applied during the execution of a FrameGraph
+ * branch.
+ *
+ * States set on a Qt3D::QStateSet are set globally, contrary to the per
+ * Material states that can be set on a Qt3D::QRenderPass. By default an empty
+ * Qt3D::QStateSet will result in all render states being disabled when
+ * executed. Adding a Qt3D::QRenderState state explicitly enables that render
+ * state at runtime.
+ *
+ * \since 5.5
+ *
+ * \sa Qt3D::QRenderState, Qt3D::QRenderPass
+ */
+
+QStateSet::QStateSet(QNode *parent)
+ : QFrameGraphNode(*new QStateSetPrivate, parent)
+{
+}
+
+QStateSet::QStateSet(QStateSetPrivate &dd, QNode *parent)
+ : QFrameGraphNode(dd, parent)
+{
+}
+
+QStateSet::~QStateSet()
+{
+}
+
+void QStateSet::copy(const QNode *ref)
+{
+ QFrameGraphNode::copy(ref);
+ const QStateSet *other = static_cast<const QStateSet*>(ref);
+
+ Q_FOREACH (QRenderState *renderState, other->d_func()->m_renderStates)
+ addRenderState(qobject_cast<QRenderState *>(QNode::clone(renderState)));
+}
+
+/*!
+ * Adds a new Qt3D::QRenderState \a state to the Qt3D::QStateSet instance.
+ *
+ * \note Not setting any Qt3D::QRenderState state on a Qt3D::QStateSet instance
+ * implies all the render states will be disabled at render time.
+ */
+void QStateSet::addRenderState(QRenderState *state)
+{
+ Q_D(QStateSet);
+
+ if (!d->m_renderStates.contains(state)) {
+ d->m_renderStates.append(state);
+
+ if (!state->parent())
+ state->setParent(this);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
+ change->setPropertyName("renderState");
+ change->setValue(QVariant::fromValue(QNodePtr(QNode::clone(state))));
+ d->notifyObservers(change);
+ }
+ }
+}
+
+/*!
+ * Removes the Qt3D::QRenderState \a state from the Qt3D::QStateSet instance.
+ */
+void QStateSet::removeRenderState(QRenderState *state)
+{
+ Q_D(QStateSet);
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, id()));
+ change->setPropertyName("renderState");
+ change->setValue(QVariant::fromValue(state->id()));
+ d->notifyObservers(change);
+ }
+ d->m_renderStates.removeOne(state);
+}
+
+/*!
+ * Returns the list of Qt3D::QRenderState that compose the Qt3D::QStateSet instance.
+ */
+QList<QRenderState *> QStateSet::renderStates() const
+{
+ Q_D(const QStateSet);
+ return d->m_renderStates;
+}
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qstateset.h b/src/render/frontend/framegraph-components/qstateset.h
new file mode 100644
index 000000000..24c8609ed
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qstateset.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_QSTATESET_H
+#define QT3D_QSTATESET_H
+
+#include <Qt3DRenderer/qframegraphnode.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QStateSetPrivate;
+class QRenderState;
+
+class QT3DRENDERERSHARED_EXPORT QStateSet : public QFrameGraphNode
+{
+ Q_OBJECT
+
+public:
+ explicit QStateSet(QNode *parent = 0);
+ ~QStateSet();
+
+ void addRenderState(QRenderState *state);
+ void removeRenderState(QRenderState *state);
+ QList<QRenderState *> renderStates() const;
+
+protected:
+ QStateSet(QStateSetPrivate &dd, QNode *parent = 0);
+ void copy(const QNode *ref) Q_DECL_OVERRIDE;
+
+private:
+ Q_DECLARE_PRIVATE(QStateSet)
+ QT3D_CLONEABLE(QStateSet)
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QSTATESET_H
diff --git a/src/render/frontend/framegraph-components/qstateset_p.h b/src/render/frontend/framegraph-components/qstateset_p.h
new file mode 100644
index 000000000..290578bec
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qstateset_p.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_QSTATESET_P_H
+#define QT3D_QSTATESET_P_H
+
+#include <private/qframegraphnode_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QStateSet;
+class QRenderState;
+
+class QStateSetPrivate : public QFrameGraphNodePrivate
+{
+public:
+ QStateSetPrivate();
+
+ Q_DECLARE_PUBLIC(QStateSet)
+ QList<QRenderState *> m_renderStates;
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QSTATESET_P_H
+
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.cpp b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
index 4fbbb0c75..7d93b40be 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.cpp
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
@@ -38,14 +38,19 @@
#include "qtechniquefilter.h"
#include "qtechniquefilter_p.h"
#include <Qt3DRenderer/qannotation.h>
+#include <Qt3DRenderer/qparameter.h>
#include <Qt3DCore/qscenepropertychange.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
-QTechniqueFilterPrivate::QTechniqueFilterPrivate(QTechniqueFilter *qq)
- : QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QTechniqueFilterPrivate
+ \internal
+*/
+QTechniqueFilterPrivate::QTechniqueFilterPrivate()
+ : QFrameGraphNodePrivate()
{
}
@@ -53,17 +58,17 @@ void QTechniqueFilter::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
const QTechniqueFilter *other = static_cast<const QTechniqueFilter*>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, other->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
+
Q_FOREACH (QAnnotation *crit, other->d_func()->m_requireList)
addRequirement(qobject_cast<QAnnotation *>(QNode::clone(crit)));
}
QTechniqueFilter::QTechniqueFilter(QNode *parent)
- : QFrameGraphNode(*new QTechniqueFilterPrivate(this), parent)
+ : QFrameGraphNode(*new QTechniqueFilterPrivate, parent)
{
}
+/*! \internal */
QTechniqueFilter::QTechniqueFilter(QTechniqueFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
@@ -107,6 +112,47 @@ void QTechniqueFilter::removeRequirement(QAnnotation *criterion)
d->m_requireList.removeOne(criterion);
}
+void QTechniqueFilter::addParameter(QParameter *parameter)
+{
+ Q_D(QTechniqueFilter);
+ if (!d->m_parameters.contains(parameter)) {
+ d->m_parameters.append(parameter);
+
+ // We need to add it as a child of the current node if it has been declared inline
+ // Or not previously added as a child of the current node so that
+ // 1) The backend gets notified about it's creation
+ // 2) When the current node is destroyed, the child parameters get destroyed as well
+ if (!parameter->parent())
+ parameter->setParent(this);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ }
+}
+
+void QTechniqueFilter::removeParameter(QParameter *parameter)
+{
+ Q_D(QTechniqueFilter);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ d->m_parameters.removeOne(parameter);
+}
+
+QList<QParameter *> QTechniqueFilter::parameters() const
+{
+ Q_D(const QTechniqueFilter);
+ return d->m_parameters;
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.h b/src/render/frontend/framegraph-components/qtechniquefilter.h
index 6d509d12c..b7ddcb9b4 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.h
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.h
@@ -46,6 +46,7 @@ namespace Qt3D {
class QTechniqueFilterPrivate;
class QAnnotation;
+class QParameter;
class QT3DRENDERERSHARED_EXPORT QTechniqueFilter : public QFrameGraphNode
{
@@ -57,6 +58,10 @@ public:
void addRequirement(QAnnotation *criterion);
void removeRequirement(QAnnotation *criterion);
+ void addParameter(QParameter *p);
+ void removeParameter(QParameter *p);
+ QList<QParameter *> parameters() const;
+
protected:
QTechniqueFilter(QTechniqueFilterPrivate &dd, QNode *parent = 0);
void copy(const QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter_p.h b/src/render/frontend/framegraph-components/qtechniquefilter_p.h
index 08e03cb4f..1b87f4e12 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter_p.h
+++ b/src/render/frontend/framegraph-components/qtechniquefilter_p.h
@@ -48,10 +48,11 @@ class QTechniqueFilter;
class QTechniqueFilterPrivate : public QFrameGraphNodePrivate
{
public :
- QTechniqueFilterPrivate(QTechniqueFilter *qq);
+ QTechniqueFilterPrivate();
Q_DECLARE_PUBLIC(QTechniqueFilter)
QList<QAnnotation *> m_requireList;
+ QList<QParameter *> m_parameters;
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qviewport.cpp b/src/render/frontend/framegraph-components/qviewport.cpp
index 481cf54b2..49ae81231 100644
--- a/src/render/frontend/framegraph-components/qviewport.cpp
+++ b/src/render/frontend/framegraph-components/qviewport.cpp
@@ -43,8 +43,13 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QViewportPrivate::QViewportPrivate(QViewport *qq) :
- QFrameGraphNodePrivate(qq)
+/*!
+ \class Qt3D::QViewportPrivate
+ \internal
+*/
+QViewportPrivate::QViewportPrivate()
+ : QFrameGraphNodePrivate()
+ , m_rect(QRectF(0.0f, 0.0f, 1.0f, 1.0f))
{
}
@@ -53,15 +58,14 @@ void QViewport::copy(const QNode *ref)
QFrameGraphNode::copy(ref);
const QViewport *viewport = static_cast<const QViewport*>(ref);
d_func()->m_rect = viewport->d_func()->m_rect;
- Q_FOREACH (QFrameGraphNode *fgChild, viewport->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
}
QViewport::QViewport(QNode *parent)
- : QFrameGraphNode(*new QViewportPrivate(this), parent)
+ : QFrameGraphNode(*new QViewportPrivate, parent)
{
}
+/*! \internal */
QViewport::QViewport(QViewportPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
{
diff --git a/src/render/frontend/framegraph-components/qviewport_p.h b/src/render/frontend/framegraph-components/qviewport_p.h
index 7b4a599e8..4e42887d7 100644
--- a/src/render/frontend/framegraph-components/qviewport_p.h
+++ b/src/render/frontend/framegraph-components/qviewport_p.h
@@ -48,7 +48,7 @@ class QViewport;
class QViewportPrivate : public QFrameGraphNodePrivate
{
public :
- QViewportPrivate(QViewport *qq);
+ QViewportPrivate();
Q_DECLARE_PUBLIC(QViewport)
QRectF m_rect;
diff --git a/src/render/frontend/qabstractlight.cpp b/src/render/frontend/qabstractlight.cpp
index 7dbbc531c..4bb7fb0c0 100644
--- a/src/render/frontend/qabstractlight.cpp
+++ b/src/render/frontend/qabstractlight.cpp
@@ -50,8 +50,12 @@ namespace Qt3D
*/
-QAbstractLightPrivate::QAbstractLightPrivate(QAbstractLight *qq)
- : QShaderDataPrivate(qq)
+/*!
+ \class Qt3D::QAbstractLightPrivate
+ \internal
+*/
+QAbstractLightPrivate::QAbstractLightPrivate()
+ : QShaderDataPrivate()
, m_color(QColor(255, 255, 255))
, m_intensity(1.0f)
{}
@@ -67,14 +71,18 @@ void QAbstractLight::copy(const QNode *ref)
}
/*!
+ \class Qt3D::QAbstractLight
+*/
+
+/*!
* Constructs a new QAbstractLight with the given \a parent.
*/
QAbstractLight::QAbstractLight(Qt3D::QNode *parent) :
- QShaderData(*new QAbstractLightPrivate(this), parent)
+ QShaderData(*new QAbstractLightPrivate, parent)
{
}
-
+/*! \internal */
QAbstractLight::QAbstractLight(QAbstractLightPrivate &dd, QNode *parent)
: QShaderData(dd, parent)
{
@@ -82,7 +90,9 @@ QAbstractLight::QAbstractLight(QAbstractLightPrivate &dd, QNode *parent)
/*!
- * Returns the current QAbstractLight color.
+ * \property Qt3D::QAbstractLight::color
+ *
+ * Holds the current QAbstractLight color.
*/
QColor QAbstractLight::color() const
{
@@ -90,11 +100,6 @@ QColor QAbstractLight::color() const
return d->m_color;
}
-/*!
- * Sets the current QAbstractLight \a color;
- *
- * \sa void QAbstractLight::colorChanged();
- */
void QAbstractLight::setColor(const QColor &color)
{
Q_D(QAbstractLight);
@@ -104,6 +109,11 @@ void QAbstractLight::setColor(const QColor &color)
}
}
+/*!
+ \property Qt3D::QAbstractLight::intensity
+
+ Holds the current QAbstractLight intensity.
+*/
float QAbstractLight::intensity() const
{
Q_D(const QAbstractLight);
@@ -119,6 +129,11 @@ void QAbstractLight::setIntensity(float intensity)
}
}
+/*!
+ \property Qt3D::QAbstractLight::position
+
+ Holds the current QAbstractLight position.
+*/
void QAbstractLight::setPosition(const QVector3D &position)
{
Q_D(QAbstractLight);
diff --git a/src/render/frontend/qabstractlight_p.h b/src/render/frontend/qabstractlight_p.h
index ee8d68236..1d90a398a 100644
--- a/src/render/frontend/qabstractlight_p.h
+++ b/src/render/frontend/qabstractlight_p.h
@@ -49,7 +49,7 @@ class QAbstractLight;
class QT3DRENDERERSHARED_EXPORT QAbstractLightPrivate : public QShaderDataPrivate
{
public:
- QAbstractLightPrivate(QAbstractLight *qq);
+ QAbstractLightPrivate();
Q_DECLARE_PUBLIC(QAbstractLight)
QColor m_color;
diff --git a/src/render/frontend/qabstractmesh.cpp b/src/render/frontend/qabstractmesh.cpp
index 94495f23d..a4d6a163e 100644
--- a/src/render/frontend/qabstractmesh.cpp
+++ b/src/render/frontend/qabstractmesh.cpp
@@ -39,8 +39,7 @@
#include <Qt3DCore/qscenepropertychange.h>
/*!
- * \class QAbstractMesh
- * \namespace Qt3D
+ * \class Qt3D::QAbstractMesh
*
* \brief Provides an abstract class that should be the base of all Mesh
* primitives in a scene
@@ -55,8 +54,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAbstractMeshPrivate::QAbstractMeshPrivate(QAbstractMesh *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QAbstractMeshPrivate
+ \internal
+*/
+QAbstractMeshPrivate::QAbstractMeshPrivate()
+ : QComponentPrivate()
{
}
@@ -69,10 +72,11 @@ void QAbstractMesh::copy(const QNode *ref)
QAbstractMesh::QAbstractMesh(QNode *parent)
- : QComponent(*new QAbstractMeshPrivate(this), parent)
+ : QComponent(*new QAbstractMeshPrivate, parent)
{
}
+/*! \internal */
QAbstractMesh::QAbstractMesh(QAbstractMeshPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
diff --git a/src/render/frontend/qabstractmesh_p.h b/src/render/frontend/qabstractmesh_p.h
index 25a25b3cc..e960b95cb 100644
--- a/src/render/frontend/qabstractmesh_p.h
+++ b/src/render/frontend/qabstractmesh_p.h
@@ -53,7 +53,7 @@ class QAbstractMesh;
class QT3DRENDERERSHARED_EXPORT QAbstractMeshPrivate : public QComponentPrivate
{
public:
- QAbstractMeshPrivate(QAbstractMesh *qq);
+ QAbstractMeshPrivate();
Q_DECLARE_PUBLIC(QAbstractMesh)
diff --git a/src/render/frontend/qabstractsceneloader.cpp b/src/render/frontend/qabstractsceneloader.cpp
index 9e0b06aec..f919a489e 100644
--- a/src/render/frontend/qabstractsceneloader.cpp
+++ b/src/render/frontend/qabstractsceneloader.cpp
@@ -47,20 +47,25 @@ namespace Qt3D {
namespace Render {
-QAbstractSceneLoaderPrivate::QAbstractSceneLoaderPrivate(QAbstractSceneLoader *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::Render::QAbstractSceneLoaderPrivate
+ \internal
+*/
+QAbstractSceneLoaderPrivate::QAbstractSceneLoaderPrivate()
+ : QComponentPrivate()
, m_status(QAbstractSceneLoader::Loading)
{
m_shareable = false;
}
+/*! \internal */
QAbstractSceneLoader::QAbstractSceneLoader(QAbstractSceneLoaderPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
}
QAbstractSceneLoader::QAbstractSceneLoader(QNode *parent)
- : QComponent(*new QAbstractSceneLoaderPrivate(this), parent)
+ : QComponent(*new QAbstractSceneLoaderPrivate, parent)
{
}
diff --git a/src/render/frontend/qabstractsceneloader.h b/src/render/frontend/qabstractsceneloader.h
index 942e23744..14aa02e2a 100644
--- a/src/render/frontend/qabstractsceneloader.h
+++ b/src/render/frontend/qabstractsceneloader.h
@@ -53,7 +53,6 @@ class QAbstractSceneLoaderPrivate;
class QT3DRENDERERSHARED_EXPORT QAbstractSceneLoader : public QComponent
{
Q_OBJECT
- Q_ENUMS(Status)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
public:
@@ -64,6 +63,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(Status)
QUrl source() const;
void setSource(const QUrl &arg);
diff --git a/src/render/frontend/qabstractsceneloader_p.h b/src/render/frontend/qabstractsceneloader_p.h
index b9586fcf7..c76f5d854 100644
--- a/src/render/frontend/qabstractsceneloader_p.h
+++ b/src/render/frontend/qabstractsceneloader_p.h
@@ -53,7 +53,7 @@ namespace Render {
class QT3DRENDERERSHARED_EXPORT QAbstractSceneLoaderPrivate : public QComponentPrivate
{
public:
- QAbstractSceneLoaderPrivate(QAbstractSceneLoader *qq);
+ QAbstractSceneLoaderPrivate();
Q_DECLARE_PUBLIC(QAbstractSceneLoader)
diff --git a/src/render/frontend/qabstracttextureimage.cpp b/src/render/frontend/qabstracttextureimage.cpp
index 8f012652c..96d679df6 100644
--- a/src/render/frontend/qabstracttextureimage.cpp
+++ b/src/render/frontend/qabstracttextureimage.cpp
@@ -43,16 +43,32 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
/*!
- \class Qt3D::QAbstractTextureImage
+ \class Qt3D::QAbstractTextureImagePrivate
+ \internal
+*/
+
+/*!
+ \qmltype AbstractTextureImage
+ \instantiates Qt3D::QAbstractTextureImage
+ \inherits Node
+ \inqmlmodule Qt3D.Render
+ \qmlabstract
\since 5.5
\brief Encapsulates the necessary information to create an OpenGL texture image.
+*/
- Qt3D::QAbstractTextureImage should be used as the mean of providing image data to a
- Qt3D::QAbstractTextureProvider. It contains the necessary informations: mipmap
+/*!
+ \class QAbstractTextureImage
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief Encapsulates the necessary information to create an OpenGL texture image.
+
+ QAbstractTextureImage should be used as the means of providing image data to a
+ QAbstractTextureProvider. It contains the necessary information: mipmap
level, layer, cube face load at the proper place data into an OpenGL texture.
The actual data is provided through a QTextureDataFunctor that will be
- executed by Aspect jobs in the backend. Qt3D::QAbstractTextureImage should be
+ executed by Aspect jobs in the backend. QAbstractTextureImage should be
subclassed to provide a functor and eventual additional properties needed by
the functor to load actual data.
@@ -64,16 +80,28 @@ namespace Qt3D {
Constructs a new Qt3D::QAbstractTextureImage instance with \a parent as parent.
*/
QAbstractTextureImage::QAbstractTextureImage(QNode *parent)
- : QNode(*new QAbstractTextureImagePrivate(this), parent)
+ : QNode(*new QAbstractTextureImagePrivate, parent)
{
}
+/*!
+ The destructor.
+ */
QAbstractTextureImage::~QAbstractTextureImage()
{
}
+
/*!
- \return the mipmal level of the texture image.
+ \qmlproperty int Qt3D.render::AbstractTextureImage::mipmapLevel
+
+ Holds the mipmap level of the texture image.
+ */
+
+/*!
+ \property Qt3D::QAbstractTextureImage::mipmapLevel
+
+ Holds the mipmap level of the texture image.
*/
int QAbstractTextureImage::mipmapLevel() const
{
@@ -82,7 +110,15 @@ int QAbstractTextureImage::mipmapLevel() const
}
/*!
- \return the layer of the texture image.
+ \qmlproperty int Qt3D.Render::AbstractTextureImage::layer
+
+ Holds the layer of the texture image.
+ */
+
+/*!
+ \property Qt3D::QAbstractTextureImage::layer
+
+ Holds the layer of the texture image.
*/
int QAbstractTextureImage::layer() const
{
@@ -91,7 +127,30 @@ int QAbstractTextureImage::layer() const
}
/*!
- \return the cube map face of the texture image.
+ \qmlproperty enumeration Qt3D.Render::AbstractTextureImage::cubeMapFace
+
+ Holds the cube map face of the texture image.
+
+ \value CubeMapPositiveX 0x8515 GL_TEXTURE_CUBE_MAP_POSITIVE_X
+ \value CubeMapNegativeX 0x8516 GL_TEXTURE_CUBE_MAP_NEGATIVE_X
+ \value CubeMapPositiveY 0x8517 GL_TEXTURE_CUBE_MAP_POSITIVE_Y
+ \value CubeMapNegativeY 0x8518 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
+ \value CubeMapPositiveZ 0x8519 GL_TEXTURE_CUBE_MAP_POSITIVE_Z
+ \value CubeMapNegativeZ 0x851A GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
+
+ \note The cube map face has a meaning only for
+ \l {QAbstractTextureProvider::}{TargetCubeMap} and
+ \l {QAbstractTextureProvider::}{TargetCubeMapArray}.
+ */
+
+/*!
+ \property Qt3D::QAbstractTextureImage::cubeMapFace
+
+ Holds the cube map face of the texture image.
+
+ \note The cube map face has a meaning only for
+ \l {QAbstractTextureProvider::}{TargetCubeMap} and
+ \l {QAbstractTextureProvider::}{TargetCubeMapArray}.
*/
QAbstractTextureProvider::CubeMapFace QAbstractTextureImage::cubeMapFace() const
{
@@ -99,9 +158,6 @@ QAbstractTextureProvider::CubeMapFace QAbstractTextureImage::cubeMapFace() const
return d->m_face;
}
-/*!
- Sets the mipmap level of the texture image to \a level.
- */
void QAbstractTextureImage::setMipmapLevel(int level)
{
Q_D(QAbstractTextureImage);
@@ -111,11 +167,6 @@ void QAbstractTextureImage::setMipmapLevel(int level)
}
}
-/*!
- Sets the layer of the texture image to \a layer.
- \note: has a meaning only for Target2DArray, TargetCubeMapArray and Target3D
- Qt3D::QAbstractTextureProvider.
- */
void QAbstractTextureImage::setLayer(int layer)
{
Q_D(QAbstractTextureImage);
@@ -125,11 +176,6 @@ void QAbstractTextureImage::setLayer(int layer)
}
}
-/*!
- Sets the cube map face of the texture image to \a face.
- \note: has a meaning only for TargetCubeMap and TargetCubeMapArray
- Qt3D::QAbstractTextureProvider.
- */
void QAbstractTextureImage::setCubeMapFace(QAbstractTextureProvider::CubeMapFace face)
{
Q_D(QAbstractTextureImage);
@@ -140,7 +186,7 @@ void QAbstractTextureImage::setCubeMapFace(QAbstractTextureProvider::CubeMapFace
}
/*!
- Triggers an update of the data functor that is sent to the backend
+ Triggers an update of the data functor that is sent to the backend.
*/
void QAbstractTextureImage::update()
{
@@ -153,6 +199,9 @@ void QAbstractTextureImage::update()
}
}
+/*!
+ Copies \a ref into this object.
+ */
void QAbstractTextureImage::copy(const QNode *ref)
{
const QAbstractTextureImage *imageRef = static_cast<const QAbstractTextureImage *>(ref);
@@ -161,6 +210,7 @@ void QAbstractTextureImage::copy(const QNode *ref)
d_func()->m_mipmapLevel = imageRef->mipmapLevel();
}
+/*! \internal */
QAbstractTextureImage::QAbstractTextureImage(QAbstractTextureImagePrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/render/frontend/qabstracttextureimage_p.h b/src/render/frontend/qabstracttextureimage_p.h
index 95e55788b..fd795f18a 100644
--- a/src/render/frontend/qabstracttextureimage_p.h
+++ b/src/render/frontend/qabstracttextureimage_p.h
@@ -50,8 +50,8 @@ class QAbstractTextureImage;
class QT3DRENDERERSHARED_PRIVATE_EXPORT QAbstractTextureImagePrivate : public QNodePrivate
{
public:
- QAbstractTextureImagePrivate(QAbstractTextureImage *qq)
- : QNodePrivate(qq)
+ QAbstractTextureImagePrivate()
+ : QNodePrivate()
, m_mipmapLevel(0)
, m_layer(0)
, m_face(QAbstractTextureProvider::CubeMapPositiveX)
diff --git a/src/render/frontend/qabstracttextureprovider.cpp b/src/render/frontend/qabstracttextureprovider.cpp
index 8d08b76b6..75ea92f03 100644
--- a/src/render/frontend/qabstracttextureprovider.cpp
+++ b/src/render/frontend/qabstracttextureprovider.cpp
@@ -43,8 +43,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAbstractTextureProviderPrivate::QAbstractTextureProviderPrivate(QAbstractTextureProvider *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QAbstractTextureProviderPrivate
+ \internal
+*/
+QAbstractTextureProviderPrivate::QAbstractTextureProviderPrivate()
+ : QNodePrivate()
, m_target(QAbstractTextureProvider::Target2D)
, m_format(QAbstractTextureProvider::Automatic)
, m_width(1)
@@ -58,6 +62,7 @@ QAbstractTextureProviderPrivate::QAbstractTextureProviderPrivate(QAbstractTextur
, m_comparisonFunction(QAbstractTextureProvider::CompareLessEqual)
, m_comparisonMode(QAbstractTextureProvider::CompareNone)
, m_maximumLayers(1)
+ , m_unique(false)
{
}
@@ -85,7 +90,7 @@ void QAbstractTextureProvider::copy(const QNode *ref)
/*!
\class Qt3D::QAbstractTextureProvider
\since 5.5
- \brief Qt3D::QAbstractTextureProvider is a base class to be used to provide textures.
+ \brief A base class to be used to provide textures.
Qt3D::QAbstractTextureProvider shouldn't be used directly but rather
through one of its subclasses. Each subclass implements a given texture
@@ -97,16 +102,17 @@ void QAbstractTextureProvider::copy(const QNode *ref)
QAbstractTextureProvider::QAbstractTextureProvider(QNode *parent)
- : QNode(*new QAbstractTextureProviderPrivate(this), parent)
+ : QNode(*new QAbstractTextureProviderPrivate, parent)
{
}
QAbstractTextureProvider::QAbstractTextureProvider(Target target, QNode *parent)
- : QNode(*new QAbstractTextureProviderPrivate(this), parent)
+ : QNode(*new QAbstractTextureProviderPrivate, parent)
{
d_func()->m_target = target;
}
+/*! \internal */
QAbstractTextureProvider::QAbstractTextureProvider(QAbstractTextureProviderPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
@@ -117,17 +123,19 @@ QAbstractTextureProvider::~QAbstractTextureProvider()
}
/*!
- Sets the size of the texture provider to width \a, height \a h and depth \a d.
+ Sets the size of the texture provider to width \a w, height \a h and depth \a d.
*/
void QAbstractTextureProvider::setSize(int w, int h, int d)
{
- setWidth(w);
- setHeight(h);
- setDepth(d);
+ setWidth(w);
+ setHeight(h);
+ setDepth(d);
}
/*!
- Sets the width of the texture provider to \a width.
+ \property Qt3D::QAbstractTextureProvider::width
+
+ Holds the width of the texture provider.
*/
void QAbstractTextureProvider::setWidth(int width)
{
@@ -139,7 +147,9 @@ void QAbstractTextureProvider::setWidth(int width)
}
/*!
- Sets the height of the texture provider to \a height.
+ \property Qt3D::QAbstractTextureProvider::height
+
+ Holds the height of the texture provider.
*/
void QAbstractTextureProvider::setHeight(int height)
{
@@ -151,7 +161,9 @@ void QAbstractTextureProvider::setHeight(int height)
}
/*!
- Sets the depth of the texture provider to \a depth.
+ \property Qt3D::QAbstractTextureProvider::depth
+
+ Holds the depth of the texture provider.
*/
void QAbstractTextureProvider::setDepth(int depth)
{
@@ -162,27 +174,18 @@ void QAbstractTextureProvider::setDepth(int depth)
}
}
-/*!
- \returns the width of the texture provider.
- */
int QAbstractTextureProvider::width() const
{
Q_D(const QAbstractTextureProvider);
return d->m_width;
}
-/*!
- \returns the height of the texture provider.
- */
int QAbstractTextureProvider::height() const
{
Q_D(const QAbstractTextureProvider);
return d->m_height;
}
-/*!
- \returns the depth of the texture provider.
- */
int QAbstractTextureProvider::depth() const
{
Q_D(const QAbstractTextureProvider);
@@ -190,11 +193,13 @@ int QAbstractTextureProvider::depth() const
}
/*!
- Sets the maximum layers count to \a maximumLayers, by defaults, the maximum
- layer count is 1.
+ \property Qt3D::QAbstractTextureProvider::maximumLayers
+
+ Holds the maximum layer count of the texture provider. By default, the
+ maximum layer count is 1.
- \note this has a meaning only for texture providers that
- have 3D or array target formats.
+ \note this has a meaning only for texture providers that have 3D or
+ array target formats.
*/
void QAbstractTextureProvider::setMaximumLayers(int maximumLayers)
{
@@ -206,8 +211,10 @@ void QAbstractTextureProvider::setMaximumLayers(int maximumLayers)
}
/*!
- \return return the maximum layers count of the texture provider.
- \note this has a meaning only for texture providers that have 3D or array target formats.
+ Returns the maximum number of layers for the texture provider.
+
+ \note this has a meaning only for texture providers that have 3D or
+ array target formats.
*/
int QAbstractTextureProvider::maximumLayers() const
{
@@ -216,7 +223,42 @@ int QAbstractTextureProvider::maximumLayers() const
}
/*!
- Sets the format of the texture provider to \a format.
+ \property Qt3D::QAbstractTextureProvider::unique
+
+ Sets whether this texture provider should be unique by reading \a unique.
+ By default this is false.
+
+ By default the renderer based on the attributes of texture providers is
+ able to compare them and detect duplicates (same size, format and image
+ sources) and smartly avoid unnecessary computations. In some cases however
+ (texture providers used as Qt3D::RenderTarget attachments) you don't want
+ the renderer to perform these comparison, in which case you can set is
+ unique to true.
+ */
+void QAbstractTextureProvider::setUnique(bool unique)
+{
+ Q_D(QAbstractTextureProvider);
+ if (d->m_unique != unique) {
+ d->m_unique = unique;
+ emit uniqueChanged();
+ }
+}
+
+/*!
+ Returns whether the texture should be shared with other textures in the
+ renderer or not. Defaults to false as this allow in most cases the renderer
+ to be faster.
+ */
+bool QAbstractTextureProvider::isUnique() const
+{
+ Q_D(const QAbstractTextureProvider);
+ return d->m_unique;
+}
+
+/*!
+ \property Qt3D::QAbstractTextureProvider::format
+
+ Holds the format of the texture provider.
*/
void QAbstractTextureProvider::setFormat(TextureFormat format)
{
@@ -228,7 +270,7 @@ void QAbstractTextureProvider::setFormat(TextureFormat format)
}
/*!
- \returns the format of the texture provider.
+ Return the texture provider's format.
*/
QAbstractTextureProvider::TextureFormat QAbstractTextureProvider::format() const
{
@@ -237,7 +279,9 @@ QAbstractTextureProvider::TextureFormat QAbstractTextureProvider::format() const
}
/*!
- Sets the current status of the texture provider to \a status.
+ \property Qt3D::QAbstractTextureProvider::status readonly
+
+ Holds the current status of the texture provider.
*/
void QAbstractTextureProvider::setStatus(Status status)
{
@@ -248,9 +292,6 @@ void QAbstractTextureProvider::setStatus(Status status)
}
}
-/*!
- \returns the current status of the texture provider.
- */
QAbstractTextureProvider::Status QAbstractTextureProvider::status() const
{
Q_D(const QAbstractTextureProvider);
@@ -258,8 +299,11 @@ QAbstractTextureProvider::Status QAbstractTextureProvider::status() const
}
/*!
- \returns the target format of the texture provider.
- \note: The target format can only be set once.
+ \property Qt3D::QAbstractTextureProvider::target readonly
+
+ Holds the target format of the texture provider.
+
+ \note The target format can only be set once.
*/
QAbstractTextureProvider::Target QAbstractTextureProvider::target() const
{
@@ -268,8 +312,10 @@ QAbstractTextureProvider::Target QAbstractTextureProvider::target() const
}
/*!
- Adds a new Qt3D::QAbstractTextureImage \a texture image to the texture provider.
- \note: Qt3D::QAbstractTextureImage should never be shared by several Qt3D::QAbstractTextureProvider
+ Adds a new Qt3D::QAbstractTextureImage \a textureImage to the texture provider.
+
+ \note Qt3D::QAbstractTextureImage should never be shared between multiple
+ Qt3D::QAbstractTextureProvider instances.
*/
void QAbstractTextureProvider::addTextureImage(QAbstractTextureImage *textureImage)
{
@@ -297,7 +343,7 @@ void QAbstractTextureProvider::addTextureImage(QAbstractTextureImage *textureIma
}
/*!
- Removes a Qt3D::QAbstractTextureImage \a texture image form the texture provider.
+ Removes a Qt3D::QAbstractTextureImage \a textureImage from the texture provider.
*/
void QAbstractTextureProvider::removeTextureImage(QAbstractTextureImage *textureImage)
{
@@ -312,7 +358,8 @@ void QAbstractTextureProvider::removeTextureImage(QAbstractTextureImage *texture
}
/*!
-\return the list of QAbstractTextureImage * contained in the texture provider.
+ Returns a list of pointers to QAbstractTextureImage objects contained in
+ the texture provider.
*/
QList<QAbstractTextureImage *> QAbstractTextureProvider::textureImages() const
{
@@ -321,7 +368,9 @@ QList<QAbstractTextureImage *> QAbstractTextureProvider::textureImages() const
}
/*!
- Sets whether the texture provider should auto generate mipmaps.
+ \property Qt3D::QAbstractTextureProvider::generateMipMaps
+
+ Holds whether the texture provider should auto generate mipmaps.
*/
void QAbstractTextureProvider::setGenerateMipMaps(bool gen)
{
@@ -332,9 +381,6 @@ void QAbstractTextureProvider::setGenerateMipMaps(bool gen)
}
}
-/*!
- \returns whether texture provider auto generates mipmaps.
- */
bool QAbstractTextureProvider::generateMipMaps() const
{
Q_D(const QAbstractTextureProvider);
@@ -342,7 +388,9 @@ bool QAbstractTextureProvider::generateMipMaps() const
}
/*!
- Sets the minification filter of the texture provider to \a f.
+ \property Qt3D::QAbstractTextureProvider::minificationFilter
+
+ Holds the minification filter of the texture provider.
*/
void QAbstractTextureProvider::setMinificationFilter(Filter f)
{
@@ -354,7 +402,9 @@ void QAbstractTextureProvider::setMinificationFilter(Filter f)
}
/*!
- Sets the magnification filter of the texture provider to \a f.
+ \property Qt3D::QAbstractTextureProvider::magnificationFilter
+
+ Holds the magnification filter of the texture provider.
*/
void QAbstractTextureProvider::setMagnificationFilter(Filter f)
{
@@ -365,18 +415,12 @@ void QAbstractTextureProvider::setMagnificationFilter(Filter f)
}
}
-/*!
- \returns the minification filter of the texture provider.
- */
QAbstractTextureProvider::Filter QAbstractTextureProvider::minificationFilter() const
{
Q_D(const QAbstractTextureProvider);
return d->m_minFilter;
}
-/*!
- \returns the magnification filter of the texture provider.
- */
QAbstractTextureProvider::Filter QAbstractTextureProvider::magnificationFilter() const
{
Q_D(const QAbstractTextureProvider);
@@ -384,7 +428,9 @@ QAbstractTextureProvider::Filter QAbstractTextureProvider::magnificationFilter()
}
/*!
- Sets the wrap mode of the texture provider to \a wrapMode.
+ \property Qt3D::QAbstractTextureProvider::wrapMode
+
+ Holds the wrap mode of the texture provider.
*/
void QAbstractTextureProvider::setWrapMode(const QTextureWrapMode &wrapMode)
{
@@ -412,9 +458,6 @@ void QAbstractTextureProvider::setWrapMode(const QTextureWrapMode &wrapMode)
}
}
-/*!
- \returns the wrap mode of the texture provider.
- */
QTextureWrapMode *QAbstractTextureProvider::wrapMode()
{
Q_D(QAbstractTextureProvider);
@@ -422,7 +465,9 @@ QTextureWrapMode *QAbstractTextureProvider::wrapMode()
}
/*!
- Sets the maximum anisotropy of the texture provider to \a anisotropy.
+ \property Qt3D::QAbstractTextureProvider::maximumAnisotropy
+
+ Holds the maximum anisotropy of the texture provider.
*/
void QAbstractTextureProvider::setMaximumAnisotropy(float anisotropy)
{
@@ -433,9 +478,6 @@ void QAbstractTextureProvider::setMaximumAnisotropy(float anisotropy)
}
}
-/*!
- \returns the maximum anisotropy of the texture provider.
- */
float QAbstractTextureProvider::maximumAnisotropy() const
{
Q_D(const QAbstractTextureProvider);
@@ -443,7 +485,9 @@ float QAbstractTextureProvider::maximumAnisotropy() const
}
/*!
- Sets the comparison function of the texture provider to \a function.
+ \property Qt3D::QAbstractTextureProvider::comparisonFunction
+
+ Holds the comparison function of the texture provider.
*/
void QAbstractTextureProvider::setComparisonFunction(QAbstractTextureProvider::ComparisonFunction function)
{
@@ -454,9 +498,6 @@ void QAbstractTextureProvider::setComparisonFunction(QAbstractTextureProvider::C
}
}
-/*!
- \returns the comparison function of the texture provider.
- */
QAbstractTextureProvider::ComparisonFunction QAbstractTextureProvider::comparisonFunction() const
{
Q_D(const QAbstractTextureProvider);
@@ -464,7 +505,9 @@ QAbstractTextureProvider::ComparisonFunction QAbstractTextureProvider::compariso
}
/*!
- Sets the comparison mode of the texture provider to \a mode.
+ \property Qt3D::QAbstractTextureProvider::comparisonMode
+
+ Holds the comparison mode of the texture provider.
*/
void QAbstractTextureProvider::setComparisonMode(QAbstractTextureProvider::ComparisonMode mode)
{
@@ -475,9 +518,6 @@ void QAbstractTextureProvider::setComparisonMode(QAbstractTextureProvider::Compa
}
}
-/*!
- \returns the comparison mode of the texture provider.
- */
QAbstractTextureProvider::ComparisonMode QAbstractTextureProvider::comparisonMode() const
{
Q_D(const QAbstractTextureProvider);
diff --git a/src/render/frontend/qabstracttextureprovider.h b/src/render/frontend/qabstracttextureprovider.h
index f177019c3..025270cd5 100644
--- a/src/render/frontend/qabstracttextureprovider.h
+++ b/src/render/frontend/qabstracttextureprovider.h
@@ -52,13 +52,6 @@ class QAbstractTextureImage;
class QT3DRENDERERSHARED_EXPORT QAbstractTextureProvider : public QNode
{
Q_OBJECT
- Q_ENUMS(Target)
- Q_ENUMS(TextureFormat)
- Q_ENUMS(Filter)
- Q_ENUMS(Status)
- Q_ENUMS(ComparisonFunction)
- Q_ENUMS(ComparisonMode)
- Q_ENUMS(CubeMapFace)
Q_PROPERTY(Target target READ target CONSTANT)
Q_PROPERTY(TextureFormat format READ format WRITE setFormat NOTIFY formatChanged)
Q_PROPERTY(bool generateMipMaps READ generateMipMaps WRITE setGenerateMipMaps NOTIFY generateMipMapsChanged)
@@ -73,6 +66,7 @@ class QT3DRENDERERSHARED_EXPORT QAbstractTextureProvider : public QNode
Q_PROPERTY(ComparisonFunction comparisonFunction READ comparisonFunction WRITE setComparisonFunction NOTIFY comparisonFunctionChanged)
Q_PROPERTY(ComparisonMode comparisonMode READ comparisonMode WRITE setComparisonMode NOTIFY comparisonModeChanged)
Q_PROPERTY(int maximumLayers READ maximumLayers WRITE setMaximumLayers NOTIFY maximumLayersChanged)
+ Q_PROPERTY(bool unique READ isUnique WRITE setUnique NOTIFY uniqueChanged)
public:
@@ -81,6 +75,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(Status)
enum Target {
Target1D = 0x0DE0, // GL_TEXTURE_1D
@@ -95,6 +90,7 @@ public:
TargetRectangle = 0x84F5, // GL_TEXTURE_RECTANGLE
TargetBuffer = 0x8C2A // GL_TEXTURE_BUFFER
};
+ Q_ENUM(Target)
enum TextureFormat {
NoFormat = 0, // GL_NONE
@@ -212,6 +208,7 @@ public:
LuminanceFormat = 0x1909, // GL_LUMINANCE
LuminanceAlphaFormat = 0x190A
};
+ Q_ENUM(TextureFormat)
enum Filter {
Nearest = 0x2600, // GL_NEAREST
@@ -221,6 +218,7 @@ public:
LinearMipMapNearest = 0x2701, // GL_LINEAR_MIPMAP_NEAREST
LinearMipMapLinear = 0x2703 // GL_LINEAR_MIPMAP_LINEAR
};
+ Q_ENUM(Filter)
enum CubeMapFace {
CubeMapPositiveX = 0x8515, // GL_TEXTURE_CUBE_MAP_POSITIVE_X
@@ -230,6 +228,7 @@ public:
CubeMapPositiveZ = 0x8519, // GL_TEXTURE_CUBE_MAP_POSITIVE_Z
CubeMapNegativeZ = 0x851A // GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
+ Q_ENUM(CubeMapFace)
enum ComparisonFunction {
CompareLessEqual = 0x0203, // GL_LEQUAL
@@ -241,11 +240,13 @@ public:
CompareAlways = 0x0207, // GL_ALWAYS
CompareNever = 0x0200 // GL_NEVER
};
+ Q_ENUM(ComparisonFunction)
enum ComparisonMode {
CompareRefToTexture = 0x884E, // GL_COMPARE_REF_TO_TEXTURE
CompareNone = 0x0000 // GL_NONE
};
+ Q_ENUM(ComparisonMode)
~QAbstractTextureProvider();
@@ -296,6 +297,9 @@ public:
void setMaximumLayers(int maximumLayers);
int maximumLayers() const;
+ void setUnique(bool unique);
+ bool isUnique() const;
+
Q_SIGNALS:
void formatChanged();
void statusChanged();
@@ -309,6 +313,7 @@ Q_SIGNALS:
void comparisonFunctionChanged();
void comparisonModeChanged();
void maximumLayersChanged();
+ void uniqueChanged();
protected:
explicit QAbstractTextureProvider(QNode *parent = 0);
@@ -327,7 +332,5 @@ private:
QT_END_NAMESPACE
Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider*)
-Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider::ComparisonFunction)
-Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider::ComparisonMode)
#endif // QT3D_QABSTRACTTEXTUREPROVIDER_H
diff --git a/src/render/frontend/qabstracttextureprovider_p.h b/src/render/frontend/qabstracttextureprovider_p.h
index d1d8eb982..b9f216e5c 100644
--- a/src/render/frontend/qabstracttextureprovider_p.h
+++ b/src/render/frontend/qabstracttextureprovider_p.h
@@ -49,7 +49,7 @@ namespace Qt3D {
class QAbstractTextureProviderPrivate : public QNodePrivate
{
public :
- QAbstractTextureProviderPrivate(QAbstractTextureProvider *qq);
+ QAbstractTextureProviderPrivate();
Q_DECLARE_PUBLIC(QAbstractTextureProvider)
@@ -69,6 +69,7 @@ public :
QAbstractTextureProvider::ComparisonMode m_comparisonMode;
QList<QAbstractTextureImage *> m_textureImages;
int m_maximumLayers;
+ bool m_unique;
};
} // QT3D
diff --git a/src/render/frontend/qalphacoverage.cpp b/src/render/frontend/qalphacoverage.cpp
index 7cc9afaed..c96980d90 100644
--- a/src/render/frontend/qalphacoverage.cpp
+++ b/src/render/frontend/qalphacoverage.cpp
@@ -45,15 +45,15 @@ namespace Qt3D {
class QAlphaCoveragePrivate : public QRenderStatePrivate
{
public :
- QAlphaCoveragePrivate(QAlphaCoverage *qq)
- : QRenderStatePrivate(qq, QRenderState::AlphaCoverage)
+ QAlphaCoveragePrivate()
+ : QRenderStatePrivate(QRenderState::AlphaCoverage)
{}
Q_DECLARE_PUBLIC(QAlphaCoverage)
};
QAlphaCoverage::QAlphaCoverage(QNode *parent)
- : QRenderState(*new QAlphaCoveragePrivate(this), parent)
+ : QRenderState(*new QAlphaCoveragePrivate, parent)
{
}
diff --git a/src/render/frontend/qalphatest.cpp b/src/render/frontend/qalphatest.cpp
index c011d42fc..1b0498392 100644
--- a/src/render/frontend/qalphatest.cpp
+++ b/src/render/frontend/qalphatest.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QAlphaTestPrivate : public QRenderStatePrivate
{
public:
- QAlphaTestPrivate(QAlphaTest *qq)
- : QRenderStatePrivate(qq, QRenderState::AlphaTest)
+ QAlphaTestPrivate()
+ : QRenderStatePrivate(QRenderState::AlphaTest)
, m_func(QAlphaTest::Never)
, m_clamp(0.0f)
{
@@ -60,7 +60,7 @@ public:
};
QAlphaTest::QAlphaTest(QNode *parent)
- : QRenderState(*new QAlphaTestPrivate(this), parent)
+ : QRenderState(*new QAlphaTestPrivate, parent)
{
}
diff --git a/src/render/frontend/qalphatest.h b/src/render/frontend/qalphatest.h
index 095f5aac1..645677762 100644
--- a/src/render/frontend/qalphatest.h
+++ b/src/render/frontend/qalphatest.h
@@ -49,7 +49,6 @@ class QAlphaTestPrivate;
class QT3DRENDERERSHARED_EXPORT QAlphaTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(AlphaFunc)
Q_PROPERTY(AlphaFunc func READ func WRITE setFunc NOTIFY funcChanged)
Q_PROPERTY(float clamp READ clamp WRITE setClamp NOTIFY clampChanged)
public:
@@ -64,6 +63,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(AlphaFunc)
explicit QAlphaTest(QNode *parent = 0);
diff --git a/src/render/frontend/qannotation.cpp b/src/render/frontend/qannotation.cpp
index 831017a51..0476e1d6a 100644
--- a/src/render/frontend/qannotation.cpp
+++ b/src/render/frontend/qannotation.cpp
@@ -44,11 +44,34 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QAnnotationPrivate::QAnnotationPrivate(QAnnotation *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QAnnotationPrivate
+ \internal
+*/
+QAnnotationPrivate::QAnnotationPrivate()
+ : QNodePrivate()
{
}
+/*!
+ \class QAnnotation
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief The QAnnotation class provides ...
+*/
+
+/*!
+ \qmltype Annotation
+ \instantiates Qt3D::QAnnotation
+ \inherits Node
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For annotating ...
+*/
+
+/*!
+ Copies the annotation in \a ref into this annotation.
+ */
void QAnnotation::copy(const QNode *ref)
{
QNode::copy(ref);
@@ -57,8 +80,11 @@ void QAnnotation::copy(const QNode *ref)
d_func()->m_value = criterion->d_func()->m_value;
}
+/*!
+ The constructor creats a new annotation under \a parent.
+ */
QAnnotation::QAnnotation(QNode *parent)
- : QNode(*new QAnnotationPrivate(this), parent)
+ : QNode(*new QAnnotationPrivate, parent)
{
}
@@ -80,12 +106,30 @@ void QAnnotation::setName(const QString &name)
}
}
+/*!
+ \property QAnnotation::value
+
+*/
+
+/*!
+ \qmlproperty variant Qt3D.Render::Annotation::value
+*/
+
QVariant QAnnotation::value() const
{
Q_D(const QAnnotation);
return d->m_value;
}
+/*!
+ \property QAnnotation::name
+
+ */
+
+/*!
+ \qmlproperty string Qt3D.Render::Annotation::name
+ */
+
QString QAnnotation::name() const
{
Q_D(const QAnnotation);
diff --git a/src/render/frontend/qannotation_p.h b/src/render/frontend/qannotation_p.h
index f790cd155..d0bd44dc5 100644
--- a/src/render/frontend/qannotation_p.h
+++ b/src/render/frontend/qannotation_p.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QAnnotationPrivate : public QNodePrivate
{
public:
- QAnnotationPrivate(QAnnotation *qq);
+ QAnnotationPrivate();
Q_DECLARE_PUBLIC(QAnnotation)
QString m_name;
diff --git a/src/render/frontend/qblendequation.cpp b/src/render/frontend/qblendequation.cpp
index 0e8b8fac7..9960bb2b8 100644
--- a/src/render/frontend/qblendequation.cpp
+++ b/src/render/frontend/qblendequation.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QBlendEquationPrivate : public QRenderStatePrivate
{
public:
- QBlendEquationPrivate(QBlendEquation *qq)
- : QRenderStatePrivate(qq, QRenderState::BlendEquation)
+ QBlendEquationPrivate()
+ : QRenderStatePrivate(QRenderState::BlendEquation)
{
}
@@ -64,7 +64,7 @@ void QBlendEquation::copy(const QNode *ref)
}
QBlendEquation::QBlendEquation(QNode *parent)
- : QRenderState(*new QBlendEquationPrivate(this), parent)
+ : QRenderState(*new QBlendEquationPrivate, parent)
{
}
diff --git a/src/render/frontend/qblendequation.h b/src/render/frontend/qblendequation.h
index 6df7cb757..280df3155 100644
--- a/src/render/frontend/qblendequation.h
+++ b/src/render/frontend/qblendequation.h
@@ -49,7 +49,6 @@ class QBlendEquationPrivate;
class QT3DRENDERERSHARED_EXPORT QBlendEquation : public QRenderState
{
Q_OBJECT
- Q_ENUMS(BlendMode)
Q_PROPERTY(BlendMode mode READ mode WRITE setMode NOTIFY modeChanged)
public:
@@ -61,6 +60,7 @@ public:
Min = 0x8007,
Max = 0x8008
};
+ Q_ENUM(BlendMode)
explicit QBlendEquation(QNode *parent = 0);
diff --git a/src/render/frontend/qblendstate.cpp b/src/render/frontend/qblendstate.cpp
index 634e730e5..642ce03ab 100644
--- a/src/render/frontend/qblendstate.cpp
+++ b/src/render/frontend/qblendstate.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QBlendStatePrivate : public QRenderStatePrivate
{
public:
- QBlendStatePrivate(QBlendState *qq)
- : QRenderStatePrivate(qq, QRenderState::BlendState)
+ QBlendStatePrivate(QRenderState::Type type = QRenderState::BlendState)
+ : QRenderStatePrivate(type)
, m_srcRGB(QBlendState::Zero)
, m_srcAlpha(QBlendState::Zero)
, m_dstRGB(QBlendState::Zero)
@@ -64,11 +64,34 @@ public:
QBlendState::Blending m_dstAlpha;
};
+/*!
+ \class Qt3D::QBlendState
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief Encapsulates blending information.
+ */
+
+/*!
+ \qmltype BlendState
+ \instantiates Qt3D::QBlendState
+ \inherits RenderState
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief Encapsulates blending information
+*/
+
+/*!
+ The constructor creates a new blend state object with the specified \a parent.
+ */
QBlendState::QBlendState(QNode *parent)
- : QRenderState(*new QBlendStatePrivate(this), parent)
+ : QRenderState(*new QBlendStatePrivate, parent)
{
}
+/*! \fn void QBlendState::copy(const QNode *ref)
+ \internal
+ Copies \a ref into this object.
+ */
void QBlendState::copy(const QNode *ref)
{
QRenderState::copy(ref);
@@ -79,6 +102,47 @@ void QBlendState::copy(const QNode *ref)
d_func()->m_dstRGB = refState->d_func()->m_dstRGB;
}
+/*!
+ \internal
+*/
+QBlendState::QBlendState(QRenderState::Type type, QNode *parent)
+ : QRenderState(*new QBlendStatePrivate(type), parent)
+{
+}
+
+/*!
+ \enum Qt3D::QBlendState::Blending
+
+ \value Zero 0
+ \value One 1
+ \value SrcColor 0x0300
+ \value SrcAlpha 0x0302
+ \value Src1Alpha
+ \value Src1Color
+ \value DstColor 0x0306
+ \value DstAlpha 0x0304
+ \value SrcAlphaSaturate 0x0308
+ \value ConstantColor 0x8001
+ \value ConstantAlpha 0x8003
+ \value OneMinusSrcColor 0x0301
+ \value OneMinusSrcAlpha 0x0303
+ \value OneMinusDstAlpha 0x0305
+ \value OneMinusDstColor 0x0307
+ \value OneMinusConstantColor 0x8002
+ \value OneMinusConstantAlpha 0x8004
+ \value OneMinusSrc1Alpha
+ \value OneMinusSrc1Color0
+*/
+
+/*!
+ \qmlproperty enumeration Qt3D.render::BlendState::srcRGB
+
+ */
+
+/*!
+ \property Qt3D::QBlendState::srcRGB
+
+ */
QBlendState::Blending QBlendState::srcRGB() const
{
Q_D(const QBlendState);
@@ -94,6 +158,15 @@ void QBlendState::setSrcRGB(QBlendState::Blending srcRGB)
}
}
+/*!
+ \qmlproperty enumeration Qt3D.render::BlendState::dstRGB
+
+ */
+
+/*!
+ \property Qt3D::QBlendState::dstRGB
+
+ */
QBlendState::Blending QBlendState::dstRGB() const
{
Q_D(const QBlendState);
@@ -109,6 +182,15 @@ void QBlendState::setDstRGB(QBlendState::Blending dstRGB)
}
}
+/*!
+ \qmlproperty enumeration Qt3D.render::BlendState::srcAlpha
+
+ */
+
+/*!
+ \property Qt3D::QBlendState::srcAlpha
+
+ */
QBlendState::Blending QBlendState::srcAlpha() const
{
Q_D(const QBlendState);
@@ -124,6 +206,15 @@ void QBlendState::setSrcAlpha(QBlendState::Blending srcAlpha)
}
}
+/*!
+ \qmlproperty enumeration Qt3D.render::BlendState::dstAlpha
+
+ */
+
+/*!
+ \property Qt3D::QBlendState::dstAlpha
+
+ */
QBlendState::Blending QBlendState::dstAlpha() const
{
Q_D(const QBlendState);
@@ -139,6 +230,31 @@ void QBlendState::setDstAlpha(QBlendState::Blending dstAlpha)
}
}
+/*!
+ \class QBlendStateSeparate
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief Encapsulates blending information.
+ */
+
+/*!
+ \qmltype BlendStateSeparate
+ \instantiates Qt3D::QBlendStateSeparate
+ \inherits RenderState
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief Encapsulates blending information
+*/
+
+/*!
+ The constructor creates a QBlendStateSeparate with the
+ specified \a parent.
+ */
+QBlendStateSeparate::QBlendStateSeparate(QNode *parent)
+ : QBlendState(QRenderState::BlendStateSeparate, parent)
+{
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qblendstate.h b/src/render/frontend/qblendstate.h
index 6284e668e..2217944f3 100644
--- a/src/render/frontend/qblendstate.h
+++ b/src/render/frontend/qblendstate.h
@@ -49,7 +49,6 @@ class QBlendStatePrivate;
class QT3DRENDERERSHARED_EXPORT QBlendState : public QRenderState
{
Q_OBJECT
- Q_ENUMS(Blending)
Q_PROPERTY(Blending srcRGB READ srcRGB WRITE setSrcRGB NOTIFY srcRGBChanged)
Q_PROPERTY(Blending srcAlpha READ srcAlpha WRITE setSrcAlpha NOTIFY srcAlphaChanged)
Q_PROPERTY(Blending dstRGB READ dstRGB WRITE setDstRGB NOTIFY dstRGBChanged)
@@ -79,6 +78,7 @@ public:
OneMinusSrc1Alpha,
OneMinusSrc1Color0
};
+ Q_ENUM(Blending)
explicit QBlendState(QNode *parent = 0);
@@ -102,12 +102,20 @@ Q_SIGNALS:
protected:
void copy(const QNode *ref) Q_DECL_OVERRIDE;
+ QBlendState(QRenderState::Type type, QNode *parent = 0);
private:
Q_DECLARE_PRIVATE(QBlendState)
QT3D_CLONEABLE(QBlendState)
};
+class QT3DRENDERERSHARED_EXPORT QBlendStateSeparate : public QBlendState
+{
+ Q_OBJECT
+public:
+ explicit QBlendStateSeparate(QNode *parent = 0);
+};
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qcolormask.cpp b/src/render/frontend/qcolormask.cpp
index 22f130134..923f16b4d 100644
--- a/src/render/frontend/qcolormask.cpp
+++ b/src/render/frontend/qcolormask.cpp
@@ -44,8 +44,8 @@ namespace Qt3D {
class QColorMaskPrivate : public QRenderStatePrivate
{
public:
- QColorMaskPrivate(QColorMask *qq)
- : QRenderStatePrivate(qq, QRenderState::ColorMask)
+ QColorMaskPrivate()
+ : QRenderStatePrivate(QRenderState::ColorMask)
, m_red(true)
, m_green(true)
, m_blue(true)
@@ -61,16 +61,15 @@ public:
};
/*!
-
\class Qt3D::QColorMask
- \brief QColorMask allows to specify which color components should be written
- to the currently bound frame buffer.
+ \brief Allows specifying which color components should be written to the
+ currently bound frame buffer.
- By default each color component (red, green, blue, alpha) is set to true
- which means they will be written to the frame buffer. Setting any of the
- color component to false will prevent it from being written into the frame
- buffer.
+ By default, the property for each color component (red, green, blue, alpha)
+ is set to \c true which means they will be written to the frame buffer.
+ Setting any of the color component to \c false will prevent it from being
+ written into the frame buffer.
*/
@@ -78,7 +77,7 @@ public:
Constructs a new Qt3D::QColorMask instance with \a parent as parent.
*/
QColorMask::QColorMask(QNode *parent)
- : QRenderState(*new QColorMaskPrivate(this), parent)
+ : QRenderState(*new QColorMaskPrivate, parent)
{
}
@@ -86,36 +85,24 @@ QColorMask::~QColorMask()
{
}
-/*!
- \return whether the red color component should be written to the frame buffer;
- */
bool QColorMask::isRed() const
{
Q_D(const QColorMask);
return d->m_red;
}
-/*!
- \return whether the green color component should be written to the frame buffer;
- */
bool QColorMask::isGreen() const
{
Q_D(const QColorMask);
return d->m_green;
}
-/*!
- \return whether the blue color component should be written to the frame buffer;
- */
bool QColorMask::isBlue() const
{
Q_D(const QColorMask);
return d->m_blue;
}
-/*!
- \return whether the alpha color component should be written to the frame buffer;
- */
bool QColorMask::isAlpha() const
{
Q_D(const QColorMask);
@@ -123,7 +110,8 @@ bool QColorMask::isAlpha() const
}
/*!
- Sets whether the \a red color component should be written to the frame buffer;
+ \property Qt3D::QColorMask::red
+ Holds whether the red color component should be written to the frame buffer.
*/
void QColorMask::setRed(bool red)
{
@@ -135,7 +123,8 @@ void QColorMask::setRed(bool red)
}
/*!
- Sets whether the \a greem color component should be written to the frame buffer;
+ \property Qt3D::QColorMask::green
+ Holds whether the green color component should be written to the frame buffer.
*/
void QColorMask::setGreen(bool green)
{
@@ -147,7 +136,8 @@ void QColorMask::setGreen(bool green)
}
/*!
- Sets whether the \a blue color component should be written to the frame buffer;
+ \property Qt3D::QColorMask::blue
+ Holds whether the blue color component should be written to the frame buffer.
*/
void QColorMask::setBlue(bool blue)
{
@@ -159,7 +149,8 @@ void QColorMask::setBlue(bool blue)
}
/*!
- Sets whether the \a alpha color component should be written to the frame buffer;
+ \property Qt3D::QColorMask::alpha
+ Holds whether the alpha component should be written to the frame buffer.
*/
void QColorMask::setAlpha(bool alpha)
{
diff --git a/src/render/frontend/qcuboidmesh.cpp b/src/render/frontend/qcuboidmesh.cpp
index 42bd15888..26238f8b6 100644
--- a/src/render/frontend/qcuboidmesh.cpp
+++ b/src/render/frontend/qcuboidmesh.cpp
@@ -48,8 +48,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QCuboidMeshPrivate::QCuboidMeshPrivate(QCuboidMesh *qq)
- : QAbstractMeshPrivate(qq)
+/*!
+ \class Qt3D::QCuboidMeshPrivate
+ \internal
+*/
+QCuboidMeshPrivate::QCuboidMeshPrivate()
+ : QAbstractMeshPrivate()
, m_xExtent(1.0)
, m_yExtent(1.0)
, m_zExtent(1.0)
@@ -72,11 +76,12 @@ void QCuboidMesh::copy(const QNode *ref)
}
QCuboidMesh::QCuboidMesh(QNode *parent)
- : QAbstractMesh(*new QCuboidMeshPrivate(this), parent)
+ : QAbstractMesh(*new QCuboidMeshPrivate, parent)
{
update();
}
+/*! \internal */
QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
{
diff --git a/src/render/frontend/qcuboidmesh_p.h b/src/render/frontend/qcuboidmesh_p.h
index c809189ce..f28e320ab 100644
--- a/src/render/frontend/qcuboidmesh_p.h
+++ b/src/render/frontend/qcuboidmesh_p.h
@@ -50,7 +50,7 @@ class QCuboidMesh;
class QCuboidMeshPrivate : QAbstractMeshPrivate
{
public:
- QCuboidMeshPrivate(QCuboidMesh *qq);
+ QCuboidMeshPrivate();
Q_DECLARE_PUBLIC(QCuboidMesh)
diff --git a/src/render/frontend/qcullface.cpp b/src/render/frontend/qcullface.cpp
index 6dd243762..cf2303ee6 100644
--- a/src/render/frontend/qcullface.cpp
+++ b/src/render/frontend/qcullface.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QCullFacePrivate : public QRenderStatePrivate
{
public:
- QCullFacePrivate(QCullFace *qq)
- : QRenderStatePrivate(qq, QRenderState::CullFace)
+ QCullFacePrivate()
+ : QRenderStatePrivate(QRenderState::CullFace)
, m_mode(QCullFace::Back)
{
}
@@ -58,7 +58,7 @@ public:
};
QCullFace::QCullFace(QNode *parent)
- : QRenderState(*new QCullFacePrivate(this), parent)
+ : QRenderState(*new QCullFacePrivate, parent)
{
}
diff --git a/src/render/frontend/qcullface.h b/src/render/frontend/qcullface.h
index 7b30aff4d..3321e0cd0 100644
--- a/src/render/frontend/qcullface.h
+++ b/src/render/frontend/qcullface.h
@@ -50,7 +50,6 @@ class QCullFacePrivate;
class QT3DRENDERERSHARED_EXPORT QCullFace : public QRenderState
{
Q_OBJECT
- Q_ENUMS(CullingMode)
Q_PROPERTY(CullingMode mode READ mode WRITE setMode NOTIFY modeChanged)
public:
@@ -61,6 +60,7 @@ public:
Back = 0x0405,
FrontAndBack = 0x0408
};
+ Q_ENUM(CullingMode)
explicit QCullFace(QNode *parent = 0);
diff --git a/src/render/frontend/qcylindermesh.cpp b/src/render/frontend/qcylindermesh.cpp
index 5c93a8234..f7fe495c9 100644
--- a/src/render/frontend/qcylindermesh.cpp
+++ b/src/render/frontend/qcylindermesh.cpp
@@ -68,8 +68,8 @@ private:
class QCylinderMeshPrivate : public QAbstractMeshPrivate
{
- QCylinderMeshPrivate(QCylinderMesh *qq)
- : QAbstractMeshPrivate(qq)
+ QCylinderMeshPrivate()
+ : QAbstractMeshPrivate()
, m_rings(16)
, m_slices(16)
, m_radius(1.0)
@@ -94,7 +94,7 @@ void QCylinderMesh::copy(const QNode *ref)
}
QCylinderMesh::QCylinderMesh(QNode *parent)
- : QAbstractMesh(*new QCylinderMeshPrivate(this), parent)
+ : QAbstractMesh(*new QCylinderMeshPrivate, parent)
{
update();
}
diff --git a/src/render/frontend/qdepthmask.cpp b/src/render/frontend/qdepthmask.cpp
index 81aaffd68..d3cb3d047 100644
--- a/src/render/frontend/qdepthmask.cpp
+++ b/src/render/frontend/qdepthmask.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QDepthMaskPrivate : public QRenderStatePrivate
{
public:
- QDepthMaskPrivate(QDepthMask *qq)
- : QRenderStatePrivate(qq, QRenderState::DepthMask)
+ QDepthMaskPrivate()
+ : QRenderStatePrivate(QRenderState::DepthMask)
, m_mask(false)
{
}
@@ -58,7 +58,7 @@ public:
};
QDepthMask::QDepthMask(QNode *parent)
- : QRenderState(*new QDepthMaskPrivate(this), parent)
+ : QRenderState(*new QDepthMaskPrivate, parent)
{
}
diff --git a/src/render/frontend/qdepthtest.cpp b/src/render/frontend/qdepthtest.cpp
index e7ba1c91e..331a5be8d 100644
--- a/src/render/frontend/qdepthtest.cpp
+++ b/src/render/frontend/qdepthtest.cpp
@@ -49,8 +49,8 @@ class QDepthTest;
class QDepthTestPrivate : public QRenderStatePrivate
{
public :
- QDepthTestPrivate(QDepthTest *qq)
- : QRenderStatePrivate(qq, QRenderState::DepthTest)
+ QDepthTestPrivate()
+ : QRenderStatePrivate(QRenderState::DepthTest)
, m_func(QDepthTest::Never)
{
}
@@ -67,7 +67,7 @@ void QDepthTest::copy(const QNode *ref)
}
QDepthTest::QDepthTest(QNode *parent)
- : QRenderState(*new QDepthTestPrivate(this), parent)
+ : QRenderState(*new QDepthTestPrivate, parent)
{
}
diff --git a/src/render/frontend/qdepthtest.h b/src/render/frontend/qdepthtest.h
index 7aa31b871..07579a4e9 100644
--- a/src/render/frontend/qdepthtest.h
+++ b/src/render/frontend/qdepthtest.h
@@ -49,7 +49,6 @@ class QDepthTestPrivate;
class QT3DRENDERERSHARED_EXPORT QDepthTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(DepthFunc)
Q_PROPERTY(DepthFunc func READ func WRITE setFunc NOTIFY funcChanged)
public:
@@ -63,6 +62,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(DepthFunc)
explicit QDepthTest(QNode *parent = 0);
diff --git a/src/render/frontend/qdirectionallight.cpp b/src/render/frontend/qdirectionallight.cpp
index cf24db3e9..515ddfae0 100644
--- a/src/render/frontend/qdirectionallight.cpp
+++ b/src/render/frontend/qdirectionallight.cpp
@@ -61,8 +61,12 @@ namespace Qt3D {
* \endcode
*/
-QDirectionalLightPrivate::QDirectionalLightPrivate(QDirectionalLight *qq)
- : QAbstractLightPrivate(qq)
+/*!
+ \class Qt3D::QDirectionalLightPrivate
+ \internal
+*/
+QDirectionalLightPrivate::QDirectionalLightPrivate()
+ : QAbstractLightPrivate()
{
}
@@ -76,10 +80,11 @@ void QDirectionalLight::copy(const QNode *ref)
}
QDirectionalLight::QDirectionalLight(QNode *parent)
- : QAbstractLight(*new QDirectionalLightPrivate(this), parent)
+ : QAbstractLight(*new QDirectionalLightPrivate, parent)
{
}
+/*! \internal */
QDirectionalLight::QDirectionalLight(QDirectionalLightPrivate &dd, QNode *parent)
: QAbstractLight(dd, parent)
{
diff --git a/src/render/frontend/qdirectionallight_p.h b/src/render/frontend/qdirectionallight_p.h
index eecd1e078..bfe24211c 100644
--- a/src/render/frontend/qdirectionallight_p.h
+++ b/src/render/frontend/qdirectionallight_p.h
@@ -48,7 +48,7 @@ class QDirectionalLight;
class QT3DRENDERERSHARED_EXPORT QDirectionalLightPrivate : QAbstractLightPrivate
{
public:
- QDirectionalLightPrivate(QDirectionalLight *qq);
+ QDirectionalLightPrivate();
Q_DECLARE_PUBLIC(QDirectionalLight)
QVector3D m_direction;
diff --git a/src/render/frontend/qdithering.cpp b/src/render/frontend/qdithering.cpp
index 7b45db087..6d8bb5fdf 100644
--- a/src/render/frontend/qdithering.cpp
+++ b/src/render/frontend/qdithering.cpp
@@ -47,15 +47,15 @@ namespace Qt3D {
class QDitheringPrivate : public QRenderStatePrivate
{
public:
- QDitheringPrivate(QDithering *qq)
- : QRenderStatePrivate(qq, QRenderState::Dithering)
+ QDitheringPrivate()
+ : QRenderStatePrivate(QRenderState::Dithering)
{}
Q_DECLARE_PUBLIC(QDithering)
};
QDithering::QDithering(QNode *parent)
- : QRenderState(*new QDitheringPrivate(this), parent)
+ : QRenderState(*new QDitheringPrivate, parent)
{
}
diff --git a/src/render/frontend/qeffect.cpp b/src/render/frontend/qeffect.cpp
index 57527fc4b..70590ec58 100644
--- a/src/render/frontend/qeffect.cpp
+++ b/src/render/frontend/qeffect.cpp
@@ -45,12 +45,17 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QEffectPrivate::QEffectPrivate(QEffect *qq)
- : QNodePrivate(qq)
-{}
+/*!
+ \class Qt3D::QEffectPrivate
+ \internal
+*/
+QEffectPrivate::QEffectPrivate()
+ : QNodePrivate()
+{
+}
QEffect::QEffect(QNode *parent)
- : QNode(*new QEffectPrivate(this), parent)
+ : QNode(*new QEffectPrivate, parent)
{
}
@@ -65,6 +70,7 @@ void QEffect::copy(const QNode* ref)
addTechnique(qobject_cast<QTechnique *>(QNode::clone(t)));
}
+/*! \internal */
QEffect::QEffect(QEffectPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
@@ -140,7 +146,7 @@ void QEffect::addTechnique(QTechnique *t)
}
/*!
- * Removes a technique \t from the effect. This posts a ComponentRemoved
+ * Removes a technique \a t from the effect. This posts a ComponentRemoved
* QScenePropertyChange notification to the QChangeArbiter, the value is
* the removed technique's id and the property name is "technique".
*/
diff --git a/src/render/frontend/qeffect_p.h b/src/render/frontend/qeffect_p.h
index fd4c7978a..53485c6cd 100644
--- a/src/render/frontend/qeffect_p.h
+++ b/src/render/frontend/qeffect_p.h
@@ -51,7 +51,7 @@ class QTechnique;
class QT3DRENDERERSHARED_EXPORT QEffectPrivate : public QNodePrivate
{
public :
- QEffectPrivate(QEffect *qq);
+ QEffectPrivate();
Q_DECLARE_PUBLIC(QEffect)
QList<QParameter *> m_parameters;
diff --git a/src/render/frontend/qfrontface.cpp b/src/render/frontend/qfrontface.cpp
index a136748f2..add4f2bab 100644
--- a/src/render/frontend/qfrontface.cpp
+++ b/src/render/frontend/qfrontface.cpp
@@ -47,8 +47,8 @@ namespace Qt3D {
class QFrontFacePrivate : public QRenderStatePrivate
{
public:
- QFrontFacePrivate(QFrontFace *qq)
- : QRenderStatePrivate(qq, QRenderState::FrontFace)
+ QFrontFacePrivate()
+ : QRenderStatePrivate(QRenderState::FrontFace)
, m_direction(QFrontFace::ClockWise)
{
}
@@ -58,7 +58,7 @@ public:
};
QFrontFace::QFrontFace(QNode *parent)
- : QRenderState(*new QFrontFacePrivate(this), parent)
+ : QRenderState(*new QFrontFacePrivate, parent)
{
}
diff --git a/src/render/frontend/qfrontface.h b/src/render/frontend/qfrontface.h
index b93371a3b..b1d6eb904 100644
--- a/src/render/frontend/qfrontface.h
+++ b/src/render/frontend/qfrontface.h
@@ -49,7 +49,6 @@ class QFrontFacePrivate;
class QT3DRENDERERSHARED_EXPORT QFrontFace : public QRenderState
{
Q_OBJECT
- Q_ENUMS(FaceDir)
Q_PROPERTY(FaceDir direction READ direction WRITE setDirection NOTIFY directionChanged)
public:
@@ -58,6 +57,7 @@ public:
ClockWise = 0x0900,
CounterClockWise = 0x0901
};
+ Q_ENUM(FaceDir)
explicit QFrontFace(QNode *parent = 0);
diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp
index a7886304f..afef8df3f 100644
--- a/src/render/frontend/qlayer.cpp
+++ b/src/render/frontend/qlayer.cpp
@@ -41,11 +41,35 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QLayerPrivate::QLayerPrivate(QLayer *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QLayerPrivate
+ \internal
+*/
+QLayerPrivate::QLayerPrivate()
+ : QComponentPrivate()
{
}
+/*!
+ \class QLayer
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief The QLayer class provides ...
+*/
+
+/*!
+ \qmltype Layer
+ \instantiates Qt3D::QLayer
+ \inherits Component3D
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For ...
+*/
+
+
+/*! \fn void Qt3D::QLayer::copy(const QNode *ref)
+ Copies the \a ref instance into this one.
+ */
void QLayer::copy(const QNode *ref)
{
QComponent::copy(ref);
@@ -53,16 +77,31 @@ void QLayer::copy(const QNode *ref)
d_func()->m_names = layer->d_func()->m_names;
}
+/*! \fn Qt3D::QLayer::QLayer(QObject *parent)
+ Constructs a new QLayer with the specified \a parent.
+ */
+
QLayer::QLayer(QNode *parent)
- : QComponent(*new QLayerPrivate(this), parent)
+ : QComponent(*new QLayerPrivate, parent)
{
}
+/*! \internal */
QLayer::QLayer(QLayerPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
}
+/*!
+ \property Qt3D::QLayer::names
+
+ */
+
+/*!
+ \qmlproperty stringlist Qt3D.Render::Layer::names
+
+*/
+
QStringList QLayer::names() const
{
Q_D(const QLayer);
diff --git a/src/render/frontend/qlayer_p.h b/src/render/frontend/qlayer_p.h
index abc5a031a..affd71bb4 100644
--- a/src/render/frontend/qlayer_p.h
+++ b/src/render/frontend/qlayer_p.h
@@ -48,7 +48,7 @@ namespace Qt3D {
class QT3DRENDERERSHARED_EXPORT QLayerPrivate : QComponentPrivate
{
public:
- QLayerPrivate(QLayer *qq);
+ QLayerPrivate();
Q_DECLARE_PUBLIC(QLayer)
QStringList m_names;
diff --git a/src/render/frontend/qmaterial.cpp b/src/render/frontend/qmaterial.cpp
index e9de8a21c..54efb6709 100644
--- a/src/render/frontend/qmaterial.cpp
+++ b/src/render/frontend/qmaterial.cpp
@@ -43,8 +43,7 @@
#include <Qt3DCore/qscenepropertychange.h>
/*!
- * \class QMaterial
- * \namespace Qt3D
+ * \class Qt3D::QMaterial
*
* \inherits Component
*
@@ -53,18 +52,23 @@
*
* QAbstractMaterial provide a way to specify the rendering of an Entity.
* Any aspect can define its own subclass of QAbstractMaterial so that a
- * Material can be used to describe a visual element, the way sound should
- * reflect on an element, the temperature of a surface and so on.
+ * Material can be used to describe a visual element; for example, the way
+ * sound should reflect off an element, the temperature of a surface,
+ * and so on.
*
- * \sa QEffect, QMesh, QComponent
+ * \sa QEffect, QMesh, {Qt3D::}{QComponent}
*/
QT_BEGIN_NAMESPACE
namespace Qt3D {
-QMaterialPrivate::QMaterialPrivate(QMaterial *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QMaterialPrivate
+ \internal
+*/
+QMaterialPrivate::QMaterialPrivate()
+ : QComponentPrivate()
, m_effect(Q_NULLPTR)
{
}
@@ -81,10 +85,11 @@ void QMaterial::copy(const QNode *ref)
}
QMaterial::QMaterial(QNode *parent)
- : QComponent(*new QMaterialPrivate(this), parent)
+ : QComponent(*new QMaterialPrivate, parent)
{
}
+/*! \internal */
QMaterial::QMaterial(QMaterialPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
diff --git a/src/render/frontend/qmaterial_p.h b/src/render/frontend/qmaterial_p.h
index 13e6dd7fb..e11e7258d 100644
--- a/src/render/frontend/qmaterial_p.h
+++ b/src/render/frontend/qmaterial_p.h
@@ -50,7 +50,7 @@ class QEffect;
class QT3DRENDERERSHARED_EXPORT QMaterialPrivate : public QComponentPrivate
{
public:
- QMaterialPrivate(QMaterial *qq);
+ QMaterialPrivate();
Q_DECLARE_PUBLIC(QMaterial)
QList<QParameter *> m_parameters;
diff --git a/src/render/frontend/qmesh.cpp b/src/render/frontend/qmesh.cpp
index c2fb74cf1..660fd26e5 100644
--- a/src/render/frontend/qmesh.cpp
+++ b/src/render/frontend/qmesh.cpp
@@ -61,9 +61,14 @@ private:
};
-QMeshPrivate::QMeshPrivate(QMesh *qq)
- : QAbstractMeshPrivate(qq)
-{}
+/*!
+ \class Qt3D::QMeshPrivate
+ \internal
+*/
+QMeshPrivate::QMeshPrivate()
+ : QAbstractMeshPrivate()
+{
+}
void QMesh::copy(const QNode *ref)
{
@@ -73,10 +78,11 @@ void QMesh::copy(const QNode *ref)
}
QMesh::QMesh(QNode *parent)
- : QAbstractMesh(*new QMeshPrivate(this), parent)
+ : QAbstractMesh(*new QMeshPrivate, parent)
{
}
+/*! \internal */
QMesh::QMesh(QMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
{
diff --git a/src/render/frontend/qmesh_p.h b/src/render/frontend/qmesh_p.h
index feca183c8..c663999b7 100644
--- a/src/render/frontend/qmesh_p.h
+++ b/src/render/frontend/qmesh_p.h
@@ -51,7 +51,7 @@ class QMesh;
class QT3DRENDERERSHARED_EXPORT QMeshPrivate : public QAbstractMeshPrivate
{
public:
- QMeshPrivate(QMesh *qq);
+ QMeshPrivate();
Q_DECLARE_PUBLIC(QMesh)
diff --git a/src/render/frontend/qopenglfilter.cpp b/src/render/frontend/qopenglfilter.cpp
index b4b16981d..c6bf6da1a 100644
--- a/src/render/frontend/qopenglfilter.cpp
+++ b/src/render/frontend/qopenglfilter.cpp
@@ -45,15 +45,13 @@ namespace Qt3D {
class QOpenGLFilterPrivate : public QObjectPrivate
{
public:
-
- QOpenGLFilterPrivate(QOpenGLFilter *qq)
+ QOpenGLFilterPrivate()
: QObjectPrivate()
, m_api(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL ? QOpenGLFilter::Desktop : QOpenGLFilter::ES)
, m_profile(QOpenGLFilter::None) // matches all (no profile, core, compat)
, m_minor(0)
, m_major(0)
{
- q_ptr = qq;
}
Q_DECLARE_PUBLIC(QOpenGLFilter)
@@ -65,11 +63,33 @@ public:
QString m_vendor;
};
+/*!
+ \class QOpenGLFilter
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief The QOpenGLFilter class provides ...
+*/
+
+/*!
+ \qmltype OpenGLFilter
+ \instantiates Qt3D::QOpenGLFilter
+ \inherits QtObject
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For OpenGL ...
+*/
+
+/*! \fn Qt3D::QOpenGLFilter::QOpenGLFilter(QObject *parent)
+ Constructs a new QOpenGLFilter with the specified \a parent.
+ */
QOpenGLFilter::QOpenGLFilter(QObject *parent)
- : QObject(*new QOpenGLFilterPrivate(this), parent)
+ : QObject(*new QOpenGLFilterPrivate, parent)
{
}
+/*! \fn void Qt3D::QOpenGLFilter::copy(const QOpenGLFilter &ref)
+ Copies the \a ref instance into this one.
+ */
void QOpenGLFilter::copy(const QOpenGLFilter &ref)
{
Q_D(QOpenGLFilter);
@@ -81,36 +101,119 @@ void QOpenGLFilter::copy(const QOpenGLFilter &ref)
d->m_vendor = ref.vendor();
}
+/*!
+ \enum Qt3D::QOpenGLFilter::Api
+
+ \value ES QSurfaceFormat::OpenGLES
+ \value Desktop QSurfaceFormat::OpenGL
+
+*/
+
+/*!
+ \enum Qt3D::QOpenGLFilter::Profile
+
+ \value None QSurfaceFormat::NoProfile
+ \value Core QSurfaceFormat::CoreProfile
+ \value Compatibility QSurfaceFormat::CompatibilityProfile
+
+*/
+
+/*!
+ \property Qt3D::QOpenGLFilter::api
+
+*/
+
+/*!
+ \qmlproperty enumeration Qt3D.Render::OpenGLFilter::api
+
+
+ \value ES QSurfaceFormat::OpenGLES
+ \value Desktop QSurfaceFormat::OpenGL
+*/
+
QOpenGLFilter::Api QOpenGLFilter::api() const
{
Q_D(const QOpenGLFilter);
return d->m_api;
}
+/*!
+ \property Qt3D::QOpenGLFilter::profile
+
+*/
+
+/*!
+ \qmlproperty enumeration Qt3D.Render::OpenGLFilter::profile
+
+ \value None QSurfaceFormat::NoProfile
+ \value Core QSurfaceFormat::CoreProfile
+ \value Compatibility QSurfaceFormat::CompatibilityProfile
+*/
+
QOpenGLFilter::Profile QOpenGLFilter::profile() const
{
Q_D(const QOpenGLFilter);
return d->m_profile;
}
+/*!
+ \property Qt3D::QOpenGLFilter::minorVersion
+
+ */
+
+/*!
+ \qmlproperty int Qt3D.Render::OpenGLFilter::minorVersion
+
+*/
+
int QOpenGLFilter::minorVersion() const
{
Q_D(const QOpenGLFilter);
return d->m_minor;
}
+/*!
+ \property Qt3D::QOpenGLFilter::majorVersion
+
+ */
+
+/*!
+ \qmlproperty int Qt3D.Render::OpenGLFilter::majorVersion
+
+*/
+
int QOpenGLFilter::majorVersion() const
{
Q_D(const QOpenGLFilter);
return d->m_major;
}
+/*!
+ \property Qt3D::QOpenGLFilter::extensions
+
+ */
+
+/*!
+ \qmlproperty stringlist Qt3D.Render::OpenGLFilter::extensions
+
+*/
+
QStringList QOpenGLFilter::extensions() const
{
Q_D(const QOpenGLFilter);
return d->m_extensions;
}
+/*!
+ \property Qt3D::QOpenGLFilter::vendor
+
+ */
+
+/*!
+ \qmlproperty string Qt3D.Render::OpenGLFilter::vendor
+
+*/
+
QString QOpenGLFilter::vendor() const
{
Q_D(const QOpenGLFilter);
@@ -177,6 +280,10 @@ void QOpenGLFilter::setVendor(const QString &vendor)
}
}
+/*! \fn bool Qt3D::operator ==(const QOpenGLFilter &reference, const QOpenGLFilter &sample)
+ \relates Qt3D::QOpenGLFilter
+ Returns true if \a reference and \a sample are equivalent.
+ */
bool operator ==(const QOpenGLFilter &reference, const QOpenGLFilter &sample)
{
if (sample.api() == reference.api()
@@ -195,11 +302,18 @@ bool operator ==(const QOpenGLFilter &reference, const QOpenGLFilter &sample)
return false;
}
+/*! \fn bool Qt3D::operator !=(const QOpenGLFilter &reference, const QOpenGLFilter &sample)
+ \relates Qt3D::QOpenGLFilter
+ Returns true if \a reference and \a sample are different.
+ */
bool operator !=(const QOpenGLFilter &reference, const QOpenGLFilter &sample)
{
return !(reference == sample);
}
+/*! \fn void Qt3D::QOpenGLFilter::openGLFilterChanged()
+ This signal is emitted when the value of any property is changed.
+*/
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qopenglfilter.h b/src/render/frontend/qopenglfilter.h
index 313ce497a..c648d2b73 100644
--- a/src/render/frontend/qopenglfilter.h
+++ b/src/render/frontend/qopenglfilter.h
@@ -51,8 +51,6 @@ class QOpenGLFilterPrivate;
class QT3DRENDERERSHARED_EXPORT QOpenGLFilter : public QObject
{
Q_OBJECT
- Q_ENUMS(Api)
- Q_ENUMS(Profile)
Q_PROPERTY(Qt3D::QOpenGLFilter::Api api READ api WRITE setApi NOTIFY apiChanged)
Q_PROPERTY(Qt3D::QOpenGLFilter::Profile profile READ profile WRITE setProfile NOTIFY profileChanged)
Q_PROPERTY(int minorVersion READ minorVersion WRITE setMinorVersion NOTIFY minorVersionChanged)
@@ -67,6 +65,7 @@ public:
ES = QSurfaceFormat::OpenGLES,
Desktop = QSurfaceFormat::OpenGL
};
+ Q_ENUM(Api)
enum Profile
{
@@ -74,6 +73,7 @@ public:
Core = QSurfaceFormat::CoreProfile,
Compatibility = QSurfaceFormat::CompatibilityProfile
};
+ Q_ENUM(Profile)
explicit QOpenGLFilter(QObject *parent = 0);
diff --git a/src/render/frontend/qparameter.cpp b/src/render/frontend/qparameter.cpp
index 9a1ec67c5..92cb0d4d8 100644
--- a/src/render/frontend/qparameter.cpp
+++ b/src/render/frontend/qparameter.cpp
@@ -45,8 +45,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QParameterPrivate::QParameterPrivate(QParameter *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QParameterPrivate
+ \internal
+*/
+QParameterPrivate::QParameterPrivate()
+ : QNodePrivate()
{
}
@@ -63,18 +67,19 @@ void QParameter::copy(const QNode *ref)
d_func()->m_value = param->d_func()->m_value;
}
+/*! \internal */
QParameter::QParameter(QParameterPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
}
QParameter::QParameter(QNode *parent)
- : QNode(*new QParameterPrivate(this), parent)
+ : QNode(*new QParameterPrivate, parent)
{
}
QParameter::QParameter(const QString &name, const QVariant &value, QNode *parent)
- : QNode(*new QParameterPrivate(this), parent)
+ : QNode(*new QParameterPrivate, parent)
{
Q_D(QParameter);
d->m_name = name;
@@ -82,7 +87,7 @@ QParameter::QParameter(const QString &name, const QVariant &value, QNode *parent
}
QParameter::QParameter(const QString &name, QAbstractTextureProvider *texture, QNode *parent)
- : QNode(*new QParameterPrivate(this), parent)
+ : QNode(*new QParameterPrivate, parent)
{
Q_D(QParameter);
d->m_name = name;
diff --git a/src/render/frontend/qparameter_p.h b/src/render/frontend/qparameter_p.h
index 668887244..bc7fe7f30 100644
--- a/src/render/frontend/qparameter_p.h
+++ b/src/render/frontend/qparameter_p.h
@@ -49,7 +49,7 @@ class QParameter;
class QT3DRENDERERSHARED_PRIVATE_EXPORT QParameterPrivate : public QNodePrivate
{
public:
- QParameterPrivate(QParameter *qq);
+ QParameterPrivate();
Q_DECLARE_PUBLIC(QParameter)
diff --git a/src/render/frontend/qparametermapping.cpp b/src/render/frontend/qparametermapping.cpp
index 61c4946be..e2b266f8d 100644
--- a/src/render/frontend/qparametermapping.cpp
+++ b/src/render/frontend/qparametermapping.cpp
@@ -41,12 +41,34 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QParameterMappingPrivate::QParameterMappingPrivate(QParameterMapping *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QParameterMappingPrivate
+ \internal
+*/
+QParameterMappingPrivate::QParameterMappingPrivate()
+ : QNodePrivate()
, m_bindingType(QParameterMapping::Uniform)
{
}
-
+/*!
+ \class QParameterMapping
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief The QParameterMapping class provides ...
+*/
+
+/*!
+ \qmltype ParameterMapping
+ \instantiates Qt3D::QParameterMapping
+ \inherits Node
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For ...
+*/
+
+/*! \fn void Qt3D::QParameterMapping::copy(const QNode *ref)
+ Copies the \a ref instance into this one.
+ */
void QParameterMapping::copy(const QNode *ref)
{
QNode::copy(ref);
@@ -56,18 +78,36 @@ void QParameterMapping::copy(const QNode *ref)
d_func()->m_bindingType = mapper->d_func()->m_bindingType;
}
+/*! \fn Qt3D::QParameterMapping::QParameterMapping(QNode *parent)
+ Constructs a new QParameterMapping with the specified \a parent.
+ */
QParameterMapping::QParameterMapping(QNode *parent)
- : QNode(*new QParameterMappingPrivate(this), parent)
+ : QNode(*new QParameterMappingPrivate, parent)
{
}
+/*!
+ \enum Qt3D::QParameterMapping::Binding
+
+ \value Uniform
+ \value Attribute
+ \value StandardUniform
+ \value FragmentOutput
+
+*/
+
+/*! \internal */
QParameterMapping::QParameterMapping(QParameterMappingPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
}
+/*!
+ This constructor takes a \a parameterName, a \a shaderParameterName,
+ a \a bindingType, and a \a parent.
+ */
QParameterMapping::QParameterMapping(const QString &parameterName, const QString &shaderParameterName, QParameterMapping::Binding bindingType, QNode *parent)
- : QNode(*new QParameterMappingPrivate(this), parent)
+ : QNode(*new QParameterMappingPrivate, parent)
{
Q_D(QParameterMapping);
d->m_parameterName = parameterName;
@@ -75,6 +115,16 @@ QParameterMapping::QParameterMapping(const QString &parameterName, const QString
d->m_bindingType = bindingType;
}
+/*!
+ \property Qt3D::QParameterMapping::parameterName
+
+*/
+
+/*!
+ \qmlproperty string Qt3D.Render::ParameterMapping::parameterName
+
+*/
+
void QParameterMapping::setParameterName(const QString &name)
{
Q_D(QParameterMapping);
@@ -84,6 +134,16 @@ void QParameterMapping::setParameterName(const QString &name)
}
}
+/*!
+ \property Qt3D::QParameterMapping::shaderVariableName
+
+*/
+
+/*!
+ \qmlproperty string Qt3D.Render::ParameterMapping::shaderVariableName
+
+*/
+
void QParameterMapping::setShaderVariableName(const QString &name)
{
Q_D(QParameterMapping);
@@ -93,6 +153,19 @@ void QParameterMapping::setShaderVariableName(const QString &name)
}
}
+/*!
+ \property Qt3D::QParameterMapping::bindingType
+
+*/
+
+/*!
+ \qmlproperty BindingType Qt3D.Render::ParameterMapping::bindingType
+
+ \value Uniform
+ \value Attribute
+ \value StandardUniform
+ \value FragmentOutput
+*/
void QParameterMapping::setBindingType(QParameterMapping::Binding type)
{
Q_D(QParameterMapping);
diff --git a/src/render/frontend/qparametermapping.h b/src/render/frontend/qparametermapping.h
index 0373e45cc..024b5796a 100644
--- a/src/render/frontend/qparametermapping.h
+++ b/src/render/frontend/qparametermapping.h
@@ -49,7 +49,6 @@ class QParameterMappingPrivate;
class QT3DRENDERERSHARED_EXPORT QParameterMapping : public QNode
{
Q_OBJECT
- Q_ENUMS(Binding)
Q_PROPERTY(QString parameterName READ parameterName WRITE setParameterName NOTIFY parameterNameChanged)
Q_PROPERTY(QString shaderVariableName READ shaderVariableName WRITE setShaderVariableName NOTIFY shaderVariableNameChanged)
Q_PROPERTY(Binding bindingType READ bindingType WRITE setBindingType NOTIFY bindingTypeChanged)
@@ -61,6 +60,7 @@ public:
StandardUniform,
FragmentOutput
};
+ Q_ENUM(Binding)
explicit QParameterMapping(QNode *parent = 0);
QParameterMapping(const QString &parameterName, const QString &shaderParameterName, QParameterMapping::Binding bindingType, QNode *parent = 0);
diff --git a/src/render/frontend/qparametermapping_p.h b/src/render/frontend/qparametermapping_p.h
index 234afcf39..6f0234c69 100644
--- a/src/render/frontend/qparametermapping_p.h
+++ b/src/render/frontend/qparametermapping_p.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QParameterMappingPrivate : public QNodePrivate
{
public:
- QParameterMappingPrivate(QParameterMapping *qq);
+ QParameterMappingPrivate();
Q_DECLARE_PUBLIC(QParameterMapping)
diff --git a/src/render/frontend/qplanemesh.cpp b/src/render/frontend/qplanemesh.cpp
index 17b22cc9b..6aca02247 100644
--- a/src/render/frontend/qplanemesh.cpp
+++ b/src/render/frontend/qplanemesh.cpp
@@ -48,8 +48,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QPlaneMeshPrivate::QPlaneMeshPrivate(QPlaneMesh *qq)
- : QAbstractMeshPrivate(qq)
+/*!
+ \class Qt3D::QPlaneMeshPrivate
+ \internal
+*/
+QPlaneMeshPrivate::QPlaneMeshPrivate()
+ : QAbstractMeshPrivate()
, m_width(1.0f)
, m_height(1.0f)
, m_meshResolution(2, 2)
@@ -57,7 +61,7 @@ QPlaneMeshPrivate::QPlaneMeshPrivate(QPlaneMesh *qq)
}
QPlaneMesh::QPlaneMesh(QNode *parent)
- : QAbstractMesh(*new QPlaneMeshPrivate(this), parent)
+ : QAbstractMesh(*new QPlaneMeshPrivate, parent)
{
update();
}
@@ -71,6 +75,7 @@ void QPlaneMesh::copy(const QNode *ref)
d_func()->m_meshResolution = mesh->d_func()->m_meshResolution;
}
+/*! \internal */
QPlaneMesh::QPlaneMesh(QPlaneMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
{
diff --git a/src/render/frontend/qplanemesh_p.h b/src/render/frontend/qplanemesh_p.h
index 5d8982688..624635342 100644
--- a/src/render/frontend/qplanemesh_p.h
+++ b/src/render/frontend/qplanemesh_p.h
@@ -49,7 +49,7 @@ class QPlaneMesh;
class QPlaneMeshPrivate : public QAbstractMeshPrivate
{
public:
- QPlaneMeshPrivate(QPlaneMesh *qq);
+ QPlaneMeshPrivate();
Q_DECLARE_PUBLIC(QPlaneMesh)
diff --git a/src/render/frontend/qpointlight.cpp b/src/render/frontend/qpointlight.cpp
index 314875157..77cb68954 100644
--- a/src/render/frontend/qpointlight.cpp
+++ b/src/render/frontend/qpointlight.cpp
@@ -41,34 +41,58 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-/*!
- *
- * Expected Shader struct
- *
- * \code
- *
- * struct PointLight
- * {
- * vec3 position;
- * vec4 color;
- * float intensity;
- * };
- *
- * uniform PointLight pointLights[10];
- *
- * \endcode
+/*
+ Expected Shader struct
+
+ \code
+
+ struct PointLight
+ {
+ vec3 position;
+ vec4 color;
+ float intensity;
+ };
+
+ uniform PointLight pointLights[10];
+
+ \endcode
*/
-QPointLightPrivate::QPointLightPrivate(QPointLight *qq)
- : QAbstractLightPrivate(qq)
+/*!
+ \class Qt3D::QPointLightPrivate
+ \internal
+*/
+QPointLightPrivate::QPointLightPrivate()
+ : QAbstractLightPrivate()
{
}
+/*!
+ \class QPointLight
+ \inmodule Qt3DRender
+ \since 5.5
+
+ */
+
+/*!
+ \qmltype PointLight
+ \instantiates Qt3D::QPointLight
+ \inherits AbstractLight
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For OpenGL ...
+*/
+
+/*!
+ \fn Qt3D::QPointLight::QPointLight(QNode *parent)
+ Constructs a new QPointLight with the specified \a parent.
+ */
QPointLight::QPointLight(QNode *parent)
- : QAbstractLight(*new QPointLightPrivate(this), parent)
+ : QAbstractLight(*new QPointLightPrivate, parent)
{
}
+/*! \internal */
QPointLight::QPointLight(QPointLightPrivate &dd, QNode *parent)
: QAbstractLight(dd, parent)
{
diff --git a/src/render/frontend/qpointlight_p.h b/src/render/frontend/qpointlight_p.h
index 3b377f879..0e98319ed 100644
--- a/src/render/frontend/qpointlight_p.h
+++ b/src/render/frontend/qpointlight_p.h
@@ -48,7 +48,7 @@ class QPointLight;
class QT3DRENDERERSHARED_EXPORT QPointLightPrivate : public QAbstractLightPrivate
{
public:
- QPointLightPrivate(QPointLight *qq);
+ QPointLightPrivate();
Q_DECLARE_PUBLIC(QPointLight)
};
diff --git a/src/render/frontend/qpolygonoffset.cpp b/src/render/frontend/qpolygonoffset.cpp
index 13bb2ad9a..192e1ef02 100644
--- a/src/render/frontend/qpolygonoffset.cpp
+++ b/src/render/frontend/qpolygonoffset.cpp
@@ -44,8 +44,8 @@ namespace Qt3D {
class QPolygonOffsetPrivate : public QRenderStatePrivate
{
public:
- QPolygonOffsetPrivate(QPolygonOffset *qq)
- : QRenderStatePrivate(qq, QRenderState::PolygonOffset)
+ QPolygonOffsetPrivate()
+ : QRenderStatePrivate(QRenderState::PolygonOffset)
, m_factor(0)
, m_units(0)
{
@@ -58,7 +58,7 @@ public:
};
QPolygonOffset::QPolygonOffset(QNode *parent)
- : QRenderState(*new QPolygonOffsetPrivate(this), parent)
+ : QRenderState(*new QPolygonOffsetPrivate, parent)
{
}
diff --git a/src/render/frontend/qrenderattachment.cpp b/src/render/frontend/qrenderattachment.cpp
index fb7892fd9..8e3fd30af 100644
--- a/src/render/frontend/qrenderattachment.cpp
+++ b/src/render/frontend/qrenderattachment.cpp
@@ -42,8 +42,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderAttachmentPrivate::QRenderAttachmentPrivate(QRenderAttachment *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QRenderAttachmentPrivate
+ \internal
+*/
+QRenderAttachmentPrivate::QRenderAttachmentPrivate()
+ : QNodePrivate()
, m_texture(Q_NULLPTR)
, m_type(QRenderAttachment::ColorAttachment0)
, m_mipLevel(0)
@@ -61,10 +65,11 @@ void QRenderAttachment::copy(const QNode *ref)
}
QRenderAttachment::QRenderAttachment(QNode *parent)
- : QNode(*new QRenderAttachmentPrivate(this), parent)
+ : QNode(*new QRenderAttachmentPrivate, parent)
{
}
+/*! \internal */
QRenderAttachment::QRenderAttachment(QRenderAttachmentPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/render/frontend/qrenderattachment.h b/src/render/frontend/qrenderattachment.h
index e27813795..5cdd8113b 100644
--- a/src/render/frontend/qrenderattachment.h
+++ b/src/render/frontend/qrenderattachment.h
@@ -50,8 +50,6 @@ class QRenderAttachmentPrivate;
class QT3DRENDERERSHARED_EXPORT QRenderAttachment : public QNode
{
Q_OBJECT
- Q_ENUMS(RenderAttachmentType)
- Q_ENUMS(CubeMapFace)
Q_PROPERTY(RenderAttachmentType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(Qt3D::QAbstractTextureProvider *texture READ texture WRITE setTexture NOTIFY textureChanged)
Q_PROPERTY(int mipLevel READ mipLevel WRITE setMipLevel NOTIFY mipLevelChanged)
@@ -81,6 +79,7 @@ public:
StencilAttachment,
DepthStencilAttachment
};
+ Q_ENUM(RenderAttachmentType)
enum CubeMapFace {
CubeMapPositiveX = 0x8515, // GL_TEXTURE_CUBE_MAP_POSITIVE_X
@@ -90,6 +89,7 @@ public:
CubeMapPositiveZ = 0x8519, // GL_TEXTURE_CUBE_MAP_POSITIVE_Z
CubeMapNegativeZ = 0x851A // GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
+ Q_ENUM(CubeMapFace)
explicit QRenderAttachment(QNode *parent = 0);
@@ -132,4 +132,6 @@ private:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(Qt3D::QRenderAttachment::RenderAttachmentType)
+
#endif // QT3D_QRENDERATTACHMENT_H
diff --git a/src/render/frontend/qrenderattachment_p.h b/src/render/frontend/qrenderattachment_p.h
index f9e95cf83..8425c36e9 100644
--- a/src/render/frontend/qrenderattachment_p.h
+++ b/src/render/frontend/qrenderattachment_p.h
@@ -49,7 +49,7 @@ class QAbstractTextureProvider;
class QRenderAttachmentPrivate : public QNodePrivate
{
public:
- QRenderAttachmentPrivate(QRenderAttachment *qq);
+ QRenderAttachmentPrivate();
Q_DECLARE_PUBLIC(QRenderAttachment)
diff --git a/src/render/frontend/qrenderpass.cpp b/src/render/frontend/qrenderpass.cpp
index 3fa5d0308..b6b16dbd6 100644
--- a/src/render/frontend/qrenderpass.cpp
+++ b/src/render/frontend/qrenderpass.cpp
@@ -48,8 +48,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderPassPrivate::QRenderPassPrivate(QRenderPass *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QRenderPassPrivate
+ \internal
+*/
+QRenderPassPrivate::QRenderPassPrivate()
+ : QNodePrivate()
, m_shader(Q_NULLPTR)
{
}
@@ -69,10 +73,11 @@ void QRenderPass::copy(const QNode *ref)
}
QRenderPass::QRenderPass(QNode *parent)
- : QNode(*new QRenderPassPrivate(this), parent)
+ : QNode(*new QRenderPassPrivate, parent)
{
}
+/*! \internal */
QRenderPass::QRenderPass(QRenderPassPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
@@ -208,6 +213,14 @@ QList<QParameterMapping *> QRenderPass::bindings() const
return d->m_bindings;
}
+/*!
+ * Adds a Qt3D::QRenderState \a state to the rendering pass. That implies that
+ * when the pass is executed at render time, the globally set render state will
+ * be modifed by the states defined locally by the Qt3D::QRenderPass.
+ *
+ * \note not defining any Qt3D::QRenderState in a pass will result in the pass using
+ * the globally set render state for a given FrameGraph branch execution path.
+ */
void QRenderPass::addRenderState(QRenderState *state)
{
Q_D(QRenderPass);
@@ -221,12 +234,15 @@ void QRenderPass::addRenderState(QRenderState *state)
if (d->m_changeArbiter != Q_NULLPTR) {
QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
change->setPropertyName("renderState");
- change->setValue(QVariant::fromValue(QNode::clone(state)));
+ change->setValue(QVariant::fromValue(QNodePtr(QNode::clone(state))));
d->notifyObservers(change);
}
}
}
+/*!
+ * Removes \a state from the Qt3D::QRenderPass local render state.
+ */
void QRenderPass::removeRenderState(QRenderState *state)
{
Q_D(QRenderPass);
@@ -239,12 +255,58 @@ void QRenderPass::removeRenderState(QRenderState *state)
d->m_renderStates.removeOne(state);
}
+/*!
+ * Returns the list of Qt3D::QRenderState state objects making up the render
+ * state of the Qt3D::QRenderPass.
+ */
QList<QRenderState *> QRenderPass::renderStates() const
{
Q_D(const QRenderPass);
return d->m_renderStates;
}
+void QRenderPass::addParameter(QParameter *parameter)
+{
+ Q_D(QRenderPass);
+ if (!d->m_parameters.contains(parameter)) {
+ d->m_parameters.append(parameter);
+
+ // We need to add it as a child of the current node if it has been declared inline
+ // Or not previously added as a child of the current node so that
+ // 1) The backend gets notified about it's creation
+ // 2) When the current node is destroyed, the child parameters get destroyed as well
+ if (!parameter->parent())
+ parameter->setParent(this);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ }
+}
+
+void QRenderPass::removeParameter(QParameter *parameter)
+{
+ Q_D(QRenderPass);
+
+ if (d->m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, id()));
+ change->setPropertyName("parameter");
+ change->setValue(QVariant::fromValue(parameter->id()));
+ d->notifyObservers(change);
+ }
+ d->m_parameters.removeOne(parameter);
+}
+
+
+QList<QParameter *> QRenderPass::parameters() const
+{
+ Q_D(const QRenderPass);
+ return d->m_parameters;
+}
+
} // namespace Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qrenderpass.h b/src/render/frontend/qrenderpass.h
index f4e53552f..1f401860d 100644
--- a/src/render/frontend/qrenderpass.h
+++ b/src/render/frontend/qrenderpass.h
@@ -86,6 +86,10 @@ public:
void removeRenderState(QRenderState *state);
QList<QRenderState *> renderStates() const;
+ void addParameter(QParameter *p);
+ void removeParameter(QParameter *p);
+ QList<QParameter *> parameters() const;
+
Q_SIGNALS:
void shaderProgramChanged();
diff --git a/src/render/frontend/qrenderpass_p.h b/src/render/frontend/qrenderpass_p.h
index 3783e3d2e..cf21a23f7 100644
--- a/src/render/frontend/qrenderpass_p.h
+++ b/src/render/frontend/qrenderpass_p.h
@@ -60,7 +60,7 @@ class RenderStateSet;
class QT3DRENDERERSHARED_EXPORT QRenderPassPrivate : public QNodePrivate
{
public:
- QRenderPassPrivate(QRenderPass *qq);
+ QRenderPassPrivate();
Q_DECLARE_PUBLIC(QRenderPass)
ParameterList m_attributes;
@@ -71,6 +71,7 @@ public:
QList<QAnnotation *> m_annotationList;
QList<QParameterMapping *> m_bindings;
QList<QRenderState *> m_renderStates;
+ QList<QParameter *> m_parameters;
QShaderProgram *m_shader;
};
diff --git a/src/render/frontend/qrenderstate.cpp b/src/render/frontend/qrenderstate.cpp
index 17375c4c2..1b13b5d03 100644
--- a/src/render/frontend/qrenderstate.cpp
+++ b/src/render/frontend/qrenderstate.cpp
@@ -42,8 +42,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderStatePrivate::QRenderStatePrivate(QRenderState *qq, QRenderState::Type type)
- : QNodePrivate(qq),
+/*!
+ \class Qt3D::QRenderStatePrivate
+ \internal
+*/
+QRenderStatePrivate::QRenderStatePrivate(QRenderState::Type type)
+ : QNodePrivate(),
m_type(type)
{
}
@@ -54,6 +58,7 @@ QRenderState::Type QRenderState::type() const
return d->m_type;
}
+/*! \internal */
QRenderState::QRenderState(QRenderStatePrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/render/frontend/qrenderstate.h b/src/render/frontend/qrenderstate.h
index 1aef2d643..7f428b426 100644
--- a/src/render/frontend/qrenderstate.h
+++ b/src/render/frontend/qrenderstate.h
@@ -50,13 +50,14 @@ class QRenderStatePrivate;
class QT3DRENDERERSHARED_EXPORT QRenderState : public QNode
{
Q_OBJECT
- Q_ENUMS(Type)
+
public:
enum Type {
AlphaCoverage,
AlphaTest,
BlendEquation,
BlendState,
+ BlendStateSeparate,
ColorMask,
CullFace,
DepthMask,
@@ -67,6 +68,7 @@ public:
ScissorTest,
StencilTest
};
+ Q_ENUM(Type)
Type type() const;
diff --git a/src/render/frontend/qrenderstate_p.h b/src/render/frontend/qrenderstate_p.h
index fca72507a..8ae1dd5c3 100644
--- a/src/render/frontend/qrenderstate_p.h
+++ b/src/render/frontend/qrenderstate_p.h
@@ -48,8 +48,7 @@ namespace Qt3D {
class QRenderStatePrivate : public QNodePrivate
{
public:
-
- QRenderStatePrivate(QRenderState *qq, QRenderState::Type type);
+ QRenderStatePrivate(QRenderState::Type type);
Q_DECLARE_PUBLIC(QRenderState)
const QRenderState::Type m_type;
diff --git a/src/render/frontend/qrendertarget.cpp b/src/render/frontend/qrendertarget.cpp
index 3eb3b4e08..532a803c8 100644
--- a/src/render/frontend/qrendertarget.cpp
+++ b/src/render/frontend/qrendertarget.cpp
@@ -43,8 +43,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QRenderTargetPrivate::QRenderTargetPrivate(QRenderTarget *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QRenderTargetPrivate
+ \internal
+*/
+QRenderTargetPrivate::QRenderTargetPrivate()
+ : QComponentPrivate()
{
}
@@ -57,10 +61,11 @@ void QRenderTarget::copy(const QNode *ref)
}
QRenderTarget::QRenderTarget(QNode *parent)
- : QComponent(*new QRenderTargetPrivate(this), parent)
+ : QComponent(*new QRenderTargetPrivate, parent)
{
}
+/*! \internal */
QRenderTarget::QRenderTarget(QRenderTargetPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
diff --git a/src/render/frontend/qrendertarget_p.h b/src/render/frontend/qrendertarget_p.h
index b55161a49..50faf7308 100644
--- a/src/render/frontend/qrendertarget_p.h
+++ b/src/render/frontend/qrendertarget_p.h
@@ -49,7 +49,7 @@ class QRenderTarget;
class QRenderTargetPrivate : public QComponentPrivate
{
public:
- QRenderTargetPrivate(QRenderTarget *qq);
+ QRenderTargetPrivate();
Q_DECLARE_PUBLIC(QRenderTarget)
QList<QRenderAttachment *> m_attachments;
diff --git a/src/render/frontend/qscissortest.cpp b/src/render/frontend/qscissortest.cpp
index 0a5a724a5..5c8922d5f 100644
--- a/src/render/frontend/qscissortest.cpp
+++ b/src/render/frontend/qscissortest.cpp
@@ -48,8 +48,8 @@ namespace Qt3D {
class QScissorTestPrivate : public QRenderStatePrivate
{
public:
- QScissorTestPrivate(QScissorTest *qq)
- : QRenderStatePrivate(qq, QRenderState::ScissorTest)
+ QScissorTestPrivate()
+ : QRenderStatePrivate(QRenderState::ScissorTest)
, m_left(0)
, m_bottom(0)
, m_width(0)
@@ -65,7 +65,7 @@ public:
};
QScissorTest::QScissorTest(QNode *parent)
- : QRenderState(*new QScissorTestPrivate(this), parent)
+ : QRenderState(*new QScissorTestPrivate, parent)
{
}
diff --git a/src/render/frontend/qshaderdata.cpp b/src/render/frontend/qshaderdata.cpp
index c209a4c53..6caf7e5b1 100644
--- a/src/render/frontend/qshaderdata.cpp
+++ b/src/render/frontend/qshaderdata.cpp
@@ -41,14 +41,22 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QShaderDataPrivate::QShaderDataPrivate(QShaderData *qq)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QShaderDataPrivate
+ \internal
+*/
+QShaderDataPrivate::QShaderDataPrivate()
+ : QComponentPrivate()
, m_propertyReader(PropertyReaderInterfacePtr(new QShaderDataPropertyReader()))
{
}
-QShaderDataPrivate::QShaderDataPrivate(QShaderData *qq, PropertyReaderInterfacePtr reader)
- : QComponentPrivate(qq)
+/*!
+ \class Qt3D::QShaderDataPrivate
+ \internal
+*/
+QShaderDataPrivate::QShaderDataPrivate(PropertyReaderInterfacePtr reader)
+ : QComponentPrivate()
, m_propertyReader(reader)
{
}
@@ -59,15 +67,15 @@ QShaderDataPrivate::QShaderDataPrivate(QShaderData *qq, PropertyReaderInterfaceP
* \brief Provides a way of specifying values of a Uniform Block or a shader
* structure.
*
- * \note When subclassing and adding properties to Qt3D::QShaderData please not
- * that if you need to nest inner Qt3D::QShaderData, the data type of the
- * property should be Qt3D::QShaderData* and not whatever you named your subclass.
+ * \note When subclassing and adding properties to Qt3D::QShaderData, please note
+ * that if you need to nest an inner Qt3D::QShaderData, the data type of the
+ * property should be Qt3D::QShaderData* instead of the name of your subclass.
*
* \since 5.5
*/
QShaderData::QShaderData(QNode *parent)
- : QComponent(*new QShaderDataPrivate(this), parent)
+ : QComponent(*new QShaderDataPrivate, parent)
{
}
@@ -77,6 +85,7 @@ PropertyReaderInterfacePtr QShaderData::propertyReader() const
return d->m_propertyReader;
}
+/*! \internal */
QShaderData::QShaderData(QShaderDataPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
diff --git a/src/render/frontend/qshaderdata.h b/src/render/frontend/qshaderdata.h
index 4459ec8e2..f526dcfc1 100644
--- a/src/render/frontend/qshaderdata.h
+++ b/src/render/frontend/qshaderdata.h
@@ -58,7 +58,6 @@ typedef QSharedPointer<PropertyReaderInterface> PropertyReaderInterfacePtr;
class QT3DRENDERERSHARED_EXPORT QShaderData : public QComponent
{
Q_OBJECT
- Q_ENUMS(TransformType)
public:
explicit QShaderData(QNode *parent = 0);
@@ -66,6 +65,7 @@ public:
ModelToEye = 0,
ModelToWorld
};
+ Q_ENUM(TransformType)
PropertyReaderInterfacePtr propertyReader() const;
diff --git a/src/render/frontend/qshaderdata_p.h b/src/render/frontend/qshaderdata_p.h
index 95512d5c6..cdd30aec4 100644
--- a/src/render/frontend/qshaderdata_p.h
+++ b/src/render/frontend/qshaderdata_p.h
@@ -75,8 +75,8 @@ class QShaderDataPropertyReader: public PropertyReaderInterface
class QT3DRENDERERSHARED_PRIVATE_EXPORT QShaderDataPrivate : public QComponentPrivate
{
public:
- QShaderDataPrivate(QShaderData *qq);
- QShaderDataPrivate(QShaderData *qq, PropertyReaderInterfacePtr reader);
+ QShaderDataPrivate();
+ QShaderDataPrivate(PropertyReaderInterfacePtr reader);
PropertyReaderInterfacePtr m_propertyReader;
Q_DECLARE_PUBLIC(QShaderData)
diff --git a/src/render/frontend/qshaderprogram.cpp b/src/render/frontend/qshaderprogram.cpp
index 15621d55c..7eb170b6b 100644
--- a/src/render/frontend/qshaderprogram.cpp
+++ b/src/render/frontend/qshaderprogram.cpp
@@ -46,8 +46,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QShaderProgramPrivate::QShaderProgramPrivate(QShaderProgram *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QShaderProgramPrivate
+ \internal
+*/
+QShaderProgramPrivate::QShaderProgramPrivate()
+ : QNodePrivate()
{
}
@@ -65,10 +69,11 @@ void QShaderProgram::copy(const QNode *ref)
}
QShaderProgram::QShaderProgram(QNode *parent)
- : QNode(*new QShaderProgramPrivate(this), parent)
+ : QNode(*new QShaderProgramPrivate, parent)
{
}
+/*! \internal */
QShaderProgram::QShaderProgram(QShaderProgramPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
diff --git a/src/render/frontend/qshaderprogram.h b/src/render/frontend/qshaderprogram.h
index 135668836..4023980a8 100644
--- a/src/render/frontend/qshaderprogram.h
+++ b/src/render/frontend/qshaderprogram.h
@@ -55,7 +55,6 @@ class QT3DRENDERERSHARED_EXPORT QShaderProgram : public QNode
Q_PROPERTY(QByteArray geometryShaderCode READ geometryShaderCode WRITE setGeometryShaderCode NOTIFY geometryShaderCodeChanged)
Q_PROPERTY(QByteArray fragmentShaderCode READ fragmentShaderCode WRITE setFragmentShaderCode NOTIFY fragmentShaderCodeChanged)
Q_PROPERTY(QByteArray computeShaderCode READ computeShaderCode WRITE setComputeShaderCode NOTIFY computeShaderCodeChanged)
- Q_ENUMS(ShaderType)
public:
explicit QShaderProgram(QNode *parent = 0);
@@ -68,6 +67,7 @@ public:
Geometry,
Compute
};
+ Q_ENUM(ShaderType)
// Source code in-line
void setVertexShaderCode(const QByteArray &vertexShaderCode);
diff --git a/src/render/frontend/qshaderprogram_p.h b/src/render/frontend/qshaderprogram_p.h
index 07cd91c59..455436a8a 100644
--- a/src/render/frontend/qshaderprogram_p.h
+++ b/src/render/frontend/qshaderprogram_p.h
@@ -48,7 +48,7 @@ class QShaderProgram;
class QShaderProgramPrivate : public QNodePrivate
{
public:
- QShaderProgramPrivate(QShaderProgram *qq);
+ QShaderProgramPrivate();
Q_DECLARE_PUBLIC(QShaderProgram)
QString m_vertexSourceFile;
diff --git a/src/render/frontend/qspheremesh.cpp b/src/render/frontend/qspheremesh.cpp
index 0ede65d43..7e103e8fe 100644
--- a/src/render/frontend/qspheremesh.cpp
+++ b/src/render/frontend/qspheremesh.cpp
@@ -68,8 +68,8 @@ private:
class QSphereMeshPrivate : public QAbstractMeshPrivate
{
- QSphereMeshPrivate(QSphereMesh *qq)
- : QAbstractMeshPrivate(qq)
+ QSphereMeshPrivate()
+ : QAbstractMeshPrivate()
, m_generateTangents(false)
, m_rings(16)
, m_slices(16)
@@ -84,7 +84,7 @@ class QSphereMeshPrivate : public QAbstractMeshPrivate
};
QSphereMesh::QSphereMesh(QNode *parent)
- : QAbstractMesh(*new QSphereMeshPrivate(this), parent)
+ : QAbstractMesh(*new QSphereMeshPrivate, parent)
{
update();
}
diff --git a/src/render/frontend/qspotlight.cpp b/src/render/frontend/qspotlight.cpp
index 467ceca19..cef18fe10 100644
--- a/src/render/frontend/qspotlight.cpp
+++ b/src/render/frontend/qspotlight.cpp
@@ -43,32 +43,55 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-/*!
- *
- * Expected Shader struct
- *
- * \code
- *
- * struct SpotLight
- * {
- * vec3 position;
- * vec3 direction;
- * vec4 color;
- * float intensity;
- * float cutOffAngle;
- * };
- *
- * uniform SpotLight spotLights[10];
- *
- * \endcode
+/*
+ Expected Shader struct
+
+ \code
+
+ struct SpotLight
+ {
+ vec3 position;
+ vec3 direction;
+ vec4 color;
+ float intensity;
+ float cutOffAngle;
+ };
+
+ uniform SpotLight spotLights[10];
+
+ \endcode
*/
-QSpotLightPrivate::QSpotLightPrivate(QSpotLight *qq)
- : QAbstractLightPrivate(qq)
+/*!
+ \class Qt3D::QSpotLightPrivate
+ \internal
+*/
+QSpotLightPrivate::QSpotLightPrivate()
+ : QAbstractLightPrivate()
, m_cutOffAngle(45.0f)
{
}
+/*!
+ \class QSpotLight
+ \inmodule Qt3DRender
+ \since 5.5
+
+ */
+
+/*!
+ \qmltype SpotLight
+ \instantiates Qt3D::QSpotLight
+ \inherits AbstractLight
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief For OpenGL ...
+*/
+
+/*! \fn void Qt3D::QSpotLight::copy(const QNode *ref)
+ Copies the \a ref instance into this one.
+ */
+
void QSpotLight::copy(const QNode *ref)
{
const QSpotLight *light = static_cast<const QSpotLight*>(ref);
@@ -79,22 +102,48 @@ void QSpotLight::copy(const QNode *ref)
QAbstractLight::copy(ref);
}
+
+/*!
+ \fn Qt3D::QSpotLight::QSpotLight(QNode *parent)
+ Constructs a new QSpotLight with the specified \a parent.
+ */
QSpotLight::QSpotLight(QNode *parent)
- : QAbstractLight(*new QSpotLightPrivate(this), parent)
+ : QAbstractLight(*new QSpotLightPrivate, parent)
{
}
+/*! \internal */
QSpotLight::QSpotLight(QSpotLightPrivate &dd, QNode *parent)
: QAbstractLight(dd, parent)
{
}
-QVector3D QSpotLight::direction() const
+/*!
+ \qmlproperty vector3d Qt3D.Render::SpotLight::direction
+
+*/
+
+/*!
+ \property Qt3D::QSpotLight::direction
+
+ */
+
+ QVector3D QSpotLight::direction() const
{
Q_D(const QSpotLight);
return d->m_direction;
}
+
+/*!
+ \qmlproperty float Qt3D.Render::SpotLight::cutOffAngle
+
+*/
+
+/*!
+ \property Qt3D::QSpotLight::cutOffAngle
+
+ */
float QSpotLight::cutOffAngle() const
{
Q_D(const QSpotLight);
diff --git a/src/render/frontend/qspotlight_p.h b/src/render/frontend/qspotlight_p.h
index 1ad4efa63..d05ec446d 100644
--- a/src/render/frontend/qspotlight_p.h
+++ b/src/render/frontend/qspotlight_p.h
@@ -46,7 +46,7 @@ namespace Qt3D {
class QT3DRENDERERSHARED_EXPORT QSpotLightPrivate : public QAbstractLightPrivate
{
public:
- QSpotLightPrivate(QSpotLight *qq);
+ QSpotLightPrivate();
Q_DECLARE_PUBLIC(QSpotLight)
float m_cutOffAngle;
diff --git a/src/render/frontend/qstenciltest.cpp b/src/render/frontend/qstenciltest.cpp
index 307c6c155..2ff78625d 100644
--- a/src/render/frontend/qstenciltest.cpp
+++ b/src/render/frontend/qstenciltest.cpp
@@ -48,8 +48,8 @@ namespace Qt3D {
class QStencilTestPrivate : public QRenderStatePrivate
{
public:
- QStencilTestPrivate(QStencilTest *qq)
- : QRenderStatePrivate(qq, QRenderState::StencilTest)
+ QStencilTestPrivate()
+ : QRenderStatePrivate(QRenderState::StencilTest)
, m_mask(0)
, m_func(QStencilTest::Never)
, m_faceMode(QStencilTest::FrontAndBack)
@@ -63,7 +63,7 @@ public:
};
QStencilTest::QStencilTest(QNode *parent)
- : QRenderState(*new QStencilTestPrivate(this), parent)
+ : QRenderState(*new QStencilTestPrivate, parent)
{
}
diff --git a/src/render/frontend/qstenciltest.h b/src/render/frontend/qstenciltest.h
index 2f1072758..fdc61037b 100644
--- a/src/render/frontend/qstenciltest.h
+++ b/src/render/frontend/qstenciltest.h
@@ -49,8 +49,6 @@ class QStencilTestPrivate;
class QT3DRENDERERSHARED_EXPORT QStencilTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(StencilFaceMode)
- Q_ENUMS(StencilFunc)
Q_PROPERTY(uint mask READ mask WRITE setMask NOTIFY maskChanged)
Q_PROPERTY(StencilFaceMode faceMode READ faceMode WRITE setFaceMode NOTIFY faceModeChanged)
Q_PROPERTY(StencilFunc func READ func WRITE setFunc NOTIFY funcChanged)
@@ -62,6 +60,7 @@ public:
Back = 0x0405,
FrontAndBack = 0x0408
};
+ Q_ENUM(StencilFaceMode)
enum StencilFunc
{
@@ -74,6 +73,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(StencilFunc)
explicit QStencilTest(QNode *parent = 0);
diff --git a/src/render/frontend/qtechnique.cpp b/src/render/frontend/qtechnique.cpp
index e78d88e01..dd72ec458 100644
--- a/src/render/frontend/qtechnique.cpp
+++ b/src/render/frontend/qtechnique.cpp
@@ -45,8 +45,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QTechniquePrivate::QTechniquePrivate(QTechnique *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QTechniquePrivate
+ \internal
+*/
+QTechniquePrivate::QTechniquePrivate()
+ : QNodePrivate()
{
}
@@ -55,17 +59,18 @@ QTechniquePrivate::~QTechniquePrivate()
}
QTechnique::QTechnique(QNode *parent)
- : QNode(*new QTechniquePrivate(this), parent)
+ : QNode(*new QTechniquePrivate, parent)
{
Q_D(QTechnique);
- QObject::connect(&d->m_openGLFilter, SIGNAL(openGLFilterChanged()), this, SLOT(openGLFilterChanged()));
+ QObject::connect(&d->m_openGLFilter, SIGNAL(openGLFilterChanged()), this, SLOT(_q_openGLFilterChanged()));
}
+/*! \internal */
QTechnique::QTechnique(QTechniquePrivate &dd, QNode *parent)
: QNode(dd, parent)
{
Q_D(QTechnique);
- QObject::connect(&d->m_openGLFilter, SIGNAL(openGLFilterChanged()), this, SLOT(openGLFilterChanged()));
+ QObject::connect(&d->m_openGLFilter, SIGNAL(openGLFilterChanged()), this, SLOT(_q_openGLFilterChanged()));
}
void QTechnique::copy(const QNode *ref)
@@ -82,16 +87,15 @@ void QTechnique::copy(const QNode *ref)
addParameter(qobject_cast<QParameter *>(QNode::clone(p)));
}
-void QTechnique::openGLFilterChanged()
+void QTechniquePrivate::_q_openGLFilterChanged()
{
- Q_D(QTechnique);
- if (d->m_changeArbiter != Q_NULLPTR) {
- QScenePropertyChangePtr change(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, id()));
+ if (m_changeArbiter != Q_NULLPTR) {
+ QScenePropertyChangePtr change(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, m_id));
change->setPropertyName("openGLFilter");
QOpenGLFilter *clone = new QOpenGLFilter();
- clone->copy(d->m_openGLFilter);
+ clone->copy(m_openGLFilter);
change->setValue(QVariant::fromValue(clone));
- d->notifyObservers(change);
+ notifyObservers(change);
}
}
@@ -200,7 +204,7 @@ void QTechnique::addPass(QRenderPass *pass)
/*!
* Removes a \a pass from the technique. This posts a ComponentRemoved
* QScenePropertyChange notification to the QChangeArbiter with the value
- * being the \a pass' id and the property name being "pass".
+ * being the id of \a pass and the property name being "pass".
*/
void QTechnique::removePass(QRenderPass *pass)
{
@@ -238,3 +242,5 @@ QOpenGLFilter *QTechnique::openGLFilter()
} // of namespace Qt3D
QT_END_NAMESPACE
+
+#include "moc_qtechnique.cpp"
diff --git a/src/render/frontend/qtechnique.h b/src/render/frontend/qtechnique.h
index 93d1439f3..199a7d57a 100644
--- a/src/render/frontend/qtechnique.h
+++ b/src/render/frontend/qtechnique.h
@@ -78,12 +78,10 @@ protected:
QTechnique(QTechniquePrivate &dd, QNode *parent = 0);
void copy(const QNode *ref) Q_DECL_OVERRIDE;
-protected Q_SLOTS:
- void openGLFilterChanged();
-
private:
Q_DECLARE_PRIVATE(QTechnique)
QT3D_CLONEABLE(QTechnique)
+ Q_PRIVATE_SLOT(d_func(), void _q_openGLFilterChanged())
};
}
diff --git a/src/render/frontend/qtechnique_p.h b/src/render/frontend/qtechnique_p.h
index 60ddc1fce..6ae35f1e1 100644
--- a/src/render/frontend/qtechnique_p.h
+++ b/src/render/frontend/qtechnique_p.h
@@ -53,7 +53,7 @@ class QRenderPass;
class QT3DRENDERERSHARED_EXPORT QTechniquePrivate : public QNodePrivate
{
public:
- QTechniquePrivate(QTechnique *dd);
+ QTechniquePrivate();
~QTechniquePrivate();
Q_DECLARE_PUBLIC(QTechnique)
@@ -61,6 +61,9 @@ public:
QList<QParameter *> m_parameters;
QList<QRenderPass*> m_renderPasses;
QOpenGLFilter m_openGLFilter;
+
+private:
+ void _q_openGLFilterChanged();
};
} // Qt3D
diff --git a/src/render/frontend/qtextureimage.cpp b/src/render/frontend/qtextureimage.cpp
index 92b69797f..e3ada359a 100644
--- a/src/render/frontend/qtextureimage.cpp
+++ b/src/render/frontend/qtextureimage.cpp
@@ -45,8 +45,8 @@ namespace Qt3D {
class QTextureImagePrivate: public QAbstractTextureImagePrivate
{
public:
- QTextureImagePrivate(QTextureImage *qq)
- : QAbstractTextureImagePrivate(qq)
+ QTextureImagePrivate()
+ : QAbstractTextureImagePrivate()
{
}
@@ -92,7 +92,8 @@ private:
};
/*!
- \class Qt3D::QTextureImage
+ \class QTextureImage
+ \inmodule Qt3DRender
\since 5.5
\brief Encapsulates the necessary information to create an OpenGL texture
image from an image source.
@@ -102,19 +103,32 @@ private:
*/
/*!
+ \qmltype TextureImage
+ \instantiates Qt3D::QTextureImage
+ \inherits AbstractTextureImage
+ \inqmlmodule Qt3D.Render
+ \since 5.5
+ \brief Encapsulates the necessary information to create an OpenGL texture
+ image from an image source.
+*/
+
+/*!
Constructs a new Qt3D::QTextureImage instance with \a parent as parent.
*/
QTextureImage::QTextureImage(QNode *parent)
- : QAbstractTextureImage(*new QTextureImagePrivate(this), parent)
+ : QAbstractTextureImage(*new QTextureImagePrivate, parent)
{
}
+/*!
+ The destructor.
+ */
QTextureImage::~QTextureImage()
{
}
/*!
- \return the source url from which data will be loaded of the texture image.
+ Returns the source url from which data for the texture image will be loaded.
*/
QUrl QTextureImage::source() const
{
@@ -123,8 +137,22 @@ QUrl QTextureImage::source() const
}
/*!
+ \property Qt3D::QTextureImage::source
+
+ This property holdsthe source url from which data for the texture
+ image will be loaded.
+*/
+
+/*!
+ \qmlproperty url Qt3D.Render::TextureImage::source
+
+ This property holdsthe source url from which data for the texture
+ image will be loaded.
+*/
+
+/*!
Sets the source url of the texture image to \a source.
- \note: this triggers a call to update()
+ \note This triggers a call to update()
*/
void QTextureImage::setSource(const QUrl &source)
{
@@ -137,7 +165,7 @@ void QTextureImage::setSource(const QUrl &source)
}
/*!
- \returns the a Qt3D::QTextureDataFunctorPtr functor to be used by the
+ Returns the Qt3D::QTextureDataFunctorPtr functor to be used by the
backend to load the texture image data into an OpenGL texture object.
*/
QTextureDataFunctorPtr QTextureImage::dataFunctor() const
@@ -145,6 +173,9 @@ QTextureDataFunctorPtr QTextureImage::dataFunctor() const
return QTextureDataFunctorPtr(new QImageTextureDataFunctor(source()));
}
+/*!
+ Copies \ref into this texture image.
+ */
void QTextureImage::copy(const QNode *ref)
{
QAbstractTextureImage::copy(ref);
diff --git a/src/render/frontend/qtorusmesh.cpp b/src/render/frontend/qtorusmesh.cpp
index 09b4e2a54..4a975d8d8 100644
--- a/src/render/frontend/qtorusmesh.cpp
+++ b/src/render/frontend/qtorusmesh.cpp
@@ -67,8 +67,8 @@ private:
class QTorusMeshPrivate : public QAbstractMeshPrivate
{
- QTorusMeshPrivate(QTorusMesh *qq)
- : QAbstractMeshPrivate(qq)
+ QTorusMeshPrivate()
+ : QAbstractMeshPrivate()
, m_rings(16)
, m_slices(16)
, m_radius(1.0)
@@ -94,7 +94,7 @@ void QTorusMesh::copy(const QNode *ref)
QTorusMesh::QTorusMesh(QNode *parent)
- : QAbstractMesh(*new QTorusMeshPrivate(this), parent)
+ : QAbstractMesh(*new QTorusMeshPrivate, parent)
{
update();
}
diff --git a/src/render/frontend/qwrapmode.cpp b/src/render/frontend/qwrapmode.cpp
index 870c194bf..c5a3a5056 100644
--- a/src/render/frontend/qwrapmode.cpp
+++ b/src/render/frontend/qwrapmode.cpp
@@ -44,9 +44,8 @@ namespace Qt3D {
class QTextureWrapModePrivate : public QObjectPrivate
{
public:
- QTextureWrapModePrivate(QTextureWrapMode *qq)
+ QTextureWrapModePrivate()
: QObjectPrivate()
- , q_ptr(qq)
, m_x(QTextureWrapMode::ClampToEdge)
, m_y(QTextureWrapMode::ClampToEdge)
, m_z(QTextureWrapMode::ClampToEdge)
@@ -54,7 +53,6 @@ public:
}
Q_DECLARE_PUBLIC(QTextureWrapMode)
- QTextureWrapMode *q_ptr;
QTextureWrapMode::WrapMode m_x;
QTextureWrapMode::WrapMode m_y;
QTextureWrapMode::WrapMode m_z;
@@ -64,12 +62,12 @@ public:
\class Qt3D::QTextureWrapMode
\since 5.5
- \brief Qt3D::QTextureWrapMode defines the wrap mode a
- Qt3D::QAbstractTextureProvider should apply to a texture.
+ \brief Defines the wrap mode a Qt3D::QAbstractTextureProvider
+ should apply to a texture.
*/
QTextureWrapMode::QTextureWrapMode(WrapMode wrapMode, QObject *parent)
- : QObject(*new QTextureWrapModePrivate(this), parent)
+ : QObject(*new QTextureWrapModePrivate, parent)
{
d_func()->m_x = wrapMode;
d_func()->m_y = wrapMode;
@@ -81,7 +79,7 @@ QTextureWrapMode::QTextureWrapMode(WrapMode wrapMode, QObject *parent)
each dimension \a x, \a y \a z of the texture and \a parent as parent.
*/
QTextureWrapMode::QTextureWrapMode(WrapMode x,WrapMode y, WrapMode z, QObject *parent)
- : QObject(*new QTextureWrapModePrivate(this), parent)
+ : QObject(*new QTextureWrapModePrivate, parent)
{
d_func()->m_x = x;
d_func()->m_y = y;
@@ -101,7 +99,7 @@ void QTextureWrapMode::setX(WrapMode x)
}
/*!
- \returns the wrap mode of the x dimension.
+ Returns the wrap mode of the x dimension.
*/
QTextureWrapMode::WrapMode QTextureWrapMode::x() const
{
@@ -123,7 +121,7 @@ void QTextureWrapMode::setY(WrapMode y)
}
/*!
- \returns the wrap mode of the y dimension.
+ Returns the wrap mode of the y dimension.
*/
QTextureWrapMode::WrapMode QTextureWrapMode::y() const
{
@@ -145,7 +143,7 @@ void QTextureWrapMode::setZ(WrapMode z)
}
/*!
- \returns the wrap mode of the y dimension.
+ Returns the wrap mode of the y dimension.
*/
QTextureWrapMode::WrapMode QTextureWrapMode::z() const
{
diff --git a/src/render/frontend/qwrapmode.h b/src/render/frontend/qwrapmode.h
index e4257c6cb..d0333c749 100644
--- a/src/render/frontend/qwrapmode.h
+++ b/src/render/frontend/qwrapmode.h
@@ -49,7 +49,6 @@ class QTextureWrapModePrivate;
class QT3DRENDERERSHARED_EXPORT QTextureWrapMode: public QObject
{
Q_OBJECT
- Q_ENUMS(WrapMode)
Q_PROPERTY(WrapMode x READ x WRITE setX NOTIFY xChanged)
Q_PROPERTY(WrapMode y READ y WRITE setY NOTIFY yChanged)
Q_PROPERTY(WrapMode z READ z WRITE setZ NOTIFY zChanged)
@@ -61,6 +60,7 @@ public:
ClampToEdge = 0x812F, // GL_CLAMP_TO_EDGE
ClampToBorder = 0x812D // GL_CLAMP_TO_BORDER
};
+ Q_ENUM(WrapMode)
explicit QTextureWrapMode(WrapMode wrapMode = ClampToEdge, QObject *parent = 0);
explicit QTextureWrapMode(WrapMode x, WrapMode y, WrapMode z, QObject *parent = 0);
diff --git a/src/render/io/abstractsceneparser_p.h b/src/render/io/abstractsceneparser_p.h
index 83257e3b9..7577cb738 100644
--- a/src/render/io/abstractsceneparser_p.h
+++ b/src/render/io/abstractsceneparser_p.h
@@ -54,7 +54,6 @@ Q_DECLARE_LOGGING_CATEGORY(SceneParsers)
class QT3DRENDERERSHARED_EXPORT AbstractSceneParser : public QObject
{
Q_OBJECT
- Q_ENUMS(ParserStatus)
Q_PROPERTY(ParserStatus parserStatus READ parserStatus NOTIFY parserStatusChanged)
Q_PROPERTY(QStringList errors READ errors NOTIFY errorsChanged)
@@ -65,6 +64,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(ParserStatus)
AbstractSceneParser();
virtual ~AbstractSceneParser();
diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp
index d3848473e..68aa14826 100644
--- a/src/render/io/gltfparser.cpp
+++ b/src/render/io/gltfparser.cpp
@@ -235,11 +235,9 @@ private:
class GLTFParserMeshPrivate : public QAbstractMeshPrivate
{
public:
-
- GLTFParserMeshPrivate(GLTFParserMesh *qq)
- : QAbstractMeshPrivate(qq)
- {
- }
+ GLTFParserMeshPrivate()
+ : QAbstractMeshPrivate()
+ {}
Q_DECLARE_PUBLIC(GLTFParserMesh)
QMeshDataPtr m_meshData;
@@ -1014,7 +1012,7 @@ void GLTFParserMesh::copy(const QNode *ref)
}
GLTFParserMesh::GLTFParserMesh(QNode *parent)
- : QAbstractMesh(*new GLTFParserMeshPrivate(this), parent)
+ : QAbstractMesh(*new GLTFParserMeshPrivate, parent)
{
}
diff --git a/src/render/io/qattribute.cpp b/src/render/io/qattribute.cpp
index a10245241..c1329fc8c 100644
--- a/src/render/io/qattribute.cpp
+++ b/src/render/io/qattribute.cpp
@@ -46,16 +46,21 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-AttributePrivate::AttributePrivate(Attribute *qq)
- : QAbstractAttributePrivate(qq)
+/*!
+ class Qt3D::AttributePrivate
+ \internal
+*/
+AttributePrivate::AttributePrivate()
+ : QAbstractAttributePrivate()
{
}
Attribute::Attribute(QAbstractBufferPtr buf, int type, int count, int offset, int stride)
- : QAbstractAttribute(*new AttributePrivate(this), buf, type, count, offset, stride)
+ : QAbstractAttribute(*new AttributePrivate, buf, type, count, offset, stride)
{
}
+/*! \internal */
Attribute::Attribute(AttributePrivate &dd, QAbstractBufferPtr buf, int type, int count, int offset, int stride)
: QAbstractAttribute(dd, buf, type, count, offset, stride)
{
diff --git a/src/render/io/qattribute_p.h b/src/render/io/qattribute_p.h
index 710763d8e..82b2278d6 100644
--- a/src/render/io/qattribute_p.h
+++ b/src/render/io/qattribute_p.h
@@ -49,9 +49,7 @@ class Attribute;
class QT3DRENDERERSHARED_EXPORT AttributePrivate : public QAbstractAttributePrivate
{
public:
- AttributePrivate(Attribute *qq);
-
- Q_DECLARE_PUBLIC(Attribute)
+ AttributePrivate();
};
} // Qt3D
diff --git a/src/render/io/qbuffer.cpp b/src/render/io/qbuffer.cpp
index 87366cb62..54ab6d75d 100644
--- a/src/render/io/qbuffer.cpp
+++ b/src/render/io/qbuffer.cpp
@@ -42,20 +42,24 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-BufferPrivate::BufferPrivate(Buffer *qq)
- : QAbstractBufferPrivate(qq)
+/*!
+ \class Qt3D::BufferPrivate
+ \internal
+*/
+BufferPrivate::BufferPrivate()
+ : QAbstractBufferPrivate()
{
}
Buffer::Buffer(QOpenGLBuffer::Type ty)
- : QAbstractBuffer(*new BufferPrivate(this))
+ : QAbstractBuffer(*new BufferPrivate)
{
Q_D(Buffer);
d->m_type = ty;
d->m_usage = QOpenGLBuffer::StaticDraw;
}
-
+/*! \internal */
Buffer::Buffer(BufferPrivate &dd, QOpenGLBuffer::Type ty)
: QAbstractBuffer(dd)
{
diff --git a/src/render/io/qbuffer_p.h b/src/render/io/qbuffer_p.h
index 5b9e9ea3f..c86bdcd5c 100644
--- a/src/render/io/qbuffer_p.h
+++ b/src/render/io/qbuffer_p.h
@@ -50,9 +50,8 @@ class Buffer;
class QT3DRENDERERSHARED_EXPORT BufferPrivate : public QAbstractBufferPrivate
{
public:
- BufferPrivate(Buffer *qq);
+ BufferPrivate();
- Q_DECLARE_PUBLIC(Buffer)
QOpenGLBuffer::Type m_type;
QOpenGLBuffer::UsagePattern m_usage;
};
diff --git a/src/render/io/qmeshdata.cpp b/src/render/io/qmeshdata.cpp
index 90ec9da4d..ddb2b00d8 100644
--- a/src/render/io/qmeshdata.cpp
+++ b/src/render/io/qmeshdata.cpp
@@ -44,15 +44,18 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QMeshDataPrivate::QMeshDataPrivate(QMeshData *qq)
- : q_ptr(qq)
- , m_verticesPerPatch(0)
+/*!
+ \class Qt3D::QMeshDataPrivate
+ \internal
+*/
+QMeshDataPrivate::QMeshDataPrivate()
+ : m_verticesPerPatch(0)
, m_primitiveType(0)
{
}
QMeshData::QMeshData(PrimitiveType primitiveType)
- : d_ptr(new QMeshDataPrivate(this))
+ : d_ptr(new QMeshDataPrivate)
{
setPrimitiveType(primitiveType);
}
@@ -61,6 +64,7 @@ QMeshData::~QMeshData()
{
}
+/*! \internal */
QMeshData::QMeshData(QMeshDataPrivate &dd)
: d_ptr(&dd)
{
diff --git a/src/render/io/qmeshdata_p.h b/src/render/io/qmeshdata_p.h
index acb0fb872..19bb89963 100644
--- a/src/render/io/qmeshdata_p.h
+++ b/src/render/io/qmeshdata_p.h
@@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-class QMeshData;
class QAbstractAttribute;
class QAbstractBuffer;
@@ -56,10 +55,7 @@ typedef QSharedPointer<QAbstractAttribute> QAbstractAttributePtr;
class QMeshDataPrivate
{
public:
- QMeshDataPrivate(QMeshData *qq);
-
- Q_DECLARE_PUBLIC(QMeshData)
- QMeshData *q_ptr;
+ QMeshDataPrivate();
QStringList m_attributesNames;
QVector<QAbstractAttributePtr> m_attributes;
diff --git a/src/render/render.qrc b/src/render/render.qrc
index 7e2227aa2..9878bec69 100644
--- a/src/render/render.qrc
+++ b/src/render/render.qrc
@@ -45,5 +45,9 @@
<file>shaders/gl3/pervertexcolor.vert</file>
<file>shaders/es2/pervertexcolor.frag</file>
<file>shaders/es2/pervertexcolor.vert</file>
+ <file>shaders/es2/skybox.frag</file>
+ <file>shaders/es2/skybox.vert</file>
+ <file>shaders/gl3/skybox.frag</file>
+ <file>shaders/gl3/skybox.vert</file>
</qresource>
</RCC>
diff --git a/src/render/renderlogging.cpp b/src/render/renderlogging.cpp
index 31f16dc3a..95bb88a8f 100644
--- a/src/render/renderlogging.cpp
+++ b/src/render/renderlogging.cpp
@@ -51,6 +51,7 @@ Q_LOGGING_CATEGORY(RenderNodes, "Qt3D.Render.RenderNodes")
Q_LOGGING_CATEGORY(Rendering, "Qt3D.Render.Rendering")
Q_LOGGING_CATEGORY(Memory, "Qt3D.Render.Memory")
Q_LOGGING_CATEGORY(Shaders, "Qt3D.Render.Shaders")
+Q_LOGGING_CATEGORY(RenderStates, "Qt3D.Render.RenderStates")
} // Render
diff --git a/src/render/renderlogging_p.h b/src/render/renderlogging_p.h
index 866206eb5..494b35988 100644
--- a/src/render/renderlogging_p.h
+++ b/src/render/renderlogging_p.h
@@ -54,6 +54,7 @@ Q_DECLARE_LOGGING_CATEGORY(RenderNodes)
Q_DECLARE_LOGGING_CATEGORY(Rendering)
Q_DECLARE_LOGGING_CATEGORY(Memory)
Q_DECLARE_LOGGING_CATEGORY(Shaders)
+Q_DECLARE_LOGGING_CATEGORY(RenderStates)
} // Render
diff --git a/src/render/shaders/es2/pervertexcolor.frag b/src/render/shaders/es2/pervertexcolor.frag
index ff00557f3..e9a6800bb 100644
--- a/src/render/shaders/es2/pervertexcolor.frag
+++ b/src/render/shaders/es2/pervertexcolor.frag
@@ -21,5 +21,5 @@ FP vec3 adModel( const FP vec3 pos, const FP vec3 n, const FP vec3 col )
void main()
{
- gl_FragColor = vec4( adModel( position, normalize( normal ) ), 1.0 );
+ gl_FragColor = vec4( adModel( position, normalize( normal ), color ), 1.0 );
}
diff --git a/src/render/shaders/es2/skybox.frag b/src/render/shaders/es2/skybox.frag
new file mode 100644
index 000000000..3de08be44
--- /dev/null
+++ b/src/render/shaders/es2/skybox.frag
@@ -0,0 +1,8 @@
+varying highp vec3 texCoord0;
+uniform samplerCube skyboxTexture;
+
+void main()
+{
+ gl_FragColor = textureCube(skyboxTexture, texCoord0);
+}
+
diff --git a/src/render/shaders/es2/skybox.vert b/src/render/shaders/es2/skybox.vert
new file mode 100644
index 000000000..e2de1d88b
--- /dev/null
+++ b/src/render/shaders/es2/skybox.vert
@@ -0,0 +1,12 @@
+attribute vec3 vertexPosition;
+varying vec3 texCoord0;
+
+uniform mat4 mvp;
+uniform mat4 inverseProjectionMatrix;
+uniform mat4 inverseModelView;
+
+void main()
+{
+ texCoord0 = vertexPosition.xyz;
+ gl_Position = vec4(mvp * vec4(vertexPosition, 1.0)).xyww;
+}
diff --git a/src/render/shaders/gl3/skybox.frag b/src/render/shaders/gl3/skybox.frag
new file mode 100644
index 000000000..99c8f111b
--- /dev/null
+++ b/src/render/shaders/gl3/skybox.frag
@@ -0,0 +1,10 @@
+#version 140
+
+in vec3 texCoord0;
+out vec4 fragColor;
+uniform samplerCube skyboxTexture;
+
+void main()
+{
+ fragColor = texture(skyboxTexture, texCoord0);
+}
diff --git a/src/render/shaders/gl3/skybox.vert b/src/render/shaders/gl3/skybox.vert
new file mode 100644
index 000000000..17bb2b00b
--- /dev/null
+++ b/src/render/shaders/gl3/skybox.vert
@@ -0,0 +1,14 @@
+#version 140
+
+in vec3 vertexPosition;
+out vec3 texCoord0;
+
+uniform mat4 mvp;
+uniform mat4 inverseProjectionMatrix;
+uniform mat4 inverseModelView;
+
+void main()
+{
+ texCoord0 = vertexPosition.xyz;
+ gl_Position = vec4(mvp * vec4(vertexPosition, 1.0)).xyww;
+}
diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro
index 6db834a65..20b9423f6 100644
--- a/tests/auto/core/core.pro
+++ b/tests/auto/core/core.pro
@@ -13,10 +13,12 @@ SUBDIRS = \
qaspectfactory \
qchangearbiter \
qscene \
- qservicelocator
+ qservicelocator \
+ qray3d
contains(QT_CONFIG, private_tests) {
SUBDIRS += \
qframeallocator \
- cloning
+ cloning \
+ threadpooler
}
diff --git a/tests/auto/core/qray3d/qray3d.pro b/tests/auto/core/qray3d/qray3d.pro
new file mode 100644
index 000000000..f86496142
--- /dev/null
+++ b/tests/auto/core/qray3d/qray3d.pro
@@ -0,0 +1,8 @@
+TARGET = tst_qray3d
+CONFIG += testcase
+TEMPLATE = app
+
+SOURCES += \
+ tst_qray3d.cpp
+
+QT += testlib core-private 3dcore 3dcore-private
diff --git a/tests/auto/core/qray3d/tst_qray3d.cpp b/tests/auto/core/qray3d/tst_qray3d.cpp
new file mode 100644
index 000000000..1f4f829a2
--- /dev/null
+++ b/tests/auto/core/qray3d/tst_qray3d.cpp
@@ -0,0 +1,546 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <Qt3DCore/qray3d.h>
+
+class tst_QRay3D : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QRay3D() {}
+ ~tst_QRay3D() {}
+
+private Q_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 distance_data();
+ void distance();
+ void compare();
+ void dataStream();
+ void transform_data();
+ void transform();
+ void properties();
+ void metaTypes();
+ void shouldNotAllowNullDirection();
+};
+
+// 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(float p1, float 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);
+ Qt3D::QRay3D ray(point, direction);
+ QVERIFY(fuzzyCompare(ray.direction(), direction));
+ QVERIFY(fuzzyCompare(ray.origin(), point));
+
+ Qt3D::QRay3D ray2;
+ QCOMPARE(ray2.origin(), QVector3D(0, 0, 0));
+ QCOMPARE(ray2.direction(), QVector3D(0, 0, 1));
+ 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);
+ Qt3D::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);
+ Qt3D::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.projectedDistance(point_on_line_pos_0_6), 0.6));
+ QVERIFY(fuzzyCompare(line.projectedDistance(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.0005f, 1.0005f, 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);
+
+ Qt3D::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);
+
+ Qt3D::QRay3D line(origin, direction);
+ if (contains) {
+ Qt3D::QRay3D line2(point, direction);
+ QVERIFY(line.contains(line2));
+ QVERIFY(line2.contains(line));
+
+ // Reversed direction is also contained.
+ Qt3D::QRay3D line3(point, -direction);
+ QVERIFY(line.contains(line2));
+ QVERIFY(line2.contains(line));
+
+ // Different direction.
+ Qt3D::QRay3D line4(point, QVector3D(direction.y(), direction.x(), direction.z()));
+ QVERIFY(!line.contains(line4));
+ QVERIFY(!line4.contains(line));
+ } else {
+ Qt3D::QRay3D line2(point, direction);
+ QVERIFY(!line.contains(line2));
+ QVERIFY(!line2.contains(line));
+ }
+}
+
+void tst_QRay3D::distance_data()
+{
+ QTest::addColumn<QVector3D>("origin");
+ QTest::addColumn<QVector3D>("direction");
+ QTest::addColumn<QVector3D>("point");
+ QTest::addColumn<float>("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)
+ << 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)
+ << 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)
+ << 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)
+ << 2.0f;
+}
+
+void tst_QRay3D::distance()
+{
+ QFETCH(QVector3D, origin);
+ QFETCH(QVector3D, direction);
+ QFETCH(QVector3D, point);
+ QFETCH(float, distance);
+
+ Qt3D::QRay3D line(origin, direction);
+ QCOMPARE(line.distance(point), distance);
+}
+
+void tst_QRay3D::compare()
+{
+ Qt3D::QRay3D ray1(QVector3D(10, 20, 30), QVector3D(-3, -4, -5));
+ Qt3D::QRay3D ray2(QVector3D(10, 20, 30), QVector3D(1.5f, 2.0f, 2.5f));
+ Qt3D::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
+ Qt3D::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;
+ }
+
+ Qt3D::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);
+
+ Qt3D::QRay3D ray1(point, direction);
+ Qt3D::QRay3D ray2(ray1);
+ Qt3D::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(Qt3D::QRay3D ray READ ray WRITE setRay)
+public:
+ tst_QRay3DProperties(QObject *parent = 0) : QObject(parent) {}
+
+ Qt3D::QRay3D ray() const { return r; }
+ void setRay(const Qt3D::QRay3D& value) { r = value; }
+
+private:
+ Qt3D::QRay3D r;
+};
+
+// Test getting and setting properties via the metaobject system.
+void tst_QRay3D::properties()
+{
+ tst_QRay3DProperties obj;
+
+ qRegisterMetaType<Qt3D::QRay3D>();
+
+ obj.setRay(Qt3D::QRay3D(QVector3D(1, 2, 3), QVector3D(4, 5, 6)));
+
+ Qt3D::QRay3D r = qvariant_cast<Qt3D::QRay3D>(obj.property("ray"));
+ QCOMPARE(r.origin(), QVector3D(1, 2, 3));
+ QCOMPARE(r.direction(), QVector3D(4, 5, 6));
+
+ obj.setProperty("ray",
+ qVariantFromValue
+ (Qt3D::QRay3D(QVector3D(-1, -2, -3), QVector3D(-4, -5, -6))));
+
+ r = qvariant_cast<Qt3D::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<Qt3D::QRay3D>();
+ QVERIFY(QMetaType::type("Qt3D::QRay3D") == id);
+ QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("Qt3D::QRay3D"));
+ QVERIFY(QMetaType::isRegistered(id));
+}
+
+void tst_QRay3D::shouldNotAllowNullDirection()
+{
+ // GIVEN
+ Qt3D::QRay3D ray;
+
+ QCOMPARE(ray.origin(), QVector3D(0, 0, 0));
+ QCOMPARE(ray.direction(), QVector3D(0, 0, 1));
+
+ // WHEN
+ ray.setDirection(QVector3D(0, 0, 0));
+
+ // THEN
+ QCOMPARE(ray.direction(), QVector3D(0, 0, 1));
+}
+
+QTEST_APPLESS_MAIN(tst_QRay3D)
+
+#include "tst_qray3d.moc"
diff --git a/tests/auto/core/threadpooler/threadpooler.pro b/tests/auto/core/threadpooler/threadpooler.pro
new file mode 100644
index 000000000..5a1115bbf
--- /dev/null
+++ b/tests/auto/core/threadpooler/threadpooler.pro
@@ -0,0 +1,7 @@
+TARGET = tst_threadpooler
+CONFIG += testcase
+TEMPLATE = app
+
+SOURCES += tst_threadpooler.cpp
+
+QT += testlib 3dcore 3dcore-private
diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp
new file mode 100644
index 000000000..bb2649d11
--- /dev/null
+++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp
@@ -0,0 +1,319 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtCore/QThread>
+#include <QtCore/QAtomicInt>
+#include <QtCore/QMutexLocker>
+#include <QtCore/QMutex>
+#include <QtGui/QVector3D>
+#include <QtGui/QMatrix4x4>
+#include <QtCore/QTimer>
+
+#include <Qt3DCore/qaspectjobmanager.h>
+#include <Qt3DCore/qabstractaspectjobmanager.h>
+#include <Qt3DCore/qaspectjob.h>
+#include <Qt3DCore/qt3dcore_global.h>
+
+// Add DEFINES += QT_BUILD_INTERNAL at least to Qt3d's core.pro
+// when running these tests. It makes QAspectJobManager available.
+
+class tst_ThreadPooler : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_ThreadPooler() {}
+ ~tst_ThreadPooler() {}
+
+private:
+ Qt3D::QAspectJobManager *m_jobManager;
+
+private slots:
+ void init();
+ void cleanup();
+
+ void defaultPerThread();
+ void defaultAspectQueue();
+ void doubleAspectQueue();
+ void dependencyAspectQueue();
+ void massTest();
+};
+
+typedef Qt3D::QAspectJobManager JobManager;
+typedef void (*TestFunction)(QAtomicInt *, int *);
+typedef void (*MassFunction)(QVector3D *data);
+
+void perThreadFunction(void *arg)
+{
+ ((QAtomicInt *)arg)->ref();
+}
+
+
+// General test AspectJob
+
+class TestAspectJob : public Qt3D::QAspectJob
+{
+public:
+ TestAspectJob(TestFunction func, QAtomicInt *counter, int *value);
+
+ void setMutex(QMutex *mutex);
+
+ void run() Q_DECL_OVERRIDE;
+
+private:
+ TestFunction m_func;
+ QAtomicInt *m_counter;
+ int *m_value;
+ QMutex *m_mutex;
+};
+
+TestAspectJob::TestAspectJob(TestFunction func, QAtomicInt *counter, int *value)
+ : m_func(func),
+ m_counter(counter),
+ m_value(value)
+{
+}
+
+void TestAspectJob::setMutex(QMutex *mutex)
+{
+ m_mutex = mutex;
+}
+
+void TestAspectJob::run()
+{
+ m_func(m_counter, m_value);
+}
+
+// Mass test AspectJob
+
+class MassAspectJob : public Qt3D::QAspectJob
+{
+public:
+ MassAspectJob(MassFunction func, QVector3D *data);
+
+ void run() Q_DECL_OVERRIDE;
+
+private:
+ MassFunction m_func;
+ QVector3D *m_data;
+};
+
+MassAspectJob::MassAspectJob(MassFunction func, QVector3D *data)
+ : m_func(func),
+ m_data(data)
+{
+}
+
+void MassAspectJob::run()
+{
+ m_func(m_data);
+}
+
+void incrementFunctionCallCounter(QAtomicInt *counter, int *value)
+{
+ Q_UNUSED(value);
+
+ counter->ref();
+}
+
+void add2(QAtomicInt *counter, int *value)
+{
+ Q_UNUSED(counter);
+
+ // Sleep for a while so that we see that multiply task really
+ // wait for us
+ QThread::currentThread()->msleep(400);
+ *value = *value + 2;
+}
+
+void multiplyBy2(QAtomicInt *counter, int *value)
+{
+ Q_UNUSED(counter);
+
+ *value = *value * 2;
+}
+
+void massTestFunction(QVector3D *data)
+{
+ QVector3D point(4.5f, 4.5f, 4.5f);
+
+ QMatrix4x4 matrix;
+ matrix.lookAt(QVector3D(10.0f, 1.5f, 2.0f), QVector3D(1.0f, -1.0f, 1.0f),
+ QVector3D(0.0f, 0.0f, 1.0f));
+ QVector3D result = matrix.map(point);
+ data->setX(result.x());
+ data->setY(result.y());
+ data->setZ(result.z());
+}
+
+void tst_ThreadPooler::init()
+{
+ m_jobManager = new JobManager(this);
+}
+
+void tst_ThreadPooler::cleanup()
+{
+ delete m_jobManager;
+}
+
+void tst_ThreadPooler::defaultPerThread()
+{
+ // GIVEN
+ QAtomicInt callCounter;
+ int maxThreadCount = QThread::idealThreadCount();
+ callCounter.store(0);
+
+ // WHEN
+ m_jobManager->waitForPerThreadFunction(perThreadFunction, &callCounter);
+
+ // THEN
+ QVERIFY(maxThreadCount == callCounter.load());
+}
+
+void tst_ThreadPooler::defaultAspectQueue()
+{
+ // GIVEN
+ QAtomicInt callCounter;
+ int value = 0; // Not used in this test
+ QVector<QSharedPointer<Qt3D::QAspectJob> > jobList;
+ callCounter.store(0);
+ const int jobCount = 5;
+
+ // WHEN
+ for (int i = 0; i < jobCount; i++) {
+ QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter,
+ &callCounter, &value));
+ jobList.append(job);
+ }
+ m_jobManager->enqueueJobs(jobList);
+ m_jobManager->waitForAllJobs();
+
+ // THEN
+ QVERIFY(jobCount == callCounter.load());
+}
+
+/*
+ * Feeds two list of jobs to queue. The pooler should be able to add jobs on
+ * the second list to execution. Single call to wait finish.
+ */
+void tst_ThreadPooler::doubleAspectQueue()
+{
+ // GIVEN
+ QAtomicInt callCounter;
+ int value = 0; // Not used in this test
+ QVector<QSharedPointer<Qt3D::QAspectJob> > jobList;
+ callCounter.store(0);
+ const int jobCount = 3;
+
+ // WHEN
+ for (int i = 0; i < jobCount; i++) {
+ QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter,
+ &callCounter, &value));
+ jobList.append(job);
+ }
+ m_jobManager->enqueueJobs(jobList);
+
+ QVector<QSharedPointer<Qt3D::QAspectJob> > jobList2;
+ for (int i = 0; i < jobCount; i++) {
+ QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter,
+ &callCounter, &value));
+ jobList2.append(job);
+ }
+ m_jobManager->enqueueJobs(jobList2);
+
+ m_jobManager->waitForAllJobs();
+
+ // THEN
+ QVERIFY(jobCount * 2 == callCounter.load());
+}
+
+/*
+ * Default test for jobs that have dependencies.
+ */
+void tst_ThreadPooler::dependencyAspectQueue()
+{
+ // GIVEN
+ QAtomicInt callCounter; // Not used in this test
+ int value = 2;
+ QVector<QSharedPointer<Qt3D::QAspectJob> > jobList;
+
+ // WHEN
+ QSharedPointer<TestAspectJob> job1(new TestAspectJob(add2, &callCounter, &value));
+ jobList.append(job1);
+ QSharedPointer<TestAspectJob> job2(new TestAspectJob(multiplyBy2, &callCounter, &value));
+ job2->addDependency(job1);
+ jobList.append(job2);
+ m_jobManager->enqueueJobs(jobList);
+ m_jobManager->waitForAllJobs();
+
+ // THEN
+ // value should be (2+2)*2 = 8
+ QVERIFY(value == 8);
+}
+
+void tst_ThreadPooler::massTest()
+{
+ // GIVEN
+ const int mass = 600; // 600
+ QVector<QSharedPointer<Qt3D::QAspectJob> > jobList;
+ QVector3D data[3 * mass];
+
+ // WHEN
+ QTime time;
+ time.start();
+
+ for (int i = 0; i < mass; i++) {
+ QSharedPointer<MassAspectJob> job1(new MassAspectJob(massTestFunction, &(data[i * 3 + 0])));
+ jobList.append(job1);
+ QSharedPointer<MassAspectJob> job2(new MassAspectJob(massTestFunction, &(data[i * 3 + 1])));
+ job2->addDependency(job1);
+ jobList.append(job2);
+ QSharedPointer<MassAspectJob> job3(new MassAspectJob(massTestFunction, &(data[i * 3 + 2])));
+ job3->addDependency(job2);
+ jobList.append(job3);
+ }
+
+ m_jobManager->enqueueJobs(jobList);
+ m_jobManager->waitForAllJobs();
+
+ // THEN
+ qDebug() << "time.elapsed() = " << time.elapsed() << " ms";
+}
+
+QTEST_APPLESS_MAIN(tst_ThreadPooler)
+
+#include "tst_threadpooler.moc"
diff --git a/tests/auto/render/render.pro b/tests/auto/render/render.pro
index 86796dab1..5393ec79c 100644
--- a/tests/auto/render/render.pro
+++ b/tests/auto/render/render.pro
@@ -8,5 +8,7 @@ contains(QT_CONFIG, private_tests) {
qgraphicsutils \
rendershader \
renderviewutils \
- renderviews
+ renderviews \
+ rendermaterial \
+ rendermesh
}
diff --git a/tests/auto/render/rendermaterial/rendermaterial.pro b/tests/auto/render/rendermaterial/rendermaterial.pro
new file mode 100644
index 000000000..545510ae8
--- /dev/null
+++ b/tests/auto/render/rendermaterial/rendermaterial.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+
+TARGET = tst_rendermaterial
+
+QT += 3dcore 3dcore-private 3drenderer 3drenderer-private testlib
+
+CONFIG += testcase
+
+SOURCES += tst_rendermaterial.cpp
diff --git a/tests/auto/render/rendermaterial/tst_rendermaterial.cpp b/tests/auto/render/rendermaterial/tst_rendermaterial.cpp
new file mode 100644
index 000000000..dcd3edd5e
--- /dev/null
+++ b/tests/auto/render/rendermaterial/tst_rendermaterial.cpp
@@ -0,0 +1,187 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QTest>
+#include <Qt3DRenderer/private/rendermaterial_p.h>
+
+#include <Qt3DRenderer/QMaterial>
+#include <Qt3DRenderer/QParameter>
+#include <Qt3DRenderer/QEffect>
+#include <Qt3DCore/QScenePropertyChange>
+
+
+using namespace Qt3D;
+using namespace Qt3D::Render;
+
+class tst_RenderMaterial : public QObject
+{
+ Q_OBJECT
+public:
+ tst_RenderMaterial() {}
+
+private slots:
+ void shouldHaveInitialState();
+ void shouldHavePropertiesMirroringFromItsPeer_data();
+ void shouldHavePropertiesMirroringFromItsPeer();
+ void shouldHandleParametersPropertyChange();
+ void shouldHandleEnablePropertyChange();
+};
+
+
+void tst_RenderMaterial::shouldHaveInitialState()
+{
+ // GIVEN
+ RenderMaterial backend;
+
+ // THEN
+ QVERIFY(backend.parameters().isEmpty());
+ QVERIFY(backend.effect().isNull());
+ QVERIFY(backend.isEnabled());
+}
+
+void tst_RenderMaterial::shouldHavePropertiesMirroringFromItsPeer_data()
+{
+ QTest::addColumn<QMaterial *>("frontendMaterial");
+
+ QMaterial *emptyMaterial = new QMaterial();
+ QTest::newRow("emptyMaterial") << emptyMaterial;
+
+ QMaterial *simpleMaterial = new QMaterial();
+ simpleMaterial->addParameter(new QParameter());
+ simpleMaterial->setEffect(new QEffect());
+ QTest::newRow("simpleMaterial") << simpleMaterial;
+
+ QMaterial *manyParametersMaterial = new QMaterial();
+ manyParametersMaterial->addParameter(new QParameter());
+ manyParametersMaterial->addParameter(new QParameter());
+ manyParametersMaterial->addParameter(new QParameter());
+ manyParametersMaterial->addParameter(new QParameter());
+ simpleMaterial->setEffect(new QEffect());
+ QTest::newRow("manyParametersMaterial") << manyParametersMaterial;
+
+ QMaterial *disabledSimpleMaterial = new QMaterial();
+ disabledSimpleMaterial->setEnabled(false);
+ disabledSimpleMaterial->addParameter(new QParameter());
+ disabledSimpleMaterial->setEffect(new QEffect());
+ QTest::newRow("simpleDisabledMaterial") << disabledSimpleMaterial;
+
+ QMaterial *manyParametersDisabledMaterial = new QMaterial();
+ manyParametersDisabledMaterial->setEnabled(false);
+ manyParametersDisabledMaterial->setEffect(new QEffect());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ manyParametersDisabledMaterial->addParameter(new QParameter());
+ QTest::newRow("manyParametersDisabledMaterial") << manyParametersDisabledMaterial;
+}
+
+void tst_RenderMaterial::shouldHavePropertiesMirroringFromItsPeer()
+{
+ // WHEN
+ QFETCH(QMaterial *, frontendMaterial);
+ RenderMaterial backend;
+
+ // GIVEN
+ backend.setPeer(frontendMaterial);
+
+ // THEN
+ QVERIFY(backend.isEnabled() == frontendMaterial->isEnabled());
+ QCOMPARE(backend.effect(), frontendMaterial->effect() ? frontendMaterial->effect()->id() : QNodeId());
+ QCOMPARE(backend.parameters().count(), frontendMaterial->parameters().count());
+
+ int c = 0;
+ Q_FOREACH (QParameter *p, frontendMaterial->parameters())
+ QCOMPARE(p->id(), backend.parameters().at(c++));
+
+ delete frontendMaterial;
+}
+
+void tst_RenderMaterial::shouldHandleParametersPropertyChange()
+{
+ // GIVEN
+ QScopedPointer<QParameter> parameter(new QParameter());
+ RenderMaterial backend;
+
+ // WHEN
+ QScenePropertyChangePtr addChange(new QScenePropertyChange(NodeAdded, QSceneChange::Node, parameter->id()));
+ addChange->setValue(QVariant::fromValue(parameter->id()));
+ addChange->setPropertyName("parameter");
+ backend.sceneChangeEvent(addChange);
+
+ // THEN
+ QCOMPARE(backend.parameters().count(), 1);
+ QCOMPARE(backend.parameters().first(), parameter->id());
+
+ // WHEN
+ QScenePropertyChangePtr removeChange(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, parameter->id()));
+ removeChange->setValue(QVariant::fromValue(parameter->id()));
+ removeChange->setPropertyName("parameter");
+ backend.sceneChangeEvent(removeChange);
+
+ // THEN
+ QVERIFY(backend.parameters().isEmpty());
+}
+
+void tst_RenderMaterial::shouldHandleEnablePropertyChange()
+{
+ // GIVEN
+ RenderMaterial backend;
+
+ // WHEN
+ QScenePropertyChangePtr updateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+ updateChange->setValue(false);
+ updateChange->setPropertyName("enabled");
+ backend.sceneChangeEvent(updateChange);
+
+ // THEN
+ QVERIFY(!backend.isEnabled());
+
+ // WHEN
+ QScenePropertyChangePtr secondUpdateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+ secondUpdateChange->setValue(true);
+ secondUpdateChange->setPropertyName("enabled");
+ backend.sceneChangeEvent(secondUpdateChange);
+
+ // THEN
+ QVERIFY(backend.isEnabled());
+}
+
+QTEST_APPLESS_MAIN(tst_RenderMaterial)
+
+#include "tst_rendermaterial.moc"
diff --git a/tests/auto/render/rendermesh/rendermesh.pro b/tests/auto/render/rendermesh/rendermesh.pro
new file mode 100644
index 000000000..c654f0dfa
--- /dev/null
+++ b/tests/auto/render/rendermesh/rendermesh.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+
+TARGET = tst_rendermesh
+
+QT += 3dcore 3dcore-private 3drenderer 3drenderer-private testlib
+
+CONFIG += testcase
+
+SOURCES += tst_rendermesh.cpp
diff --git a/tests/auto/render/rendermesh/tst_rendermesh.cpp b/tests/auto/render/rendermesh/tst_rendermesh.cpp
new file mode 100644
index 000000000..e79b95371
--- /dev/null
+++ b/tests/auto/render/rendermesh/tst_rendermesh.cpp
@@ -0,0 +1,178 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QTest>
+#include <Qt3DRenderer/private/meshdatamanager_p.h>
+#include <Qt3DRenderer/private/rendermesh_p.h>
+#include <Qt3DRenderer/QAbstractMesh>
+#include <Qt3DRenderer/QAbstractMeshFunctor>
+#include <Qt3DRenderer/QCylinderMesh>
+#include <Qt3DRenderer/QPlaneMesh>
+#include <Qt3DRenderer/QCuboidMesh>
+#include <Qt3DRenderer/QSphereMesh>
+#include <Qt3DRenderer/QTorusMesh>
+#include <Qt3DRenderer/QMesh>
+#include <Qt3DCore/QScenePropertyChange>
+
+
+using namespace Qt3D;
+using namespace Qt3D::Render;
+
+class tst_RenderMesh : public QObject
+{
+ Q_OBJECT
+public:
+ tst_RenderMesh() {}
+
+private slots:
+ void shouldHaveInitialState();
+ void shouldHavePropertiesMirroringFromItsPeer_data();
+ void shouldHavePropertiesMirroringFromItsPeer();
+ void shouldHandleMeshFunctorPropertyChange();
+ void shouldHandleEnablePropertyChange();
+};
+
+
+void tst_RenderMesh::shouldHaveInitialState()
+{
+ // GIVEN
+ RenderMesh backend;
+
+ // THEN
+ QVERIFY(backend.meshFunctor().isNull());
+ QVERIFY(backend.isEnabled());
+}
+
+void tst_RenderMesh::shouldHavePropertiesMirroringFromItsPeer_data()
+{
+ QTest::addColumn<QAbstractMesh *>("frontendMesh");
+
+ QTest::newRow("planeMesh") << (QAbstractMesh *)new QPlaneMesh();
+ QTest::newRow("cuboidMesh") << (QAbstractMesh *)new QCuboidMesh();
+ QTest::newRow("sphereMesh") << (QAbstractMesh *)new QSphereMesh();
+ QTest::newRow("torusMesh") << (QAbstractMesh *)new QTorusMesh();
+ QTest::newRow("cylinderMesh") << (QAbstractMesh *)new QCylinderMesh();
+ QTest::newRow("mesh") << (QAbstractMesh *)new QMesh();
+}
+
+void tst_RenderMesh::shouldHavePropertiesMirroringFromItsPeer()
+{
+ // GIVEN
+ QFETCH(QAbstractMesh *, frontendMesh);
+ RenderMesh backend;
+ QScopedPointer<MeshDataManager> manager(new MeshDataManager());
+ backend.setMeshDataManager(manager.data());
+
+ // WHEN
+ backend.setPeer(frontendMesh);
+
+ // THEN
+ QVERIFY(backend.isEnabled() == frontendMesh->isEnabled());
+ QVERIFY(backend.meshFunctor());
+ QVERIFY(*backend.meshFunctor() == *frontendMesh->meshFunctor());
+
+ delete frontendMesh;
+}
+
+void tst_RenderMesh::shouldHandleMeshFunctorPropertyChange()
+{
+ // GIVEN
+ RenderMesh backend;
+ QScopedPointer<MeshDataManager> manager(new MeshDataManager());
+ backend.setMeshDataManager(manager.data());
+
+ QScopedPointer<QPlaneMesh> planeMesh(new QPlaneMesh());
+ QScopedPointer<QSphereMesh> sphereMesh(new QSphereMesh());
+ QAbstractMeshFunctorPtr meshFunctor(planeMesh->meshFunctor());
+
+ // THEN
+ QVERIFY(backend.meshFunctor() != meshFunctor);
+
+ // WHEN
+ QScenePropertyChangePtr updateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+
+ updateChange->setValue(QVariant::fromValue(meshFunctor));
+ updateChange->setPropertyName("meshFunctor");
+ backend.sceneChangeEvent(updateChange);
+
+ // THEN
+ QVERIFY(backend.meshFunctor() == meshFunctor);
+
+ // GIVEN
+ meshFunctor = sphereMesh->meshFunctor();
+
+ // THEN
+ QVERIFY(backend.meshFunctor() != meshFunctor);
+
+ // WHEN
+ QScenePropertyChangePtr secondUpdateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+ secondUpdateChange->setValue(QVariant::fromValue(meshFunctor));
+ secondUpdateChange->setPropertyName("meshFunctor");
+ backend.sceneChangeEvent(secondUpdateChange);
+
+ // THEN
+ QVERIFY(backend.meshFunctor() == meshFunctor);
+}
+
+void tst_RenderMesh::shouldHandleEnablePropertyChange()
+{
+ // GIVEN
+ RenderMesh backend;
+ QScopedPointer<MeshDataManager> manager(new MeshDataManager());
+ backend.setMeshDataManager(manager.data());
+
+ // WHEN
+ QScenePropertyChangePtr updateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+ updateChange->setValue(false);
+ updateChange->setPropertyName("enabled");
+ backend.sceneChangeEvent(updateChange);
+
+ // THEN
+ QVERIFY(!backend.isEnabled());
+
+ // WHEN
+ QScenePropertyChangePtr secondUpdateChange(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, QNodeId()));
+ secondUpdateChange->setValue(true);
+ secondUpdateChange->setPropertyName("enabled");
+ backend.sceneChangeEvent(secondUpdateChange);
+
+ // THEN
+ QVERIFY(backend.isEnabled());
+}
+
+QTEST_MAIN(tst_RenderMesh)
+
+#include "tst_rendermesh.moc"
diff --git a/tests/auto/render/renderrenderpass/tst_renderrenderpass.cpp b/tests/auto/render/renderrenderpass/tst_renderrenderpass.cpp
index 79ab05c67..4f3983861 100644
--- a/tests/auto/render/renderrenderpass/tst_renderrenderpass.cpp
+++ b/tests/auto/render/renderrenderpass/tst_renderrenderpass.cpp
@@ -43,6 +43,7 @@
#include <Qt3DRenderer/QParameterMapping>
#include <Qt3DRenderer/QRenderPass>
#include <Qt3DRenderer/QShaderProgram>
+#include <Qt3DRenderer/QParameter>
#include <Qt3DRenderer/QAlphaCoverage>
#include <Qt3DRenderer/QAlphaTest>
@@ -83,6 +84,7 @@ private slots:
QVERIFY(backend.annotations().isEmpty());
QVERIFY(backend.bindings().isEmpty());
QVERIFY(backend.renderStates().isEmpty());
+ QVERIFY(backend.parameters().isEmpty());
}
void shouldHavePropertiesMirroringItsPeer_data()
@@ -178,6 +180,8 @@ private slots:
frontend.addBinding(new QParameterMapping(&frontend));
+ frontend.addParameter(new QParameter(&frontend));
+
QFETCH(QRenderState*, frontendState);
frontendState->setParent(&frontend);
frontend.addRenderState(frontendState);
@@ -201,6 +205,9 @@ private slots:
QCOMPARE(backend.bindings().first().parameterName(), frontend.bindings().first()->parameterName());
QCOMPARE(backend.bindings().first().shaderVariableName(), frontend.bindings().first()->shaderVariableName());
+ QCOMPARE(backend.parameters().size(), 1);
+ QCOMPARE(backend.parameters().first(), frontend.parameters().first()->id());
+
QCOMPARE(backend.renderStates().size(), 1);
QCOMPARE(backend.renderStates().first(), backendState);
}
@@ -288,6 +295,33 @@ private slots:
QVERIFY(backend.bindings().isEmpty());
}
+ void shouldHandleParametersPropertyChangeEvents()
+ {
+ // GIVEN
+ QScopedPointer<QParameter> parameter(new QParameter);
+
+ RenderRenderPass backend;
+
+ // WHEN
+ QScenePropertyChangePtr addChange(new QScenePropertyChange(NodeAdded, QSceneChange::Node, parameter->id()));
+ addChange->setValue(QVariant::fromValue(parameter->id()));
+ addChange->setPropertyName("parameter");
+ backend.sceneChangeEvent(addChange);
+
+ // THEN
+ QCOMPARE(backend.parameters().size(), 1);
+ QCOMPARE(backend.parameters().first(), parameter->id());
+
+ // WHEN
+ QScenePropertyChangePtr removeChange(new QScenePropertyChange(NodeRemoved, QSceneChange::Node, parameter->id()));
+ removeChange->setValue(QVariant::fromValue(parameter->id()));
+ removeChange->setPropertyName("parameter");
+ backend.sceneChangeEvent(removeChange);
+
+ // THEN
+ QVERIFY(backend.parameters().isEmpty());
+ }
+
void shouldHandlePropertyChangeEvents_data()
{
shouldHavePropertiesMirroringItsPeer_data();
@@ -297,8 +331,7 @@ private slots:
{
// GIVEN
QFETCH(QRenderState*, frontendState);
- QScopedPointer<QRenderState> frontendStatePtr(frontendState);
- Q_UNUSED(frontendStatePtr);
+ QNodePtr frontendStatePtr(frontendState);
RenderRenderPass backend;
@@ -306,7 +339,7 @@ private slots:
// WHEN
QScenePropertyChangePtr addChange(new QScenePropertyChange(NodeAdded, QSceneChange::Node, frontendState->id()));
- addChange->setValue(QVariant::fromValue(frontendState));
+ addChange->setValue(QVariant::fromValue(frontendStatePtr));
addChange->setPropertyName("renderState");
backend.sceneChangeEvent(addChange);
diff --git a/tests/auto/shared/util.cpp b/tests/auto/shared/util.cpp
index 37468f467..cd3e604c6 100644
--- a/tests/auto/shared/util.cpp
+++ b/tests/auto/shared/util.cpp
@@ -5,7 +5,7 @@
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -16,16 +16,19 @@
**
** 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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/shared/util.h b/tests/auto/shared/util.h
index 12a8933c4..80d301bc7 100644
--- a/tests/auto/shared/util.h
+++ b/tests/auto/shared/util.h
@@ -5,7 +5,7 @@
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -16,16 +16,19 @@
**
** 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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**