MeshManager renamed to MeshDataManager

Some ground work to made to have a MeshManager of RenderMesh
Some comments and refactorings here and there

Change-Id: Ia4a2e5bc5b77fed2f57a022630d7e28e9690c609
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
RenderMesh and MeshManager

For each Entity with a Mesh property, a RenderMesh is created.
For each mesh source, a MeshData is created.
RenderCommand has a handle to a RenderMesh. That allows for a RenderMesh
and MeshData to be properly updated if a Mesh's source changes.

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

RenderNode now uses a QHandle to a QMatrix4x4

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

One VAO is created and associated to a MeshData and a RenderShader.
A ShaderManager was added but default Material / Technique and Shader
are still being used. Small changes to how the RenderCommands are executed
and the RenderView processed. Nice performance improvement overall.
Also proceeded with the removal of most of the hacked renderer.

Change-Id: Ie99bea7863e979e3dd88c8599472d527bb24b28c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Hookup Assimp scene loader

Assimp scene loadet hooked up.
Required a few changes to VAOManager and MeshDataManager.
MeshData aren't indexed by their sources any longer as a Mesh can set
its data either by having a source (obj scene file) or by a raw MeshData
(case of scene loaders). MeshData are now indexed by their frontend
Mesh's uuid.
The LoadMeshDataJobs and RenderSceneBuilder have been slightly modified
to incorporate those changes as well.

Note : VAOManager has to be a QArrayResourcesManager instead of a
QListResourcesManager.

Change-Id: Ia874e58871ab221636e0c5701d8a566642e663d2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Slight changes to QChangeArbiter

QChangerArbiter now takes an int instead of a QChangeFlag when
registering an observer.
Completed unregister methods and changes are only forwarded to
observer that monitor that type of change.

Change-Id: I67600eaa2803e0a0b08f700a0cc789e64e807b4e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Transform updates synched with QChangeArbiter

Transform monitor changes of each of its AbstractTransform objects.
On a change, it notifies the QChangeArbiter. The QChangeArbiter tells
the associated RenderNode about the change. The RenderNode updates its
localTransform matrix.

Small typo correction appendTransform instead of appendTransfrom.

Change-Id: I8613cda1b3c7b7211722f78585ac75736528f86a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Handle Component property reference changes

A follow up patch with a reworked Entity / Component
composition will follow.

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

QmlEntity is a subclass of Entity.
It contains a QmlListProperty of Components. It properly
separates the C++ from Qml.

Change-Id: I8004943e3a98fb3211309a38e022be71560f9951
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Hooked up QmlEntity

The simple_qml has been updated to use QmlEntity.
Only QmlEntity is instanciable on the Qml side. With the
use of a QmlListProperty we can easily monitor component changes.

Change-Id: Ie59258767450e842093bd76b0f55dfe31724c752
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
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>