Handling of property reference changes

When a QML property that is part of the Components list of an Entity
changes reference, this triggers a QQmlListProperty clear followed
by a QQmlListProperty append of each Component.
In turn, foreach Component added, a notification ComponentAdded is submitted
to the QChangeArbiter. The Arbiter notifies the RenderNode observing the
frontend Entity so that the backend can be rebuilt.

RenderNode handles the ComponentAdded, ComponentRemoved notification as it
is the only backend element linked to the corresponding frontend Entity. That
means that when such an event occurs, it has to check for the type of
Component being added or removed and update the corresponding backend classes
(RenderMesh, RenderCamera, RenderMaterial ...). This is a design choice so as
to avoid having all backend render classes have a reference to the frontend
Entity. Also reference property changes should be fairly rare and handling all
of those in RenderNode reduces notification traffic.
On the other hand, ComponentUpdate notifications are handled directly by the
backend classes (RenderCamera, RenderMesh ..).

Note : Please make sure that the property whose reference is changed is
actually part of the components list of the Qml Entity so as to avoid losing
time not understanding why updates have no effect.

Also, the QChangeArbiter takes a binary flag QChangeFlag when registering an
observer. The flags can be a combination of common events. It is then up to
the observer to check upon reception of a notification, the subject, property
name and the value contained in the QSceneChangePropertyEvent.

Change-Id: I0bff49d753c439999d6745af03d14d4ae36a118a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Removed useless mutex use in Renderer

Change-Id: I05f4d519865f6c8bb7ba8c9089185546fa222db7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
TechniqueManager

RenderTechnique are indexed by a pair composed of the Effect frontend and the
technique name.

Change-Id: Ie4dd5388ca7fc87905cef196a6e23d7941389114
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Added TechniqueManager to Renderer

Change-Id: I9973a717ca41786294574baa572ca311aaf0cbc1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
RenderMesh set to dirty on peer change

This allows the RenderMesh - MeshData link to be updated when the frontent
peer Mesh assigned to RenderMesh is updated.

Change-Id: I36c6beca551709e5f0f68e3bfe354bf7baa78885
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3D independent library

In order to be able to have Qt3D work without dependencies to the Qml module,
a dedicated Quick3D library has been set up for that purpose. It offers a
QQuickWindow class which extends Qt3D::Window and allows to load a Qml source
file.

Examples have been updated to use QuickWindow.

Note: There are still dependencies to the Qml module in Qt3DCore and
Qt3DRenderer. This patch is a first step toward the removal of those. Follow
up commits will completely remove those dependencies.

Change-Id: I603eec8fb01b3706f648550b43b62356b0b4b4ac
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3DTransform

Quick3D frontend element to create a Qt3DCore Transform element from Qml.
The QQmlListProperty was removed from Transform and transferred to
Quick3DTransform so that in a near future all Qml dependencies will be removed
from Qt3DCore.

More similar follow-up patches to follow.

Change-Id: I0154da986176da31d58738123a6b56f63ccaf32e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Renamed QmlEntity to Quick3DEntity

To be consistent with the quick3d module name and other quick3d elements.

Change-Id: Iaed819e9690a5c516aaadad2b62ecc4f25332853
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3DNode

Qml frontend Entity for Qt3D::Node.

All QQmlListProperty are now in Quick3DNode.

Note : this breaks the rendering as the Qml FrameGraph is defined by
FrameGraphItem elements that inherit Node. As node no longer has
QQmlListProperties and a Default property, FrameGraphItem nodes cannot
be added to the FrameGraph tree.
The follow-up patches will correct that.

Change-Id: Iac8cb89cffca8d604b003d546350bc0afdb1eb0e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
FrameGraphItems C++ Qml API

FrameGraphItems are different from usual Qt3D elements as they inherit from
FrameGraphItem which is a sublcass of Node. As Qml items should now inherit
Quick3DNode instead of Node, this makes using old FrameGraphItems as they were
impossible because children cannot be added to a Node in Qml if the Node is
not a Quick3DNode.

One method that reduces code duplication to the minimum is creating abstract
classes for Viewport, RenderTargetSelector, CameraSelector, RenderPassFilter
and TechniqueFilter. Then the C++ FrameGraphItem Nodes can inherit from node
and one of those abstracts. On the QML side, Quick3D FrameGraphItems inherit
from Quick3DNode and one of the base class.

