summaryrefslogtreecommitdiffstats
path: root/src/quick3d
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-05-24 12:09:44 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-05-24 12:10:02 +0100
commit77d294db076dac19e8b549b445ffede9f7260c84 (patch)
tree828ee7a6862ec5c0bd24f97cb540625a2c647376 /src/quick3d
parent59f8fec8a41606b3185fe3a4e276978e3e1ed5ef (diff)
parent939b9b4b7591e8a421cf048a0a84ed3e75d81d21 (diff)
Merge branch 'dev' into wip/animationwip/animation
Diffstat (limited to 'src/quick3d')
-rw-r--r--src/quick3d/imports/animation/plugins.qmltypes670
-rw-r--r--src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp54
-rw-r--r--src/quick3d/imports/core/plugins.qmltypes82
-rw-r--r--src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp19
-rw-r--r--src/quick3d/imports/core/qt3dquick3dcoreplugin.h1
-rw-r--r--src/quick3d/imports/extras/defaults/defaults.pri26
-rw-r--r--src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml148
-rw-r--r--src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml104
-rw-r--r--src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml81
-rw-r--r--src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml93
-rw-r--r--src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml191
-rw-r--r--src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml80
-rw-r--r--src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml115
-rw-r--r--src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml92
-rw-r--r--src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml97
-rw-r--r--src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml110
-rw-r--r--src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml236
-rw-r--r--src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml68
-rw-r--r--src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml151
-rw-r--r--src/quick3d/imports/extras/importsextras.pro30
-rw-r--r--src/quick3d/imports/extras/plugins.qmltypes1181
-rw-r--r--src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp127
-rw-r--r--src/quick3d/imports/extras/qt3dquick3dextrasplugin.h1
-rw-r--r--src/quick3d/imports/input/plugins.qmltypes86
-rw-r--r--src/quick3d/imports/input/qt3dquick3dinputplugin.cpp34
-rw-r--r--src/quick3d/imports/logic/plugins.qmltypes27
-rw-r--r--src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp5
-rw-r--r--src/quick3d/imports/render/importsrender.pro2
-rw-r--r--src/quick3d/imports/render/plugins.qmltypes438
-rw-r--r--src/quick3d/imports/render/qt3dquick3drenderplugin.cpp155
-rw-r--r--src/quick3d/imports/scene2d/importsscene2d.pro19
-rw-r--r--src/quick3d/imports/scene2d/plugins.qmltypes121
-rw-r--r--src/quick3d/imports/scene2d/qmldir3
-rw-r--r--src/quick3d/imports/scene2d/qtquickscene2dplugin.cpp58
-rw-r--r--src/quick3d/imports/scene2d/qtquickscene2dplugin.h62
-rw-r--r--src/quick3d/imports/scene3d/qtquickscene3dplugin.cpp6
-rw-r--r--src/quick3d/imports/scene3d/scene3dcleaner.cpp6
-rw-r--r--src/quick3d/imports/scene3d/scene3dcleaner_p.h2
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem.cpp45
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem_p.h7
-rw-r--r--src/quick3d/imports/scene3d/scene3dlogging.cpp2
-rw-r--r--src/quick3d/imports/scene3d/scene3dlogging_p.h2
-rw-r--r--src/quick3d/imports/scene3d/scene3drenderer.cpp70
-rw-r--r--src/quick3d/imports/scene3d/scene3drenderer_p.h7
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgmaterial_p.h4
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp10
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h1
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgnode.cpp3
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgnode_p.h2
-rw-r--r--src/quick3d/quick3d/items/items.pri6
-rw-r--r--src/quick3d/quick3d/items/quick3dentity.cpp7
-rw-r--r--src/quick3d/quick3d/items/quick3dentity_p.h5
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader.cpp97
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader_p.h17
-rw-r--r--src/quick3d/quick3d/items/quick3dentityloader_p_p.h7
-rw-r--r--src/quick3d/quick3d/items/quick3dnode.cpp3
-rw-r--r--src/quick3d/quick3d/items/quick3dnode_p.h3
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp10
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h3
-rw-r--r--src/quick3d/quick3d/items/quick3dnodev9.cpp203
-rw-r--r--src/quick3d/quick3d/items/quick3dnodev9_p.h109
-rw-r--r--src/quick3d/quick3d/qqmlaspectengine.cpp7
-rw-r--r--src/quick3d/quick3d/qqmlaspectengine.h2
-rw-r--r--src/quick3d/quick3d/qqmlaspectengine_p.h5
-rw-r--r--src/quick3d/quick3d/qquaternionanimation.cpp1
-rw-r--r--src/quick3d/quick3d/qquaternionanimation_p.h3
-rw-r--r--src/quick3d/quick3d/qt3dquick_global.cpp21
-rw-r--r--src/quick3d/quick3d/qt3dquick_global_p.h1
-rw-r--r--src/quick3d/quick3d/qt3dquicknodefactory.cpp1
-rw-r--r--src/quick3d/quick3d/qt3dquicknodefactory_p.h3
-rw-r--r--src/quick3d/quick3d/qt3dquickvaluetypes_p.h10
-rw-r--r--src/quick3d/quick3danimation/items/items.pri14
-rw-r--r--src/quick3d/quick3danimation/items/quick3dabstractclipblendnode.cpp92
-rw-r--r--src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp (renamed from src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp)4
-rw-r--r--src/quick3d/quick3danimation/items/quick3danimationcontroller_p.h (renamed from src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h)32
-rw-r--r--src/quick3d/quick3danimation/items/quick3danimationgroup.cpp (renamed from src/quick3d/quick3dextras/items/quick3danimationgroup.cpp)24
-rw-r--r--src/quick3d/quick3danimation/items/quick3danimationgroup_p.h (renamed from src/quick3d/quick3dextras/items/quick3danimationgroup_p.h)32
-rw-r--r--src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h2
-rw-r--r--src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp (renamed from src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp)4
-rw-r--r--src/quick3d/quick3danimation/items/quick3dkeyframeanimation_p.h (renamed from src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h)16
-rw-r--r--src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp (renamed from src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp)22
-rw-r--r--src/quick3d/quick3danimation/items/quick3dmorphinganimation_p.h (renamed from src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h)30
-rw-r--r--src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp (renamed from src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp)4
-rw-r--r--src/quick3d/quick3danimation/items/quick3dmorphtarget_p.h (renamed from src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h)16
-rw-r--r--src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp104
-rw-r--r--src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h93
-rw-r--r--src/quick3d/quick3dextras/items/items.pri13
-rw-r--r--src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp194
-rw-r--r--src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h121
-rw-r--r--src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p_p.h (renamed from src/quick3d/quick3danimation/items/quick3dabstractclipblendnode_p.h)46
-rw-r--r--src/quick3d/quick3dextras/qt3dquickextras_global_p.h (renamed from src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml)38
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow.cpp106
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow.h18
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow_p.h86
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp (renamed from src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml)23
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h (renamed from src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml)52
-rw-r--r--src/quick3d/quick3dextras/quick3dextras.pro12
-rw-r--r--src/quick3d/quick3dinput/items/quick3daction.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3daction_p.h5
-rw-r--r--src/quick3d/quick3dinput/items/quick3daxis.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3daxis_p.h7
-rw-r--r--src/quick3d/quick3dinput/items/quick3dinputchord.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3dinputchord_p.h5
-rw-r--r--src/quick3d/quick3dinput/items/quick3dinputsequence.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3dinputsequence_p.h5
-rw-r--r--src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3dlogicaldevice_p.h5
-rw-r--r--src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp2
-rw-r--r--src/quick3d/quick3dinput/items/quick3dphysicaldevice_p.h7
-rw-r--r--src/quick3d/quick3dinput/qt3dquickinput_global.cpp4
-rw-r--r--src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp2
-rw-r--r--src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h3
-rw-r--r--src/quick3d/quick3drender/items/quick3dbuffer.cpp6
-rw-r--r--src/quick3d/quick3drender/items/quick3dbuffer_p.h3
-rw-r--r--src/quick3d/quick3drender/items/quick3deffect.cpp3
-rw-r--r--src/quick3d/quick3drender/items/quick3deffect_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dgeometry.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dgeometry_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dlayerfilter.cpp3
-rw-r--r--src/quick3d/quick3drender/items/quick3dlayerfilter_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dmaterial.cpp3
-rw-r--r--src/quick3d/quick3drender/items/quick3dmaterial_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp10
-rw-r--r--src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h6
-rw-r--r--src/quick3d/quick3drender/items/quick3dparameter.cpp6
-rw-r--r--src/quick3d/quick3drender/items/quick3dparameter_p.h3
-rw-r--r--src/quick3d/quick3drender/items/quick3dparameter_p_p.h4
-rw-r--r--src/quick3d/quick3drender/items/quick3drenderpass.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3drenderpass_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h7
-rw-r--r--src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3drendertargetselector.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3drendertargetselector_p.h7
-rw-r--r--src/quick3d/quick3drender/items/quick3dscene.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dscene_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dshaderdata.cpp18
-rw-r--r--src/quick3d/quick3drender/items/quick3dshaderdata_p.h8
-rw-r--r--src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp4
-rw-r--r--src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h3
-rw-r--r--src/quick3d/quick3drender/items/quick3dstateset.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dstateset_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dtechnique.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dtechnique_p.h5
-rw-r--r--src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h7
-rw-r--r--src/quick3d/quick3drender/items/quick3dtexture.cpp5
-rw-r--r--src/quick3d/quick3drender/items/quick3dtexture_p.h6
-rw-r--r--src/quick3d/quick3drender/items/quick3dviewport.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3dviewport_p.h3
-rw-r--r--src/quick3d/quick3drender/qt3dquickrender_global.cpp4
-rw-r--r--src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp2
-rw-r--r--src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h3
-rw-r--r--src/quick3d/quick3dscene2d/items/items.pri17
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d.cpp365
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d.h112
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d_p.h99
-rw-r--r--src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp100
-rw-r--r--src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d_p.h93
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d.cpp516
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d.pri10
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d_p.h134
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2devent_p.h84
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dmanager.cpp248
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dmanager_p.h112
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dsharedobject.cpp162
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dsharedobject_p.h130
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2d_global.cpp58
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2d_global.h56
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2d_global_p.h88
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2d_logging.cpp49
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2d_logging_p.h65
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp (renamed from src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml)86
-rw-r--r--src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h (renamed from src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml)74
-rw-r--r--src/quick3d/quick3dscene2d/quick3dscene2d.pro31
176 files changed, 6841 insertions, 2748 deletions
diff --git a/src/quick3d/imports/animation/plugins.qmltypes b/src/quick3d/imports/animation/plugins.qmltypes
new file mode 100644
index 000000000..08879ee52
--- /dev/null
+++ b/src/quick3d/imports/animation/plugins.qmltypes
@@ -0,0 +1,670 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable Qt3D.Animation 2.9'
+
+Module {
+ dependencies: ["QtQuick 2.8"]
+ Component {
+ name: "Qt3DAnimation::Animation::Quick::Quick3DChannelMapper"
+ defaultProperty: "mappings"
+ prototype: "Qt3DAnimation::QChannelMapper"
+ exports: ["Qt3D.Animation/ChannelMapper 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "mappings"
+ type: "Qt3DAnimation::QChannelMapping"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractAnimation"
+ prototype: "QObject"
+ exports: ["Qt3D.Animation/AbstractAnimation 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "AnimationType"
+ values: {
+ "KeyframeAnimation": 1,
+ "MorphingAnimation": 2,
+ "VertexBlendAnimation": 3
+ }
+ }
+ Property { name: "animationName"; type: "string" }
+ Property { name: "animationType"; type: "QAbstractAnimation::AnimationType"; isReadonly: true }
+ Property { name: "position"; type: "float" }
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "animationNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ Method {
+ name: "setAnimationName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractAnimationClip"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/AbstractAnimationClip 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractClipAnimator"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Animation/AbstractClipAnimator 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Loops"
+ values: {
+ "Infinite": -1
+ }
+ }
+ Property { name: "running"; type: "bool" }
+ Property { name: "loops"; type: "int" }
+ Property { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ Signal {
+ name: "runningChanged"
+ Parameter { name: "running"; type: "bool" }
+ }
+ Signal {
+ name: "channelMapperChanged"
+ Parameter { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ }
+ Signal {
+ name: "loopCountChanged"
+ Parameter { name: "loops"; type: "int" }
+ }
+ Method {
+ name: "setRunning"
+ Parameter { name: "running"; type: "bool" }
+ }
+ Method {
+ name: "setChannelMapper"
+ Parameter { name: "channelMapper"; type: "Qt3DAnimation::QChannelMapper"; isPointer: true }
+ }
+ Method {
+ name: "setLoopCount"
+ Parameter { name: "loops"; type: "int" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAbstractClipBlendNode"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/AbstractClipBlendNode 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "Qt3DAnimation::QAdditiveClipBlend"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/AdditiveClipBlend 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ Property { name: "additiveFactor"; type: "float" }
+ Signal {
+ name: "additiveFactorChanged"
+ Parameter { name: "additiveFactor"; type: "float" }
+ }
+ Signal {
+ name: "baseClipChanged"
+ Parameter { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Signal {
+ name: "additiveClipChanged"
+ Parameter {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ }
+ Method {
+ name: "setAdditiveFactor"
+ Parameter { name: "additiveFactor"; type: "float" }
+ }
+ Method {
+ name: "setBaseClip"
+ Parameter { name: "baseClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setAdditiveClip"
+ Parameter {
+ name: "additiveClip"
+ type: "Qt3DAnimation::QAbstractClipBlendNode"
+ isPointer: true
+ }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationClip"
+ prototype: "Qt3DAnimation::QAbstractAnimationClip"
+ exports: ["Qt3D.Animation/AnimationClip 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ Signal {
+ name: "clipDataChanged"
+ Parameter { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ }
+ Method {
+ name: "setClipData"
+ Parameter { name: "clipData"; type: "Qt3DAnimation::QAnimationClipData" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationClipLoader"
+ prototype: "Qt3DAnimation::QAbstractAnimationClip"
+ exports: ["Qt3D.Animation/AnimationClipLoader 2.9"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Status"
+ values: {
+ "NotReady": 0,
+ "Ready": 1,
+ "Error": 2
+ }
+ }
+ Property { name: "source"; type: "QUrl" }
+ Property { name: "status"; type: "Status"; isReadonly: true }
+ Signal {
+ name: "sourceChanged"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ Signal {
+ name: "statusChanged"
+ Parameter { name: "status"; type: "Status" }
+ }
+ Method {
+ name: "setSource"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationController"
+ prototype: "QObject"
+ Property { name: "activeAnimationGroup"; type: "int" }
+ Property { name: "position"; type: "float" }
+ Property { name: "positionScale"; type: "float" }
+ Property { name: "positionOffset"; type: "float" }
+ Property { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ Property { name: "recursive"; type: "bool" }
+ Signal {
+ name: "activeAnimationGroupChanged"
+ Parameter { name: "index"; type: "int" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "positionScaleChanged"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Signal {
+ name: "positionOffsetChanged"
+ Parameter { name: "offset"; type: "float" }
+ }
+ Signal {
+ name: "entityChanged"
+ Parameter { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "recursiveChanged"
+ Parameter { name: "recursive"; type: "bool" }
+ }
+ Method {
+ name: "setActiveAnimationGroup"
+ Parameter { name: "index"; type: "int" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ Method {
+ name: "setPositionScale"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Method {
+ name: "setPositionOffset"
+ Parameter { name: "offset"; type: "float" }
+ }
+ Method {
+ name: "setEntity"
+ Parameter { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Method {
+ name: "setRecursive"
+ Parameter { name: "recursive"; type: "bool" }
+ }
+ Method {
+ name: "getAnimationIndex"
+ type: "int"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "getGroup"
+ type: "Qt3DAnimation::QAnimationGroup*"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QAnimationGroup"
+ prototype: "QObject"
+ Property { name: "name"; type: "string" }
+ Property { name: "position"; type: "float" }
+ Property { name: "duration"; type: "float"; isReadonly: true }
+ Signal {
+ name: "nameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "positionChanged"
+ Parameter { name: "position"; type: "float" }
+ }
+ Signal {
+ name: "durationChanged"
+ Parameter { name: "duration"; type: "float" }
+ }
+ Method {
+ name: "setName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setPosition"
+ Parameter { name: "position"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QBlendedClipAnimator"
+ prototype: "Qt3DAnimation::QAbstractClipAnimator"
+ exports: ["Qt3D.Animation/BlendedClipAnimator 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "blendTree"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Signal {
+ name: "blendTreeChanged"
+ Parameter { name: "blendTree"; type: "QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setBlendTree"
+ Parameter { name: "blendTree"; type: "QAbstractClipBlendNode"; isPointer: true }
+ }
+ }
+ Component { name: "Qt3DAnimation::QChannelMapper"; prototype: "Qt3DCore::QNode" }
+ Component {
+ name: "Qt3DAnimation::QChannelMapping"
+ prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Animation/ChannelMapping 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "channelName"; type: "string" }
+ Property { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ Property { name: "property"; type: "string" }
+ Signal {
+ name: "channelNameChanged"
+ Parameter { name: "channelName"; type: "string" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ }
+ Signal {
+ name: "propertyChanged"
+ Parameter { name: "property"; type: "string" }
+ }
+ Method {
+ name: "setChannelName"
+ Parameter { name: "channelName"; type: "string" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DCore::QNode"; isPointer: true }
+ }
+ Method {
+ name: "setProperty"
+ Parameter { name: "property"; type: "string" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QClipAnimator"
+ prototype: "Qt3DAnimation::QAbstractClipAnimator"
+ exports: ["Qt3D.Animation/ClipAnimator 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ Signal {
+ name: "clipChanged"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ Method {
+ name: "setClip"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QClipBlendValue"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/ClipBlendValue 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ Signal {
+ name: "clipChanged"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ Method {
+ name: "setClip"
+ Parameter { name: "clip"; type: "Qt3DAnimation::QAbstractAnimationClip"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QKeyframeAnimation"
+ prototype: "Qt3DAnimation::QAbstractAnimation"
+ Enum {
+ name: "RepeatMode"
+ values: {
+ "None": 0,
+ "Constant": 1,
+ "Repeat": 2
+ }
+ }
+ Property { name: "framePositions"; type: "QVector<float>" }
+ Property { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ Property { name: "easing"; type: "QEasingCurve" }
+ Property { name: "targetName"; type: "string" }
+ Property { name: "startMode"; type: "QKeyframeAnimation::RepeatMode" }
+ Property { name: "endMode"; type: "QKeyframeAnimation::RepeatMode" }
+ Signal {
+ name: "framePositionsChanged"
+ Parameter { name: "positions"; type: "QVector<float>" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ }
+ Signal {
+ name: "easingChanged"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Signal {
+ name: "targetNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "startModeChanged"
+ Parameter { name: "startMode"; type: "QKeyframeAnimation::RepeatMode" }
+ }
+ Signal {
+ name: "endModeChanged"
+ Parameter { name: "endMode"; type: "QKeyframeAnimation::RepeatMode" }
+ }
+ Method {
+ name: "setFramePositions"
+ Parameter { name: "positions"; type: "QVector<float>" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DCore::QTransform"; isPointer: true }
+ }
+ Method {
+ name: "setEasing"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Method {
+ name: "setTargetName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setStartMode"
+ Parameter { name: "mode"; type: "RepeatMode" }
+ }
+ Method {
+ name: "setEndMode"
+ Parameter { name: "mode"; type: "RepeatMode" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QLerpClipBlend"
+ prototype: "Qt3DAnimation::QAbstractClipBlendNode"
+ exports: ["Qt3D.Animation/LerpClipBlend 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ Property { name: "blendFactor"; type: "float" }
+ Signal {
+ name: "blendFactorChanged"
+ Parameter { name: "blendFactor"; type: "float" }
+ }
+ Signal {
+ name: "startClipChanged"
+ Parameter { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Signal {
+ name: "endClipChanged"
+ Parameter { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setBlendFactor"
+ Parameter { name: "blendFactor"; type: "float" }
+ }
+ Method {
+ name: "setStartClip"
+ Parameter { name: "startClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ Method {
+ name: "setEndClip"
+ Parameter { name: "endClip"; type: "Qt3DAnimation::QAbstractClipBlendNode"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QMorphTarget"
+ prototype: "QObject"
+ Property { name: "attributeNames"; type: "QStringList"; isReadonly: true }
+ Signal {
+ name: "attributeNamesChanged"
+ Parameter { name: "attributeNames"; type: "QStringList" }
+ }
+ Method {
+ name: "fromGeometry"
+ type: "QMorphTarget*"
+ Parameter { name: "geometry"; type: "Qt3DRender::QGeometry"; isPointer: true }
+ Parameter { name: "attributes"; type: "QStringList" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::QMorphingAnimation"
+ prototype: "Qt3DAnimation::QAbstractAnimation"
+ Enum {
+ name: "Method"
+ values: {
+ "Normalized": 0,
+ "Relative": 1
+ }
+ }
+ Property { name: "targetPositions"; type: "QVector<float>" }
+ Property { name: "interpolator"; type: "float"; isReadonly: true }
+ Property { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ Property { name: "targetName"; type: "string" }
+ Property { name: "method"; type: "QMorphingAnimation::Method" }
+ Property { name: "easing"; type: "QEasingCurve" }
+ Signal {
+ name: "targetPositionsChanged"
+ Parameter { name: "targetPositions"; type: "QVector<float>" }
+ }
+ Signal {
+ name: "interpolatorChanged"
+ Parameter { name: "interpolator"; type: "float" }
+ }
+ Signal {
+ name: "targetChanged"
+ Parameter { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ }
+ Signal {
+ name: "targetNameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "methodChanged"
+ Parameter { name: "method"; type: "QMorphingAnimation::Method" }
+ }
+ Signal {
+ name: "easingChanged"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ Method {
+ name: "setTargetPositions"
+ Parameter { name: "targetPositions"; type: "QVector<float>" }
+ }
+ Method {
+ name: "setTarget"
+ Parameter { name: "target"; type: "Qt3DRender::QGeometryRenderer"; isPointer: true }
+ }
+ Method {
+ name: "setTargetName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setMethod"
+ Parameter { name: "method"; type: "QMorphingAnimation::Method" }
+ }
+ Method {
+ name: "setEasing"
+ Parameter { name: "easing"; type: "QEasingCurve" }
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DAnimationController"
+ prototype: "Qt3DAnimation::QAnimationController"
+ exports: ["Qt3D.Animation/AnimationController 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "animationGroups"
+ type: "Qt3DAnimation::QAnimationGroup"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DAnimationGroup"
+ prototype: "Qt3DAnimation::QAnimationGroup"
+ exports: ["Qt3D.Animation/AnimationGroup 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "animations"
+ type: "Qt3DAnimation::QAbstractAnimation"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DKeyframeAnimation"
+ prototype: "Qt3DAnimation::QKeyframeAnimation"
+ exports: ["Qt3D.Animation/KeyframeAnimation 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "keyframes"; type: "Qt3DCore::QTransform"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DMorphTarget"
+ prototype: "Qt3DAnimation::QMorphTarget"
+ exports: ["Qt3D.Animation/MorphTarget 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "attributes"; type: "Qt3DRender::QAttribute"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "Qt3DAnimation::Quick::QQuick3DMorphingAnimation"
+ prototype: "Qt3DAnimation::QMorphingAnimation"
+ exports: ["Qt3D.Animation/MorphingAnimation 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property {
+ name: "morphTargets"
+ type: "Qt3DAnimation::QMorphTarget"
+ isList: true
+ isReadonly: true
+ }
+ }
+ Component {
+ name: "Qt3DCore::QComponent"
+ prototype: "Qt3DCore::QNode"
+ Property { name: "isShareable"; type: "bool" }
+ Signal {
+ name: "shareableChanged"
+ Parameter { name: "isShareable"; type: "bool" }
+ }
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Method {
+ name: "setShareable"
+ Parameter { name: "isShareable"; type: "bool" }
+ }
+ }
+ Component {
+ name: "Qt3DCore::QNode"
+ prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
+ Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
+ Signal {
+ name: "parentChanged"
+ Parameter { name: "parent"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "enabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ Signal { name: "nodeDestroyed" }
+ Method {
+ name: "setParent"
+ Parameter { name: "parent"; type: "QNode"; isPointer: true }
+ }
+ Method {
+ name: "setEnabled"
+ Parameter { name: "isEnabled"; type: "bool" }
+ }
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ }
+}
diff --git a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
index e0addd6b0..7feeaf84c 100644
--- a/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
+++ b/src/quick3d/imports/animation/qt3dquick3danimationplugin.cpp
@@ -38,15 +38,33 @@
****************************************************************************/
#include "qt3dquick3danimationplugin.h"
+#include <Qt3DAnimation/qabstractclipanimator.h>
+#include <Qt3DAnimation/qabstractanimationclip.h>
#include <Qt3DAnimation/qanimationclip.h>
+#include <Qt3DAnimation/qanimationcliploader.h>
#include <Qt3DAnimation/qblendedclipanimator.h>
#include <Qt3DAnimation/qclipanimator.h>
-#include <Qt3DAnimation/qconductedclipanimator.h>
#include <Qt3DAnimation/qchannelmapping.h>
-#include <Qt3DAnimation/qlerpblend.h>
+#include <Qt3DAnimation/qlerpclipblend.h>
+#include <Qt3DAnimation/qadditiveclipblend.h>
+#include <Qt3DAnimation/qclipblendvalue.h>
+
+#include <Qt3DAnimation/qkeyframeanimation.h>
+#include <Qt3DAnimation/qanimationcontroller.h>
+#include <Qt3DAnimation/qabstractanimation.h>
+#include <Qt3DAnimation/qmorphinganimation.h>
+#include <Qt3DAnimation/qanimationgroup.h>
+#include <Qt3DAnimation/qmorphtarget.h>
+#include <Qt3DAnimation/qvertexblendanimation.h>
+
#include <Qt3DQuickAnimation/private/qt3dquickanimation_global_p.h>
#include <Qt3DQuickAnimation/private/quick3dchannelmapper_p.h>
-#include <Qt3DQuickAnimation/private/quick3dabstractclipblendnode_p.h>
+#include <Qt3DQuickAnimation/private/quick3dkeyframeanimation_p.h>
+#include <Qt3DQuickAnimation/private/quick3danimationgroup_p.h>
+#include <Qt3DQuickAnimation/private/quick3danimationcontroller_p.h>
+#include <Qt3DQuickAnimation/private/quick3dmorphtarget_p.h>
+#include <Qt3DQuickAnimation/private/quick3dmorphinganimation_p.h>
+#include <Qt3DQuickAnimation/private/quick3dvertexblendanimation_p.h>
QT_BEGIN_NAMESPACE
@@ -55,16 +73,28 @@ void Qt3DQuick3DAnimationPlugin::registerTypes(const char *uri)
Qt3DAnimation::Quick::Quick3DAnimation_initialize();
// @uri Qt3D.Animation
- qmlRegisterType<Qt3DAnimation::QAnimationClip>(uri, 2, 2, "AnimationClip");
- qmlRegisterType<Qt3DAnimation::QClipAnimator>(uri, 2, 2, "ClipAnimator");
- qmlRegisterType<Qt3DAnimation::QBlendedClipAnimator>(uri, 2, 2, "BlendedClipAnimator");
- qmlRegisterType<Qt3DAnimation::QConductedClipAnimator>(uri, 2, 2, "ConductedClipAnimator");
- qmlRegisterType<Qt3DAnimation::QChannelMapping>(uri, 2, 2, "ChannelMapping");
+ qmlRegisterUncreatableType<Qt3DAnimation::QAbstractClipAnimator>(uri, 2, 9, "AbstractClipAnimator", QStringLiteral("QAbstractClipAnimator is abstract"));
+ qmlRegisterType<Qt3DAnimation::QClipAnimator>(uri, 2, 9, "ClipAnimator");
+ qmlRegisterType<Qt3DAnimation::QBlendedClipAnimator>(uri, 2, 9, "BlendedClipAnimator");
+ qmlRegisterType<Qt3DAnimation::QChannelMapping>(uri, 2, 9, "ChannelMapping");
+ qmlRegisterType<Qt3DAnimation::QChannelMapping>(uri, 2, 9, "ChannelMapping");
+ qmlRegisterUncreatableType<Qt3DAnimation::QAbstractAnimationClip>(uri, 2, 9, "AbstractAnimationClip", QStringLiteral("QAbstractAnimationClip is abstract"));
+ qmlRegisterType<Qt3DAnimation::QAnimationClipLoader>(uri, 2, 9, "AnimationClipLoader");
+ qmlRegisterType<Qt3DAnimation::QAnimationClip>(uri, 2, 9, "AnimationClip");
qmlRegisterExtendedType<Qt3DAnimation::QChannelMapper,
- Qt3DAnimation::Animation::Quick::Quick3DChannelMapper>(uri, 2, 2, "ChannelMapper");
- qmlRegisterExtendedUncreatableType<Qt3DAnimation::QAbstractClipBlendNode,
- Qt3DAnimation::Animation::Quick::Quick3DAbstractClipBlendNode>(uri, 2, 2, "AbstractClipBlendNode", QStringLiteral("QAbstractClipBlendNode is abstract"));
- qmlRegisterType<Qt3DAnimation::QLerpBlend>(uri, 2, 2, "LerpBlend");
+ Qt3DAnimation::Animation::Quick::Quick3DChannelMapper>(uri, 2, 9, "ChannelMapper");
+ qmlRegisterUncreatableType<Qt3DAnimation::QAbstractClipBlendNode>(uri, 2, 9, "AbstractClipBlendNode", QStringLiteral("QAbstractClipBlendNode is abstract"));
+ qmlRegisterType<Qt3DAnimation::QLerpClipBlend>(uri, 2, 9, "LerpClipBlend");
+ qmlRegisterType<Qt3DAnimation::QAdditiveClipBlend>(uri, 2, 9, "AdditiveClipBlend");
+ qmlRegisterType<Qt3DAnimation::QClipBlendValue>(uri, 2, 9, "ClipBlendValue");
+
+ qmlRegisterUncreatableType<Qt3DAnimation::QAbstractAnimation>(uri, 2, 9, "AbstractAnimation", QStringLiteral("AbstractAnimation is abstract"));
+ qmlRegisterExtendedType<Qt3DAnimation::QKeyframeAnimation, Qt3DAnimation::Quick::QQuick3DKeyframeAnimation>(uri, 2, 9, "KeyframeAnimation");
+ qmlRegisterExtendedType<Qt3DAnimation::QAnimationGroup, Qt3DAnimation::Quick::QQuick3DAnimationGroup>(uri, 2, 9, "AnimationGroup");
+ qmlRegisterExtendedType<Qt3DAnimation::QAnimationController, Qt3DAnimation::Quick::QQuick3DAnimationController>(uri, 2, 9, "AnimationController");
+ qmlRegisterExtendedType<Qt3DAnimation::QMorphingAnimation, Qt3DAnimation::Quick::QQuick3DMorphingAnimation>(uri, 2, 9, "MorphingAnimation");
+ qmlRegisterExtendedType<Qt3DAnimation::QMorphTarget, Qt3DAnimation::Quick::QQuick3DMorphTarget>(uri, 2, 9, "MorphTarget");
+ qmlRegisterExtendedType<Qt3DAnimation::QVertexBlendAnimation, Qt3DAnimation::Quick::QQuick3DVertexBlendAnimation>(uri, 2, 9, "VertexBlendAnimation");
}
QT_END_NAMESPACE
diff --git a/src/quick3d/imports/core/plugins.qmltypes b/src/quick3d/imports/core/plugins.qmltypes
index ed06f8e0c..87cdac04c 100644
--- a/src/quick3d/imports/core/plugins.qmltypes
+++ b/src/quick3d/imports/core/plugins.qmltypes
@@ -4,29 +4,41 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Core 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Core 2.9'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
- prototype: "Qt3DCore::QNode"
- Property { name: "isShareable"; type: "bool" }
+ defaultProperty: "data"
+ prototype: "Qt3DCore::QComponent"
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
Signal {
- name: "shareableChanged"
- Parameter { name: "isShareable"; type: "bool" }
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
}
- Method {
- name: "setShareable"
- Parameter { name: "isShareable"; type: "bool" }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
}
}
Component { name: "Qt3DCore::QEntity"; prototype: "Qt3DCore::QNode" }
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -35,6 +47,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -44,11 +60,14 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DCore::QTransform"
prototype: "Qt3DCore::QComponent"
- exports: ["Qt3D.Core/Transform 2.0"]
Property { name: "matrix"; type: "QMatrix4x4" }
Property { name: "scale"; type: "float" }
Property { name: "scale3D"; type: "QVector3D" }
@@ -230,10 +249,8 @@ Module {
Component {
name: "Qt3DCore::Quick::Quick3DEntityLoader"
defaultProperty: "data"
- prototype: "Qt3DCore::QEntity"
- exports: ["Qt3D.Core/EntityLoader 2.0"]
- Property { name: "entity"; type: "Qt3DCore::QEntity"; isPointer: true; isReadonly: true }
- Property { name: "source"; type: "QUrl" }
+ prototype: "Qt3DCore::Quick::Quick3DEntityLoader"
+ Property { name: "components"; type: "Qt3DCore::QComponent"; isList: true; isReadonly: true }
}
Component {
name: "Qt3DCore::Quick::Quick3DNode"
@@ -248,13 +265,36 @@ Module {
Component {
name: "Qt3DCore::Quick::Quick3DNodeInstantiator"
defaultProperty: "delegate"
+ prototype: "Qt3DCore::Quick::Quick3DNodeInstantiator"
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ }
+ Component {
+ name: "Qt3DCore::Quick::Quick3DNodeV9"
+ defaultProperty: "data"
prototype: "Qt3DCore::QNode"
- exports: ["Qt3D.Core/NodeInstantiator 2.0"]
- Property { name: "active"; type: "bool" }
- Property { name: "asynchronous"; type: "bool" }
- Property { name: "model"; type: "QVariant" }
- Property { name: "count"; type: "int"; isReadonly: true }
- Property { name: "delegate"; type: "QQmlComponent" }
- Property { name: "object"; type: "QObject"; isReadonly: true }
+ exports: ["Qt3D.Core/Node 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [9]
+ Property { name: "propertyTrackingOverrides"; type: "QJSValue" }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "childNodes"; type: "Qt3DCore::QNode"; isList: true; isReadonly: true }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
+ Signal {
+ name: "propertyTrackingOverridesChanged"
+ Parameter { name: "value"; type: "QJSValue" }
+ }
}
}
diff --git a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
index b72ee9600..3ff63d9d9 100644
--- a/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
+++ b/src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp
@@ -38,14 +38,17 @@
****************************************************************************/
#include "qt3dquick3dcoreplugin.h"
+
#include <Qt3DCore/qtransform.h>
-#include <private/quick3dentity_p.h>
-#include <private/quick3dentityloader_p.h>
-#include <private/quick3dnodeinstantiator_p.h>
-#include <private/qquaternionanimation_p.h>
-#include <private/qt3dquick_global_p.h>
#include <QtCore/qvariantanimation.h>
+#include <Qt3DQuick/private/quick3dnodev9_p.h>
+#include <Qt3DQuick/private/quick3dentity_p.h>
+#include <Qt3DQuick/private/quick3dentityloader_p.h>
+#include <Qt3DQuick/private/quick3dnodeinstantiator_p.h>
+#include <Qt3DQuick/private/qquaternionanimation_p.h>
+#include <Qt3DQuick/private/qt3dquick_global_p.h>
+
QT_BEGIN_NAMESPACE
void Qt3DQuick3DCorePlugin::registerTypes(const char *uri)
@@ -65,6 +68,12 @@ void Qt3DQuick3DCorePlugin::registerTypes(const char *uri)
// Ideally we want to make Node an uncreatable type
// We would need qmlRegisterUncreatableExtendedType for that
qmlRegisterExtendedUncreatableType<Qt3DCore::QNode, Qt3DCore::Quick::Quick3DNode>(uri, 2, 0, "Node", QStringLiteral("Node is a base class"));
+ qmlRegisterExtendedUncreatableType<Qt3DCore::QNode, Qt3DCore::Quick::Quick3DNodeV9, 9>(uri, 2, 9, "Node", QStringLiteral("Node is a base class"));
+}
+
+Qt3DQuick3DCorePlugin::~Qt3DQuick3DCorePlugin()
+{
+ Qt3DCore::Quick::Quick3D_uninitialize();
}
QT_END_NAMESPACE
diff --git a/src/quick3d/imports/core/qt3dquick3dcoreplugin.h b/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
index a9b215c4a..b0ef5947c 100644
--- a/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
+++ b/src/quick3d/imports/core/qt3dquick3dcoreplugin.h
@@ -57,6 +57,7 @@ class Qt3DQuick3DCorePlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
Qt3DQuick3DCorePlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); }
+ ~Qt3DQuick3DCorePlugin();
void registerTypes(const char *uri) Q_DECL_OVERRIDE;
};
diff --git a/src/quick3d/imports/extras/defaults/defaults.pri b/src/quick3d/imports/extras/defaults/defaults.pri
deleted file mode 100644
index 98f542fd6..000000000
--- a/src/quick3d/imports/extras/defaults/defaults.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# When adding new QML files that should be built into the plugin,
-# add them to this variable and they will be listed into a generated
-# resource file.
-#
-# To have the plugin register them as types, add an entries to the
-# qmldir array in qt3dquick3dextrasplugin.cpp
-QML_FILES = \
- $$PWD/qml/DefaultEffect.qml \
- $$PWD/qml/DefaultAlphaEffect.qml \
- $$PWD/qml/PhongMaterial.qml \
- $$PWD/qml/DiffuseMapMaterial.qml \
- $$PWD/qml/DiffuseSpecularMapMaterial.qml \
- $$PWD/qml/NormalDiffuseMapMaterial.qml \
- $$PWD/qml/NormalDiffuseMapAlphaMaterial.qml \
- $$PWD/qml/NormalDiffuseSpecularMapMaterial.qml \
- $$PWD/qml/ForwardRenderer.qml \
- $$PWD/qml/PerVertexColorMaterial.qml \
- $$PWD/qml/SkyboxEntity.qml \
- $$PWD/qml/GoochMaterial.qml \
- $$PWD/qml/PhongAlphaMaterial.qml \
- $$PWD/qml/TextureMaterial.qml \
- $$PWD/qml/OrbitCameraController.qml \
- $$PWD/qml/FirstPersonCameraController.qml \
- $$PWD/qml/NormalDiffuseMapAlphaEffect.qml \
- $$PWD/qml/LevelOfDetailLoader.qml
diff --git a/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml b/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml
deleted file mode 100644
index c28fda4d1..000000000
--- a/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Effect {
- property string vertexES: "qrc:/shaders/es2/phong.vert"
- property string fragmentES: "qrc:/shaders/es2/phongalpha.frag"
- property string vertex: "qrc:/shaders/gl3/phong.vert"
- property string fragment: "qrc:/shaders/gl3/phongalpha.frag"
- property int sourceRgbArg: BlendEquationArguments.SourceAlpha
- property int destinationRgbArg: BlendEquationArguments.OneMinusSourceAlpha
- property int sourceAlphaArg: BlendEquationArguments.One
- property int destinationAlphaArg: BlendEquationArguments.Zero
- property int blendFunctionArg: BlendEquation.Add
-
- FilterKey {
- id: forward
- name: "renderingStyle"
- value: "forward"
- }
-
- ShaderProgram {
- id: gl2Es2Shader
- vertexShaderCode: loadSource(vertexES)
- fragmentShaderCode: loadSource(fragmentES)
- }
-
- ShaderProgram {
- id: gl3Shader
- vertexShaderCode: loadSource(vertex)
- fragmentShaderCode: loadSource(fragment)
- }
-
- techniques: [
- // OpenGL 3.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.CoreProfile
- majorVersion: 3
- minorVersion: 1
- }
- renderPasses: RenderPass {
- shaderProgram: gl3Shader
- renderStates: [
- BlendEquationArguments {
- sourceRgb: sourceRgbArg
- destinationRgb: destinationRgbArg
- sourceAlpha: sourceAlphaArg
- destinationAlpha: destinationAlphaArg
- },
- BlendEquation {
- blendFunction: blendFunctionArg
- }
- ]
- }
- },
-
- // OpenGL 2.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2Es2Shader
- renderStates: [
- BlendEquationArguments {
- sourceRgb: sourceRgbArg
- destinationRgb: destinationRgbArg
- sourceAlpha: sourceAlphaArg
- destinationAlpha: destinationAlphaArg
- },
- BlendEquation {
- blendFunction: blendFunctionArg
- }
- ]
- }
- },
-
- // OpenGL ES 2
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGLES
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2Es2Shader
- renderStates: [
- BlendEquationArguments {
- sourceRgb: sourceRgbArg
- destinationRgb: destinationRgbArg
- sourceAlpha: sourceAlphaArg
- destinationAlpha: destinationAlphaArg
- },
- BlendEquation {
- blendFunction: blendFunctionArg
- }
- ]
- }
- }
- ]
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml b/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml
deleted file mode 100644
index fed87c94d..000000000
--- a/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Effect {
- property string vertexES: "qrc:/shaders/es2/phong.vert"
- property string fragmentES: "qrc:/shaders/es2/phong.frag"
- property string vertex: "qrc:/shaders/gl3/phong.vert"
- property string fragment: "qrc:/shaders/gl3/phong.frag"
-
- FilterKey {
- id: forward
- name: "renderingStyle"
- value: "forward"
- }
-
- ShaderProgram {
- id: gl2Es2Shader
- vertexShaderCode: loadSource(vertexES)
- fragmentShaderCode: loadSource(fragmentES)
- }
-
- ShaderProgram {
- id: gl3Shader
- vertexShaderCode: loadSource(vertex)
- fragmentShaderCode: loadSource(fragment)
- }
-
- techniques: [
- // OpenGL 3.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.CoreProfile
- majorVersion: 3
- minorVersion: 1
- }
- renderPasses: RenderPass { shaderProgram: gl3Shader }
- },
-
- // OpenGL 2.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass { shaderProgram: gl2Es2Shader }
- },
-
- // OpenGL ES 2
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGLES
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass { shaderProgram: gl2Es2Shader }
- }
- ]
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml
deleted file mode 100644
index 4b49d76de..000000000
--- a/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property alias diffuse: diffuseTextureImage.source
- property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 )
- property real shininess: 150.0
- property real textureScale: 1.0
-
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter {
- name: "diffuseTexture"
- value: Texture2D {
- id: diffuseTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: diffuseTextureImage; }
- }
- },
- Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) },
- Parameter { name: "shininess"; value: root.shininess },
- Parameter { name: "texCoordScale"; value: textureScale }
- ]
-
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/diffusemap.vert"
- fragmentES: "qrc:/shaders/es2/diffusemap.frag"
- vertex: "qrc:/shaders/gl3/diffusemap.vert"
- fragment: "qrc:/shaders/gl3/diffusemap.frag"
- }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml
deleted file mode 100644
index 629cb6d11..000000000
--- a/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property alias diffuse: diffuseTextureImage.source
- property alias specular: specularTextureImage.source
- property real shininess: 150.0
- property real textureScale: 1.0
-
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter {
- name: "diffuseTexture"
- value: Texture2D {
- id: diffuseTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: diffuseTextureImage; }
- }
- },
- Parameter { name: "specularTexture";
- value: Texture2D {
- id: specularTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: specularTextureImage; }
- }
- },
- Parameter { name: "shininess"; value: root.shininess },
- Parameter { name: "texCoordScale"; value: textureScale }
- ]
-
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/diffusemap.vert"
- fragmentES: "qrc:/shaders/es2/diffusespecularmap.frag"
- vertex: "qrc:/shaders/gl3/diffusemap.vert"
- fragment: "qrc:/shaders/gl3/diffusespecularmap.frag"
- }
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml b/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml
deleted file mode 100644
index 1003c0ea0..000000000
--- a/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-import Qt3D.Input 2.0
-import Qt3D.Logic 2.0
-import QtQml 2.2
-
-Entity {
- id: root
- property Camera camera
- property real linearSpeed: 10.0
- property real lookSpeed: 180.0
- property real acceleration: -1.0
- property real deceleration: -1.0
-
- QtObject {
- id: d
- readonly property vector3d firstPersonUp: Qt.vector3d(0, 1, 0)
- readonly property bool leftMouseButtonPressed: leftMouseButtonAction.active
- readonly property real vx: txAxis.value * linearSpeed;
- readonly property real vy: tyAxis.value * linearSpeed;
- readonly property real vz: tzAxis.value * linearSpeed;
- readonly property real dx: rxAxis.value * lookSpeed
- readonly property real dy: ryAxis.value * lookSpeed
- readonly property bool fineMotion: fineMotionAction.active
- }
-
- KeyboardDevice {
- id: keyboardSourceDevice
- }
-
- MouseDevice {
- id: mouseSourceDevice
- sensitivity: d.fineMotion ? 0.01 : 0.1
- }
-
- components: [
-
- LogicalDevice {
- enabled: root.enabled
- actions: [
- Action {
- id: leftMouseButtonAction
- ActionInput {
- sourceDevice: mouseSourceDevice
- buttons: [MouseEvent.LeftButton]
- }
- },
- Action {
- id: fineMotionAction
- ActionInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Shift]
- }
- }
- ] // actions
-
- axes: [
- // Rotation
- Axis {
- id: rxAxis
- AnalogAxisInput {
- sourceDevice: mouseSourceDevice
- axis: MouseDevice.X
- }
- },
- Axis {
- id: ryAxis
- AnalogAxisInput {
- sourceDevice: mouseSourceDevice
- axis: MouseDevice.Y
- }
- },
- // Translation
- Axis {
- id: txAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Left]
- scale: -1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Right]
- scale: 1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- },
- Axis {
- id: tzAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Up]
- scale: 1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Down]
- scale: -1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- },
- Axis {
- id: tyAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_PageUp]
- scale: 1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_PageDown]
- scale: -1.0
- acceleration: root.acceleration
- deceleration: root.deceleration
- }
- }
- ] // axes
- },
-
- FrameAction {
- onTriggered: {
- // The time difference since the last frame is passed in as the
- // argument dt. It is a floating point value in units of seconds.
- root.camera.translate(Qt.vector3d(d.vx, d.vy, d.vz).times(dt))
-
- if (d.leftMouseButtonPressed) {
- root.camera.pan(d.dx * dt, d.firstPersonUp)
- root.camera.tilt(d.dy * dt)
- }
- }
- }
- ] // components
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml b/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml
deleted file mode 100644
index 83655a7bc..000000000
--- a/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.2
-
-Entity {
- id:root
-
- property var sources: []
- readonly property alias entity: loader.entity
- readonly property alias source: loader.source
-
- property alias camera: lod.camera
- property alias currentIndex: lod.currentIndex
- property alias thresholdType: lod.thresholdType
- property alias thresholds: lod.thresholds
- property alias volumeOverride: lod.volumeOverride
-
- EntityLoader {
- id: loader
- components: [
- LevelOfDetail {
- id: lod
- enabled: root.enabled
- currentIndex: -1
- onCurrentIndexChanged: if (currentIndex >= 0 && currentIndex < root.sources.length)
- loader.source = root.sources[currentIndex]
- }
- ]
- }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml
deleted file mode 100644
index e4f038642..000000000
--- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Effect {
- property string vertexES: "qrc:/shaders/es2/normaldiffusemap.vert"
- property string fragmentES: "qrc:/shaders/es2/normaldiffusemapalpha.frag"
- property string vertex: "qrc:/shaders/gl3/normaldiffusemap.vert"
- property string fragment: "qrc:/shaders/gl3/normaldiffusemapalpha.frag"
-
- FilterKey {
- id: forward
- name: "renderingStyle"
- value: "forward"
- }
-
- ShaderProgram {
- id: gl2Es2Shader
- vertexShaderCode: loadSource(vertexES)
- fragmentShaderCode: loadSource(fragmentES)
- }
-
- ShaderProgram {
- id: gl3Shader
- vertexShaderCode: loadSource(vertex)
- fragmentShaderCode: loadSource(fragment)
- }
-
- AlphaCoverage { id: alphaCoverage }
-
- techniques: [
- // OpenGL 3.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.CoreProfile
- majorVersion: 3
- minorVersion: 1
- }
- renderPasses: RenderPass {
- shaderProgram: gl3Shader
- renderStates: [ alphaCoverage ]
- }
- },
-
- // OpenGL 2.1
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2Es2Shader
- renderStates: [ alphaCoverage ]
- }
- },
-
- // OpenGL ES 2
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGLES
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2Es2Shader
- renderStates: [ alphaCoverage ]
- }
- }
- ]
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml
deleted file mode 100644
index 421cc3aa9..000000000
--- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property alias diffuse: diffuseTextureImage.source
- property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 )
- property alias normal: normalTextureImage.source
- property real shininess: 150.0
- property real textureScale: 1.0
-
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter {
- name: "diffuseTexture"
- value: Texture2D {
- id: diffuseTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: diffuseTextureImage; }
- }
- },
- Parameter {
- name: "normalTexture"
- value: Texture2D {
- id: normalTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: normalTextureImage; }
- }
- },
- Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) },
- Parameter { name: "shininess"; value: root.shininess },
- Parameter { name: "texCoordScale"; value: textureScale }
- ]
-
- effect: NormalDiffuseMapAlphaEffect { }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml
deleted file mode 100644
index 0724cf597..000000000
--- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property alias diffuse: diffuseTextureImage.source
- property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 )
- property alias normal: normalTextureImage.source
- property real shininess: 150.0
- property real textureScale: 1.0
-
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter {
- name: "diffuseTexture"
- value: Texture2D {
- id: diffuseTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: diffuseTextureImage; }
- }
- },
- Parameter {
- name: "normalTexture"
- value: Texture2D {
- id: normalTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: normalTextureImage; }
- }
- },
- Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) },
- Parameter { name: "shininess"; value: root.shininess },
- Parameter { name: "texCoordScale"; value: textureScale }
- ]
-
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/normaldiffusemap.vert"
- fragmentES: "qrc:/shaders/es2/normaldiffusemap.frag"
- vertex: "qrc:/shaders/gl3/normaldiffusemap.vert"
- fragment: "qrc:/shaders/gl3/normaldiffusemap.frag"
- }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml
deleted file mode 100644
index 497209c32..000000000
--- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property alias diffuse: diffuseTextureImage.source
- property alias specular: specularTextureImage.source
- property alias normal: normalTextureImage.source
- property real shininess: 150.0
- property real textureScale: 1.0
-
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter {
- name: "diffuseTexture"
- value: Texture2D {
- id: diffuseTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: diffuseTextureImage; }
- }
- },
- Parameter { name: "specularTexture";
- value: Texture2D {
- id: specularTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: specularTextureImage; }
- }
- },
- Parameter {
- name: "normalTexture"
- value: Texture2D {
- id: normalTexture
- minificationFilter: Texture.LinearMipMapLinear
- magnificationFilter: Texture.Linear
- wrapMode {
- x: WrapMode.Repeat
- y: WrapMode.Repeat
- }
- generateMipMaps: true
- maximumAnisotropy: 16.0
- TextureImage { id: normalTextureImage; }
- }
- },
- Parameter { name: "shininess"; value: root.shininess },
- Parameter { name: "texCoordScale"; value: textureScale }
- ]
-
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/normaldiffusemap.vert"
- fragmentES: "qrc:/shaders/es2/normaldiffusespecularmap.frag"
- vertex: "qrc:/shaders/gl3/normaldiffusemap.vert"
- fragment: "qrc:/shaders/gl3/normaldiffusespecularmap.frag"
- }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml b/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml
deleted file mode 100644
index ae8869473..000000000
--- a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml
+++ /dev/null
@@ -1,236 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-import Qt3D.Input 2.0
-import Qt3D.Logic 2.0
-import QtQml 2.2
-
-Entity {
- id: root
- property Camera camera
- property real linearSpeed: 10.0
- property real lookSpeed: 180.0
- property real zoomLimit: 2.0
-
- QtObject {
- id: d
- readonly property vector3d firstPersonUp: Qt.vector3d(0, 1, 0)
- readonly property bool leftMouseButtonPressed: leftMouseButtonAction.active
- readonly property bool rightMouseButtonPressed: rightMouseButtonAction.active
- readonly property bool shiftPressed: shiftAction.active
- readonly property bool altPressed: altAction.active
- property real translationX: clampInputs(leftMouseButtonPressed ? mouseXAxis.value : 0, keyboardXAxis.value) * linearSpeed;
- property real translationY: clampInputs(leftMouseButtonPressed ? mouseYAxis.value : 0, keyboardYAxis.value) * linearSpeed;
- property real translationZ: keyboardZAxis.value * linearSpeed;
- property real orbitX: clampInputs(rightMouseButtonPressed ? mouseXAxis.value : 0, keyboardXAxis.value) * lookSpeed;
- property real orbitY: clampInputs(rightMouseButtonPressed ? mouseYAxis.value : 0, keyboardYAxis.value) * lookSpeed;
- }
-
- function clampInputs(input1, input2) {
- var axisValue = input1 + input2;
- return (axisValue < -1) ? -1 : (axisValue > 1) ? 1 : axisValue;
- }
-
- function zoomDistance(firstPoint, secondPoint) {
- var u = secondPoint.minus(firstPoint); u = u.times(u);
- return u.x + u.y + u.z;
- }
-
- KeyboardDevice {
- id: keyboardSourceDevice
- }
-
- MouseDevice {
- id: mouseSourceDevice
- sensitivity: 0.1
- }
-
- components: [
-
- LogicalDevice {
- enabled: root.enabled
- actions: [
- Action {
- id: leftMouseButtonAction
- ActionInput {
- sourceDevice: mouseSourceDevice
- buttons: [MouseEvent.LeftButton]
- }
- },
- Action {
- id: rightMouseButtonAction
- ActionInput {
- sourceDevice: mouseSourceDevice
- buttons: [MouseEvent.RightButton]
- }
- },
- Action {
- id: shiftAction
- ActionInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Shift]
- }
- },
- Action {
- id: altAction
- ActionInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Alt]
- }
- }
- ] // actions
-
- axes: [
- // Mouse
- Axis {
- id: mouseXAxis
- AnalogAxisInput {
- sourceDevice: mouseSourceDevice
- axis: MouseDevice.X
- }
- },
- Axis {
- id: mouseYAxis
- AnalogAxisInput {
- sourceDevice: mouseSourceDevice
- axis: MouseDevice.Y
- }
- },
- // Keyboard
- Axis {
- id: keyboardXAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Left]
- scale: -1.0
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Right]
- scale: 1.0
- }
- },
- Axis {
- id: keyboardZAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_PageUp]
- scale: 1.0
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_PageDown]
- scale: -1.0
- }
- },
- Axis {
- id: keyboardYAxis
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Up]
- scale: 1.0
- }
- ButtonAxisInput {
- sourceDevice: keyboardSourceDevice
- buttons: [Qt.Key_Down]
- scale: -1.0
- }
- }
- ] // axes
- },
-
- FrameAction {
- onTriggered: {
- // The time difference since the last frame is passed in as the
- // argument dt. It is a floating point value in units of seconds.
-
- // Mouse input
- if (d.leftMouseButtonPressed) {
- if (d.rightMouseButtonPressed) {
- if (zoomDistance(root.camera.position, root.camera.viewCenter) > root.zoomLimit * root.zoomLimit) {
- // Dolly up to limit
- root.camera.translate(Qt.vector3d(0, 0, d.translationY).times(dt), Camera.DontTranslateViewCenter);
- } else {
- // Too close, Dolly backwards
- root.camera.translate(Qt.vector3d(0, 0, -1).times(dt), Camera.DontTranslateViewCenter);
- }
- } else {
- // Translate
- root.camera.translate(Qt.vector3d(d.translationX, d.translationY, 0).times(dt));
- }
- return
- } else if (d.rightMouseButtonPressed) {
- // Orbit
- root.camera.panAboutViewCenter(d.orbitX * dt, d.firstPersonUp);
- root.camera.tiltAboutViewCenter(d.orbitY * dt);
- }
- // Keyboard input
- if (d.altPressed) {
- // Orbit
- root.camera.panAboutViewCenter(d.orbitX * dt, d.firstPersonUp);
- root.camera.tiltAboutViewCenter(d.orbitY * dt);
- } else if (d.shiftPressed) {
- if (zoomDistance(root.camera.position, root.camera.viewCenter) > root.zoomLimit * root.zoomLimit) {
- // Dolly up to limit
- root.camera.translate(Qt.vector3d(0, 0, d.translationY).times(dt), Camera.DontTranslateViewCenter);
- } else {
- // Too close, Dolly backwards
- root.camera.translate(Qt.vector3d(0, 0, -1).times(dt), Camera.DontTranslateViewCenter);
- }
- } else {
- // Translate
- root.camera.translate(Qt.vector3d(d.translationX, d.translationY, d.translationZ).times(dt));
- }
- }
- }
- ] // components
-}
diff --git a/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml b/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml
deleted file mode 100644
index 87373242d..000000000
--- a/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Paul Lemire
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-Material {
- id: root
-
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property color diffuse: Qt.rgba( 0.7, 0.7, 0.7, 1.0 )
- property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 )
- property real shininess: 150.0
- property real alpha: 0.5
-
- property alias sourceRgbArg: alphaEffect.sourceRgbArg
- property alias destinationRgbArg: alphaEffect.destinationRgbArg
- property alias sourceAlphaArg: alphaEffect.sourceAlphaArg
- property alias destinationAlphaArg: alphaEffect.destinationAlphaArg
- property alias blendFunctionArg: alphaEffect.blendFunctionArg
-
- parameters: [
- Parameter { name: "alpha"; value: root.alpha },
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter { name: "kd"; value: Qt.vector3d(root.diffuse.r, root.diffuse.g, root.diffuse.b) },
- Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) },
- Parameter { name: "shininess"; value: root.shininess }
- ]
-
- effect: DefaultAlphaEffect { id: alphaEffect }
-}
-
diff --git a/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml b/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml
deleted file mode 100644
index 00bff6f10..000000000
--- a/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-import Qt3D.Extras 2.0
-
-Entity {
- 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 { mirrored: false; face: Texture.CubeMapPositiveX; source: baseName + "_posx" + extension }
- TextureImage { mirrored: false; face: Texture.CubeMapPositiveY; source: baseName + "_posy" + extension }
- TextureImage { mirrored: false; face: Texture.CubeMapPositiveZ; source: baseName + "_posz" + extension }
- TextureImage { mirrored: false; face: Texture.CubeMapNegativeX; source: baseName + "_negx" + extension }
- TextureImage { mirrored: false; face: Texture.CubeMapNegativeY; source: baseName + "_negy" + extension }
- TextureImage { mirrored: false; face: 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)
- }
-
- Material {
- id: skyboxMaterial
- parameters: Parameter { name: "skyboxTexture"; value: skyboxTexture}
-
- effect: Effect {
- FilterKey {
- id: forward
- name: "renderingStyle"
- value: "forward"
- }
-
- techniques: [
- // GL3 Technique
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.CoreProfile
- majorVersion: 3
- minorVersion: 1
- }
- renderPasses: RenderPass {
- shaderProgram: gl3SkyboxShader
- renderStates: [
- // cull front faces
- CullFace { mode: CullFace.Front },
- DepthTest { depthFunction: DepthTest.LessOrEqual }
- ]
- }
- },
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2es2SkyboxShader
- renderStates: [
- CullFace { mode: CullFace.Front },
- DepthTest { depthFunction: DepthTest.LessOrEqual }
- ]
- }
- },
- Technique {
- filterKeys: [ forward ]
- graphicsApiFilter {
- api: GraphicsApiFilter.OpenGLES
- profile: GraphicsApiFilter.NoProfile
- majorVersion: 2
- minorVersion: 0
- }
- renderPasses: RenderPass {
- shaderProgram: gl2es2SkyboxShader
- renderStates: [
- CullFace { mode: CullFace.Front },
- DepthTest { depthFunction: DepthTest.LessOrEqual }
- ]
- }
- }
- ]
- }
- }
-
- components: [cuboidMesh, skyboxMaterial]
-}
-
diff --git a/src/quick3d/imports/extras/importsextras.pro b/src/quick3d/imports/extras/importsextras.pro
index 6a70238f4..22f753ee0 100644
--- a/src/quick3d/imports/extras/importsextras.pro
+++ b/src/quick3d/imports/extras/importsextras.pro
@@ -14,32 +14,6 @@ HEADERS += \
SOURCES += \
qt3dquick3dextrasplugin.cpp
-load(qml_plugin)
-
-include(./defaults/defaults.pri)
-
-OTHER_FILES += \
- qmldir \
- $$QML_FILES
-
-# Create a resource file for qml files that need to be registered by the plugin
-GENERATED_RESOURCE_FILE = $$OUT_PWD/defaults.qrc
-INCLUDED_RESOURCE_FILES = $$QML_FILES
-RESOURCE_CONTENT = \
- "<RCC>" \
- "<qresource prefix=\"/qt-project.org/imports/Qt3D/Extras/\">"
+OTHER_FILES += qmldir
-for(resourcefile, INCLUDED_RESOURCE_FILES) {
- resourcefileabsolutepath = $$absolute_path($$resourcefile)
- relativepath_in = $$relative_path($$resourcefileabsolutepath, $$_PRO_FILE_PWD_)
- relativepath_out = $$relative_path($$resourcefileabsolutepath, $$OUT_PWD)
- RESOURCE_CONTENT += "<file alias=\"$$relativepath_in\">$$relativepath_out</file>"
-}
-
-RESOURCE_CONTENT += \
- "</qresource>" \
- "</RCC>"
-
-write_file($$GENERATED_RESOURCE_FILE, RESOURCE_CONTENT)|error("Aborting.")
-
-RESOURCES += $$GENERATED_RESOURCE_FILE
+load(qml_plugin)
diff --git a/src/quick3d/imports/extras/plugins.qmltypes b/src/quick3d/imports/extras/plugins.qmltypes
index 6a7e1203d..a623f385c 100644
--- a/src/quick3d/imports/extras/plugins.qmltypes
+++ b/src/quick3d/imports/extras/plugins.qmltypes
@@ -4,10 +4,31 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.9'
Module {
dependencies: ["Qt3D.Logic 2.0"]
+ Component { name: "Qt3DCore::QEntity"; prototype: "Qt3DCore::QNode" }
+ Component {
+ name: "Qt3DExtras::Extras::Quick::Quick3DLevelOfDetailLoader"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/LevelOfDetailLoader 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "sources"; type: "QVariantList" }
+ Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
+ Property { name: "currentIndex"; type: "int" }
+ Property { name: "thresholdType"; type: "Qt3DRender::QLevelOfDetail::ThresholdType" }
+ Property { name: "thresholds"; type: "QVector<qreal>" }
+ Property { name: "volumeOverride"; type: "Qt3DRender::QLevelOfDetailBoundingSphere" }
+ Property { name: "entity"; type: "QObject"; isReadonly: true; isPointer: true }
+ Property { name: "source"; type: "QUrl"; isReadonly: true }
+ Method {
+ name: "createBoundingSphere"
+ type: "Qt3DRender::QLevelOfDetailBoundingSphere"
+ Parameter { name: "center"; type: "QVector3D" }
+ Parameter { name: "radius"; type: "float" }
+ }
+ }
Component {
name: "Qt3DExtras::QConeGeometry"
prototype: "Qt3DRender::QGeometry"
@@ -429,6 +450,723 @@ Module {
}
}
Component {
+ name: "Qt3DExtras::QDiffuseMapMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/DiffuseMapMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "textureScale"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "textureScaleChanged"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "color"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setTextureScale"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QDiffuseSpecularMapMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/DiffuseSpecularMapMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "textureScale"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "textureScaleChanged"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setTextureScale"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QExtrudedTextGeometry"
+ prototype: "Qt3DRender::QGeometry"
+ exports: ["Qt3D.Extras/ExtrudedTextGeometry 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "text"; type: "string" }
+ Property { name: "font"; type: "QFont" }
+ Property { name: "extrusionLength"; type: "float" }
+ Property {
+ name: "positionAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Property {
+ name: "normalAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Property {
+ name: "indexAttribute"
+ type: "Qt3DRender::QAttribute"
+ isReadonly: true
+ isPointer: true
+ }
+ Signal {
+ name: "textChanged"
+ Parameter { name: "text"; type: "string" }
+ }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Signal {
+ name: "depthChanged"
+ Parameter { name: "extrusionLength"; type: "float" }
+ }
+ Method {
+ name: "setText"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "setFont"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Method {
+ name: "setDepth"
+ Parameter { name: "extrusionLength"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QExtrudedTextMesh"
+ prototype: "Qt3DRender::QGeometryRenderer"
+ exports: ["Qt3D.Extras/ExtrudedTextMesh 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "text"; type: "string" }
+ Property { name: "font"; type: "QFont" }
+ Property { name: "depth"; type: "float" }
+ Signal {
+ name: "textChanged"
+ Parameter { name: "text"; type: "string" }
+ }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Signal {
+ name: "depthChanged"
+ Parameter { name: "depth"; type: "float" }
+ }
+ Method {
+ name: "setText"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "setFont"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Method {
+ name: "setDepth"
+ Parameter { name: "depth"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QFirstPersonCameraController"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/FirstPersonCameraController 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
+ Property { name: "linearSpeed"; type: "float" }
+ Property { name: "lookSpeed"; type: "float" }
+ Property { name: "acceleration"; type: "float" }
+ Property { name: "deceleration"; type: "float" }
+ Signal {
+ name: "accelerationChanged"
+ Parameter { name: "acceleration"; type: "float" }
+ }
+ Signal {
+ name: "decelerationChanged"
+ Parameter { name: "deceleration"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QForwardRenderer"
+ prototype: "Qt3DRender::QTechniqueFilter"
+ exports: ["Qt3D.Extras/ForwardRenderer 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "surface"; type: "QObject"; isPointer: true }
+ Property { name: "window"; type: "QObject"; isPointer: true }
+ Property { name: "viewportRect"; type: "QRectF" }
+ Property { name: "clearColor"; type: "QColor" }
+ Property { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true }
+ Property { name: "externalRenderTargetSize"; type: "QSize" }
+ Property { name: "frustumCulling"; type: "bool" }
+ Property { name: "gamma"; revision: 9; type: "float" }
+ Signal {
+ name: "viewportRectChanged"
+ Parameter { name: "viewportRect"; type: "QRectF" }
+ }
+ Signal {
+ name: "clearColorChanged"
+ Parameter { name: "clearColor"; type: "QColor" }
+ }
+ Signal {
+ name: "cameraChanged"
+ Parameter { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "surfaceChanged"
+ Parameter { name: "surface"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "externalRenderTargetSizeChanged"
+ Parameter { name: "size"; type: "QSize" }
+ }
+ Signal {
+ name: "frustumCullingEnabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "gammaChanged"
+ Parameter { name: "gamma"; type: "float" }
+ }
+ Method {
+ name: "setViewportRect"
+ Parameter { name: "viewportRect"; type: "QRectF" }
+ }
+ Method {
+ name: "setClearColor"
+ Parameter { name: "clearColor"; type: "QColor" }
+ }
+ Method {
+ name: "setCamera"
+ Parameter { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true }
+ }
+ Method {
+ name: "setSurface"
+ Parameter { name: "surface"; type: "QObject"; isPointer: true }
+ }
+ Method {
+ name: "setExternalRenderTargetSize"
+ Parameter { name: "size"; type: "QSize" }
+ }
+ Method {
+ name: "setFrustumCullingEnabled"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Method {
+ name: "setGamma"
+ Parameter { name: "gamma"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QGoochMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/GoochMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "diffuse"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "cool"; type: "QColor" }
+ Property { name: "warm"; type: "QColor" }
+ Property { name: "alpha"; type: "float" }
+ Property { name: "beta"; type: "float" }
+ Property { name: "shininess"; type: "float" }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "coolChanged"
+ Parameter { name: "cool"; type: "QColor" }
+ }
+ Signal {
+ name: "warmChanged"
+ Parameter { name: "warm"; type: "QColor" }
+ }
+ Signal {
+ name: "alphaChanged"
+ Parameter { name: "alpha"; type: "float" }
+ }
+ Signal {
+ name: "betaChanged"
+ Parameter { name: "beta"; type: "float" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setCool"
+ Parameter { name: "cool"; type: "QColor" }
+ }
+ Method {
+ name: "setWarm"
+ Parameter { name: "warm"; type: "QColor" }
+ }
+ Method {
+ name: "setAlpha"
+ Parameter { name: "alpha"; type: "float" }
+ }
+ Method {
+ name: "setBeta"
+ Parameter { name: "beta"; type: "float" }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QMetalRoughMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/MetalRoughMaterial 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "baseColor"; type: "QColor" }
+ Property { name: "metalness"; type: "float" }
+ Property { name: "roughness"; type: "float" }
+ Signal {
+ name: "baseColorChanged"
+ Parameter { name: "baseColor"; type: "QColor" }
+ }
+ Signal {
+ name: "metalnessChanged"
+ Parameter { name: "metalness"; type: "float" }
+ }
+ Signal {
+ name: "roughnessChanged"
+ Parameter { name: "roughness"; type: "float" }
+ }
+ Method {
+ name: "setBaseColor"
+ Parameter { name: "baseColor"; type: "QColor" }
+ }
+ Method {
+ name: "setMetalness"
+ Parameter { name: "metalness"; type: "float" }
+ }
+ Method {
+ name: "setRoughness"
+ Parameter { name: "roughness"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QMorphPhongMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/MorphPhongMaterial 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "diffuse"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "interpolator"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "interpolatorChanged"
+ Parameter { name: "interpolator"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setInterpolator"
+ Parameter { name: "interpolator"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QNormalDiffuseMapAlphaMaterial"
+ prototype: "Qt3DExtras::QNormalDiffuseMapMaterial"
+ exports: ["Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "Qt3DExtras::QNormalDiffuseMapMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/NormalDiffuseMapMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "textureScale"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "normalChanged"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "textureScaleChanged"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setNormal"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setTextureScale"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QNormalDiffuseSpecularMapMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "textureScale"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "normalChanged"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "textureScaleChanged"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setNormal"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setTextureScale"
+ Parameter { name: "textureScale"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QOrbitCameraController"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/OrbitCameraController 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
+ Property { name: "linearSpeed"; type: "float" }
+ Property { name: "lookSpeed"; type: "float" }
+ Property { name: "zoomInLimit"; type: "float" }
+ }
+ Component {
+ name: "Qt3DExtras::QPerVertexColorMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/PerVertexColorMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "Qt3DExtras::QPhongAlphaMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/PhongAlphaMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "diffuse"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Property { name: "alpha"; type: "float" }
+ Property { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ Property { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ Property { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ Property {
+ name: "destinationAlphaArg"
+ type: "Qt3DRender::QBlendEquationArguments::Blending"
+ }
+ Property { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Signal {
+ name: "alphaChanged"
+ Parameter { name: "alpha"; type: "float" }
+ }
+ Signal {
+ name: "sourceRgbArgChanged"
+ Parameter { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Signal {
+ name: "destinationRgbArgChanged"
+ Parameter { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Signal {
+ name: "sourceAlphaArgChanged"
+ Parameter { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Signal {
+ name: "destinationAlphaArgChanged"
+ Parameter {
+ name: "destinationAlphaArg"
+ type: "Qt3DRender::QBlendEquationArguments::Blending"
+ }
+ }
+ Signal {
+ name: "blendFunctionArgChanged"
+ Parameter { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setAlpha"
+ Parameter { name: "alpha"; type: "float" }
+ }
+ Method {
+ name: "setSourceRgbArg"
+ Parameter { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Method {
+ name: "setDestinationRgbArg"
+ Parameter { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Method {
+ name: "setSourceAlphaArg"
+ Parameter { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" }
+ }
+ Method {
+ name: "setDestinationAlphaArg"
+ Parameter {
+ name: "destinationAlphaArg"
+ type: "Qt3DRender::QBlendEquationArguments::Blending"
+ }
+ }
+ Method {
+ name: "setBlendFunctionArg"
+ Parameter { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QPhongMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/PhongMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "ambient"; type: "QColor" }
+ Property { name: "diffuse"; type: "QColor" }
+ Property { name: "specular"; type: "QColor" }
+ Property { name: "shininess"; type: "float" }
+ Signal {
+ name: "ambientChanged"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Signal {
+ name: "diffuseChanged"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Signal {
+ name: "shininessChanged"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ Method {
+ name: "setAmbient"
+ Parameter { name: "ambient"; type: "QColor" }
+ }
+ Method {
+ name: "setDiffuse"
+ Parameter { name: "diffuse"; type: "QColor" }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "QColor" }
+ }
+ Method {
+ name: "setShininess"
+ Parameter { name: "shininess"; type: "float" }
+ }
+ }
+ Component {
name: "Qt3DExtras::QPlaneGeometry"
prototype: "Qt3DRender::QGeometry"
exports: ["Qt3D.Extras/PlaneGeometry 2.0"]
@@ -525,6 +1263,39 @@ Module {
}
}
Component {
+ name: "Qt3DExtras::QSkyboxEntity"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/SkyboxEntity 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "baseName"; type: "string" }
+ Property { name: "extension"; type: "string" }
+ Property { name: "gammaCorrect"; revision: 9; type: "bool" }
+ Signal {
+ name: "baseNameChanged"
+ Parameter { name: "path"; type: "string" }
+ }
+ Signal {
+ name: "extensionChanged"
+ Parameter { name: "extension"; type: "string" }
+ }
+ Signal {
+ name: "gammaCorrectEnabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Method {
+ name: "setBaseName"
+ Parameter { name: "path"; type: "string" }
+ }
+ Method {
+ name: "setExtension"
+ Parameter { name: "extension"; type: "string" }
+ }
+ Method {
+ name: "setGammaCorrectEnabled"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ }
+ Component {
name: "Qt3DExtras::QSphereGeometry"
prototype: "Qt3DRender::QGeometry"
exports: ["Qt3D.Extras/SphereGeometry 2.0"]
@@ -639,6 +1410,112 @@ Module {
}
}
Component {
+ name: "Qt3DExtras::QText2DEntity"
+ prototype: "Qt3DCore::QEntity"
+ exports: ["Qt3D.Extras/Text2DEntity 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "font"; type: "QFont" }
+ Property { name: "text"; type: "string" }
+ Property { name: "color"; type: "QColor" }
+ Property { name: "width"; type: "float" }
+ Property { name: "height"; type: "float" }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Signal {
+ name: "colorChanged"
+ Parameter { name: "color"; type: "QColor" }
+ }
+ Signal {
+ name: "textChanged"
+ Parameter { name: "text"; type: "string" }
+ }
+ Signal {
+ name: "widthChanged"
+ Parameter { name: "width"; type: "float" }
+ }
+ Signal {
+ name: "heightChanged"
+ Parameter { name: "height"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QTextureMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/TextureMaterial 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "textureOffset"; type: "QVector2D" }
+ Signal {
+ name: "textureChanged"
+ Parameter { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "textureOffsetChanged"
+ Parameter { name: "textureOffset"; type: "QVector2D" }
+ }
+ Method {
+ name: "setTexture"
+ Parameter { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setTextureOffset"
+ Parameter { name: "textureOffset"; type: "QVector2D" }
+ }
+ }
+ Component {
+ name: "Qt3DExtras::QTexturedMetalRoughMaterial"
+ prototype: "Qt3DRender::QMaterial"
+ exports: ["Qt3D.Extras/TexturedMetalRoughMaterial 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Signal {
+ name: "baseColorChanged"
+ Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "metalnessChanged"
+ Parameter { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "roughnessChanged"
+ Parameter { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "ambientOcclusionChanged"
+ Parameter { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Signal {
+ name: "normalChanged"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setBaseColor"
+ Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setMetalness"
+ Parameter { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setRoughness"
+ Parameter { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setAmbientOcclusion"
+ Parameter { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setNormal"
+ Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ }
+ Component {
name: "Qt3DExtras::QTorusGeometry"
prototype: "Qt3DRender::QGeometry"
exports: ["Qt3D.Extras/TorusGeometry 2.0"]
@@ -746,6 +1623,7 @@ Module {
Parameter { name: "minorRadius"; type: "float" }
}
}
+ Component { name: "Qt3DRender::QFrameGraphNode"; prototype: "Qt3DCore::QNode" }
Component {
name: "Qt3DRender::QGeometry"
prototype: "Qt3DCore::QNode"
@@ -883,306 +1761,8 @@ Module {
}
}
Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/DefaultAlphaEffect 2.0"
- exports: ["Qt3D.Extras/DefaultAlphaEffect 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "vertexES"; type: "string" }
- Property { name: "fragmentES"; type: "string" }
- Property { name: "vertex"; type: "string" }
- Property { name: "fragment"; type: "string" }
- Property { name: "sourceRgbArg"; type: "int" }
- Property { name: "destinationRgbArg"; type: "int" }
- Property { name: "sourceAlphaArg"; type: "int" }
- Property { name: "destinationAlphaArg"; type: "int" }
- Property { name: "blendFunctionArg"; type: "int" }
- }
- Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/DefaultEffect 2.0"
- exports: ["Qt3D.Extras/DefaultEffect 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "vertexES"; type: "string" }
- Property { name: "fragmentES"; type: "string" }
- Property { name: "vertex"; type: "string" }
- Property { name: "fragment"; type: "string" }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/DiffuseMapMaterial 2.0"
- exports: ["Qt3D.Extras/DiffuseMapMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "textureScale"; type: "double" }
- Property { name: "diffuse"; type: "QUrl" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/DiffuseSpecularMapMaterial 2.0"
- exports: ["Qt3D.Extras/DiffuseSpecularMapMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "textureScale"; type: "double" }
- Property { name: "diffuse"; type: "QUrl" }
- Property { name: "specular"; type: "QUrl" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/FirstPersonCameraController 2.0"
- exports: ["Qt3D.Extras/FirstPersonCameraController 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
- Property { name: "linearSpeed"; type: "double" }
- Property { name: "lookSpeed"; type: "double" }
- Property { name: "acceleration"; type: "double" }
- Property { name: "deceleration"; type: "double" }
- }
- Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/ForwardRenderer 2.0"
- exports: ["Qt3D.Extras/ForwardRenderer 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true }
- Property { name: "clearColor"; type: "QColor" }
- Property { name: "viewportRect"; type: "QRectF" }
- Property { name: "window"; type: "QObject"; isPointer: true }
- }
- Component {
+ name: "Qt3DRender::QMaterial"
prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/GoochMaterial 2.0"
- exports: ["Qt3D.Extras/GoochMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "diffuse"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "coolColor"; type: "QColor" }
- Property { name: "warmColor"; type: "QColor" }
- Property { name: "alpha"; type: "double" }
- Property { name: "beta"; type: "double" }
- Property { name: "shininess"; type: "double" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/NormalDiffuseMapAlphaEffect 2.0"
- exports: ["Qt3D.Extras/NormalDiffuseMapAlphaEffect 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "vertexES"; type: "string" }
- Property { name: "fragmentES"; type: "string" }
- Property { name: "vertex"; type: "string" }
- Property { name: "fragment"; type: "string" }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0"
- exports: ["Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "textureScale"; type: "double" }
- Property { name: "diffuse"; type: "QUrl" }
- Property { name: "normal"; type: "QUrl" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/NormalDiffuseMapMaterial 2.0"
- exports: ["Qt3D.Extras/NormalDiffuseMapMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "textureScale"; type: "double" }
- Property { name: "diffuse"; type: "QUrl" }
- Property { name: "normal"; type: "QUrl" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0"
- exports: ["Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "textureScale"; type: "double" }
- Property { name: "diffuse"; type: "QUrl" }
- Property { name: "specular"; type: "QUrl" }
- Property { name: "normal"; type: "QUrl" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QNode"
- name: "Qt3D.Extras/OrbitCameraController 2.0"
- exports: ["Qt3D.Extras/OrbitCameraController 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
- Property { name: "linearSpeed"; type: "double" }
- Property { name: "lookSpeed"; type: "double" }
- Property { name: "zoomLimit"; type: "double" }
- Method {
- name: "clampInputs"
- type: "QVariant"
- Parameter { name: "input1"; type: "QVariant" }
- Parameter { name: "input2"; type: "QVariant" }
- }
- Method {
- name: "zoomDistance"
- type: "QVariant"
- Parameter { name: "firstPoint"; type: "QVariant" }
- Parameter { name: "secondPoint"; type: "QVariant" }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/PerVertexColorMaterial 2.0"
- exports: ["Qt3D.Extras/PerVertexColorMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/PhongAlphaMaterial 2.0"
- exports: ["Qt3D.Extras/PhongAlphaMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "diffuse"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "alpha"; type: "double" }
- Property { name: "sourceRgbArg"; type: "int" }
- Property { name: "destinationRgbArg"; type: "int" }
- Property { name: "sourceAlphaArg"; type: "int" }
- Property { name: "destinationAlphaArg"; type: "int" }
- Property { name: "blendFunctionArg"; type: "int" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/PhongMaterial 2.0"
- exports: ["Qt3D.Extras/PhongMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "ambient"; type: "QColor" }
- Property { name: "diffuse"; type: "QColor" }
- Property { name: "specular"; type: "QColor" }
- Property { name: "shininess"; type: "double" }
- Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
- Signal {
- name: "effectChanged"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- Method {
- name: "setEffect"
- Parameter { name: "effect"; type: "QEffect"; isPointer: true }
- }
- }
- Component {
- prototype: "Qt3DCore::QComponent"
- name: "Qt3D.Extras/TextureMaterial 2.0"
- exports: ["Qt3D.Extras/TextureMaterial 2.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "texture"; type: "Qt3DRender::QTexture2D"; isPointer: true }
- Property { name: "textureOffset"; type: "QVector2D" }
Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
Signal {
name: "effectChanged"
@@ -1193,4 +1773,5 @@ Module {
Parameter { name: "effect"; type: "QEffect"; isPointer: true }
}
}
+ Component { name: "Qt3DRender::QTechniqueFilter"; prototype: "Qt3DRender::QFrameGraphNode" }
}
diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
index 55af6432b..879b79294 100644
--- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
+++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp
@@ -38,69 +38,76 @@
****************************************************************************/
#include "qt3dquick3dextrasplugin.h"
-#include <Qt3DExtras/qcuboidmesh.h>
+
+#include <Qt3DExtras/qconegeometry.h>
#include <Qt3DExtras/qconemesh.h>
+#include <Qt3DExtras/qcuboidgeometry.h>
+#include <Qt3DExtras/qcuboidmesh.h>
+#include <Qt3DExtras/qcylindergeometry.h>
#include <Qt3DExtras/qcylindermesh.h>
+#include <Qt3DExtras/qdiffusemapmaterial.h>
+#include <Qt3DExtras/qdiffusespecularmapmaterial.h>
+#include <Qt3DExtras/qextrudedtextgeometry.h>
+#include <Qt3DExtras/qextrudedtextmesh.h>
+#include <Qt3DExtras/qfirstpersoncameracontroller.h>
+#include <Qt3DExtras/qforwardrenderer.h>
+#include <Qt3DExtras/qgoochmaterial.h>
+#include <Qt3DExtras/qmetalroughmaterial.h>
+#include <Qt3DExtras/qmorphphongmaterial.h>
+#include <Qt3DExtras/qnormaldiffusemapalphamaterial.h>
+#include <Qt3DExtras/qnormaldiffusemapmaterial.h>
+#include <Qt3DExtras/qnormaldiffusespecularmapmaterial.h>
+#include <Qt3DExtras/qorbitcameracontroller.h>
+#include <Qt3DExtras/qpervertexcolormaterial.h>
+#include <Qt3DExtras/qphongalphamaterial.h>
+#include <Qt3DExtras/qphongmaterial.h>
+#include <Qt3DExtras/qplanegeometry.h>
#include <Qt3DExtras/qplanemesh.h>
+#include <Qt3DExtras/qskyboxentity.h>
+#include <Qt3DExtras/qspheregeometry.h>
#include <Qt3DExtras/qspheremesh.h>
-#include <Qt3DExtras/qtorusmesh.h>
+#include <Qt3DExtras/qtext2dentity.h>
+#include <Qt3DExtras/qtexturedmetalroughmaterial.h>
+#include <Qt3DExtras/qtexturematerial.h>
#include <Qt3DExtras/qtorusgeometry.h>
-#include <Qt3DExtras/qspheregeometry.h>
-#include <Qt3DExtras/qcuboidgeometry.h>
-#include <Qt3DExtras/qplanegeometry.h>
-#include <Qt3DExtras/qconegeometry.h>
-#include <Qt3DExtras/qcylindergeometry.h>
-#include <Qt3DExtras/qtext3dgeometry.h>
-#include <Qt3DExtras/qtext3dmesh.h>
-#include <Qt3DExtras/qkeyframeanimation.h>
-#include <Qt3DExtras/qanimationcontroller.h>
-#include <Qt3DExtras/qabstractanimation.h>
-#include <Qt3DExtras/qmorphinganimation.h>
-#include <Qt3DExtras/qanimationgroup.h>
-#include <Qt3DExtras/qmorphtarget.h>
+#include <Qt3DExtras/qtorusmesh.h>
-#include <Qt3DQuickExtras/private/quick3dkeyframeanimation_p.h>
-#include <Qt3DQuickExtras/private/quick3danimationgroup_p.h>
-#include <Qt3DQuickExtras/private/quick3danimationcontroller_p.h>
-#include <Qt3DQuickExtras/private/quick3dmorphtarget_p.h>
-#include <Qt3DQuickExtras/private/quick3dmorphinganimation_p.h>
+#include <Qt3DQuickExtras/private/quick3dlevelofdetailloader_p.h>
#include <QtQml/qqml.h>
QT_BEGIN_NAMESPACE
-static const struct {
- const char *type;
- int major, minor;
-} qmldir [] = {
- // Materials
- { "PhongMaterial", 2, 0 },
- { "PhongAlphaMaterial", 2, 0 },
- { "DiffuseMapMaterial", 2, 0 },
- { "DiffuseSpecularMapMaterial", 2, 0 },
- { "NormalDiffuseMapAlphaMaterial", 2, 0 },
- { "NormalDiffuseMapMaterial", 2, 0 },
- { "NormalDiffuseSpecularMapMaterial", 2, 0 },
- { "PerVertexColorMaterial", 2, 0 },
- { "GoochMaterial", 2, 0 },
- { "TextureMaterial", 2, 0 },
- // Effects
- { "DefaultEffect", 2, 0 },
- { "DefaultAlphaEffect", 2, 0 },
- { "NormalDiffuseMapAlphaEffect", 2, 0 },
- // Scene Graph
- { "LevelOfDetailLoader", 2, 2 },
- // FrameGraphs
- { "ForwardRenderer", 2, 0 },
+void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri)
+{
+ // Framegraphs
+ qmlRegisterType<Qt3DExtras::QForwardRenderer>(uri, 2, 0, "ForwardRenderer");
+ qmlRegisterRevision<Qt3DExtras::QForwardRenderer, 9>(uri, 2, 9);
+
// Entities
- { "SkyboxEntity", 2, 0 },
+ qmlRegisterType<Qt3DExtras::QSkyboxEntity>(uri, 2, 0, "SkyboxEntity");
+ qmlRegisterRevision<Qt3DExtras::QSkyboxEntity, 9>(uri, 2, 9);
+ qmlRegisterType<Qt3DExtras::Extras::Quick::Quick3DLevelOfDetailLoader>(uri, 2, 9, "LevelOfDetailLoader");
+
// Camera Controllers
- { "OrbitCameraController", 2, 0 },
- { "FirstPersonCameraController", 2, 0 },
-};
+ qmlRegisterType<Qt3DExtras::QFirstPersonCameraController>(uri, 2, 0, "FirstPersonCameraController");
+ qmlRegisterType<Qt3DExtras::QOrbitCameraController>(uri, 2, 0, "OrbitCameraController");
+
+ // Materials
+ qmlRegisterType<Qt3DExtras::QPhongMaterial>(uri, 2, 0, "PhongMaterial");
+ qmlRegisterType<Qt3DExtras::QPhongAlphaMaterial>(uri, 2, 0, "PhongAlphaMaterial");
+ qmlRegisterType<Qt3DExtras::QDiffuseMapMaterial>(uri, 2, 0, "DiffuseMapMaterial");
+ qmlRegisterType<Qt3DExtras::QDiffuseSpecularMapMaterial>(uri, 2, 0, "DiffuseSpecularMapMaterial");
+ qmlRegisterType<Qt3DExtras::QNormalDiffuseMapAlphaMaterial>(uri, 2, 0, "NormalDiffuseMapAlphaMaterial");
+ qmlRegisterType<Qt3DExtras::QNormalDiffuseMapMaterial>(uri, 2, 0, "NormalDiffuseMapMaterial");
+ qmlRegisterType<Qt3DExtras::QNormalDiffuseSpecularMapMaterial>(uri, 2, 0, "NormalDiffuseSpecularMapMaterial");
+ qmlRegisterType<Qt3DExtras::QPerVertexColorMaterial>(uri, 2, 0, "PerVertexColorMaterial");
+ qmlRegisterType<Qt3DExtras::QGoochMaterial>(uri, 2, 0, "GoochMaterial");
+ qmlRegisterType<Qt3DExtras::QTextureMaterial>(uri, 2, 0, "TextureMaterial");
+ qmlRegisterType<Qt3DExtras::QMetalRoughMaterial>(uri, 2, 9, "MetalRoughMaterial");
+ qmlRegisterType<Qt3DExtras::QTexturedMetalRoughMaterial>(uri, 2, 9, "TexturedMetalRoughMaterial");
+ qmlRegisterType<Qt3DExtras::QMorphPhongMaterial>(uri, 2, 9, "MorphPhongMaterial");
-void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri)
-{
// Meshes
qmlRegisterType<Qt3DExtras::QConeMesh>(uri, 2, 0, "ConeMesh");
qmlRegisterType<Qt3DExtras::QConeGeometry>(uri, 2, 0, "ConeGeometry");
@@ -109,31 +116,19 @@ void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri)
qmlRegisterType<Qt3DExtras::QCylinderMesh>(uri, 2, 0, "CylinderMesh");
qmlRegisterType<Qt3DExtras::QCylinderGeometry>(uri, 2, 0, "CylinderGeometry");
qmlRegisterType<Qt3DExtras::QPlaneMesh>(uri, 2, 0, "PlaneMesh");
+ qmlRegisterRevision<Qt3DExtras::QPlaneMesh, 9>(uri, 2, 9);
qmlRegisterType<Qt3DExtras::QPlaneGeometry>(uri, 2, 0, "PlaneGeometry");
+ qmlRegisterRevision<Qt3DExtras::QPlaneGeometry, 9>(uri, 2, 9);
qmlRegisterType<Qt3DExtras::QTorusMesh>(uri, 2, 0, "TorusMesh");
qmlRegisterType<Qt3DExtras::QTorusGeometry>(uri, 2, 0, "TorusGeometry");
qmlRegisterType<Qt3DExtras::QSphereMesh>(uri, 2, 0, "SphereMesh");
qmlRegisterType<Qt3DExtras::QSphereGeometry>(uri, 2, 0, "SphereGeometry");
// 3D Text
- qmlRegisterType<Qt3DExtras::QText3DGeometry>(uri, 2, 2, "Text3DGeometry");
- qmlRegisterType<Qt3DExtras::QText3DMesh>(uri, 2, 2, "Text3DMesh");
-
- qmlRegisterUncreatableType<Qt3DExtras::QAbstractAnimation>(uri, 2, 0, "AbstractAnimation", QStringLiteral("AbstractAnimation is abstract"));
- qmlRegisterExtendedType<Qt3DExtras::QKeyframeAnimation, Qt3DExtras::Quick::QQuick3DKeyframeAnimation>(uri, 2, 2, "KeyframeAnimation");
- qmlRegisterExtendedType<Qt3DExtras::QAnimationGroup, Qt3DExtras::Quick::QQuick3DAnimationGroup>(uri, 2, 2, "AnimationGroup");
- qmlRegisterExtendedType<Qt3DExtras::QAnimationController, Qt3DExtras::Quick::QQuick3DAnimationController>(uri, 2, 2, "AnimationController");
- qmlRegisterExtendedType<Qt3DExtras::QMorphingAnimation, Qt3DExtras::Quick::QQuick3DMorphingAnimation>(uri, 2, 2, "MorphingAnimation");
- qmlRegisterExtendedType<Qt3DExtras::QMorphTarget, Qt3DExtras::Quick::QQuick3DMorphTarget>(uri, 2, 2, "MorphTarget");
+ qmlRegisterType<Qt3DExtras::QExtrudedTextGeometry>(uri, 2, 9, "ExtrudedTextGeometry");
+ qmlRegisterType<Qt3DExtras::QExtrudedTextMesh>(uri, 2, 9, "ExtrudedTextMesh");
- // Register types provided as QML files compiled into the plugin
- for (int i = 0; i < int(sizeof(qmldir) / sizeof(qmldir[0])); i++) {
- auto path = QLatin1String("qrc:/qt-project.org/imports/Qt3D/Extras/defaults/qml/");
- qmlRegisterType(QUrl(path + qmldir[i].type + QLatin1String(".qml")),
- uri,
- qmldir[i].major, qmldir[i].minor,
- qmldir[i].type);
- }
+ qmlRegisterType<Qt3DExtras::QText2DEntity>(uri, 2, 9, "Text2DEntity");
}
diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h
index f5ea6a7f1..f24a93b3f 100644
--- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h
+++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h
@@ -46,7 +46,6 @@ static void initResources()
{
#ifdef QT_STATIC
Q_INIT_RESOURCE(qmake_Qt3D_Extras);
- Q_INIT_RESOURCE(defaults);
Q_INIT_RESOURCE(extras);
#endif
}
diff --git a/src/quick3d/imports/input/plugins.qmltypes b/src/quick3d/imports/input/plugins.qmltypes
index 860ab4d68..24655977e 100644
--- a/src/quick3d/imports/input/plugins.qmltypes
+++ b/src/quick3d/imports/input/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Input 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Input 2.1'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
prototype: "Qt3DCore::QNode"
@@ -16,6 +16,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -24,8 +32,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -34,6 +51,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -43,6 +64,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DInput::Input::Quick::Quick3DAction"
@@ -101,6 +126,7 @@ Module {
name: "Qt3DInput::Input::Quick::Quick3DPhysicalDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
exports: ["Qt3D.Input/QAbstractPhysicalDevice 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "axisSettings"; type: "Qt3DInput::QAxisSetting"; isList: true; isReadonly: true }
}
@@ -186,6 +212,56 @@ Module {
}
}
Component {
+ name: "Qt3DInput::QAxisAccumulator"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Input/AxisAccumulator 2.1"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "SourceAxisType"
+ values: {
+ "Velocity": 0,
+ "Acceleration": 1
+ }
+ }
+ Property { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ Property { name: "sourceAxisType"; type: "SourceAxisType" }
+ Property { name: "scale"; type: "float" }
+ Property { name: "value"; type: "float"; isReadonly: true }
+ Property { name: "velocity"; type: "float"; isReadonly: true }
+ Signal {
+ name: "sourceAxisChanged"
+ Parameter { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ }
+ Signal {
+ name: "sourceAxisTypeChanged"
+ Parameter { name: "sourceAxisType"; type: "QAxisAccumulator::SourceAxisType" }
+ }
+ Signal {
+ name: "valueChanged"
+ Parameter { name: "value"; type: "float" }
+ }
+ Signal {
+ name: "velocityChanged"
+ Parameter { name: "value"; type: "float" }
+ }
+ Signal {
+ name: "scaleChanged"
+ Parameter { name: "scale"; type: "float" }
+ }
+ Method {
+ name: "setSourceAxis"
+ Parameter { name: "sourceAxis"; type: "Qt3DInput::QAxis"; isPointer: true }
+ }
+ Method {
+ name: "setSourceAxisType"
+ Parameter { name: "sourceAxisType"; type: "QAxisAccumulator::SourceAxisType" }
+ }
+ Method {
+ name: "setScale"
+ Parameter { name: "scale"; type: "float" }
+ }
+ }
+ Component {
name: "Qt3DInput::QAxisSetting"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Input/AxisSetting 2.0"]
@@ -337,7 +413,6 @@ Module {
Component {
name: "Qt3DInput::QKeyboardDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
- exports: ["Qt3D.Input/KeyboardDevice 2.0"]
Property {
name: "activeInput"
type: "Qt3DInput::QKeyboardHandler"
@@ -537,12 +612,13 @@ Module {
Component {
name: "Qt3DInput::QMouseDevice"
prototype: "Qt3DInput::QAbstractPhysicalDevice"
- exports: ["Qt3D.Input/MouseDevice 2.0"]
Enum {
name: "Axis"
values: {
"X": 0,
- "Y": 1
+ "Y": 1,
+ "WheelX": 2,
+ "WheelY": 3
}
}
Property { name: "sensitivity"; type: "float" }
diff --git a/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp b/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
index d31680b4d..5719a2b98 100644
--- a/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
+++ b/src/quick3d/imports/input/qt3dquick3dinputplugin.cpp
@@ -37,29 +37,31 @@
**
****************************************************************************/
-#include <QtQml>
-#include <Qt3DInput/qkeyboarddevice.h>
-#include <Qt3DInput/qkeyboardhandler.h>
-#include <Qt3DInput/qkeyevent.h>
-#include <Qt3DInput/qmousedevice.h>
-#include <Qt3DInput/qmousehandler.h>
-#include <Qt3DInput/qmouseevent.h>
+#include "qt3dquick3dinputplugin.h"
-#include <Qt3DInput/qaxis.h>
-#include <Qt3DInput/qaxisaccumulator.h>
-#include <Qt3DInput/qaxissetting.h>
+#include <Qt3DInput/qabstractphysicaldevice.h>
#include <Qt3DInput/qaction.h>
#include <Qt3DInput/qactioninput.h>
#include <Qt3DInput/qanalogaxisinput.h>
+#include <Qt3DInput/qaxis.h>
+#include <Qt3DInput/qaxisaccumulator.h>
+#include <Qt3DInput/qaxissetting.h>
#include <Qt3DInput/qbuttonaxisinput.h>
-#include <Qt3DInput/qinputsequence.h>
#include <Qt3DInput/qinputchord.h>
-#include <Qt3DInput/qlogicaldevice.h>
-#include <Qt3DInput/qabstractphysicaldevice.h>
+#include <Qt3DInput/qinputsequence.h>
#include <Qt3DInput/qinputsettings.h>
+#include <Qt3DInput/qkeyboarddevice.h>
+#include <Qt3DInput/qkeyboardhandler.h>
+#include <Qt3DInput/qkeyevent.h>
+#include <Qt3DInput/qlogicaldevice.h>
+#include <Qt3DInput/qmousedevice.h>
+#include <Qt3DInput/qmouseevent.h>
+#include <Qt3DInput/qmousehandler.h>
+#include <QtQml>
+
#include <Qt3DInput/private/qgenericinputdevice_p.h>
-#include <Qt3DQuickInput/private/quick3daxis_p.h>
#include <Qt3DQuickInput/private/quick3daction_p.h>
+#include <Qt3DQuickInput/private/quick3daxis_p.h>
#include <Qt3DQuickInput/private/quick3dinputchord_p.h>
#include <Qt3DQuickInput/private/quick3dinputsequence_p.h>
#include <Qt3DQuickInput/private/quick3dlogicaldevice_p.h>
@@ -69,8 +71,6 @@
# include <Qt3DInput/private/qgamepadinput_p.h>
#endif
-#include "qt3dquick3dinputplugin.h"
-
QT_BEGIN_NAMESPACE
void Qt3DQuick3DInputPlugin::registerTypes(const char *uri)
@@ -81,7 +81,9 @@ void Qt3DQuick3DInputPlugin::registerTypes(const char *uri)
qmlRegisterType<Qt3DInput::QInputSettings>(uri, 2, 0, "InputSettings");
qmlRegisterUncreatableType<Qt3DInput::QMouseEvent>(uri, 2, 0, "MouseEvent", QStringLiteral("Events cannot be created"));
+#if QT_CONFIG(wheelevent)
qmlRegisterUncreatableType<Qt3DInput::QWheelEvent>(uri, 2, 0, "WheelEvent", QStringLiteral("Events cannot be created"));
+#endif
qmlRegisterType<Qt3DInput::QMouseHandler>(uri, 2, 0, "MouseHandler");
qmlRegisterType<Qt3DInput::QMouseDevice>(uri, 2, 0, "MouseDevice");
diff --git a/src/quick3d/imports/logic/plugins.qmltypes b/src/quick3d/imports/logic/plugins.qmltypes
index 0c0ccc847..61b67ca73 100644
--- a/src/quick3d/imports/logic/plugins.qmltypes
+++ b/src/quick3d/imports/logic/plugins.qmltypes
@@ -7,7 +7,7 @@ import QtQuick.tooling 1.2
// 'qmlplugindump -nonrelocatable Qt3D.Logic 2.0'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "Qt3DCore::QComponent"
prototype: "Qt3DCore::QNode"
@@ -16,6 +16,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -24,8 +32,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -34,6 +51,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -43,6 +64,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DLogic::QFrameAction"
diff --git a/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp b/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
index 3f96928b7..f97bc8fc6 100644
--- a/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
+++ b/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
@@ -37,10 +37,11 @@
**
****************************************************************************/
-#include <QtQml>
-#include <Qt3DLogic/qframeaction.h>
#include "qt3dquick3dlogicplugin.h"
+#include <Qt3DLogic/qframeaction.h>
+#include <QtQml>
+
QT_BEGIN_NAMESPACE
void Qt3DQuick3DLogicPlugin::registerTypes(const char *uri)
diff --git a/src/quick3d/imports/render/importsrender.pro b/src/quick3d/imports/render/importsrender.pro
index 442068fe7..cc34ff3df 100644
--- a/src/quick3d/imports/render/importsrender.pro
+++ b/src/quick3d/imports/render/importsrender.pro
@@ -3,7 +3,7 @@ TARGET = quick3drenderplugin
TARGETPATH = Qt3D/Render
IMPORT_VERSION = 2.0
-QT += core-private qml qml-private 3dcore 3drender 3dquick 3dquick-private 3dquickrender-private
+QT += core-private qml qml-private 3dcore 3drender 3drender-private 3dquick 3dquick-private 3dquickrender-private
# Qt3D is free of Q_FOREACH - make sure it stays that way:
DEFINES += QT_NO_FOREACH
diff --git a/src/quick3d/imports/render/plugins.qmltypes b/src/quick3d/imports/render/plugins.qmltypes
index 9e6e5fe38..aa0272430 100644
--- a/src/quick3d/imports/render/plugins.qmltypes
+++ b/src/quick3d/imports/render/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt3D.Render 2.0'
+// 'qmlplugindump -nonrelocatable Qt3D.Render 2.9'
Module {
- dependencies: ["QtQuick 2.7"]
+ dependencies: ["QtQuick 2.8"]
Component {
name: "QWindow"
prototype: "QObject"
@@ -25,6 +25,13 @@ Module {
"FullScreen": 5
}
}
+ Enum {
+ name: "AncestorMode"
+ values: {
+ "ExcludeTransients": 0,
+ "IncludeTransients": 1
+ }
+ }
Property { name: "title"; type: "string" }
Property { name: "modality"; type: "Qt::WindowModality" }
Property { name: "flags"; type: "Qt::WindowFlags" }
@@ -178,6 +185,14 @@ Module {
name: "shareableChanged"
Parameter { name: "isShareable"; type: "bool" }
}
+ Signal {
+ name: "addedToEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
+ Signal {
+ name: "removedFromEntity"
+ Parameter { name: "entity"; type: "QEntity"; isPointer: true }
+ }
Method {
name: "setShareable"
Parameter { name: "isShareable"; type: "bool" }
@@ -187,8 +202,17 @@ Module {
Component {
name: "Qt3DCore::QNode"
prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
Signal {
name: "parentChanged"
Parameter { name: "parent"; type: "QObject"; isPointer: true }
@@ -197,6 +221,10 @@ Module {
name: "enabledChanged"
Parameter { name: "enabled"; type: "bool" }
}
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
Signal { name: "nodeDestroyed" }
Method {
name: "setParent"
@@ -206,6 +234,10 @@ Module {
name: "setEnabled"
Parameter { name: "isEnabled"; type: "bool" }
}
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
}
Component {
name: "Qt3DCore::Quick::Quick3DNode"
@@ -404,7 +436,8 @@ Module {
"CubeMapPositiveY": 34071,
"CubeMapNegativeY": 34072,
"CubeMapPositiveZ": 34073,
- "CubeMapNegativeZ": 34074
+ "CubeMapNegativeZ": 34074,
+ "AllFaces": 34075
}
}
Enum {
@@ -446,6 +479,7 @@ Module {
Property { name: "comparisonFunction"; type: "ComparisonFunction" }
Property { name: "comparisonMode"; type: "ComparisonMode" }
Property { name: "layers"; type: "int" }
+ Property { name: "samples"; type: "int" }
Signal {
name: "formatChanged"
Parameter { name: "format"; type: "TextureFormat" }
@@ -494,6 +528,10 @@ Module {
name: "layersChanged"
Parameter { name: "layers"; type: "int" }
}
+ Signal {
+ name: "samplesChanged"
+ Parameter { name: "samples"; type: "int" }
+ }
Method {
name: "setFormat"
Parameter { name: "format"; type: "TextureFormat" }
@@ -538,6 +576,10 @@ Module {
name: "setLayers"
Parameter { name: "layers"; type: "int" }
}
+ Method {
+ name: "setSamples"
+ Parameter { name: "samples"; type: "int" }
+ }
}
Component {
name: "Qt3DRender::QAbstractTextureImage"
@@ -625,7 +667,8 @@ Module {
name: "AttributeType"
values: {
"VertexAttribute": 0,
- "IndexAttribute": 1
+ "IndexAttribute": 1,
+ "DrawIndirectAttribute": 2
}
}
Enum {
@@ -651,6 +694,11 @@ Module {
Property { name: "byteOffset"; type: "uint" }
Property { name: "divisor"; type: "uint" }
Property { name: "attributeType"; type: "AttributeType" }
+ Property { name: "defaultPositionAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultNormalAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultColorAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultTextureCoordinateAttributeName"; type: "string"; isReadonly: true }
+ Property { name: "defaultTangentAttributeName"; type: "string"; isReadonly: true }
Signal {
name: "bufferChanged"
Parameter { name: "buffer"; type: "QBuffer"; isPointer: true }
@@ -660,6 +708,14 @@ Module {
Parameter { name: "name"; type: "string" }
}
Signal {
+ name: "vertexBaseTypeChanged"
+ Parameter { name: "vertexBaseType"; type: "VertexBaseType" }
+ }
+ Signal {
+ name: "vertexSizeChanged"
+ Parameter { name: "vertexSize"; type: "uint" }
+ }
+ Signal {
name: "dataTypeChanged"
Parameter { name: "vertexBaseType"; type: "VertexBaseType" }
}
@@ -696,6 +752,14 @@ Module {
Parameter { name: "name"; type: "string" }
}
Method {
+ name: "setVertexBaseType"
+ Parameter { name: "type"; type: "VertexBaseType" }
+ }
+ Method {
+ name: "setVertexSize"
+ Parameter { name: "size"; type: "uint" }
+ }
+ Method {
name: "setDataType"
Parameter { name: "type"; type: "VertexBaseType" }
}
@@ -780,7 +844,8 @@ Module {
"OneMinusConstantColor": 32770,
"OneMinusConstantAlpha": 32772,
"OneMinusSource1Alpha": 32773,
- "OneMinusSource1Color": 32774
+ "OneMinusSource1Color": 32774,
+ "OneMinusSource1Color0": 32774
}
}
Property { name: "sourceRgb"; type: "Blending" }
@@ -848,6 +913,9 @@ Module {
Component {
name: "Qt3DRender::QBuffer"
prototype: "Qt3DCore::QNode"
+ exports: ["Qt3D.Render/BufferBase 2.0", "Qt3D.Render/BufferBase 2.9"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0, 9]
Enum {
name: "BufferType"
values: {
@@ -856,7 +924,8 @@ Module {
"PixelPackBuffer": 35051,
"PixelUnpackBuffer": 35052,
"UniformBuffer": 35345,
- "ShaderStorageBuffer": 37074
+ "ShaderStorageBuffer": 37074,
+ "DrawIndirectBuffer": 36671
}
}
Enum {
@@ -873,9 +942,18 @@ Module {
"DynamicCopy": 35050
}
}
+ Enum {
+ name: "AccessType"
+ values: {
+ "Write": 1,
+ "Read": 2,
+ "ReadWrite": 3
+ }
+ }
Property { name: "type"; type: "BufferType" }
Property { name: "usage"; type: "UsageType" }
Property { name: "syncData"; type: "bool" }
+ Property { name: "accessType"; revision: 9; type: "AccessType" }
Signal {
name: "dataChanged"
Parameter { name: "bytes"; type: "QByteArray" }
@@ -892,6 +970,11 @@ Module {
name: "syncDataChanged"
Parameter { name: "syncData"; type: "bool" }
}
+ Signal {
+ name: "accessTypeChanged"
+ Parameter { name: "access"; type: "AccessType" }
+ }
+ Signal { name: "dataAvailable" }
Method {
name: "setType"
Parameter { name: "type"; type: "BufferType" }
@@ -904,6 +987,21 @@ Module {
name: "setSyncData"
Parameter { name: "syncData"; type: "bool" }
}
+ Method {
+ name: "setAccessType"
+ Parameter { name: "access"; type: "AccessType" }
+ }
+ Method {
+ name: "updateData"
+ Parameter { name: "offset"; type: "int" }
+ Parameter { name: "bytes"; type: "QByteArray" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::QBufferCapture"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ exports: ["Qt3D.Render/BufferCapture 2.9"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "Qt3DRender::QCamera"
@@ -927,6 +1025,7 @@ Module {
Property { name: "bottom"; type: "float" }
Property { name: "top"; type: "float" }
Property { name: "projectionMatrix"; type: "QMatrix4x4" }
+ Property { name: "exposure"; revision: 9; type: "float" }
Property { name: "position"; type: "QVector3D" }
Property { name: "upVector"; type: "QVector3D" }
Property { name: "viewCenter"; type: "QVector3D" }
@@ -973,6 +1072,10 @@ Module {
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
Signal {
+ name: "exposureChanged"
+ Parameter { name: "exposure"; type: "float" }
+ }
+ Signal {
name: "positionChanged"
Parameter { name: "position"; type: "QVector3D" }
}
@@ -1029,6 +1132,10 @@ Module {
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
Method {
+ name: "setExposure"
+ Parameter { name: "exposure"; type: "float" }
+ }
+ Method {
name: "setPosition"
Parameter { name: "position"; type: "QVector3D" }
}
@@ -1146,6 +1253,7 @@ Module {
Property { name: "bottom"; type: "float" }
Property { name: "top"; type: "float" }
Property { name: "projectionMatrix"; type: "QMatrix4x4" }
+ Property { name: "exposure"; revision: 9; type: "float" }
Signal {
name: "projectionTypeChanged"
Parameter { name: "projectionType"; type: "QCameraLens::ProjectionType" }
@@ -1186,6 +1294,10 @@ Module {
name: "projectionMatrixChanged"
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
+ Signal {
+ name: "exposureChanged"
+ Parameter { name: "exposure"; type: "float" }
+ }
Method {
name: "setProjectionType"
Parameter { name: "projectionType"; type: "ProjectionType" }
@@ -1226,6 +1338,10 @@ Module {
name: "setProjectionMatrix"
Parameter { name: "projectionMatrix"; type: "QMatrix4x4" }
}
+ Method {
+ name: "setExposure"
+ Parameter { name: "exposure"; type: "float" }
+ }
}
Component {
name: "Qt3DRender::QCameraSelector"
@@ -1496,6 +1612,34 @@ Module {
}
Component { name: "Qt3DRender::QEffect"; prototype: "Qt3DCore::QNode" }
Component {
+ name: "Qt3DRender::QEnvironmentLight"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Render/EnvironmentLight 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "irradiance"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ Signal {
+ name: "irradianceChanged"
+ Parameter {
+ name: "environmentIrradiance"
+ type: "Qt3DRender::QAbstractTexture"
+ isPointer: true
+ }
+ }
+ Signal {
+ name: "specularChanged"
+ Parameter { name: "environmentSpecular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setIrradiance"
+ Parameter { name: "irradiance"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ Method {
+ name: "setSpecular"
+ Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true }
+ }
+ }
+ Component {
name: "Qt3DRender::QFilterKey"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Render/FilterKey 2.0"]
@@ -1523,7 +1667,6 @@ Module {
name: "Qt3DRender::QFrameGraphNode"
prototype: "Qt3DCore::QNode"
exports: ["Qt3D.Render/FrameGraphNode 2.0"]
- isCreatable: false
exportMetaObjectRevisions: [0]
}
Component {
@@ -1776,6 +1919,76 @@ Module {
}
Component { name: "Qt3DRender::QLayerFilter"; prototype: "Qt3DRender::QFrameGraphNode" }
Component {
+ name: "Qt3DRender::QLevelOfDetail"
+ prototype: "Qt3DCore::QComponent"
+ exports: ["Qt3D.Render/LevelOfDetail 2.9"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "ThresholdType"
+ values: {
+ "DistanceToCameraThreshold": 0,
+ "ProjectedScreenPixelSizeThreshold": 1
+ }
+ }
+ Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true }
+ Property { name: "currentIndex"; type: "int" }
+ Property { name: "thresholdType"; type: "ThresholdType" }
+ Property { name: "thresholds"; type: "QVector<qreal>" }
+ Property { name: "volumeOverride"; type: "Qt3DRender::QLevelOfDetailBoundingSphere" }
+ Signal {
+ name: "cameraChanged"
+ Parameter { name: "camera"; type: "QCamera"; isPointer: true }
+ }
+ Signal {
+ name: "currentIndexChanged"
+ Parameter { name: "currentIndex"; type: "int" }
+ }
+ Signal {
+ name: "thresholdTypeChanged"
+ Parameter { name: "thresholdType"; type: "ThresholdType" }
+ }
+ Signal {
+ name: "thresholdsChanged"
+ Parameter { name: "thresholds"; type: "QVector<qreal>" }
+ }
+ Signal {
+ name: "volumeOverrideChanged"
+ Parameter { name: "volumeOverride"; type: "QLevelOfDetailBoundingSphere" }
+ }
+ Method {
+ name: "setCamera"
+ Parameter { name: "camera"; type: "QCamera"; isPointer: true }
+ }
+ Method {
+ name: "setCurrentIndex"
+ Parameter { name: "currentIndex"; type: "int" }
+ }
+ Method {
+ name: "setThresholdType"
+ Parameter { name: "thresholdType"; type: "ThresholdType" }
+ }
+ Method {
+ name: "setThresholds"
+ Parameter { name: "thresholds"; type: "QVector<qreal>" }
+ }
+ Method {
+ name: "setVolumeOverride"
+ Parameter { name: "volumeOverride"; type: "QLevelOfDetailBoundingSphere" }
+ }
+ Method {
+ name: "createBoundingSphere"
+ type: "QLevelOfDetailBoundingSphere"
+ Parameter { name: "center"; type: "QVector3D" }
+ Parameter { name: "radius"; type: "float" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::QLevelOfDetailSwitch"
+ prototype: "Qt3DRender::QLevelOfDetail"
+ exports: ["Qt3D.Render/LevelOfDetailSwitch 2.9"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "Qt3DRender::QMaterial"
prototype: "Qt3DCore::QComponent"
Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true }
@@ -1789,6 +2002,39 @@ Module {
}
}
Component {
+ name: "Qt3DRender::QMemoryBarrier"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ Enum {
+ name: "Operation"
+ values: {
+ "None": 0,
+ "VertexAttributeArray": 1,
+ "ElementArray": 2,
+ "Uniform": 4,
+ "TextureFetch": 8,
+ "ShaderImageAccess": 16,
+ "Command": 32,
+ "PixelBuffer": 64,
+ "TextureUpdate": 128,
+ "BufferUpdate": 256,
+ "FrameBuffer": 512,
+ "TransformFeedback": 1024,
+ "AtomicCounter": 2048,
+ "ShaderStorage": 4096,
+ "QueryBuffer": 8192,
+ "All": -1
+ }
+ }
+ Signal {
+ name: "waitOperationsChanged"
+ Parameter { name: "barrierTypes"; type: "QMemoryBarrier::Operations" }
+ }
+ Method {
+ name: "setWaitOperations"
+ Parameter { name: "operations"; type: "QMemoryBarrier::Operations" }
+ }
+ }
+ Component {
name: "Qt3DRender::QMesh"
prototype: "Qt3DRender::QGeometryRenderer"
exports: ["Qt3D.Render/Mesh 2.0"]
@@ -1913,11 +2159,35 @@ Module {
exports: ["Qt3D.Render/PickEvent 2.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
+ Enum {
+ name: "Buttons"
+ values: {
+ "LeftButton": 1,
+ "RightButton": 2,
+ "MiddleButton": 4,
+ "BackButton": 8,
+ "NoButton": 0
+ }
+ }
+ Enum {
+ name: "Modifiers"
+ values: {
+ "NoModifier": 0,
+ "ShiftModifier": 33554432,
+ "ControlModifier": 67108864,
+ "AltModifier": 134217728,
+ "MetaModifier": 268435456,
+ "KeypadModifier": 536870912
+ }
+ }
Property { name: "accepted"; type: "bool" }
Property { name: "position"; type: "QPointF"; isReadonly: true }
Property { name: "distance"; type: "float"; isReadonly: true }
Property { name: "localIntersection"; type: "QVector3D"; isReadonly: true }
Property { name: "worldIntersection"; type: "QVector3D"; isReadonly: true }
+ Property { name: "button"; type: "Qt3DRender::QPickEvent::Buttons"; isReadonly: true }
+ Property { name: "buttons"; type: "int"; isReadonly: true }
+ Property { name: "modifiers"; type: "int"; isReadonly: true }
Signal {
name: "acceptedChanged"
Parameter { name: "accepted"; type: "bool" }
@@ -1946,8 +2216,17 @@ Module {
"AllPicks": 1
}
}
+ Enum {
+ name: "FaceOrientationPickingMode"
+ values: {
+ "FrontFace": 1,
+ "BackFace": 2,
+ "FrontAndBackFace": 3
+ }
+ }
Property { name: "pickMethod"; type: "PickMethod" }
Property { name: "pickResultMode"; type: "PickResultMode" }
+ Property { name: "faceOrientationPickingMode"; type: "FaceOrientationPickingMode" }
Signal {
name: "pickMethodChanged"
Parameter { name: "pickMethod"; type: "QPickingSettings::PickMethod" }
@@ -1956,6 +2235,13 @@ Module {
name: "pickResultModeChanged"
Parameter { name: "pickResult"; type: "QPickingSettings::PickResultMode" }
}
+ Signal {
+ name: "faceOrientationPickingModeChanged"
+ Parameter {
+ name: "faceOrientationPickingMode"
+ type: "QPickingSettings::FaceOrientationPickingMode"
+ }
+ }
Method {
name: "setPickMethod"
Parameter { name: "pickMethod"; type: "PickMethod" }
@@ -1964,6 +2250,10 @@ Module {
name: "setPickResultMode"
Parameter { name: "pickResultMode"; type: "PickResultMode" }
}
+ Method {
+ name: "setFaceOrientationPickingMode"
+ Parameter { name: "faceOrientationPickingMode"; type: "FaceOrientationPickingMode" }
+ }
}
Component {
name: "Qt3DRender::QPointLight"
@@ -2054,6 +2344,42 @@ Module {
}
}
Component {
+ name: "Qt3DRender::QRenderCapture"
+ prototype: "Qt3DRender::QFrameGraphNode"
+ exports: ["Qt3D.Render/RenderCapture 2.1"]
+ exportMetaObjectRevisions: [0]
+ Method {
+ name: "requestCapture"
+ type: "Qt3DRender::QRenderCaptureReply*"
+ Parameter { name: "captureId"; type: "int" }
+ }
+ Method { name: "requestCapture"; revision: 9; type: "Qt3DRender::QRenderCaptureReply*" }
+ }
+ Component {
+ name: "Qt3DRender::QRenderCaptureReply"
+ prototype: "QObject"
+ exports: ["Qt3D.Render/RenderCaptureReply 2.1"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "image"; type: "QImage"; isReadonly: true }
+ Property { name: "captureId"; type: "int"; isReadonly: true }
+ Property { name: "complete"; type: "bool"; isReadonly: true }
+ Signal {
+ name: "completeChanged"
+ Parameter { name: "isComplete"; type: "bool" }
+ }
+ Signal { name: "completed" }
+ Method {
+ name: "saveImage"
+ type: "bool"
+ Parameter { name: "fileName"; type: "string" }
+ }
+ Method {
+ name: "saveToFile"
+ Parameter { name: "fileName"; type: "string" }
+ }
+ }
+ Component {
name: "Qt3DRender::QRenderPass"
prototype: "Qt3DCore::QNode"
Property { name: "shaderProgram"; type: "Qt3DRender::QShaderProgram"; isPointer: true }
@@ -2119,7 +2445,7 @@ Module {
exports: ["Qt3D.Render/RenderSurfaceSelector 2.0"]
exportMetaObjectRevisions: [0]
Property { name: "surface"; type: "QObject"; isPointer: true }
- Property { name: "externalRenderTargetSize"; type: "QSize"; isReadonly: true }
+ Property { name: "externalRenderTargetSize"; type: "QSize" }
Property { name: "surfacePixelRatio"; type: "float" }
Signal {
name: "surfaceChanged"
@@ -2141,6 +2467,10 @@ Module {
name: "setSurfacePixelRatio"
Parameter { name: "ratio"; type: "float" }
}
+ Method {
+ name: "setExternalRenderTargetSize"
+ Parameter { name: "size"; type: "QSize" }
+ }
}
Component { name: "Qt3DRender::QRenderTarget"; prototype: "Qt3DCore::QComponent" }
Component {
@@ -2176,7 +2506,7 @@ Module {
Property { name: "texture"; type: "QAbstractTexture"; isPointer: true }
Property { name: "mipLevel"; type: "int" }
Property { name: "layer"; type: "int" }
- Property { name: "face"; type: "QAbstractTexture::CubeMapFace" }
+ Property { name: "face"; type: "Qt3DRender::QAbstractTexture::CubeMapFace" }
Signal {
name: "attachmentPointChanged"
Parameter { name: "attachmentPoint"; type: "AttachmentPoint" }
@@ -2243,6 +2573,17 @@ Module {
"Error": 3
}
}
+ Enum {
+ name: "ComponentType"
+ values: {
+ "UnknownComponent": 0,
+ "GeometryRendererComponent": 1,
+ "TransformComponent": 2,
+ "MaterialComponent": 3,
+ "LightComponent": 4,
+ "CameraLensComponent": 5
+ }
+ }
Property { name: "source"; type: "QUrl" }
Property { name: "status"; type: "Status"; isReadonly: true }
Signal {
@@ -2261,6 +2602,20 @@ Module {
name: "setStatus"
Parameter { name: "status"; type: "Status" }
}
+ Method {
+ name: "entity"
+ revision: 9
+ type: "Qt3DCore::QEntity*"
+ Parameter { name: "entityName"; type: "string" }
+ }
+ Method { name: "entityNames"; revision: 9; type: "QStringList" }
+ Method {
+ name: "component"
+ revision: 9
+ type: "Qt3DCore::QComponent*"
+ Parameter { name: "entityName"; type: "string" }
+ Parameter { name: "componentType"; type: "ComponentType" }
+ }
}
Component {
name: "Qt3DRender::QScissorTest"
@@ -2333,12 +2688,22 @@ Module {
"Compute": 5
}
}
+ Enum {
+ name: "Status"
+ values: {
+ "NotReady": 0,
+ "Ready": 1,
+ "Error": 2
+ }
+ }
Property { name: "vertexShaderCode"; type: "QByteArray" }
Property { name: "tessellationControlShaderCode"; type: "QByteArray" }
Property { name: "tessellationEvaluationShaderCode"; type: "QByteArray" }
Property { name: "geometryShaderCode"; type: "QByteArray" }
Property { name: "fragmentShaderCode"; type: "QByteArray" }
Property { name: "computeShaderCode"; type: "QByteArray" }
+ Property { name: "log"; revision: 9; type: "string"; isReadonly: true }
+ Property { name: "status"; revision: 9; type: "Status"; isReadonly: true }
Signal {
name: "vertexShaderCodeChanged"
Parameter { name: "vertexShaderCode"; type: "QByteArray" }
@@ -2363,6 +2728,14 @@ Module {
name: "computeShaderCodeChanged"
Parameter { name: "computeShaderCode"; type: "QByteArray" }
}
+ Signal {
+ name: "logChanged"
+ Parameter { name: "log"; type: "string" }
+ }
+ Signal {
+ name: "statusChanged"
+ Parameter { name: "status"; type: "Status" }
+ }
Method {
name: "setVertexShaderCode"
Parameter { name: "vertexShaderCode"; type: "QByteArray" }
@@ -2701,6 +3074,7 @@ Module {
}
Property { name: "source"; type: "QUrl" }
Property { name: "status"; type: "Status"; isReadonly: true }
+ Property { name: "mirrored"; type: "bool" }
Signal {
name: "sourceChanged"
Parameter { name: "source"; type: "QUrl" }
@@ -2709,23 +3083,40 @@ Module {
name: "statusChanged"
Parameter { name: "status"; type: "Status" }
}
+ Signal {
+ name: "mirroredChanged"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
}
+ Method {
+ name: "setMirrored"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
}
Component {
name: "Qt3DRender::QTextureLoader"
prototype: "Qt3DRender::QAbstractTexture"
Property { name: "source"; type: "QUrl" }
+ Property { name: "mirrored"; type: "bool" }
Signal {
name: "sourceChanged"
Parameter { name: "source"; type: "QUrl" }
}
+ Signal {
+ name: "mirroredChanged"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
Method {
name: "setSource"
Parameter { name: "source"; type: "QUrl" }
}
+ Method {
+ name: "setMirrored"
+ Parameter { name: "mirrored"; type: "bool" }
+ }
}
Component { name: "Qt3DRender::QTextureRectangle"; prototype: "Qt3DRender::QAbstractTexture" }
Component {
@@ -2774,14 +3165,23 @@ Module {
name: "Qt3DRender::QViewport"
prototype: "Qt3DRender::QFrameGraphNode"
Property { name: "normalizedRect"; type: "QRectF" }
+ Property { name: "gamma"; revision: 9; type: "float" }
Signal {
name: "normalizedRectChanged"
Parameter { name: "normalizedRect"; type: "QRectF" }
}
+ Signal {
+ name: "gammaChanged"
+ Parameter { name: "gamma"; type: "float" }
+ }
Method {
name: "setNormalizedRect"
Parameter { name: "normalizedRect"; type: "QRectF" }
}
+ Method {
+ name: "setGamma"
+ Parameter { name: "gamma"; type: "float" }
+ }
}
Component {
name: "Qt3DRender::Render::Quick::Quick3DBuffer"
@@ -2790,7 +3190,16 @@ Module {
exportMetaObjectRevisions: [0]
Property { name: "data"; type: "QVariant" }
Signal { name: "bufferDataChanged" }
- Signal { name: "bufferDataChanged" }
+ Method {
+ name: "updateData"
+ Parameter { name: "offset"; type: "int" }
+ Parameter { name: "bytes"; type: "QVariant" }
+ }
+ Method {
+ name: "readBinaryFile"
+ type: "QVariant"
+ Parameter { name: "fileUrl"; type: "QUrl" }
+ }
}
Component {
name: "Qt3DRender::Render::Quick::Quick3DEffect"
@@ -2823,6 +3232,13 @@ Module {
Property { name: "parameters"; type: "Qt3DRender::QParameter"; isList: true; isReadonly: true }
}
Component {
+ name: "Qt3DRender::Render::Quick::Quick3DMemoryBarrier"
+ prototype: "Qt3DRender::QMemoryBarrier"
+ exports: ["Qt3D.Render/MemoryBarrier 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "waitFor"; type: "int" }
+ }
+ Component {
name: "Qt3DRender::Render::Quick::Quick3DParameter"
prototype: "Qt3DRender::QParameter"
exports: ["Qt3D.Render/Parameter 2.0"]
@@ -2921,7 +3337,7 @@ Module {
Component {
name: "Qt3DRender::Render::Quick::Quick3DTextureExtension"
defaultProperty: "textureImages"
- prototype: "Qt3DRender::QTextureLoader"
+ prototype: "Qt3DRender::QTextureRectangle"
exports: [
"Qt3D.Render/Texture1D 2.0",
"Qt3D.Render/Texture1DArray 2.0",
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
index c6831dbce..f81b1fa53 100644
--- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
+++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
@@ -39,94 +39,99 @@
****************************************************************************/
#include "qt3dquick3drenderplugin.h"
-#include <Qt3DRender/qsceneloader.h>
-#include <Qt3DRender/qmesh.h>
-#include <Qt3DRender/qrenderpass.h>
-#include <Qt3DRender/qshaderprogram.h>
-#include <Qt3DRender/qviewport.h>
-#include <Qt3DRender/qrenderpassfilter.h>
-#include <Qt3DRender/qtechniquefilter.h>
-#include <Qt3DRender/qrendertargetselector.h>
-#include <Qt3DRender/qrendersurfaceselector.h>
-#include <Qt3DRender/qtexture.h>
-#include <Qt3DRender/qtechnique.h>
+#include <Qt3DRender/qabstractlight.h>
+#include <Qt3DRender/qalphacoverage.h>
+#include <Qt3DRender/qalphatest.h>
+#include <Qt3DRender/qattribute.h>
+#include <Qt3DRender/qblendequation.h>
+#include <Qt3DRender/qblendequationarguments.h>
+#include <Qt3DRender/qbuffer.h>
+#include <Qt3DRender/qbuffercapture.h>
+#include <Qt3DRender/qcamera.h>
+#include <Qt3DRender/qcameralens.h>
#include <Qt3DRender/qcameraselector.h>
+#include <Qt3DRender/qclearbuffers.h>
+#include <Qt3DRender/qclipplane.h>
+#include <Qt3DRender/qcolormask.h>
+#include <Qt3DRender/qcomputecommand.h>
+#include <Qt3DRender/qcullface.h>
+#include <Qt3DRender/qdepthtest.h>
+#include <Qt3DRender/qdirectionallight.h>
+#include <Qt3DRender/qdispatchcompute.h>
+#include <Qt3DRender/qdithering.h>
#include <Qt3DRender/qeffect.h>
-#include <Qt3DRender/qparameter.h>
+#include <Qt3DRender/qenvironmentlight.h>
#include <Qt3DRender/qfilterkey.h>
+#include <Qt3DRender/qfrontface.h>
+#include <Qt3DRender/qfrustumculling.h>
+#include <Qt3DRender/qgeometry.h>
+#include <Qt3DRender/qgeometryrenderer.h>
+#include <Qt3DRender/qgraphicsapifilter.h>
#include <Qt3DRender/qlayer.h>
#include <Qt3DRender/qlevelofdetail.h>
+#include <Qt3DRender/qlevelofdetailboundingsphere.h>
#include <Qt3DRender/qlevelofdetailswitch.h>
-#include <Qt3DRender/qboundingsphere.h>
-#include <Qt3DRender/qabstractlight.h>
-#include <Qt3DRender/qspotlight.h>
-#include <Qt3DRender/qdirectionallight.h>
-#include <Qt3DRender/qpointlight.h>
-#include <Qt3DRender/qgraphicsapifilter.h>
-#include <Qt3DRender/qrenderstate.h>
-#include <Qt3DRender/qblendequationarguments.h>
-#include <Qt3DRender/qblendequation.h>
-#include <Qt3DRender/qalphatest.h>
-#include <Qt3DRender/qdepthtest.h>
-#include <Qt3DRender/qnodepthmask.h>
-#include <Qt3DRender/qcullface.h>
-#include <Qt3DRender/qfrontface.h>
-#include <Qt3DRender/qstenciltest.h>
-#include <Qt3DRender/qstenciltestarguments.h>
-#include <Qt3DRender/qscissortest.h>
-#include <Qt3DRender/qdithering.h>
-#include <Qt3DRender/qrendertargetoutput.h>
-#include <Qt3DRender/qclearbuffers.h>
-#include <Qt3DRender/qalphacoverage.h>
+#include <Qt3DRender/qmemorybarrier.h>
+#include <Qt3DRender/qmesh.h>
#include <Qt3DRender/qmultisampleantialiasing.h>
+#include <Qt3DRender/qnodepthmask.h>
+#include <Qt3DRender/qnodraw.h>
+#include <Qt3DRender/qobjectpicker.h>
+#include <Qt3DRender/qparameter.h>
+#include <Qt3DRender/qpickevent.h>
+#include <Qt3DRender/qpickingsettings.h>
+#include <Qt3DRender/qpointlight.h>
#include <Qt3DRender/qpointsize.h>
#include <Qt3DRender/qpolygonoffset.h>
-#include <Qt3DRender/qcolormask.h>
-#include <Qt3DRender/qshaderdata.h>
-#include <Qt3DRender/qnodraw.h>
-#include <Qt3DRender/qclipplane.h>
+#include <Qt3DRender/qrendercapture.h>
+#include <Qt3DRender/qrenderpass.h>
+#include <Qt3DRender/qrenderpassfilter.h>
+#include <Qt3DRender/qrendersettings.h>
+#include <Qt3DRender/qrenderstate.h>
+#include <Qt3DRender/qrendersurfaceselector.h>
+#include <Qt3DRender/qrendertargetoutput.h>
+#include <Qt3DRender/qrendertargetselector.h>
+#include <Qt3DRender/qsceneloader.h>
+#include <Qt3DRender/qscissortest.h>
#include <Qt3DRender/qseamlesscubemap.h>
+#include <Qt3DRender/qshaderdata.h>
+#include <Qt3DRender/qshaderprogram.h>
#include <Qt3DRender/qsortpolicy.h>
+#include <Qt3DRender/qspotlight.h>
+#include <Qt3DRender/qstencilmask.h>
#include <Qt3DRender/qstenciloperation.h>
#include <Qt3DRender/qstenciloperationarguments.h>
-#include <Qt3DRender/qstencilmask.h>
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qgeometry.h>
-#include <Qt3DRender/qgeometryrenderer.h>
-#include <Qt3DRender/qobjectpicker.h>
-#include <Qt3DRender/qpickevent.h>
-#include <Qt3DRender/qfrustumculling.h>
-#include <Qt3DRender/qdispatchcompute.h>
-#include <Qt3DRender/qcomputecommand.h>
-#include <Qt3DRender/qcameralens.h>
-#include <Qt3DRender/qcamera.h>
-#include <Qt3DRender/qrendersettings.h>
-#include <Qt3DRender/qpickingsettings.h>
-#include <Qt3DRender/qrendercapture.h>
-#include <Qt3DRender/qmemorybarrier.h>
+#include <Qt3DRender/qstenciltest.h>
+#include <Qt3DRender/qstenciltestarguments.h>
+#include <Qt3DRender/qtechnique.h>
+#include <Qt3DRender/qtechniquefilter.h>
+#include <Qt3DRender/qtexture.h>
+#include <Qt3DRender/qviewport.h>
+
+#include <QtGui/qwindow.h>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+#include <Qt3DQuickRender/private/quick3dbuffer_p.h>
+#include <Qt3DQuickRender/private/quick3deffect_p.h>
+#include <Qt3DQuickRender/private/quick3dgeometry_p.h>
#include <Qt3DQuickRender/private/quick3dlayerfilter_p.h>
-#include <Qt3DQuickRender/private/quick3dtechnique_p.h>
#include <Qt3DQuickRender/private/quick3dmaterial_p.h>
-#include <Qt3DQuickRender/private/quick3dtechniquefilter_p.h>
-#include <Qt3DQuickRender/private/quick3dviewport_p.h>
+#include <Qt3DQuickRender/private/quick3dmemorybarrier_p.h>
+#include <Qt3DQuickRender/private/quick3dparameter_p.h>
+#include <Qt3DQuickRender/private/quick3drenderpass_p.h>
#include <Qt3DQuickRender/private/quick3drenderpassfilter_p.h>
#include <Qt3DQuickRender/private/quick3drendertargetoutput_p.h>
-#include <Qt3DQuickRender/private/quick3deffect_p.h>
+#include <Qt3DQuickRender/private/quick3drendertargetselector_p.h>
#include <Qt3DQuickRender/private/quick3dscene_p.h>
-#include <Qt3DQuickRender/private/quick3dtexture_p.h>
-#include <Qt3DQuickRender/private/quick3drenderpass_p.h>
-#include <Qt3DQuickRender/private/quick3dparameter_p.h>
#include <Qt3DQuickRender/private/quick3dshaderdata_p.h>
#include <Qt3DQuickRender/private/quick3dshaderdataarray_p.h>
#include <Qt3DQuickRender/private/quick3dstateset_p.h>
-#include <Qt3DQuickRender/private/quick3drendertargetselector_p.h>
-#include <Qt3DQuickRender/private/quick3dgeometry_p.h>
-#include <Qt3DQuickRender/private/quick3dbuffer_p.h>
-#include <Qt3DQuickRender/private/quick3dmemorybarrier_p.h>
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+#include <Qt3DQuickRender/private/quick3dtechnique_p.h>
+#include <Qt3DQuickRender/private/quick3dtechniquefilter_p.h>
+#include <Qt3DQuickRender/private/quick3dtexture_p.h>
+#include <Qt3DQuickRender/private/quick3dviewport_p.h>
-#include <QtGui/qwindow.h>
QT_BEGIN_NAMESPACE
@@ -155,6 +160,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
// @uri Qt3D.Render
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QSceneLoader, Qt3DRender::Render::Quick::Quick3DScene>("QSceneLoader", "Qt3D.Render/SceneLoader", uri, 2, 0, "SceneLoader");
+ qmlRegisterRevision<Qt3DRender::QSceneLoader, 9>(uri, 2, 9);
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QEffect, Qt3DRender::Render::Quick::Quick3DEffect>("QEffect", "Qt3D.Render/Effect", uri, 2, 0, "Effect");
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QTechnique, Qt3DRender::Render::Quick::Quick3DTechnique>("QTechnique", "Qt3D.Render/Technique", uri, 2, 0, "Technique");
qmlRegisterType<Qt3DRender::QFilterKey>(uri, 2, 0, "FilterKey");
@@ -164,13 +170,16 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QMaterial, Qt3DRender::Render::Quick::Quick3DMaterial>("QMaterial", "Qt3D.Render/Material", uri, 2, 0, "Material");
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QRenderPass, Qt3DRender::Render::Quick::Quick3DRenderPass>("QRenderPass", "Qt3D.Render/RenderPass", uri, 2, 0, "RenderPass");
qmlRegisterType<Qt3DRender::QShaderProgram>(uri, 2, 0, "ShaderProgram");
+ qmlRegisterRevision<Qt3DRender::QShaderProgram, 9>(uri, 2, 9);
qmlRegisterUncreatableType<Qt3DRender::QShaderData>(uri, 2, 0, "QShaderData", "Quick3D should instantiate Quick3DShaderData only");
qmlRegisterType<Qt3DRender::Render::Quick::Quick3DShaderDataArray>(uri, 2, 0, "ShaderDataArray");
qmlRegisterType<Qt3DRender::Render::Quick::Quick3DShaderData>(uri, 2, 0, "ShaderData");
// Camera
qmlRegisterType<Qt3DRender::QCamera>(uri, 2, 0, "Camera");
+ qmlRegisterRevision<Qt3DRender::QCamera, 9>(uri, 2, 9);
qmlRegisterType<Qt3DRender::QCameraLens>(uri, 2, 0, "CameraLens");
+ qmlRegisterRevision<Qt3DRender::QCameraLens, 9>(uri, 2, 9);
// Textures
qmlRegisterType<Qt3DRender::QTextureWrapMode>(uri, 2, 0, "WrapMode");//, QStringLiteral("QTextureWrapMode cannot be created from QML"));
@@ -193,18 +202,20 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
// Geometry
qmlRegisterType<Qt3DRender::QAttribute>(uri, 2, 0, "Attribute");
qmlRegisterUncreatableType<Qt3DRender::QBuffer>(uri, 2, 0, "BufferBase", QStringLiteral("Use Quick3DBuffer in QML"));
+ qmlRegisterUncreatableType<Qt3DRender::QBuffer, 9>(uri, 2, 9, "BufferBase", QStringLiteral("Use Quick3DBuffer in QML"));
qmlRegisterType<Qt3DRender::Render::Quick::Quick3DBuffer>(uri, 2, 0, "Buffer");
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QGeometry, Qt3DRender::Render::Quick::Quick3DGeometry>("QGeometry", "Qt3D.Render/Geometry", uri, 2, 0, "Geometry");
qmlRegisterType<Qt3DRender::QGeometryRenderer>(uri, 2, 0, "GeometryRenderer");
- qmlRegisterType<Qt3DRender::QLevelOfDetail>(uri, 2, 2, "LevelOfDetail");
- qmlRegisterType<Qt3DRender::QLevelOfDetailSwitch>(uri, 2, 2, "LevelOfDetailSwitch");
- qmlRegisterType<Qt3DRender::QBoundingSphere>(uri, 2, 2, "BoundingSphere");
+ qmlRegisterType<Qt3DRender::QLevelOfDetail>(uri, 2, 9, "LevelOfDetail");
+ qmlRegisterType<Qt3DRender::QLevelOfDetailSwitch>(uri, 2, 9, "LevelOfDetailSwitch");
+ qRegisterMetaType<Qt3DRender::QLevelOfDetailBoundingSphere>("LevelOfDetailBoundingSphere");
// Mesh
qmlRegisterType<Qt3DRender::QMesh>(uri, 2, 0, "Mesh");
// Picking
qmlRegisterType<Qt3DRender::QObjectPicker>(uri, 2, 0, "ObjectPicker");
+ qmlRegisterRevision<Qt3DRender::QObjectPicker, 9>(uri, 2, 9);
qmlRegisterUncreatableType<Qt3DRender::QPickEvent>(uri, 2, 0, "PickEvent", QStringLiteral("Events cannot be created"));
// Compute Job
@@ -218,6 +229,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<Qt3DRender::QAbstractLight>(uri, 2, 0, "Light", QStringLiteral("Light is an abstract base class"));
qmlRegisterType<Qt3DRender::QPointLight>(uri, 2, 0, "PointLight");
qmlRegisterType<Qt3DRender::QDirectionalLight>(uri, 2, 0, "DirectionalLight");
+ qmlRegisterType<Qt3DRender::QEnvironmentLight>(uri, 2, 9, "EnvironmentLight");
qmlRegisterType<Qt3DRender::QSpotLight>(uri, 2, 0, "SpotLight");
// FrameGraph
@@ -225,6 +237,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QRenderPassFilter, Qt3DRender::Render::Quick::Quick3DRenderPassFilter>("QRenderPassFilter", "Qt3D.Render/RenderPassFilter", uri, 2, 0, "RenderPassFilter");
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QTechniqueFilter, Qt3DRender::Render::Quick::Quick3DTechniqueFilter>("QTechniqueFilter", "Qt3D.Render/TechniqueFilter", uri, 2, 0, "TechniqueFilter");
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QViewport, Qt3DRender::Render::Quick::Quick3DViewport>("QViewport", "Qt3D.Render/Viewport", uri, 2, 0, "Viewport");
+ qmlRegisterRevision<Qt3DRender::QViewport, 9>(uri, 2, 9);
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QRenderTargetSelector, Qt3DRender::Render::Quick::Quick3DRenderTargetSelector>("QRenderTargetSelector", "Qt3D.Render/RenderTargetSelector", uri, 2, 0, "RenderTargetSelector");
qmlRegisterType<Qt3DRender::QClearBuffers>(uri, 2, 0, "ClearBuffers");
qmlRegisterType<Qt3DRender::QFrameGraphNode>(uri, 2, 0, "FrameGraphNode");
@@ -233,8 +246,10 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
qmlRegisterType<Qt3DRender::QFrustumCulling>(uri, 2, 0, "FrustumCulling");
qmlRegisterType<Qt3DRender::QDispatchCompute>(uri, 2, 0, "DispatchCompute");
qmlRegisterType<Qt3DRender::QRenderCapture>(uri, 2, 1, "RenderCapture");
+ qmlRegisterRevision<Qt3DRender::QRenderCapture, 9>(uri, 2, 9);
qmlRegisterUncreatableType<Qt3DRender::QRenderCaptureReply>(uri, 2, 1, "RenderCaptureReply", QStringLiteral("RenderCaptureReply is only instantiated by RenderCapture"));
- Qt3DRender::Quick::registerExtendedType<Qt3DRender::QMemoryBarrier, Qt3DRender::Render::Quick::Quick3DMemoryBarrier>("QMemoryBarrier", "Qt3D.Render/MemoryBarrier", uri, 2, 0, "MemoryBarrier");
+ qmlRegisterType<Qt3DRender::QBufferCapture>(uri, 2, 9, "BufferCapture");
+ Qt3DRender::Quick::registerExtendedType<Qt3DRender::QMemoryBarrier, Qt3DRender::Render::Quick::Quick3DMemoryBarrier>("QMemoryBarrier", "Qt3D.Render/MemoryBarrier", uri, 2, 9, "MemoryBarrier");
// RenderTarget
qmlRegisterType<Qt3DRender::QRenderTargetOutput>(uri, 2, 0, "RenderTargetOutput");
diff --git a/src/quick3d/imports/scene2d/importsscene2d.pro b/src/quick3d/imports/scene2d/importsscene2d.pro
new file mode 100644
index 000000000..32fbc5b1b
--- /dev/null
+++ b/src/quick3d/imports/scene2d/importsscene2d.pro
@@ -0,0 +1,19 @@
+CXX_MODULE = qml
+TARGET = qtquickscene2dplugin
+TARGETPATH = QtQuick/Scene2D
+IMPORT_VERSION = 2.0
+
+QT += qml quick 3dcore 3drender 3drender-private 3dinput 3dlogic 3dquickscene2d 3dquickscene2d-private
+
+# Qt3D is free of Q_FOREACH - make sure it stays that way:
+DEFINES += QT_NO_FOREACH
+
+HEADERS += \
+ qtquickscene2dplugin.h \
+
+SOURCES += \
+ qtquickscene2dplugin.cpp \
+
+OTHER_FILES += qmldir
+
+load(qml_plugin)
diff --git a/src/quick3d/imports/scene2d/plugins.qmltypes b/src/quick3d/imports/scene2d/plugins.qmltypes
new file mode 100644
index 000000000..a26dcbec0
--- /dev/null
+++ b/src/quick3d/imports/scene2d/plugins.qmltypes
@@ -0,0 +1,121 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable -output plugins.qmltypes QtQuick.Scene2D 2.9'
+
+Module {
+ dependencies: []
+ Component {
+ name: "Qt3DCore::QNode"
+ prototype: "QObject"
+ Enum {
+ name: "PropertyTrackingMode"
+ values: {
+ "TrackFinalValues": 0,
+ "DontTrackValues": 1,
+ "TrackAllValues": 2
+ }
+ }
+ Property { name: "parent"; type: "Qt3DCore::QNode"; isPointer: true }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "defaultPropertyTrackingMode"; revision: 9; type: "PropertyTrackingMode" }
+ Signal {
+ name: "parentChanged"
+ Parameter { name: "parent"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "enabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "defaultPropertyTrackingModeChanged"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ Signal { name: "nodeDestroyed" }
+ Method {
+ name: "setParent"
+ Parameter { name: "parent"; type: "QNode"; isPointer: true }
+ }
+ Method {
+ name: "setEnabled"
+ Parameter { name: "isEnabled"; type: "bool" }
+ }
+ Method {
+ name: "setDefaultPropertyTrackingMode"
+ Parameter { name: "mode"; type: "PropertyTrackingMode" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::Quick::QScene2D"
+ defaultProperty: "item"
+ prototype: "Qt3DCore::QNode"
+ Enum {
+ name: "RenderPolicy"
+ values: {
+ "Continuous": 0,
+ "SingleShot": 1
+ }
+ }
+ Property { name: "output"; type: "Qt3DRender::QRenderTargetOutput"; isPointer: true }
+ Property { name: "source"; type: "QUrl" }
+ Property { name: "renderPolicy"; type: "QScene2D::RenderPolicy" }
+ Property { name: "loaded"; type: "bool"; isReadonly: true }
+ Property { name: "item"; type: "QQuickItem"; isPointer: true }
+ Property { name: "grabMouse"; type: "bool" }
+ Signal {
+ name: "outputChanged"
+ Parameter { name: "output"; type: "Qt3DRender::QRenderTargetOutput"; isPointer: true }
+ }
+ Signal {
+ name: "sourceChanged"
+ Parameter { name: "url"; type: "QUrl" }
+ }
+ Signal {
+ name: "loadedChanged"
+ Parameter { name: "loaded"; type: "bool" }
+ }
+ Signal {
+ name: "renderPolicyChanged"
+ Parameter { name: "policy"; type: "QScene2D::RenderPolicy" }
+ }
+ Signal {
+ name: "itemChanged"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ }
+ Signal {
+ name: "grabMouseChanged"
+ Parameter { name: "grab"; type: "bool" }
+ }
+ Method {
+ name: "setOutput"
+ Parameter { name: "output"; type: "Qt3DRender::QRenderTargetOutput"; isPointer: true }
+ }
+ Method {
+ name: "setSource"
+ Parameter { name: "url"; type: "QUrl" }
+ }
+ Method {
+ name: "setRenderPolicy"
+ Parameter { name: "policy"; type: "QScene2D::RenderPolicy" }
+ }
+ Method {
+ name: "setItem"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ }
+ Method {
+ name: "setGrabMouseEnabled"
+ Parameter { name: "grab"; type: "bool" }
+ }
+ }
+ Component {
+ name: "Qt3DRender::Render::Quick::QQuick3DScene2D"
+ defaultProperty: "item"
+ prototype: "Qt3DRender::Quick::QScene2D"
+ exports: ["QtQuick.Scene2D/Scene2D 2.9"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "entities"; type: "Qt3DCore::QEntity"; isList: true; isReadonly: true }
+ }
+}
diff --git a/src/quick3d/imports/scene2d/qmldir b/src/quick3d/imports/scene2d/qmldir
new file mode 100644
index 000000000..2e807f1e6
--- /dev/null
+++ b/src/quick3d/imports/scene2d/qmldir
@@ -0,0 +1,3 @@
+module QtQuick.Scene2D
+plugin qtquickscene2dplugin
+classname QtQuickScene2DPlugin
diff --git a/src/quick3d/imports/scene2d/qtquickscene2dplugin.cpp b/src/quick3d/imports/scene2d/qtquickscene2dplugin.cpp
new file mode 100644
index 000000000..4e6245d2d
--- /dev/null
+++ b/src/quick3d/imports/scene2d/qtquickscene2dplugin.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qtquickscene2dplugin.h"
+
+#include <Qt3DQuickScene2D/qscene2d.h>
+#include <private/qrenderaspect_p.h>
+#include <Qt3DQuickScene2D/private/qt3dquick3dscene2d_p.h>
+#include <QtCore/qcoreapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+static void initScene2dPlugin()
+{
+ Qt3DRender::QRenderAspectPrivate::configurePlugin("scene2d");
+}
+
+Q_COREAPP_STARTUP_FUNCTION(initScene2dPlugin)
+
+void QtQuickScene2DPlugin::registerTypes(const char *uri)
+{
+ qmlRegisterExtendedType<Qt3DRender::Quick::QScene2D, Qt3DRender::Render::Quick::QQuick3DScene2D>(uri, 2, 9, "Scene2D");
+}
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/imports/scene2d/qtquickscene2dplugin.h b/src/quick3d/imports/scene2d/qtquickscene2dplugin.h
new file mode 100644
index 000000000..c9318673f
--- /dev/null
+++ b/src/quick3d/imports/scene2d/qtquickscene2dplugin.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QTQUICKSCENE2DPLUGIN_H
+#define QTQUICKSCENE2DPLUGIN_H
+
+#include <QtQml/qqmlextensionplugin.h>
+
+static void initResources()
+{
+#ifdef QT_STATIC
+ Q_INIT_RESOURCE(qmake_QtQuick_Scene2D);
+#endif
+}
+
+QT_BEGIN_NAMESPACE
+
+class QtQuickScene2DPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+public:
+ QtQuickScene2DPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); }
+ void registerTypes(const char *uri) Q_DECL_OVERRIDE;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTQUICKSCENE2DPLUGIN_H
diff --git a/src/quick3d/imports/scene3d/qtquickscene3dplugin.cpp b/src/quick3d/imports/scene3d/qtquickscene3dplugin.cpp
index 7103a1bb8..6b9ec96f8 100644
--- a/src/quick3d/imports/scene3d/qtquickscene3dplugin.cpp
+++ b/src/quick3d/imports/scene3d/qtquickscene3dplugin.cpp
@@ -37,9 +37,11 @@
**
****************************************************************************/
-#include <QtQml>
#include "qtquickscene3dplugin.h"
-#include "scene3ditem_p.h"
+
+#include <QtQml>
+
+#include <scene3ditem_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/imports/scene3d/scene3dcleaner.cpp b/src/quick3d/imports/scene3d/scene3dcleaner.cpp
index 06b795c8a..ec371410d 100644
--- a/src/quick3d/imports/scene3d/scene3dcleaner.cpp
+++ b/src/quick3d/imports/scene3d/scene3dcleaner.cpp
@@ -38,13 +38,13 @@
****************************************************************************/
#include "scene3dcleaner_p.h"
-#include "scene3dlogging_p.h"
-#include "scene3drenderer_p.h"
#include <Qt3DCore/qaspectengine.h>
-
#include <QtCore/qthread.h>
+#include <scene3dlogging_p.h>
+#include <scene3drenderer_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/imports/scene3d/scene3dcleaner_p.h b/src/quick3d/imports/scene3d/scene3dcleaner_p.h
index 6ec2c7e6b..a246cbde7 100644
--- a/src/quick3d/imports/scene3d/scene3dcleaner_p.h
+++ b/src/quick3d/imports/scene3d/scene3dcleaner_p.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include <QObject>
+#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp
index 4a5c959c4..c31f4aa97 100644
--- a/src/quick3d/imports/scene3d/scene3ditem.cpp
+++ b/src/quick3d/imports/scene3d/scene3ditem.cpp
@@ -38,23 +38,26 @@
****************************************************************************/
#include "scene3ditem_p.h"
-#include "scene3dcleaner_p.h"
-#include "scene3dlogging_p.h"
-#include "scene3drenderer_p.h"
-#include "scene3dsgnode_p.h"
#include <Qt3DCore/QAspectEngine>
#include <Qt3DCore/qentity.h>
-#include <Qt3DRender/qcamera.h>
-#include <Qt3DRender/QRenderAspect>
-#include <Qt3DRender/qrendersurfaceselector.h>
-#include <Qt3DRender/private/qrendersurfaceselector_p.h>
#include <Qt3DInput/QInputAspect>
#include <Qt3DInput/qinputsettings.h>
#include <Qt3DLogic/qlogicaspect.h>
+#include <Qt3DRender/QRenderAspect>
+#include <Qt3DRender/qcamera.h>
+#include <Qt3DRender/qrendersurfaceselector.h>
-
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qoffscreensurface.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qquickrendercontrol.h>
+
+#include <Qt3DRender/private/qrendersurfaceselector_p.h>
+#include <scene3dcleaner_p.h>
+#include <scene3dlogging_p.h>
+#include <scene3drenderer_p.h>
+#include <scene3dsgnode_p.h>
QT_BEGIN_NAMESPACE
@@ -179,7 +182,7 @@ void Scene3DItem::applyRootEntityChange()
QList<Qt3DRender::QCamera *> cameras
= m_entity->findChildren<Qt3DRender::QCamera *>();
if (cameras.isEmpty()) {
- qWarning() << "No camera found and automatic aspect ratio requested";
+ qCDebug(Scene3D) << "No camera found and automatic aspect ratio requested";
} else {
m_camera = cameras.first();
setCameraAspectModeHelper();
@@ -191,7 +194,7 @@ void Scene3DItem::applyRootEntityChange()
if (inputSettings) {
inputSettings->setEventSource(this);
} else {
- qWarning() << "No Input Settings found, keyboard and mouse events won't be handled";
+ qCDebug(Scene3D) << "No Input Settings found, keyboard and mouse events won't be handled";
}
}
}
@@ -202,11 +205,25 @@ void Scene3DItem::setWindowSurface(QObject *rootObject)
// Set the item's window surface if it appears
// the surface wasn't set on the surfaceSelector
- if (surfaceSelector && !surfaceSelector->surface())
- surfaceSelector->setSurface(this->window());
+ if (surfaceSelector && !surfaceSelector->surface()) {
+ // We may not have a real, exposed QQuickWindow when the Quick rendering
+ // is redirected via QQuickRenderControl (f.ex. QQuickWidget).
+ if (QWindow *rw = QQuickRenderControl::renderWindowFor(this->window())) {
+ // rw is the top-level window that is backed by a native window. Do
+ // not use that though since we must not clash with e.g. the widget
+ // backingstore compositor in the gui thread.
+ m_dummySurface = new QOffscreenSurface;
+ m_dummySurface->setParent(qGuiApp); // parent to something suitably long-living
+ m_dummySurface->setFormat(rw->format());
+ m_dummySurface->create();
+ surfaceSelector->setSurface(m_dummySurface);
+ } else {
+ surfaceSelector->setSurface(this->window());
+ }
+ }
}
-void Scene3DItem::setItemArea(const QSize &area)
+void Scene3DItem::setItemArea(QSize area)
{
Qt3DRender::QRenderSurfaceSelector *surfaceSelector = Qt3DRender::QRenderSurfaceSelectorPrivate::find(m_entity);
if (surfaceSelector)
diff --git a/src/quick3d/imports/scene3d/scene3ditem_p.h b/src/quick3d/imports/scene3d/scene3ditem_p.h
index 09859a763..e0ce3addc 100644
--- a/src/quick3d/imports/scene3d/scene3ditem_p.h
+++ b/src/quick3d/imports/scene3d/scene3ditem_p.h
@@ -51,11 +51,13 @@
// We mean it.
//
-#include <QQuickItem>
#include <QtCore/qpointer.h>
+#include <QtQuick/QQuickItem>
QT_BEGIN_NAMESPACE
+class QOffscreenSurface;
+
namespace Qt3DCore {
class QAspectEngine;
class QEntity;
@@ -86,7 +88,7 @@ public:
bool multisample() const;
void setMultisample(bool enable);
- void setItemArea(const QSize &area);
+ Q_INVOKABLE void setItemArea(QSize area);
bool isHoverEnabled() const;
enum CameraAspectRatioMode {
@@ -131,6 +133,7 @@ private:
QPointer<Qt3DRender::QCamera> m_camera;
CameraAspectRatioMode m_cameraAspectRatioMode;
+ QOffscreenSurface *m_dummySurface;
};
} // Qt3DRender
diff --git a/src/quick3d/imports/scene3d/scene3dlogging.cpp b/src/quick3d/imports/scene3d/scene3dlogging.cpp
index b9582799b..b6656541b 100644
--- a/src/quick3d/imports/scene3d/scene3dlogging.cpp
+++ b/src/quick3d/imports/scene3d/scene3dlogging.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-Q_LOGGING_CATEGORY(Scene3D, "Qt3D.Scene3D")
+Q_LOGGING_CATEGORY(Scene3D, "Qt3D.Scene3D", QtWarningMsg)
} // Qt3DRender
diff --git a/src/quick3d/imports/scene3d/scene3dlogging_p.h b/src/quick3d/imports/scene3d/scene3dlogging_p.h
index 0f9448d42..91430939f 100644
--- a/src/quick3d/imports/scene3d/scene3dlogging_p.h
+++ b/src/quick3d/imports/scene3d/scene3dlogging_p.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include <QLoggingCategory>
+#include <QtCore/QLoggingCategory>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/imports/scene3d/scene3drenderer.cpp b/src/quick3d/imports/scene3d/scene3drenderer.cpp
index 3065b19ac..b32191391 100644
--- a/src/quick3d/imports/scene3d/scene3drenderer.cpp
+++ b/src/quick3d/imports/scene3d/scene3drenderer.cpp
@@ -38,27 +38,36 @@
****************************************************************************/
#include "scene3drenderer_p.h"
-#include "scene3dcleaner_p.h"
-#include "scene3ditem_p.h"
-#include "scene3dlogging_p.h"
-#include "scene3dsgnode_p.h"
-#include <Qt3DRender/qrenderaspect.h>
-#include <Qt3DRender/private/qrenderaspect_p.h>
#include <Qt3DCore/qaspectengine.h>
-#include <Qt3DCore/private/qaspectengine_p.h>
-
-#include <QtQuick/qquickwindow.h>
-
+#include <Qt3DRender/qrenderaspect.h>
+#include <QtCore/qthread.h>
#include <QtGui/qopenglcontext.h>
#include <QtGui/qopenglframebufferobject.h>
+#include <QtQuick/qquickwindow.h>
-#include <QtCore/qthread.h>
+#include <Qt3DRender/private/qrenderaspect_p.h>
+#include <Qt3DCore/private/qaspectengine_p.h>
+#include <scene3dcleaner_p.h>
+#include <scene3ditem_p.h>
+#include <scene3dlogging_p.h>
+#include <scene3dsgnode_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
+namespace {
+
+inline QMetaMethod setItemAreaMethod()
+{
+ const int idx = Scene3DItem::staticMetaObject.indexOfMethod("setItemArea(QSize)");
+ Q_ASSERT(idx != -1);
+ return Scene3DItem::staticMetaObject.method(idx);
+}
+
+} // anonymous
+
class ContextSaver
{
public:
@@ -120,14 +129,18 @@ Scene3DRenderer::Scene3DRenderer(Scene3DItem *item, Qt3DCore::QAspectEngine *asp
, m_multisampledFBO(nullptr)
, m_finalFBO(nullptr)
, m_texture(nullptr)
+ , m_node(nullptr)
+ , m_cleaner(nullptr)
, m_multisample(false) // this value is not used, will be synced from the Scene3DItem instead
, m_lastMultisample(false)
+ , m_needsShutdown(true)
{
Q_CHECK_PTR(m_item);
Q_CHECK_PTR(m_item->window());
QObject::connect(m_item->window(), &QQuickWindow::beforeRendering, this, &Scene3DRenderer::render, Qt::DirectConnection);
- QObject::connect(m_item, &QQuickItem::windowChanged, this, &Scene3DRenderer::onWindowChangedQueued, Qt::QueuedConnection);
+ QObject::connect(m_item->window(), &QQuickWindow::sceneGraphInvalidated, this, &Scene3DRenderer::onSceneGraphInvalidated, Qt::DirectConnection);
+ QObject::connect(m_item, &QQuickItem::windowChanged, this, &Scene3DRenderer::onWindowChanged, Qt::QueuedConnection);
Q_ASSERT(QOpenGLContext::currentContext());
ContextSaver saver;
@@ -173,7 +186,7 @@ void Scene3DRenderer::setCleanerHelper(Scene3DCleaner *cleaner)
}
}
-// Executed in the QtQuick render thread.
+// Executed in the QtQuick render thread (which may even be the gui/main with QQuickWidget / RenderControl).
void Scene3DRenderer::shutdown()
{
qCDebug(Scene3D) << Q_FUNC_INFO << QThread::currentThread();
@@ -195,19 +208,29 @@ void Scene3DRenderer::shutdown()
static_cast<QRenderAspectPrivate*>(QRenderAspectPrivate::get(m_renderAspect))->renderShutdown();
}
-// SGThread
-void Scene3DRenderer::onWindowChangedQueued(QQuickWindow *w)
+// QtQuick render thread (which may also be the gui/main thread with QQuickWidget / RenderControl)
+void Scene3DRenderer::onSceneGraphInvalidated()
{
- if (w == nullptr) {
- qCDebug(Scene3D) << Q_FUNC_INFO << QThread::currentThread();
+ qCDebug(Scene3D) << Q_FUNC_INFO << QThread::currentThread();
+ if (m_needsShutdown) {
+ m_needsShutdown = false;
shutdown();
- // Will only trigger something with the Loader case
- // The window closed cases is handled by the window's destroyed
- // signal
QMetaObject::invokeMethod(m_cleaner, "cleanup");
}
}
+void Scene3DRenderer::onWindowChanged(QQuickWindow *w)
+{
+ qCDebug(Scene3D) << Q_FUNC_INFO << QThread::currentThread() << w;
+ if (!w) {
+ if (m_needsShutdown) {
+ m_needsShutdown = false;
+ shutdown();
+ QMetaObject::invokeMethod(m_cleaner, "cleanup");
+ }
+ }
+}
+
void Scene3DRenderer::synchronize()
{
m_multisample = m_item->multisample();
@@ -238,8 +261,11 @@ void Scene3DRenderer::render()
const bool multisampleHasChanged = m_multisample != m_lastMultisample;
const bool forceRecreate = sizeHasChanged || multisampleHasChanged;
- if (sizeHasChanged)
- m_item->setItemArea(boundingRectSize);
+ if (sizeHasChanged) {
+ // We are in the QSGRenderThread (doing a direct call would result in a race)
+ static const QMetaMethod setItemArea = setItemAreaMethod();
+ setItemArea.invoke(m_item, Qt::QueuedConnection, Q_ARG(QSize, boundingRectSize));
+ }
// Rebuild FBO and textures if never created or a resize has occurred
if ((m_multisampledFBO.isNull() || forceRecreate) && m_multisample) {
diff --git a/src/quick3d/imports/scene3d/scene3drenderer_p.h b/src/quick3d/imports/scene3d/scene3drenderer_p.h
index 9ff5e7f36..ab1db1010 100644
--- a/src/quick3d/imports/scene3d/scene3drenderer_p.h
+++ b/src/quick3d/imports/scene3d/scene3drenderer_p.h
@@ -51,8 +51,7 @@
// We mean it.
//
-#include <QObject>
-
+#include <QtCore/QObject>
#include <QtCore/qsize.h>
QT_BEGIN_NAMESPACE
@@ -91,7 +90,8 @@ public:
public Q_SLOTS:
void render();
void shutdown();
- void onWindowChangedQueued(QQuickWindow *w);
+ void onSceneGraphInvalidated();
+ void onWindowChanged(QQuickWindow *w);
private:
Scene3DItem *m_item; // Will be released by the QQuickWindow/QML Engine
@@ -105,6 +105,7 @@ private:
QSize m_lastSize;
bool m_multisample;
bool m_lastMultisample;
+ bool m_needsShutdown;
friend class Scene3DCleaner;
};
diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h b/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h
index f3817dc05..df431e452 100644
--- a/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h
+++ b/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h
@@ -52,10 +52,10 @@
//
#include <QtQuick/QSGMaterial>
-#include "scene3dsgmaterialshader_p.h"
-
#include <QtQuick/qsgtexture.h>
+#include <scene3dsgmaterialshader_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
index 5ce0f4d60..8a4585558 100644
--- a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
+++ b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
@@ -38,12 +38,13 @@
****************************************************************************/
#include "scene3dsgmaterialshader_p.h"
-#include "scene3dsgmaterial_p.h"
#include <QtGui/qopenglcontext.h>
#include <QtGui/qopenglfunctions.h>
#include <QtGui/qsurfaceformat.h>
+#include <scene3dsgmaterial_p.h>
+
QT_BEGIN_NAMESPACE
namespace {
@@ -71,6 +72,13 @@ namespace Qt3DRender {
QSGMaterialType Scene3DSGMaterialShader::type;
+Scene3DSGMaterialShader::Scene3DSGMaterialShader()
+ : QSGMaterialShader()
+ , m_matrixId(-1)
+ , m_opacityId(-1)
+{
+}
+
const char * const *Scene3DSGMaterialShader::attributeNames() const
{
static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", 0 };
diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h b/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h
index 64d281ec4..a1222b07d 100644
--- a/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h
+++ b/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h
@@ -60,6 +60,7 @@ namespace Qt3DRender {
class Scene3DSGMaterialShader : public QSGMaterialShader
{
public:
+ Scene3DSGMaterialShader();
void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) Q_DECL_FINAL;
const char * const *attributeNames() const Q_DECL_FINAL;
diff --git a/src/quick3d/imports/scene3d/scene3dsgnode.cpp b/src/quick3d/imports/scene3d/scene3dsgnode.cpp
index ae0a07350..8806b59a9 100644
--- a/src/quick3d/imports/scene3d/scene3dsgnode.cpp
+++ b/src/quick3d/imports/scene3d/scene3dsgnode.cpp
@@ -38,10 +38,11 @@
****************************************************************************/
#include "scene3dsgnode_p.h"
-#include "scene3dlogging_p.h"
#include <QtCore/qthread.h>
+#include <scene3dlogging_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/imports/scene3d/scene3dsgnode_p.h b/src/quick3d/imports/scene3d/scene3dsgnode_p.h
index f7b21e2b9..68b68eea5 100644
--- a/src/quick3d/imports/scene3d/scene3dsgnode_p.h
+++ b/src/quick3d/imports/scene3d/scene3dsgnode_p.h
@@ -53,7 +53,7 @@
#include <QtQuick/QSGGeometryNode>
-#include "scene3dsgmaterial_p.h"
+#include <scene3dsgmaterial_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/items/items.pri b/src/quick3d/quick3d/items/items.pri
index 4c5e93fb2..4749c83cf 100644
--- a/src/quick3d/quick3d/items/items.pri
+++ b/src/quick3d/quick3d/items/items.pri
@@ -3,12 +3,14 @@ HEADERS += \
$$PWD/quick3dentity_p.h \
$$PWD/quick3dentityloader_p_p.h \
$$PWD/quick3dentityloader_p.h \
- $$PWD/quick3dnode_p.h
+ $$PWD/quick3dnode_p.h \
+ $$PWD/quick3dnodev9_p.h
SOURCES += \
$$PWD/quick3dnode.cpp \
$$PWD/quick3dentity.cpp \
$$PWD/quick3dentityloader.cpp \
- $$PWD/quick3dnodeinstantiator.cpp
+ $$PWD/quick3dnodeinstantiator.cpp \
+ $$PWD/quick3dnodev9.cpp
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3d/items/quick3dentity.cpp b/src/quick3d/quick3d/items/quick3dentity.cpp
index ebc92e843..c2814a79e 100644
--- a/src/quick3d/quick3d/items/quick3dentity.cpp
+++ b/src/quick3d/quick3d/items/quick3dentity.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "quick3dentity_p.h"
+
#include <Qt3DCore/qcomponent.h>
QT_BEGIN_NAMESPACE
@@ -92,6 +93,7 @@ void Quick3DEntity::qmlAppendComponent(QQmlListProperty<QComponent> *list, QComp
if (comp == nullptr)
return;
Quick3DEntity *self = static_cast<Quick3DEntity *>(list->object);
+ self->m_managedComponents.push_back(comp);
self->parentEntity()->addComponent(comp);
}
@@ -110,10 +112,9 @@ int Quick3DEntity::qmlComponentsCount(QQmlListProperty<QComponent> *list)
void Quick3DEntity::qmlClearComponents(QQmlListProperty<QComponent> *list)
{
Quick3DEntity *self = static_cast<Quick3DEntity *>(list->object);
- const QComponentVector components = self->parentEntity()->components();
- for (QComponent *comp : components) {
+ for (QComponent *comp : qAsConst(self->m_managedComponents))
self->parentEntity()->removeComponent(comp);
- }
+ self->m_managedComponents.clear();
}
} // namespace Quick
diff --git a/src/quick3d/quick3d/items/quick3dentity_p.h b/src/quick3d/quick3d/items/quick3dentity_p.h
index eb716a0c3..7ba5c62c2 100644
--- a/src/quick3d/quick3d/items/quick3dentity_p.h
+++ b/src/quick3d/quick3d/items/quick3dentity_p.h
@@ -51,8 +51,9 @@
// We mean it.
//
-#include <QQmlListProperty>
#include <Qt3DCore/qentity.h>
+#include <QtQml/QQmlListProperty>
+
#include <Qt3DQuick/private/quick3dnode_p.h>
#include <Qt3DQuick/private/qt3dquick_global_p.h>
@@ -82,6 +83,8 @@ private:
static QComponent *qmlComponentAt(QQmlListProperty<Qt3DCore::QComponent> *list, int index);
static int qmlComponentsCount(QQmlListProperty<Qt3DCore::QComponent> *list);
static void qmlClearComponents(QQmlListProperty<Qt3DCore::QComponent> *list);
+
+ QVector<Qt3DCore::QComponent *> m_managedComponents;
};
} // namespace Quick
diff --git a/src/quick3d/quick3d/items/quick3dentityloader.cpp b/src/quick3d/quick3d/items/quick3dentityloader.cpp
index 9c82db7ad..8a9b19024 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader.cpp
+++ b/src/quick3d/quick3d/items/quick3dentityloader.cpp
@@ -39,9 +39,9 @@
#include "quick3dentityloader_p_p.h"
-#include <QQmlContext>
-#include <QQmlEngine>
-#include <QQmlIncubator>
+#include <QtQml/QQmlContext>
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlIncubator>
#include <QtQml/private/qqmlengine_p.h>
@@ -50,6 +50,32 @@ QT_BEGIN_NAMESPACE
namespace Qt3DCore {
namespace Quick {
+namespace {
+struct Quick3DQmlOwner
+{
+ Quick3DQmlOwner(QQmlEngine *e, QObject *o)
+ : engine(e)
+ , object(o)
+ {}
+
+ QQmlEngine *engine;
+ QObject *object;
+
+ QQmlContext *context() const
+ {
+ return engine->contextForObject(object);
+ }
+};
+
+Quick3DQmlOwner _q_findQmlOwner(QObject *object)
+{
+ auto o = object;
+ while (!qmlEngine(o) && o->parent())
+ o = o->parent();
+ return Quick3DQmlOwner(qmlEngine(o), o);
+}
+}
+
class Quick3DEntityLoaderIncubator : public QQmlIncubator
{
public:
@@ -71,13 +97,20 @@ protected:
Q_ASSERT(priv->m_entity != nullptr);
priv->m_entity->setParent(m_loader);
emit m_loader->entityChanged();
+ priv->setStatus(Quick3DEntityLoader::Ready);
+ break;
+ }
+
+ case Loading: {
+ priv->setStatus(Quick3DEntityLoader::Loading);
break;
}
case Error: {
- QQmlEnginePrivate::warning(qmlEngine(m_loader), errors());
+ QQmlEnginePrivate::warning(_q_findQmlOwner(m_loader).engine, errors());
priv->clear();
emit m_loader->entityChanged();
+ priv->setStatus(Quick3DEntityLoader::Error);
break;
}
@@ -95,13 +128,21 @@ private:
\inqmlmodule Qt3D.Core
\inherits Entity
\since 5.5
- \brief Provides the facility to load entities from qml source
+ \brief Provides a way to dynamically load an Entity subtree
An EntityLoader provides the facitily to load predefined set of entities
from qml source file. EntityLoader itself is an entity and the loaded entity
tree is set as a child of the loader. The loaded entity tree root can be
accessed with EntityLoader::entity property.
+
+ \badcode
+ EntityLoader {
+ id: loader
+ source: "./SphereEntity.qml"
+ }
+ \endcode
*/
+
Quick3DEntityLoader::Quick3DEntityLoader(QNode *parent)
: QEntity(*new Quick3DEntityLoaderPrivate, parent)
{
@@ -117,6 +158,10 @@ Quick3DEntityLoader::~Quick3DEntityLoader()
\qmlproperty QtQml::QtObject EntityLoader::entity
Holds the loaded entity tree root.
\readonly
+
+ This property allows access to the content of the loader. It references
+ either a valid Entity object if the status property equals
+ EntityLoader.Ready, it is equal to null otherwise.
*/
QObject *Quick3DEntityLoader::entity() const
{
@@ -147,12 +192,30 @@ void Quick3DEntityLoader::setSource(const QUrl &url)
d->loadFromSource();
}
+/*!
+ \qmlproperty Status Qt3DCore::EntityLoader::status
+
+ Holds the status of the entity loader.
+ \list
+ \li EntityLoader.Null
+ \li EntityLoader.Loading
+ \li EntityLoader.Ready
+ \li EntityLoader.Error
+ \endlist
+ */
+Quick3DEntityLoader::Status Quick3DEntityLoader::status() const
+{
+ Q_D(const Quick3DEntityLoader);
+ return d->m_status;
+}
+
Quick3DEntityLoaderPrivate::Quick3DEntityLoaderPrivate()
: QEntityPrivate(),
m_incubator(nullptr),
m_context(nullptr),
m_component(nullptr),
- m_entity(nullptr)
+ m_entity(nullptr),
+ m_status(Quick3DEntityLoader::Null)
{
}
@@ -201,7 +264,8 @@ void Quick3DEntityLoaderPrivate::loadComponent(const QUrl &source)
Q_ASSERT(m_component == nullptr);
Q_ASSERT(m_context == nullptr);
- m_component = new QQmlComponent(qmlEngine(q), q);
+ auto owner = _q_findQmlOwner(q);
+ m_component = new QQmlComponent(owner.engine, owner.object);
QObject::connect(m_component, SIGNAL(statusChanged(QQmlComponent::Status)),
q, SLOT(_q_componentStatusChanged(QQmlComponent::Status)));
m_component->loadUrl(source, QQmlComponent::Asynchronous);
@@ -216,8 +280,10 @@ void Quick3DEntityLoaderPrivate::_q_componentStatusChanged(QQmlComponent::Status
Q_ASSERT(m_context == nullptr);
Q_ASSERT(m_incubator == nullptr);
+ auto owner = _q_findQmlOwner(q);
+
if (!m_component->errors().isEmpty()) {
- QQmlEnginePrivate::warning(qmlEngine(q), m_component->errors());
+ QQmlEnginePrivate::warning(owner.engine, m_component->errors());
clear();
emit q->entityChanged();
return;
@@ -227,13 +293,24 @@ void Quick3DEntityLoaderPrivate::_q_componentStatusChanged(QQmlComponent::Status
if (status != QQmlComponent::Ready)
return;
- m_context = new QQmlContext(qmlContext(q));
- m_context->setContextObject(q);
+ m_context = new QQmlContext(owner.context());
+ m_context->setContextObject(owner.object);
m_incubator = new Quick3DEntityLoaderIncubator(q);
m_component->create(*m_incubator, m_context);
}
+void Quick3DEntityLoaderPrivate::setStatus(Quick3DEntityLoader::Status status)
+{
+ Q_Q(Quick3DEntityLoader);
+ if (status != m_status) {
+ m_status = status;
+ const bool blocked = q->blockNotifications(true);
+ emit q->statusChanged(m_status);
+ q->blockNotifications(blocked);
+ }
+}
+
} // namespace Quick
} // namespace Qt3DCore
diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p.h
index 5721af115..6a2fe5473 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader_p.h
+++ b/src/quick3d/quick3d/items/quick3dentityloader_p.h
@@ -51,10 +51,9 @@
// We mean it.
//
-#include <QObject>
-#include <QUrl>
-
#include <Qt3DCore/QEntity>
+#include <QtCore/QObject>
+#include <QtCore/QUrl>
#include <Qt3DQuick/private/qt3dquick_global_p.h>
@@ -74,7 +73,16 @@ class QT3DQUICKSHARED_PRIVATE_EXPORT Quick3DEntityLoader : public QEntity
Q_OBJECT
Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
public:
+ enum Status {
+ Null = 0,
+ Loading,
+ Ready,
+ Error
+ };
+ Q_ENUM(Status)
+
explicit Quick3DEntityLoader(QNode *parent = 0);
~Quick3DEntityLoader();
@@ -83,9 +91,12 @@ public:
QUrl source() const;
void setSource(const QUrl &url);
+ Status status() const;
+
Q_SIGNALS:
void entityChanged();
void sourceChanged();
+ void statusChanged(Status status);
private:
Q_DECLARE_PRIVATE(Quick3DEntityLoader)
diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p_p.h
index 235870933..4d067f0e6 100644
--- a/src/quick3d/quick3d/items/quick3dentityloader_p_p.h
+++ b/src/quick3d/quick3d/items/quick3dentityloader_p_p.h
@@ -51,11 +51,10 @@
// We mean it.
//
-#include "quick3dentityloader_p.h"
-
-#include <QQmlComponent>
+#include <QtQml/QQmlComponent>
#include <Qt3DCore/private/qentity_p.h>
+#include <Qt3DQuick/private/quick3dentityloader_p.h>
QT_BEGIN_NAMESPACE
@@ -82,6 +81,7 @@ public:
void loadComponent(const QUrl &source);
void _q_componentStatusChanged(QQmlComponent::Status status);
+ void setStatus(Quick3DEntityLoader::Status status);
static inline Quick3DEntityLoaderPrivate *get(Quick3DEntityLoader *q) { return q->d_func(); }
@@ -90,6 +90,7 @@ public:
QQmlContext *m_context;
QQmlComponent *m_component;
QEntity *m_entity;
+ Quick3DEntityLoader::Status m_status;
};
} // namespace Quick
diff --git a/src/quick3d/quick3d/items/quick3dnode.cpp b/src/quick3d/quick3d/items/quick3dnode.cpp
index 3761f8d64..fb91f4ae0 100644
--- a/src/quick3d/quick3d/items/quick3dnode.cpp
+++ b/src/quick3d/quick3d/items/quick3dnode.cpp
@@ -38,7 +38,8 @@
****************************************************************************/
#include "quick3dnode_p.h"
-#include <QDebug>
+
+#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/items/quick3dnode_p.h b/src/quick3d/quick3d/items/quick3dnode_p.h
index 9798d0d4c..640a58149 100644
--- a/src/quick3d/quick3d/items/quick3dnode_p.h
+++ b/src/quick3d/quick3d/items/quick3dnode_p.h
@@ -51,8 +51,9 @@
// We mean it.
//
-#include <QQmlListProperty>
#include <Qt3DCore/qnode.h>
+#include <QtQml/QQmlListProperty>
+
#include <Qt3DQuick/private/qt3dquick_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
index eb6df2756..1626554ea 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
@@ -42,13 +42,13 @@
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
-#include <QtQml/QQmlInfo>
#include <QtQml/QQmlError>
-#include <QtQml/private/qqmlobjectmodel_p.h>
+#include <QtQml/QQmlInfo>
+
+#include <Qt3DCore/private/qnode_p.h>
+#include <QtQml/private/qqmlchangeset_p.h>
#include <QtQml/private/qqmldelegatemodel_p.h>
-#include <private/qnode_p.h>
-#include <private/qqmlchangeset_p.h>
-#include <private/qqmlobjectmodel_p.h>
+#include <QtQml/private/qqmlobjectmodel_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
index d861fc2fe..fd7a1d83d 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
@@ -52,11 +52,12 @@
// We mean it.
//
-#include <Qt3DQuick/private/qt3dquick_global_p.h>
#include <Qt3DCore/qnode.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlparserstatus.h>
+#include <Qt3DQuick/private/qt3dquick_global_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
diff --git a/src/quick3d/quick3d/items/quick3dnodev9.cpp b/src/quick3d/quick3d/items/quick3dnodev9.cpp
new file mode 100644
index 000000000..d1a9011b5
--- /dev/null
+++ b/src/quick3d/quick3d/items/quick3dnodev9.cpp
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** 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.LGPL3 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-3.0.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 (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dnodev9_p.h"
+#include <QtQml/QJSValueIterator>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DCore {
+namespace Quick {
+
+Quick3DNodeV9::Quick3DNodeV9(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ \qmlproperty QJSValue Qt3DCore::Node::propertyTrackingOverrides
+ \default {}
+
+ Assuming a Qt3DCore::Node needs to override the PropertyTrackingMode on two
+ properties (enabled and displacement), the value should be set as shown
+ below.
+
+ \badcode
+ propertyTrackingOverrides: {
+ "enabled": Entity.DontTrackValues,
+ "displacement": Entity.TrackFinalValues
+ }
+ \endcode
+
+ \since 2.9
+*/
+
+QJSValue Quick3DNodeV9::propertyTrackingOverrides() const
+{
+ return m_propertyTrackingOverrides;
+}
+
+void Quick3DNodeV9::setPropertyTrackingOverrides(const QJSValue &value)
+{
+ m_propertyTrackingOverrides = value;
+
+ QNode *parentNode = this->parentNode();
+ parentNode->clearPropertyTrackings();
+
+ if (value.isObject()) {
+ QJSValueIterator it(value);
+ while (it.hasNext()) {
+ it.next();
+ parentNode->setPropertyTracking(it.name(), static_cast<QNode::PropertyTrackingMode>(it.value().toInt()));
+ }
+ }
+ emit propertyTrackingOverridesChanged(value);
+}
+
+/*!
+ \qmlproperty list<QtQml::QtObject> Qt3DCore::Node::data
+ \default
+*/
+
+QQmlListProperty<QObject> Quick3DNodeV9::data()
+{
+ return QQmlListProperty<QObject>(this, 0,
+ Quick3DNodeV9::appendData,
+ Quick3DNodeV9::dataCount,
+ Quick3DNodeV9::dataAt,
+ Quick3DNodeV9::clearData);
+}
+
+/*!
+ \qmlproperty list<Node> Qt3DCore::Node::childNodes
+ \readonly
+*/
+
+QQmlListProperty<QNode> Quick3DNodeV9::childNodes()
+{
+ return QQmlListProperty<QNode>(this, 0,
+ Quick3DNodeV9::appendChild,
+ Quick3DNodeV9::childCount,
+ Quick3DNodeV9::childAt,
+ Quick3DNodeV9::clearChildren);
+}
+
+void Quick3DNodeV9::appendData(QQmlListProperty<QObject> *list, QObject *obj)
+{
+ if (!obj)
+ return;
+
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ self->childAppended(0, obj);
+}
+
+QObject *Quick3DNodeV9::dataAt(QQmlListProperty<QObject> *list, int index)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ return self->parentNode()->children().at(index);
+}
+
+int Quick3DNodeV9::dataCount(QQmlListProperty<QObject> *list)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ return self->parentNode()->children().count();
+}
+
+void Quick3DNodeV9::clearData(QQmlListProperty<QObject> *list)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ for (QObject *const child : self->parentNode()->children())
+ self->childRemoved(0, child);
+}
+
+void Quick3DNodeV9::appendChild(QQmlListProperty<Qt3DCore::QNode> *list, Qt3DCore::QNode *obj)
+{
+ if (!obj)
+ return;
+
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ Q_ASSERT(!self->parentNode()->children().contains(obj));
+
+ self->childAppended(0, obj);
+}
+
+Qt3DCore::QNode *Quick3DNodeV9::childAt(QQmlListProperty<Qt3DCore::QNode> *list, int index)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ return qobject_cast<QNode *>(self->parentNode()->children().at(index));
+}
+
+int Quick3DNodeV9::childCount(QQmlListProperty<Qt3DCore::QNode> *list)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ return self->parentNode()->children().count();
+}
+
+void Quick3DNodeV9::clearChildren(QQmlListProperty<Qt3DCore::QNode> *list)
+{
+ Quick3DNodeV9 *self = static_cast<Quick3DNodeV9 *>(list->object);
+ for (QObject *const child : self->parentNode()->children())
+ self->childRemoved(0, child);
+}
+
+void Quick3DNodeV9::childAppended(int, QObject *obj)
+{
+ QNode *parentNode = this->parentNode();
+ if (obj->parent() == parentNode)
+ obj->setParent(0);
+ // Set after otherwise addChild might not work
+ if (QNode *n = qobject_cast<QNode *>(obj))
+ n->setParent(parentNode);
+ else
+ obj->setParent(parentNode);
+}
+
+void Quick3DNodeV9::childRemoved(int, QObject *obj)
+{
+ if (QNode *n = qobject_cast<QNode *>(obj))
+ n->setParent(Q_NODE_NULLPTR);
+ else
+ obj->setParent(nullptr);
+}
+
+
+} // namespace Quick
+} // namespace Qt3DCore
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3d/items/quick3dnodev9_p.h b/src/quick3d/quick3d/items/quick3dnodev9_p.h
new file mode 100644
index 000000000..d969c4b64
--- /dev/null
+++ b/src/quick3d/quick3d/items/quick3dnodev9_p.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** 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.LGPL3 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-3.0.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 (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3D_QUICK_QUICK3DNODEV9_P_H
+#define QT3D_QUICK_QUICK3DNODEV9_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/QJSValue>
+#include <QQmlListProperty>
+#include <Qt3DCore/qnode.h>
+#include <Qt3DQuick/private/qt3dquick_global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DCore {
+namespace Quick {
+
+class QT3DQUICKSHARED_PRIVATE_EXPORT Quick3DNodeV9 : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QJSValue propertyTrackingOverrides READ propertyTrackingOverrides WRITE setPropertyTrackingOverrides NOTIFY propertyTrackingOverridesChanged)
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data)
+ Q_PROPERTY(QQmlListProperty<Qt3DCore::QNode> childNodes READ childNodes)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ explicit Quick3DNodeV9(QObject *parent = nullptr);
+
+ QJSValue propertyTrackingOverrides() const;
+ QQmlListProperty<QObject> data();
+ QQmlListProperty<Qt3DCore::QNode> childNodes();
+
+ inline QNode *parentNode() const { return qobject_cast<QNode*>(parent()); }
+
+Q_SIGNALS:
+ void propertyTrackingOverridesChanged(const QJSValue &value);
+
+private Q_SLOTS:
+ void setPropertyTrackingOverrides(const QJSValue &value);
+ void childAppended(int idx, QObject *child);
+ void childRemoved(int idx, QObject *child);
+
+private:
+ static void appendData(QQmlListProperty<QObject> *list, QObject *obj);
+ static QObject *dataAt(QQmlListProperty<QObject> *list, int index);
+ static int dataCount(QQmlListProperty<QObject> *list);
+ static void clearData(QQmlListProperty<QObject> *list);
+
+ static void appendChild(QQmlListProperty<Qt3DCore::QNode> *list, Qt3DCore::QNode *obj);
+ static QNode *childAt(QQmlListProperty<Qt3DCore::QNode> *list, int index);
+ static int childCount(QQmlListProperty<Qt3DCore::QNode> *list);
+ static void clearChildren(QQmlListProperty<Qt3DCore::QNode> *list);
+
+ QJSValue m_propertyTrackingOverrides;
+};
+
+} // namespace Quick
+} // namespace Qt3DCore
+
+QT_END_NAMESPACE
+
+
+#endif // QT3D_QUICK_QUICK3DNODEV9_P_H
diff --git a/src/quick3d/quick3d/qqmlaspectengine.cpp b/src/quick3d/quick3d/qqmlaspectengine.cpp
index 4b694d26e..912c71fb3 100644
--- a/src/quick3d/quick3d/qqmlaspectengine.cpp
+++ b/src/quick3d/quick3d/qqmlaspectengine.cpp
@@ -38,10 +38,11 @@
****************************************************************************/
#include "qqmlaspectengine_p.h"
-#include <QQmlComponent>
-#include <QQmlContext>
-#include <QDebug>
+
#include <Qt3DCore/qentity.h>
+#include <QtCore/QDebug>
+#include <QtQml/QQmlComponent>
+#include <QtQml/QQmlContext>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qqmlaspectengine.h b/src/quick3d/quick3d/qqmlaspectengine.h
index c85cbb8ea..a7b09ec8a 100644
--- a/src/quick3d/quick3d/qqmlaspectengine.h
+++ b/src/quick3d/quick3d/qqmlaspectengine.h
@@ -40,9 +40,9 @@
#ifndef QT3D_QUICK_QQMLASPECTENGINE_H
#define QT3D_QUICK_QQMLASPECTENGINE_H
-#include <QQmlEngine>
#include <Qt3DCore/QAspectEngine>
#include <Qt3DQuick/qt3dquick_global.h>
+#include <QtQml/QQmlEngine>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qqmlaspectengine_p.h b/src/quick3d/quick3d/qqmlaspectengine_p.h
index f9343ae68..960ecb344 100644
--- a/src/quick3d/quick3d/qqmlaspectengine_p.h
+++ b/src/quick3d/quick3d/qqmlaspectengine_p.h
@@ -53,8 +53,9 @@
#include <Qt3DQuick/qt3dquick_global.h>
#include <Qt3DQuick/qqmlaspectengine.h>
-#include <private/qobject_p.h>
-#include <QScopedPointer>
+#include <QtCore/QScopedPointer>
+
+#include <QtCore/private/qobject_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qquaternionanimation.cpp b/src/quick3d/quick3d/qquaternionanimation.cpp
index 25cad523b..adccf4d97 100644
--- a/src/quick3d/quick3d/qquaternionanimation.cpp
+++ b/src/quick3d/quick3d/qquaternionanimation.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qquaternionanimation_p.h"
+
#include <QtQuick/private/qquickanimation_p_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qquaternionanimation_p.h b/src/quick3d/quick3d/qquaternionanimation_p.h
index 3c5f092c4..172d3bc85 100644
--- a/src/quick3d/quick3d/qquaternionanimation_p.h
+++ b/src/quick3d/quick3d/qquaternionanimation_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
+#include <QtGui/qquaternion.h>
+
#include <Qt3DQuick/private/qt3dquick_global_p.h>
#include <QtQuick/private/qquickanimation_p.h>
-#include <QtGui/qquaternion.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qt3dquick_global.cpp b/src/quick3d/quick3d/qt3dquick_global.cpp
index f25aae268..a98211991 100644
--- a/src/quick3d/quick3d/qt3dquick_global.cpp
+++ b/src/quick3d/quick3d/qt3dquick_global.cpp
@@ -38,12 +38,13 @@
****************************************************************************/
#include "qt3dquick_global_p.h"
-#include "qt3dquicknodefactory_p.h"
-#include <private/qqmlglobal_p.h>
-#include <private/qt3dquickvaluetypes_p.h>
-#include <private/qv8engine_p.h>
-#include <private/qv4engine_p.h>
-#include <private/qv4object_p.h>
+
+#include <Qt3DQuick/private/qt3dquicknodefactory_p.h>
+#include <Qt3DQuick/private/qt3dquickvaluetypes_p.h>
+#include <QtQml/private/qqmlglobal_p.h>
+#include <QtQml/private/qv4engine_p.h>
+#include <QtQml/private/qv4object_p.h>
+#include <QtQml/private/qv8engine_p.h>
QT_BEGIN_NAMESPACE
@@ -579,6 +580,7 @@ public:
case QMetaType::QColor:
{
Q_ASSERT(dstSize >= sizeof(QColor));
+ Q_UNUSED(dstSize);
const QRgb *rgb = reinterpret_cast<const QRgb *>(src);
QColor *color = reinterpret_cast<QColor *>(dst);
new (color) QColor(QColor::fromRgba(*rgb));
@@ -657,9 +659,9 @@ public:
#undef ASSERT_VALID_SIZE
};
+static Quick3DValueTypeProvider valueTypeProvider;
static Quick3DValueTypeProvider *getValueTypeProvider()
{
- static Quick3DValueTypeProvider valueTypeProvider;
return &valueTypeProvider;
}
@@ -704,6 +706,11 @@ void Quick3D_initialize()
QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent);
}
+void Quick3D_uninitialize()
+{
+ QQml_removeValueTypeProvider(&valueTypeProvider);
+}
+
void Quick3D_registerType(const char *className, const char *quickName, int major, int minor)
{
QuickNodeFactory::instance()->registerType(className, quickName, major, minor);
diff --git a/src/quick3d/quick3d/qt3dquick_global_p.h b/src/quick3d/quick3d/qt3dquick_global_p.h
index d67209404..ffc603f91 100644
--- a/src/quick3d/quick3d/qt3dquick_global_p.h
+++ b/src/quick3d/quick3d/qt3dquick_global_p.h
@@ -62,6 +62,7 @@ namespace Qt3DCore {
namespace Quick {
QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_initialize();
+QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_uninitialize();
QT3DQUICKSHARED_PRIVATE_EXPORT void Quick3D_registerType(const char *className, const char *quickName, int major, int minor);
template<class T, class E> void registerExtendedType(const char *className, const char *quickName,
diff --git a/src/quick3d/quick3d/qt3dquicknodefactory.cpp b/src/quick3d/quick3d/qt3dquicknodefactory.cpp
index 923793506..a8c021754 100644
--- a/src/quick3d/quick3d/qt3dquicknodefactory.cpp
+++ b/src/quick3d/quick3d/qt3dquicknodefactory.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qt3dquicknodefactory_p.h"
+
#include <QtQml/private/qqmlmetatype_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3d/qt3dquicknodefactory_p.h b/src/quick3d/quick3d/qt3dquicknodefactory_p.h
index 4dd455461..6c074da04 100644
--- a/src/quick3d/quick3d/qt3dquicknodefactory_p.h
+++ b/src/quick3d/quick3d/qt3dquicknodefactory_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DCore/private/qabstractnodefactory_p.h>
#include <QtCore/qhash.h>
+#include <Qt3DCore/private/qabstractnodefactory_p.h>
+
QT_BEGIN_NAMESPACE
class QQmlType;
diff --git a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
index ed80d0426..46500b935 100644
--- a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
+++ b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h
@@ -52,15 +52,15 @@
// We mean it.
//
-#include <private/qt3dquick_global_p.h>
-#include <private/qqmlvaluetype_p.h>
-
#include <QtGui/QColor>
+#include <QtGui/QMatrix4x4>
+#include <QtGui/QQuaternion>
#include <QtGui/QVector2D>
#include <QtGui/QVector3D>
#include <QtGui/QVector4D>
-#include <QtGui/QQuaternion>
-#include <QtGui/QMatrix4x4>
+
+#include <Qt3DQuick/private/qt3dquick_global_p.h>
+#include <QtQml/private/qqmlvaluetype_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3danimation/items/items.pri b/src/quick3d/quick3danimation/items/items.pri
index 0c3511902..27adabbe4 100644
--- a/src/quick3d/quick3danimation/items/items.pri
+++ b/src/quick3d/quick3danimation/items/items.pri
@@ -1,9 +1,19 @@
SOURCES += \
$$PWD/quick3dchannelmapper.cpp \
- $$PWD/quick3dabstractclipblendnode.cpp
+ $$PWD/quick3danimationcontroller.cpp \
+ $$PWD/quick3danimationgroup.cpp \
+ $$PWD/quick3dkeyframeanimation.cpp \
+ $$PWD/quick3dmorphinganimation.cpp \
+ $$PWD/quick3dmorphtarget.cpp \
+ $$PWD/quick3dvertexblendanimation.cpp
HEADERS += \
$$PWD/quick3dchannelmapper_p.h \
- $$PWD/quick3dabstractclipblendnode_p.h
+ $$PWD/quick3danimationcontroller_p.h \
+ $$PWD/quick3danimationgroup_p.h \
+ $$PWD/quick3dkeyframeanimation_p.h \
+ $$PWD/quick3dmorphinganimation_p.h \
+ $$PWD/quick3dmorphtarget_p.h \
+ $$PWD/quick3dvertexblendanimation_p.h
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3danimation/items/quick3dabstractclipblendnode.cpp b/src/quick3d/quick3danimation/items/quick3dabstractclipblendnode.cpp
deleted file mode 100644
index 7a709c2d6..000000000
--- a/src/quick3d/quick3danimation/items/quick3dabstractclipblendnode.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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.LGPL3 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-3.0.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 (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "quick3dabstractclipblendnode_p.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DAnimation {
-namespace Animation {
-namespace Quick {
-
-Quick3DAbstractClipBlendNode::Quick3DAbstractClipBlendNode(QObject *parent)
- : QObject(parent)
-{
-}
-
-QQmlListProperty<QAnimationClip> Quick3DAbstractClipBlendNode::clipList()
-{
- return QQmlListProperty<QAnimationClip>(this, 0,
- &Quick3DAbstractClipBlendNode::appendClip,
- &Quick3DAbstractClipBlendNode::clipCount,
- &Quick3DAbstractClipBlendNode::clipAt,
- &Quick3DAbstractClipBlendNode::clearClips);
-}
-
-void Quick3DAbstractClipBlendNode::appendClip(QQmlListProperty<QAnimationClip> *list, QAnimationClip *clip)
-{
- Quick3DAbstractClipBlendNode *extension = qobject_cast<Quick3DAbstractClipBlendNode *>(list->object);
- extension->parentAbstractClipBlendNode()->addClip(clip);
-}
-
-QAnimationClip *Quick3DAbstractClipBlendNode::clipAt(QQmlListProperty<QAnimationClip> *list, int index)
-{
- Quick3DAbstractClipBlendNode *extension = qobject_cast<Quick3DAbstractClipBlendNode *>(list->object);
- return extension->parentAbstractClipBlendNode()->clips().at(index);
-}
-
-int Quick3DAbstractClipBlendNode::clipCount(QQmlListProperty<QAnimationClip> *list)
-{
- Quick3DAbstractClipBlendNode *extension = qobject_cast<Quick3DAbstractClipBlendNode *>(list->object);
- return extension->parentAbstractClipBlendNode()->clips().count();
-}
-
-void Quick3DAbstractClipBlendNode::clearClips(QQmlListProperty<QAnimationClip> *list)
-{
- Quick3DAbstractClipBlendNode *extension = qobject_cast<Quick3DAbstractClipBlendNode *>(list->object);
- const QVector<QAnimationClip *> clips = extension->parentAbstractClipBlendNode()->clips();
- for (QAnimationClip *clip : clips)
- extension->parentAbstractClipBlendNode()->removeClip(clip);
-}
-
-} // Quick
-} // Animation
-} // Qt3DAnimation
-
-QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp b/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp
index 4aceb0d55..dc6183989 100644
--- a/src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp
+++ b/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
QQuick3DAnimationController::QQuick3DAnimationController(QObject *parent)
@@ -90,6 +90,6 @@ void QQuick3DAnimationController::clearAnimationGroups(QQmlListProperty<QAnimati
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h b/src/quick3d/quick3danimation/items/quick3danimationcontroller_p.h
index 82ad29e2c..a3033e537 100644
--- a/src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h
+++ b/src/quick3d/quick3danimation/items/quick3danimationcontroller_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QT3DEXTRAS_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
-#define QT3DEXTRAS_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
+#ifndef QT3DANIMATION_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
+#define QT3DANIMATION_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
//
// W A R N I N G
@@ -48,41 +48,41 @@
// We mean it.
//
-#include <Qt3DQuickExtras/qt3dquickextras_global.h>
-#include <QQmlListProperty>
-#include <Qt3DExtras/QAnimationController>
+#include <private/qt3dquickanimation_global_p.h>
+#include <QtQml/QQmlListProperty>
+#include <Qt3DAnimation/QAnimationController>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
-class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DAnimationController : public QObject
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DAnimationController : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3DExtras::QAnimationGroup> animationGroups READ animationGroups)
+ Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QAnimationGroup> animationGroups READ animationGroups)
public:
explicit QQuick3DAnimationController(QObject *parent = nullptr);
- inline Qt3DExtras::QAnimationController *parentAnimationController() const
+ inline Qt3DAnimation::QAnimationController *parentAnimationController() const
{
- return qobject_cast<Qt3DExtras::QAnimationController *>(parent());
+ return qobject_cast<Qt3DAnimation::QAnimationController *>(parent());
}
- QQmlListProperty<Qt3DExtras::QAnimationGroup> animationGroups();
+ QQmlListProperty<Qt3DAnimation::QAnimationGroup> animationGroups();
private:
- static void appendAnimationGroup(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list, Qt3DExtras::QAnimationGroup *bar);
- static QAnimationGroup *animationGroupAt(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list, int index);
- static int animationGroupCount(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list);
- static void clearAnimationGroups(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list);
+ static void appendAnimationGroup(QQmlListProperty<Qt3DAnimation::QAnimationGroup> *list, Qt3DAnimation::QAnimationGroup *bar);
+ static QAnimationGroup *animationGroupAt(QQmlListProperty<Qt3DAnimation::QAnimationGroup> *list, int index);
+ static int animationGroupCount(QQmlListProperty<Qt3DAnimation::QAnimationGroup> *list);
+ static void clearAnimationGroups(QQmlListProperty<Qt3DAnimation::QAnimationGroup> *list);
};
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationgroup.cpp b/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp
index 3e3813227..f10450280 100644
--- a/src/quick3d/quick3dextras/items/quick3danimationgroup.cpp
+++ b/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp
@@ -36,11 +36,11 @@
#include "quick3danimationgroup_p.h"
-#include <Qt3DExtras/qabstractanimation.h>
+#include <Qt3DAnimation/qabstractanimation.h>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
QQuick3DAnimationGroup::QQuick3DAnimationGroup(QObject *parent)
@@ -48,9 +48,9 @@ QQuick3DAnimationGroup::QQuick3DAnimationGroup(QObject *parent)
{
}
-QQmlListProperty<Qt3DExtras::QAbstractAnimation> QQuick3DAnimationGroup::animations()
+QQmlListProperty<Qt3DAnimation::QAbstractAnimation> QQuick3DAnimationGroup::animations()
{
- return QQmlListProperty<Qt3DExtras::QAbstractAnimation>(this, 0,
+ return QQmlListProperty<Qt3DAnimation::QAbstractAnimation>(this, 0,
&QQuick3DAnimationGroup::appendAnimation,
&QQuick3DAnimationGroup::animationCount,
&QQuick3DAnimationGroup::animationAt,
@@ -58,15 +58,15 @@ QQmlListProperty<Qt3DExtras::QAbstractAnimation> QQuick3DAnimationGroup::animati
}
-void QQuick3DAnimationGroup::appendAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list,
- Qt3DExtras::QAbstractAnimation *animation)
+void QQuick3DAnimationGroup::appendAnimation(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list,
+ Qt3DAnimation::QAbstractAnimation *animation)
{
QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
if (animationGroup)
animationGroup->parentAnimationGroup()->addAnimation(animation);
}
-int QQuick3DAnimationGroup::animationCount(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list)
+int QQuick3DAnimationGroup::animationCount(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list)
{
QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
if (animationGroup)
@@ -74,26 +74,26 @@ int QQuick3DAnimationGroup::animationCount(QQmlListProperty<Qt3DExtras::QAbstrac
return 0;
}
-Qt3DExtras::QAbstractAnimation *QQuick3DAnimationGroup::animationAt(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, int index)
+Qt3DAnimation::QAbstractAnimation *QQuick3DAnimationGroup::animationAt(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list, int index)
{
QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
if (animationGroup) {
- return qobject_cast<Qt3DExtras::QAbstractAnimation *>(
+ return qobject_cast<Qt3DAnimation::QAbstractAnimation *>(
animationGroup->parentAnimationGroup()->animationList().at(index));
}
return nullptr;
}
-void QQuick3DAnimationGroup::clearAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list)
+void QQuick3DAnimationGroup::clearAnimation(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list)
{
QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
if (animationGroup) {
- QVector<Qt3DExtras::QAbstractAnimation *> emptyList;
+ QVector<Qt3DAnimation::QAbstractAnimation *> emptyList;
animationGroup->parentAnimationGroup()->setAnimations(emptyList);
}
}
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationgroup_p.h b/src/quick3d/quick3danimation/items/quick3danimationgroup_p.h
index c7140c946..aef202480 100644
--- a/src/quick3d/quick3dextras/items/quick3danimationgroup_p.h
+++ b/src/quick3d/quick3danimation/items/quick3danimationgroup_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QT3DEXTRAS_QUICK_QUICK3DANIMATIONGROUP_P_H
-#define QT3DEXTRAS_QUICK_QUICK3DANIMATIONGROUP_P_H
+#ifndef QT3DANIMATION_QUICK_QUICK3DANIMATIONGROUP_P_H
+#define QT3DANIMATION_QUICK_QUICK3DANIMATIONGROUP_P_H
//
// W A R N I N G
@@ -49,42 +49,42 @@
//
#include <QtQml/qqmllist.h>
-#include <Qt3DExtras/qabstractanimation.h>
-#include <Qt3DExtras/qanimationgroup.h>
+#include <Qt3DAnimation/qabstractanimation.h>
+#include <Qt3DAnimation/qanimationgroup.h>
-#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <private/qt3dquickanimation_global_p.h>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
-class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DAnimationGroup : public QObject
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DAnimationGroup : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3DExtras::QAbstractAnimation> animations READ animations)
+ Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> animations READ animations)
public:
explicit QQuick3DAnimationGroup(QObject *parent = nullptr);
- inline Qt3DExtras::QAnimationGroup *parentAnimationGroup() const
+ inline Qt3DAnimation::QAnimationGroup *parentAnimationGroup() const
{
- return qobject_cast<Qt3DExtras::QAnimationGroup *>(parent());
+ return qobject_cast<Qt3DAnimation::QAnimationGroup *>(parent());
}
- QQmlListProperty<Qt3DExtras::QAbstractAnimation> animations();
+ QQmlListProperty<Qt3DAnimation::QAbstractAnimation> animations();
private:
- static void appendAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, Qt3DExtras::QAbstractAnimation *animation);
- static Qt3DExtras::QAbstractAnimation *animationAt(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, int index);
- static int animationCount(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list);
- static void clearAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list);
+ static void appendAnimation(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list, Qt3DAnimation::QAbstractAnimation *animation);
+ static Qt3DAnimation::QAbstractAnimation *animationAt(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list, int index);
+ static int animationCount(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list);
+ static void clearAnimation(QQmlListProperty<Qt3DAnimation::QAbstractAnimation> *list);
};
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h b/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h
index fddaae72d..e44efad68 100644
--- a/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h
+++ b/src/quick3d/quick3danimation/items/quick3dchannelmapper_p.h
@@ -66,6 +66,8 @@ class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT Quick3DChannelMapper : public QOb
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QChannelMapping> mappings READ qmlMappings CONSTANT)
+ Q_CLASSINFO("DefaultProperty", "mappings")
+
public:
explicit Quick3DChannelMapper(QObject *parent = nullptr);
diff --git a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp
index cfd9ca7d2..f7cf133fe 100644
--- a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp
+++ b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
QQuick3DKeyframeAnimation::QQuick3DKeyframeAnimation(QObject *parent)
@@ -96,6 +96,6 @@ void QQuick3DKeyframeAnimation::clearKeyframes(QQmlListProperty<Qt3DCore::QTrans
}
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation_p.h
index e8309de9e..944cdbe67 100644
--- a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h
+++ b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
-#define QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
+#ifndef QT3DANIMATION_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
+#define QT3DANIMATION_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
//
// W A R N I N G
@@ -50,16 +50,16 @@
#include <QtQml/qqmllist.h>
-#include <Qt3DExtras/qkeyframeanimation.h>
+#include <Qt3DAnimation/qkeyframeanimation.h>
-#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <private/qt3dquickanimation_global_p.h>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
-class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DKeyframeAnimation : public QObject
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DKeyframeAnimation : public QObject
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<Qt3DCore::QTransform> keyframes READ keyframes)
@@ -85,8 +85,8 @@ private:
};
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
-#endif // QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
+#endif // QT3DANIMATION_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp b/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp
index 61636f06d..997e2e215 100644
--- a/src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp
+++ b/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
QQuick3DMorphingAnimation::QQuick3DMorphingAnimation(QObject *parent)
@@ -46,24 +46,24 @@ QQuick3DMorphingAnimation::QQuick3DMorphingAnimation(QObject *parent)
{
}
-QQmlListProperty<Qt3DExtras::QMorphTarget> QQuick3DMorphingAnimation::morphTargets()
+QQmlListProperty<Qt3DAnimation::QMorphTarget> QQuick3DMorphingAnimation::morphTargets()
{
- return QQmlListProperty<Qt3DExtras::QMorphTarget>(this, 0,
+ return QQmlListProperty<Qt3DAnimation::QMorphTarget>(this, 0,
&QQuick3DMorphingAnimation::appendMorphTarget,
&QQuick3DMorphingAnimation::morphTargetCount,
&QQuick3DMorphingAnimation::morphTargetAt,
&QQuick3DMorphingAnimation::clearMorphTargets);
}
-void QQuick3DMorphingAnimation::appendMorphTarget(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
- Qt3DExtras::QMorphTarget *morphTarget)
+void QQuick3DMorphingAnimation::appendMorphTarget(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget)
{
QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
if (animation)
animation->parentMorphingAnimation()->addMorphTarget(morphTarget);
}
-int QQuick3DMorphingAnimation::morphTargetCount(QQmlListProperty<Qt3DExtras::QMorphTarget> *list)
+int QQuick3DMorphingAnimation::morphTargetCount(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
{
QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
if (animation)
@@ -71,27 +71,27 @@ int QQuick3DMorphingAnimation::morphTargetCount(QQmlListProperty<Qt3DExtras::QMo
return 0;
}
-Qt3DExtras::QMorphTarget *QQuick3DMorphingAnimation::morphTargetAt(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+Qt3DAnimation::QMorphTarget *QQuick3DMorphingAnimation::morphTargetAt(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
int index)
{
QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
if (animation) {
- return qobject_cast<Qt3DExtras::QMorphTarget *>(
+ return qobject_cast<Qt3DAnimation::QMorphTarget *>(
animation->parentMorphingAnimation()->morphTargetList().at(index));
}
return nullptr;
}
-void QQuick3DMorphingAnimation::clearMorphTargets(QQmlListProperty<Qt3DExtras::QMorphTarget> *list)
+void QQuick3DMorphingAnimation::clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
{
QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
if (animation) {
- QVector<Qt3DExtras::QMorphTarget *> emptyList;
+ QVector<Qt3DAnimation::QMorphTarget *> emptyList;
animation->parentMorphingAnimation()->setMorphTargets(emptyList);
}
}
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h b/src/quick3d/quick3danimation/items/quick3dmorphinganimation_p.h
index 5f052fd04..31d008a89 100644
--- a/src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h
+++ b/src/quick3d/quick3danimation/items/quick3dmorphinganimation_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
-#define QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
+#ifndef QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
+#define QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
//
// W A R N I N G
@@ -50,19 +50,19 @@
#include <QtQml/qqmllist.h>
-#include <Qt3DExtras/qmorphinganimation.h>
+#include <Qt3DAnimation/qmorphinganimation.h>
-#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <private/qt3dquickanimation_global_p.h>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
-class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DMorphingAnimation : public QObject
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DMorphingAnimation : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3DExtras::QMorphTarget> morphTargets READ morphTargets)
+ Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets READ morphTargets)
public:
QQuick3DMorphingAnimation(QObject *parent = nullptr);
@@ -72,21 +72,21 @@ public:
return qobject_cast<QMorphingAnimation *>(parent());
}
- QQmlListProperty<Qt3DExtras::QMorphTarget> morphTargets();
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets();
private:
- static void appendMorphTarget(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
- Qt3DExtras::QMorphTarget *morphTarget);
- static Qt3DExtras::QMorphTarget *morphTargetAt(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+ static void appendMorphTarget(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget);
+ static Qt3DAnimation::QMorphTarget *morphTargetAt(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
int index);
- static int morphTargetCount(QQmlListProperty<Qt3DExtras::QMorphTarget> *list);
- static void clearMorphTargets(QQmlListProperty<Qt3DExtras::QMorphTarget> *list);
+ static int morphTargetCount(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
+ static void clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
};
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
-#endif // QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
+#endif // QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp b/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp
index 8c1b9f0c1..81144e186 100644
--- a/src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp
+++ b/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
QQuick3DMorphTarget::QQuick3DMorphTarget(QObject *parent)
@@ -88,6 +88,6 @@ void QQuick3DMorphTarget::clearAttributes(QQmlListProperty<Qt3DRender::QAttribut
}
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h b/src/quick3d/quick3danimation/items/quick3dmorphtarget_p.h
index e5c664370..03b52dfeb 100644
--- a/src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h
+++ b/src/quick3d/quick3danimation/items/quick3dmorphtarget_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
-#define QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
+#ifndef QT3DANIMATION_QUICK_QUICK3DMORPHTARGET_P_H
+#define QT3DANIMATION_QUICK_QUICK3DMORPHTARGET_P_H
//
// W A R N I N G
@@ -48,16 +48,16 @@
// We mean it.
//
-#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <private/qt3dquickanimation_global_p.h>
#include <QQmlListProperty>
-#include <Qt3DExtras/QMorphTarget>
+#include <Qt3DAnimation/QMorphTarget>
QT_BEGIN_NAMESPACE
-namespace Qt3DExtras {
+namespace Qt3DAnimation {
namespace Quick {
-class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DMorphTarget : public QObject
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DMorphTarget : public QObject
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<Qt3DRender::QAttribute> attributes READ attributes)
@@ -78,8 +78,8 @@ private:
};
} // namespace Quick
-} // namespace Qt3DExtras
+} // namespace Qt3DAnimation
QT_END_NAMESPACE
-#endif // QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
+#endif // QT3DANIMATION_QUICK_QUICK3DMORPHTARGET_P_H
diff --git a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp
new file mode 100644
index 000000000..2dffb7858
--- /dev/null
+++ b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "quick3dvertexblendanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DAnimation {
+namespace Quick {
+
+QQuick3DVertexBlendAnimation::QQuick3DVertexBlendAnimation(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DAnimation::QMorphTarget> QQuick3DVertexBlendAnimation::morphTargets()
+{
+ return QQmlListProperty<Qt3DAnimation::QMorphTarget>(this, 0,
+ &QQuick3DVertexBlendAnimation::appendMorphTarget,
+ &QQuick3DVertexBlendAnimation::morphTargetCount,
+ &QQuick3DVertexBlendAnimation::morphTargetAt,
+ &QQuick3DVertexBlendAnimation::clearMorphTargets);
+}
+
+void QQuick3DVertexBlendAnimation::appendMorphTarget(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation)
+ animation->parentVertexBlendAnimation()->addMorphTarget(morphTarget);
+}
+
+int QQuick3DVertexBlendAnimation::morphTargetCount(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation)
+ return animation->parentVertexBlendAnimation()->morphTargetList().count();
+ return 0;
+}
+
+Qt3DAnimation::QMorphTarget *QQuick3DVertexBlendAnimation::morphTargetAt(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ int index)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation) {
+ return qobject_cast<Qt3DAnimation::QMorphTarget *>(
+ animation->parentVertexBlendAnimation()->morphTargetList().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DVertexBlendAnimation::clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list)
+{
+ QQuick3DVertexBlendAnimation *animation
+ = qobject_cast<QQuick3DVertexBlendAnimation *>(list->object);
+ if (animation) {
+ QVector<Qt3DAnimation::QMorphTarget *> emptyList;
+ animation->parentVertexBlendAnimation()->setMorphTargets(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DAnimation
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h
new file mode 100644
index 000000000..6be2d662f
--- /dev/null
+++ b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DANIMATION_QUICK_QUICK3DVERTEXBLENDANIMATION_P_H
+#define QT3DANIMATION_QUICK_QUICK3DVERTEXBLENDANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+
+#include <Qt3DAnimation/qvertexblendanimation.h>
+
+#include <private/qt3dquickanimation_global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DAnimation {
+namespace Quick {
+
+class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT QQuick3DVertexBlendAnimation : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets READ morphTargets)
+
+public:
+ QQuick3DVertexBlendAnimation(QObject *parent = nullptr);
+
+ inline QVertexBlendAnimation *parentVertexBlendAnimation() const
+ {
+ return qobject_cast<QVertexBlendAnimation *>(parent());
+ }
+
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> morphTargets();
+
+private:
+
+ static void appendMorphTarget(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ Qt3DAnimation::QMorphTarget *morphTarget);
+ static Qt3DAnimation::QMorphTarget *morphTargetAt(
+ QQmlListProperty<Qt3DAnimation::QMorphTarget> *list,
+ int index);
+ static int morphTargetCount(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
+ static void clearMorphTargets(QQmlListProperty<Qt3DAnimation::QMorphTarget> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DAnimation
+
+QT_END_NAMESPACE
+
+#endif // QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/items/items.pri b/src/quick3d/quick3dextras/items/items.pri
index cdb1e1245..b6f5d1877 100644
--- a/src/quick3d/quick3dextras/items/items.pri
+++ b/src/quick3d/quick3dextras/items/items.pri
@@ -1,15 +1,8 @@
HEADERS += \
- $$PWD/quick3danimationcontroller_p.h \
- $$PWD/quick3danimationgroup_p.h \
- $$PWD/quick3dkeyframeanimation_p.h \
- $$PWD/quick3dmorphinganimation_p.h \
- $$PWD/quick3dmorphtarget_p.h
+ $$PWD/quick3dlevelofdetailloader_p.h \
+ $$PWD/quick3dlevelofdetailloader_p_p.h
SOURCES += \
- $$PWD/quick3danimationcontroller.cpp \
- $$PWD/quick3danimationgroup.cpp \
- $$PWD/quick3dkeyframeanimation.cpp \
- $$PWD/quick3dmorphinganimation.cpp \
- $$PWD/quick3dmorphtarget.cpp
+ $$PWD/quick3dlevelofdetailloader.cpp
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp
new file mode 100644
index 000000000..087342063
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp
@@ -0,0 +1,194 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** 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.LGPL3 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-3.0.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 (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dlevelofdetailloader_p_p.h"
+#include <Qt3DRender/qlevelofdetailboundingsphere.h>
+#include <Qt3DRender/qcamera.h>
+#include <Qt3DQuick/private/quick3dentityloader_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Extras {
+namespace Quick {
+
+Quick3DLevelOfDetailLoaderPrivate::Quick3DLevelOfDetailLoaderPrivate()
+ : QEntityPrivate()
+ , m_loader(new Qt3DCore::Quick::Quick3DEntityLoader)
+ , m_lod(new Qt3DRender::QLevelOfDetail)
+{
+}
+
+Quick3DLevelOfDetailLoader::Quick3DLevelOfDetailLoader(QNode *parent)
+ : QEntity(*new Quick3DLevelOfDetailLoaderPrivate, parent)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_loader->setParent(this);
+ d->m_loader->addComponent(d->m_lod);
+
+ connect(d->m_lod, &Qt3DRender::QLevelOfDetail::cameraChanged,
+ this, &Quick3DLevelOfDetailLoader::cameraChanged);
+ connect(d->m_lod, &Qt3DRender::QLevelOfDetail::currentIndexChanged,
+ this, &Quick3DLevelOfDetailLoader::currentIndexChanged);
+ connect(d->m_lod, &Qt3DRender::QLevelOfDetail::thresholdTypeChanged,
+ this, &Quick3DLevelOfDetailLoader::thresholdTypeChanged);
+ connect(d->m_lod, &Qt3DRender::QLevelOfDetail::thresholdsChanged,
+ this, &Quick3DLevelOfDetailLoader::thresholdsChanged);
+ connect(d->m_lod, &Qt3DRender::QLevelOfDetail::volumeOverrideChanged,
+ this, &Quick3DLevelOfDetailLoader::volumeOverrideChanged);
+ connect(d->m_loader, &Qt3DCore::Quick::Quick3DEntityLoader::entityChanged,
+ this, &Quick3DLevelOfDetailLoader::entityChanged);
+ connect(d->m_loader, &Qt3DCore::Quick::Quick3DEntityLoader::sourceChanged,
+ this, &Quick3DLevelOfDetailLoader::sourceChanged);
+
+ connect(this, &Quick3DLevelOfDetailLoader::enabledChanged,
+ d->m_lod, &Qt3DRender::QLevelOfDetail::setEnabled);
+
+ auto applyCurrentSource = [this] {
+ Q_D(Quick3DLevelOfDetailLoader);
+ const auto index = currentIndex();
+ if (index >= 0 && index < d->m_sources.size())
+ d->m_loader->setSource(d->m_sources.at(index).toUrl());
+ };
+
+ connect(this, &Quick3DLevelOfDetailLoader::sourcesChanged,
+ this, applyCurrentSource);
+ connect(this, &Quick3DLevelOfDetailLoader::currentIndexChanged,
+ this, applyCurrentSource);
+}
+
+QVariantList Quick3DLevelOfDetailLoader::sources() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_sources;
+}
+
+void Quick3DLevelOfDetailLoader::setSources(const QVariantList &sources)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ if (d->m_sources != sources) {
+ d->m_sources = sources;
+ emit sourcesChanged();
+ }
+}
+
+Qt3DRender::QCamera *Quick3DLevelOfDetailLoader::camera() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_lod->camera();
+}
+
+void Quick3DLevelOfDetailLoader::setCamera(Qt3DRender::QCamera *camera)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_lod->setCamera(camera);
+}
+
+int Quick3DLevelOfDetailLoader::currentIndex() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_lod->currentIndex();
+}
+
+void Quick3DLevelOfDetailLoader::setCurrentIndex(int currentIndex)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_lod->setCurrentIndex(currentIndex);
+}
+
+Qt3DRender::QLevelOfDetail::ThresholdType Quick3DLevelOfDetailLoader::thresholdType() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_lod->thresholdType();
+}
+
+void Quick3DLevelOfDetailLoader::setThresholdType(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_lod->setThresholdType(thresholdType);
+}
+
+QVector<qreal> Quick3DLevelOfDetailLoader::thresholds() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_lod->thresholds();
+}
+
+void Quick3DLevelOfDetailLoader::setThresholds(const QVector<qreal> &thresholds)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_lod->setThresholds(thresholds);
+}
+
+Qt3DRender::QLevelOfDetailBoundingSphere Quick3DLevelOfDetailLoader::createBoundingSphere(const QVector3D &center, float radius)
+{
+ return Qt3DRender::QLevelOfDetailBoundingSphere(center, radius);
+}
+
+Qt3DRender::QLevelOfDetailBoundingSphere Quick3DLevelOfDetailLoader::volumeOverride() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_lod->volumeOverride();
+}
+
+void Quick3DLevelOfDetailLoader::setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride)
+{
+ Q_D(Quick3DLevelOfDetailLoader);
+ d->m_lod->setVolumeOverride(volumeOverride);
+}
+
+QObject *Quick3DLevelOfDetailLoader::entity() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_loader->entity();
+}
+
+QUrl Quick3DLevelOfDetailLoader::source() const
+{
+ Q_D(const Quick3DLevelOfDetailLoader);
+ return d->m_loader->source();
+}
+
+} // namespace Quick
+} // namespace Extras
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+
diff --git a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h
new file mode 100644
index 000000000..445e7bca6
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** 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.LGPL3 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-3.0.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 (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
+#define QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickExtras/private/qt3dquickextras_global_p.h>
+#include <Qt3DCore/qentity.h>
+#include <Qt3DRender/qlevelofdetail.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Extras {
+namespace Quick {
+
+class Quick3DLevelOfDetailLoaderPrivate;
+
+class QT3DQUICKEXTRASSHARED_PRIVATE_EXPORT Quick3DLevelOfDetailLoader : public Qt3DCore::QEntity
+{
+ Q_OBJECT
+ Q_PROPERTY(QVariantList sources READ sources WRITE setSources NOTIFY sourcesChanged)
+
+ Q_PROPERTY(Qt3DRender::QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged)
+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
+ Q_PROPERTY(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType READ thresholdType WRITE setThresholdType NOTIFY thresholdTypeChanged)
+ Q_PROPERTY(QVector<qreal> thresholds READ thresholds WRITE setThresholds NOTIFY thresholdsChanged)
+ Q_PROPERTY(Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride READ volumeOverride WRITE setVolumeOverride NOTIFY volumeOverrideChanged)
+
+ Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
+ Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged)
+public:
+ explicit Quick3DLevelOfDetailLoader(QNode *parent = 0);
+
+ QVariantList sources() const;
+ void setSources(const QVariantList &sources);
+
+ Qt3DRender::QCamera *camera() const;
+ void setCamera(Qt3DRender::QCamera *camera);
+ int currentIndex() const;
+ void setCurrentIndex(int currentIndex);
+ Qt3DRender::QLevelOfDetail::ThresholdType thresholdType() const;
+ void setThresholdType(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType);
+ QVector<qreal> thresholds() const;
+ void setThresholds(const QVector<qreal> &thresholds);
+ Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride() const;
+ void setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride);
+
+ Q_INVOKABLE Qt3DRender::QLevelOfDetailBoundingSphere createBoundingSphere(const QVector3D &center, float radius);
+
+ QObject *entity() const;
+ QUrl source() const;
+
+Q_SIGNALS:
+ void sourcesChanged();
+ void cameraChanged();
+ void currentIndexChanged();
+ void thresholdTypeChanged();
+ void thresholdsChanged();
+ void volumeOverrideChanged();
+ void entityChanged();
+ void sourceChanged();
+
+private:
+ Q_DECLARE_PRIVATE(Quick3DLevelOfDetailLoader)
+};
+
+} // namespace Quick
+} // namespace Extras
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_H
diff --git a/src/quick3d/quick3danimation/items/quick3dabstractclipblendnode_p.h b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p_p.h
index bfb1825a7..b123ea30b 100644
--- a/src/quick3d/quick3danimation/items/quick3dabstractclipblendnode_p.h
+++ b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p_p.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QT3DANIMATION_ANIMATION_QUICK3DABSTRACTCLIPBLENDNODE_P_H
-#define QT3DANIMATION_ANIMATION_QUICK3DABSTRACTCLIPBLENDNODE_P_H
+#ifndef QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_P_H
+#define QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_P_H
//
// W A R N I N G
@@ -51,39 +51,37 @@
// We mean it.
//
-#include <Qt3DQuickAnimation/private/qt3dquickanimation_global_p.h>
-#include <Qt3DAnimation/qabstractclipblendnode.h>
-#include <Qt3DAnimation/qanimationclip.h>
-#include <QQmlListProperty>
+#include "quick3dlevelofdetailloader_p.h"
+#include <Qt3DCore/private/qentity_p.h>
QT_BEGIN_NAMESPACE
-namespace Qt3DAnimation {
-namespace Animation {
+namespace Qt3DCore {
namespace Quick {
+class Quick3DEntityLoader;
+}
+}
-class QT3DQUICKANIMATIONSHARED_PRIVATE_EXPORT Quick3DAbstractClipBlendNode : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Qt3DAnimation::QAnimationClip> clips READ clipList CONSTANT)
+namespace Qt3DExtras {
+namespace Extras {
+namespace Quick {
+class Quick3DLevelOfDetailLoaderPrivate : public Qt3DCore::QEntityPrivate
+{
public:
- explicit Quick3DAbstractClipBlendNode(QObject *parent = nullptr);
+ Quick3DLevelOfDetailLoaderPrivate();
- inline QAbstractClipBlendNode *parentAbstractClipBlendNode() const { return qobject_cast<QAbstractClipBlendNode *>(parent()); }
- QQmlListProperty<QAnimationClip> clipList();
+ Q_DECLARE_PUBLIC(Quick3DLevelOfDetailLoader)
-private:
- static void appendClip(QQmlListProperty<QAnimationClip> *list, QAnimationClip *clip);
- static QAnimationClip *clipAt(QQmlListProperty<QAnimationClip> *list, int index);
- static int clipCount(QQmlListProperty<QAnimationClip> *list);
- static void clearClips(QQmlListProperty<QAnimationClip> *list);
+ QVariantList m_sources;
+ Qt3DCore::Quick::Quick3DEntityLoader *m_loader;
+ Qt3DRender::QLevelOfDetail *m_lod;
};
-} // Quick
-} // Animation
-} // Qt3DAnimation
+} // namespace Quick
+} // namespace Extras
+} // namespace Qt3DExtras
QT_END_NAMESPACE
-#endif // QT3DANIMATION_ANIMATION_QUICK3DABSTRACTCLIPBLENDNODE_P_H
+#endif // QT3DEXTRAS_EXTRAS_QUICK_QUICK3DLEVELOFDETAILLOADER_P_P_H
diff --git a/src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml b/src/quick3d/quick3dextras/qt3dquickextras_global_p.h
index 5b770a56d..524393743 100644
--- a/src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml
+++ b/src/quick3d/quick3dextras/qt3dquickextras_global_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
@@ -37,23 +37,27 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
+#ifndef QT3DQUICKEXTRAS_GLOBAL_P_H
+#define QT3DQUICKEXTRAS_GLOBAL_P_H
-Material {
- id:root
- property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- property color diffuse: Qt.rgba( 0.7, 0.7, 0.7, 1.0 )
- property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 )
- property real shininess: 150.0
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
- parameters: [
- Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) },
- Parameter { name: "kd"; value: Qt.vector3d(root.diffuse.r, root.diffuse.g, root.diffuse.b) },
- Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) },
- Parameter { name: "shininess"; value: root.shininess }
- ]
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <QtQml/qqml.h>
- effect: DefaultEffect {}
-}
+#define QT3DQUICKEXTRASSHARED_PRIVATE_EXPORT QT3DQUICKEXTRASSHARED_EXPORT
+QT_BEGIN_NAMESPACE
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKEXTRAS_GLOBAL_P_H
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.cpp b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
index 8a7921d8e..91773bb66 100644
--- a/src/quick3d/quick3dextras/qt3dquickwindow.cpp
+++ b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
@@ -49,21 +49,23 @@
****************************************************************************/
#include <Qt3DQuickExtras/qt3dquickwindow.h>
+#include "qt3dquickwindow_p.h"
#include <Qt3DQuick/QQmlAspectEngine>
-#include <Qt3DRender/qcamera.h>
-#include <Qt3DRender/qrenderaspect.h>
-#include <Qt3DRender/qrendersurfaceselector.h>
-#include <Qt3DRender/private/qrendersurfaceselector_p.h>
+#include <Qt3DQuickExtras/qt3dquickwindow.h>
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DInput/qinputsettings.h>
#include <Qt3DLogic/qlogicaspect.h>
-
-#include <QQmlContext>
-#include <qqmlincubator.h>
-#include <QGuiApplication>
-#include <QScreen>
-
+#include <Qt3DRender/qcamera.h>
+#include <Qt3DRender/qrenderaspect.h>
+#include <Qt3DRender/qrendersurfaceselector.h>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
#include <QtGui/qopenglcontext.h>
+#include <QtQml/QQmlContext>
+#include <QtQml/qqmlincubator.h>
+
+#include <Qt3DQuickExtras/private/qt3dquickwindowlogging_p.h>
+#include <Qt3DRender/private/qrendersurfaceselector_p.h>
QT_BEGIN_NAMESPACE
@@ -95,16 +97,21 @@ private:
} // anonymous
-Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
- : QWindow(parent)
- , m_engine(nullptr)
+Qt3DQuickWindowPrivate::Qt3DQuickWindowPrivate()
+ : m_engine(nullptr)
, m_renderAspect(nullptr)
, m_inputAspect(nullptr)
, m_logicAspect(nullptr)
, m_initialized(false)
- , m_cameraAspectRatioMode(AutomaticAspectRatio)
+ , m_cameraAspectRatioMode(Qt3DQuickWindow::AutomaticAspectRatio)
, m_incubationController(nullptr)
{
+}
+
+Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
+ : QWindow(*new Qt3DQuickWindowPrivate(), parent)
+{
+ Q_D(Qt3DQuickWindow);
setSurfaceType(QSurface::OpenGLSurface);
resize(1024, 768);
@@ -123,80 +130,88 @@ Qt3DQuickWindow::Qt3DQuickWindow(QWindow *parent)
format.setStencilBufferSize(8);
setFormat(format);
QSurfaceFormat::setDefaultFormat(format);
- create();
- m_engine.reset(new Qt3DCore::Quick::QQmlAspectEngine);
- m_renderAspect = new Qt3DRender::QRenderAspect;
- m_inputAspect = new Qt3DInput::QInputAspect;
- m_logicAspect = new Qt3DLogic::QLogicAspect;
+ d->m_engine = new Qt3DCore::Quick::QQmlAspectEngine;
+ d->m_renderAspect = new Qt3DRender::QRenderAspect;
+ d->m_inputAspect = new Qt3DInput::QInputAspect;
+ d->m_logicAspect = new Qt3DLogic::QLogicAspect;
- m_engine->aspectEngine()->registerAspect(m_renderAspect);
- m_engine->aspectEngine()->registerAspect(m_inputAspect);
- m_engine->aspectEngine()->registerAspect(m_logicAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_renderAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_inputAspect);
+ d->m_engine->aspectEngine()->registerAspect(d->m_logicAspect);
}
Qt3DQuickWindow::~Qt3DQuickWindow()
{
+ Q_D(Qt3DQuickWindow);
+ delete d->m_engine;
}
void Qt3DQuickWindow::registerAspect(Qt3DCore::QAbstractAspect *aspect)
{
Q_ASSERT(!isVisible());
- m_engine->aspectEngine()->registerAspect(aspect);
+ Q_D(Qt3DQuickWindow);
+ d->m_engine->aspectEngine()->registerAspect(aspect);
}
void Qt3DQuickWindow::registerAspect(const QString &name)
{
Q_ASSERT(!isVisible());
- m_engine->aspectEngine()->registerAspect(name);
+ Q_D(Qt3DQuickWindow);
+ d->m_engine->aspectEngine()->registerAspect(name);
}
void Qt3DQuickWindow::setSource(const QUrl &source)
{
- m_source = source;
+ Q_D(Qt3DQuickWindow);
+ d->m_source = source;
}
Qt3DCore::Quick::QQmlAspectEngine *Qt3DQuickWindow::engine() const
{
- return m_engine.data();
+ Q_D(const Qt3DQuickWindow);
+ return d->m_engine;
}
void Qt3DQuickWindow::setCameraAspectRatioMode(CameraAspectRatioMode mode)
{
- if (m_cameraAspectRatioMode == mode)
+ Q_D(Qt3DQuickWindow);
+ if (d->m_cameraAspectRatioMode == mode)
return;
- m_cameraAspectRatioMode = mode;
+ d->m_cameraAspectRatioMode = mode;
setCameraAspectModeHelper();
emit cameraAspectRatioModeChanged(mode);
}
Qt3DQuickWindow::CameraAspectRatioMode Qt3DQuickWindow::cameraAspectRatioMode() const
{
- return m_cameraAspectRatioMode;
+ Q_D(const Qt3DQuickWindow);
+ return d->m_cameraAspectRatioMode;
}
void Qt3DQuickWindow::showEvent(QShowEvent *e)
{
- if (!m_initialized) {
+ Q_D(Qt3DQuickWindow);
+ if (!d->m_initialized) {
// Connect to the QQmlAspectEngine's statusChanged signal so that when the QML is loaded
// and th eobjects hav ebeen instantiated, but before we set them on the QAspectEngine we
// can swoop in and set the window surface and camera on the framegraph and ensure the camera
// respects the window's aspect ratio
- connect(m_engine.data(), &Qt3DCore::Quick::QQmlAspectEngine::sceneCreated,
+ connect(d->m_engine, &Qt3DCore::Quick::QQmlAspectEngine::sceneCreated,
this, &Qt3DQuickWindow::onSceneCreated);
- m_engine->setSource(m_source);
+ d->m_engine->setSource(d->m_source);
// Set the QQmlIncubationController on the window
// to benefit from asynchronous incubation
- if (!m_incubationController)
- m_incubationController = new Qt3DQuickWindowIncubationController(this);
+ if (!d->m_incubationController)
+ d->m_incubationController = new Qt3DQuickWindowIncubationController(this);
- m_engine->qmlEngine()->setIncubationController(m_incubationController);
+ d->m_engine->qmlEngine()->setIncubationController(d->m_incubationController);
- m_initialized = true;
+ d->m_initialized = true;
}
QWindow::showEvent(e);
}
@@ -204,17 +219,18 @@ void Qt3DQuickWindow::showEvent(QShowEvent *e)
void Qt3DQuickWindow::onSceneCreated(QObject *rootObject)
{
Q_ASSERT(rootObject);
+ Q_D(Qt3DQuickWindow);
setWindowSurface(rootObject);
- if (m_cameraAspectRatioMode == AutomaticAspectRatio) {
+ if (d->m_cameraAspectRatioMode == AutomaticAspectRatio) {
// Set aspect ratio of first camera to match the window
QList<Qt3DRender::QCamera *> cameras
= rootObject->findChildren<Qt3DRender::QCamera *>();
if (cameras.isEmpty()) {
- qWarning() << "No camera found";
+ qCDebug(QuickWindow) << "No camera found";
} else {
- m_camera = cameras.first();
+ d->m_camera = cameras.first();
setCameraAspectModeHelper();
}
}
@@ -224,7 +240,7 @@ void Qt3DQuickWindow::onSceneCreated(QObject *rootObject)
if (inputSettings) {
inputSettings->setEventSource(this);
} else {
- qWarning() << "No Input Settings found, keyboard and mouse events won't be handled";
+ qCDebug(QuickWindow) << "No Input Settings found, keyboard and mouse events won't be handled";
}
}
@@ -237,7 +253,8 @@ void Qt3DQuickWindow::setWindowSurface(QObject *rootObject)
void Qt3DQuickWindow::setCameraAspectModeHelper()
{
- switch (m_cameraAspectRatioMode) {
+ Q_D(Qt3DQuickWindow);
+ switch (d->m_cameraAspectRatioMode) {
case AutomaticAspectRatio:
connect(this, &QWindow::widthChanged, this, &Qt3DQuickWindow::updateCameraAspectRatio);
connect(this, &QWindow::heightChanged, this, &Qt3DQuickWindow::updateCameraAspectRatio);
@@ -253,9 +270,10 @@ void Qt3DQuickWindow::setCameraAspectModeHelper()
void Qt3DQuickWindow::updateCameraAspectRatio()
{
- if (m_camera) {
- m_camera->setAspectRatio(static_cast<float>(width()) /
- static_cast<float>(height()));
+ Q_D(Qt3DQuickWindow);
+ if (d->m_camera) {
+ d->m_camera->setAspectRatio(static_cast<float>(width()) /
+ static_cast<float>(height()));
}
}
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.h b/src/quick3d/quick3dextras/qt3dquickwindow.h
index a8703093e..0880fc160 100644
--- a/src/quick3d/quick3dextras/qt3dquickwindow.h
+++ b/src/quick3d/quick3dextras/qt3dquickwindow.h
@@ -52,9 +52,9 @@
#define QT3DEXTRAS_QUICK_QT3DQUICKWINDOW_H
#include <Qt3DQuickExtras/qt3dquickextras_global.h>
-#include <QQuickWindow>
+#include <QtCore/QUrl>
#include <QtCore/qpointer.h>
-#include <QUrl>
+#include <QtQuick/QQuickWindow>
QT_BEGIN_NAMESPACE
@@ -84,6 +84,7 @@ namespace Qt3DExtras {
namespace Quick {
+class Qt3DQuickWindowPrivate;
class QT3DQUICKEXTRASSHARED_EXPORT Qt3DQuickWindow : public QWindow
{
@@ -121,18 +122,7 @@ private:
void setCameraAspectModeHelper();
void updateCameraAspectRatio();
- QScopedPointer<Qt3DCore::Quick::QQmlAspectEngine> m_engine;
-
- // Aspects
- Qt3DRender::QRenderAspect *m_renderAspect;
- Qt3DInput::QInputAspect *m_inputAspect;
- Qt3DLogic::QLogicAspect *m_logicAspect;
-
- QUrl m_source;
- bool m_initialized;
- QPointer<Qt3DRender::QCamera> m_camera;
- CameraAspectRatioMode m_cameraAspectRatioMode;
- QQmlIncubationController *m_incubationController;
+ Q_DECLARE_PRIVATE(Qt3DQuickWindow)
};
} // Quick
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow_p.h b/src/quick3d/quick3dextras/qt3dquickwindow_p.h
new file mode 100644
index 000000000..f2f8d0492
--- /dev/null
+++ b/src/quick3d/quick3dextras/qt3dquickwindow_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://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$
+**
+****************************************************************************/
+
+#ifndef QT3DQUICKWINDOW_P_H
+#define QT3DQUICKWINDOW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/private/qwindow_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+
+namespace Quick {
+
+class Qt3DQuickWindowPrivate : public QWindowPrivate
+{
+public:
+ Qt3DQuickWindowPrivate();
+
+ Qt3DCore::Quick::QQmlAspectEngine *m_engine;
+
+ // Aspects
+ Qt3DRender::QRenderAspect *m_renderAspect;
+ Qt3DInput::QInputAspect *m_inputAspect;
+ Qt3DLogic::QLogicAspect *m_logicAspect;
+
+ QUrl m_source;
+ bool m_initialized;
+ QPointer<Qt3DRender::QCamera> m_camera;
+ Qt3DQuickWindow::CameraAspectRatioMode m_cameraAspectRatioMode;
+ QQmlIncubationController *m_incubationController;
+
+ Q_DECLARE_PUBLIC(Qt3DQuickWindow)
+};
+
+} // Quick
+
+} // Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKWINDOW_P_H
diff --git a/src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml b/src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp
index 70c461edd..cd74d6b3e 100644
--- a/src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml
+++ b/src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2015 Lorenz Esch (TU Ilmenau).
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the Qt3D module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,17 +37,14 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
+#include "qt3dquickwindowlogging_p.h"
-Material {
- id: root
+QT_BEGIN_NAMESPACE
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/pervertexcolor.vert"
- fragmentES: "qrc:/shaders/es2/pervertexcolor.frag"
- vertex: "qrc:/shaders/gl3/pervertexcolor.vert"
- fragment: "qrc:/shaders/gl3/pervertexcolor.frag"
- }
-}
+namespace Qt3DExtras {
+Q_LOGGING_CATEGORY(QuickWindow, "Qt3D.QuickWindow", QtWarningMsg)
+
+} // Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml b/src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h
index 387d8d4aa..75a774dda 100644
--- a/src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml
+++ b/src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the Qt3D module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,32 +37,30 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
+#ifndef QT3D_QUICKWINDOWLOGGING_P_H
+#define QT3D_QUICKWINDOWLOGGING_P_H
-Material {
- id: root
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
- property Texture2D texture: Texture2D {}
- property alias textureOffset: texCoordOffset.offset
+#include <QLoggingCategory>
- parameters: [
- Parameter {
- name: "diffuseTexture"
- value: root.texture
- },
- Parameter {
- id: texCoordOffset
- property vector2d offset: Qt.vector2d(0, 0)
- name: "texCoordOffset"
- value: offset
- }
- ]
+QT_BEGIN_NAMESPACE
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/unlittexture.vert"
- fragmentES: "qrc:/shaders/es2/unlittexture.frag"
- vertex: "qrc:/shaders/gl3/unlittexture.vert"
- fragment: "qrc:/shaders/gl3/unlittexture.frag"
- }
-}
+namespace Qt3DExtras {
+
+Q_DECLARE_LOGGING_CATEGORY(QuickWindow)
+
+} // Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QUICKWINDOWLOGGING_P_H
diff --git a/src/quick3d/quick3dextras/quick3dextras.pro b/src/quick3d/quick3dextras/quick3dextras.pro
index 4f103765c..976430eba 100644
--- a/src/quick3d/quick3dextras/quick3dextras.pro
+++ b/src/quick3d/quick3dextras/quick3dextras.pro
@@ -1,7 +1,8 @@
TARGET = Qt3DQuickExtras
MODULE = 3dquickextras
-QT += core core-private qml qml-private 3dcore 3dinput 3dquick 3drender 3drender-private 3dlogic 3dextras
+QT += core core-private qml qml-private 3dcore 3dinput 3dquick 3dquick-private 3drender 3drender-private 3dlogic 3dextras
+
CONFIG -= precompile_header
# Qt3D is free of Q_FOREACH - make sure it stays that way:
@@ -13,12 +14,15 @@ gcov {
}
SOURCES += \
- qt3dquickwindow.cpp
-
+ qt3dquickwindow.cpp \
+ qt3dquickwindowlogging.cpp
HEADERS += \
qt3dquickextras_global.h \
- qt3dquickwindow.h
+ qt3dquickextras_global_p.h \
+ qt3dquickwindow.h \
+ qt3dquickwindow_p.h \
+ qt3dquickwindowlogging_p.h
# otherwise mingw headers do not declare common functions like ::strcasecmp
win32-g++*:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
diff --git a/src/quick3d/quick3dinput/items/quick3daction.cpp b/src/quick3d/quick3dinput/items/quick3daction.cpp
index b3b99e504..33752c6e0 100644
--- a/src/quick3d/quick3dinput/items/quick3daction.cpp
+++ b/src/quick3d/quick3dinput/items/quick3daction.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3daction_p.h"
+#include <Qt3DQuickInput/private/quick3daction_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3daction_p.h b/src/quick3d/quick3dinput/items/quick3daction_p.h
index 8394f9c48..86e52eb33 100644
--- a/src/quick3d/quick3dinput/items/quick3daction_p.h
+++ b/src/quick3d/quick3dinput/items/quick3daction_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
#include <Qt3DInput/QAction>
#include <Qt3DInput/QAbstractActionInput>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3daxis.cpp b/src/quick3d/quick3dinput/items/quick3daxis.cpp
index 2857e4c48..966aa250d 100644
--- a/src/quick3d/quick3dinput/items/quick3daxis.cpp
+++ b/src/quick3d/quick3dinput/items/quick3daxis.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3daxis_p.h"
+#include <Qt3DQuickInput/private/quick3daxis_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3daxis_p.h b/src/quick3d/quick3dinput/items/quick3daxis_p.h
index 400bd5ea0..58ba32ae7 100644
--- a/src/quick3d/quick3dinput/items/quick3daxis_p.h
+++ b/src/quick3d/quick3dinput/items/quick3daxis_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
-#include <Qt3DInput/QAxis>
#include <Qt3DInput/QAbstractAxisInput>
-#include <QQmlListProperty>
+#include <Qt3DInput/QAxis>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dinputchord.cpp b/src/quick3d/quick3dinput/items/quick3dinputchord.cpp
index 0d214a5ec..16a5e8181 100644
--- a/src/quick3d/quick3dinput/items/quick3dinputchord.cpp
+++ b/src/quick3d/quick3dinput/items/quick3dinputchord.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dinputchord_p.h"
+#include <Qt3DQuickInput/private/quick3dinputchord_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dinputchord_p.h b/src/quick3d/quick3dinput/items/quick3dinputchord_p.h
index d9759b856..3380fefa4 100644
--- a/src/quick3d/quick3dinput/items/quick3dinputchord_p.h
+++ b/src/quick3d/quick3dinput/items/quick3dinputchord_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
#include <Qt3DInput/qinputchord.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp b/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp
index 02539443e..4f4eed9d3 100644
--- a/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp
+++ b/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dinputsequence_p.h"
+#include <Qt3DQuickInput/private/quick3dinputsequence_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dinputsequence_p.h b/src/quick3d/quick3dinput/items/quick3dinputsequence_p.h
index ccf872675..aea671f12 100644
--- a/src/quick3d/quick3dinput/items/quick3dinputsequence_p.h
+++ b/src/quick3d/quick3dinput/items/quick3dinputsequence_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
#include <Qt3DInput/qinputsequence.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp
index 72be7e7ac..50218dd25 100644
--- a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp
+++ b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dlogicaldevice_p.h"
+#include <Qt3DQuickInput/private/quick3dlogicaldevice_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dlogicaldevice_p.h b/src/quick3d/quick3dinput/items/quick3dlogicaldevice_p.h
index 5b3b36039..050d81ab8 100644
--- a/src/quick3d/quick3dinput/items/quick3dlogicaldevice_p.h
+++ b/src/quick3d/quick3dinput/items/quick3dlogicaldevice_p.h
@@ -51,11 +51,12 @@
// We mean it.
//
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
#include <Qt3DInput/QAxis>
#include <Qt3DInput/QAction>
#include <Qt3DInput/QLogicalDevice>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp b/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp
index ead311135..5c8d55b54 100644
--- a/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp
+++ b/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dphysicaldevice_p.h"
+#include <Qt3DQuickInput/private/quick3dphysicaldevice_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/items/quick3dphysicaldevice_p.h b/src/quick3d/quick3dinput/items/quick3dphysicaldevice_p.h
index 9a97d152c..b4c96ac14 100644
--- a/src/quick3d/quick3dinput/items/quick3dphysicaldevice_p.h
+++ b/src/quick3d/quick3dinput/items/quick3dphysicaldevice_p.h
@@ -51,11 +51,12 @@
// We mean it.
//
-#include <QObject>
-#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
#include <Qt3DInput/qabstractphysicaldevice.h>
#include <Qt3DInput/qaxissetting.h>
-#include <QQmlListProperty>
+#include <QtCore/QObject>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/qt3dquickinput_global.cpp b/src/quick3d/quick3dinput/qt3dquickinput_global.cpp
index dd84f9fa4..724a5db86 100644
--- a/src/quick3d/quick3dinput/qt3dquickinput_global.cpp
+++ b/src/quick3d/quick3dinput/qt3dquickinput_global.cpp
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#include "qt3dquickinput_global_p.h"
-#include "qt3dquickinputnodefactory_p.h"
+#include <Qt3DQuickInput/private/qt3dquickinput_global_p.h>
+#include <Qt3DQuickInput/private/qt3dquickinputnodefactory_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp
index 8f9fe81ec..b158e30d5 100644
--- a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp
+++ b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qt3dquickinputnodefactory_p.h"
+#include <Qt3DQuickInput/private/qt3dquickinputnodefactory_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h b/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h
index 3473cf038..f4d4aee27 100644
--- a/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h
+++ b/src/quick3d/quick3dinput/qt3dquickinputnodefactory_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DCore/private/qabstractnodefactory_p.h>
#include <QtCore/qhash.h>
+#include <Qt3DCore/private/qabstractnodefactory_p.h>
+
QT_BEGIN_NAMESPACE
class QQmlType;
diff --git a/src/quick3d/quick3drender/items/quick3dbuffer.cpp b/src/quick3d/quick3drender/items/quick3dbuffer.cpp
index d36ce8341..362e60328 100644
--- a/src/quick3d/quick3drender/items/quick3dbuffer.cpp
+++ b/src/quick3d/quick3drender/items/quick3dbuffer.cpp
@@ -37,10 +37,10 @@
**
****************************************************************************/
-#include <QJSValue>
-#include <QQmlEngine>
+#include <QtQml/QJSValue>
+#include <QtQml/QQmlEngine>
-#include "quick3dbuffer_p.h"
+#include <Qt3DQuickRender/private/quick3dbuffer_p.h>
#include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qjsvalue_p.h>
#include <QtQml/private/qv4typedarray_p.h>
diff --git a/src/quick3d/quick3drender/items/quick3dbuffer_p.h b/src/quick3d/quick3drender/items/quick3dbuffer_p.h
index d8dbafcb2..712e11078 100644
--- a/src/quick3d/quick3drender/items/quick3dbuffer_p.h
+++ b/src/quick3d/quick3drender/items/quick3dbuffer_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/QBuffer>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+
QT_BEGIN_NAMESPACE
class QQmlEngine;
diff --git a/src/quick3d/quick3drender/items/quick3deffect.cpp b/src/quick3d/quick3drender/items/quick3deffect.cpp
index 9d4ce934a..fa82c6eff 100644
--- a/src/quick3d/quick3drender/items/quick3deffect.cpp
+++ b/src/quick3d/quick3drender/items/quick3deffect.cpp
@@ -37,9 +37,10 @@
**
****************************************************************************/
-#include "quick3deffect_p.h"
#include <Qt3DRender/qeffect.h>
+#include <Qt3DQuickRender/private/quick3deffect_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3deffect_p.h b/src/quick3d/quick3drender/items/quick3deffect_p.h
index 50152e2af..3b778563d 100644
--- a/src/quick3d/quick3drender/items/quick3deffect_p.h
+++ b/src/quick3d/quick3drender/items/quick3deffect_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <QQmlListProperty>
#include <Qt3DRender/qeffect.h>
#include <Qt3DRender/qtechnique.h>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dgeometry.cpp b/src/quick3d/quick3drender/items/quick3dgeometry.cpp
index 84c02d7c9..3f70ea572 100644
--- a/src/quick3d/quick3drender/items/quick3dgeometry.cpp
+++ b/src/quick3d/quick3drender/items/quick3dgeometry.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dgeometry_p.h"
+#include <Qt3DQuickRender/private/quick3dgeometry_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dgeometry_p.h b/src/quick3d/quick3drender/items/quick3dgeometry_p.h
index 4c020b0e2..6bf7faf58 100644
--- a/src/quick3d/quick3drender/items/quick3dgeometry_p.h
+++ b/src/quick3d/quick3drender/items/quick3dgeometry_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <QQmlListProperty>
#include <Qt3DRender/QGeometry>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp
index 6f7efcd23..951b4f82f 100644
--- a/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp
+++ b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp
@@ -37,9 +37,10 @@
**
****************************************************************************/
-#include "quick3dlayerfilter_p.h"
#include <Qt3DRender/qtexture.h>
+#include <Qt3DQuickRender/private/quick3dlayerfilter_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h b/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h
index b2e7e2d11..f59be2787 100644
--- a/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h
+++ b/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qlayerfilter.h>
#include <Qt3DRender/qlayer.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dmaterial.cpp b/src/quick3d/quick3drender/items/quick3dmaterial.cpp
index 50b064bc2..3dfbec83e 100644
--- a/src/quick3d/quick3drender/items/quick3dmaterial.cpp
+++ b/src/quick3d/quick3drender/items/quick3dmaterial.cpp
@@ -37,9 +37,10 @@
**
****************************************************************************/
-#include "quick3dmaterial_p.h"
#include <Qt3DRender/qtexture.h>
+#include <Qt3DQuickRender/private/quick3dmaterial_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3dmaterial_p.h b/src/quick3d/quick3drender/items/quick3dmaterial_p.h
index 48b60df62..646e3b154 100644
--- a/src/quick3d/quick3drender/items/quick3dmaterial_p.h
+++ b/src/quick3d/quick3drender/items/quick3dmaterial_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qmaterial.h>
#include <Qt3DRender/qparameter.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp b/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp
index a899d36c5..0754a0cf5 100644
--- a/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp
+++ b/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp
@@ -55,16 +55,16 @@ Quick3DMemoryBarrier::~Quick3DMemoryBarrier()
{
}
-void Quick3DMemoryBarrier::setBarrierTypesInt(int barrierTypes)
+void Quick3DMemoryBarrier::setWaitFor(int barrierTypes)
{
- QMemoryBarrier::BarrierTypes types(QMemoryBarrier::AllBarrier);
+ QMemoryBarrier::Operations types(QMemoryBarrier::All);
types &= barrierTypes; // Will only keep flags that are actually set
- parentBarrier()->setBarrierTypes(types);
+ parentBarrier()->setWaitOperations(types);
}
-int Quick3DMemoryBarrier::barrierTypesInt() const
+int Quick3DMemoryBarrier::waitFor() const
{
- return QMemoryBarrier::BarrierTypes::Int(parentBarrier()->barrierTypes());
+ return QMemoryBarrier::Operations::Int(parentBarrier()->waitOperations());
}
} // namespace Quick
diff --git a/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h b/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h
index 5e402f006..ab8f72a76 100644
--- a/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h
+++ b/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h
@@ -65,15 +65,15 @@ namespace Quick {
class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DMemoryBarrier : public QObject
{
Q_OBJECT
- Q_PROPERTY(int barrierTypes READ barrierTypesInt WRITE setBarrierTypesInt)
+ Q_PROPERTY(int waitFor READ waitFor WRITE setWaitFor)
public:
explicit Quick3DMemoryBarrier(QObject *parent = nullptr);
~Quick3DMemoryBarrier();
inline QMemoryBarrier *parentBarrier() const { return qobject_cast<QMemoryBarrier*>(parent()); }
- void setBarrierTypesInt(int barrierTypes);
- int barrierTypesInt() const;
+ void setWaitFor(int waitOperations);
+ int waitFor() const;
};
} // namespace Quick
diff --git a/src/quick3d/quick3drender/items/quick3dparameter.cpp b/src/quick3d/quick3drender/items/quick3dparameter.cpp
index 783f152c1..2ef95a4d4 100644
--- a/src/quick3d/quick3drender/items/quick3dparameter.cpp
+++ b/src/quick3d/quick3drender/items/quick3dparameter.cpp
@@ -37,10 +37,10 @@
**
****************************************************************************/
-#include <QJSValue>
-#include <QJSValueIterator>
+#include <QtQml/QJSValue>
+#include <QtQml/QJSValueIterator>
-#include "quick3dparameter_p_p.h"
+#include <Qt3DQuickRender/private/quick3dparameter_p_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dparameter_p.h b/src/quick3d/quick3drender/items/quick3dparameter_p.h
index 60493973d..948df22a7 100644
--- a/src/quick3d/quick3drender/items/quick3dparameter_p.h
+++ b/src/quick3d/quick3drender/items/quick3dparameter_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qparameter.h>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3dparameter_p_p.h b/src/quick3d/quick3drender/items/quick3dparameter_p_p.h
index 0432642f3..2e680b852 100644
--- a/src/quick3d/quick3drender/items/quick3dparameter_p_p.h
+++ b/src/quick3d/quick3drender/items/quick3dparameter_p_p.h
@@ -51,10 +51,10 @@
// We mean it.
//
-#include "quick3dparameter_p.h"
-
+#include <Qt3DQuickRender/private/quick3dparameter_p.h>
#include <Qt3DRender/private/qparameter_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3drenderpass.cpp b/src/quick3d/quick3drender/items/quick3drenderpass.cpp
index d5f16fab6..7bd50a0d5 100644
--- a/src/quick3d/quick3drender/items/quick3drenderpass.cpp
+++ b/src/quick3d/quick3drender/items/quick3drenderpass.cpp
@@ -38,7 +38,7 @@
**
****************************************************************************/
-#include "quick3drenderpass_p.h"
+#include <Qt3DQuickRender/private/quick3drenderpass_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drenderpass_p.h b/src/quick3d/quick3drender/items/quick3drenderpass_p.h
index 6ac940e23..c9d2fce59 100644
--- a/src/quick3d/quick3drender/items/quick3drenderpass_p.h
+++ b/src/quick3d/quick3drender/items/quick3drenderpass_p.h
@@ -52,9 +52,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qrenderpass.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp
index 8b51a79ef..0a8fa8a3a 100644
--- a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp
+++ b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3drenderpassfilter_p.h"
+#include <Qt3DQuickRender/private/quick3drenderpassfilter_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h b/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h
index 3acd32270..cab75f4a6 100644
--- a/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h
+++ b/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h
@@ -51,11 +51,12 @@
// We mean it.
//
-#include <Qt3DQuick/private/quick3dnode_p.h>
-#include <Qt3DRender/qrenderpassfilter.h>
#include <Qt3DRender/qfilterkey.h>
+#include <Qt3DRender/qrenderpassfilter.h>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuick/private/quick3dnode_p.h>
#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <QQmlListProperty>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp
index e3b40243a..024789a4c 100644
--- a/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp
+++ b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3drendertargetoutput_p.h"
+#include <Qt3DQuickRender/private/quick3drendertargetoutput_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h b/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h
index 5a2c8ea54..7626a2db7 100644
--- a/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h
+++ b/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qrendertarget.h>
#include <Qt3DRender/qrendertargetoutput.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp b/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp
index b61c7ed12..1ace5950a 100644
--- a/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp
+++ b/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3drendertargetselector_p.h"
+#include <Qt3DQuickRender/private/quick3drendertargetselector_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h b/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h
index a24a6a71f..610ea1a49 100644
--- a/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h
+++ b/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h
@@ -51,11 +51,12 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qrendertargetoutput.h>
#include <Qt3DRender/qrendertargetselector.h>
-#include <QQmlListProperty>
-#include <QVariantList>
+#include <QtCore/QVariantList>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dscene.cpp b/src/quick3d/quick3drender/items/quick3dscene.cpp
index 4062904f2..af4f44f0e 100644
--- a/src/quick3d/quick3drender/items/quick3dscene.cpp
+++ b/src/quick3d/quick3drender/items/quick3dscene.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dscene_p.h"
+#include <Qt3DQuickRender/private/quick3dscene_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dscene_p.h b/src/quick3d/quick3drender/items/quick3dscene_p.h
index 60c2d2ab5..a7173a6c7 100644
--- a/src/quick3d/quick3drender/items/quick3dscene_p.h
+++ b/src/quick3d/quick3drender/items/quick3dscene_p.h
@@ -51,10 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <Qt3DQuick/private/quick3dentity_p.h>
#include <Qt3DRender/qsceneloader.h>
+#include <Qt3DQuick/private/quick3dentity_p.h>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
index dbf351695..cd6e2a81e 100644
--- a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
+++ b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp
@@ -37,11 +37,11 @@
**
****************************************************************************/
-#include <Qt3DQuickRender/private/quick3dshaderdataarray_p.h>
-#include <QMetaProperty>
+#include <QtCore/QMetaProperty>
-#include "quick3dshaderdata_p.h"
-#include <private/qshaderdata_p.h>
+#include <Qt3DQuickRender/private/quick3dshaderdataarray_p.h>
+#include <Qt3DQuickRender/private/quick3dshaderdata_p.h>
+#include <Qt3DRender/private/qshaderdata_p.h>
QT_BEGIN_NAMESPACE
@@ -53,7 +53,7 @@ namespace {
const int qjsValueTypeId = qMetaTypeId<QJSValue>();
const int quick3DShaderDataArrayTypeId = qMetaTypeId<Quick3DShaderDataArray*>();
-const int quick3DShaderDataTypeId = qMetaTypeId<Quick3DShaderData*>();
+Q_DECL_UNUSED const int quick3DShaderDataTypeId = qMetaTypeId<Quick3DShaderData*>();
}
@@ -84,11 +84,9 @@ public:
}
}
return innerValues;
- } else if (v.userType() == quick3DShaderDataTypeId) {
- Qt3DCore::QNodeId id;
- QShaderData *shaderData = v.value<Quick3DShaderData *>();
- if (shaderData)
- id = shaderData->id();
+ } else if (v.canConvert<Qt3DCore::QNode*>()) {
+ const auto node = v.value<Qt3DCore::QNode *>();
+ const auto id = Qt3DCore::qIdForNode(node);
return QVariant::fromValue(id);
}
return v;
diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h
index 15e127b78..207096149 100644
--- a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h
+++ b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h
@@ -51,11 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <Qt3DRender/qshaderdata.h>
+#include <QtQml/QJSValue>
+#include <QtQml/QJSValueIterator>
-#include <QJSValue>
-#include <QJSValueIterator>
+#include <Qt3DRender/qshaderdata.h>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp
index 21dd2525a..9dac7bbc6 100644
--- a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp
+++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#include "quick3dshaderdataarray_p.h"
-#include <private/qshaderdata_p.h>
+#include <Qt3DQuickRender/private/quick3dshaderdataarray_p.h>
+#include <Qt3DRender/private/qshaderdata_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h
index 9d33df208..162f402aa 100644
--- a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h
+++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h
@@ -52,9 +52,10 @@
//
#include <Qt3DCore/qnode.h>
+#include <QtQml/QQmlListProperty>
+
#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DQuickRender/private/quick3dshaderdata_p.h>
-#include <QQmlListProperty>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dstateset.cpp b/src/quick3d/quick3drender/items/quick3dstateset.cpp
index d7d74e5ad..468364493 100644
--- a/src/quick3d/quick3drender/items/quick3dstateset.cpp
+++ b/src/quick3d/quick3drender/items/quick3dstateset.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dstateset_p.h"
+#include <Qt3DQuickRender/private/quick3dstateset_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dstateset_p.h b/src/quick3d/quick3drender/items/quick3dstateset_p.h
index 4bb9b6cec..b2e63c066 100644
--- a/src/quick3d/quick3drender/items/quick3dstateset_p.h
+++ b/src/quick3d/quick3drender/items/quick3dstateset_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DRender/qrenderstateset.h>
-#include <QQmlListProperty>
+#include <QtQml/QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtechnique.cpp b/src/quick3d/quick3drender/items/quick3dtechnique.cpp
index 123050645..0a15c9f7e 100644
--- a/src/quick3d/quick3drender/items/quick3dtechnique.cpp
+++ b/src/quick3d/quick3drender/items/quick3dtechnique.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dtechnique_p.h"
+#include <Qt3DQuickRender/private/quick3dtechnique_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtechnique_p.h b/src/quick3d/quick3drender/items/quick3dtechnique_p.h
index 203befcb7..9cdfdfefe 100644
--- a/src/quick3d/quick3drender/items/quick3dtechnique_p.h
+++ b/src/quick3d/quick3drender/items/quick3dtechnique_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+#include <QtQml/QQmlListProperty>
#include <Qt3DRender/qtechnique.h>
-#include <QQmlListProperty>
+
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp
index b27d46c31..2019093c9 100644
--- a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp
+++ b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dtechniquefilter_p.h"
+#include <Qt3DQuickRender/private/quick3dtechniquefilter_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h b/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h
index 27d637e23..2b10bc108 100644
--- a/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h
+++ b/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h
@@ -51,11 +51,12 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <Qt3DRender/qtechniquefilter.h>
#include <Qt3DRender/qfilterkey.h>
+#include <Qt3DRender/qtechniquefilter.h>
+#include <QtQml/QQmlListProperty>
+
#include <Qt3DQuick/private/quick3dnode_p.h>
-#include <QQmlListProperty>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtexture.cpp b/src/quick3d/quick3drender/items/quick3dtexture.cpp
index 9c528996c..7627a3283 100644
--- a/src/quick3d/quick3drender/items/quick3dtexture.cpp
+++ b/src/quick3d/quick3drender/items/quick3dtexture.cpp
@@ -37,8 +37,9 @@
**
****************************************************************************/
-#include "quick3dtexture_p.h"
-#include <QDebug>
+#include <QtCore/QDebug>
+
+#include <Qt3DQuickRender/private/quick3dtexture_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dtexture_p.h b/src/quick3d/quick3drender/items/quick3dtexture_p.h
index a1e2ad6b8..6b0430211 100644
--- a/src/quick3d/quick3drender/items/quick3dtexture_p.h
+++ b/src/quick3d/quick3drender/items/quick3dtexture_p.h
@@ -51,11 +51,11 @@
// We mean it.
//
-#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
-#include <Qt3DQuick/private/quick3dnode_p.h>
#include <Qt3DRender/qtexture.h>
+#include <QtCore/QUrl>
-#include <QUrl>
+#include <Qt3DQuick/private/quick3dnode_p.h>
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dviewport.cpp b/src/quick3d/quick3drender/items/quick3dviewport.cpp
index 5d490018f..3b4bf33f5 100644
--- a/src/quick3d/quick3drender/items/quick3dviewport.cpp
+++ b/src/quick3d/quick3drender/items/quick3dviewport.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "quick3dviewport_p.h"
+#include <Qt3DQuickRender/private/quick3dviewport_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/items/quick3dviewport_p.h b/src/quick3d/quick3drender/items/quick3dviewport_p.h
index 877900365..adf0c983f 100644
--- a/src/quick3d/quick3drender/items/quick3dviewport_p.h
+++ b/src/quick3d/quick3drender/items/quick3dviewport_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
+#include <Qt3DRender/qviewport.h>
+
#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
#include <Qt3DQuick/private/quick3dnode_p.h>
-#include <Qt3DRender/qviewport.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/qt3dquickrender_global.cpp b/src/quick3d/quick3drender/qt3dquickrender_global.cpp
index 0706185fe..bf7d68e71 100644
--- a/src/quick3d/quick3drender/qt3dquickrender_global.cpp
+++ b/src/quick3d/quick3drender/qt3dquickrender_global.cpp
@@ -38,8 +38,8 @@
**
****************************************************************************/
-#include "qt3dquickrender_global_p.h"
-#include "qt3dquickrendernodefactory_p.h"
+#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h>
+#include <Qt3DQuickRender/private/qt3dquickrendernodefactory_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp
index 2d9456d12..f57451379 100644
--- a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp
+++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qt3dquickrendernodefactory_p.h"
+#include <Qt3DQuickRender/private/qt3dquickrendernodefactory_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h
index 863a97f0b..6068124e5 100644
--- a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h
+++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h
@@ -51,9 +51,10 @@
// We mean it.
//
-#include <Qt3DCore/private/qabstractnodefactory_p.h>
#include <QtCore/qhash.h>
+#include <Qt3DCore/private/qabstractnodefactory_p.h>
+
QT_BEGIN_NAMESPACE
class QQmlType;
diff --git a/src/quick3d/quick3dscene2d/items/items.pri b/src/quick3d/quick3dscene2d/items/items.pri
new file mode 100644
index 000000000..45d18dc40
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/items.pri
@@ -0,0 +1,17 @@
+HEADERS += \
+ $$PWD/scene2d_p.h \
+ $$PWD/qscene2d_p.h \
+ $$PWD/qscene2d.h \
+ $$PWD/scene2dmanager_p.h \
+ $$PWD/scene2dsharedobject_p.h \
+ $$PWD/scene2devent_p.h \
+ $$PWD/qt3dquick3dscene2d_p.h
+
+SOURCES += \
+ $$PWD/qscene2d.cpp \
+ $$PWD/scene2d.cpp \
+ $$PWD/scene2dmanager.cpp \
+ $$PWD/scene2dsharedobject.cpp \
+ $$PWD/qt3dquick3dscene2d.cpp
+
+INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d.cpp b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
new file mode 100644
index 000000000..52e2be094
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
@@ -0,0 +1,365 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qscene2d.h"
+#include "qscene2d_p.h"
+#include "scene2d_p.h"
+#include "scene2dmanager_p.h"
+#include "scene2devent_p.h"
+
+#include <Qt3DCore/qentity.h>
+#include <Qt3DCore/qpropertynodeaddedchange.h>
+#include <Qt3DCore/qpropertynoderemovedchange.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace Qt3DCore;
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+/*!
+ \class Qt3DRender::Quick::QScene2D
+ \inmodule Qt3DScene2D
+
+ \brief This class enables rendering qml into a texture, which then can be
+ used as a part of 3D scene.
+
+ This class uses QQuickRenderControl to render the given QQuickItem into an
+ offscreen surface, which is attached to a texture provided by the user. This allows the
+ component to directly render into the texture without intermediate copy and the user to
+ freely specify how the texture is used in the 3D scene.
+
+ The entities using the QScene2D can be associated with the class to enable interaction
+ with the item; if an entity has a QObjectPicker component, the pick events from that picker
+ are sent to the QScene2D and converted to mouse events and finally sent to the item.
+
+ \since 5.9
+*/
+
+/*!
+ \qmltype Scene2D
+ \inqmlmodule Qt3D.Scene2D
+ \since 5.9
+ \instantiates Qt3DRender::Quick::QScene2D
+
+ \brief This type enables rendering qml into a texture, which then can be
+ used as a part of 3D scene.
+
+ This object uses RenderControl to render the given Item into an
+ offscreen surface, which is attached to a texture provided by the user. This allows the
+ component to directly render into the texture without intermediate copy and the user to
+ freely specify how the texture is used in the 3D scene.
+
+ The entities using the Scene2D can be associated with the type to enable interaction
+ with the item; if an entity has an ObjectPicker component, the pick events from that picker
+ are sent to the Scene2D and converted to mouse events and finally sent to the item.
+
+ Usage:
+ \qml
+ Entity {
+ id: sceneRoot
+
+ // specify Scene2D inside the entity hierarchy
+ Scene2D {
+ // specify output
+ output: RenderTargetOutput {
+ attachmentPoint: RenderTargetOutput.Color0
+ texture: Texture2D {
+ id: textureId
+ width: 1024
+ height: 1024
+ format: Texture.RGBA8_UNorm
+ }
+ }
+ // specify entities
+ entities: [entityId]
+
+ // specify rendered content
+ Rectangle {
+ color: "red"
+ }
+ }
+
+ Entity {
+ id: entityId
+
+ property Material material: TextureMaterial {
+ texture: textureId
+ }
+ property ObjectPicker picker: ObjectPicker {
+ hoverEnabled: true
+ dragEnabled: true
+ }
+ ...
+
+ \endqml
+ */
+
+/*!
+ \enum QScene2D::RenderPolicy
+
+ This enum type describes types of render policies available.
+ \value Continuous The Scene2D is rendering continuously. This is the default render policy.
+ \value SingleShot The Scene2D renders to the texture only once after which the resources
+ allocated for rendering are released.
+*/
+
+/*!
+ \qmlproperty RenderTargetOutput Qt3D.Render::Scene2D::output
+ Holds the RenderTargetOutput, which specifies where the Scene2D is rendering to.
+ */
+
+/*!
+ \qmlproperty enumeration Qt3D.Render::Scene2D::renderPolicy
+ Holds the render policy of this Scene2D.
+
+ \list
+ \li Continuous The Scene2D is rendering continuously. This is the default render policy.
+ \li SingleShot The Scene2D renders to the texture only once after which the resources
+ allocated for rendering are released.
+ \endlist
+ */
+/*!
+ \qmlproperty Item Qt3D.Render::Scene2D::item
+ Holds the Item, which is rendered by Scene2D to the texture.
+ */
+
+/*!
+ \qmlproperty bool Qt3D.Render::Scene2D::mouseEnabled
+ Holds whether mouse events are enabled for the rendered item. The mouse events are
+ generated from object picking events of the entities added to the Scene2D.
+ Mouse is enabled by default.
+
+ \note Events sent to items are delayed by one frame due to object picking
+ happening in the backend.
+ */
+/*!
+ \qmlproperty list<Entity> Qt3D.Render::Scene2D::entities
+ Holds the list of entities which are associated with the Scene2D object. If the
+ entities have ObjectPicker, the pick events from that entity are sent to Scene2D
+ and converted to mouse events.
+ */
+
+QScene2DPrivate::QScene2DPrivate()
+ : Qt3DCore::QNodePrivate()
+ , m_renderManager(new Scene2DManager(this))
+ , m_output(nullptr)
+{
+}
+
+QScene2DPrivate::~QScene2DPrivate()
+{
+ m_renderManager->cleanup();
+ delete m_renderManager;
+}
+
+void QScene2DPrivate::setScene(Qt3DCore::QScene *scene)
+{
+ Q_Q(QScene2D);
+ QNodePrivate::setScene(scene);
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(q->id());
+ change->setPropertyName("sceneInitialized");
+ notifyObservers(change);
+}
+
+
+/*!
+ The constructor creates a new QScene2D instance with the specified \a parent.
+ */
+QScene2D::QScene2D(Qt3DCore::QNode *parent)
+ : Qt3DCore::QNode(*new QScene2DPrivate, parent)
+{
+}
+
+/*!
+ \property QScene2D::item
+ Holds the QQuickItem, which is rendered by QScene2D to the texture.
+ */
+QQuickItem* QScene2D::item() const
+{
+ Q_D(const QScene2D);
+ return d->m_renderManager->m_item;
+}
+
+void QScene2D::setItem(QQuickItem *item)
+{
+ Q_D(QScene2D);
+ if (d->m_renderManager->m_initialized) {
+ qWarning() << "Unable to set item after initialization.";
+ return;
+ }
+ if (d->m_renderManager->m_item != item) {
+ d->m_renderManager->setItem(item);
+ emit itemChanged(item);
+ }
+}
+
+/*!
+ \property QScene2D::renderPolicy
+
+ Holds the render policy of this Scene2D.
+ */
+QScene2D::RenderPolicy QScene2D::renderPolicy() const
+{
+ Q_D(const QScene2D);
+ return d->m_renderManager->m_renderPolicy;
+}
+
+void QScene2D::setRenderPolicy(QScene2D::RenderPolicy renderPolicy)
+{
+ Q_D(const QScene2D);
+ if (d->m_renderManager->m_renderPolicy != renderPolicy) {
+ d->m_renderManager->m_renderPolicy = renderPolicy;
+ emit renderPolicyChanged(renderPolicy);
+ }
+}
+
+/*!
+ \property QScene2D::output
+ Holds the QRenderTargetOutput, which specifies where the QScene2D is
+ rendering to.
+ */
+Qt3DRender::QRenderTargetOutput *QScene2D::output() const
+{
+ Q_D(const QScene2D);
+ return d->m_output;
+}
+
+void QScene2D::setOutput(Qt3DRender::QRenderTargetOutput *output)
+{
+ Q_D(QScene2D);
+ if (d->m_output != output) {
+ if (d->m_output)
+ d->unregisterDestructionHelper(d->m_output);
+ d->m_output = output;
+ if (output)
+ d->registerDestructionHelper(output, &QScene2D::setOutput, d->m_output);
+ emit outputChanged(output);
+ }
+}
+
+Qt3DCore::QNodeCreatedChangeBasePtr QScene2D::createNodeCreationChange() const
+{
+ auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QScene2DData>::create(this);
+ auto &data = creationChange->data;
+ Q_D(const QScene2D);
+ data.renderPolicy = d->m_renderManager->m_renderPolicy;
+ data.sharedObject = d->m_renderManager->m_sharedObject;
+ data.output = d->m_output ? d->m_output->id() : Qt3DCore::QNodeId();
+ for (Qt3DCore::QEntity *e : d->m_entities)
+ data.entityIds.append(e->id());
+ data.mouseEnabled = d->m_renderManager->m_mouseEnabled;
+ return creationChange;
+}
+
+bool QScene2D::isMouseEnabled() const
+{
+ Q_D(const QScene2D);
+ return d->m_renderManager->m_mouseEnabled;
+}
+
+/*!
+ Retrieve entities associated with the QScene2D.
+ */
+QVector<Qt3DCore::QEntity*> QScene2D::entities()
+{
+ Q_D(const QScene2D);
+ return d->m_entities;
+}
+
+/*!
+ Adds an \a entity to the the QScene2D object. If the entities have QObjectPicker,
+ the pick events from that entity are sent to QScene2D and converted to mouse events.
+*/
+void QScene2D::addEntity(Qt3DCore::QEntity *entity)
+{
+ Q_D(QScene2D);
+ if (!d->m_entities.contains(entity)) {
+ d->m_entities.append(entity);
+
+ d->registerDestructionHelper(entity, &QScene2D::removeEntity, d->m_entities);
+
+ if (d->m_changeArbiter != nullptr) {
+ const auto change = Qt3DCore::QPropertyNodeAddedChangePtr::create(id(), entity);
+ change->setPropertyName("entities");
+ d->notifyObservers(change);
+ }
+ }
+}
+
+/*!
+ Removes an \a entity from the the QScene2D object.
+*/
+void QScene2D::removeEntity(Qt3DCore::QEntity *entity)
+{
+ Q_D(QScene2D);
+ if (d->m_entities.contains(entity)) {
+ d->m_entities.removeAll(entity);
+
+ d->unregisterDestructionHelper(entity);
+
+ if (d->m_changeArbiter != nullptr) {
+ const auto change = Qt3DCore::QPropertyNodeRemovedChangePtr::create(id(), entity);
+ change->setPropertyName("entities");
+ d->notifyObservers(change);
+ }
+ }
+}
+
+/*!
+ \property QScene2D::mouseEnabled
+ Holds whether mouse events are enabled for the rendered item. The mouse events are
+ generated from object picking events of the entities added to the QScene2D.
+ Mouse is enabled by default.
+
+ \note Events are delayed by one frame due to object picking happening in the backend.
+ */
+void QScene2D::setMouseEnabled(bool enabled)
+{
+ Q_D(QScene2D);
+ if (d->m_renderManager->m_mouseEnabled != enabled) {
+ d->m_renderManager->m_mouseEnabled = enabled;
+ emit mouseEnabledChanged(enabled);
+ }
+}
+
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d.h b/src/quick3d/quick3dscene2d/items/qscene2d.h
new file mode 100644
index 000000000..73322a9e9
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/qscene2d.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_H
+#define QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_H
+
+#include <Qt3DQuickScene2D/qt3dquickscene2d_global.h>
+#include <Qt3DRender/qrendertargetoutput.h>
+
+#include <QtCore/QUrl>
+#include <QtCore/QEvent>
+
+#include <Qt3DCore/qnode.h>
+
+#include <QtQuick/qquickitem.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class QScene2DPrivate;
+
+class QT3DQUICKSCENE2DSHARED_EXPORT QScene2D : public Qt3DCore::QNode
+{
+ Q_OBJECT
+
+ Q_PROPERTY(Qt3DRender::QRenderTargetOutput *output READ output WRITE setOutput NOTIFY outputChanged)
+ Q_PROPERTY(QScene2D::RenderPolicy renderPolicy READ renderPolicy WRITE setRenderPolicy NOTIFY renderPolicyChanged)
+ Q_PROPERTY(QQuickItem *item READ item WRITE setItem NOTIFY itemChanged)
+ Q_PROPERTY(bool mouseEnabled READ isMouseEnabled WRITE setMouseEnabled NOTIFY mouseEnabledChanged)
+
+ Q_CLASSINFO("DefaultProperty", "item")
+
+public:
+
+ enum RenderPolicy {
+ Continuous,
+ SingleShot
+ };
+ Q_ENUM(RenderPolicy)
+
+ explicit QScene2D(Qt3DCore::QNode *parent = nullptr);
+
+ Qt3DRender::QRenderTargetOutput *output() const;
+ QScene2D::RenderPolicy renderPolicy() const;
+ QQuickItem *item() const;
+ bool isMouseEnabled() const;
+
+ QVector<Qt3DCore::QEntity *> entities();
+ void addEntity(Qt3DCore::QEntity *entity);
+ void removeEntity(Qt3DCore::QEntity *entity);
+
+public Q_SLOTS:
+ void setOutput(Qt3DRender::QRenderTargetOutput *output);
+ void setRenderPolicy(QScene2D::RenderPolicy policy);
+ void setItem(QQuickItem *item);
+ void setMouseEnabled(bool enabled);
+
+Q_SIGNALS:
+ void outputChanged(Qt3DRender::QRenderTargetOutput *output);
+ void renderPolicyChanged(QScene2D::RenderPolicy policy);
+ void itemChanged(QQuickItem *item);
+ void mouseEnabledChanged(bool enabled);
+
+protected:
+ Q_DECLARE_PRIVATE(QScene2D)
+
+private:
+ Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE;
+};
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_H
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d_p.h b/src/quick3d/quick3dscene2d/items/qscene2d_p.h
new file mode 100644
index 000000000..217058f5c
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/qscene2d_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_P_H
+#define QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickScene2D/qscene2d.h>
+
+#include <private/qnode_p.h>
+#include <private/scene2dsharedobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DCore {
+class QScene;
+}
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class QScene2D;
+class Scene2DManager;
+
+class Q_AUTOTEST_EXPORT QScene2DPrivate : public Qt3DCore::QNodePrivate
+{
+public:
+ Q_DECLARE_PUBLIC(QScene2D)
+
+ QScene2DPrivate();
+ ~QScene2DPrivate();
+
+ void setScene(Qt3DCore::QScene *scene) Q_DECL_OVERRIDE;
+
+ Scene2DManager *m_renderManager;
+ QMetaObject::Connection m_textureDestroyedConnection;
+ Qt3DRender::QRenderTargetOutput *m_output;
+ QVector<Qt3DCore::QEntity *> m_entities;
+};
+
+struct QScene2DData
+{
+ QScene2D::RenderPolicy renderPolicy;
+ Scene2DSharedObjectPtr sharedObject;
+ Qt3DCore::QNodeId output;
+ QVector<Qt3DCore::QNodeId> entityIds;
+ bool mouseEnabled;
+};
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_QUICK3DSCENE2D_QSCENE2D_P_H
diff --git a/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp
new file mode 100644
index 000000000..83cbefc59
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qt3dquick3dscene2d_p.h"
+#include <Qt3DCore/qentity.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+namespace Render {
+namespace Quick {
+
+QQuick3DScene2D::QQuick3DScene2D(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DCore::QEntity> QQuick3DScene2D::entities()
+{
+ return QQmlListProperty<Qt3DCore::QEntity>(this, 0,
+ &QQuick3DScene2D::appendEntity,
+ &QQuick3DScene2D::entityCount,
+ &QQuick3DScene2D::entityAt,
+ &QQuick3DScene2D::clearEntities);
+}
+
+void QQuick3DScene2D::appendEntity(QQmlListProperty<Qt3DCore::QEntity> *list,
+ Qt3DCore::QEntity *entity)
+{
+ QQuick3DScene2D *scene2d = qobject_cast<QQuick3DScene2D *>(list->object);
+ if (scene2d)
+ scene2d->parentScene2D()->addEntity(entity);
+}
+
+int QQuick3DScene2D::entityCount(QQmlListProperty<Qt3DCore::QEntity> *list)
+{
+ QQuick3DScene2D *scene2d = qobject_cast<QQuick3DScene2D *>(list->object);
+ if (scene2d)
+ return scene2d->parentScene2D()->entities().count();
+ return 0;
+}
+
+Qt3DCore::QEntity *QQuick3DScene2D::entityAt(QQmlListProperty<Qt3DCore::QEntity> *list, int index)
+{
+ QQuick3DScene2D *scene2d = qobject_cast<QQuick3DScene2D *>(list->object);
+ if (scene2d) {
+ return qobject_cast<Qt3DCore::QEntity *>(
+ scene2d->parentScene2D()->entities().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DScene2D::clearEntities(QQmlListProperty<Qt3DCore::QEntity> *list)
+{
+ QQuick3DScene2D *scene2d = qobject_cast<QQuick3DScene2D *>(list->object);
+ if (scene2d) {
+ QVector<Qt3DCore::QEntity*> entities = scene2d->parentScene2D()->entities();
+ for (Qt3DCore::QEntity *e : entities)
+ scene2d->parentScene2D()->removeEntity(e);
+ }
+}
+
+} // namespace Quick
+} // namespace Render
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d_p.h b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d_p.h
new file mode 100644
index 000000000..57734223b
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DSCENE2D_QUICK_QUICK3DSCENE2D_P_H
+#define QT3DSCENE2D_QUICK_QUICK3DSCENE2D_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+
+#include <Qt3DQuickScene2D/qscene2d.h>
+
+#include <private/qt3dquickscene2d_global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+namespace Render {
+namespace Quick {
+
+class QT3DQUICKSCENE2DSHARED_EXPORT QQuick3DScene2D : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DCore::QEntity> entities READ entities)
+
+public:
+ QQuick3DScene2D(QObject *parent = nullptr);
+
+ inline Qt3DRender::Quick::QScene2D *parentScene2D() const
+ {
+ return qobject_cast<Qt3DRender::Quick::QScene2D *>(parent());
+ }
+
+ QQmlListProperty<Qt3DCore::QEntity> entities();
+
+private:
+
+ static void appendEntity(QQmlListProperty<Qt3DCore::QEntity> *list, Qt3DCore::QEntity *entity);
+ static Qt3DCore::QEntity *entityAt(QQmlListProperty<Qt3DCore::QEntity> *list, int index);
+ static int entityCount(QQmlListProperty<Qt3DCore::QEntity> *list);
+ static void clearEntities(QQmlListProperty<Qt3DCore::QEntity> *list);
+};
+
+} // namespace Quick
+} // namespace Render
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DANIMATION_QUICK_QUICK3DMORPHINGANIMATION_P_H
+
diff --git a/src/quick3d/quick3dscene2d/items/scene2d.cpp b/src/quick3d/quick3dscene2d/items/scene2d.cpp
new file mode 100644
index 000000000..b0c58c6c5
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2d.cpp
@@ -0,0 +1,516 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <Qt3DCore/qpropertyupdatedchange.h>
+#include <Qt3DCore/qpropertynodeaddedchange.h>
+#include <Qt3DCore/qpropertynoderemovedchange.h>
+#include <Qt3DQuickScene2D/qscene2d.h>
+#include <Qt3DRender/qpicktriangleevent.h>
+
+#include <QtCore/qthread.h>
+#include <QtCore/qatomic.h>
+#include <QtGui/qevent.h>
+
+#include <private/qscene2d_p.h>
+#include <private/scene2d_p.h>
+#include <private/scene2dmanager_p.h>
+#include <private/scene2devent_p.h>
+#include <private/graphicscontext_p.h>
+#include <private/texture_p.h>
+#include <private/nodemanagers_p.h>
+#include <private/resourceaccessor_p.h>
+#include <private/attachmentpack_p.h>
+#include <private/qt3dquickscene2d_logging_p.h>
+#include <private/qbackendnode_p.h>
+#include <private/qpickevent_p.h>
+#include <private/entity_p.h>
+#include <private/platformsurfacefilter_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef GL_DEPTH24_STENCIL8
+#define GL_DEPTH24_STENCIL8 0x88F0
+#endif
+
+using namespace Qt3DRender::Quick;
+
+namespace Qt3DRender {
+
+namespace Render {
+
+namespace Quick {
+
+Q_GLOBAL_STATIC(QThread, renderThread)
+Q_GLOBAL_STATIC(QAtomicInt, renderThreadClientCount)
+
+RenderQmlEventHandler::RenderQmlEventHandler(Scene2D *node)
+ : QObject()
+ , m_node(node)
+{
+}
+
+// Event handler for the RenderQmlToTexture::renderThread
+bool RenderQmlEventHandler::event(QEvent *e)
+{
+ switch (static_cast<Scene2DEvent::Type>(e->type())) {
+
+ case Scene2DEvent::Render: {
+ m_node->render();
+ return true;
+ }
+
+ case Scene2DEvent::Initialize: {
+ m_node->initializeRender();
+ return true;
+ }
+
+ case Scene2DEvent::Quit: {
+ m_node->cleanup();
+ return true;
+ }
+
+ default:
+ break;
+ }
+ return QObject::event(e);
+}
+
+Scene2D::Scene2D()
+ : Qt3DRender::Render::BackendNode(Qt3DCore::QBackendNode::ReadWrite)
+ , m_context(nullptr)
+ , m_shareContext(nullptr)
+ , m_renderThread(nullptr)
+ , m_sharedObject(nullptr)
+ , m_fbo(0)
+ , m_rbo(0)
+ , m_initialized(false)
+ , m_renderInitialized(false)
+ , m_mouseEnabled(true)
+ , m_renderPolicy(Qt3DRender::Quick::QScene2D::Continuous)
+{
+ renderThreadClientCount->fetchAndAddAcquire(1);
+}
+
+Scene2D::~Scene2D()
+{
+ stopGrabbing();
+}
+
+void Scene2D::setOutput(Qt3DCore::QNodeId outputId)
+{
+ m_outputId = outputId;
+}
+
+void Scene2D::initializeSharedObject()
+{
+ if (!m_initialized) {
+
+ // bail out if we're running autotests
+ if (!m_sharedObject->m_renderManager
+ || m_sharedObject->m_renderManager->thread() == QThread::currentThread()) {
+ return;
+ }
+
+ renderThread->setObjectName(QStringLiteral("Scene2D::renderThread"));
+ m_renderThread = renderThread;
+ m_sharedObject->m_renderThread = m_renderThread;
+
+ // Create event handler for the render thread
+ m_sharedObject->m_renderObject = new RenderQmlEventHandler(this);
+ m_sharedObject->m_renderObject->moveToThread(m_sharedObject->m_renderThread);
+ if (!m_sharedObject->m_renderThread->isRunning())
+ m_sharedObject->m_renderThread->start();
+
+ // Notify main thread we have been initialized
+ QCoreApplication::postEvent(m_sharedObject->m_renderManager,
+ new Scene2DEvent(Scene2DEvent::Initialized));
+ // Initialize render thread
+ QCoreApplication::postEvent(m_sharedObject->m_renderObject,
+ new Scene2DEvent(Scene2DEvent::Initialize));
+
+ m_initialized = true;
+ }
+}
+
+void Scene2D::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change)
+{
+ const auto typedChange = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<QScene2DData>>(change);
+ const auto &data = typedChange->data;
+ m_renderPolicy = data.renderPolicy;
+ setSharedObject(data.sharedObject);
+ setOutput(data.output);
+ m_entities = data.entityIds;
+ m_mouseEnabled = data.mouseEnabled;
+}
+
+void Scene2D::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
+{
+ switch (e->type()) {
+
+ case Qt3DCore::PropertyUpdated: {
+
+ Qt3DCore::QPropertyUpdatedChangePtr propertyChange
+ = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(e);
+ if (propertyChange->propertyName() == QByteArrayLiteral("renderPolicy")) {
+ m_renderPolicy = propertyChange->value().value<QScene2D::RenderPolicy>();
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("output")) {
+ Qt3DCore::QNodeId outputId = propertyChange->value().value<Qt3DCore::QNodeId>();
+ setOutput(outputId);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("pressed")) {
+ QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
+ handlePickEvent(QEvent::MouseButtonPress, ev);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("released")) {
+ QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
+ handlePickEvent(QEvent::MouseButtonRelease, ev);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("moved")) {
+ QPickEventPtr ev = propertyChange->value().value<QPickEventPtr>();
+ handlePickEvent(QEvent::MouseMove, ev);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("mouseEnabled")) {
+ m_mouseEnabled = propertyChange->value().toBool();
+ if (m_mouseEnabled && !m_cachedPickEvent.isNull()) {
+ handlePickEvent(QEvent::MouseButtonPress, m_cachedPickEvent);
+ m_cachedPickEvent.clear();
+ }
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("sceneInitialized")) {
+ startGrabbing();
+ }
+ break;
+ }
+
+ case Qt3DCore::PropertyValueAdded: {
+ const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeAddedChange>(e);
+ if (change->propertyName() == QByteArrayLiteral("entities")) {
+ m_entities.push_back(change->addedNodeId());
+ registerObjectPickerEvents(change->addedNodeId());
+ }
+ break;
+ }
+
+ case Qt3DCore::PropertyValueRemoved: {
+ const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeRemovedChange>(e);
+ if (change->propertyName() == QByteArrayLiteral("entities")) {
+ m_entities.removeOne(change->removedNodeId());
+ unregisterObjectPickerEvents(change->removedNodeId());
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ BackendNode::sceneChangeEvent(e);
+}
+
+void Scene2D::setSharedObject(Qt3DRender::Quick::Scene2DSharedObjectPtr sharedObject)
+{
+ m_sharedObject = sharedObject;
+ if (!m_initialized)
+ initializeSharedObject();
+}
+
+void Scene2D::initializeRender()
+{
+ if (!m_renderInitialized && m_sharedObject.data() != nullptr) {
+ m_shareContext = renderer()->shareContext();
+ if (!m_shareContext){
+ qCDebug(Qt3DRender::Quick::Scene2D) << Q_FUNC_INFO << "Renderer not initialized.";
+ QCoreApplication::postEvent(m_sharedObject->m_renderObject,
+ new Scene2DEvent(Scene2DEvent::Initialize));
+ return;
+ }
+ m_context = new QOpenGLContext();
+#ifdef Q_OS_MACOS
+ m_context->setFormat(m_shareContext->format());
+#else
+ QSurfaceFormat format;
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ m_context->setFormat(format);
+#endif
+ m_context->setShareContext(m_shareContext);
+ m_context->create();
+
+ m_context->makeCurrent(m_sharedObject->m_surface);
+ m_sharedObject->m_renderControl->initialize(m_context);
+ m_context->doneCurrent();
+
+ QCoreApplication::postEvent(m_sharedObject->m_renderManager,
+ new Scene2DEvent(Scene2DEvent::Prepare));
+ m_renderInitialized = true;
+ }
+}
+
+bool Scene2D::updateFbo(QOpenGLTexture *texture)
+{
+ QOpenGLFunctions *gl = m_context->functions();
+ if (m_fbo == 0) {
+ gl->glGenFramebuffers(1, &m_fbo);
+ gl->glGenRenderbuffers(1, &m_rbo);
+ }
+ // TODO: Add another codepath when GL_DEPTH24_STENCIL8 is not supported
+ gl->glBindRenderbuffer(GL_RENDERBUFFER, m_rbo);
+ gl->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8,
+ m_textureSize.width(), m_textureSize.height());
+ gl->glBindRenderbuffer(GL_RENDERBUFFER, 0);
+
+ gl->glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
+ gl->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, texture->textureId(), 0);
+ gl->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_rbo);
+ GLenum status = gl->glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ gl->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ if (status != GL_FRAMEBUFFER_COMPLETE)
+ return false;
+ return true;
+}
+
+void Scene2D::syncRenderControl()
+{
+ if (m_sharedObject->isSyncRequested()) {
+
+ m_sharedObject->clearSyncRequest();
+
+ m_sharedObject->m_renderControl->sync();
+
+ // gui thread can now continue
+ m_sharedObject->wake();
+ }
+}
+
+void Scene2D::render()
+{
+ if (m_initialized && m_renderInitialized && m_sharedObject.data() != nullptr) {
+
+ QMutexLocker lock(&m_sharedObject->m_mutex);
+
+ QOpenGLTexture *texture = nullptr;
+ const Qt3DRender::Render::Attachment *attachmentData = nullptr;
+ QMutex *textureLock = nullptr;
+
+#ifdef QT_OPENGL_ES_2_ANGLE
+ SurfaceLocker surfaceLocker(m_sharedObject->m_surface);
+#endif
+ m_context->makeCurrent(m_sharedObject->m_surface);
+
+ if (resourceAccessor()->accessResource(RenderBackendResourceAccessor::OutputAttachment,
+ m_outputId, (void**)&attachmentData, nullptr)) {
+ if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::OGLTexture,
+ attachmentData->m_textureUuid,
+ (void**)&texture, &textureLock)) {
+ // Need to call sync even if the texture is not in use
+ syncRenderControl();
+ m_context->doneCurrent();
+ qCDebug(Qt3DRender::Quick::Scene2D) << Q_FUNC_INFO << "Texture not in use.";
+ QCoreApplication::postEvent(m_sharedObject->m_renderObject,
+ new Scene2DEvent(Scene2DEvent::Render));
+ return;
+ }
+ textureLock->lock();
+ const QSize textureSize = QSize(texture->width(), texture->height());
+ if (m_attachmentData.m_textureUuid != attachmentData->m_textureUuid
+ || m_attachmentData.m_point != attachmentData->m_point
+ || m_attachmentData.m_face != attachmentData->m_face
+ || m_attachmentData.m_layer != attachmentData->m_layer
+ || m_attachmentData.m_mipLevel != attachmentData->m_mipLevel
+ || m_textureSize != textureSize) {
+ m_textureSize = textureSize;
+ m_attachmentData = *attachmentData;
+ if (!updateFbo(texture)) {
+ // Need to call sync even if the fbo is not usable
+ syncRenderControl();
+ textureLock->unlock();
+ m_context->doneCurrent();
+ qCWarning(Qt3DRender::Quick::Scene2D) << Q_FUNC_INFO << "Fbo not initialized.";
+ return;
+ }
+ }
+ }
+
+ if (m_fbo != m_sharedObject->m_quickWindow->renderTargetId())
+ m_sharedObject->m_quickWindow->setRenderTarget(m_fbo, m_textureSize);
+
+ // Call disallow rendering while mutex is locked
+ if (m_renderPolicy == QScene2D::SingleShot)
+ m_sharedObject->disallowRender();
+
+ // Sync
+ if (m_sharedObject->isSyncRequested()) {
+
+ m_sharedObject->clearSyncRequest();
+
+ m_sharedObject->m_renderControl->sync();
+ }
+
+ // Render
+ m_sharedObject->m_renderControl->render();
+
+ // Tell main thread we are done so it can begin cleanup if this is final frame
+ if (m_renderPolicy == QScene2D::SingleShot)
+ QCoreApplication::postEvent(m_sharedObject->m_renderManager,
+ new Scene2DEvent(Scene2DEvent::Rendered));
+
+ m_sharedObject->m_quickWindow->resetOpenGLState();
+ m_context->functions()->glFlush();
+ if (texture->isAutoMipMapGenerationEnabled())
+ texture->generateMipMaps();
+ textureLock->unlock();
+ m_context->doneCurrent();
+
+ // gui thread can now continue
+ m_sharedObject->wake();
+ }
+}
+
+// this function gets called while the main thread is waiting
+void Scene2D::cleanup()
+{
+ if (m_renderInitialized && m_initialized) {
+ m_context->makeCurrent(m_sharedObject->m_surface);
+ m_sharedObject->m_renderControl->invalidate();
+ m_context->functions()->glDeleteFramebuffers(1, &m_fbo);
+ m_context->functions()->glDeleteRenderbuffers(1, &m_rbo);
+ m_context->doneCurrent();
+ m_renderInitialized = false;
+ }
+ if (m_initialized) {
+ delete m_sharedObject->m_renderObject;
+ m_sharedObject->m_renderObject = nullptr;
+ delete m_context;
+ m_context = nullptr;
+ m_initialized = false;
+ }
+ if (m_sharedObject) {
+ // wake up the main thread
+ m_sharedObject->wake();
+ m_sharedObject = nullptr;
+ }
+
+ renderThreadClientCount->fetchAndSubAcquire(1);
+ if (renderThreadClientCount->load() == 0)
+ renderThread->quit();
+}
+
+
+bool Scene2D::registerObjectPickerEvents(Qt3DCore::QNodeId entityId)
+{
+ Entity *entity = nullptr;
+ if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::EntityHandle,
+ entityId, (void**)&entity, nullptr)) {
+ return false;
+ }
+ if (!entity->containsComponentsOfType<ObjectPicker>() ||
+ !entity->containsComponentsOfType<GeometryRenderer>()) {
+ qCWarning(Qt3DRender::Quick::Scene2D) << Q_FUNC_INFO
+ << "Entity does not contain required components: ObjectPicker and GeometryRenderer";
+ return false;
+ }
+ Qt3DCore::QBackendNodePrivate *priv = Qt3DCore::QBackendNodePrivate::get(this);
+ Qt3DCore::QChangeArbiter *arbiter = static_cast<Qt3DCore::QChangeArbiter*>(priv->m_arbiter);
+ arbiter->registerObserver(d_ptr, entity->componentUuid<ObjectPicker>());
+ return true;
+}
+
+void Scene2D::unregisterObjectPickerEvents(Qt3DCore::QNodeId entityId)
+{
+ Entity *entity = nullptr;
+ if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::EntityHandle,
+ entityId, (void**)&entity, nullptr)) {
+ return;
+ }
+ Qt3DCore::QBackendNodePrivate *priv = Qt3DCore::QBackendNodePrivate::get(this);
+ Qt3DCore::QChangeArbiter *arbiter = static_cast<Qt3DCore::QChangeArbiter*>(priv->m_arbiter);
+ arbiter->unregisterObserver(d_ptr, entity->componentUuid<ObjectPicker>());
+}
+
+void Scene2D::handlePickEvent(int type, const Qt3DRender::QPickEventPtr &ev)
+{
+ if (!isEnabled())
+ return;
+ if (m_mouseEnabled) {
+ QPickTriangleEvent *pickTriangle = static_cast<QPickTriangleEvent *>(ev.data());
+ Entity *entity = nullptr;
+ if (!resourceAccessor()->accessResource(RenderBackendResourceAccessor::EntityHandle,
+ QPickEventPrivate::get(pickTriangle)->m_entity,
+ (void**)&entity, nullptr)) {
+ return;
+ }
+ CoordinateReader reader(renderer()->nodeManagers());
+ if (reader.setGeometry(entity->renderComponent<GeometryRenderer>(),
+ QAttribute::defaultTextureCoordinateAttributeName())) {
+ QVector4D c0 = reader.getCoordinate(pickTriangle->vertex1Index());
+ QVector4D c1 = reader.getCoordinate(pickTriangle->vertex2Index());
+ QVector4D c2 = reader.getCoordinate(pickTriangle->vertex3Index());
+ QVector4D ci = c0 * pickTriangle->uvw().x()
+ + c1 * pickTriangle->uvw().y() + c2 * pickTriangle->uvw().z();
+ ci.setW(1.0f);
+
+ const QSize size = m_sharedObject->m_quickWindow->size();
+ QPointF pos = QPointF(ci.x() * size.width(), (1.0f - ci.y()) * size.height());
+ QMouseEvent *mouseEvent
+ = new QMouseEvent(static_cast<QEvent::Type>(type),
+ pos, pos, pos,
+ static_cast<Qt::MouseButton>(pickTriangle->button()),
+ static_cast<Qt::MouseButtons>(pickTriangle->buttons()),
+ static_cast<Qt::KeyboardModifiers>(pickTriangle->modifiers()),
+ Qt::MouseEventSynthesizedByApplication);
+
+ QCoreApplication::postEvent(m_sharedObject->m_quickWindow, mouseEvent);
+ }
+ } else if (type == QEvent::MouseButtonPress) {
+ m_cachedPickEvent = ev;
+ } else {
+ m_cachedPickEvent.clear();
+ }
+}
+
+void Scene2D::startGrabbing()
+{
+ for (Qt3DCore::QNodeId e : qAsConst(m_entities))
+ registerObjectPickerEvents(e);
+}
+
+void Scene2D::stopGrabbing()
+{
+ for (Qt3DCore::QNodeId e : qAsConst(m_entities))
+ unregisterObjectPickerEvents(e);
+}
+
+} // namespace Quick
+} // namespace Render
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/items/scene2d.pri b/src/quick3d/quick3dscene2d/items/scene2d.pri
new file mode 100644
index 000000000..4635c43e1
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2d.pri
@@ -0,0 +1,10 @@
+HEADERS += \
+ $$PWD/qscene2d.h \
+ $$PWD/qscene2d_p.h \
+ $$PWD/scene2d_p.h
+
+SOURCES += \
+ $$PWD/qscene2d.cpp \
+ $$PWD/scene2d.cpp
+
+INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3dscene2d/items/scene2d_p.h b/src/quick3d/quick3dscene2d/items/scene2d_p.h
new file mode 100644
index 000000000..b42089306
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2d_p.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_RENDER_QUICK3DSCENE2D_SCENE2D_P_H
+#define QT3DRENDER_RENDER_QUICK3DSCENE2D_SCENE2D_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DCore/qnodeid.h>
+#include <Qt3DCore/qpropertyupdatedchange.h>
+#include <Qt3DRender/qpickevent.h>
+#include <Qt3DQuickScene2D/qscene2d.h>
+
+#include <private/qscene2d_p.h>
+#include <private/qrendertargetoutput_p.h>
+#include <private/backendnode_p.h>
+#include <private/attachmentpack_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Render {
+
+class GraphicsContext;
+
+namespace Quick {
+
+class Scene2D;
+
+class RenderQmlEventHandler : public QObject
+{
+ Q_OBJECT
+public:
+ RenderQmlEventHandler(Scene2D *node);
+ bool event(QEvent *e) Q_DECL_OVERRIDE;
+
+private:
+ Scene2D *m_node;
+};
+
+class QT3DQUICKSCENE2DSHARED_EXPORT Scene2D : public Qt3DRender::Render::BackendNode
+{
+public:
+ Scene2D();
+ ~Scene2D();
+
+ void render();
+ void initializeRender();
+ void setSharedObject(Qt3DRender::Quick::Scene2DSharedObjectPtr sharedObject);
+ void cleanup();
+ void setOutput(Qt3DCore::QNodeId outputId);
+ void initializeSharedObject();
+
+ void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_OVERRIDE;
+ void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
+
+ bool updateFbo(QOpenGLTexture *texture);
+ void syncRenderControl();
+ void startGrabbing();
+ void stopGrabbing();
+ bool registerObjectPickerEvents(Qt3DCore::QNodeId entityId);
+ void unregisterObjectPickerEvents(Qt3DCore::QNodeId entityId);
+ void handlePickEvent(int type, const Qt3DRender::QPickEventPtr &ev);
+
+ QOpenGLContext *m_context;
+ QOpenGLContext *m_shareContext;
+ QThread *m_renderThread;
+ Qt3DCore::QNodeId m_outputId;
+ QSharedPointer<Qt3DRender::Quick::Scene2DSharedObject> m_sharedObject;
+ Qt3DCore::QNodeId m_peerId;
+ Qt3DRender::Render::Attachment m_attachmentData;
+
+ GLuint m_fbo;
+ GLuint m_rbo;
+ QSize m_textureSize;
+
+ bool m_initialized;
+ bool m_renderInitialized;
+ bool m_mouseEnabled;
+ Qt3DRender::Quick::QScene2D::RenderPolicy m_renderPolicy;
+ QVector<Qt3DCore::QNodeId> m_entities;
+ Qt3DRender::QPickEventPtr m_cachedPickEvent;
+};
+
+} // Quick
+} // Render
+} // Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_RENDER_QUICK3DSCENE2D_SCENE2D_P_H
diff --git a/src/quick3d/quick3dscene2d/items/scene2devent_p.h b/src/quick3d/quick3dscene2d/items/scene2devent_p.h
new file mode 100644
index 000000000..bcc808a4d
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2devent_p.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QUICK3DRENDER_SCENE2DEVENT_P_H
+#define QT3DRENDER_QUICK3DRENDER_SCENE2DEVENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickScene2D/qt3dquickscene2d_global.h>
+
+#include <QtCore/QEvent>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class Scene2DEvent : public QEvent
+{
+public:
+ enum Type {
+ Initialize = QEvent::User + 1,
+ Render,
+ RenderSync,
+ Prepare,
+ Initialized,
+ Rendered,
+ Quit
+ };
+ Scene2DEvent(Type type)
+ : QEvent(static_cast<QEvent::Type>(type))
+ {
+ }
+};
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_QUICK3DRENDER_SCENE2DEVENT_P_H
diff --git a/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
new file mode 100644
index 000000000..20c080dec
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
@@ -0,0 +1,248 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qscene2d.h"
+#include "qscene2d_p.h"
+#include "scene2d_p.h"
+#include "scene2dmanager_p.h"
+#include "scene2devent_p.h"
+
+#include <Qt3DCore/QPropertyUpdatedChange>
+
+QT_BEGIN_NAMESPACE
+
+using namespace Qt3DCore;
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class RenderControl : public QQuickRenderControl
+{
+public:
+ RenderControl(QWindow *w) : m_window(w) { }
+ QWindow *renderWindow(QPoint *offset) Q_DECL_OVERRIDE;
+
+private:
+ QWindow *m_window;
+};
+
+QWindow *RenderControl::renderWindow(QPoint *offset)
+{
+ if (offset)
+ *offset = QPoint(0, 0);
+ return m_window;
+}
+
+/*!
+ \internal
+ Constructs qml render manager.
+ */
+Scene2DManager::Scene2DManager(QScene2DPrivate *priv)
+ : m_rootItem(nullptr)
+ , m_item(nullptr)
+ , m_priv(priv)
+ , m_sharedObject(new Scene2DSharedObject(this))
+ , m_renderPolicy(QScene2D::Continuous)
+ , m_requested(false)
+ , m_initialized(false)
+ , m_renderSyncRequested(false)
+ , m_backendInitialized(false)
+ , m_mouseEnabled(true)
+{
+ m_sharedObject->m_surface = new QOffscreenSurface;
+ m_sharedObject->m_surface->setFormat(QSurfaceFormat::defaultFormat());
+ m_sharedObject->m_surface->create();
+
+ // Create render control
+ m_sharedObject->m_renderControl = new RenderControl(nullptr);
+
+ // Create window to render the QML with
+ m_sharedObject->m_quickWindow = new QQuickWindow(m_sharedObject->m_renderControl);
+ m_sharedObject->m_quickWindow->setClearBeforeRendering(false);
+
+ connect(m_sharedObject->m_renderControl, &QQuickRenderControl::renderRequested,
+ this, &Scene2DManager::requestRender);
+ connect(m_sharedObject->m_renderControl, &QQuickRenderControl::sceneChanged,
+ this, &Scene2DManager::requestRenderSync);
+}
+
+Scene2DManager::~Scene2DManager()
+{
+ m_sharedObject = nullptr;
+}
+
+void Scene2DManager::requestRender()
+{
+ // Don't request render until the backend is initialized.
+ if (m_sharedObject->canRender()) {
+ if (!m_requested) {
+ m_requested = true;
+ QCoreApplication::postEvent(this, new Scene2DEvent(Scene2DEvent::Render));
+ }
+ }
+}
+
+void Scene2DManager::requestRenderSync()
+{
+ // Don't request render until the backed is initialized.
+ if (m_sharedObject->canRender()) {
+ if (!m_requested) {
+ m_requested = true;
+ QCoreApplication::postEvent(this, new Scene2DEvent(Scene2DEvent::RenderSync));
+ }
+ } else {
+ m_renderSyncRequested = true;
+ }
+}
+
+void Scene2DManager::startIfInitialized()
+{
+ if (!m_initialized && m_backendInitialized && m_item != nullptr) {
+ m_rootItem = m_item;
+
+ // Associate root item with the window.
+ m_rootItem->setParentItem(m_sharedObject->m_quickWindow->contentItem());
+
+ // Update window size.
+ updateSizes();
+
+ m_initialized = true;
+ m_sharedObject->setInitialized();
+ }
+}
+
+void Scene2DManager::stopAndClean()
+{
+ if (m_sharedObject->isInitialized()) {
+ QMutexLocker lock(&m_sharedObject->m_mutex);
+ m_sharedObject->requestQuit();
+ m_sharedObject->wait();
+ m_sharedObject->cleanup();
+ }
+}
+
+void Scene2DManager::updateSizes()
+{
+ const int width = m_rootItem->width();
+ const int height = m_rootItem->height();
+ if (width == 0 || height == 0) {
+ qWarning() << "QScene2D: Root item size not set.";
+ return;
+ }
+ m_sharedObject->m_quickWindow->setGeometry(0, 0, width, height);
+}
+
+void Scene2DManager::setItem(QQuickItem *item)
+{
+ m_item = item;
+ startIfInitialized();
+}
+
+bool Scene2DManager::event(QEvent *e)
+{
+ switch (static_cast<Scene2DEvent::Type>(e->type())) {
+
+ case Scene2DEvent::Render: {
+ // just render request, don't need to call sync in render thread
+ QMutexLocker lock(&m_sharedObject->m_mutex);
+ m_sharedObject->requestRender(false);
+ m_requested = false;
+ return true;
+ }
+
+ case Scene2DEvent::RenderSync: {
+ // sync and render request, main and render threads must be synchronized
+ if (!m_sharedObject->isQuit())
+ doRenderSync();
+ m_requested = false;
+ return true;
+ }
+
+ case Scene2DEvent::Prepare: {
+ m_sharedObject->m_renderControl->prepareThread(m_sharedObject->m_renderThread);
+ m_sharedObject->setPrepared();
+
+ if (m_renderSyncRequested) {
+ if (!m_requested) {
+ m_requested = true;
+ QCoreApplication::postEvent(this, new Scene2DEvent(Scene2DEvent::RenderSync));
+ }
+ m_renderSyncRequested = false;
+ }
+ return true;
+ }
+
+ case Scene2DEvent::Initialized: {
+ // backend is initialized, start the qml
+ m_backendInitialized = true;
+ startIfInitialized();
+ return true;
+ }
+
+ case Scene2DEvent::Rendered: {
+ // render is done, excellent, now clean anything not needed anymore.
+ stopAndClean();
+ return true;
+ }
+
+ default:
+ break;
+ }
+ return QObject::event(e);
+}
+
+void Scene2DManager::doRenderSync()
+{
+ QMutexLocker lock(&m_sharedObject->m_mutex);
+
+ m_sharedObject->requestRender(true);
+ m_sharedObject->m_renderControl->polishItems();
+
+ // begin waiting render thread
+ m_sharedObject->wait();
+ m_requested = false;
+}
+
+void Scene2DManager::cleanup()
+{
+ stopAndClean();
+}
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h b/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h
new file mode 100644
index 000000000..821616f47
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2dmanager_p.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QUICK3DRENDER_SCENE2DMANAGER_P_H
+#define QT3DRENDER_QUICK3DRENDER_SCENE2DMANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickScene2D/qt3dquickscene2d_global.h>
+#include <Qt3DQuickScene2D/qscene2d.h>
+
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlComponent>
+#include <QtQuick/QQuickItem>
+
+#include <private/qnode_p.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class QScene2DPrivate;
+class Scene2DSharedObject;
+
+class Scene2DManager : public QObject
+{
+ Q_OBJECT
+public:
+ Scene2DManager(QScene2DPrivate *priv);
+ ~Scene2DManager();
+
+ QQuickItem *m_rootItem;
+ QQuickItem *m_item;
+
+ QScene2DPrivate *m_priv;
+ QSharedPointer<Scene2DSharedObject> m_sharedObject;
+
+ Qt3DCore::QNodeId m_id;
+ QScene2D::RenderPolicy m_renderPolicy;
+
+ bool m_requested;
+ bool m_initialized;
+ bool m_renderSyncRequested;
+ bool m_backendInitialized;
+ bool m_mouseEnabled;
+
+ void requestRender();
+ void requestRenderSync();
+ void doRenderSync();
+ void startIfInitialized();
+ void stopAndClean();
+ void updateSizes();
+
+ void setItem(QQuickItem *item);
+
+ bool event(QEvent *e) Q_DECL_OVERRIDE;
+
+ void cleanup();
+};
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_QUICK3DRENDER_SCENE2DMANAGER_P_H
diff --git a/src/quick3d/quick3dscene2d/items/scene2dsharedobject.cpp b/src/quick3d/quick3dscene2d/items/scene2dsharedobject.cpp
new file mode 100644
index 000000000..1dd798d94
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2dsharedobject.cpp
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qscene2d.h"
+#include "qscene2d_p.h"
+#include "scene2d_p.h"
+#include "scene2dmanager_p.h"
+#include "scene2devent_p.h"
+#include "scene2dsharedobject_p.h"
+
+#include <Qt3DCore/QPropertyUpdatedChange>
+
+QT_BEGIN_NAMESPACE
+
+using namespace Qt3DCore;
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+
+/*!
+ \internal
+ Constructs object shared by the front-end and back-end to synchronize the rendering.
+ */
+Scene2DSharedObject::Scene2DSharedObject(Scene2DManager *manager)
+ : m_renderControl(nullptr)
+ , m_quickWindow(nullptr)
+ , m_renderManager(manager)
+ , m_surface(nullptr)
+ , m_renderObject(nullptr)
+ , m_disallowed(false)
+ , m_quit(false)
+ , m_requestSync(false)
+ , m_prepared(false)
+ , m_initialized(false)
+{
+}
+
+Scene2DSharedObject::~Scene2DSharedObject()
+{
+}
+
+void Scene2DSharedObject::cleanup()
+{
+ delete m_renderControl;
+ delete m_quickWindow;
+ delete m_surface;
+ m_renderControl = nullptr;
+ m_quickWindow = nullptr;
+ m_surface = nullptr;
+ m_initialized = false;
+}
+
+bool Scene2DSharedObject::canRender() const
+{
+ return m_initialized && m_prepared && !m_disallowed;
+}
+
+bool Scene2DSharedObject::isInitialized() const
+{
+ return m_initialized;
+}
+
+void Scene2DSharedObject::disallowRender()
+{
+ m_disallowed = true;
+}
+
+void Scene2DSharedObject::setInitialized()
+{
+ m_initialized = true;
+}
+
+bool Scene2DSharedObject::isPrepared() const
+{
+ return m_prepared;
+}
+
+void Scene2DSharedObject::setPrepared()
+{
+ m_prepared = true;
+}
+
+// not protected, call only from main thread
+bool Scene2DSharedObject::isQuit() const
+{
+ Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread());
+ return m_quit;
+}
+
+// not protected, call only from main thread
+void Scene2DSharedObject::requestQuit()
+{
+ Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread());
+ m_quit = true;
+ QCoreApplication::postEvent(m_renderObject, new Scene2DEvent(Scene2DEvent::Quit));
+}
+
+bool Scene2DSharedObject::isSyncRequested() const
+{
+ return m_requestSync;
+}
+
+void Scene2DSharedObject::requestRender(bool sync)
+{
+ m_requestSync = sync;
+ QCoreApplication::postEvent(m_renderObject, new Scene2DEvent(Scene2DEvent::Render));
+}
+
+void Scene2DSharedObject::wait()
+{
+ m_cond.wait(&m_mutex);
+}
+
+void Scene2DSharedObject::wake()
+{
+ m_cond.wakeOne();
+}
+
+void Scene2DSharedObject::clearSyncRequest()
+{
+ m_requestSync = false;
+}
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/items/scene2dsharedobject_p.h b/src/quick3d/quick3dscene2d/items/scene2dsharedobject_p.h
new file mode 100644
index 000000000..83863be20
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/items/scene2dsharedobject_p.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QUICK3DRENDER_SCENE2DSHAREDOBJECT_P_H
+#define QT3DRENDER_QUICK3DRENDER_SCENE2DSHAREDOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickScene2D/qt3dquickscene2d_global.h>
+#include <Qt3DQuickScene2D/qscene2d.h>
+
+#include <QtQuick/QQuickWindow>
+#include <QtQuick/QQuickRenderControl>
+#include <QtGui/QOffscreenSurface>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QWaitCondition>
+#include <QtCore/QThread>
+
+#include <private/qnode_p.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+class Scene2DManager;
+
+class Q_AUTOTEST_EXPORT Scene2DSharedObject
+{
+public:
+ Scene2DSharedObject(Scene2DManager *manager);
+ ~Scene2DSharedObject();
+
+ QQuickRenderControl *m_renderControl;
+ QQuickWindow *m_quickWindow;
+ Scene2DManager *m_renderManager;
+ QOffscreenSurface *m_surface;
+
+ QThread *m_renderThread;
+ QObject *m_renderObject;
+
+ QWaitCondition m_cond;
+ QMutex m_mutex;
+
+ bool isInitialized() const;
+ void setInitialized();
+
+ void requestQuit();
+ bool isQuit() const;
+
+ void requestRender(bool sync);
+
+ bool isSyncRequested() const;
+ void clearSyncRequest();
+
+ void wait();
+ void wake();
+
+ bool isPrepared() const;
+ void setPrepared();
+
+ void disallowRender();
+ bool canRender() const;
+
+ void cleanup();
+
+private:
+
+ bool m_disallowed;
+ bool m_quit;
+ bool m_requestSync;
+ bool m_prepared;
+ bool m_initialized;
+};
+
+typedef QSharedPointer<Scene2DSharedObject> Scene2DSharedObjectPtr;
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(Qt3DRender::Quick::Scene2DSharedObjectPtr)
+
+#endif // QT3DRENDER_QUICK3DRENDER_SCENE2DSHAREDOBJECT_P_H
diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.cpp b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.cpp
new file mode 100644
index 000000000..da5698d52
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qt3dquickscene2d_global_p.h"
+#include "qt3dquickscene2dnodefactory_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+namespace Quick {
+
+void Quick3DScene2D_initialize()
+{
+ Qt3DCore::QAbstractNodeFactory::registerNodeFactory(QuickScene2DNodeFactory::instance());
+}
+
+void Quick3DScene2D_registerType(const char *className, const char *quickName, int major, int minor)
+{
+ QuickScene2DNodeFactory::instance()->registerType(className, quickName, major, minor);
+}
+
+} // namespace Quick
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.h b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.h
new file mode 100644
index 000000000..509a62024
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DQUICKSCENE2D_GLOBAL_H
+#define QT3DQUICKSCENE2D_GLOBAL_H
+
+#include <Qt3DCore/qt3dcore_global.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_SHARED) || !defined(QT_STATIC)
+# if defined(QT_BUILD_3DQUICKSCENE2D_LIB)
+# define QT3DQUICKSCENE2DSHARED_EXPORT Q_DECL_EXPORT
+# else
+# define QT3DQUICKSCENE2DSHARED_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define QT3DQUICKSCENE2DSHARED_EXPORT
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKSCENE2D_GLOBAL_H
diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2d_global_p.h b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global_p.h
new file mode 100644
index 000000000..e115e3d5e
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2d_global_p.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DQUICKSCENE2D_GLOBAL_P_H
+#define QT3DQUICKSCENE2D_GLOBAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickScene2D/qt3dquickscene2d_global.h>
+#include <QtQml/qqml.h>
+
+#define QT3DQUICKSCENE2DSHARED_PRIVATE_EXPORT QT3DQUICKSCENE2DSHARED_EXPORT
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+namespace Quick {
+
+QT3DQUICKSCENE2DSHARED_PRIVATE_EXPORT void Quick3DScene2D_initialize();
+QT3DQUICKSCENE2DSHARED_PRIVATE_EXPORT void Quick3DScene2D_registerType(const char *className,
+ const char *quickName,
+ int major, int minor);
+
+template<class T, class E> void registerExtendedType(const char *className, const char *quickName,
+ const char *uri, int major, int minor,
+ const char *name)
+{
+ qmlRegisterExtendedType<T, E>(uri, major, minor, name);
+ Quick3DScene2D_registerType(className, quickName, major, minor);
+}
+
+template<class T> void registerType(const char *className, const char *quickName,
+ const char *uri, int major, int minor, const char *name)
+{
+ qmlRegisterType<T>(uri, major, minor, name);
+ Quick3DScene2D_registerType(className, quickName, major, minor);
+}
+
+} // Quick
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKSCENE2D_GLOBAL_P_H
diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging.cpp b/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging.cpp
new file mode 100644
index 000000000..e60ba0fde
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qt3dquickscene2d_logging_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+namespace Quick {
+
+Q_LOGGING_CATEGORY(Scene2D, "Qt3D.Scene2D", QtWarningMsg)
+
+} // Quick
+} // Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging_p.h b/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging_p.h
new file mode 100644
index 000000000..3120e9919
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2d_logging_p.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QT3DQUICKSCENE2D_LOGGING_P_H
+#define QT3DQUICKSCENE2D_LOGGING_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+namespace Quick {
+
+Q_DECLARE_LOGGING_CATEGORY(Scene2D)
+
+} // Quick
+} // Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DQUICKRENDER_LOGGING_P_H
diff --git a/src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp
index b7ad3188c..5d092501e 100644
--- a/src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2017 The Qt Company Ltd and/or its subsidiary(-ies).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
@@ -37,41 +37,53 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
-
-TechniqueFilter {
- // Expose camera to allow user to choose which camera to use for rendering
- property alias camera: cameraSelector.camera
- property alias clearColor: clearBuffer.clearColor
- property alias viewportRect: viewport.normalizedRect
- property alias window: surfaceSelector.surface
- property alias externalRenderTargetSize: surfaceSelector.externalRenderTargetSize
- property alias frustumCulling: frustumCulling.enabled
-
- // Select the forward rendering Technique of any used Effect
- matchAll: [ FilterKey { name: "renderingStyle"; value: "forward" } ]
-
- RenderSurfaceSelector {
- id: surfaceSelector
-
- // Use the whole viewport
- Viewport {
- id: viewport
- normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
-
- // Use the specified camera
- CameraSelector {
- id : cameraSelector
- FrustumCulling {
- id: frustumCulling
- ClearBuffers {
- id: clearBuffer
- clearColor: "white"
- buffers : ClearBuffers.ColorDepthBuffer
- }
- }
- }
- }
+#include "qt3dquickscene2dnodefactory_p.h"
+#include <QtQml/private/qqmlmetatype_p.h>
+
+#include <private/qrenderaspect_p.h>
+
+#include <QtCore/qcoreapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+Q_GLOBAL_STATIC(QuickScene2DNodeFactory, quick_scene2d_node_factory)
+
+static void initScene2dPlugin()
+{
+ Qt3DRender::QRenderAspectPrivate::configurePlugin(QLatin1String("scene2d"));
+}
+
+Q_COREAPP_STARTUP_FUNCTION(initScene2dPlugin)
+
+QuickScene2DNodeFactory *QuickScene2DNodeFactory::instance()
+{
+ return quick_scene2d_node_factory();
+}
+
+void QuickScene2DNodeFactory::registerType(const char *className, const char *quickName,
+ int major, int minor)
+{
+ m_types.insert(className, Type(quickName, major, minor));
+}
+
+Qt3DCore::QNode *QuickScene2DNodeFactory::createNode(const char *type)
+{
+ if (!m_types.contains(type))
+ return nullptr;
+
+ Type &typeInfo(m_types[type]);
+
+ if (!typeInfo.resolved) {
+ typeInfo.resolved = true;
+ typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName),
+ typeInfo.version.first, typeInfo.version.second);
}
+
+ return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr;
}
+
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h
index fffa2284d..b5eb82aa1 100644
--- a/src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml
+++ b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Copyright (C) 2017 The Qt Company Ltd and/or its subsidiary(-ies).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
@@ -37,35 +37,53 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
-import Qt3D.Render 2.0
+#ifndef QUICKSCENENODEFACTORY_H
+#define QUICKSCENENODEFACTORY_H
-Material {
- id: root
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
- property color diffuse: Qt.rgba( 0.0, 0.0, 0.0, 1.0 )
- property color specular: Qt.rgba( 0.0, 0.0, 0.0, 1.0 )
- property color coolColor: Qt.rgba( 0.0, 0.0, 0.4, 1.0 )
- property color warmColor: Qt.rgba( 0.4, 0.4, 0.0, 1.0 )
- property real alpha: 0.25
- property real beta: 0.5
- property real shininess: 100.0
+#include <Qt3DCore/private/qabstractnodefactory_p.h>
+#include <QtCore/qhash.h>
- parameters: [
- Parameter { name: "kd"; value: root.diffuse },
- Parameter { name: "ks"; value: root.specular },
- Parameter { name: "kblue"; value: root.coolColor },
- Parameter { name: "kyellow"; value: root.warmColor },
- Parameter { name: "alpha"; value: root.alpha },
- Parameter { name: "beta"; value: root.beta },
- Parameter { name: "shininess"; value: root.shininess }
- ]
+QT_BEGIN_NAMESPACE
- effect: DefaultEffect {
- vertexES: "qrc:/shaders/es2/gooch.vert"
- fragmentES: "qrc:/shaders/es2/gooch.frag"
- vertex: "qrc:/shaders/gl3/gooch.vert"
- fragment: "qrc:/shaders/gl3/gooch.frag"
- }
-}
+class QQmlType;
+namespace Qt3DRender {
+
+class QuickScene2DNodeFactory : public Qt3DCore::QAbstractNodeFactory
+{
+public:
+ Qt3DCore::QNode *createNode(const char *type) Q_DECL_OVERRIDE;
+
+ void registerType(const char *className, const char *quickName, int major, int minor);
+
+ static QuickScene2DNodeFactory *instance();
+
+private:
+ struct Type {
+ Type() : t(nullptr), resolved(false) { }
+ Type(const char *quickName, int major, int minor)
+ : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { }
+ QByteArray quickName;
+ QPair<int, int> version;
+ QQmlType *t;
+ bool resolved;
+ };
+ QHash<QByteArray, Type> m_types;
+};
+
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QUICKRENDERERNODEFACTORY_H
diff --git a/src/quick3d/quick3dscene2d/quick3dscene2d.pro b/src/quick3d/quick3dscene2d/quick3dscene2d.pro
new file mode 100644
index 000000000..7d2d59392
--- /dev/null
+++ b/src/quick3d/quick3dscene2d/quick3dscene2d.pro
@@ -0,0 +1,31 @@
+TARGET = Qt3DQuickScene2D
+MODULE = 3dquickscene2d
+
+QT += core core-private qml qml-private 3dcore 3drender 3dquick 3dquick-private 3dcore-private 3drender-private
+CONFIG -= precompile_header
+
+# Qt3D is free of Q_FOREACH - make sure it stays that way:
+DEFINES += QT_NO_FOREACH
+
+gcov {
+ QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
+ QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
+}
+
+SOURCES += \
+ qt3dquickscene2d_global.cpp \
+ qt3dquickscene2dnodefactory.cpp \
+ qt3dquickscene2d_logging.cpp
+
+HEADERS += \
+ qt3dquickscene2dnodefactory_p.h \
+ qt3dquickscene2d_global_p.h \
+ qt3dquickscene2d_global.h \
+ qt3dquickscene2d_logging_p.h
+
+# otherwise mingw headers do not declare common functions like ::strcasecmp
+win32-g++*:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
+
+include(./items/items.pri)
+
+load(qt_module)