diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2014-06-08 11:52:59 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-08 14:59:51 +0200 |
commit | 6d608c1050f225408532c105e3da5757f76ac066 (patch) | |
tree | 66d77cca0f1f72f882cfd58c2e62597c2b38c48b | |
parent | 5996d9e9bdf670b82545993a78b7485d19c03a90 (diff) | |
download | qt3d-6d608c1050f225408532c105e3da5757f76ac066.tar.gz |
Separate QObserverInterface, QObservableInterface and QObserver
This just refactors the above classes into their own files and adusts
the #includes throughout the project.
Change-Id: Ie53b8d19f2c9f7119940d27137c4bb90cd7df805
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
54 files changed, 662 insertions, 180 deletions
diff --git a/src/core/core-components/qabstracteffect.cpp b/src/core/core-components/qabstracteffect.cpp index 664d3b24c..8c4a0991a 100644 --- a/src/core/core-components/qabstracteffect.cpp +++ b/src/core/core-components/qabstracteffect.cpp @@ -41,6 +41,7 @@ #include "qabstracteffect.h" #include "qabstracttechnique.h" +#include <Qt3DCore/qscenepropertychange.h> /*! * \class QAbstractEffect diff --git a/src/core/core-components/qabstracteffect.h b/src/core/core-components/qabstracteffect.h index 01bd114ea..57e370a01 100644 --- a/src/core/core-components/qabstracteffect.h +++ b/src/core/core-components/qabstracteffect.h @@ -43,7 +43,6 @@ #define QT3D_QABSTRACTEFFECT_H #include <Qt3DCore/node.h> -#include <Qt3DCore/qchangearbiter.h> QT_BEGIN_NAMESPACE diff --git a/src/core/core-components/qabstractrenderpass.cpp b/src/core/core-components/qabstractrenderpass.cpp index 73c8eb181..e2cb937ac 100644 --- a/src/core/core-components/qabstractrenderpass.cpp +++ b/src/core/core-components/qabstractrenderpass.cpp @@ -41,6 +41,7 @@ #include "qabstractrenderpass.h" #include "qabstractshader.h" +#include <Qt3DCore/qscenepropertychange.h> QT_BEGIN_NAMESPACE diff --git a/src/core/core-components/qabstractrenderpass.h b/src/core/core-components/qabstractrenderpass.h index 17ebc596c..4bfe4f0f2 100644 --- a/src/core/core-components/qabstractrenderpass.h +++ b/src/core/core-components/qabstractrenderpass.h @@ -43,7 +43,6 @@ #define QT3D_QABSTRACTRENDERPASS_H #include <Qt3DCore/node.h> -#include <Qt3DCore/qchangearbiter.h> QT_BEGIN_NAMESPACE diff --git a/src/core/core-components/qabstracttechnique.cpp b/src/core/core-components/qabstracttechnique.cpp index 73f6601a7..226e7ea28 100644 --- a/src/core/core-components/qabstracttechnique.cpp +++ b/src/core/core-components/qabstracttechnique.cpp @@ -42,6 +42,8 @@ #include "qabstracttechnique.h" #include "qabstractrenderpass.h" +#include <Qt3DCore/qscenepropertychange.h> + /*! * \class QAbstractTechnique * \namespace Qt3D diff --git a/src/core/core-components/qabstracttechnique.h b/src/core/core-components/qabstracttechnique.h index 1035429e8..13be3b5ec 100644 --- a/src/core/core-components/qabstracttechnique.h +++ b/src/core/core-components/qabstracttechnique.h @@ -43,7 +43,6 @@ #define QT3D_QABSTRACTTECHNIQUE_H #include <Qt3DCore/node.h> -#include <Qt3DCore/qchangearbiter.h> QT_BEGIN_NAMESPACE diff --git a/src/core/core.pri b/src/core/core.pri index 50d2e2ebb..030ae99e4 100644 --- a/src/core/core.pri +++ b/src/core/core.pri @@ -22,7 +22,12 @@ HEADERS += \ $$PWD/qscheduler.h \ $$PWD/cameracontroller.h \ $$PWD/qchangearbiter.h \ - $$PWD/corelogging.h + $$PWD/corelogging.h \ + $$PWD/qscenechange.h \ + $$PWD/qscenepropertychange.h \ + $$PWD/qobservableinterface.h \ + $$PWD/qobservable.h \ + $$PWD/qobserverinterface.h SOURCES += \ $$PWD/window.cpp \ @@ -30,4 +35,7 @@ SOURCES += \ $$PWD/qscheduler.cpp \ $$PWD/cameracontroller.cpp \ $$PWD/qchangearbiter.cpp \ - $$PWD/corelogging.cpp + $$PWD/corelogging.cpp \ + $$PWD/qobservableinterface.cpp \ + $$PWD/qobservable.cpp \ + $$PWD/qobserverinterface.cpp diff --git a/src/core/nodes/entity.cpp b/src/core/nodes/entity.cpp index 126fa8da7..b302bbe1a 100644 --- a/src/core/nodes/entity.cpp +++ b/src/core/nodes/entity.cpp @@ -44,6 +44,7 @@ #include "abstracttransform.h" #include "matrixtransform.h" +#include <Qt3DCore/qscenepropertychange.h> #include <QMetaObject> #include <QMetaProperty> #include "corelogging.h" diff --git a/src/core/nodes/entity.h b/src/core/nodes/entity.h index ded0370a9..7a9ef8a10 100644 --- a/src/core/nodes/entity.h +++ b/src/core/nodes/entity.h @@ -44,7 +44,6 @@ #include <Qt3DCore/node.h> #include <Qt3DCore/qt3dcore_global.h> -#include <Qt3DCore/qchangearbiter.h> #include <QMatrix4x4> #include <QUuid> diff --git a/src/core/nodes/node.cpp b/src/core/nodes/node.cpp index 235f8d4f1..210a6a0de 100644 --- a/src/core/nodes/node.cpp +++ b/src/core/nodes/node.cpp @@ -43,6 +43,8 @@ #include "entity.h" +#include <Qt3DCore/qscenepropertychange.h> + #include <QEvent> #include <QMetaObject> #include <QMetaProperty> diff --git a/src/core/nodes/node.h b/src/core/nodes/node.h index b1daaa23f..a013aa6c2 100644 --- a/src/core/nodes/node.h +++ b/src/core/nodes/node.h @@ -44,7 +44,7 @@ #include <QObject> #include <Qt3DCore/qt3dcore_global.h> -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobservable.h> QT_BEGIN_NAMESPACE diff --git a/src/core/qchangearbiter.cpp b/src/core/qchangearbiter.cpp index 3dc89c18a..984d4ae21 100644 --- a/src/core/qchangearbiter.cpp +++ b/src/core/qchangearbiter.cpp @@ -53,34 +53,6 @@ QT_BEGIN_NAMESPACE namespace Qt3D { -QObservable::QObservable() - : m_observers() - , m_lock(QReadWriteLock::NonRecursive) -{ -} - -void QObservable::registerObserver(QObserverInterface *observer) -{ - QWriteLocker locker(&m_lock); - if (!m_observers.contains(observer)) - m_observers.append(observer); -} - -void QObservable::unregisterObserver(QObserverInterface *observer) -{ - QWriteLocker locker(&m_lock); - m_observers.removeOne(observer); -} - -// This calls sceneChangeEvent on the QChangeArbiter -void QObservable::notifyObservers(const QSceneChangePtr &e) -{ - QReadLocker locker(&m_lock); - Q_FOREACH (QObserverInterface *observer, m_observers) - observer->sceneChangeEvent(e); -} - - QChangeArbiter::QChangeArbiter(QObject *parent) : QObject(parent) , m_mutex(QMutex::Recursive) diff --git a/src/core/qchangearbiter.h b/src/core/qchangearbiter.h index 90ff31301..7d05a13b2 100644 --- a/src/core/qchangearbiter.h +++ b/src/core/qchangearbiter.h @@ -44,12 +44,13 @@ #include <Qt3DCore/qt3dcore_global.h> #include <QObject> -#include <QDateTime> +#include <Qt3DCore/qobserverinterface.h> +#include <Qt3DCore/qscenechange.h> + #include <QDebug> #include <QFlags> #include <QMutex> #include <QReadWriteLock> -#include <QSharedPointer> #include <QThreadStorage> #include <QVariant> #include <QVector> @@ -60,135 +61,7 @@ QT_BEGIN_NAMESPACE namespace Qt3D { class Component; - -enum ChangeFlag { - NodeCreated = 0x00000001, - NodeAboutToBeDeleted = 0x00000002, - NodeDeleted = 0x00000004, - NodeStatus = 0x00000008, - ComponentAdded = 0x00000010, - ComponentRemoved = 0x00000020, - ComponentUpdated = 0x00000040, - AllChanges = 0x00000FFF -}; -Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag) -Q_DECLARE_OPERATORS_FOR_FLAGS(ChangeFlags) - - -class QObserverInterface; class QObservableInterface; - -class QT3DCORESHARED_EXPORT QSceneChange -{ -public: - enum Priority { - High, - Standard, - Low - }; - - QSceneChange(ChangeFlag type, QObservableInterface *observable, Priority priority = Standard) - : m_type(type), - m_priority(priority), - m_timestamp(QDateTime::currentMSecsSinceEpoch()) - { - m_subject.m_observable = observable; - m_subjectType = ObservableType; - } - - QSceneChange(ChangeFlag type, Component *component, Priority priority = Standard) - : m_type(type), - m_priority(priority), - m_timestamp(QDateTime::currentMSecsSinceEpoch()) - { - m_subject.m_component = component; - m_subjectType = ComponentType; - } - - union { - QObservableInterface *m_observable; - Component *m_component; - } m_subject; - - enum ObservableType { - ObservableType, - ComponentType - } m_subjectType; - - ChangeFlag m_type; - Priority m_priority; - qint64 m_timestamp; - - // TODO: add timestamp from central clock and priority level - // These can be used to resolve any conflicts between events - // posted from different aspects -}; - -typedef QSharedPointer<QSceneChange> QSceneChangePtr; - -class QT3DCORESHARED_EXPORT QScenePropertyChange : public QSceneChange -{ -public: - QScenePropertyChange(ChangeFlag type, QObservableInterface *subject, Priority priority = Standard) - : QSceneChange(type, subject, priority) - { - } - - QScenePropertyChange(ChangeFlag type, Component *component, Priority priority = Standard) - : QSceneChange(type, component, priority) - { - } - - QByteArray m_propertyName; - QVariant m_value; -}; - -typedef QSharedPointer<QScenePropertyChange> QScenePropertyChangePtr; - - -class QT3DCORESHARED_EXPORT QObservableInterface -{ -public: - virtual ~QObservableInterface() {} - - virtual void registerObserver(QObserverInterface *observer) = 0; - virtual void unregisterObserver(QObserverInterface *observer) = 0; - -protected: - virtual void notifyObservers(const QSceneChangePtr &e) = 0; -}; - - -class QT3DCORESHARED_EXPORT QObservable : public QObservableInterface -{ -public: - QObservable(); - - // In most cases, only the QChangeArbiter should be able to call these - // Might be worth making them private and having a friend class - void registerObserver(QObserverInterface *observer) Q_DECL_OVERRIDE; - void unregisterObserver(QObserverInterface *observer) Q_DECL_OVERRIDE; - -protected: - void notifyObservers(const QSceneChangePtr &e) Q_DECL_OVERRIDE; - - const QList<QObserverInterface *> &observers() const { return m_observers; } - -private: - QList<QObserverInterface *> m_observers; - QReadWriteLock m_lock; -}; - - -class QObserverInterface -{ -public: - virtual ~QObserverInterface() {} - - virtual void sceneChangeEvent(const QSceneChangePtr &e) = 0; -}; - - class QJobManagerInterface; class QT3DCORESHARED_EXPORT QChangeArbiter : public QObject, diff --git a/src/core/qobservable.cpp b/src/core/qobservable.cpp new file mode 100644 index 000000000..f4bf85011 --- /dev/null +++ b/src/core/qobservable.cpp @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qobservable.h" +#include <Qt3DCore/qobserverinterface.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +QObservable::QObservable() + : m_observers() + , m_lock(QReadWriteLock::NonRecursive) +{ +} + +void QObservable::registerObserver(QObserverInterface *observer) +{ + QWriteLocker locker(&m_lock); + if (!m_observers.contains(observer)) + m_observers.append(observer); +} + +void QObservable::unregisterObserver(QObserverInterface *observer) +{ + QWriteLocker locker(&m_lock); + m_observers.removeOne(observer); +} + +// This calls sceneChangeEvent on the QChangeArbiter +void QObservable::notifyObservers(const QSceneChangePtr &e) +{ + QReadLocker locker(&m_lock); + Q_FOREACH (QObserverInterface *observer, m_observers) + observer->sceneChangeEvent(e); +} + +} // namespace Qt3D + +QT_END_NAMESPACE diff --git a/src/core/qobservable.h b/src/core/qobservable.h new file mode 100644 index 000000000..ba552a8f3 --- /dev/null +++ b/src/core/qobservable.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QOBSERVABLE_H +#define QT3D_QOBSERVABLE_H + +#include <Qt3DCore/qobservableinterface.h> +#include <QReadWriteLock> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class QT3DCORESHARED_EXPORT QObservable : public QObservableInterface +{ +public: + QObservable(); + + // In most cases, only the QChangeArbiter should be able to call these + // Might be worth making them private and having a friend class + void registerObserver(QObserverInterface *observer) Q_DECL_OVERRIDE; + void unregisterObserver(QObserverInterface *observer) Q_DECL_OVERRIDE; + +protected: + void notifyObservers(const QSceneChangePtr &e) Q_DECL_OVERRIDE; + + const QList<QObserverInterface *> &observers() const { return m_observers; } + +private: + QList<QObserverInterface *> m_observers; + QReadWriteLock m_lock; +}; + +} // namespace Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_QOBSERVABLE_H diff --git a/src/core/qobservableinterface.cpp b/src/core/qobservableinterface.cpp new file mode 100644 index 000000000..20106ddb3 --- /dev/null +++ b/src/core/qobservableinterface.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qobservableinterface.h" + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +QObservableInterface::~QObservableInterface() +{ +} + +} // namespace Qt3D + +QT_END_NAMESPACE diff --git a/src/core/qobservableinterface.h b/src/core/qobservableinterface.h new file mode 100644 index 000000000..1ae6aa5a3 --- /dev/null +++ b/src/core/qobservableinterface.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QOBSERVABLEINTERFACE_H +#define QT3D_QOBSERVABLEINTERFACE_H + +#include <Qt3DCore/qt3dcore_global.h> +#include <Qt3DCore/qscenechange.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class QObserverInterface; + +class QT3DCORESHARED_EXPORT QObservableInterface +{ +public: + virtual ~QObservableInterface(); + + virtual void registerObserver(QObserverInterface *observer) = 0; + virtual void unregisterObserver(QObserverInterface *observer) = 0; + +protected: + virtual void notifyObservers(const QSceneChangePtr &e) = 0; +}; + +} // namespace Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_QOBSERVABLEINTERFACE_H diff --git a/src/core/qobserverinterface.cpp b/src/core/qobserverinterface.cpp new file mode 100644 index 000000000..6c7d0f893 --- /dev/null +++ b/src/core/qobserverinterface.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qobserverinterface.h" + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +QObserverInterface::~QObserverInterface() +{ +} + +} // namespace Qt3D + +QT_END_NAMESPACE diff --git a/src/core/qobserverinterface.h b/src/core/qobserverinterface.h new file mode 100644 index 000000000..ab3142b94 --- /dev/null +++ b/src/core/qobserverinterface.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QOBSERVERINTERFACE_H +#define QT3D_QOBSERVERINTERFACE_H + +#include <Qt3DCore/qt3dcore_global.h> +#include <Qt3DCore/qscenechange.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class QT3DCORESHARED_EXPORT QObserverInterface +{ +public: + virtual ~QObserverInterface(); + virtual void sceneChangeEvent(const QSceneChangePtr &e) = 0; +}; + +} // namespace Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_QOBSERVERINTERFACE_H diff --git a/src/core/qscenechange.h b/src/core/qscenechange.h new file mode 100644 index 000000000..7e452f38f --- /dev/null +++ b/src/core/qscenechange.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QSCENECHANGE_H +#define QT3D_QSCENECHANGE_H + +#include <Qt3DCore/qt3dcore_global.h> +#include <QDateTime> +#include <QSharedPointer> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +enum ChangeFlag { + NodeCreated = 0x00000001, + NodeAboutToBeDeleted = 0x00000002, + NodeDeleted = 0x00000004, + NodeStatus = 0x00000008, + ComponentAdded = 0x00000010, + ComponentRemoved = 0x00000020, + ComponentUpdated = 0x00000040, + AllChanges = 0x00000FFF +}; +Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag) +Q_DECLARE_OPERATORS_FOR_FLAGS(ChangeFlags) + +class Component; +class QObservableInterface; + +class QT3DCORESHARED_EXPORT QSceneChange +{ +public: + enum Priority { + High, + Standard, + Low + }; + + QSceneChange(ChangeFlag type, QObservableInterface *observable, Priority priority = Standard) + : m_type(type), + m_priority(priority), + m_timestamp(QDateTime::currentMSecsSinceEpoch()) + { + m_subject.m_observable = observable; + m_subjectType = ObservableType; + } + + QSceneChange(ChangeFlag type, Component *component, Priority priority = Standard) + : m_type(type), + m_priority(priority), + m_timestamp(QDateTime::currentMSecsSinceEpoch()) + { + m_subject.m_component = component; + m_subjectType = ComponentType; + } + + union { + QObservableInterface *m_observable; + Component *m_component; + } m_subject; + + enum ObservableType { + ObservableType, + ComponentType + } m_subjectType; + + ChangeFlag m_type; + Priority m_priority; + qint64 m_timestamp; + + // TODO: add timestamp from central clock and priority level + // These can be used to resolve any conflicts between events + // posted from different aspects +}; + +typedef QSharedPointer<QSceneChange> QSceneChangePtr; + +} // namespace Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_QSCENECHANGE_H diff --git a/src/core/qscenepropertychange.h b/src/core/qscenepropertychange.h new file mode 100644 index 000000000..839f0d329 --- /dev/null +++ b/src/core/qscenepropertychange.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QSCENEPROPERTYCHANGE_H +#define QT3D_QSCENEPROPERTYCHANGE_H + +#include <Qt3DCore/qscenechange.h> + +#include <QVariant> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class QT3DCORESHARED_EXPORT QScenePropertyChange : public QSceneChange +{ +public: + QScenePropertyChange(ChangeFlag type, QObservableInterface *subject, Priority priority = Standard) + : QSceneChange(type, subject, priority) + { + } + + QScenePropertyChange(ChangeFlag type, Component *component, Priority priority = Standard) + : QSceneChange(type, component, priority) + { + } + + QByteArray m_propertyName; + QVariant m_value; +}; + +typedef QSharedPointer<QScenePropertyChange> QScenePropertyChangePtr; + +} // namespace Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_QSCENEPROPERTYCHANGE_H diff --git a/src/core/transforms/transform.cpp b/src/core/transforms/transform.cpp index e0350db0e..c5abefc77 100644 --- a/src/core/transforms/transform.cpp +++ b/src/core/transforms/transform.cpp @@ -41,6 +41,7 @@ #include "transform.h" +#include <Qt3DCore/qscenepropertychange.h> #include <matrixtransform.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/cameraselectornode.cpp b/src/render/backend/framegraph/cameraselectornode.cpp index a3e2cdcf3..17c70df28 100644 --- a/src/render/backend/framegraph/cameraselectornode.cpp +++ b/src/render/backend/framegraph/cameraselectornode.cpp @@ -45,6 +45,7 @@ #include <Qt3DRenderer/renderer.h> #include <Qt3DRenderer/rendereraspect.h> #include <Qt3DCore/qaspectmanager.h> +#include <Qt3DCore/qchangearbiter.h> #include <Qt3DCore/entity.h> #include "renderlogging.h" diff --git a/src/render/backend/framegraph/cameraselectornode.h b/src/render/backend/framegraph/cameraselectornode.h index 911634df6..f7cfe194b 100644 --- a/src/render/backend/framegraph/cameraselectornode.h +++ b/src/render/backend/framegraph/cameraselectornode.h @@ -43,6 +43,7 @@ #define QT3D_RENDER_CAMERASELECTOR_H #include <Qt3DRenderer/framegraphnode.h> +#include <Qt3DCore/qobserverinterface.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/framegraphnode.h b/src/render/backend/framegraph/framegraphnode.h index adf5de19c..6916c47a2 100644 --- a/src/render/backend/framegraph/framegraphnode.h +++ b/src/render/backend/framegraph/framegraphnode.h @@ -44,7 +44,6 @@ #include <qglobal.h> #include <QVector> -#include <Qt3DCore/qchangearbiter.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/renderpassfilternode.cpp b/src/render/backend/framegraph/renderpassfilternode.cpp index 0f6d45a06..ab420a22e 100644 --- a/src/render/backend/framegraph/renderpassfilternode.cpp +++ b/src/render/backend/framegraph/renderpassfilternode.cpp @@ -45,6 +45,7 @@ #include "renderpasscriterion.h" #include "renderpassfilter.h" #include <Qt3DCore/qaspectmanager.h> +#include <Qt3DCore/qchangearbiter.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/renderpassfilternode.h b/src/render/backend/framegraph/renderpassfilternode.h index 264a3784b..37cfbb502 100644 --- a/src/render/backend/framegraph/renderpassfilternode.h +++ b/src/render/backend/framegraph/renderpassfilternode.h @@ -42,7 +42,7 @@ #ifndef QT3D_RENDER_RENDERPASSFILTER_H #define QT3D_RENDER_RENDERPASSFILTER_H -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> #include <Qt3DRenderer/framegraphnode.h> #include <QList> diff --git a/src/render/backend/framegraph/techniquefilternode.cpp b/src/render/backend/framegraph/techniquefilternode.cpp index a72ac47ef..00eed7df6 100644 --- a/src/render/backend/framegraph/techniquefilternode.cpp +++ b/src/render/backend/framegraph/techniquefilternode.cpp @@ -46,6 +46,7 @@ #include "rendereraspect.h" #include <Qt3DCore/qaspectmanager.h> #include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qscenepropertychange.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/techniquefilternode.h b/src/render/backend/framegraph/techniquefilternode.h index a8d1508f8..cce1c0431 100644 --- a/src/render/backend/framegraph/techniquefilternode.h +++ b/src/render/backend/framegraph/techniquefilternode.h @@ -43,6 +43,8 @@ #define QT3D_RENDER_TECHNIQUEFILTER_H #include <Qt3DRenderer/framegraphnode.h> +#include <Qt3DCore/qobserverinterface.h> + #include <QList> #include <QString> #include <QVariant> diff --git a/src/render/backend/framegraph/viewportnode.cpp b/src/render/backend/framegraph/viewportnode.cpp index 7fe9a47a5..6e20deeb8 100644 --- a/src/render/backend/framegraph/viewportnode.cpp +++ b/src/render/backend/framegraph/viewportnode.cpp @@ -40,10 +40,14 @@ ****************************************************************************/ #include "viewportnode.h" + #include <Qt3DRenderer/renderer.h> #include <Qt3DRenderer/rendereraspect.h> -#include <Qt3DCore/qaspectmanager.h> #include <Qt3DRenderer/viewport.h> + +#include <Qt3DCore/qaspectmanager.h> +#include <Qt3DCore/qchangearbiter.h> + #include <QDebug> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/framegraph/viewportnode.h b/src/render/backend/framegraph/viewportnode.h index 2f034c489..f8a4b3cf6 100644 --- a/src/render/backend/framegraph/viewportnode.h +++ b/src/render/backend/framegraph/viewportnode.h @@ -43,6 +43,7 @@ #define QT3D_RENDER_VIEWPORTNODE_H #include <Qt3DRenderer/framegraphnode.h> +#include <Qt3DCore/qobserverinterface.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/rendercamera.cpp b/src/render/backend/rendercamera.cpp index f619f31e3..041655cc5 100644 --- a/src/render/backend/rendercamera.cpp +++ b/src/render/backend/rendercamera.cpp @@ -47,6 +47,7 @@ #include <entity.h> #include <qaspectmanager.h> +#include <Qt3DCore/qscenepropertychange.h> #include <QOpenGLContext> diff --git a/src/render/backend/rendercamera.h b/src/render/backend/rendercamera.h index 4b33fbaac..f5dea4eb6 100644 --- a/src/render/backend/rendercamera.h +++ b/src/render/backend/rendercamera.h @@ -42,7 +42,7 @@ #ifndef QT3D_RENDER_RENDERCAMERA_H #define QT3D_RENDER_RENDERCAMERA_H -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> #include <QMatrix4x4> #include <QRectF> diff --git a/src/render/backend/rendereffect.cpp b/src/render/backend/rendereffect.cpp index 6411d9556..bc1ef46df 100644 --- a/src/render/backend/rendereffect.cpp +++ b/src/render/backend/rendereffect.cpp @@ -45,6 +45,8 @@ #include <Qt3DCore/qaspectmanager.h> #include <Qt3DCore/qabstracteffect.h> #include <Qt3DCore/qabstracttechnique.h> +#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qscenepropertychange.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/rendereffect.h b/src/render/backend/rendereffect.h index 050e8e0a8..95792d3ec 100644 --- a/src/render/backend/rendereffect.h +++ b/src/render/backend/rendereffect.h @@ -44,7 +44,7 @@ #include <QList> #include <Qt3DRenderer/qt3drenderer_global.h> -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/rendermaterial.cpp b/src/render/backend/rendermaterial.cpp index b78913cf8..c62d7d495 100644 --- a/src/render/backend/rendermaterial.cpp +++ b/src/render/backend/rendermaterial.cpp @@ -50,6 +50,7 @@ #include <material.h> #include <qaspectmanager.h> +#include <Qt3DCore/qscenepropertychange.h> #include <QOpenGLShaderProgram> diff --git a/src/render/backend/rendermaterial.h b/src/render/backend/rendermaterial.h index e6ae13325..e178f7ae9 100644 --- a/src/render/backend/rendermaterial.h +++ b/src/render/backend/rendermaterial.h @@ -44,7 +44,7 @@ #include <QVariant> -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> #include <Qt3DRenderer/quniformvalue.h> #include <Qt3DRenderer/rendertextureprovider.h> diff --git a/src/render/backend/rendermesh.cpp b/src/render/backend/rendermesh.cpp index 2a2c57f9d..22ad07536 100644 --- a/src/render/backend/rendermesh.cpp +++ b/src/render/backend/rendermesh.cpp @@ -49,6 +49,8 @@ #include <meshdata.h> #include <technique.h> +#include <Qt3DCore/qscenepropertychange.h> + #include <QOpenGLContext> #include <QOpenGLShaderProgram> #include <QReadWriteLock> diff --git a/src/render/backend/rendermesh.h b/src/render/backend/rendermesh.h index 4018ccc28..730d69235 100644 --- a/src/render/backend/rendermesh.h +++ b/src/render/backend/rendermesh.h @@ -43,7 +43,7 @@ #define QT3D_RENDER_RENDERMESH_H #include <Qt3DCore/axisalignedboundingbox.h> -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> #include <Qt3DCore/qhandle.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/rendernode.cpp b/src/render/backend/rendernode.cpp index e63b94435..7da511d7e 100644 --- a/src/render/backend/rendernode.cpp +++ b/src/render/backend/rendernode.cpp @@ -56,6 +56,7 @@ #include <qaspectmanager.h> #include <sphere.h> #include <entity.h> +#include <Qt3DCore/qscenepropertychange.h> #include <QMatrix4x4> #include <QString> diff --git a/src/render/backend/rendernode.h b/src/render/backend/rendernode.h index aaa6614d9..447b92ac4 100644 --- a/src/render/backend/rendernode.h +++ b/src/render/backend/rendernode.h @@ -42,7 +42,7 @@ #ifndef QT3D_RENDER_RENDERNODE_H #define QT3D_RENDER_RENDERNODE_H -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> #include <Qt3DCore/qhandle.h> #include <QVector> diff --git a/src/render/backend/renderrenderpass.cpp b/src/render/backend/renderrenderpass.cpp index f56fadf90..045220187 100644 --- a/src/render/backend/renderrenderpass.cpp +++ b/src/render/backend/renderrenderpass.cpp @@ -43,6 +43,8 @@ #include "renderer.h" #include "rendereraspect.h" #include <Qt3DCore/qaspectmanager.h> +#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qscenepropertychange.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/renderrenderpass.h b/src/render/backend/renderrenderpass.h index 9ab7a55c9..b1b95197e 100644 --- a/src/render/backend/renderrenderpass.h +++ b/src/render/backend/renderrenderpass.h @@ -42,8 +42,8 @@ #ifndef QT3D_RENDER_RENDERRENDERPASS_H #define QT3D_RENDER_RENDERRENDERPASS_H -#include <Qt3DCore/qchangearbiter.h> #include <Qt3DRenderer/qt3drenderer_global.h> +#include <Qt3DCore/qobserverinterface.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/rendertechnique.cpp b/src/render/backend/rendertechnique.cpp index 5d14a750c..74bdda9e7 100644 --- a/src/render/backend/rendertechnique.cpp +++ b/src/render/backend/rendertechnique.cpp @@ -48,6 +48,7 @@ #include "renderer.h" #include <Qt3DCore/qaspectmanager.h> #include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qscenepropertychange.h> #include <QDebug> diff --git a/src/render/backend/rendertechnique.h b/src/render/backend/rendertechnique.h index 674c09824..984d94ac9 100644 --- a/src/render/backend/rendertechnique.h +++ b/src/render/backend/rendertechnique.h @@ -44,7 +44,7 @@ #include <QVector> #include <QStringList> -#include <Qt3DCore/qchangearbiter.h> +#include <Qt3DCore/qobserverinterface.h> QT_BEGIN_NAMESPACE diff --git a/src/render/frontend/cameraselector.h b/src/render/frontend/cameraselector.h index b978cb3c4..f63297dcf 100644 --- a/src/render/frontend/cameraselector.h +++ b/src/render/frontend/cameraselector.h @@ -45,6 +45,9 @@ #include <Qt3DRenderer/qt3drenderer_global.h> #include <Qt3DRenderer/framegraphitem.h> +#include <Qt3DCore/node.h> +#include <Qt3DCore/qscenepropertychange.h> + QT_BEGIN_NAMESPACE namespace Qt3D { diff --git a/src/render/frontend/effect.h b/src/render/frontend/effect.h index fee10f1c3..edb661c68 100644 --- a/src/render/frontend/effect.h +++ b/src/render/frontend/effect.h @@ -44,7 +44,6 @@ #include <Qt3DCore/qabstracteffect.h> #include <Qt3DCore/node.h> -#include <Qt3DCore/qchangearbiter.h> #include <Qt3DRenderer/qt3drenderer_global.h> QT_BEGIN_NAMESPACE diff --git a/src/render/frontend/framegraphitem.h b/src/render/frontend/framegraphitem.h index 3f0dd54cb..d4c57e78b 100644 --- a/src/render/frontend/framegraphitem.h +++ b/src/render/frontend/framegraphitem.h @@ -43,8 +43,7 @@ #define QT3D_FRAMEGRAPHNODE_H #include <Qt3DRenderer/qt3drenderer_global.h> -#include <Qt3DCore/node.h> -#include <Qt3DCore/qchangearbiter.h> +#include <QObject> QT_BEGIN_NAMESPACE @@ -61,6 +60,7 @@ public: void setEnabled(bool enabled); bool isEnabled() const; + // TODO: Remove this Q_SIGNALS: virtual void enabledChanged() = 0; diff --git a/src/render/frontend/material.cpp b/src/render/frontend/material.cpp index 921d96ad0..c322160b7 100644 --- a/src/render/frontend/material.cpp +++ b/src/render/frontend/material.cpp @@ -41,11 +41,11 @@ #include "material.h" //#include <Qt3DCore/qabstractmaterial_p.h> -#include <qchangearbiter.h> #include <texture.h> #include "qabstracteffect.h" #include "renderlogging.h" #include "parameter.h" +#include <Qt3DCore/qscenepropertychange.h> QT_BEGIN_NAMESPACE diff --git a/src/render/frontend/mesh.cpp b/src/render/frontend/mesh.cpp index 74c46e07f..217afed81 100644 --- a/src/render/frontend/mesh.cpp +++ b/src/render/frontend/mesh.cpp @@ -41,13 +41,14 @@ #include "mesh.h" -#include <qchangearbiter.h> #include <QDebug> #include <QFile> #include <QFileInfo> #include <objloader.h> +#include <Qt3DCore/qscenepropertychange.h> + QT_BEGIN_NAMESPACE namespace Qt3D { diff --git a/src/render/frontend/renderpassfilter.h b/src/render/frontend/renderpassfilter.h index 312c75b1d..f1a23fce4 100644 --- a/src/render/frontend/renderpassfilter.h +++ b/src/render/frontend/renderpassfilter.h @@ -45,6 +45,10 @@ #include <Qt3DRenderer/qt3drenderer_global.h> #include <Qt3DRenderer/framegraphitem.h> #include <Qt3DRenderer/renderpasscriterion.h> + +#include <Qt3DCore/node.h> +#include <Qt3DCore/qscenepropertychange.h> + #include <QString> QT_BEGIN_NAMESPACE diff --git a/src/render/frontend/rendertargetselector.h b/src/render/frontend/rendertargetselector.h index 7adca56ae..0e67725f6 100644 --- a/src/render/frontend/rendertargetselector.h +++ b/src/render/frontend/rendertargetselector.h @@ -43,6 +43,7 @@ #define QT3D_RENDERTARGETSELECTOR_H #include <Qt3DRenderer/qt3drenderer_global.h> +#include <Qt3DCore/node.h> #include <Qt3DRenderer/framegraphitem.h> QT_BEGIN_NAMESPACE diff --git a/src/render/frontend/techniquefilter.h b/src/render/frontend/techniquefilter.h index 4d26e65aa..14369acd6 100644 --- a/src/render/frontend/techniquefilter.h +++ b/src/render/frontend/techniquefilter.h @@ -46,6 +46,9 @@ #include <Qt3DRenderer/framegraphitem.h> #include <Qt3DRenderer/techniquecriterion.h> +#include <Qt3DCore/node.h> +#include <Qt3DCore/qscenepropertychange.h> + QT_BEGIN_NAMESPACE namespace Qt3D { diff --git a/src/render/frontend/viewport.h b/src/render/frontend/viewport.h index aa16c2052..318b16c7a 100644 --- a/src/render/frontend/viewport.h +++ b/src/render/frontend/viewport.h @@ -43,6 +43,8 @@ #define QT3D_VIEWPORT_H #include <Qt3DRenderer/framegraphitem.h> +#include <Qt3DCore/node.h> +#include <Qt3DCore/qscenepropertychange.h> #include <QtCore/QRectF> QT_BEGIN_NAMESPACE |