diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-12-02 12:01:32 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-12-04 09:19:35 +0000 |
commit | 7ab3c098417c91c5bbdfaee2133c642978828ef3 (patch) | |
tree | fc61aa24875ed6cd74a7a437c20852539015764b /src/render/frontend/qcameralens_p.h | |
parent | 00e0783992a4326fcca93e118edb9a3ed09fd5a4 (diff) | |
download | qt3d-7ab3c098417c91c5bbdfaee2133c642978828ef3.tar.gz |
Refactor ViewAll to not use commands
Change-Id: I6527c96bfdb484a0dc95565cb2533a4d47b819e7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/frontend/qcameralens_p.h')
-rw-r--r-- | src/render/frontend/qcameralens_p.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/render/frontend/qcameralens_p.h b/src/render/frontend/qcameralens_p.h index 5c5a6a42a..eca01b890 100644 --- a/src/render/frontend/qcameralens_p.h +++ b/src/render/frontend/qcameralens_p.h @@ -53,7 +53,6 @@ #include <Qt3DRender/private/qt3drender_global_p.h> #include <Qt3DCore/private/qcomponent_p.h> -#include <Qt3DCore/private/qnodecommand_p.h> #include "qcameralens.h" @@ -63,21 +62,21 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -struct CameraLensCommand +struct CameraLensRequest { - QString name; - QVariant data; - Qt3DCore::QNodeCommand::CommandId commandId; + Qt3DCore::QNodeId requestId; + Qt3DCore::QNodeId cameraId; + Qt3DCore::QNodeId entityId; - inline operator bool() const { return !name.isEmpty(); } + inline operator bool() const { return !requestId.isNull(); } }; -inline bool operator ==(const CameraLensCommand &a, const CameraLensCommand &b) noexcept +inline bool operator ==(const CameraLensRequest &a, const CameraLensRequest &b) noexcept { - return a.name == b.name && a.data == b.data && a.commandId == b.commandId; + return a.cameraId == b.cameraId && a.entityId == b.entityId && a.requestId == b.requestId; } -inline bool operator !=(const CameraLensCommand &a, const CameraLensCommand &b) noexcept +inline bool operator !=(const CameraLensRequest &a, const CameraLensRequest &b) noexcept { return !(a == b); } @@ -123,8 +122,8 @@ public: float m_exposure; - CameraLensCommand m_pendingViewAllCommand; - void processViewAllCommand(Qt3DCore::QNodeCommand::CommandId commandId, const QVariant &data); + CameraLensRequest m_pendingViewAllRequest; + void processViewAllResult(Qt3DCore::QNodeId requestId, const QVector3D ¢er, float radius); private: inline void updatePerpectiveProjection() |