Because multiple inheritance of QObject is not possible, abstract
FrameGraphItems are not subclasses of QObject and are therefore declared as
Q_INTERFACES so as to be able to perform qobject_cast.

Change-Id: Ibf1350a53ce409ff03aad8d0fd8f5b7d6cc26fc0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Abstract Entity, EntityNode and Quick3DEntity

Because Node no longer holds QQmlListProperties, Entity which inherited Node
could'nt be used to have nested children in Qml because there was no longer a
data DefaultProperty.

To solve that issue Entity has become an abstract class encapsulating most
what an Entity used to contain. EntityNode is a class bound to be used by
the C++ API and it subclasses Node and Entity. Regarding the Qml API,
Quick3DEntity subclasses Quick3DNode and Entity.

RenderSceneBuilder and NodeVisitor have been slightly modified to work with
those changes but the backend is pretty much the same. The big change is that
Entity is no longer a QObject and no logner inherits Node. That means Node and
Entity have to be used along side on the backend. On the frontend or other
Aspects subclassing EntityNode or Quick3DEntity should be pretty much the same
as subclassing Entity prior this change.

Component classes have not been touched so they cannot contain nested QtQuick2
elements in QML. As Entity and Nodes can hold QtQuick2 Components this isn't a
big issue. Also as the DefaultProperty of each Component subclasses may
differ, keeping them as they are at the moment could make sense.

Note: This patch restored rendering. The code is a bit messy at the
moment but necessary to keep commits small. Follow up patches will clean
things up a bit and move the Qml and C++ API in distinct subprojects.

Change-Id: Ia048812f51bbbd43ec2ee754b5120b7ec3174436
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
QQmlExtensionPlugins for Qt3DCore and Qt3DRenderer

Quick3D components for core and renderer have been moved to their own module.
For each module, a QQmlExtensionPlugin has been created and is installed in
qtbase/qml/Qt3D/.

To use the Qml API, 3dquick needs to added in the .pro.
3dquickrenderer can be added if subclassing Quick3D elements defined in
Renderer. Otherwise, appending it is not necessary as the Qml engine will
automatically load the QQmlExtensionPlugin.

Core has no more reference to the QML module. Qt3DRenderer still has
references to the QML module which will be remove in follow up patches.

Change-Id: I0cd5cbd27020c776b9eb8d1548514df2b1321bbd
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Removal of QmlRegistration in Aspects

Aspects no longer need to register Qml components. This has to be done through
the use of QQmlExtensionPlugin and dedicated modules.

Change-Id: I63554736e88db5acf7a0a91e215bdc8895363b45
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3DMaterial subclass of Material

Quick3DMaterial exposes a QQmlListProperty of Tags that are used to set
Material parameters and texture. In the near future that may be replace by a
custom QQmlCustomParser.

Change-Id: I7381691a77768b6f76265ef30b68ab033504c166
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3DTechnique

Moved the QQmlListProperties used for tags and renderpasses out of Technique.

Change-Id: I9cfe3eb5f1a78528e1b67ebb8bd24a768c328d5e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Quick3DEffect and EffectNode

Effect has been transformed to a non QObject abstract. EffectNode and
Quick3DEffect subclass Effect. This was needed so that Quick3DEffect can have
node children such as ShaderProgram.

Few changes to the backend and renderer to accommodate that a Material's effect
is now returned as a Node instead of an Effect as an Effect cannot be
registered as qml types as it has no QObject base.

Change-Id: Ief40f1d784151a085f244c35b3ed09a93dcc153e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Removed last QML dependency of the Render module.

Change-Id: Ie1041622b7de10d22afc439042301493e737b7f1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Transform fix

When appending a transformation to a Transform component, the updated
transform matrix was computed prior to having the transformation
appended. This lead to the transform matrix not having the correct
values.

Change-Id: Iee3634017acdf3e0d7f9b61ab47c9cff535e9163
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
RenderSceneBuilder fix

When the root node is an Entity, the node root handle was not properly set.
Also added warnings when having a CameraSelector that references an Entity
that doesn't contain a CameraLens components, hence not being a camera.

Change-Id: Ic26ca178698bdfac6e51e0e64fb1bbf3108579e0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Updated cpp_example

Example using only the cpp API and no dependency to the QML module.

Change-Id: Id5f2a3f297e0db9b4ba3ec4abbb71639cd57ddf8
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>