diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2014-06-14 16:24:51 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-06-26 10:13:17 +0200 |
commit | c2f83ea6051d12c740a4210fbb63c4766b770212 (patch) | |
tree | 9ef27c74b93925bc3f7b0c1e74cd9095805740a5 | |
parent | f6306934cb61580934a6d43ded03145ea5be6703 (diff) |
d-pointer FrameGraph component
Change-Id: I1384e6daf0aafcef7229f277e3002043360d3565
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/render/frontend/framegraph.cpp | 26 | ||||
-rw-r--r-- | src/render/frontend/framegraph.h | 7 | ||||
-rw-r--r-- | src/render/frontend/framegraph_p.h | 68 | ||||
-rw-r--r-- | src/render/frontend/render-frontend.pri | 3 | ||||
-rw-r--r-- | src/render/render.pro | 2 |
5 files changed, 96 insertions, 10 deletions
diff --git a/src/render/frontend/framegraph.cpp b/src/render/frontend/framegraph.cpp index df33d674e..7428a2c96 100644 --- a/src/render/frontend/framegraph.cpp +++ b/src/render/frontend/framegraph.cpp @@ -40,12 +40,20 @@ ****************************************************************************/ #include "framegraph.h" +#include "framegraph_p.h" #include <Qt3DCore/entity.h> QT_BEGIN_NAMESPACE namespace Qt3D { +FrameGraphPrivate::FrameGraphPrivate(FrameGraph *qq) + : ComponentPrivate(qq) + , m_activeFrameGraph(Q_NULLPTR) +{ + +} + /*! * \class FrameGraph * @@ -60,9 +68,13 @@ namespace Qt3D { * \namespace Qt3D */ -FrameGraph::FrameGraph(Node *parent) : - Qt3D::Component(parent), - m_activeFrameGraph(Q_NULLPTR) +FrameGraph::FrameGraph(Node *parent) + : Component(*new FrameGraphPrivate(this), parent) +{ +} + +FrameGraph::FrameGraph(FrameGraphPrivate &dd, Node *parent) + : Component(dd, parent) { } @@ -71,7 +83,8 @@ FrameGraph::FrameGraph(Node *parent) : */ Node *FrameGraph::activeFrameGraph() const { - return m_activeFrameGraph; + Q_D(const FrameGraph); + return d->m_activeFrameGraph; } /*! @@ -79,8 +92,9 @@ Node *FrameGraph::activeFrameGraph() const */ void FrameGraph::setActiveFrameGraph(Node *activeFrameGraph) { - if (activeFrameGraph != m_activeFrameGraph) { - m_activeFrameGraph = activeFrameGraph; + Q_D(FrameGraph); + if (activeFrameGraph != d->m_activeFrameGraph) { + d->m_activeFrameGraph = activeFrameGraph; emit activeFrameGraphChanged(); } } diff --git a/src/render/frontend/framegraph.h b/src/render/frontend/framegraph.h index 512303e1d..05ec9191c 100644 --- a/src/render/frontend/framegraph.h +++ b/src/render/frontend/framegraph.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE namespace Qt3D { +class FrameGraphPrivate; + class QT3DRENDERERSHARED_EXPORT FrameGraph : public Qt3D::Component { Q_OBJECT @@ -66,8 +68,9 @@ public: Q_SIGNALS: void activeFrameGraphChanged(); -private: - Node *m_activeFrameGraph; +protected: + Q_DECLARE_PRIVATE(FrameGraph) + FrameGraph(FrameGraphPrivate &dd, Node *parent = 0); }; } //Qt3D diff --git a/src/render/frontend/framegraph_p.h b/src/render/frontend/framegraph_p.h new file mode 100644 index 000000000..769bfd734 --- /dev/null +++ b/src/render/frontend/framegraph_p.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** 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_FRAMEGRAPH_P_H +#define QT3D_FRAMEGRAPH_P_H + +#include <Qt3DCore/qt3dcore_global.h> +#include <private/component_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +class FrameGraph; + +class FrameGraphPrivate : public ComponentPrivate +{ +public: + FrameGraphPrivate(FrameGraph *qq); + + Q_DECLARE_PUBLIC(FrameGraph) + + Node *m_activeFrameGraph; +}; + +} + +QT_END_NAMESPACE + +#endif // QT3D_FRAMEGRAPH_P_H diff --git a/src/render/frontend/render-frontend.pri b/src/render/frontend/render-frontend.pri index 58f427fe8..c1d17f298 100644 --- a/src/render/frontend/render-frontend.pri +++ b/src/render/frontend/render-frontend.pri @@ -25,7 +25,8 @@ HEADERS += \ $$PWD/techniquecriterion.h \ $$PWD/renderpasscriterion.h \ $$PWD/parameter.h \ - $$PWD/parameterbinder.h + $$PWD/parameterbinder.h \ + $$PWD/framegraph_p.h SOURCES += \ $$PWD/material.cpp \ diff --git a/src/render/render.pro b/src/render/render.pro index 902871660..ad4f5870f 100644 --- a/src/render/render.pro +++ b/src/render/render.pro @@ -1,6 +1,6 @@ TARGET = Qt3DRenderer -QT += core-private gui-private 3dcore +QT += core-private gui-private 3dcore 3dcore-private DEFINES += QT3DRENDERER_LIBRARY |