1/****************************************************************************
2**
3** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt3D module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "nodemanagers_p.h"
41
42#include <Qt3DRender/private/managers_p.h>
43#include <Qt3DRender/private/scenemanager_p.h>
44#include <Qt3DRender/private/buffermanager_p.h>
45#include <Qt3DRender/private/geometryrenderermanager_p.h>
46#include <Qt3DRender/private/techniquemanager_p.h>
47#include <Qt3DRender/private/armature_p.h>
48#include <Qt3DRender/private/skeleton_p.h>
49
50
51QT_BEGIN_NAMESPACE
52
53namespace Qt3DRender {
54
55namespace Render {
56
57NodeManagers::NodeManagers()
58 : m_cameraManager(new CameraManager())
59 , m_renderNodesManager(new EntityManager())
60 , m_materialManager(new MaterialManager())
61 , m_worldMatrixManager(new MatrixManager())
62 , m_shaderManager(new ShaderManager())
63 , m_shaderBuilderManager(new ShaderBuilderManager())
64 , m_techniqueManager(new TechniqueManager())
65 , m_effectManager(new EffectManager())
66 , m_renderPassManager(new RenderPassManager())
67 , m_textureManager(new TextureManager())
68 , m_textureImageManager(new TextureImageManager())
69 , m_layerManager(new LayerManager())
70 , m_levelOfDetailManager(new LevelOfDetailManager())
71 , m_filterKeyManager(new FilterKeyManager())
72 , m_frameGraphManager(new FrameGraphManager())
73 , m_transformManager(new TransformManager())
74 , m_renderTargetManager(new RenderTargetManager())
75 , m_sceneManager(new SceneManager())
76 , m_attachmentManager(new AttachmentManager())
77 , m_parameterManager(new ParameterManager())
78 , m_shaderDataManager(new ShaderDataManager())
79 , m_bufferManager(new BufferManager())
80 , m_attributeManager(new AttributeManager())
81 , m_geometryManager(new GeometryManager())
82 , m_geometryRendererManager(new GeometryRendererManager)
83 , m_objectPickerManager(new ObjectPickerManager())
84 , m_rayCasterManager(new RayCasterManager())
85// , m_boundingVolumeDebugManager(new BoundingVolumeDebugManager())
86 , m_lightManager(new LightManager())
87 , m_environmentLightManager(new EnvironmentLightManager())
88 , m_computeJobManager(new ComputeCommandManager())
89 , m_renderStateManager(new RenderStateManager())
90 , m_armatureManager(new ArmatureManager())
91 , m_skeletonManager(new SkeletonManager())
92 , m_jointManager(new JointManager())
93 , m_shaderImageManager(new ShaderImageManager())
94{
95}
96
97NodeManagers::~NodeManagers()
98{
99 delete m_cameraManager;
100 delete m_materialManager;
101 delete m_worldMatrixManager;
102 delete m_shaderManager;
103 delete m_shaderBuilderManager;
104 delete m_techniqueManager;
105 delete m_effectManager;
106 delete m_renderPassManager;
107 delete m_textureManager;
108 delete m_layerManager;
109 delete m_levelOfDetailManager;
110 delete m_filterKeyManager;
111 delete m_transformManager;
112 delete m_renderTargetManager;
113 delete m_sceneManager;
114 delete m_attachmentManager;
115 delete m_parameterManager;
116 delete m_shaderDataManager;
117 delete m_textureImageManager;
118 delete m_bufferManager;
119 delete m_attributeManager;
120 delete m_geometryManager;
121 delete m_geometryRendererManager;
122 delete m_objectPickerManager;
123 delete m_rayCasterManager;
124
125 // Delete after m_objectPickerManager as that manager's shutdown needs to access
126 // the frame graph manager still.
127 delete m_frameGraphManager;
128// delete m_boundingVolumeDebugManager;
129 delete m_lightManager;
130 delete m_environmentLightManager;
131 delete m_computeJobManager;
132 delete m_renderStateManager;
133 delete m_renderNodesManager;
134 delete m_armatureManager;
135 delete m_skeletonManager;
136 delete m_jointManager;
137 delete m_shaderImageManager;
138}
139
140template<>
141CameraManager *NodeManagers::manager<CameraLens>() const noexcept
142{
143 return m_cameraManager;
144}
145
146template<>
147EntityManager *NodeManagers::manager<Entity>() const noexcept
148{
149 return m_renderNodesManager;
150}
151
152template<>
153MaterialManager *NodeManagers::manager<Material>() const noexcept
154{
155 return m_materialManager;
156}
157
158template<>
159MatrixManager *NodeManagers::manager<Matrix4x4>() const noexcept
160{
161 return m_worldMatrixManager;
162}
163
164template<>
165ShaderManager *NodeManagers::manager<Shader>() const noexcept
166{
167 return m_shaderManager;
168}
169
170template<>
171ShaderBuilderManager *NodeManagers::manager<ShaderBuilder>() const noexcept
172{
173 return m_shaderBuilderManager;
174}
175
176template<>
177TechniqueManager *NodeManagers::manager<Technique>() const noexcept
178{
179 return m_techniqueManager;
180}
181
182template<>
183EffectManager *NodeManagers::manager<Effect>() const noexcept
184{
185 return m_effectManager;
186}
187
188template<>
189RenderPassManager *NodeManagers::manager<RenderPass>() const noexcept
190{
191 return m_renderPassManager;
192}
193
194template<>
195TextureManager *NodeManagers::manager<Texture>() const noexcept
196{
197 return m_textureManager;
198}
199
200template<>
201LayerManager *NodeManagers::manager<Layer>() const noexcept
202{
203 return m_layerManager;
204}
205
206template<>
207LevelOfDetailManager *NodeManagers::manager<LevelOfDetail>() const noexcept
208{
209 return m_levelOfDetailManager;
210}
211
212template<>
213FilterKeyManager *NodeManagers::manager<FilterKey>() const noexcept
214{
215 return m_filterKeyManager;
216}
217
218template<>
219FrameGraphManager *NodeManagers::manager<FrameGraphNode*>() const noexcept
220{
221 return m_frameGraphManager;
222}
223
224template<>
225TransformManager *NodeManagers::manager<Transform>() const noexcept
226{
227 return m_transformManager;
228}
229
230template<>
231RenderTargetManager *NodeManagers::manager<RenderTarget>() const noexcept
232{
233 return m_renderTargetManager;
234}
235
236template<>
237SceneManager *NodeManagers::manager<Scene>() const noexcept
238{
239 return m_sceneManager;
240}
241
242template<>
243AttachmentManager *NodeManagers::manager<RenderTargetOutput>() const noexcept
244{
245 return m_attachmentManager;
246}
247
248template<>
249ParameterManager *NodeManagers::manager<Parameter>() const noexcept
250{
251 return m_parameterManager;
252}
253
254template<>
255ShaderDataManager *NodeManagers::manager<ShaderData>() const noexcept
256{
257 return m_shaderDataManager;
258}
259
260template<>
261TextureImageManager *NodeManagers::manager<TextureImage>() const noexcept
262{
263 return m_textureImageManager;
264}
265
266template<>
267BufferManager *NodeManagers::manager<Buffer>() const noexcept
268{
269 return m_bufferManager;
270}
271
272template<>
273AttributeManager *NodeManagers::manager<Attribute>() const noexcept
274{
275 return m_attributeManager;
276}
277
278template<>
279GeometryManager *NodeManagers::manager<Geometry>() const noexcept
280{
281 return m_geometryManager;
282}
283
284template<>
285GeometryRendererManager *NodeManagers::manager<GeometryRenderer>() const noexcept
286{
287 return m_geometryRendererManager;
288}
289
290template<>
291ObjectPickerManager *NodeManagers::manager<ObjectPicker>() const noexcept
292{
293 return m_objectPickerManager;
294}
295
296template<>
297RayCasterManager *NodeManagers::manager<RayCaster>() const noexcept
298{
299 return m_rayCasterManager;
300}
301
302//template<>
303//BoundingVolumeDebugManager *NodeManagers::manager<BoundingVolumeDebug>() const noexcept
304//{
305// return m_boundingVolumeDebugManager;
306//}
307
308template<>
309LightManager *NodeManagers::manager<Light>() const noexcept
310{
311 return m_lightManager;
312}
313
314template<>
315EnvironmentLightManager *NodeManagers::manager<EnvironmentLight>() const noexcept
316{
317 return m_environmentLightManager;
318}
319
320template<>
321ComputeCommandManager *NodeManagers::manager<ComputeCommand>() const noexcept
322{
323 return m_computeJobManager;
324}
325
326template<>
327RenderStateManager *NodeManagers::manager<RenderStateNode>() const noexcept
328{
329 return m_renderStateManager;
330}
331
332template<>
333ArmatureManager *NodeManagers::manager<Armature>() const noexcept
334{
335 return m_armatureManager;
336}
337
338template<>
339SkeletonManager *NodeManagers::manager<Skeleton>() const noexcept
340{
341 return m_skeletonManager;
342}
343
344template<>
345JointManager *NodeManagers::manager<Joint>() const noexcept
346{
347 return m_jointManager;
348}
349
350template<>
351ShaderImageManager *NodeManagers::manager<ShaderImage>() const noexcept
352{
353 return m_shaderImageManager;
354}
355
356} // Render
357
358} // Qt3DRender
359
360QT_END_NAMESPACE
361

source code of qt3d/src/render/backend/nodemanagers.cpp