summaryrefslogtreecommitdiffstats
path: root/src/render/backend/nodemanagers_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-11-10 09:25:59 +0100
committerAndy Nichols <andy.nichols@theqtcompany.com>2015-11-16 12:26:08 +0000
commiteb43b63a8457f451507f47b4fb6b16bdafc677f9 (patch)
tree94d016d5c5bf3519a367217a854c746504f6790f /src/render/backend/nodemanagers_p.h
parent655d39dd70571bfb8defc0ccc0f39cc0883e41ad (diff)
NodeManagers class added
The Renderer will have an instance of it so that the managing nodes part can be removed from the Renderer class (should make it easier to test in the long run). Change-Id: Ia85833adff5d0bb383b6cb7bc44869141e1d4985 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/render/backend/nodemanagers_p.h')
-rw-r--r--src/render/backend/nodemanagers_p.h321
1 files changed, 321 insertions, 0 deletions
diff --git a/src/render/backend/nodemanagers_p.h b/src/render/backend/nodemanagers_p.h
new file mode 100644
index 000000000..827ddfe7d
--- /dev/null
+++ b/src/render/backend/nodemanagers_p.h
@@ -0,0 +1,321 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_RENDER_NODEMANAGERS_H
+#define QT3DRENDER_RENDER_NODEMANAGERS_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/private/qresourcemanager_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QMatrix4x4;
+class QOpenGLVertexArrayObject;
+
+namespace Qt3DRender {
+
+class QTexImageData;
+
+namespace Render {
+
+class CameraManager;
+class EntityManager;
+class BufferManager;
+class AttributeManager;
+class GeometryManager;
+class GeometryRendererManager;
+class ObjectPickerManager;
+class BoundingVolumeDebugManager;
+class MaterialManager;
+class MatrixManager;
+class VAOManager;
+class ShaderManager;
+class TechniqueManager;
+class EffectManager;
+class RenderPassManager;
+class RenderTargetManager;
+class SceneManager;
+class AttachmentManager;
+class SortCriterionManager;
+class ParameterManager;
+class ShaderDataManager;
+class UBOManager;
+class TextureImageManager;
+class CriterionManager;
+class FrameGraphManager;
+class TransformManager;
+class TextureManager;
+class TextureDataManager;
+class LayerManager;
+class LightManager;
+
+class FrameGraphNode;
+class Annotation;
+class Entity;
+class CameraLens;
+class Material;
+class Shader;
+class Technique;
+class Effect;
+class RenderPass;
+class Texture;
+class Layer;
+class Annotation;
+class FrameGraphNode;
+class Transform;
+class Scene;
+class RenderAttachment;
+class RenderTarget;
+class ShaderData;
+class SortCriterion;
+class Parameter;
+class UniformBuffer;
+class TextureImage;
+class Buffer;
+class Attribute;
+class Geometry;
+class GeometryRenderer;
+class ObjectPicker;
+class BoundingVolumeDebug;
+
+class Q_AUTOTEST_EXPORT NodeManagers
+{
+public:
+ NodeManagers();
+
+ template<class Backend, typename Manager>
+ Manager *manager() const Q_DECL_NOEXCEPT
+ {
+ return Q_NULLPTR;
+ }
+
+ template<class Backend, typename Manager, typename Key>
+ Backend *lookupResource(const Key &id) const
+ {
+ Manager *mgr = manager<Backend, Manager>();
+ if (mgr != Q_NULLPTR)
+ return mgr->lookupResource(id);
+ return Q_NULLPTR;
+ }
+
+ template<class Backend, typename Manager, typename Handle, typename Key>
+ Handle lookupHandle(const Key &id) const
+ {
+ Manager *mgr = manager<Backend, Manager>();
+ if (mgr != Q_NULLPTR)
+ return mgr->lookupHandle(id);
+ return Handle();
+ }
+
+ template<class Backend, typename Manager, typename Handle>
+ Backend *data(Handle handle)
+ {
+ Manager *mgr = manager<Backend, Manager>();
+ if (mgr != Q_NULLPTR)
+ return mgr->data(handle);
+ return Q_NULLPTR;
+ }
+
+
+ inline CameraManager *cameraManager() const Q_DECL_NOEXCEPT { return m_cameraManager; }
+ inline EntityManager *renderNodesManager() const Q_DECL_NOEXCEPT { return m_renderNodesManager; }
+ inline MaterialManager *materialManager() const Q_DECL_NOEXCEPT { return m_materialManager; }
+ inline MatrixManager *worldMatrixManager() const Q_DECL_NOEXCEPT { return m_worldMatrixManager; }
+ inline VAOManager *vaoManager() const Q_DECL_NOEXCEPT { return m_vaoManager; }
+ inline ShaderManager *shaderManager() const Q_DECL_NOEXCEPT { return m_shaderManager; }
+ inline TechniqueManager *techniqueManager() const Q_DECL_NOEXCEPT { return m_techniqueManager; }
+ inline EffectManager *effectManager() const Q_DECL_NOEXCEPT { return m_effectManager; }
+ inline RenderPassManager *renderPassManager() const Q_DECL_NOEXCEPT { return m_renderPassManager; }
+ inline TextureManager *textureManager() const Q_DECL_NOEXCEPT { return m_textureManager; }
+ inline TextureDataManager *textureDataManager() const Q_DECL_NOEXCEPT { return m_textureDataManager; }
+ inline LayerManager *layerManager() const Q_DECL_NOEXCEPT { return m_layerManager; }
+ inline CriterionManager *criterionManager() const Q_DECL_NOEXCEPT { return m_criterionManager; }
+ inline FrameGraphManager *frameGraphManager() const Q_DECL_NOEXCEPT { return m_frameGraphManager; }
+ inline TransformManager *transformManager() const Q_DECL_NOEXCEPT { return m_transformManager; }
+ inline RenderTargetManager *renderTargetManager() const Q_DECL_NOEXCEPT { return m_renderTargetManager; }
+ inline SceneManager *sceneManager() const Q_DECL_NOEXCEPT { return m_sceneManager; }
+ inline AttachmentManager *attachmentManager() const Q_DECL_NOEXCEPT { return m_attachmentManager; }
+ inline SortCriterionManager *sortCriterionManager() const Q_DECL_NOEXCEPT { return m_sortCriterionManager; }
+ inline ParameterManager *parameterManager() const Q_DECL_NOEXCEPT { return m_parameterManager; }
+ inline ShaderDataManager *shaderDataManager() const Q_DECL_NOEXCEPT { return m_shaderDataManager; }
+ inline UBOManager *uboManager() const Q_DECL_NOEXCEPT { return m_uboManager; }
+ inline TextureImageManager *textureImageManager() const Q_DECL_NOEXCEPT { return m_textureImageManager; }
+ inline BufferManager *bufferManager() const Q_DECL_NOEXCEPT { return m_bufferManager; }
+ inline AttributeManager *attributeManager() const Q_DECL_NOEXCEPT { return m_attributeManager; }
+ inline GeometryManager *geometryManager() const Q_DECL_NOEXCEPT { return m_geometryManager; }
+ inline GeometryRendererManager *geometryRendererManager() const Q_DECL_NOEXCEPT { return m_geometryRendererManager; }
+ inline ObjectPickerManager *objectPickerManager() const Q_DECL_NOEXCEPT { return m_objectPickerManager; }
+ inline BoundingVolumeDebugManager *boundingVolumeDebugManager() const Q_DECL_NOEXCEPT { return m_boundingVolumeDebugManager; }
+
+private:
+ CameraManager *m_cameraManager;
+ EntityManager *m_renderNodesManager;
+ MaterialManager *m_materialManager;
+ MatrixManager *m_worldMatrixManager;
+ VAOManager *m_vaoManager;
+ ShaderManager *m_shaderManager;
+ TechniqueManager *m_techniqueManager;
+ EffectManager *m_effectManager;
+ RenderPassManager *m_renderPassManager;
+ TextureManager *m_textureManager;
+ TextureDataManager *m_textureDataManager;
+ LayerManager *m_layerManager;
+ CriterionManager *m_criterionManager;
+ FrameGraphManager *m_frameGraphManager;
+ TransformManager *m_transformManager;
+ RenderTargetManager *m_renderTargetManager;
+ SceneManager *m_sceneManager;
+ AttachmentManager *m_attachmentManager;
+ SortCriterionManager *m_sortCriterionManager;
+ ParameterManager *m_parameterManager;
+ ShaderDataManager *m_shaderDataManager;
+ UBOManager *m_uboManager;
+ TextureImageManager *m_textureImageManager;
+ BufferManager *m_bufferManager;
+ AttributeManager *m_attributeManager;
+ GeometryManager *m_geometryManager;
+ GeometryRendererManager *m_geometryRendererManager;
+ ObjectPickerManager *m_objectPickerManager;
+ BoundingVolumeDebugManager *m_boundingVolumeDebugManager;
+};
+
+// Specializations
+
+template<>
+CameraManager *NodeManagers::manager<CameraLens>() const Q_DECL_NOEXCEPT;
+
+template<>
+EntityManager *NodeManagers::manager<Entity>() const Q_DECL_NOEXCEPT;
+
+template<>
+MaterialManager *NodeManagers::manager<Material>() const Q_DECL_NOEXCEPT;
+
+template<>
+MatrixManager *NodeManagers::manager<QMatrix4x4*>() const Q_DECL_NOEXCEPT;
+
+template<>
+VAOManager *NodeManagers::manager<QOpenGLVertexArrayObject*>() const Q_DECL_NOEXCEPT;
+
+template<>
+ShaderManager *NodeManagers::manager<Shader>() const Q_DECL_NOEXCEPT;
+
+template<>
+TechniqueManager *NodeManagers::manager<Technique>() const Q_DECL_NOEXCEPT;
+
+template<>
+EffectManager *NodeManagers::manager<Effect>() const Q_DECL_NOEXCEPT;
+
+template<>
+RenderPassManager *NodeManagers::manager<RenderPass>() const Q_DECL_NOEXCEPT;
+
+template<>
+TextureManager *NodeManagers::manager<Texture>() const Q_DECL_NOEXCEPT;
+
+template<>
+TextureDataManager *NodeManagers::manager<QTexImageData>() const Q_DECL_NOEXCEPT;
+
+template<>
+LayerManager *NodeManagers::manager<Layer>() const Q_DECL_NOEXCEPT;
+
+template<>
+CriterionManager *NodeManagers::manager<Annotation>() const Q_DECL_NOEXCEPT;
+
+template<>
+FrameGraphManager *NodeManagers::manager<FrameGraphNode*>() const Q_DECL_NOEXCEPT;
+
+template<>
+TransformManager *NodeManagers::manager<Transform>() const Q_DECL_NOEXCEPT;
+
+template<>
+RenderTargetManager *NodeManagers::manager<RenderTarget>() const Q_DECL_NOEXCEPT;
+
+template<>
+SceneManager *NodeManagers::manager<Scene>() const Q_DECL_NOEXCEPT;
+
+template<>
+AttachmentManager *NodeManagers::manager<RenderAttachment>() const Q_DECL_NOEXCEPT;
+
+template<>
+SortCriterionManager *NodeManagers::manager<SortCriterion>() const Q_DECL_NOEXCEPT;
+
+template<>
+ParameterManager *NodeManagers::manager<Parameter>() const Q_DECL_NOEXCEPT;
+
+template<>
+ShaderDataManager *NodeManagers::manager<ShaderData>() const Q_DECL_NOEXCEPT;
+
+template<>
+UBOManager *NodeManagers::manager<UniformBuffer>() const Q_DECL_NOEXCEPT;
+
+template<>
+TextureImageManager *NodeManagers::manager<TextureImage>() const Q_DECL_NOEXCEPT;
+
+template<>
+BufferManager *NodeManagers::manager<Buffer>() const Q_DECL_NOEXCEPT;
+
+template<>
+AttributeManager *NodeManagers::manager<Attribute>() const Q_DECL_NOEXCEPT;
+
+template<>
+GeometryManager *NodeManagers::manager<Geometry>() const Q_DECL_NOEXCEPT;
+
+template<>
+GeometryRendererManager *NodeManagers::manager<GeometryRenderer>() const Q_DECL_NOEXCEPT;
+
+template<>
+ObjectPickerManager *NodeManagers::manager<ObjectPicker>() const Q_DECL_NOEXCEPT;
+
+template<>
+BoundingVolumeDebugManager *NodeManagers::manager<BoundingVolumeDebug>() const Q_DECL_NOEXCEPT;
+
+} // Render
+
+} // Qt3DRender
+
+QT_END_NAMESPACE
+
+
+#endif // NODEMANAGERS_H