summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-03-16 09:11:45 +0100
committerPaul Lemire <paul.lemire@kdab.com>2015-04-27 06:28:39 +0000
commit9349ce658d23c713d6e19a3c1a7e1701691bcbd2 (patch)
treec6d563a1de4e67461ded77e95fd288d0aebc1348
parentc2c3f9cfa0b55202d8c41c2c66db5832fd6fc40f (diff)
NoDraw backend node for QNoDraw added
Change-Id: I085353a1e2779b3283dbb99101569198c782efc3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/backend/framegraph/framegraph.pri6
-rw-r--r--src/render/backend/framegraph/framegraphnode_p.h3
-rw-r--r--src/render/backend/framegraph/nodraw.cpp70
-rw-r--r--src/render/backend/framegraph/nodraw_p.h66
4 files changed, 142 insertions, 3 deletions
diff --git a/src/render/backend/framegraph/framegraph.pri b/src/render/backend/framegraph/framegraph.pri
index 649121c36..51dfdc88e 100644
--- a/src/render/backend/framegraph/framegraph.pri
+++ b/src/render/backend/framegraph/framegraph.pri
@@ -11,7 +11,8 @@ HEADERS += \
$$PWD/sortmethod_p.h \
$$PWD/sortcriterion_p.h \
$$PWD/framegraphsubtreeselector_p.h \
- $$PWD/statesetnode_p.h
+ $$PWD/statesetnode_p.h \
+ $$PWD/nodraw_p.h
SOURCES += \
$$PWD/cameraselectornode.cpp \
@@ -26,6 +27,7 @@ SOURCES += \
$$PWD/sortmethod.cpp \
$$PWD/sortcriterion.cpp \
$$PWD/framegraphsubtreeselector.cpp \
- $$PWD/statesetnode.cpp
+ $$PWD/statesetnode.cpp \
+ $$PWD/nodraw.cpp
INCLUDEPATH += $$PWD
diff --git a/src/render/backend/framegraph/framegraphnode_p.h b/src/render/backend/framegraph/framegraphnode_p.h
index 565469f42..d05408125 100644
--- a/src/render/backend/framegraph/framegraphnode_p.h
+++ b/src/render/backend/framegraph/framegraphnode_p.h
@@ -68,7 +68,8 @@ public:
ClearBuffer,
SortMethod,
SubtreeSelector,
- StateSet
+ StateSet,
+ NoDraw
};
FrameGraphNodeType nodeType() const { return m_nodeType; }
diff --git a/src/render/backend/framegraph/nodraw.cpp b/src/render/backend/framegraph/nodraw.cpp
new file mode 100644
index 000000000..bffc1a8fc
--- /dev/null
+++ b/src/render/backend/framegraph/nodraw.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** 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:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "nodraw_p.h"
+#include <Qt3DRenderer/qnodraw.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+NoDraw::NoDraw()
+ : FrameGraphNode(FrameGraphNode::NoDraw)
+{
+}
+
+NoDraw::~NoDraw()
+{
+}
+
+void NoDraw::updateFromPeer(QNode *peer)
+{
+ QNoDraw *noDraw = static_cast<QNoDraw *>(peer);
+ setEnabled(noDraw->isEnabled());
+}
+
+void NoDraw::sceneChangeEvent(const QSceneChangePtr &e)
+{
+ Q_UNUSED(e);
+}
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/render/backend/framegraph/nodraw_p.h b/src/render/backend/framegraph/nodraw_p.h
new file mode 100644
index 000000000..1d9a53a1c
--- /dev/null
+++ b/src/render/backend/framegraph/nodraw_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <Qt3DRenderer/private/framegraphnode_p.h>
+
+#ifndef QT3D_RENDER_NODRAW_H
+#define QT3D_RENDER_NODRAW_H
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+namespace Render {
+
+class NoDraw : public FrameGraphNode
+{
+public:
+ NoDraw();
+ ~NoDraw();
+
+ void updateFromPeer(QNode *peer) Q_DECL_OVERRIDE;
+
+protected:
+ void sceneChangeEvent(const QSceneChangePtr &e) Q_DECL_OVERRIDE;
+};
+
+} // Render
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_RENDER_NODRAW_H