From 1f8e2ee5fd8b66f6a10440166134972016a78c21 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Thu, 6 Aug 2015 19:04:34 +0200 Subject: LoadGeometryJob added to load geometries Change-Id: I6149a085197fb317fffe6214d16a4806bd08e58c Reviewed-by: Sean Harmer --- src/render/backend/jobs/loadgeometryjob.cpp | 67 ++++++++++++++++++++++++++ src/render/backend/jobs/loadgeometryjob_p.h | 74 +++++++++++++++++++++++++++++ src/render/backend/jobs/render-jobs.pri | 6 ++- 3 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 src/render/backend/jobs/loadgeometryjob.cpp create mode 100644 src/render/backend/jobs/loadgeometryjob_p.h 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 +#include + +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 +#include +#include + +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 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 -- cgit v1.2.3