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 | |
15 | QT_BEGIN_NAMESPACE |
16 | |
17 | namespace Qt3DRender { |
18 | |
19 | namespace Render { |
20 | |
21 | NodeManagers::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 | |
62 | NodeManagers::~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 | |
105 | template<> |
106 | CameraManager *NodeManagers::manager<CameraLens>() const noexcept |
107 | { |
108 | return m_cameraManager; |
109 | } |
110 | |
111 | template<> |
112 | EntityManager *NodeManagers::manager<Entity>() const noexcept |
113 | { |
114 | return m_renderNodesManager; |
115 | } |
116 | |
117 | template<> |
118 | MaterialManager *NodeManagers::manager<Material>() const noexcept |
119 | { |
120 | return m_materialManager; |
121 | } |
122 | |
123 | template<> |
124 | MatrixManager *NodeManagers::manager<Matrix4x4>() const noexcept |
125 | { |
126 | return m_worldMatrixManager; |
127 | } |
128 | |
129 | template<> |
130 | ShaderManager *NodeManagers::manager<Shader>() const noexcept |
131 | { |
132 | return m_shaderManager; |
133 | } |
134 | |
135 | template<> |
136 | ShaderBuilderManager *NodeManagers::manager<ShaderBuilder>() const noexcept |
137 | { |
138 | return m_shaderBuilderManager; |
139 | } |
140 | |
141 | template<> |
142 | TechniqueManager *NodeManagers::manager<Technique>() const noexcept |
143 | { |
144 | return m_techniqueManager; |
145 | } |
146 | |
147 | template<> |
148 | EffectManager *NodeManagers::manager<Effect>() const noexcept |
149 | { |
150 | return m_effectManager; |
151 | } |
152 | |
153 | template<> |
154 | RenderPassManager *NodeManagers::manager<RenderPass>() const noexcept |
155 | { |
156 | return m_renderPassManager; |
157 | } |
158 | |
159 | template<> |
160 | TextureManager *NodeManagers::manager<Texture>() const noexcept |
161 | { |
162 | return m_textureManager; |
163 | } |
164 | |
165 | template<> |
166 | LayerManager *NodeManagers::manager<Layer>() const noexcept |
167 | { |
168 | return m_layerManager; |
169 | } |
170 | |
171 | template<> |
172 | LevelOfDetailManager *NodeManagers::manager<LevelOfDetail>() const noexcept |
173 | { |
174 | return m_levelOfDetailManager; |
175 | } |
176 | |
177 | template<> |
178 | FilterKeyManager *NodeManagers::manager<FilterKey>() const noexcept |
179 | { |
180 | return m_filterKeyManager; |
181 | } |
182 | |
183 | template<> |
184 | FrameGraphManager *NodeManagers::manager<FrameGraphNode*>() const noexcept |
185 | { |
186 | return m_frameGraphManager; |
187 | } |
188 | |
189 | template<> |
190 | TransformManager *NodeManagers::manager<Transform>() const noexcept |
191 | { |
192 | return m_transformManager; |
193 | } |
194 | |
195 | template<> |
196 | RenderTargetManager *NodeManagers::manager<RenderTarget>() const noexcept |
197 | { |
198 | return m_renderTargetManager; |
199 | } |
200 | |
201 | template<> |
202 | SceneManager *NodeManagers::manager<Scene>() const noexcept |
203 | { |
204 | return m_sceneManager; |
205 | } |
206 | |
207 | template<> |
208 | AttachmentManager *NodeManagers::manager<RenderTargetOutput>() const noexcept |
209 | { |
210 | return m_attachmentManager; |
211 | } |
212 | |
213 | template<> |
214 | ParameterManager *NodeManagers::manager<Parameter>() const noexcept |
215 | { |
216 | return m_parameterManager; |
217 | } |
218 | |
219 | template<> |
220 | ShaderDataManager *NodeManagers::manager<ShaderData>() const noexcept |
221 | { |
222 | return m_shaderDataManager; |
223 | } |
224 | |
225 | template<> |
226 | TextureImageManager *NodeManagers::manager<TextureImage>() const noexcept |
227 | { |
228 | return m_textureImageManager; |
229 | } |
230 | |
231 | template<> |
232 | BufferManager *NodeManagers::manager<Buffer>() const noexcept |
233 | { |
234 | return m_bufferManager; |
235 | } |
236 | |
237 | template<> |
238 | AttributeManager *NodeManagers::manager<Attribute>() const noexcept |
239 | { |
240 | return m_attributeManager; |
241 | } |
242 | |
243 | template<> |
244 | GeometryManager *NodeManagers::manager<Geometry>() const noexcept |
245 | { |
246 | return m_geometryManager; |
247 | } |
248 | |
249 | template<> |
250 | GeometryRendererManager *NodeManagers::manager<GeometryRenderer>() const noexcept |
251 | { |
252 | return m_geometryRendererManager; |
253 | } |
254 | |
255 | template<> |
256 | ObjectPickerManager *NodeManagers::manager<ObjectPicker>() const noexcept |
257 | { |
258 | return m_objectPickerManager; |
259 | } |
260 | |
261 | template<> |
262 | PickingProxyManager *NodeManagers::manager<PickingProxy>() const noexcept |
263 | { |
264 | return m_pickingProxyManager; |
265 | } |
266 | |
267 | template<> |
268 | RayCasterManager *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 | |
279 | template<> |
280 | LightManager *NodeManagers::manager<Light>() const noexcept |
281 | { |
282 | return m_lightManager; |
283 | } |
284 | |
285 | template<> |
286 | EnvironmentLightManager *NodeManagers::manager<EnvironmentLight>() const noexcept |
287 | { |
288 | return m_environmentLightManager; |
289 | } |
290 | |
291 | template<> |
292 | ComputeCommandManager *NodeManagers::manager<ComputeCommand>() const noexcept |
293 | { |
294 | return m_computeJobManager; |
295 | } |
296 | |
297 | template<> |
298 | RenderStateManager *NodeManagers::manager<RenderStateNode>() const noexcept |
299 | { |
300 | return m_renderStateManager; |
301 | } |
302 | |
303 | template<> |
304 | ArmatureManager *NodeManagers::manager<Armature>() const noexcept |
305 | { |
306 | return m_armatureManager; |
307 | } |
308 | |
309 | template<> |
310 | SkeletonManager *NodeManagers::manager<Skeleton>() const noexcept |
311 | { |
312 | return m_skeletonManager; |
313 | } |
314 | |
315 | template<> |
316 | JointManager *NodeManagers::manager<Joint>() const noexcept |
317 | { |
318 | return m_jointManager; |
319 | } |
320 | |
321 | template<> |
322 | ShaderImageManager *NodeManagers::manager<ShaderImage>() const noexcept |
323 | { |
324 | return m_shaderImageManager; |
325 | } |
326 | |
327 | } // Render |
328 | |
329 | } // Qt3DRender |
330 | |
331 | QT_END_NAMESPACE |
332 | |