diff options
author | Paul Lemire <paul.lemire350@gmail.com> | 2015-08-06 19:04:34 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-08-07 19:43:15 +0000 |
commit | 1f8e2ee5fd8b66f6a10440166134972016a78c21 (patch) | |
tree | 9dbbcf2cf217f8814739780f99095cfb7399ce32 | |
parent | 2ee91cf599604cda81d0b705968435d3ebe8f439 (diff) |
LoadGeometryJob added to load geometries
Change-Id: I6149a085197fb317fffe6214d16a4806bd08e58c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/backend/jobs/loadgeometryjob.cpp | 67 | ||||
-rw-r--r-- | src/render/backend/jobs/loadgeometryjob_p.h | 74 | ||||
-rw-r--r-- | src/render/backend/jobs/render-jobs.pri | 6 |
3 files changed, 145 insertions, 2 deletions
diff --git a/src/render/backend/jobs/loadgeometryjob.cpp b/src/render/backend/jobs/loadgeometryjob.cpp new file mode 100644 index 000000000..ed5af49ea --- /dev/null +++ b/src/render/backend/jobs/loadgeometryjob.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Paul Lemire +** 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 "loadgeometryjob_p.h" +#include <Qt3DRenderer/private/renderer_p.h> +#include <Qt3DRenderer/private/geometryrenderermanager_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +namespace Render { + +LoadGeometryJob::LoadGeometryJob(const HGeometryRenderer &handle) + : QAspectJob() + , m_handle(handle) +{ +} + +LoadGeometryJob::~LoadGeometryJob() +{ +} + +void LoadGeometryJob::run() +{ + RenderGeometryRenderer *geometryRenderer = m_renderer->geometryRendererManager()->data(m_handle); + // TO DO: Do something +} + +} // Render + +} // Qt3D + +QT_END_NAMESPACE diff --git a/src/render/backend/jobs/loadgeometryjob_p.h b/src/render/backend/jobs/loadgeometryjob_p.h new file mode 100644 index 000000000..6203e7d8a --- /dev/null +++ b/src/render/backend/jobs/loadgeometryjob_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Paul Lemire +** 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$ +** +****************************************************************************/ + +#ifndef QT3D_RENDER_LOADGEOMETRYJOB_H +#define QT3D_RENDER_LOADGEOMETRYJOB_H + +#include <QSharedPointer> +#include <Qt3DCore/qaspectjob.h> +#include <Qt3DRenderer/private/handle_types_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3D { + +namespace Render { + +class Renderer; + +class LoadGeometryJob : public QAspectJob +{ +public: + explicit LoadGeometryJob(const HGeometryRenderer &handle); + ~LoadGeometryJob(); + + void setRenderer(Renderer *renderer) { m_renderer = renderer; } + +protected: + void run() Q_DECL_OVERRIDE; + HGeometryRenderer m_handle; + Renderer *m_renderer; +}; + +typedef QSharedPointer<LoadGeometryJob> LoadGeometryJobPtr; + +} // Render + +} // Qt3D + +QT_END_NAMESPACE + +#endif // QT3D_RENDER_LOADGEOMETRYJOB_H diff --git a/src/render/backend/jobs/render-jobs.pri b/src/render/backend/jobs/render-jobs.pri index 2a4f4ddee..a9905525d 100644 --- a/src/render/backend/jobs/render-jobs.pri +++ b/src/render/backend/jobs/render-jobs.pri @@ -10,7 +10,8 @@ HEADERS += \ $$PWD/framecleanupjob_p.h \ $$PWD/framepreparationjob_p.h \ $$PWD/loadtexturedatajob_p.h \ - $$PWD/loadbufferjob_p.h + $$PWD/loadbufferjob_p.h \ + $$PWD/loadgeometryjob_p.h SOURCES += \ $$PWD/updateworldtransformjob.cpp \ @@ -22,4 +23,5 @@ SOURCES += \ $$PWD/framecleanupjob.cpp \ $$PWD/framepreparationjob.cpp \ $$PWD/loadtexturedatajob.cpp \ - $$PWD/loadbufferjob.cpp + $$PWD/loadbufferjob.cpp \ + $$PWD/loadgeometryjob.cpp |