1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
2 | // Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). |
3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
4 | |
5 | #ifndef QT3DRENDER_RENDER_CALCBOUNDINGVOLUMEJOB_H |
6 | #define QT3DRENDER_RENDER_CALCBOUNDINGVOLUMEJOB_H |
7 | |
8 | // |
9 | // W A R N I N G |
10 | // ------------- |
11 | // |
12 | // This file is not part of the Qt API. It exists purely as an |
13 | // implementation detail. This header file may change from version to |
14 | // version without notice, or even be removed. |
15 | // |
16 | // We mean it. |
17 | // |
18 | |
19 | #include <Qt3DCore/qaspectjob.h> |
20 | #include <Qt3DRender/private/qt3drender_global_p.h> |
21 | #include <Qt3DCore/private/calcboundingvolumejob_p.h> |
22 | #include <QSharedPointer> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | namespace Qt3DCore { |
27 | class QAbstractFrontEndNodeManager; |
28 | } |
29 | |
30 | namespace Qt3DRender { |
31 | namespace Render { |
32 | |
33 | class NodeManagers; |
34 | class Entity; |
35 | class Geometry; |
36 | |
37 | class Q_3DRENDERSHARED_PRIVATE_EXPORT CalculateBoundingVolumeJob : public Qt3DCore::QAspectJob, public Qt3DCore::BoundingVolumeJobProcessor |
38 | { |
39 | public: |
40 | explicit CalculateBoundingVolumeJob(); |
41 | |
42 | void setRoot(Entity *node); |
43 | void setManagers(NodeManagers *manager); |
44 | void setFrontEndNodeManager(Qt3DCore::QAbstractFrontEndNodeManager *manager); |
45 | void run() override; |
46 | |
47 | void postFrame(Qt3DCore::QAspectEngine *aspectEngine) override; |
48 | |
49 | private: |
50 | void process(const Qt3DCore::BoundingVolumeComputeResult &result, bool computedResult) override; |
51 | |
52 | NodeManagers *m_manager; |
53 | Entity *m_node; |
54 | Qt3DCore::QAbstractFrontEndNodeManager *m_frontEndNodeManager; |
55 | std::vector<Geometry *> m_updatedGeometries; |
56 | }; |
57 | |
58 | typedef QSharedPointer<CalculateBoundingVolumeJob> CalculateBoundingVolumeJobPtr; |
59 | |
60 | } // namespace Render |
61 | } // namespace Qt3DRender |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QT3DRENDER_RENDER_CALCBOUNDINGVOLUMEJOB_H |
66 | |