summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-02-04 16:45:32 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-02-08 15:01:51 +0000
commitc72f232b572b5b4b2e20622b14fe6d2858c5d465 (patch)
tree5bec835ebbfe563bce97c3127e026b1191511186
parent2ef4491efe28141aa40555f1935b22ca73bdb203 (diff)
Introduce QBackendNodeFactory
This interface will be provided by aspects and used by backend nodes when they need to resolve a frontend node to a backend one. Change-Id: I695b1c5027826377c3e5ac7d2a05ca653148b96f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/aspects/qabstractaspect.h4
-rw-r--r--src/core/core.pri4
-rw-r--r--src/core/qbackendnodefactory.cpp54
-rw-r--r--src/core/qbackendnodefactory.h65
4 files changed, 125 insertions, 2 deletions
diff --git a/src/core/aspects/qabstractaspect.h b/src/core/aspects/qabstractaspect.h
index 27a4099f3..e308e49a9 100644
--- a/src/core/aspects/qabstractaspect.h
+++ b/src/core/aspects/qabstractaspect.h
@@ -46,6 +46,7 @@
#include <QSharedPointer>
#include <Qt3DCore/qt3dcore_global.h>
#include <Qt3DCore/qaspectjobproviderinterface.h>
+#include <Qt3DCore/qbackendnodefactory.h>
#include <Qt3DCore/qsceneobserverinterface.h>
QT_BEGIN_NAMESPACE
@@ -67,6 +68,7 @@ class QT3DCORESHARED_EXPORT QAbstractAspect
: public QObject
, public QAspectJobProviderInterface
, public QSceneObserverInterface
+ , public QBackendNodeFactory
{
Q_OBJECT
@@ -94,7 +96,7 @@ public:
protected:
QAbstractAspect(QAbstractAspectPrivate &dd, QObject *parent = 0);
- QBackendNode *createBackendNode(QNode *frontend) const;
+ QBackendNode *createBackendNode(QNode *frontend) const Q_DECL_OVERRIDE;
QBackendNode *getBackendNode(QNode *frontend) const;
void clearBackendNode(QNode *frontend) const;
diff --git a/src/core/core.pri b/src/core/core.pri
index 66870d367..c44e09c64 100644
--- a/src/core/core.pri
+++ b/src/core/core.pri
@@ -39,6 +39,7 @@ HEADERS += \
$$PWD/qobserverinterface_p.h \
$$PWD/qlockableobserverinterface_p.h \
$$PWD/qchangearbiter_p.h \
+ $$PWD/qbackendnodefactory.h \
$$PWD/qt3dcore_global_p.h
SOURCES += \
@@ -55,4 +56,5 @@ SOURCES += \
$$PWD/qsceneobserverinterface.cpp \
$$PWD/qpostman.cpp \
$$PWD/qscene.cpp \
- $$PWD/qbackendscenepropertychange.cpp
+ $$PWD/qbackendscenepropertychange.cpp \
+ $$PWD/qbackendnodefactory.cpp
diff --git a/src/core/qbackendnodefactory.cpp b/src/core/qbackendnodefactory.cpp
new file mode 100644
index 000000000..a3a793652
--- /dev/null
+++ b/src/core/qbackendnodefactory.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qbackendnodefactory.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+QBackendNodeFactory::~QBackendNodeFactory()
+{
+}
+
+} // namespace Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/core/qbackendnodefactory.h b/src/core/qbackendnodefactory.h
new file mode 100644
index 000000000..a93a68b93
--- /dev/null
+++ b/src/core/qbackendnodefactory.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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_QBACKENDNODEFACTORY_H
+#define QT3D_QBACKENDNODEFACTORY_H
+
+#include <Qt3DCore/qt3dcore_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QBackendNode;
+class QNode;
+
+class QT3DCORESHARED_EXPORT QBackendNodeFactory
+{
+public:
+ virtual ~QBackendNodeFactory();
+ virtual QBackendNode *createBackendNode(QNode *frontend) const = 0;
+};
+
+} // namespace Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QBACKENDNODEFACTORY_H