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 | |
51 | QT_BEGIN_NAMESPACE |
52 | |
53 | namespace Qt3DRender { |
54 | |
55 | namespace Render { |
56 | |
57 | NodeManagers::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 | |
97 | NodeManagers::~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 | |
140 | template<> |
141 | CameraManager *NodeManagers::manager<CameraLens>() const noexcept |
142 | { |
143 | return m_cameraManager; |
144 | } |
145 | |
146 | template<> |
147 | EntityManager *NodeManagers::manager<Entity>() const noexcept |
148 | { |
149 | return m_renderNodesManager; |
150 | } |
151 | |
152 | template<> |
153 | MaterialManager *NodeManagers::manager<Material>() const noexcept |
154 | { |
155 | return m_materialManager; |
156 | } |
157 | |
158 | template<> |
159 | MatrixManager *NodeManagers::manager<Matrix4x4>() const noexcept |
160 | { |
161 | return m_worldMatrixManager; |
162 | } |
163 | |
164 | template<> |
165 | ShaderManager *NodeManagers::manager<Shader>() const noexcept |
166 | { |
167 | return m_shaderManager; |
168 | } |
169 | |
170 | template<> |
171 | ShaderBuilderManager *NodeManagers::manager<ShaderBuilder>() const noexcept |
172 | { |
173 | return m_shaderBuilderManager; |
174 | } |
175 | |
176 | template<> |
177 | TechniqueManager *NodeManagers::manager<Technique>() const noexcept |
178 | { |
179 | return m_techniqueManager; |
180 | } |
181 | |
182 | template<> |
183 | EffectManager *NodeManagers::manager<Effect>() const noexcept |
184 | { |
185 | return m_effectManager; |
186 | } |
187 | |
188 | template<> |
189 | RenderPassManager *NodeManagers::manager<RenderPass>() const noexcept |
190 | { |
191 | return m_renderPassManager; |
192 | } |
193 | |
194 | template<> |
195 | TextureManager *NodeManagers::manager<Texture>() const noexcept |
196 | { |
197 | return m_textureManager; |
198 | } |
199 | |
200 | template<> |
201 | LayerManager *NodeManagers::manager<Layer>() const noexcept |
202 | { |
203 | return m_layerManager; |
204 | } |
205 | |
206 | template<> |
207 | LevelOfDetailManager *NodeManagers::manager<LevelOfDetail>() const noexcept |
208 | { |
209 | return m_levelOfDetailManager; |
210 | } |
211 | |
212 | template<> |
213 | FilterKeyManager *NodeManagers::manager<FilterKey>() const noexcept |
214 | { |
215 | return m_filterKeyManager; |
216 | } |
217 | |
218 | template<> |
219 | FrameGraphManager *NodeManagers::manager<FrameGraphNode*>() const noexcept |
220 | { |
221 | return m_frameGraphManager; |
222 | } |
223 | |
224 | template<> |
225 | TransformManager *NodeManagers::manager<Transform>() const noexcept |
226 | { |
227 | return m_transformManager; |
228 | } |
229 | |
230 | template<> |
231 | RenderTargetManager *NodeManagers::manager<RenderTarget>() const noexcept |
232 | { |
233 | return m_renderTargetManager; |
234 | } |
235 | |
236 | template<> |
237 | SceneManager *NodeManagers::manager<Scene>() const noexcept |
238 | { |
239 | return m_sceneManager; |
240 | } |
241 | |
242 | template<> |
243 | AttachmentManager *NodeManagers::manager<RenderTargetOutput>() const noexcept |
244 | { |
245 | return m_attachmentManager; |
246 | } |
247 | |
248 | template<> |
249 | ParameterManager *NodeManagers::manager<Parameter>() const noexcept |
250 | { |
251 | return m_parameterManager; |
252 | } |
253 | |
254 | template<> |
255 | ShaderDataManager *NodeManagers::manager<ShaderData>() const noexcept |
256 | { |
257 | return m_shaderDataManager; |
258 | } |
259 | |
260 | template<> |
261 | TextureImageManager *NodeManagers::manager<TextureImage>() const noexcept |
262 | { |
263 | return m_textureImageManager; |
264 | } |
265 | |
266 | template<> |
267 | BufferManager *NodeManagers::manager<Buffer>() const noexcept |
268 | { |
269 | return m_bufferManager; |
270 | } |
271 | |
272 | template<> |
273 | AttributeManager *NodeManagers::manager<Attribute>() const noexcept |
274 | { |
275 | return m_attributeManager; |
276 | } |
277 | |
278 | template<> |
279 | GeometryManager *NodeManagers::manager<Geometry>() const noexcept |
280 | { |
281 | return m_geometryManager; |
282 | } |
283 | |
284 | template<> |
285 | GeometryRendererManager *NodeManagers::manager<GeometryRenderer>() const noexcept |
286 | { |
287 | return m_geometryRendererManager; |
288 | } |
289 | |
290 | template<> |
291 | ObjectPickerManager *NodeManagers::manager<ObjectPicker>() const noexcept |
292 | { |
293 | return m_objectPickerManager; |
294 | } |
295 | |
296 | template<> |
297 | RayCasterManager *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 | |
308 | template<> |
309 | LightManager *NodeManagers::manager<Light>() const noexcept |
310 | { |
311 | return m_lightManager; |
312 | } |
313 | |
314 | template<> |
315 | EnvironmentLightManager *NodeManagers::manager<EnvironmentLight>() const noexcept |
316 | { |
317 | return m_environmentLightManager; |
318 | } |
319 | |
320 | template<> |
321 | ComputeCommandManager *NodeManagers::manager<ComputeCommand>() const noexcept |
322 | { |
323 | return m_computeJobManager; |
324 | } |
325 | |
326 | template<> |
327 | RenderStateManager *NodeManagers::manager<RenderStateNode>() const noexcept |
328 | { |
329 | return m_renderStateManager; |
330 | } |
331 | |
332 | template<> |
333 | ArmatureManager *NodeManagers::manager<Armature>() const noexcept |
334 | { |
335 | return m_armatureManager; |
336 | } |
337 | |
338 | template<> |
339 | SkeletonManager *NodeManagers::manager<Skeleton>() const noexcept |
340 | { |
341 | return m_skeletonManager; |
342 | } |
343 | |
344 | template<> |
345 | JointManager *NodeManagers::manager<Joint>() const noexcept |
346 | { |
347 | return m_jointManager; |
348 | } |
349 | |
350 | template<> |
351 | ShaderImageManager *NodeManagers::manager<ShaderImage>() const noexcept |
352 | { |
353 | return m_shaderImageManager; |
354 | } |
355 | |
356 | } // Render |
357 | |
358 | } // Qt3DRender |
359 | |
360 | QT_END_NAMESPACE |
361 | |