diff options
author | Paul Lemire <paul.lemire350@gmail.com> | 2015-08-10 15:26:28 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-08-11 17:29:25 +0000 |
commit | 86efa9fe761915d738ba231a5d94c74af3660500 (patch) | |
tree | 62176b3200e30bdf4f52ac2e1fd01277c80188ff /src/render/backend/jobs | |
parent | dfe50678f651f4effd677e4fc9d7b518a5975329 (diff) |
Cleanup: remove QAbstractMesh/QMeshData/MeshDataManager
Change-Id: I1f13cea4cf864dcf985d1f487e195509de9006e7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/backend/jobs')
-rw-r--r-- | src/render/backend/jobs/framepreparationjob.cpp | 1 | ||||
-rw-r--r-- | src/render/backend/jobs/loadmeshdatajob.cpp | 96 | ||||
-rw-r--r-- | src/render/backend/jobs/loadmeshdatajob_p.h | 76 | ||||
-rw-r--r-- | src/render/backend/jobs/render-jobs.pri | 2 |
4 files changed, 0 insertions, 175 deletions
diff --git a/src/render/backend/jobs/framepreparationjob.cpp b/src/render/backend/jobs/framepreparationjob.cpp index 34465406c..c402783cc 100644 --- a/src/render/backend/jobs/framepreparationjob.cpp +++ b/src/render/backend/jobs/framepreparationjob.cpp @@ -38,7 +38,6 @@ #include <Qt3DRenderer/private/renderer_p.h> #include <Qt3DRenderer/private/renderentity_p.h> #include <Qt3DRenderer/private/rendershaderdata_p.h> -#include <Qt3DRenderer/qmeshdata.h> #include <Qt3DRenderer/sphere.h> QT_BEGIN_NAMESPACE diff --git a/src/render/backend/jobs/loadmeshdatajob.cpp b/src/render/backend/jobs/loadmeshdatajob.cpp deleted file mode 100644 index 93c3aea7d..000000000 --- a/src/render/backend/jobs/loadmeshdatajob.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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: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 "loadmeshdatajob_p.h" - -#include <qattribute.h> -#include <qmesh.h> -#include <sphere.h> -#include <Qt3DRenderer/private/renderer_p.h> -#include <Qt3DRenderer/private/managers_p.h> -#include <Qt3DRenderer/private/meshdatamanager_p.h> -#include <Qt3DRenderer/private/renderlogging_p.h> - -#include <QThread> - -QT_BEGIN_NAMESPACE - -namespace Qt3D { -namespace Render { - -LoadMeshDataJob::LoadMeshDataJob(QAbstractMeshFunctorPtr functor, const QNodeId &meshUuid) - : QAspectJob() - , m_meshUuid(meshUuid) - , m_functor(functor) -{ -} - -void LoadMeshDataJob::run() -{ - qCDebug(Jobs) << "Entering" << Q_FUNC_INFO << QThread::currentThread(); - - if (m_functor.isNull()) - return ; - - QMutexLocker lock(m_renderer->mutex()); - HMeshData meshDataHandle = m_renderer->meshDataManager()->meshDataFromFunctor(m_functor); - lock.unlock(); - - if (meshDataHandle.isNull()) { - // Load the mesh from disk (or wherever) - QMeshDataPtr meshDataPtr = m_functor->operator ()().staticCast<QMeshData>(); - if (meshDataPtr.isNull()) { - qCDebug(Jobs) << Q_FUNC_INFO << "Mesh has no raw data"; - return ; - } - // TO DO try to use QAbstractMeshData if possible - lock.relock(); - meshDataHandle = m_renderer->meshDataManager()->acquire(); - QMeshData *meshData = m_renderer->meshDataManager()->data(meshDataHandle); - *meshData = *(meshDataPtr.data()); - m_renderer->meshDataManager()->addMeshDataForFunctor(meshDataHandle, m_functor); - QAttribute *attr = static_cast<QAttribute *>(meshData->attributeByName(QMeshData::defaultPositionAttributeName())); - if (!attr) - qCWarning(Jobs) << Q_FUNC_INFO << "unknown attribute: position"; - } - lock.relock(); -// m_renderer->meshManager()->lookupResource(m_meshUuid)->setMeshData(meshDataHandle); -} - -} // namespace Render -} // namespace Qt3D - -QT_END_NAMESPACE diff --git a/src/render/backend/jobs/loadmeshdatajob_p.h b/src/render/backend/jobs/loadmeshdatajob_p.h deleted file mode 100644 index c8d20ca45..000000000 --- a/src/render/backend/jobs/loadmeshdatajob_p.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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: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_LOADMESHDATAJOB_H -#define QT3D_RENDER_LOADMESHDATAJOB_H - -#include <Qt3DCore/qnodeid.h> -#include <Qt3DCore/qaspectjob.h> -#include <Qt3DCore/qhandle.h> -#include <Qt3DRenderer/qmeshdata.h> -#include <Qt3DRenderer/qabstractmesh.h> -#include <QSharedPointer> - -QT_BEGIN_NAMESPACE - -namespace Qt3D { - -namespace Render { - -class Renderer; - -class LoadMeshDataJob : public Qt3D::QAspectJob -{ -public: - LoadMeshDataJob(QAbstractMeshFunctorPtr functor, const QNodeId &meshUuid); - void setRenderer(Renderer *renderer) { m_renderer = renderer; } -protected: - void run() Q_DECL_OVERRIDE; - -private: - QNodeId m_meshUuid; - QAbstractMeshFunctorPtr m_functor; - Renderer *m_renderer; -}; - -typedef QSharedPointer<LoadMeshDataJob> LoadMeshDataJobPtr; - -} // namespace Render -} // namespace Qt3D - -QT_END_NAMESPACE - -#endif // QT3D_RENDER_LOADMESHDATAJOB_H diff --git a/src/render/backend/jobs/render-jobs.pri b/src/render/backend/jobs/render-jobs.pri index a9905525d..2c9b93a4e 100644 --- a/src/render/backend/jobs/render-jobs.pri +++ b/src/render/backend/jobs/render-jobs.pri @@ -3,7 +3,6 @@ INCLUDEPATH += $$PWD HEADERS += \ $$PWD/updateworldtransformjob_p.h \ $$PWD/updateboundingvolumejob_p.h \ - $$PWD/loadmeshdatajob_p.h \ $$PWD/renderviewjob_p.h \ $$PWD/renderviewjobutils_p.h \ $$PWD/loadscenejob_p.h \ @@ -16,7 +15,6 @@ HEADERS += \ SOURCES += \ $$PWD/updateworldtransformjob.cpp \ $$PWD/updateboundingvolumejob.cpp \ - $$PWD/loadmeshdatajob.cpp \ $$PWD/renderviewjob.cpp \ $$PWD/renderviewjobutils.cpp \ $$PWD/loadscenejob.cpp \ |