1// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "nodemanagers_p.h"
5
6#include <Qt3DRender/private/managers_p.h>
7#include <Qt3DRender/private/scenemanager_p.h>
8#include <Qt3DRender/private/buffermanager_p.h>
9#include <Qt3DRender/private/geometryrenderermanager_p.h>
10#include <Qt3DRender/private/techniquemanager_p.h>
11#include <Qt3DRender/private/armature_p.h>
12#include <Qt3DRender/private/skeleton_p.h>
13
14
15QT_BEGIN_NAMESPACE
16
17namespace Qt3DRender {
18
19namespace Render {
20
21NodeManagers::NodeManagers()
22 : m_cameraManager(new CameraManager())
23 , m_renderNodesManager(new EntityManager())
24 , m_materialManager(new MaterialManager())
25 , m_worldMatrixManager(new MatrixManager())
26 , m_shaderManager(new ShaderManager())
27 , m_shaderBuilderManager(new ShaderBuilderManager())
28 , m_techniqueManager(new TechniqueManager())
29 , m_effectManager(new EffectManager())
30 , m_renderPassManager(new RenderPassManager())
31 , m_textureManager(new TextureManager())
32 , m_textureImageManager(new TextureImageManager())
33 , m_layerManager(new LayerManager())
34 , m_levelOfDetailManager(new LevelOfDetailManager())
35 , m_filterKeyManager(new FilterKeyManager())
36 , m_frameGraphManager(new FrameGraphManager())
37 , m_transformManager(new TransformManager())
38 , m_renderTargetManager(new RenderTargetManager())
39 , m_sceneManager(new SceneManager())
40 , m_attachmentManager(new AttachmentManager())
41 , m_parameterManager(new ParameterManager())
42 , m_shaderDataManager(new ShaderDataManager())
43 , m_bufferManager(new BufferManager())
44 , m_attributeManager(new AttributeManager())
45 , m_geometryManager(new GeometryManager())
46 , m_geometryRendererManager(new GeometryRendererManager)
47 , m_objectPickerManager(new ObjectPickerManager())
48 , m_rayCasterManager(new RayCasterManager())
49// , m_boundingVolumeDebugManager(new BoundingVolumeDebugManager())
50 , m_lightManager(new LightManager())
51 , m_environmentLightManager(new EnvironmentLightManager())
52 , m_computeJobManager(new ComputeCommandManager())
53 , m_renderStateManager(new RenderStateManager())
54 , m_armatureManager(new ArmatureManager())
55 , m_skeletonManager(new SkeletonManager())
56 , m_jointManager(new JointManager())
57 , m_shaderImageManager(new ShaderImageManager())
58 , m_pickingProxyManager(new PickingProxyManager())
59{
60}
61
62NodeManagers::~NodeManagers()
63{
64 delete m_cameraManager;
65 delete m_materialManager;
66 delete m_worldMatrixManager;
67 delete m_shaderManager;
68 delete m_shaderBuilderManager;
69 delete m_techniqueManager;
70 delete m_effectManager;
71 delete m_renderPassManager;
72 delete m_textureManager;
73 delete m_layerManager;
74 delete m_levelOfDetailManager;
75 delete m_filterKeyManager;
76 delete m_transformManager;
77 delete m_renderTargetManager;
78 delete m_sceneManager;
79 delete m_attachmentManager;
80 delete m_parameterManager;
81 delete m_shaderDataManager;
82 delete m_textureImageManager;
83 delete m_bufferManager;
84 delete m_attributeManager;
85 delete m_geometryManager;
86 delete m_geometryRendererManager;
87 delete m_objectPickerManager;
88 delete m_rayCasterManager;
89
90 // Delete after m_objectPickerManager as that manager's shutdown needs to access
91 // the frame graph manager still.
92 delete m_frameGraphManager;
93// delete m_boundingVolumeDebugManager;
94 delete m_lightManager;
95 delete m_environmentLightManager;
96 delete m_computeJobManager;
97 delete m_renderStateManager;
98 delete m_renderNodesManager;
99 delete m_armatureManager;
100 delete m_skeletonManager;
101 delete m_jointManager;
102 delete m_shaderImageManager;
103}
104
105template<>
106CameraManager *NodeManagers::manager<CameraLens>() const noexcept
107{
108 return m_cameraManager;
109}
110
111template<>
112EntityManager *NodeManagers::manager<Entity>() const noexcept
113{
114 return m_renderNodesManager;
115}
116
117template<>
118MaterialManager *NodeManagers::manager<Material>() const noexcept
119{
120 return m_materialManager;
121}
122
123template<>
124MatrixManager *NodeManagers::manager<Matrix4x4>() const noexcept
125{
126 return m_worldMatrixManager;
127}
128
129template<>
130ShaderManager *NodeManagers::manager<Shader>() const noexcept
131{
132 return m_shaderManager;
133}
134
135template<>
136ShaderBuilderManager *NodeManagers::manager<ShaderBuilder>() const noexcept
137{
138 return m_shaderBuilderManager;
139}
140
141template<>
142TechniqueManager *NodeManagers::manager<Technique>() const noexcept
143{
144 return m_techniqueManager;
145}
146
147template<>
148EffectManager *NodeManagers::manager<Effect>() const noexcept
149{
150 return m_effectManager;
151}
152
153template<>
154RenderPassManager *NodeManagers::manager<RenderPass>() const noexcept
155{
156 return m_renderPassManager;
157}
158
159template<>
160TextureManager *NodeManagers::manager<Texture>() const noexcept
161{
162 return m_textureManager;
163}
164
165template<>
166LayerManager *NodeManagers::manager<Layer>() const noexcept
167{
168 return m_layerManager;
169}
170
171template<>
172LevelOfDetailManager *NodeManagers::manager<LevelOfDetail>() const noexcept
173{
174 return m_levelOfDetailManager;
175}
176
177template<>
178FilterKeyManager *NodeManagers::manager<FilterKey>() const noexcept
179{
180 return m_filterKeyManager;
181}
182
183template<>
184FrameGraphManager *NodeManagers::manager<FrameGraphNode*>() const noexcept
185{
186 return m_frameGraphManager;
187}
188
189template<>
190TransformManager *NodeManagers::manager<Transform>() const noexcept
191{
192 return m_transformManager;
193}
194
195template<>
196RenderTargetManager *NodeManagers::manager<RenderTarget>() const noexcept
197{
198 return m_renderTargetManager;
199}
200
201template<>
202SceneManager *NodeManagers::manager<Scene>() const noexcept
203{
204 return m_sceneManager;
205}
206
207template<>
208AttachmentManager *NodeManagers::manager<RenderTargetOutput>() const noexcept
209{
210 return m_attachmentManager;
211}
212
213template<>
214ParameterManager *NodeManagers::manager<Parameter>() const noexcept
215{
216 return m_parameterManager;
217}
218
219template<>
220ShaderDataManager *NodeManagers::manager<ShaderData>() const noexcept
221{
222 return m_shaderDataManager;
223}
224
225template<>
226TextureImageManager *NodeManagers::manager<TextureImage>() const noexcept
227{
228 return m_textureImageManager;
229}
230
231template<>
232BufferManager *NodeManagers::manager<Buffer>() const noexcept
233{
234 return m_bufferManager;
235}
236
237template<>
238AttributeManager *NodeManagers::manager<Attribute>() const noexcept
239{
240 return m_attributeManager;
241}
242
243template<>
244GeometryManager *NodeManagers::manager<Geometry>() const noexcept
245{
246 return m_geometryManager;
247}
248
249template<>
250GeometryRendererManager *NodeManagers::manager<GeometryRenderer>() const noexcept
251{
252 return m_geometryRendererManager;
253}
254
255template<>
256ObjectPickerManager *NodeManagers::manager<ObjectPicker>() const noexcept
257{
258 return m_objectPickerManager;
259}
260
261template<>
262PickingProxyManager *NodeManagers::manager<PickingProxy>() const noexcept
263{
264 return m_pickingProxyManager;
265}
266
267template<>
268RayCasterManager *NodeManagers::manager<RayCaster>() const noexcept
269{
270 return m_rayCasterManager;
271}
272
273//template<>
274//BoundingVolumeDebugManager *NodeManagers::manager<BoundingVolumeDebug>() const noexcept
275//{
276// return m_boundingVolumeDebugManager;
277//}
278
279template<>
280LightManager *NodeManagers::manager<Light>() const noexcept
281{
282 return m_lightManager;
283}
284
285template<>
286EnvironmentLightManager *NodeManagers::manager<EnvironmentLight>() const noexcept
287{
288 return m_environmentLightManager;
289}
290
291template<>
292ComputeCommandManager *NodeManagers::manager<ComputeCommand>() const noexcept
293{
294 return m_computeJobManager;
295}
296
297template<>
298RenderStateManager *NodeManagers::manager<RenderStateNode>() const noexcept
299{
300 return m_renderStateManager;
301}
302
303template<>
304ArmatureManager *NodeManagers::manager<Armature>() const noexcept
305{
306 return m_armatureManager;
307}
308
309template<>
310SkeletonManager *NodeManagers::manager<Skeleton>() const noexcept
311{
312 return m_skeletonManager;
313}
314
315template<>
316JointManager *NodeManagers::manager<Joint>() const noexcept
317{
318 return m_jointManager;
319}
320
321template<>
322ShaderImageManager *NodeManagers::manager<ShaderImage>() const noexcept
323{
324 return m_shaderImageManager;
325}
326
327} // Render
328
329} // Qt3DRender
330
331QT_END_NAMESPACE
332

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