From 3be1d4fd1e39d67ff086504c9d16a37a38296005 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 4 Jun 2015 12:54:03 +0200 Subject: Examples: added license files gltf/LICENSE.md is from 4fb289da, https://github.com/KhronosGroup/glTF/blob/master/LICENSE.md (excluding third-party licenses - only glTF graphical assets are used in the examples). Task-number: QTBUG-45612 Change-Id: I66c7d7d3ef2ae8ad10feb74a1e7be41d6ac281ad Reviewed-by: Sami Makkonen Reviewed-by: Sean Harmer --- examples/qt3d/exampleresources/assets/LICENSE | 5 ++++ .../qt3d/exampleresources/assets/gltf/LICENSE.md | 33 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 examples/qt3d/exampleresources/assets/LICENSE create mode 100644 examples/qt3d/exampleresources/assets/gltf/LICENSE.md diff --git a/examples/qt3d/exampleresources/assets/LICENSE b/examples/qt3d/exampleresources/assets/LICENSE new file mode 100644 index 000000000..8d2cfc6c9 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/LICENSE @@ -0,0 +1,5 @@ +cubemaps: See cubemaps/miramar/README.TXT + +gltf: See gltf/LICENSE.md + +textures: See textures/pattern_09/readme.txt diff --git a/examples/qt3d/exampleresources/assets/gltf/LICENSE.md b/examples/qt3d/exampleresources/assets/gltf/LICENSE.md new file mode 100644 index 000000000..25e13f1d6 --- /dev/null +++ b/examples/qt3d/exampleresources/assets/gltf/LICENSE.md @@ -0,0 +1,33 @@ +This license is for the example glTF code, not the [specification](specification/README.md) and [schema](specification). + +Original work Copyright (c) 2012, Motorola Mobility, Inc. +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Additional contributions copyright their respective contributors (also BSD License): + * Fabrice Robinet + * Analytical Graphics, Inc. -- cgit v1.2.3 From 7c07835dbfa127d901cb490165ff92a375c9f09b Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Fri, 5 Jun 2015 13:10:44 +0100 Subject: Fix compilation on OS X 10.8 Task-number: QTBUG-46143 Change-Id: I1ebf37c5f78f4532749d7b432bca367c51d7efdd Reviewed-by: Tim Blechmann Reviewed-by: Paul Lemire --- src/render/backend/qgraphicshelpergl3.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/render/backend/qgraphicshelpergl3.cpp b/src/render/backend/qgraphicshelpergl3.cpp index cd2a5033b..1b0fde66f 100644 --- a/src/render/backend/qgraphicshelpergl3.cpp +++ b/src/render/backend/qgraphicshelpergl3.cpp @@ -117,12 +117,17 @@ void QGraphicsHelperGL3::drawArrays(GLenum primitiveType, void QGraphicsHelperGL3::setVerticesPerPatch(GLint verticesPerPatch) { +#if defined(QT_OPENGL_4) if (!m_tessFuncs) { qWarning() << "Tessellation not supported with OpenGL 3 without GL_ARB_tessellation_shader"; return; } m_tessFuncs->glPatchParameteri(GL_PATCH_VERTICES, verticesPerPatch); +#else + Q_UNUSED(verticesPerPatch); + qWarning() << "Tessellation not supported"; +#endif } void QGraphicsHelperGL3::useProgram(GLuint programId) -- cgit v1.2.3 From 3779e007024b712dee5cd8c187950119ba811bcf Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 8 Jun 2015 13:05:42 +0100 Subject: Remove unnecessary metatype declarations Task-number: QTBUG-46539 Change-Id: I0e9e2d405da2fa5ecc2fc8b8efece6f7364e1b39 Reviewed-by: Paul Lemire --- src/core/aspects/qabstractaspect.h | 2 -- src/core/nodes/qentity.h | 2 -- src/core/nodes/qnode.h | 2 -- src/input/q3dkeyevent.h | 2 -- src/input/qkeyboardcontroller.h | 2 -- src/quick3d/quick3drenderer/items/quick3dshaderdata.h | 2 -- src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h | 2 -- src/render/frontend/framegraph-components/qsortcriterion.h | 2 -- src/render/frontend/qabstracttextureprovider.h | 2 -- src/render/frontend/qannotation.h | 2 -- src/render/frontend/qeffect.h | 2 -- src/render/frontend/qopenglfilter.h | 2 -- src/render/frontend/qparameter.h | 2 -- src/render/frontend/qrenderpass.h | 2 -- src/render/frontend/qshaderdata.h | 2 -- src/render/frontend/qshaderprogram.h | 2 -- src/render/frontend/qtechnique.h | 2 -- src/render/frontend/qtextureimage.h | 2 -- src/render/frontend/qwrapmode.h | 2 -- 19 files changed, 38 deletions(-) diff --git a/src/core/aspects/qabstractaspect.h b/src/core/aspects/qabstractaspect.h index 16d6b1d96..83e1953e2 100644 --- a/src/core/aspects/qabstractaspect.h +++ b/src/core/aspects/qabstractaspect.h @@ -118,6 +118,4 @@ void QAbstractAspect::registerBackendType(const QBackendNodeFunctorPtr &functor) QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QAbstractAspect *) - #endif // QT3D_ABSTRACTASPECT_H diff --git a/src/core/nodes/qentity.h b/src/core/nodes/qentity.h index 86a6ba791..17a0107ec 100644 --- a/src/core/nodes/qentity.h +++ b/src/core/nodes/qentity.h @@ -80,6 +80,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QEntity *) - #endif // QT3D_QENTITY_H diff --git a/src/core/nodes/qnode.h b/src/core/nodes/qnode.h index e61f30edb..5d9f04283 100644 --- a/src/core/nodes/qnode.h +++ b/src/core/nodes/qnode.h @@ -98,6 +98,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QNode *) - #endif diff --git a/src/input/q3dkeyevent.h b/src/input/q3dkeyevent.h index 21f3e4b3c..9f66d26c5 100644 --- a/src/input/q3dkeyevent.h +++ b/src/input/q3dkeyevent.h @@ -84,6 +84,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::Q3DKeyEvent*) - #endif // QT3D_Q3DKEYEVENT_H diff --git a/src/input/qkeyboardcontroller.h b/src/input/qkeyboardcontroller.h index df667b4d5..e30b8722b 100644 --- a/src/input/qkeyboardcontroller.h +++ b/src/input/qkeyboardcontroller.h @@ -74,6 +74,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QKeyboardController *) - #endif // QT3D_INPUT_QKEYBOARDCONTROLLER_H diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdata.h b/src/quick3d/quick3drenderer/items/quick3dshaderdata.h index 56bd143f9..65b635fe7 100644 --- a/src/quick3d/quick3drenderer/items/quick3dshaderdata.h +++ b/src/quick3d/quick3drenderer/items/quick3dshaderdata.h @@ -69,6 +69,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::Render::Quick::Quick3DShaderData*) - #endif // QT3D_RENDER_QUICK_QUICK3DSHADERDATA_H diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h index 7e663fbb9..e5ca26bf0 100644 --- a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h +++ b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h @@ -85,6 +85,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::Render::Quick::Quick3DShaderDataArray*) - #endif // QT3D_RENDER_QUICK_QUICK3DSHADERDATAARRAY_H diff --git a/src/render/frontend/framegraph-components/qsortcriterion.h b/src/render/frontend/framegraph-components/qsortcriterion.h index ef413eeb5..2e24c0ee4 100644 --- a/src/render/frontend/framegraph-components/qsortcriterion.h +++ b/src/render/frontend/framegraph-components/qsortcriterion.h @@ -79,6 +79,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QSortCriterion *) - #endif // QSORTCRITERION_H diff --git a/src/render/frontend/qabstracttextureprovider.h b/src/render/frontend/qabstracttextureprovider.h index 025270cd5..dd82bd776 100644 --- a/src/render/frontend/qabstracttextureprovider.h +++ b/src/render/frontend/qabstracttextureprovider.h @@ -331,6 +331,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider*) - #endif // QT3D_QABSTRACTTEXTUREPROVIDER_H diff --git a/src/render/frontend/qannotation.h b/src/render/frontend/qannotation.h index 639de2e0e..47c82d418 100644 --- a/src/render/frontend/qannotation.h +++ b/src/render/frontend/qannotation.h @@ -77,6 +77,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QAnnotation *) - #endif // QT3D_QANNOTATION_H diff --git a/src/render/frontend/qeffect.h b/src/render/frontend/qeffect.h index ce91357bd..5a395e083 100644 --- a/src/render/frontend/qeffect.h +++ b/src/render/frontend/qeffect.h @@ -76,6 +76,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QEffect*) - #endif // QT3D_QEFFECT_H diff --git a/src/render/frontend/qopenglfilter.h b/src/render/frontend/qopenglfilter.h index c648d2b73..6ff43c417 100644 --- a/src/render/frontend/qopenglfilter.h +++ b/src/render/frontend/qopenglfilter.h @@ -113,6 +113,4 @@ bool operator !=(const QOpenGLFilter &reference, const QOpenGLFilter &sample); QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QOpenGLFilter *) - #endif // QT3D_QOPENGLFILTER_H diff --git a/src/render/frontend/qparameter.h b/src/render/frontend/qparameter.h index 01268e15b..6cb363e21 100644 --- a/src/render/frontend/qparameter.h +++ b/src/render/frontend/qparameter.h @@ -86,6 +86,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QParameter *) - #endif // QT3D_PARAMETER_H diff --git a/src/render/frontend/qrenderpass.h b/src/render/frontend/qrenderpass.h index 1f401860d..4b0fe79a9 100644 --- a/src/render/frontend/qrenderpass.h +++ b/src/render/frontend/qrenderpass.h @@ -106,6 +106,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QRenderPass *) - #endif // QT3D_QRENDERPASS_H diff --git a/src/render/frontend/qshaderdata.h b/src/render/frontend/qshaderdata.h index f526dcfc1..577d4fd79 100644 --- a/src/render/frontend/qshaderdata.h +++ b/src/render/frontend/qshaderdata.h @@ -83,6 +83,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QShaderData*) - #endif // QT3D_QSHADERDATA_H diff --git a/src/render/frontend/qshaderprogram.h b/src/render/frontend/qshaderprogram.h index 4023980a8..94383302b 100644 --- a/src/render/frontend/qshaderprogram.h +++ b/src/render/frontend/qshaderprogram.h @@ -114,6 +114,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QShaderProgram *) - #endif // QT3D_QSHADERPROGRAM_H diff --git a/src/render/frontend/qtechnique.h b/src/render/frontend/qtechnique.h index 199a7d57a..d3d2bf559 100644 --- a/src/render/frontend/qtechnique.h +++ b/src/render/frontend/qtechnique.h @@ -88,6 +88,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QTechnique *) - #endif // QT3D_QTECHNIQUE_H diff --git a/src/render/frontend/qtextureimage.h b/src/render/frontend/qtextureimage.h index e5f078b75..cf08f7b2b 100644 --- a/src/render/frontend/qtextureimage.h +++ b/src/render/frontend/qtextureimage.h @@ -75,6 +75,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QTextureImage*) - #endif // QT3D_QTEXTUREIMAGE_H diff --git a/src/render/frontend/qwrapmode.h b/src/render/frontend/qwrapmode.h index d0333c749..1fac8d153 100644 --- a/src/render/frontend/qwrapmode.h +++ b/src/render/frontend/qwrapmode.h @@ -87,6 +87,4 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3D::QTextureWrapMode*) - #endif // QT3D_QWRAPMODE_H -- cgit v1.2.3 From 9db7beabdbaa0182cc9fd25603a790db293d56eb Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 9 Jun 2015 09:30:22 +0100 Subject: Make QAspectJobManager and base class private Prevents leaking of private headers and allows use of QT3DCORE_PRIVATE_EXPORT for use with the job manager unit test. Change-Id: I7f0c2b2e27e88eee6cb686f5ae55c78b73ea27d3 Reviewed-by: Paul Lemire --- src/core/aspects/qabstractaspect.cpp | 2 +- src/core/aspects/qaspectmanager.cpp | 4 +- src/core/jobs/jobs.pri | 2 - src/core/jobs/qabstractaspectjobmanager.cpp | 11 +--- src/core/jobs/qabstractaspectjobmanager.h | 73 --------------------- src/core/jobs/qabstractaspectjobmanager_p.h | 23 ++++--- src/core/jobs/qaspectjobmanager.cpp | 69 +++++++------------- src/core/jobs/qaspectjobmanager.h | 77 ----------------------- src/core/jobs/qaspectjobmanager_p.h | 29 ++++++--- src/core/jobs/task_p.h | 2 +- src/core/qchangearbiter.cpp | 2 +- src/core/qscheduler.cpp | 2 +- src/render/backend/renderer.cpp | 2 +- tests/auto/core/threadpooler/tst_threadpooler.cpp | 4 +- 14 files changed, 67 insertions(+), 235 deletions(-) delete mode 100644 src/core/jobs/qabstractaspectjobmanager.h delete mode 100644 src/core/jobs/qaspectjobmanager.h diff --git a/src/core/aspects/qabstractaspect.cpp b/src/core/aspects/qabstractaspect.cpp index 94e52c086..aae2100c0 100644 --- a/src/core/aspects/qabstractaspect.cpp +++ b/src/core/aspects/qabstractaspect.cpp @@ -38,7 +38,7 @@ #include "qentity.h" #include #include -#include +#include #include #include diff --git a/src/core/aspects/qaspectmanager.cpp b/src/core/aspects/qaspectmanager.cpp index f6ba2ab97..510ea1777 100644 --- a/src/core/aspects/qaspectmanager.cpp +++ b/src/core/aspects/qaspectmanager.cpp @@ -39,8 +39,8 @@ #include "qabstractaspect_p.h" #include "qchangearbiter_p.h" // TODO Make the kind of job manager configurable (e.g. ThreadWeaver vs Intel TBB) -#include "qaspectjobmanager.h" -#include "qabstractaspectjobmanager.h" +#include "qaspectjobmanager_p.h" +#include "qabstractaspectjobmanager_p.h" #include "qentity.h" #include diff --git a/src/core/jobs/jobs.pri b/src/core/jobs/jobs.pri index d21d21975..35de78e50 100644 --- a/src/core/jobs/jobs.pri +++ b/src/core/jobs/jobs.pri @@ -19,9 +19,7 @@ SOURCES += \ HEADERS += \ $$PWD/qaspectjob.h \ $$PWD/qaspectjob_p.h \ - $$PWD/qabstractaspectjobmanager.h \ $$PWD/qaspectjobproviderinterface.h \ - $$PWD/qaspectjobmanager.h \ $$PWD/qaspectjobmanager_p.h \ $$PWD/qabstractaspectjobmanager_p.h \ $$PWD/dependencyhandler_p.h \ diff --git a/src/core/jobs/qabstractaspectjobmanager.cpp b/src/core/jobs/qabstractaspectjobmanager.cpp index bfd9e1638..a3b768ae4 100644 --- a/src/core/jobs/qabstractaspectjobmanager.cpp +++ b/src/core/jobs/qabstractaspectjobmanager.cpp @@ -34,7 +34,6 @@ ** ****************************************************************************/ -#include "qabstractaspectjobmanager.h" #include "qabstractaspectjobmanager_p.h" QT_BEGIN_NAMESPACE @@ -42,17 +41,11 @@ QT_BEGIN_NAMESPACE namespace Qt3D { /*! - \class Qt3D::QAbstractAspectJobManagerPrivate + \class Qt3D::QAbstractAspectJobManager \internal */ QAbstractAspectJobManager::QAbstractAspectJobManager(QObject *parent) - : QObject(*new QAbstractAspectJobManagerPrivate, parent) -{ -} - -/*! \internal */ -QAbstractAspectJobManager::QAbstractAspectJobManager(QAbstractAspectJobManagerPrivate &dd, QObject *parent) - : QObject(dd, parent) + : QObject(parent) { } diff --git a/src/core/jobs/qabstractaspectjobmanager.h b/src/core/jobs/qabstractaspectjobmanager.h deleted file mode 100644 index 541210112..000000000 --- a/src/core/jobs/qabstractaspectjobmanager.h +++ /dev/null @@ -1,73 +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_QABSTRACTASPECTJOBMANAGER_H -#define QT3D_QABSTRACTASPECTJOBMANAGER_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3D { - -class QAbstractAspectJobManagerPrivate; - -class QAbstractAspectJobManager : public QObject -{ - Q_OBJECT -public: - explicit QAbstractAspectJobManager(QObject *p = 0); - - virtual void initialize() {} - virtual void enqueueJobs(const QVector &jobQueue) = 0; - virtual void waitForAllJobs() = 0; - - // Callback signature for running SynchronizedJobs - typedef void (*JobFunction)(void *); - virtual void waitForPerThreadFunction(JobFunction func, void *arg) = 0; - -protected: - QAbstractAspectJobManager(QAbstractAspectJobManagerPrivate &dd, QObject *parent); - Q_DECLARE_PRIVATE(QAbstractAspectJobManager) -}; - -} // namespace Qt3D - -QT_END_NAMESPACE - -#endif // QT3D_QABSTRACTASPECTJOBMANAGER_H diff --git a/src/core/jobs/qabstractaspectjobmanager_p.h b/src/core/jobs/qabstractaspectjobmanager_p.h index 2ac2d9bcc..29f863ae0 100644 --- a/src/core/jobs/qabstractaspectjobmanager_p.h +++ b/src/core/jobs/qabstractaspectjobmanager_p.h @@ -37,23 +37,30 @@ #ifndef QABSTRACTASPECTJOBMANAGER_P_H #define QABSTRACTASPECTJOBMANAGER_P_H -#include +#include + +#include QT_BEGIN_NAMESPACE namespace Qt3D { -class QAbstractAspectJobManager; - -class QAbstractAspectJobManagerPrivate : public QObjectPrivate +class QAbstractAspectJobManager : public QObject { + Q_OBJECT public: - QAbstractAspectJobManagerPrivate() - : QObjectPrivate() - {} + explicit QAbstractAspectJobManager(QObject *p = 0); + + virtual void initialize() {} + virtual void enqueueJobs(const QVector &jobQueue) = 0; + virtual void waitForAllJobs() = 0; + + // Callback signature for running SynchronizedJobs + typedef void (*JobFunction)(void *); + virtual void waitForPerThreadFunction(JobFunction func, void *arg) = 0; }; -} // Qt3D +} // namespace Qt3D QT_END_NAMESPACE diff --git a/src/core/jobs/qaspectjobmanager.cpp b/src/core/jobs/qaspectjobmanager.cpp index 1488eed21..7fedc2ea8 100644 --- a/src/core/jobs/qaspectjobmanager.cpp +++ b/src/core/jobs/qaspectjobmanager.cpp @@ -42,9 +42,9 @@ #include "weaverjob_p.h" #endif -#include "qaspectjobmanager.h" #include "qaspectjobmanager_p.h" #include "task_p.h" +#include "qthreadpooler_p.h" #include "dependencyhandler_p.h" #include @@ -102,49 +102,27 @@ void SynchronizedJob::run(ThreadWeaver::JobPointer self, ThreadWeaver::Thread *t #endif /*! - \class Qt3D::QAspectJobManagerPrivate + \class Qt3D::QAspectJobManager \internal */ -QAspectJobManagerPrivate::QAspectJobManagerPrivate() - : QAbstractAspectJobManagerPrivate() +QAspectJobManager::QAspectJobManager(QObject *parent) + : QAbstractAspectJobManager(parent) #ifdef THREAD_WEAVER , m_weaver(Q_NULLPTR) #endif + , m_threadPooler(new QThreadPooler(this)) + , m_dependencyHandler(new DependencyHandler) { -} - -QAspectJobManagerPrivate::~QAspectJobManagerPrivate() -{ - delete m_dependencyHandler; -} - -QAspectJobManager::QAspectJobManager(QObject *parent) - : QAbstractAspectJobManager(*new QAspectJobManagerPrivate, parent) -{ - Q_D(QAspectJobManager); #ifdef THREAD_WEAVER - d->m_weaver = new ThreadWeaver::Queue(this); - d->m_weaver->setMaximumNumberOfThreads(QThread::idealThreadCount()); + m_weaver = new ThreadWeaver::Queue(this); + m_weaver->setMaximumNumberOfThreads(QThread::idealThreadCount()); #else - d->m_threadPooler = new QThreadPooler(this); - d->m_dependencyHandler = new DependencyHandler(); - d->m_threadPooler->setDependencyHandler(d->m_dependencyHandler); + m_threadPooler->setDependencyHandler(m_dependencyHandler.data()); #endif } -/*! \internal */ -QAspectJobManager::QAspectJobManager(QAspectJobManagerPrivate &dd, QObject *parent) - : QAbstractAspectJobManager(dd, parent) +QAspectJobManager::~QAspectJobManager() { - Q_D(QAspectJobManager); -#ifdef THREAD_WEAVER - d->m_weaver = new ThreadWeaver::Queue(this); - d->m_weaver->setMaximumNumberOfThreads(QThread::idealThreadCount()); -#else - d->m_threadPooler = new QThreadPooler(this); - d->m_dependencyHandler = new DependencyHandler(); - d->m_threadPooler->setDependencyHandler(d->m_dependencyHandler); -#endif } void QAspectJobManager::initialize() @@ -153,8 +131,6 @@ void QAspectJobManager::initialize() void QAspectJobManager::enqueueJobs(const QVector &jobQueue) { - Q_D(QAspectJobManager); - #ifdef THREAD_WEAVER // Convert QJobs to ThreadWeaver::Jobs QHash > jobsMap; @@ -181,7 +157,7 @@ void QAspectJobManager::enqueueJobs(const QVector &jobQueue) Q_FOREACH (const QAspectJobPtr &job, jobQueue) { QSharedPointer weaverJob = jobsMap.value(job.data()); - d->m_weaver->enqueue(weaverJob); + m_weaver->enqueue(weaverJob); } #else // Convert QJobs to Tasks @@ -207,43 +183,40 @@ void QAspectJobManager::enqueueJobs(const QVector &jobQueue) if (taskDependee) { AspectTaskRunnable *taskDepender = tasksMap.value(job.data()); dependencyList.append(Dependency(taskDepender, taskDependee)); - taskDepender->setDependencyHandler(d->m_dependencyHandler); - taskDependee->setDependencyHandler(d->m_dependencyHandler); + taskDepender->setDependencyHandler(m_dependencyHandler.data()); + taskDependee->setDependencyHandler(m_dependencyHandler.data()); } } } - d->m_dependencyHandler->addDependencies(qMove(dependencyList)); + m_dependencyHandler->addDependencies(qMove(dependencyList)); - d->m_threadPooler->mapDependables(taskList); + m_threadPooler->mapDependables(taskList); #endif } void QAspectJobManager::waitForAllJobs() { - Q_D(QAspectJobManager); #ifdef THREAD_WEAVER - d->m_weaver->finish(); + m_weaver->finish(); #else QFutureWatcher futureWatcher; - futureWatcher.setFuture(d->m_threadPooler->future()); + futureWatcher.setFuture(m_threadPooler->future()); futureWatcher.waitForFinished(); #endif } void QAspectJobManager::waitForPerThreadFunction(JobFunction func, void *arg) { - Q_D(QAspectJobManager); - #ifdef THREAD_WEAVER - const int threadCount = d->m_weaver->maximumNumberOfThreads(); + const int threadCount = m_weaver->maximumNumberOfThreads(); QAtomicInt atomicCount(threadCount); for (int i = 0; i < threadCount; ++i) { SynchronizedJobPtr syncJob(new SynchronizedJob(func, arg, &atomicCount)); - d->m_weaver->enqueue(syncJob); + m_weaver->enqueue(syncJob); } - d->m_weaver->finish(); + m_weaver->finish(); #else const int threadCount = QThread::idealThreadCount(); QAtomicInt atomicCount(threadCount); @@ -254,7 +227,7 @@ void QAspectJobManager::waitForPerThreadFunction(JobFunction func, void *arg) taskList << syncTask; } - QFuture future = d->m_threadPooler->mapDependables(taskList); + QFuture future = m_threadPooler->mapDependables(taskList); QFutureWatcher futureWatcher; futureWatcher.setFuture(future); futureWatcher.waitForFinished(); diff --git a/src/core/jobs/qaspectjobmanager.h b/src/core/jobs/qaspectjobmanager.h deleted file mode 100644 index d2436d29c..000000000 --- a/src/core/jobs/qaspectjobmanager.h +++ /dev/null @@ -1,77 +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_QASPECTJOBMANAGER_H -#define QT3D_QASPECTJOBMANAGER_H - -#include -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3D { - -class QAspectJobManagerPrivate; - -class QT3DCORE_PRIVATE_EXPORT QAspectJobManager : public QAbstractAspectJobManager -{ - Q_OBJECT -public: - explicit QAspectJobManager(QObject *parent = 0); - - void initialize() Q_DECL_OVERRIDE; - - void enqueueJobs(const QVector &jobQueue) Q_DECL_OVERRIDE; - - void waitForAllJobs() Q_DECL_OVERRIDE; - - void waitForPerThreadFunction(JobFunction func, void *arg) Q_DECL_OVERRIDE; - -protected: - QAspectJobManager(QAspectJobManagerPrivate &dd, QObject *parent); - Q_DECLARE_PRIVATE(QAspectJobManager) -}; - -} // namespace Qt3D - -QT_END_NAMESPACE - -#endif // QT3D_QASPECTJOBMANAGER_H diff --git a/src/core/jobs/qaspectjobmanager_p.h b/src/core/jobs/qaspectjobmanager_p.h index 4d6e1feb3..1264bb52b 100644 --- a/src/core/jobs/qaspectjobmanager_p.h +++ b/src/core/jobs/qaspectjobmanager_p.h @@ -38,9 +38,11 @@ #define QT3D_QASPECTJOBMANAGER_P_H #include +#include -#include "qthreadpooler_p.h" -#include "dependencyhandler_p.h" +#include + +#include #ifdef THREAD_WEAVER namespace ThreadWeaver { @@ -52,26 +54,35 @@ QT_BEGIN_NAMESPACE namespace Qt3D { -class QAspectJobManager; +class QThreadPooler; +class DependencyHandler; -class QAspectJobManagerPrivate : public QAbstractAspectJobManagerPrivate +class QT3DCORE_PRIVATE_EXPORT QAspectJobManager : public QAbstractAspectJobManager { + Q_OBJECT public: - QAspectJobManagerPrivate(); - ~QAspectJobManagerPrivate(); + explicit QAspectJobManager(QObject *parent = 0); + ~QAspectJobManager(); + + void initialize() Q_DECL_OVERRIDE; + + void enqueueJobs(const QVector &jobQueue) Q_DECL_OVERRIDE; + + void waitForAllJobs() Q_DECL_OVERRIDE; - Q_DECLARE_PUBLIC(QAspectJobManager) + void waitForPerThreadFunction(JobFunction func, void *arg) Q_DECL_OVERRIDE; +private: #ifdef THREAD_WEAVER // Owned by QAspectJobManager via QObject parent-child ThreadWeaver::Queue *m_weaver; #endif QThreadPooler *m_threadPooler; - DependencyHandler *m_dependencyHandler; + QScopedPointer m_dependencyHandler; }; -} // Qt3D +} // namespace Qt3D QT_END_NAMESPACE diff --git a/src/core/jobs/task_p.h b/src/core/jobs/task_p.h index ea8547303..11f1fb8c6 100644 --- a/src/core/jobs/task_p.h +++ b/src/core/jobs/task_p.h @@ -37,7 +37,7 @@ #ifndef QT3D_TASK_P_H #define QT3D_TASK_P_H -#include "qaspectjobmanager.h" +#include "qaspectjobmanager_p.h" #include #include diff --git a/src/core/qchangearbiter.cpp b/src/core/qchangearbiter.cpp index 7c7dafd0f..886b74036 100644 --- a/src/core/qchangearbiter.cpp +++ b/src/core/qchangearbiter.cpp @@ -36,7 +36,7 @@ #include "qchangearbiter_p.h" #include "qcomponent.h" -#include "qabstractaspectjobmanager.h" +#include "qabstractaspectjobmanager_p.h" #include "qsceneobserverinterface.h" #include "qsceneinterface.h" diff --git a/src/core/qscheduler.cpp b/src/core/qscheduler.cpp index 395c8083e..92c601153 100644 --- a/src/core/qscheduler.cpp +++ b/src/core/qscheduler.cpp @@ -38,7 +38,7 @@ #include "qabstractaspect.h" #include "qaspectmanager_p.h" -#include "qabstractaspectjobmanager.h" +#include "qabstractaspectjobmanager_p.h" QT_BEGIN_NAMESPACE diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp index 78805c47e..7a889910c 100644 --- a/src/render/backend/renderer.cpp +++ b/src/render/backend/renderer.cpp @@ -77,7 +77,7 @@ #include #include -#include +#include #include #include diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index bb2649d11..9becabf08 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -43,8 +43,8 @@ #include #include -#include -#include +#include +#include #include #include -- cgit v1.2.3 From 0eec20fc1e5ee4822bd8560eb6c3c551879528ea Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Wed, 10 Jun 2015 13:00:38 +0300 Subject: Reshape torus-cpp example to be basicshapes-cpp Leave the cylinder-cpp example to show minimal code for setting up a basic element. Reshape torus-cpp to show several shapes available. Change-Id: Ic9dd7cb54258b5eb442ee0492ef4fc2e4b30f836 Reviewed-by: Sean Harmer --- examples/qt3d/basicshapes-cpp/basicshapes-cpp.pro | 14 ++ .../qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc | 32 ++++ examples/qt3d/basicshapes-cpp/main.cpp | 187 +++++++++++++++++++++ examples/qt3d/basicshapes-cpp/scenemodifier.cpp | 178 ++++++++++++++++++++ examples/qt3d/basicshapes-cpp/scenemodifier.h | 78 +++++++++ examples/qt3d/qt3d.pro | 4 +- examples/qt3d/torus-cpp/doc/src/torus-cpp.qdoc | 32 ---- examples/qt3d/torus-cpp/main.cpp | 134 --------------- examples/qt3d/torus-cpp/torus-cpp.pro | 9 - 9 files changed, 491 insertions(+), 177 deletions(-) create mode 100644 examples/qt3d/basicshapes-cpp/basicshapes-cpp.pro create mode 100644 examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc create mode 100644 examples/qt3d/basicshapes-cpp/main.cpp create mode 100644 examples/qt3d/basicshapes-cpp/scenemodifier.cpp create mode 100644 examples/qt3d/basicshapes-cpp/scenemodifier.h delete mode 100644 examples/qt3d/torus-cpp/doc/src/torus-cpp.qdoc delete mode 100644 examples/qt3d/torus-cpp/main.cpp delete mode 100644 examples/qt3d/torus-cpp/torus-cpp.pro diff --git a/examples/qt3d/basicshapes-cpp/basicshapes-cpp.pro b/examples/qt3d/basicshapes-cpp/basicshapes-cpp.pro new file mode 100644 index 000000000..546715fca --- /dev/null +++ b/examples/qt3d/basicshapes-cpp/basicshapes-cpp.pro @@ -0,0 +1,14 @@ +!include( ../examples.pri ) { + error( "Couldn't find the examples.pri file!" ) +} + +QT += 3dcore 3drenderer 3dinput +QT += widgets + +SOURCES += main.cpp \ + scenemodifier.cpp + +HEADERS += \ + scenemodifier.h + + diff --git a/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc new file mode 100644 index 000000000..f408bc43b --- /dev/null +++ b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc @@ -0,0 +1,32 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example basicshapes-cpp + \title Qt3D: Basic Shapes C++ Example + \ingroup qt3d-examples-cpp +*/ diff --git a/examples/qt3d/basicshapes-cpp/main.cpp b/examples/qt3d/basicshapes-cpp/main.cpp new file mode 100644 index 000000000..3aa42f7f8 --- /dev/null +++ b/examples/qt3d/basicshapes-cpp/main.cpp @@ -0,0 +1,187 @@ +/**************************************************************************** +** +** 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 "scenemodifier.h" + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + Qt3D::Window *view = new Qt3D::Window(); + QWidget *container = QWidget::createWindowContainer(view); + + QSize screenSize = view->screen()->size(); + container->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 1.5)); + container->setMaximumSize(screenSize); + container->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + container->setFocusPolicy(Qt::StrongFocus); + + QWidget *widget = new QWidget; + QHBoxLayout *hLayout = new QHBoxLayout(widget); + QVBoxLayout *vLayout = new QVBoxLayout(); + vLayout->setAlignment(Qt::AlignTop); + hLayout->addWidget(container, 1); + hLayout->addLayout(vLayout); + + widget->setWindowTitle(QStringLiteral("Basic shapes")); + + Qt3D::QAspectEngine engine; + engine.registerAspect(new Qt3D::QRenderAspect()); + Qt3D::QInputAspect *input = new Qt3D::QInputAspect; + engine.registerAspect(input); + engine.initialize(); + QVariantMap data; + data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast(view))); + data.insert(QStringLiteral("eventSource"), QVariant::fromValue(view)); + engine.setData(data); + + // Root entity + Qt3D::QEntity *rootEntity = new Qt3D::QEntity(); + + // Camera + Qt3D::QCamera *cameraEntity = new Qt3D::QCamera(rootEntity); + cameraEntity->setObjectName(QStringLiteral("cameraEntity")); + + cameraEntity->lens()->setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f); + cameraEntity->setPosition(QVector3D(0, 0, -20.0f)); + cameraEntity->setUpVector(QVector3D(0, 1, 0)); + cameraEntity->setViewCenter(QVector3D(0, 0, 0)); + input->setCamera(cameraEntity); + + // FrameGraph + Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph(); + Qt3D::QForwardRenderer *forwardRenderer = new Qt3D::QForwardRenderer(); + + forwardRenderer->setCamera(cameraEntity); + forwardRenderer->setClearColor(QColor(QRgb(0x4d4d4f))); + frameGraph->setActiveFrameGraph(forwardRenderer); + + // Setting the FrameGraph + rootEntity->addComponent(frameGraph); + + // Scenemodifier + SceneModifier *modifier = new SceneModifier(rootEntity); + + // Set root object of the scene + engine.setRootEntity(rootEntity); + + // Create control widgets + QCommandLinkButton *info = new QCommandLinkButton(); + info->setText(QStringLiteral("Qt3D ready-made meshes")); + info->setDescription(QStringLiteral("Qt3D provides several ready-made meshes, like torus, cylinder, cube and sphere.")); + info->setIconSize(QSize(0,0)); + + QCheckBox *torusCB = new QCheckBox(widget); + torusCB->setChecked(true); + torusCB->setText(QStringLiteral("Torus")); + + QCheckBox *cylinderCB = new QCheckBox(widget); + cylinderCB->setChecked(true); + cylinderCB->setText(QStringLiteral("Cylinder")); + + QCheckBox *cuboidCB = new QCheckBox(widget); + cuboidCB->setChecked(true); + cuboidCB->setText(QStringLiteral("Cuboid")); + + QCheckBox *sphereCB = new QCheckBox(widget); + sphereCB->setChecked(true); + sphereCB->setText(QStringLiteral("Sphere")); + + vLayout->addWidget(info); + vLayout->addWidget(torusCB); + vLayout->addWidget(cylinderCB); + vLayout->addWidget(cuboidCB); + vLayout->addWidget(sphereCB); + + QObject::connect(torusCB, &QCheckBox::stateChanged, + modifier, &SceneModifier::enableTorus); + QObject::connect(cylinderCB, &QCheckBox::stateChanged, + modifier, &SceneModifier::enableCylinder); + QObject::connect(cuboidCB, &QCheckBox::stateChanged, + modifier, &SceneModifier::enableCuboid); + QObject::connect(sphereCB, &QCheckBox::stateChanged, + modifier, &SceneModifier::enableSphere); + + torusCB->setChecked(true); + cylinderCB->setChecked(true); + cuboidCB->setChecked(true); + sphereCB->setChecked(true); + + // Show window + widget->show(); + widget->resize(1280, 600); + + // Update the aspect ratio + QSize widgetSize = container->size(); + float aspectRatio = float(widgetSize.width()) / float(widgetSize.height()); + cameraEntity->lens()->setPerspectiveProjection(45.0f, aspectRatio, 0.1f, 1000.0f); + + return app.exec(); +} diff --git a/examples/qt3d/basicshapes-cpp/scenemodifier.cpp b/examples/qt3d/basicshapes-cpp/scenemodifier.cpp new file mode 100644 index 000000000..030db1596 --- /dev/null +++ b/examples/qt3d/basicshapes-cpp/scenemodifier.cpp @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** 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 "scenemodifier.h" + +#include + +SceneModifier::SceneModifier(Qt3D::QEntity *rootEntity) + : m_rootEntity(rootEntity) +{ + // Torus shape data + m_torus = new Qt3D::QTorusMesh(); + m_torus->setRadius(1.0f); + m_torus->setMinorRadius(0.4f); + m_torus->setRings(100); + m_torus->setSlices(20); + + // TorusMesh Transform + Qt3D::QScaleTransform *torusScale = new Qt3D::QScaleTransform(); + Qt3D::QTranslateTransform *torusTranslation = new Qt3D::QTranslateTransform(); + Qt3D::QRotateTransform *torusRotation = new Qt3D::QRotateTransform(); + Qt3D::QTransform *torusTransforms = new Qt3D::QTransform(); + + torusScale->setScale3D(QVector3D(2.0f, 2.0f, 2.0f)); + torusTranslation->setTranslation(QVector3D(1.7f, 1.7f, 0.0f)); + torusRotation->setAngleDeg(25.0f); + torusRotation->setAxis(QVector3D(0, 1, 0)); + + torusTransforms->addTransform(torusRotation); + torusTransforms->addTransform(torusTranslation); + torusTransforms->addTransform(torusScale); + + Qt3D::QPhongMaterial *torusMaterial = new Qt3D::QPhongMaterial(); + torusMaterial->setDiffuse(QColor(QRgb(0xbeb32b))); + + // Torus + m_torusEntity = new Qt3D::QEntity(m_rootEntity); + m_torusEntity->addComponent(m_torus); + m_torusEntity->addComponent(torusMaterial); + m_torusEntity->addComponent(torusTransforms); + + // Cylinder shape data + Qt3D::QCylinderMesh *cylinder = new Qt3D::QCylinderMesh(); + cylinder->setRadius(1); + cylinder->setLength(3); + cylinder->setRings(100); + cylinder->setSlices(20); + + // CylinderMesh Transform + Qt3D::QScaleTransform *cylinderScale = new Qt3D::QScaleTransform(); + Qt3D::QRotateTransform *cylinderRotation = new Qt3D::QRotateTransform(); + Qt3D::QTranslateTransform *cylinderTranslation = new Qt3D::QTranslateTransform(); + Qt3D::QTransform *cylinderTransforms = new Qt3D::QTransform(); + + cylinderScale->setScale3D(QVector3D(1.5f, 1.5f, 1.5f)); + cylinderTranslation->setTranslation(QVector3D(-2.6f, 2.4f, -1.5)); + cylinderRotation->setAngleDeg(45.0f); + cylinderRotation->setAxis(QVector3D(1, 0, 0)); + + cylinderTransforms->addTransform(cylinderTranslation); + cylinderTransforms->addTransform(cylinderRotation); + cylinderTransforms->addTransform(cylinderScale); + + Qt3D::QPhongMaterial *cylinderMaterial = new Qt3D::QPhongMaterial(); + cylinderMaterial->setDiffuse(QColor(QRgb(0x928327))); + + // Cylinder + m_cylinderEntity = new Qt3D::QEntity(m_rootEntity); + m_cylinderEntity->addComponent(cylinder); + m_cylinderEntity->addComponent(cylinderMaterial); + m_cylinderEntity->addComponent(cylinderTransforms); + + // Cuboid shape data + Qt3D::QCuboidMesh *cuboid = new Qt3D::QCuboidMesh(); + + // CuboidMesh Transform + Qt3D::QScaleTransform *cuboidScale = new Qt3D::QScaleTransform(); + Qt3D::QTranslateTransform *cuboidTranslation = new Qt3D::QTranslateTransform(); + Qt3D::QTransform *cuboidTransforms = new Qt3D::QTransform(); + + cuboidScale->setScale3D(QVector3D(4.0f, 4.0f, 4.0f)); + cuboidTranslation->setTranslation(QVector3D(0.9f, -0.9f, 0.0f)); + + cuboidTransforms->addTransform(cuboidTranslation); + cuboidTransforms->addTransform(cuboidScale); + + Qt3D::QPhongMaterial *cuboidMaterial = new Qt3D::QPhongMaterial(); + cuboidMaterial->setDiffuse(QColor(QRgb(0x665423))); + + //Cuboid + m_cuboidEntity = new Qt3D::QEntity(m_rootEntity); + m_cuboidEntity->addComponent(cuboid); + m_cuboidEntity->addComponent(cuboidMaterial); + m_cuboidEntity->addComponent(cuboidTransforms); + + // Sphere shape data + Qt3D::QSphereMesh *sphereMesh = new Qt3D::QSphereMesh(); + sphereMesh->setRings(20); + sphereMesh->setSlices(20); + sphereMesh->setRadius(2); + + // Sphere mesh transform + Qt3D::QScaleTransform *sphereScale = new Qt3D::QScaleTransform(); + Qt3D::QTranslateTransform *sphereTranslation = new Qt3D::QTranslateTransform(); + Qt3D::QTransform *sphereTransforms = new Qt3D::QTransform(); + + sphereScale->setScale3D(QVector3D(1.3f, 1.3f, 1.3f)); + sphereTranslation->setTranslation(QVector3D(-2.9f, -2.9f, 0.0f)); + + sphereTransforms->addTransform(sphereTranslation); + sphereTransforms->addTransform(sphereScale); + + Qt3D::QPhongMaterial *sphereMaterial = new Qt3D::QPhongMaterial(); + sphereMaterial->setDiffuse(QColor(QRgb(0xa69929))); + + // Sphere + m_sphereEntity = new Qt3D::QEntity(m_rootEntity); + m_sphereEntity->addComponent(sphereMesh); + m_sphereEntity->addComponent(sphereMaterial); + m_sphereEntity->addComponent(sphereTransforms); +} + +SceneModifier::~SceneModifier() +{ +} + +void SceneModifier::enableTorus(bool enabled) +{ + m_torusEntity->setParent(enabled ? m_rootEntity : Q_NULLPTR); +} + +void SceneModifier::enableCylinder(bool enabled) +{ + m_cylinderEntity->setParent(enabled ? m_rootEntity : Q_NULLPTR); +} + +void SceneModifier::enableCuboid(bool enabled) +{ + m_cuboidEntity->setParent(enabled ? m_rootEntity : Q_NULLPTR); +} + +void SceneModifier::enableSphere(bool enabled) +{ + m_sphereEntity->setParent(enabled ? m_rootEntity : Q_NULLPTR); +} diff --git a/examples/qt3d/basicshapes-cpp/scenemodifier.h b/examples/qt3d/basicshapes-cpp/scenemodifier.h new file mode 100644 index 000000000..ba4718401 --- /dev/null +++ b/examples/qt3d/basicshapes-cpp/scenemodifier.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** 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 SCENEMODIFIER_H +#define SCENEMODIFIER_H + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class SceneModifier : public QObject +{ + Q_OBJECT + +public: + explicit SceneModifier(Qt3D::QEntity *rootEntity); + ~SceneModifier(); + +public slots: + void enableTorus(bool enabled); + void enableCylinder(bool enabled); + void enableCuboid(bool enabled); + void enableSphere(bool enabled); + +private: + Qt3D::QEntity *m_rootEntity; + Qt3D::QTorusMesh *m_torus; + Qt3D::QEntity *m_cylinderEntity; + Qt3D::QEntity *m_torusEntity; + Qt3D::QEntity *m_cuboidEntity; + Qt3D::QEntity *m_sphereEntity; +}; + +#endif // SCENEMODIFIER_H + diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro index 5882ad38b..2894e4760 100644 --- a/examples/qt3d/qt3d.pro +++ b/examples/qt3d/qt3d.pro @@ -9,7 +9,6 @@ SUBDIRS += \ cpp_example \ multiviewport \ torus-qml \ - torus-cpp \ cylinder-qml \ cylinder-cpp \ bigmodel-qml \ @@ -34,4 +33,5 @@ SUBDIRS += \ # TODO Port the old examples to new APIs #SUBDIRS += qt3d -qtHaveModule(widgets): SUBDIRS += assimp-cpp +qtHaveModule(widgets): SUBDIRS += assimp-cpp \ + basicshapes-cpp diff --git a/examples/qt3d/torus-cpp/doc/src/torus-cpp.qdoc b/examples/qt3d/torus-cpp/doc/src/torus-cpp.qdoc deleted file mode 100644 index 76f6d9782..000000000 --- a/examples/qt3d/torus-cpp/doc/src/torus-cpp.qdoc +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example torus-cpp - \title Qt3D: Torus C++ Example - \ingroup qt3d-examples-cpp -*/ diff --git a/examples/qt3d/torus-cpp/main.cpp b/examples/qt3d/torus-cpp/main.cpp deleted file mode 100644 index b2cf5b24b..000000000 --- a/examples/qt3d/torus-cpp/main.cpp +++ /dev/null @@ -1,134 +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 - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -int main(int argc, char **argv) -{ - QGuiApplication app(argc, argv); - - Qt3D::Window view; - Qt3D::QAspectEngine engine; - engine.registerAspect(new Qt3D::QRenderAspect()); - Qt3D::QInputAspect *input = new Qt3D::QInputAspect; - engine.registerAspect(input); - engine.initialize(); - QVariantMap data; - data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast(&view))); - data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view)); - engine.setData(data); - - // Root entity - Qt3D::QEntity *rootEntity = new Qt3D::QEntity(); - - // Camera - Qt3D::QCamera *cameraEntity = new Qt3D::QCamera(rootEntity); - cameraEntity->setObjectName(QStringLiteral("cameraEntity")); - - cameraEntity->lens()->setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f); - cameraEntity->setPosition(QVector3D(0, 0, -20.0f)); - cameraEntity->setUpVector(QVector3D(0, 1, 0)); - cameraEntity->setViewCenter(QVector3D(0, 0, 0)); - input->setCamera(cameraEntity); - - // FrameGraph - Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph(); - Qt3D::QForwardRenderer *forwardRenderer = new Qt3D::QForwardRenderer(); - - forwardRenderer->setCamera(cameraEntity); - forwardRenderer->setClearColor(Qt::black); - frameGraph->setActiveFrameGraph(forwardRenderer); - - // Torus shape data - Qt3D::QTorusMesh *torus = new Qt3D::QTorusMesh(); - torus->setRadius(5); - torus->setMinorRadius(1); - torus->setRings(100); - torus->setSlices(20); - - // TorusMesh Transform - Qt3D::QScaleTransform *torusScale = new Qt3D::QScaleTransform(); - Qt3D::QRotateTransform *torusRotation = new Qt3D::QRotateTransform(); - Qt3D::QTransform *torusTransforms = new Qt3D::QTransform(); - - torusScale->setScale3D(QVector3D(1.5f, 1.0f, 0.5f)); - torusRotation->setAngleDeg(45.0f); - torusRotation->setAxis(QVector3D(1, 0, 0)); - - torusTransforms->addTransform(torusScale); - torusTransforms->addTransform(torusRotation); - - // Torus - Qt3D::QEntity *torusEntity = new Qt3D::QEntity(rootEntity); - torusEntity->addComponent(torus); - torusEntity->addComponent(torusTransforms); - - // Setting the FrameGraph - rootEntity->addComponent(frameGraph); - - // Set root object of the scene - engine.setRootEntity(rootEntity); - // Show window - view.show(); - - return app.exec(); -} diff --git a/examples/qt3d/torus-cpp/torus-cpp.pro b/examples/qt3d/torus-cpp/torus-cpp.pro deleted file mode 100644 index eeefc5c22..000000000 --- a/examples/qt3d/torus-cpp/torus-cpp.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -QT += 3dcore 3drenderer 3dinput - -SOURCES += main.cpp - - -- cgit v1.2.3 From 09a701b0aecd199a210df971fb0f13bd37c24430 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 9 Jun 2015 08:40:41 +0100 Subject: Fix cmake unit test for Qt3D Task-number: QTBUG-46592 Change-Id: Ib28a8fcf2c0e692dd10227f9a9e3c6a10a7fcdbd Reviewed-by: Giuseppe D'Angelo --- tests/auto/auto.pro | 5 ++++- tests/auto/cmake/CMakeLists.txt | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 43811f84e..8326d90b6 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -3,4 +3,7 @@ TEMPLATE = subdirs SUBDIRS = \ core \ render \ - quick3d + quick3d \ + cmake + +installed_cmake.depends = cmake diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index dfd0cba9a..b68e55708 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -9,7 +9,10 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") +set(QAspectEngine_NAMESPACE Qt3D) +set(QMesh_NAMESPACE Qt3D) + test_module_includes( - 3dcore QAspectEngine - 3drenderer Mesh + 3DCore QAspectEngine + 3DRenderer QMesh ) -- cgit v1.2.3 From b21dfb2db3b48192e05dfdca9fdb85ed4bca02f2 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 11 Jun 2015 14:55:32 +0100 Subject: Use Qt3D.Renderer rather than Render This should make the documentation and code terminology consistent throughout. We can rename the source directories at a later date if needed. Task-number: QTBUG-46622 Change-Id: I2737e54192341808f4a0270ad19ba70f6c4af589 Reviewed-by: Kai Koehne Reviewed-by: Giuseppe D'Angelo --- examples/qt3d/anaglyph-rendering/StereoCamera.qml | 2 +- .../qt3d/anaglyph-rendering/StereoFrameGraph.qml | 2 +- examples/qt3d/anaglyph-rendering/main.qml | 2 +- examples/qt3d/assimp/main.qml | 2 +- examples/qt3d/bigmodel-qml/MyEntity.qml | 2 +- examples/qt3d/bigmodel-qml/main.qml | 2 +- examples/qt3d/controls/Logo.qml | 2 +- examples/qt3d/cylinder-qml/main.qml | 2 +- .../deferred-renderer-qml/DeferredRenderer.qml | 2 +- .../qt3d/deferred-renderer-qml/FinalEffect.qml | 2 +- examples/qt3d/deferred-renderer-qml/GBuffer.qml | 2 +- .../qt3d/deferred-renderer-qml/SceneEffect.qml | 2 +- examples/qt3d/deferred-renderer-qml/main.qml | 2 +- examples/qt3d/enabled-qml/main.qml | 2 +- examples/qt3d/gltf/main.qml | 2 +- examples/qt3d/keyboardinput-qml/main.qml | 2 +- examples/qt3d/loader-qml/CuboidEntity.qml | 2 +- examples/qt3d/loader-qml/SphereEntity.qml | 2 +- examples/qt3d/loader-qml/main.qml | 2 +- examples/qt3d/materials/Barrel.qml | 2 +- examples/qt3d/materials/BasicCamera.qml | 2 +- examples/qt3d/materials/Chest.qml | 2 +- examples/qt3d/materials/HousePlant.qml | 2 +- examples/qt3d/materials/PlaneEntity.qml | 2 +- examples/qt3d/materials/RenderableEntity.qml | 2 +- examples/qt3d/materials/SortedForwardRenderer.qml | 2 +- examples/qt3d/materials/TrefoilKnot.qml | 2 +- examples/qt3d/materials/main.qml | 2 +- examples/qt3d/multiviewport/main.qml | 2 +- examples/qt3d/playground-qml/AdsEffect.qml | 2 +- .../playground-qml/AnimatedDiffuseMaterial.qml | 2 +- examples/qt3d/playground-qml/ComplexTechnique.qml | 2 +- examples/qt3d/playground-qml/DetailView.qml | 2 +- examples/qt3d/playground-qml/MainView.qml | 2 +- examples/qt3d/playground-qml/MyForwardRenderer.qml | 2 +- examples/qt3d/playground-qml/RenderableEntity.qml | 2 +- examples/qt3d/playground-qml/main.qml | 2 +- examples/qt3d/scene3d/AnimatedEntity.qml | 2 +- examples/qt3d/shadow-map-qml/AdsEffect.qml | 2 +- examples/qt3d/shadow-map-qml/AdsMaterial.qml | 2 +- examples/qt3d/shadow-map-qml/GroundPlane.qml | 2 +- examples/qt3d/shadow-map-qml/Light.qml | 2 +- .../qt3d/shadow-map-qml/ShadowMapFrameGraph.qml | 2 +- examples/qt3d/shadow-map-qml/Toyplane.qml | 2 +- examples/qt3d/shadow-map-qml/Trefoil.qml | 2 +- examples/qt3d/shadow-map-qml/main.qml | 2 +- examples/qt3d/simple-qml/main.qml | 2 +- examples/qt3d/simple-shaders-qml/main.qml | 2 +- examples/qt3d/skybox/Skybox.qml | 2 +- examples/qt3d/skybox/main.qml | 2 +- examples/qt3d/tessellation-modes/BasicCamera.qml | 2 +- .../qt3d/tessellation-modes/TessellatedQuad.qml | 2 +- .../TessellatedWireframeEffect.qml | 2 +- .../TessellatedWireframeMaterial.qml | 2 +- examples/qt3d/tessellation-modes/main.qml | 2 +- examples/qt3d/torus-qml/main.qml | 2 +- examples/qt3d/wave/Background.qml | 2 +- examples/qt3d/wave/BackgroundEffect.qml | 2 +- examples/qt3d/wave/BasicCamera.qml | 2 +- examples/qt3d/wave/Wave.qml | 2 +- examples/qt3d/wave/WaveEffect.qml | 2 +- examples/qt3d/wave/WaveForwardRenderer.qml | 2 +- examples/qt3d/wave/WaveMaterial.qml | 2 +- examples/qt3d/wave/main.qml | 2 +- examples/qt3d/wireframe/BasicCamera.qml | 2 +- examples/qt3d/wireframe/TrefoilKnot.qml | 2 +- examples/qt3d/wireframe/WireframeEffect.qml | 2 +- examples/qt3d/wireframe/WireframeMaterial.qml | 2 +- examples/qt3d/wireframe/main.qml | 2 +- src/quick3d/imports/render/defaults/defaults.pri | 2 +- .../render/defaults/qml/DiffuseMapMaterial.qml | 2 +- .../defaults/qml/DiffuseSpecularMapMaterial.qml | 2 +- .../render/defaults/qml/ForwardRenderer.qml | 2 +- .../defaults/qml/NormalDiffuseMapAlphaMaterial.qml | 2 +- .../defaults/qml/NormalDiffuseMapMaterial.qml | 2 +- .../qml/NormalDiffuseSpecularMapMaterial.qml | 2 +- .../render/defaults/qml/PerVertexColorMaterial.qml | 2 +- .../imports/render/defaults/qml/PhongMaterial.qml | 2 +- .../imports/render/defaults/qml/SkyboxEntity.qml | 2 +- src/quick3d/imports/render/importsrender.pro | 8 +- src/quick3d/imports/render/qmldir | 6 +- .../imports/render/qt3dquick3drendererplugin.cpp | 253 +++++++++++++++++++++ .../imports/render/qt3dquick3drendererplugin.h | 54 +++++ .../imports/render/qt3dquick3drenderplugin.cpp | 253 --------------------- .../imports/render/qt3dquick3drenderplugin.h | 54 ----- .../frontend/framegraph-components/qframegraph.cpp | 4 +- .../framegraph-components/qframegraphnode.cpp | 4 +- .../framegraph-components/qlayerfilter.cpp | 4 +- src/render/frontend/qabstracttextureimage.cpp | 6 +- src/render/frontend/qannotation.cpp | 6 +- src/render/frontend/qblendstate.cpp | 4 +- src/render/frontend/qlayer.cpp | 4 +- src/render/frontend/qopenglfilter.cpp | 14 +- src/render/frontend/qparametermapping.cpp | 8 +- src/render/frontend/qpointlight.cpp | 2 +- src/render/frontend/qspotlight.cpp | 6 +- src/render/frontend/qtextureimage.cpp | 4 +- src/render/renderlogging.cpp | 20 +- 98 files changed, 436 insertions(+), 436 deletions(-) create mode 100644 src/quick3d/imports/render/qt3dquick3drendererplugin.cpp create mode 100644 src/quick3d/imports/render/qt3dquick3drendererplugin.h delete mode 100644 src/quick3d/imports/render/qt3dquick3drenderplugin.cpp delete mode 100644 src/quick3d/imports/render/qt3dquick3drenderplugin.h diff --git a/examples/qt3d/anaglyph-rendering/StereoCamera.qml b/examples/qt3d/anaglyph-rendering/StereoCamera.qml index c91d81ddf..3098ba367 100644 --- a/examples/qt3d/anaglyph-rendering/StereoCamera.qml +++ b/examples/qt3d/anaglyph-rendering/StereoCamera.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml b/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml index 46164fc60..b958255ee 100644 --- a/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml +++ b/examples/qt3d/anaglyph-rendering/StereoFrameGraph.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Viewport { diff --git a/examples/qt3d/anaglyph-rendering/main.qml b/examples/qt3d/anaglyph-rendering/main.qml index bf1dd211c..aaa253f3c 100644 --- a/examples/qt3d/anaglyph-rendering/main.qml +++ b/examples/qt3d/anaglyph-rendering/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.4 as QQ2 Entity { diff --git a/examples/qt3d/assimp/main.qml b/examples/qt3d/assimp/main.qml index f9807491c..6ebbe8afd 100644 --- a/examples/qt3d/assimp/main.qml +++ b/examples/qt3d/assimp/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { diff --git a/examples/qt3d/bigmodel-qml/MyEntity.qml b/examples/qt3d/bigmodel-qml/MyEntity.qml index fd30c1071..8e0e819bc 100644 --- a/examples/qt3d/bigmodel-qml/MyEntity.qml +++ b/examples/qt3d/bigmodel-qml/MyEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/bigmodel-qml/main.qml b/examples/qt3d/bigmodel-qml/main.qml index 9d6a16264..704d17872 100644 --- a/examples/qt3d/bigmodel-qml/main.qml +++ b/examples/qt3d/bigmodel-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 Entity { diff --git a/examples/qt3d/controls/Logo.qml b/examples/qt3d/controls/Logo.qml index 7d85ee941..bcd7a4359 100644 --- a/examples/qt3d/controls/Logo.qml +++ b/examples/qt3d/controls/Logo.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.0 Entity { diff --git a/examples/qt3d/cylinder-qml/main.qml b/examples/qt3d/cylinder-qml/main.qml index 282826116..4c5e5e4e7 100644 --- a/examples/qt3d/cylinder-qml/main.qml +++ b/examples/qt3d/cylinder-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: sceneRoot diff --git a/examples/qt3d/deferred-renderer-qml/DeferredRenderer.qml b/examples/qt3d/deferred-renderer-qml/DeferredRenderer.qml index d95402cb9..82401fe66 100644 --- a/examples/qt3d/deferred-renderer-qml/DeferredRenderer.qml +++ b/examples/qt3d/deferred-renderer-qml/DeferredRenderer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Viewport { rect : Qt.rect(0.0, 0.0, 1.0, 1.0) diff --git a/examples/qt3d/deferred-renderer-qml/FinalEffect.qml b/examples/qt3d/deferred-renderer-qml/FinalEffect.qml index f46e65c12..07dbdffa5 100644 --- a/examples/qt3d/deferred-renderer-qml/FinalEffect.qml +++ b/examples/qt3d/deferred-renderer-qml/FinalEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { techniques : [ diff --git a/examples/qt3d/deferred-renderer-qml/GBuffer.qml b/examples/qt3d/deferred-renderer-qml/GBuffer.qml index 309cec160..94c889be1 100644 --- a/examples/qt3d/deferred-renderer-qml/GBuffer.qml +++ b/examples/qt3d/deferred-renderer-qml/GBuffer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 RenderTarget { diff --git a/examples/qt3d/deferred-renderer-qml/SceneEffect.qml b/examples/qt3d/deferred-renderer-qml/SceneEffect.qml index e4cfdf8c5..589a4ac37 100644 --- a/examples/qt3d/deferred-renderer-qml/SceneEffect.qml +++ b/examples/qt3d/deferred-renderer-qml/SceneEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { id : sceneMaterialEffect diff --git a/examples/qt3d/deferred-renderer-qml/main.qml b/examples/qt3d/deferred-renderer-qml/main.qml index d70619baa..4b9ee9a28 100644 --- a/examples/qt3d/deferred-renderer-qml/main.qml +++ b/examples/qt3d/deferred-renderer-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.0 as QQ2 Entity { diff --git a/examples/qt3d/enabled-qml/main.qml b/examples/qt3d/enabled-qml/main.qml index 031759556..a7cb5ed45 100644 --- a/examples/qt3d/enabled-qml/main.qml +++ b/examples/qt3d/enabled-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.0 as QQ2 Entity { diff --git a/examples/qt3d/gltf/main.qml b/examples/qt3d/gltf/main.qml index 3fd8ca398..acce5d7ac 100644 --- a/examples/qt3d/gltf/main.qml +++ b/examples/qt3d/gltf/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/keyboardinput-qml/main.qml b/examples/qt3d/keyboardinput-qml/main.qml index ef5afd077..100773280 100644 --- a/examples/qt3d/keyboardinput-qml/main.qml +++ b/examples/qt3d/keyboardinput-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import Qt3D.Input 2.0 Entity { diff --git a/examples/qt3d/loader-qml/CuboidEntity.qml b/examples/qt3d/loader-qml/CuboidEntity.qml index d05e47a57..9de96e1a3 100644 --- a/examples/qt3d/loader-qml/CuboidEntity.qml +++ b/examples/qt3d/loader-qml/CuboidEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { components: [ mesh, material, transform ] diff --git a/examples/qt3d/loader-qml/SphereEntity.qml b/examples/qt3d/loader-qml/SphereEntity.qml index fe36c1467..2825b8253 100644 --- a/examples/qt3d/loader-qml/SphereEntity.qml +++ b/examples/qt3d/loader-qml/SphereEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { components: [ mesh, material ] diff --git a/examples/qt3d/loader-qml/main.qml b/examples/qt3d/loader-qml/main.qml index fa3e8ff5a..76eb524ec 100644 --- a/examples/qt3d/loader-qml/main.qml +++ b/examples/qt3d/loader-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 Entity { diff --git a/examples/qt3d/materials/Barrel.qml b/examples/qt3d/materials/Barrel.qml index 1dcec0ca1..a79cffbc1 100644 --- a/examples/qt3d/materials/Barrel.qml +++ b/examples/qt3d/materials/Barrel.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/BasicCamera.qml b/examples/qt3d/materials/BasicCamera.qml index f96132416..e8a8bd7f4 100644 --- a/examples/qt3d/materials/BasicCamera.qml +++ b/examples/qt3d/materials/BasicCamera.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Camera { id: mainCamera diff --git a/examples/qt3d/materials/Chest.qml b/examples/qt3d/materials/Chest.qml index 1acd126ff..a8ef6b3f5 100644 --- a/examples/qt3d/materials/Chest.qml +++ b/examples/qt3d/materials/Chest.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/HousePlant.qml b/examples/qt3d/materials/HousePlant.qml index 353a252d2..1f2a759af 100644 --- a/examples/qt3d/materials/HousePlant.qml +++ b/examples/qt3d/materials/HousePlant.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/PlaneEntity.qml b/examples/qt3d/materials/PlaneEntity.qml index 222b5a33b..6e1f1925e 100644 --- a/examples/qt3d/materials/PlaneEntity.qml +++ b/examples/qt3d/materials/PlaneEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/RenderableEntity.qml b/examples/qt3d/materials/RenderableEntity.qml index 03119b713..60b62a05b 100644 --- a/examples/qt3d/materials/RenderableEntity.qml +++ b/examples/qt3d/materials/RenderableEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/SortedForwardRenderer.qml b/examples/qt3d/materials/SortedForwardRenderer.qml index 0687785fb..13e79800f 100644 --- a/examples/qt3d/materials/SortedForwardRenderer.qml +++ b/examples/qt3d/materials/SortedForwardRenderer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 TechniqueFilter { id: root diff --git a/examples/qt3d/materials/TrefoilKnot.qml b/examples/qt3d/materials/TrefoilKnot.qml index 48b334ce0..51b2409b3 100644 --- a/examples/qt3d/materials/TrefoilKnot.qml +++ b/examples/qt3d/materials/TrefoilKnot.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/materials/main.qml b/examples/qt3d/materials/main.qml index cceac110b..2a3190640 100644 --- a/examples/qt3d/materials/main.qml +++ b/examples/qt3d/materials/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/multiviewport/main.qml b/examples/qt3d/multiviewport/main.qml index c5ad221dd..c5606fd25 100644 --- a/examples/qt3d/multiviewport/main.qml +++ b/examples/qt3d/multiviewport/main.qml @@ -36,7 +36,7 @@ import QtQuick 2.0 import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { diff --git a/examples/qt3d/playground-qml/AdsEffect.qml b/examples/qt3d/playground-qml/AdsEffect.qml index 4bc81ca44..958d69768 100644 --- a/examples/qt3d/playground-qml/AdsEffect.qml +++ b/examples/qt3d/playground-qml/AdsEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 // For Qt.vector3d() and friends. For some reason this is provided by // QQuickValueTypeProvider in QtQuick rather than the default value diff --git a/examples/qt3d/playground-qml/AnimatedDiffuseMaterial.qml b/examples/qt3d/playground-qml/AnimatedDiffuseMaterial.qml index 50605baee..f376baf31 100644 --- a/examples/qt3d/playground-qml/AnimatedDiffuseMaterial.qml +++ b/examples/qt3d/playground-qml/AnimatedDiffuseMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 Material { diff --git a/examples/qt3d/playground-qml/ComplexTechnique.qml b/examples/qt3d/playground-qml/ComplexTechnique.qml index 9bc3cad58..8d7395786 100644 --- a/examples/qt3d/playground-qml/ComplexTechnique.qml +++ b/examples/qt3d/playground-qml/ComplexTechnique.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Technique { annotations : [ diff --git a/examples/qt3d/playground-qml/DetailView.qml b/examples/qt3d/playground-qml/DetailView.qml index 92a2f3a1f..f0fc20d38 100644 --- a/examples/qt3d/playground-qml/DetailView.qml +++ b/examples/qt3d/playground-qml/DetailView.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { diff --git a/examples/qt3d/playground-qml/MainView.qml b/examples/qt3d/playground-qml/MainView.qml index 0f115d397..8e477f698 100644 --- a/examples/qt3d/playground-qml/MainView.qml +++ b/examples/qt3d/playground-qml/MainView.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.0 as QQ2 Entity { diff --git a/examples/qt3d/playground-qml/MyForwardRenderer.qml b/examples/qt3d/playground-qml/MyForwardRenderer.qml index b4b412e77..0c9d08c62 100644 --- a/examples/qt3d/playground-qml/MyForwardRenderer.qml +++ b/examples/qt3d/playground-qml/MyForwardRenderer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 TechniqueFilter { id: root diff --git a/examples/qt3d/playground-qml/RenderableEntity.qml b/examples/qt3d/playground-qml/RenderableEntity.qml index 13be8f1f9..bdb1f22b9 100644 --- a/examples/qt3d/playground-qml/RenderableEntity.qml +++ b/examples/qt3d/playground-qml/RenderableEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { property Transform transform; diff --git a/examples/qt3d/playground-qml/main.qml b/examples/qt3d/playground-qml/main.qml index a5605f762..09a784955 100644 --- a/examples/qt3d/playground-qml/main.qml +++ b/examples/qt3d/playground-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import Qt3D.Input 2.0 import QtQuick 2.2 as QQ2 diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml index 72d9787d6..180907113 100644 --- a/examples/qt3d/scene3d/AnimatedEntity.qml +++ b/examples/qt3d/scene3d/AnimatedEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.0 as QQ2 diff --git a/examples/qt3d/shadow-map-qml/AdsEffect.qml b/examples/qt3d/shadow-map-qml/AdsEffect.qml index 1ddc58f3b..a54f32d13 100644 --- a/examples/qt3d/shadow-map-qml/AdsEffect.qml +++ b/examples/qt3d/shadow-map-qml/AdsEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { id: root diff --git a/examples/qt3d/shadow-map-qml/AdsMaterial.qml b/examples/qt3d/shadow-map-qml/AdsMaterial.qml index 322c7b9ac..93708cbe9 100644 --- a/examples/qt3d/shadow-map-qml/AdsMaterial.qml +++ b/examples/qt3d/shadow-map-qml/AdsMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 Material { diff --git a/examples/qt3d/shadow-map-qml/GroundPlane.qml b/examples/qt3d/shadow-map-qml/GroundPlane.qml index b863da3b5..e126547b5 100644 --- a/examples/qt3d/shadow-map-qml/GroundPlane.qml +++ b/examples/qt3d/shadow-map-qml/GroundPlane.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/shadow-map-qml/Light.qml b/examples/qt3d/shadow-map-qml/Light.qml index ca03f070f..e4a87830a 100644 --- a/examples/qt3d/shadow-map-qml/Light.qml +++ b/examples/qt3d/shadow-map-qml/Light.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml b/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml index b6932a76d..84dcd1f24 100644 --- a/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml +++ b/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 FrameGraph { diff --git a/examples/qt3d/shadow-map-qml/Toyplane.qml b/examples/qt3d/shadow-map-qml/Toyplane.qml index 61c803469..3ac2b64ce 100644 --- a/examples/qt3d/shadow-map-qml/Toyplane.qml +++ b/examples/qt3d/shadow-map-qml/Toyplane.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/shadow-map-qml/Trefoil.qml b/examples/qt3d/shadow-map-qml/Trefoil.qml index 341ee6c23..9eefd425e 100644 --- a/examples/qt3d/shadow-map-qml/Trefoil.qml +++ b/examples/qt3d/shadow-map-qml/Trefoil.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/shadow-map-qml/main.qml b/examples/qt3d/shadow-map-qml/main.qml index 59040c39b..8bc021760 100644 --- a/examples/qt3d/shadow-map-qml/main.qml +++ b/examples/qt3d/shadow-map-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: sceneRoot diff --git a/examples/qt3d/simple-qml/main.qml b/examples/qt3d/simple-qml/main.qml index c82bafaa3..9d9038d7d 100644 --- a/examples/qt3d/simple-qml/main.qml +++ b/examples/qt3d/simple-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 Entity { diff --git a/examples/qt3d/simple-shaders-qml/main.qml b/examples/qt3d/simple-shaders-qml/main.qml index 22b6322be..89c2270e3 100644 --- a/examples/qt3d/simple-shaders-qml/main.qml +++ b/examples/qt3d/simple-shaders-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.2 as QQ2 Entity { diff --git a/examples/qt3d/skybox/Skybox.qml b/examples/qt3d/skybox/Skybox.qml index 49d269bf5..f396484bc 100644 --- a/examples/qt3d/skybox/Skybox.qml +++ b/examples/qt3d/skybox/Skybox.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { diff --git a/examples/qt3d/skybox/main.qml b/examples/qt3d/skybox/main.qml index fbb3c90d0..e84d027d6 100644 --- a/examples/qt3d/skybox/main.qml +++ b/examples/qt3d/skybox/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/tessellation-modes/BasicCamera.qml b/examples/qt3d/tessellation-modes/BasicCamera.qml index 062c84eff..385b40397 100644 --- a/examples/qt3d/tessellation-modes/BasicCamera.qml +++ b/examples/qt3d/tessellation-modes/BasicCamera.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Camera { diff --git a/examples/qt3d/tessellation-modes/TessellatedQuad.qml b/examples/qt3d/tessellation-modes/TessellatedQuad.qml index b6c3122a9..39199af10 100644 --- a/examples/qt3d/tessellation-modes/TessellatedQuad.qml +++ b/examples/qt3d/tessellation-modes/TessellatedQuad.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import Qt3D.Examples 1.0 import QtQuick 2.1 as QQ2 diff --git a/examples/qt3d/tessellation-modes/TessellatedWireframeEffect.qml b/examples/qt3d/tessellation-modes/TessellatedWireframeEffect.qml index 0b51fde2a..57d9a0b4d 100644 --- a/examples/qt3d/tessellation-modes/TessellatedWireframeEffect.qml +++ b/examples/qt3d/tessellation-modes/TessellatedWireframeEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 Effect { diff --git a/examples/qt3d/tessellation-modes/TessellatedWireframeMaterial.qml b/examples/qt3d/tessellation-modes/TessellatedWireframeMaterial.qml index d66ad740c..c812e2295 100644 --- a/examples/qt3d/tessellation-modes/TessellatedWireframeMaterial.qml +++ b/examples/qt3d/tessellation-modes/TessellatedWireframeMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Material { diff --git a/examples/qt3d/tessellation-modes/main.qml b/examples/qt3d/tessellation-modes/main.qml index 425ca40de..864081cb5 100644 --- a/examples/qt3d/tessellation-modes/main.qml +++ b/examples/qt3d/tessellation-modes/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/torus-qml/main.qml b/examples/qt3d/torus-qml/main.qml index 05398d10b..47ad51c83 100644 --- a/examples/qt3d/torus-qml/main.qml +++ b/examples/qt3d/torus-qml/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: sceneRoot diff --git a/examples/qt3d/wave/Background.qml b/examples/qt3d/wave/Background.qml index d25edfabf..b9005c2b4 100644 --- a/examples/qt3d/wave/Background.qml +++ b/examples/qt3d/wave/Background.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/examples/qt3d/wave/BackgroundEffect.qml b/examples/qt3d/wave/BackgroundEffect.qml index be02664f7..ad2170d47 100644 --- a/examples/qt3d/wave/BackgroundEffect.qml +++ b/examples/qt3d/wave/BackgroundEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { id: root diff --git a/examples/qt3d/wave/BasicCamera.qml b/examples/qt3d/wave/BasicCamera.qml index 740dd54ce..df21bcd5d 100644 --- a/examples/qt3d/wave/BasicCamera.qml +++ b/examples/qt3d/wave/BasicCamera.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Camera { id: mainCamera diff --git a/examples/qt3d/wave/Wave.qml b/examples/qt3d/wave/Wave.qml index 023631b9e..72badde5f 100644 --- a/examples/qt3d/wave/Wave.qml +++ b/examples/qt3d/wave/Wave.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/wave/WaveEffect.qml b/examples/qt3d/wave/WaveEffect.qml index bca3737b8..4391d71c2 100644 --- a/examples/qt3d/wave/WaveEffect.qml +++ b/examples/qt3d/wave/WaveEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { id: root diff --git a/examples/qt3d/wave/WaveForwardRenderer.qml b/examples/qt3d/wave/WaveForwardRenderer.qml index 9f8031668..49e6be22b 100644 --- a/examples/qt3d/wave/WaveForwardRenderer.qml +++ b/examples/qt3d/wave/WaveForwardRenderer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 TechniqueFilter { id: root diff --git a/examples/qt3d/wave/WaveMaterial.qml b/examples/qt3d/wave/WaveMaterial.qml index 1417b54cb..c1dda4695 100644 --- a/examples/qt3d/wave/WaveMaterial.qml +++ b/examples/qt3d/wave/WaveMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/examples/qt3d/wave/main.qml b/examples/qt3d/wave/main.qml index b2e0c1bff..0836cecd1 100644 --- a/examples/qt3d/wave/main.qml +++ b/examples/qt3d/wave/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import Qt3D.Input 2.0 Entity { diff --git a/examples/qt3d/wireframe/BasicCamera.qml b/examples/qt3d/wireframe/BasicCamera.qml index 740dd54ce..df21bcd5d 100644 --- a/examples/qt3d/wireframe/BasicCamera.qml +++ b/examples/qt3d/wireframe/BasicCamera.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Camera { id: mainCamera diff --git a/examples/qt3d/wireframe/TrefoilKnot.qml b/examples/qt3d/wireframe/TrefoilKnot.qml index 7b6faf852..47a3b49ba 100644 --- a/examples/qt3d/wireframe/TrefoilKnot.qml +++ b/examples/qt3d/wireframe/TrefoilKnot.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { id: root diff --git a/examples/qt3d/wireframe/WireframeEffect.qml b/examples/qt3d/wireframe/WireframeEffect.qml index c8fe3bef8..f413b2992 100644 --- a/examples/qt3d/wireframe/WireframeEffect.qml +++ b/examples/qt3d/wireframe/WireframeEffect.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Effect { id: root diff --git a/examples/qt3d/wireframe/WireframeMaterial.qml b/examples/qt3d/wireframe/WireframeMaterial.qml index 834ce657d..b8a08b29e 100644 --- a/examples/qt3d/wireframe/WireframeMaterial.qml +++ b/examples/qt3d/wireframe/WireframeMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/examples/qt3d/wireframe/main.qml b/examples/qt3d/wireframe/main.qml index 8a9506c1c..ab739b187 100644 --- a/examples/qt3d/wireframe/main.qml +++ b/examples/qt3d/wireframe/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 import QtQuick 2.1 as QQ2 Entity { diff --git a/src/quick3d/imports/render/defaults/defaults.pri b/src/quick3d/imports/render/defaults/defaults.pri index 4e871abc3..2d219b646 100644 --- a/src/quick3d/imports/render/defaults/defaults.pri +++ b/src/quick3d/imports/render/defaults/defaults.pri @@ -3,7 +3,7 @@ # resource file. # # To have the plugin register them as types, add an entries to the -# qmldir array in qt3dquick3drenderplugin.cpp +# qmldir array in qt3dquick3drendererplugin.cpp QML_FILES = \ $$PWD/qml/PhongMaterial.qml \ $$PWD/qml/DiffuseMapMaterial.qml \ diff --git a/src/quick3d/imports/render/defaults/qml/DiffuseMapMaterial.qml b/src/quick3d/imports/render/defaults/qml/DiffuseMapMaterial.qml index 5c6838dbd..3697b0b3d 100644 --- a/src/quick3d/imports/render/defaults/qml/DiffuseMapMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/DiffuseMapMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/src/quick3d/imports/render/defaults/qml/DiffuseSpecularMapMaterial.qml b/src/quick3d/imports/render/defaults/qml/DiffuseSpecularMapMaterial.qml index 43885be14..cb52a67cf 100644 --- a/src/quick3d/imports/render/defaults/qml/DiffuseSpecularMapMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/DiffuseSpecularMapMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml b/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml index ee7744806..861854169 100644 --- a/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml +++ b/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 TechniqueFilter { // Expose camera to allow user to choose which camera to use for rendering diff --git a/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapAlphaMaterial.qml b/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapAlphaMaterial.qml index df62ec84d..ff070197a 100644 --- a/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapAlphaMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapAlphaMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapMaterial.qml b/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapMaterial.qml index 16e2f0b42..862ef5afa 100644 --- a/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/NormalDiffuseMapMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/src/quick3d/imports/render/defaults/qml/NormalDiffuseSpecularMapMaterial.qml b/src/quick3d/imports/render/defaults/qml/NormalDiffuseSpecularMapMaterial.qml index bfb2cb163..44de8940b 100644 --- a/src/quick3d/imports/render/defaults/qml/NormalDiffuseSpecularMapMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/NormalDiffuseSpecularMapMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id: root diff --git a/src/quick3d/imports/render/defaults/qml/PerVertexColorMaterial.qml b/src/quick3d/imports/render/defaults/qml/PerVertexColorMaterial.qml index 6051ca3b9..2199a2cc6 100644 --- a/src/quick3d/imports/render/defaults/qml/PerVertexColorMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/PerVertexColorMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id:root diff --git a/src/quick3d/imports/render/defaults/qml/PhongMaterial.qml b/src/quick3d/imports/render/defaults/qml/PhongMaterial.qml index dc66eb78a..2d2ed2d3a 100644 --- a/src/quick3d/imports/render/defaults/qml/PhongMaterial.qml +++ b/src/quick3d/imports/render/defaults/qml/PhongMaterial.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Material { id:root diff --git a/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml b/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml index 2f0c54600..fd810bc9e 100644 --- a/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml +++ b/src/quick3d/imports/render/defaults/qml/SkyboxEntity.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import Qt3D 2.0 -import Qt3D.Render 2.0 +import Qt3D.Renderer 2.0 Entity { diff --git a/src/quick3d/imports/render/importsrender.pro b/src/quick3d/imports/render/importsrender.pro index 2bdb7c7bb..00f0538d0 100644 --- a/src/quick3d/imports/render/importsrender.pro +++ b/src/quick3d/imports/render/importsrender.pro @@ -1,14 +1,14 @@ CXX_MODULE = qml -TARGET = quick3drenderplugin -TARGETPATH = Qt3D/Render +TARGET = quick3drendererplugin +TARGETPATH = Qt3D/Renderer QT += core-private qml qml-private 3dcore 3drenderer 3dquick 3dquickrenderer-private HEADERS += \ - qt3dquick3drenderplugin.h + qt3dquick3drendererplugin.h SOURCES += \ - qt3dquick3drenderplugin.cpp + qt3dquick3drendererplugin.cpp OTHER_FILES += qmldir diff --git a/src/quick3d/imports/render/qmldir b/src/quick3d/imports/render/qmldir index 6654a6a50..27e4826df 100644 --- a/src/quick3d/imports/render/qmldir +++ b/src/quick3d/imports/render/qmldir @@ -1,3 +1,3 @@ -module Qt3D.Render -plugin quick3drenderplugin -classname Qt3DQuick3DRenderPlugin +module Qt3D.Renderer +plugin quick3drendererplugin +classname Qt3DQuick3DRendererPlugin diff --git a/src/quick3d/imports/render/qt3dquick3drendererplugin.cpp b/src/quick3d/imports/render/qt3dquick3drendererplugin.cpp new file mode 100644 index 000000000..39e6a9d51 --- /dev/null +++ b/src/quick3d/imports/render/qt3dquick3drendererplugin.cpp @@ -0,0 +1,253 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** 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 +#include "qt3dquick3drendererplugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void initResources() +{ + Q_INIT_RESOURCE(defaults); +} + +QT_BEGIN_NAMESPACE + +static const struct { + const char *type; + int major, minor; +} qmldir [] = { + // Materials + { "PhongMaterial", 2, 0 }, + { "DiffuseMapMaterial", 2, 0 }, + { "DiffuseSpecularMapMaterial", 2, 0 }, + { "NormalDiffuseMapAlphaMaterial", 2, 0 }, + { "NormalDiffuseMapMaterial", 2, 0 }, + { "NormalDiffuseSpecularMapMaterial", 2, 0 }, + { "PerVertexColorMaterial", 2, 0 }, + // FrameGraphs + { "ForwardRenderer", 2, 0 }, + // Entities + { "SkyboxEntity", 2, 0 } +}; + +QVariantList Quick3DShaderDataArrayToVariantListConverter(Qt3D::Render::Quick::Quick3DShaderDataArray *array) +{ + QList arrayValues = array->values(); + QVariantList values; + values.reserve(arrayValues.size()); + Q_FOREACH (Qt3D::QShaderData *data, arrayValues) + values.append(QVariant::fromValue(data)); + return values; +} + +void Qt3DQuick3DRendererPlugin::registerTypes(const char *uri) +{ + // Init resources for defaults QML files + initResources(); + + // Converters + QMetaType::registerConverter(Quick3DShaderDataArrayToVariantListConverter); + + // @uri Qt3D.Renderer + qmlRegisterUncreatableType(uri, 2, 0, "QAbstractSceneLoader", "QAbstractScene is abstract"); + qmlRegisterExtendedType(uri, 2, 0, "SceneLoader"); +// qmlRegisterCustomType(uri, 2, 0, "Effect", new Qt3D::Render::Quick::ShaderPropertyParser()); + qmlRegisterExtendedType(uri, 2, 0, "Effect"); + qmlRegisterExtendedType(uri, 2, 0, "Technique"); + qmlRegisterType(uri, 2, 0, "Annotation"); + qmlRegisterType(uri, 2, 0, "OpenGLFilter"); + qmlRegisterUncreatableType(uri, 2, 0, "QParameter", "Quick3D should instantiate Quick3DParameter only"); + qmlRegisterType(uri, 2, 0, "Parameter"); + qmlRegisterType(uri, 2, 0, "ParameterMapping"); + qmlRegisterExtendedType(uri, 2, 0, "Material"); + qmlRegisterExtendedType(uri, 2, 0, "RenderPass"); + qmlRegisterType(uri, 2, 0, "ShaderProgram"); + qmlRegisterUncreatableType(uri, 2, 0, "QShaderData", "Quick3D should instantiate Quick3DShaderData only"); + qmlRegisterType(uri, 2, 0, "ShaderDataArray"); + qmlRegisterType(uri, 2, 0, "ShaderData"); + + // Textures + qmlRegisterType(uri, 2, 0, "WrapMode");//, QStringLiteral("QTextureWrapMode cannot be created from QML")); + qmlRegisterUncreatableType(uri, 2, 0, "Texture", QStringLiteral("Texture should be created from one of the subclasses")); + qmlRegisterExtendedType(uri, 2, 0, "Texture1D"); + qmlRegisterExtendedType(uri, 2, 0, "Texture1DArray"); + qmlRegisterExtendedType(uri, 2, 0, "Texture2D"); + qmlRegisterExtendedType(uri, 2, 0, "Texture2DArray"); + qmlRegisterExtendedType(uri, 2, 0, "Texture3D"); + qmlRegisterExtendedType(uri, 2, 0, "TextureCubeMap"); + qmlRegisterExtendedType(uri, 2, 0, "TextureCubeMapArray"); + qmlRegisterExtendedType(uri, 2, 0, "Texture2DMultisample"); + qmlRegisterExtendedType(uri, 2, 0, "Texture2DMultisampleArray"); + qmlRegisterExtendedType(uri, 2, 0, "TextureRectangle"); + qmlRegisterExtendedType(uri, 2, 0, "TextureBuffer"); + qmlRegisterUncreatableType(uri, 2, 0, "QAbstractTextureImage", QStringLiteral("QAbstractTextureImage is abstract")); + qmlRegisterType(uri, 2, 0, "TextureImage"); + + // Meshes + qmlRegisterUncreatableType(uri, 2, 0, "QAbstractMesh", QStringLiteral("QAbstractMesh is abstract")); + qmlRegisterType(uri, 2, 0, "Mesh"); + qmlRegisterType(uri, 2, 0, "CuboidMesh"); + qmlRegisterType(uri, 2, 0, "CylinderMesh"); + qmlRegisterType(uri, 2, 0, "PlaneMesh"); + qmlRegisterType(uri, 2, 0, "TorusMesh"); + qmlRegisterType(uri, 2, 0, "SphereMesh"); + + // Layers + qmlRegisterType(uri, 2, 0, "Layer"); + qmlRegisterType(uri, 2, 0, "LayerFilter"); + + // Lights + qmlRegisterUncreatableType(uri, 2, 0, "QAbstractLight", QStringLiteral("QAbstractLight is abstract")); + qmlRegisterType(uri, 2, 0, "PointLight"); + qmlRegisterType(uri, 2, 0, "DirectionalLight"); + qmlRegisterType(uri, 2, 0, "SpotLight"); + + // FrameGraph + qmlRegisterExtendedType(uri, 2, 0, "CameraSelector"); + qmlRegisterExtendedType(uri, 2, 0, "RenderPassFilter"); + qmlRegisterExtendedType(uri, 2, 0, "TechniqueFilter"); + qmlRegisterExtendedType(uri, 2, 0, "Viewport"); + qmlRegisterExtendedType(uri, 2, 0, "RenderTargetSelector"); + qmlRegisterType(uri, 2, 0, "ClearBuffer"); + qmlRegisterUncreatableType(uri, 2, 0, "FrameGraphNode", QStringLiteral("FrameGraphNode is a base class")); + qmlRegisterExtendedType(uri, 2, 0, "StateSet"); + qmlRegisterType(uri, 2, 0, "NoDraw"); + qmlRegisterType(uri, 2, 0, "FrameGraph"); + + // RenderTarget + qmlRegisterType(uri, 2, 0, "RenderAttachment"); + qmlRegisterExtendedType(uri, 2, 0, "RenderTarget"); + + // Sorting + qmlRegisterType(uri, 2, 0, "SortCriterion"); + qmlRegisterExtendedType(uri, 2, 0, "SortMethod"); + + // RenderStates + qmlRegisterUncreatableType(uri, 2, 0, "RenderState", QStringLiteral("QRenderState is a base class")); + qmlRegisterType(uri, 2, 0, "BlendState"); + qmlRegisterType(uri, 2, 0, "BlendStateSeparate"); + qmlRegisterType(uri, 2, 0, "BlendEquation"); + qmlRegisterType(uri, 2, 0, "AlphaTest"); + qmlRegisterType(uri, 2, 0, "DepthTest"); + qmlRegisterType(uri, 2, 0, "DepthMask"); + qmlRegisterType(uri, 2, 0, "CullFace"); + qmlRegisterType(uri, 2, 0, "FrontFace"); + qmlRegisterType(uri, 2, 0, "StencilTest"); + qmlRegisterType(uri, 2, 0, "ScissorTest"); + qmlRegisterType(uri, 2, 0, "Dithering"); + qmlRegisterType(uri, 2, 0, "AlphaCoverage"); + qmlRegisterType(uri, 2, 0, "PolygonOffset"); + qmlRegisterType(uri, 2, 0, "ColorMask"); + + // Register types provided as QML files compiled into the plugin + for (int i = 0; i < int(sizeof(qmldir) / sizeof(qmldir[0])); i++) { + QString path = QStringLiteral("qrc:/Qt3D/Render/defaults/qml/"); + qmlRegisterType(QUrl(path + qmldir[i].type + QStringLiteral(".qml")), + uri, + qmldir[i].major, qmldir[i].minor, + qmldir[i].type); + } +} + +QT_END_NAMESPACE + + diff --git a/src/quick3d/imports/render/qt3dquick3drendererplugin.h b/src/quick3d/imports/render/qt3dquick3drendererplugin.h new file mode 100644 index 000000000..50105d5ae --- /dev/null +++ b/src/quick3d/imports/render/qt3dquick3drendererplugin.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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 QT3DQUICK3DRENDERPLUGIN_H +#define QT3DQUICK3DRENDERPLUGIN_H + +#include + +QT_BEGIN_NAMESPACE + +class Qt3DQuick3DRendererPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") +public: + void registerTypes(const char *uri) Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif // QT3DQUICK3DRENDERPLUGIN_H diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp deleted file mode 100644 index 4c3959c93..000000000 --- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). -** 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 -#include "qt3dquick3drenderplugin.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void initResources() -{ - Q_INIT_RESOURCE(defaults); -} - -QT_BEGIN_NAMESPACE - -static const struct { - const char *type; - int major, minor; -} qmldir [] = { - // Materials - { "PhongMaterial", 2, 0 }, - { "DiffuseMapMaterial", 2, 0 }, - { "DiffuseSpecularMapMaterial", 2, 0 }, - { "NormalDiffuseMapAlphaMaterial", 2, 0 }, - { "NormalDiffuseMapMaterial", 2, 0 }, - { "NormalDiffuseSpecularMapMaterial", 2, 0 }, - { "PerVertexColorMaterial", 2, 0 }, - // FrameGraphs - { "ForwardRenderer", 2, 0 }, - // Entities - { "SkyboxEntity", 2, 0 } -}; - -QVariantList Quick3DShaderDataArrayToVariantListConverter(Qt3D::Render::Quick::Quick3DShaderDataArray *array) -{ - QList arrayValues = array->values(); - QVariantList values; - values.reserve(arrayValues.size()); - Q_FOREACH (Qt3D::QShaderData *data, arrayValues) - values.append(QVariant::fromValue(data)); - return values; -} - -void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri) -{ - // Init resources for defaults QML files - initResources(); - - // Converters - QMetaType::registerConverter(Quick3DShaderDataArrayToVariantListConverter); - - // @uri Qt3D.Render - qmlRegisterUncreatableType(uri, 2, 0, "QAbstractSceneLoader", "QAbstractScene is abstract"); - qmlRegisterExtendedType(uri, 2, 0, "SceneLoader"); -// qmlRegisterCustomType(uri, 2, 0, "Effect", new Qt3D::Render::Quick::ShaderPropertyParser()); - qmlRegisterExtendedType(uri, 2, 0, "Effect"); - qmlRegisterExtendedType(uri, 2, 0, "Technique"); - qmlRegisterType(uri, 2, 0, "Annotation"); - qmlRegisterType(uri, 2, 0, "OpenGLFilter"); - qmlRegisterUncreatableType(uri, 2, 0, "QParameter", "Quick3D should instantiate Quick3DParameter only"); - qmlRegisterType(uri, 2, 0, "Parameter"); - qmlRegisterType(uri, 2, 0, "ParameterMapping"); - qmlRegisterExtendedType(uri, 2, 0, "Material"); - qmlRegisterExtendedType(uri, 2, 0, "RenderPass"); - qmlRegisterType(uri, 2, 0, "ShaderProgram"); - qmlRegisterUncreatableType(uri, 2, 0, "QShaderData", "Quick3D should instantiate Quick3DShaderData only"); - qmlRegisterType(uri, 2, 0, "ShaderDataArray"); - qmlRegisterType(uri, 2, 0, "ShaderData"); - - // Textures - qmlRegisterType(uri, 2, 0, "WrapMode");//, QStringLiteral("QTextureWrapMode cannot be created from QML")); - qmlRegisterUncreatableType(uri, 2, 0, "Texture", QStringLiteral("Texture should be created from one of the subclasses")); - qmlRegisterExtendedType(uri, 2, 0, "Texture1D"); - qmlRegisterExtendedType(uri, 2, 0, "Texture1DArray"); - qmlRegisterExtendedType(uri, 2, 0, "Texture2D"); - qmlRegisterExtendedType(uri, 2, 0, "Texture2DArray"); - qmlRegisterExtendedType(uri, 2, 0, "Texture3D"); - qmlRegisterExtendedType(uri, 2, 0, "TextureCubeMap"); - qmlRegisterExtendedType(uri, 2, 0, "TextureCubeMapArray"); - qmlRegisterExtendedType(uri, 2, 0, "Texture2DMultisample"); - qmlRegisterExtendedType(uri, 2, 0, "Texture2DMultisampleArray"); - qmlRegisterExtendedType(uri, 2, 0, "TextureRectangle"); - qmlRegisterExtendedType(uri, 2, 0, "TextureBuffer"); - qmlRegisterUncreatableType(uri, 2, 0, "QAbstractTextureImage", QStringLiteral("QAbstractTextureImage is abstract")); - qmlRegisterType(uri, 2, 0, "TextureImage"); - - // Meshes - qmlRegisterUncreatableType(uri, 2, 0, "QAbstractMesh", QStringLiteral("QAbstractMesh is abstract")); - qmlRegisterType(uri, 2, 0, "Mesh"); - qmlRegisterType(uri, 2, 0, "CuboidMesh"); - qmlRegisterType(uri, 2, 0, "CylinderMesh"); - qmlRegisterType(uri, 2, 0, "PlaneMesh"); - qmlRegisterType(uri, 2, 0, "TorusMesh"); - qmlRegisterType(uri, 2, 0, "SphereMesh"); - - // Layers - qmlRegisterType(uri, 2, 0, "Layer"); - qmlRegisterType(uri, 2, 0, "LayerFilter"); - - // Lights - qmlRegisterUncreatableType(uri, 2, 0, "QAbstractLight", QStringLiteral("QAbstractLight is abstract")); - qmlRegisterType(uri, 2, 0, "PointLight"); - qmlRegisterType(uri, 2, 0, "DirectionalLight"); - qmlRegisterType(uri, 2, 0, "SpotLight"); - - // FrameGraph - qmlRegisterExtendedType(uri, 2, 0, "CameraSelector"); - qmlRegisterExtendedType(uri, 2, 0, "RenderPassFilter"); - qmlRegisterExtendedType(uri, 2, 0, "TechniqueFilter"); - qmlRegisterExtendedType(uri, 2, 0, "Viewport"); - qmlRegisterExtendedType(uri, 2, 0, "RenderTargetSelector"); - qmlRegisterType(uri, 2, 0, "ClearBuffer"); - qmlRegisterUncreatableType(uri, 2, 0, "FrameGraphNode", QStringLiteral("FrameGraphNode is a base class")); - qmlRegisterExtendedType(uri, 2, 0, "StateSet"); - qmlRegisterType(uri, 2, 0, "NoDraw"); - qmlRegisterType(uri, 2, 0, "FrameGraph"); - - // RenderTarget - qmlRegisterType(uri, 2, 0, "RenderAttachment"); - qmlRegisterExtendedType(uri, 2, 0, "RenderTarget"); - - // Sorting - qmlRegisterType(uri, 2, 0, "SortCriterion"); - qmlRegisterExtendedType(uri, 2, 0, "SortMethod"); - - // RenderStates - qmlRegisterUncreatableType(uri, 2, 0, "RenderState", QStringLiteral("QRenderState is a base class")); - qmlRegisterType(uri, 2, 0, "BlendState"); - qmlRegisterType(uri, 2, 0, "BlendStateSeparate"); - qmlRegisterType(uri, 2, 0, "BlendEquation"); - qmlRegisterType(uri, 2, 0, "AlphaTest"); - qmlRegisterType(uri, 2, 0, "DepthTest"); - qmlRegisterType(uri, 2, 0, "DepthMask"); - qmlRegisterType(uri, 2, 0, "CullFace"); - qmlRegisterType(uri, 2, 0, "FrontFace"); - qmlRegisterType(uri, 2, 0, "StencilTest"); - qmlRegisterType(uri, 2, 0, "ScissorTest"); - qmlRegisterType(uri, 2, 0, "Dithering"); - qmlRegisterType(uri, 2, 0, "AlphaCoverage"); - qmlRegisterType(uri, 2, 0, "PolygonOffset"); - qmlRegisterType(uri, 2, 0, "ColorMask"); - - // Register types provided as QML files compiled into the plugin - for (int i = 0; i < int(sizeof(qmldir) / sizeof(qmldir[0])); i++) { - QString path = QStringLiteral("qrc:/Qt3D/Render/defaults/qml/"); - qmlRegisterType(QUrl(path + qmldir[i].type + QStringLiteral(".qml")), - uri, - qmldir[i].major, qmldir[i].minor, - qmldir[i].type); - } -} - -QT_END_NAMESPACE - - diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.h b/src/quick3d/imports/render/qt3dquick3drenderplugin.h deleted file mode 100644 index 05aceab7f..000000000 --- a/src/quick3d/imports/render/qt3dquick3drenderplugin.h +++ /dev/null @@ -1,54 +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 QT3DQUICK3DRENDERPLUGIN_H -#define QT3DQUICK3DRENDERPLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class Qt3DQuick3DRenderPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") -public: - void registerTypes(const char *uri) Q_DECL_OVERRIDE; -}; - -QT_END_NAMESPACE - -#endif // QT3DQUICK3DRENDERPLUGIN_H diff --git a/src/render/frontend/framegraph-components/qframegraph.cpp b/src/render/frontend/framegraph-components/qframegraph.cpp index 754e90ed3..345bff596 100644 --- a/src/render/frontend/framegraph-components/qframegraph.cpp +++ b/src/render/frontend/framegraph-components/qframegraph.cpp @@ -74,7 +74,7 @@ QFrameGraphPrivate::QFrameGraphPrivate() \qmltype FrameGraph \instantiates Qt3D::QFrameGraph \inherits Component3D - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For OpenGL ... */ @@ -105,7 +105,7 @@ QFrameGraph::QFrameGraph(QFrameGraphPrivate &dd, QNode *parent) } /*! - \qmlproperty Qt3D.Render::FrameGraphNode Qt3D.Render::FrameGraph::activeFrameGraph + \qmlproperty Qt3D.Renderer::FrameGraphNode Qt3D.Renderer::FrameGraph::activeFrameGraph Holds the current activeFrameGraph root node. */ diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp index 2f81b786e..9f4d10baa 100644 --- a/src/render/frontend/framegraph-components/qframegraphnode.cpp +++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp @@ -65,7 +65,7 @@ QFrameGraphNodePrivate::QFrameGraphNodePrivate() /*! \qmltype FrameGraphNode - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \instantiates QFrameGraphNode \inherits Node \since 5.5 @@ -103,7 +103,7 @@ QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent) } /*! - \qmlproperty bool Qt3D.Render::FrameGraphNode::enabled + \qmlproperty bool Qt3D.Renderer::FrameGraphNode::enabled Holds whether the frame graph node is enabled or disabled. */ diff --git a/src/render/frontend/framegraph-components/qlayerfilter.cpp b/src/render/frontend/framegraph-components/qlayerfilter.cpp index cfccfb987..5d52b517e 100644 --- a/src/render/frontend/framegraph-components/qlayerfilter.cpp +++ b/src/render/frontend/framegraph-components/qlayerfilter.cpp @@ -62,7 +62,7 @@ QLayerFilterPrivate::QLayerFilterPrivate() \qmltype LayerFilter \instantiates Qt3D::QLayerFilter \inherits FrameGraphNode - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For ... */ @@ -98,7 +98,7 @@ QLayerFilter::QLayerFilter(QLayerFilterPrivate &dd, QNode *parent) */ /*! - \qmlproperty stringlist Qt3D.Render::LayerFilter::layers + \qmlproperty stringlist Qt3D.Renderer::LayerFilter::layers */ diff --git a/src/render/frontend/qabstracttextureimage.cpp b/src/render/frontend/qabstracttextureimage.cpp index 96d679df6..c26503db9 100644 --- a/src/render/frontend/qabstracttextureimage.cpp +++ b/src/render/frontend/qabstracttextureimage.cpp @@ -51,7 +51,7 @@ namespace Qt3D { \qmltype AbstractTextureImage \instantiates Qt3D::QAbstractTextureImage \inherits Node - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \qmlabstract \since 5.5 \brief Encapsulates the necessary information to create an OpenGL texture image. @@ -110,7 +110,7 @@ int QAbstractTextureImage::mipmapLevel() const } /*! - \qmlproperty int Qt3D.Render::AbstractTextureImage::layer + \qmlproperty int Qt3D.Renderer::AbstractTextureImage::layer Holds the layer of the texture image. */ @@ -127,7 +127,7 @@ int QAbstractTextureImage::layer() const } /*! - \qmlproperty enumeration Qt3D.Render::AbstractTextureImage::cubeMapFace + \qmlproperty enumeration Qt3D.Renderer::AbstractTextureImage::cubeMapFace Holds the cube map face of the texture image. diff --git a/src/render/frontend/qannotation.cpp b/src/render/frontend/qannotation.cpp index 0476e1d6a..e04c26047 100644 --- a/src/render/frontend/qannotation.cpp +++ b/src/render/frontend/qannotation.cpp @@ -64,7 +64,7 @@ QAnnotationPrivate::QAnnotationPrivate() \qmltype Annotation \instantiates Qt3D::QAnnotation \inherits Node - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For annotating ... */ @@ -112,7 +112,7 @@ void QAnnotation::setName(const QString &name) */ /*! - \qmlproperty variant Qt3D.Render::Annotation::value + \qmlproperty variant Qt3D.Renderer::Annotation::value */ QVariant QAnnotation::value() const @@ -127,7 +127,7 @@ QVariant QAnnotation::value() const */ /*! - \qmlproperty string Qt3D.Render::Annotation::name + \qmlproperty string Qt3D.Renderer::Annotation::name */ QString QAnnotation::name() const diff --git a/src/render/frontend/qblendstate.cpp b/src/render/frontend/qblendstate.cpp index 642ce03ab..b1c80f76e 100644 --- a/src/render/frontend/qblendstate.cpp +++ b/src/render/frontend/qblendstate.cpp @@ -75,7 +75,7 @@ public: \qmltype BlendState \instantiates Qt3D::QBlendState \inherits RenderState - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief Encapsulates blending information */ @@ -241,7 +241,7 @@ void QBlendState::setDstAlpha(QBlendState::Blending dstAlpha) \qmltype BlendStateSeparate \instantiates Qt3D::QBlendStateSeparate \inherits RenderState - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief Encapsulates blending information */ diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp index afef8df3f..c3767baf5 100644 --- a/src/render/frontend/qlayer.cpp +++ b/src/render/frontend/qlayer.cpp @@ -61,7 +61,7 @@ QLayerPrivate::QLayerPrivate() \qmltype Layer \instantiates Qt3D::QLayer \inherits Component3D - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For ... */ @@ -98,7 +98,7 @@ QLayer::QLayer(QLayerPrivate &dd, QNode *parent) */ /*! - \qmlproperty stringlist Qt3D.Render::Layer::names + \qmlproperty stringlist Qt3D.Renderer::Layer::names */ diff --git a/src/render/frontend/qopenglfilter.cpp b/src/render/frontend/qopenglfilter.cpp index c6bf6da1a..101c28366 100644 --- a/src/render/frontend/qopenglfilter.cpp +++ b/src/render/frontend/qopenglfilter.cpp @@ -74,7 +74,7 @@ public: \qmltype OpenGLFilter \instantiates Qt3D::QOpenGLFilter \inherits QtObject - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For OpenGL ... */ @@ -124,7 +124,7 @@ void QOpenGLFilter::copy(const QOpenGLFilter &ref) */ /*! - \qmlproperty enumeration Qt3D.Render::OpenGLFilter::api + \qmlproperty enumeration Qt3D.Renderer::OpenGLFilter::api \value ES QSurfaceFormat::OpenGLES @@ -143,7 +143,7 @@ QOpenGLFilter::Api QOpenGLFilter::api() const */ /*! - \qmlproperty enumeration Qt3D.Render::OpenGLFilter::profile + \qmlproperty enumeration Qt3D.Renderer::OpenGLFilter::profile \value None QSurfaceFormat::NoProfile \value Core QSurfaceFormat::CoreProfile @@ -162,7 +162,7 @@ QOpenGLFilter::Profile QOpenGLFilter::profile() const */ /*! - \qmlproperty int Qt3D.Render::OpenGLFilter::minorVersion + \qmlproperty int Qt3D.Renderer::OpenGLFilter::minorVersion */ @@ -178,7 +178,7 @@ int QOpenGLFilter::minorVersion() const */ /*! - \qmlproperty int Qt3D.Render::OpenGLFilter::majorVersion + \qmlproperty int Qt3D.Renderer::OpenGLFilter::majorVersion */ @@ -194,7 +194,7 @@ int QOpenGLFilter::majorVersion() const */ /*! - \qmlproperty stringlist Qt3D.Render::OpenGLFilter::extensions + \qmlproperty stringlist Qt3D.Renderer::OpenGLFilter::extensions */ @@ -210,7 +210,7 @@ QStringList QOpenGLFilter::extensions() const */ /*! - \qmlproperty string Qt3D.Render::OpenGLFilter::vendor + \qmlproperty string Qt3D.Renderer::OpenGLFilter::vendor */ diff --git a/src/render/frontend/qparametermapping.cpp b/src/render/frontend/qparametermapping.cpp index e2b266f8d..6214e2a17 100644 --- a/src/render/frontend/qparametermapping.cpp +++ b/src/render/frontend/qparametermapping.cpp @@ -61,7 +61,7 @@ QParameterMappingPrivate::QParameterMappingPrivate() \qmltype ParameterMapping \instantiates Qt3D::QParameterMapping \inherits Node - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For ... */ @@ -121,7 +121,7 @@ QParameterMapping::QParameterMapping(const QString ¶meterName, const QString */ /*! - \qmlproperty string Qt3D.Render::ParameterMapping::parameterName + \qmlproperty string Qt3D.Renderer::ParameterMapping::parameterName */ @@ -140,7 +140,7 @@ void QParameterMapping::setParameterName(const QString &name) */ /*! - \qmlproperty string Qt3D.Render::ParameterMapping::shaderVariableName + \qmlproperty string Qt3D.Renderer::ParameterMapping::shaderVariableName */ @@ -159,7 +159,7 @@ void QParameterMapping::setShaderVariableName(const QString &name) */ /*! - \qmlproperty BindingType Qt3D.Render::ParameterMapping::bindingType + \qmlproperty BindingType Qt3D.Renderer::ParameterMapping::bindingType \value Uniform \value Attribute diff --git a/src/render/frontend/qpointlight.cpp b/src/render/frontend/qpointlight.cpp index 77cb68954..f4ade9b5d 100644 --- a/src/render/frontend/qpointlight.cpp +++ b/src/render/frontend/qpointlight.cpp @@ -78,7 +78,7 @@ QPointLightPrivate::QPointLightPrivate() \qmltype PointLight \instantiates Qt3D::QPointLight \inherits AbstractLight - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For OpenGL ... */ diff --git a/src/render/frontend/qspotlight.cpp b/src/render/frontend/qspotlight.cpp index cef18fe10..2eb947d64 100644 --- a/src/render/frontend/qspotlight.cpp +++ b/src/render/frontend/qspotlight.cpp @@ -83,7 +83,7 @@ QSpotLightPrivate::QSpotLightPrivate() \qmltype SpotLight \instantiates Qt3D::QSpotLight \inherits AbstractLight - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief For OpenGL ... */ @@ -119,7 +119,7 @@ QSpotLight::QSpotLight(QSpotLightPrivate &dd, QNode *parent) } /*! - \qmlproperty vector3d Qt3D.Render::SpotLight::direction + \qmlproperty vector3d Qt3D.Renderer::SpotLight::direction */ @@ -136,7 +136,7 @@ QSpotLight::QSpotLight(QSpotLightPrivate &dd, QNode *parent) /*! - \qmlproperty float Qt3D.Render::SpotLight::cutOffAngle + \qmlproperty float Qt3D.Renderer::SpotLight::cutOffAngle */ diff --git a/src/render/frontend/qtextureimage.cpp b/src/render/frontend/qtextureimage.cpp index e3ada359a..4596bf943 100644 --- a/src/render/frontend/qtextureimage.cpp +++ b/src/render/frontend/qtextureimage.cpp @@ -106,7 +106,7 @@ private: \qmltype TextureImage \instantiates Qt3D::QTextureImage \inherits AbstractTextureImage - \inqmlmodule Qt3D.Render + \inqmlmodule Qt3D.Renderer \since 5.5 \brief Encapsulates the necessary information to create an OpenGL texture image from an image source. @@ -144,7 +144,7 @@ QUrl QTextureImage::source() const */ /*! - \qmlproperty url Qt3D.Render::TextureImage::source + \qmlproperty url Qt3D.Renderer::TextureImage::source This property holdsthe source url from which data for the texture image will be loaded. diff --git a/src/render/renderlogging.cpp b/src/render/renderlogging.cpp index 95bb88a8f..c5823c6dc 100644 --- a/src/render/renderlogging.cpp +++ b/src/render/renderlogging.cpp @@ -42,16 +42,16 @@ namespace Qt3D { namespace Render { -Q_LOGGING_CATEGORY(Backend, "Qt3D.Render.Backend") -Q_LOGGING_CATEGORY(Frontend, "Qt3D.Render.Frontend") -Q_LOGGING_CATEGORY(Io, "Qt3D.Render.IO") -Q_LOGGING_CATEGORY(Jobs, "Qt3D.Render.Jobs") -Q_LOGGING_CATEGORY(Framegraph, "Qt3D.Render.Framegraph") -Q_LOGGING_CATEGORY(RenderNodes, "Qt3D.Render.RenderNodes") -Q_LOGGING_CATEGORY(Rendering, "Qt3D.Render.Rendering") -Q_LOGGING_CATEGORY(Memory, "Qt3D.Render.Memory") -Q_LOGGING_CATEGORY(Shaders, "Qt3D.Render.Shaders") -Q_LOGGING_CATEGORY(RenderStates, "Qt3D.Render.RenderStates") +Q_LOGGING_CATEGORY(Backend, "Qt3D.Renderer.Backend") +Q_LOGGING_CATEGORY(Frontend, "Qt3D.Renderer.Frontend") +Q_LOGGING_CATEGORY(Io, "Qt3D.Renderer.IO") +Q_LOGGING_CATEGORY(Jobs, "Qt3D.Renderer.Jobs") +Q_LOGGING_CATEGORY(Framegraph, "Qt3D.Renderer.Framegraph") +Q_LOGGING_CATEGORY(RenderNodes, "Qt3D.Renderer.RenderNodes") +Q_LOGGING_CATEGORY(Rendering, "Qt3D.Renderer.Rendering") +Q_LOGGING_CATEGORY(Memory, "Qt3D.Renderer.Memory") +Q_LOGGING_CATEGORY(Shaders, "Qt3D.Renderer.Shaders") +Q_LOGGING_CATEGORY(RenderStates, "Qt3D.Renderer.RenderStates") } // Render -- cgit v1.2.3 From 57f11fe309969665ddebafa3b770263d2d82fa93 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 11 Jun 2015 13:23:22 +0100 Subject: Move temporary window class to examples So as to avoid public header without a QPrefix. Real integration points will be added later. Also removed it from the Qt3D namespace and fixed linkage. Task-number: QTBUG-46617 Change-Id: I1bea09f45f5fdba3d658b57b86b907ab57164479 Reviewed-by: Giuseppe D'Angelo --- examples/qt3d/anaglyph-rendering/main.cpp | 4 +- examples/qt3d/assimp-cpp/main.cpp | 4 +- examples/qt3d/assimp/main.cpp | 4 +- examples/qt3d/basicshapes-cpp/main.cpp | 4 +- examples/qt3d/bigmodel-qml/main.cpp | 4 +- examples/qt3d/bigscene-cpp/main.cpp | 3 +- examples/qt3d/common/window.cpp | 77 +++++++++++++++++++++++ examples/qt3d/common/window.h | 53 ++++++++++++++++ examples/qt3d/cpp_example/main.cpp | 4 +- examples/qt3d/cylinder-cpp/main.cpp | 4 +- examples/qt3d/cylinder-qml/main.cpp | 4 +- examples/qt3d/deferred-renderer-cpp/main.cpp | 4 +- examples/qt3d/deferred-renderer-qml/main.cpp | 4 +- examples/qt3d/dynamicscene-cpp/main.cpp | 4 +- examples/qt3d/enabled-qml/main.cpp | 4 +- examples/qt3d/examples.pri | 4 ++ examples/qt3d/gltf/main.cpp | 4 +- examples/qt3d/keyboardinput-qml/main.cpp | 4 +- examples/qt3d/loader-qml/main.cpp | 4 +- examples/qt3d/materials-cpp/main.cpp | 4 +- examples/qt3d/materials/main.cpp | 4 +- examples/qt3d/multiviewport/main.cpp | 4 +- examples/qt3d/playground-qml/main.cpp | 4 +- examples/qt3d/shadow-map-qml/main.cpp | 4 +- examples/qt3d/simple-cpp/main.cpp | 4 +- examples/qt3d/simple-qml/main.cpp | 4 +- examples/qt3d/simple-shaders-qml/main.cpp | 4 +- examples/qt3d/skybox/main.cpp | 4 +- examples/qt3d/tessellation-modes/main.cpp | 4 +- examples/qt3d/torus-qml/main.cpp | 4 +- examples/qt3d/wave/main.cpp | 4 +- examples/qt3d/wireframe/main.cpp | 4 +- src/core/core.pri | 2 - src/core/window.cpp | 92 ---------------------------- src/core/window.h | 62 ------------------- 35 files changed, 192 insertions(+), 213 deletions(-) create mode 100644 examples/qt3d/common/window.cpp create mode 100644 examples/qt3d/common/window.h delete mode 100644 src/core/window.cpp delete mode 100644 src/core/window.h diff --git a/examples/qt3d/anaglyph-rendering/main.cpp b/examples/qt3d/anaglyph-rendering/main.cpp index 4521970f0..6072269ae 100644 --- a/examples/qt3d/anaglyph-rendering/main.cpp +++ b/examples/qt3d/anaglyph-rendering/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/assimp-cpp/main.cpp b/examples/qt3d/assimp-cpp/main.cpp index 2925626cd..d068f443e 100644 --- a/examples/qt3d/assimp-cpp/main.cpp +++ b/examples/qt3d/assimp-cpp/main.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include @@ -52,7 +52,7 @@ int main(int ac, char **av) { QApplication app(ac, av); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; Qt3D::QInputAspect *inputAspect = new Qt3D::QInputAspect(); diff --git a/examples/qt3d/assimp/main.cpp b/examples/qt3d/assimp/main.cpp index d9c0ede88..d8fcbc269 100644 --- a/examples/qt3d/assimp/main.cpp +++ b/examples/qt3d/assimp/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/basicshapes-cpp/main.cpp b/examples/qt3d/basicshapes-cpp/main.cpp index 3aa42f7f8..dc2317948 100644 --- a/examples/qt3d/basicshapes-cpp/main.cpp +++ b/examples/qt3d/basicshapes-cpp/main.cpp @@ -38,7 +38,7 @@ #include -#include +#include #include #include #include @@ -74,7 +74,7 @@ int main(int argc, char **argv) { QApplication app(argc, argv); - Qt3D::Window *view = new Qt3D::Window(); + Window *view = new Window(); QWidget *container = QWidget::createWindowContainer(view); QSize screenSize = view->screen()->size(); diff --git a/examples/qt3d/bigmodel-qml/main.cpp b/examples/qt3d/bigmodel-qml/main.cpp index 6e76f1f5a..5d57b0694 100644 --- a/examples/qt3d/bigmodel-qml/main.cpp +++ b/examples/qt3d/bigmodel-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/bigscene-cpp/main.cpp b/examples/qt3d/bigscene-cpp/main.cpp index 5ab25bf5e..ec99f9bc9 100644 --- a/examples/qt3d/bigscene-cpp/main.cpp +++ b/examples/qt3d/bigscene-cpp/main.cpp @@ -35,10 +35,11 @@ ****************************************************************************/ #include +#include + #include #include #include -#include #include #include #include diff --git a/examples/qt3d/common/window.cpp b/examples/qt3d/common/window.cpp new file mode 100644 index 000000000..433942f25 --- /dev/null +++ b/examples/qt3d/common/window.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** 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 "window.h" + +#include +#include +#include + +Window::Window(QScreen *screen) + : QWindow(screen) + +{ + setSurfaceType(QSurface::OpenGLSurface); + + resize(1024, 768); + + QSurfaceFormat format; + if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { + format.setVersion(4, 3); + format.setProfile(QSurfaceFormat::CoreProfile); + } + format.setDepthBufferSize( 24 ); + format.setSamples( 4 ); + setFormat(format); + create(); +} + +Window::~Window() +{ +} + +void Window::keyPressEvent( QKeyEvent* e ) +{ + switch ( e->key() ) + { + case Qt::Key_Escape: + QGuiApplication::quit(); + break; + + default: + QWindow::keyPressEvent( e ); + } +} diff --git a/examples/qt3d/common/window.h b/examples/qt3d/common/window.h new file mode 100644 index 000000000..7c6e3606e --- /dev/null +++ b/examples/qt3d/common/window.h @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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 WINDOW_H +#define WINDOW_H + +#include + +class Window : public QWindow +{ + Q_OBJECT +public: + explicit Window(QScreen *screen = 0); + ~Window(); + +protected: + virtual void keyPressEvent(QKeyEvent *e); +}; + +#endif // QT3D_WINDOW_H diff --git a/examples/qt3d/cpp_example/main.cpp b/examples/qt3d/cpp_example/main.cpp index 014e8d958..2bc079e25 100644 --- a/examples/qt3d/cpp_example/main.cpp +++ b/examples/qt3d/cpp_example/main.cpp @@ -36,7 +36,7 @@ #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ int main(int ac, char **av) { QGuiApplication app(ac, av); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); Qt3D::QInputAspect *input = new Qt3D::QInputAspect; diff --git a/examples/qt3d/cylinder-cpp/main.cpp b/examples/qt3d/cylinder-cpp/main.cpp index 13a40ddfb..01e6c7cf7 100644 --- a/examples/qt3d/cylinder-cpp/main.cpp +++ b/examples/qt3d/cylinder-cpp/main.cpp @@ -36,7 +36,7 @@ #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); Qt3D::QInputAspect *input = new Qt3D::QInputAspect; diff --git a/examples/qt3d/cylinder-qml/main.cpp b/examples/qt3d/cylinder-qml/main.cpp index 171c11f92..53a1a94b9 100644 --- a/examples/qt3d/cylinder-qml/main.cpp +++ b/examples/qt3d/cylinder-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/deferred-renderer-cpp/main.cpp b/examples/qt3d/deferred-renderer-cpp/main.cpp index 24814585f..7e6c03d58 100644 --- a/examples/qt3d/deferred-renderer-cpp/main.cpp +++ b/examples/qt3d/deferred-renderer-cpp/main.cpp @@ -35,7 +35,7 @@ ****************************************************************************/ #include -#include +#include #include @@ -67,7 +67,7 @@ int main(int ac, char **av) { QGuiApplication app(ac, av); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); Qt3D::QInputAspect *input = new Qt3D::QInputAspect; diff --git a/examples/qt3d/deferred-renderer-qml/main.cpp b/examples/qt3d/deferred-renderer-qml/main.cpp index 533bea16b..efbe03d70 100644 --- a/examples/qt3d/deferred-renderer-qml/main.cpp +++ b/examples/qt3d/deferred-renderer-qml/main.cpp @@ -35,7 +35,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/dynamicscene-cpp/main.cpp b/examples/qt3d/dynamicscene-cpp/main.cpp index 8d265ec33..4d43ba59b 100644 --- a/examples/qt3d/dynamicscene-cpp/main.cpp +++ b/examples/qt3d/dynamicscene-cpp/main.cpp @@ -36,9 +36,9 @@ #include +#include #include #include -#include #include @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); Qt3D::QInputAspect *input = new Qt3D::QInputAspect; diff --git a/examples/qt3d/enabled-qml/main.cpp b/examples/qt3d/enabled-qml/main.cpp index 0b3f1023c..6152557a5 100644 --- a/examples/qt3d/enabled-qml/main.cpp +++ b/examples/qt3d/enabled-qml/main.cpp @@ -36,8 +36,8 @@ #include +#include #include -#include #include #include @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); engine.aspectEngine()->initialize(); diff --git a/examples/qt3d/examples.pri b/examples/qt3d/examples.pri index 6e2f67dcc..5f67884c0 100644 --- a/examples/qt3d/examples.pri +++ b/examples/qt3d/examples.pri @@ -1,4 +1,8 @@ TEMPLATE = app +INCLUDEPATH += $$PWD/common +SOURCES += $$PWD/common/window.cpp +HEADERS += $$PWD/common/window.h + target.path = $$[QT_INSTALL_EXAMPLES]/qt3d/$$TARGET INSTALLS += target diff --git a/examples/qt3d/gltf/main.cpp b/examples/qt3d/gltf/main.cpp index 523ee4396..1c1018404 100644 --- a/examples/qt3d/gltf/main.cpp +++ b/examples/qt3d/gltf/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/keyboardinput-qml/main.cpp b/examples/qt3d/keyboardinput-qml/main.cpp index 0238633d3..0797d355f 100644 --- a/examples/qt3d/keyboardinput-qml/main.cpp +++ b/examples/qt3d/keyboardinput-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/loader-qml/main.cpp b/examples/qt3d/loader-qml/main.cpp index e74dc8b43..45385a76c 100644 --- a/examples/qt3d/loader-qml/main.cpp +++ b/examples/qt3d/loader-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/materials-cpp/main.cpp b/examples/qt3d/materials-cpp/main.cpp index 2e5a4834b..057f4f35e 100644 --- a/examples/qt3d/materials-cpp/main.cpp +++ b/examples/qt3d/materials-cpp/main.cpp @@ -36,8 +36,8 @@ #include +#include #include -#include #include #include @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); Qt3D::QInputAspect *input = new Qt3D::QInputAspect; diff --git a/examples/qt3d/materials/main.cpp b/examples/qt3d/materials/main.cpp index e27bbdaff..160831d3e 100644 --- a/examples/qt3d/materials/main.cpp +++ b/examples/qt3d/materials/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/multiviewport/main.cpp b/examples/qt3d/multiviewport/main.cpp index 666aa1434..bb64bf2c7 100644 --- a/examples/qt3d/multiviewport/main.cpp +++ b/examples/qt3d/multiviewport/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -44,7 +44,7 @@ int main(int ac, char **av) { QGuiApplication app(ac, av); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect); diff --git a/examples/qt3d/playground-qml/main.cpp b/examples/qt3d/playground-qml/main.cpp index 6ec4c6097..9b2ff6e0b 100644 --- a/examples/qt3d/playground-qml/main.cpp +++ b/examples/qt3d/playground-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/shadow-map-qml/main.cpp b/examples/qt3d/shadow-map-qml/main.cpp index 2357106c7..ac08f5381 100644 --- a/examples/qt3d/shadow-map-qml/main.cpp +++ b/examples/qt3d/shadow-map-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; view.resize(1600, 800); diff --git a/examples/qt3d/simple-cpp/main.cpp b/examples/qt3d/simple-cpp/main.cpp index d44271543..873df84dd 100644 --- a/examples/qt3d/simple-cpp/main.cpp +++ b/examples/qt3d/simple-cpp/main.cpp @@ -36,8 +36,8 @@ #include +#include #include -#include #include #include #include @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::QAspectEngine engine; engine.registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/simple-qml/main.cpp b/examples/qt3d/simple-qml/main.cpp index e74dc8b43..45385a76c 100644 --- a/examples/qt3d/simple-qml/main.cpp +++ b/examples/qt3d/simple-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/simple-shaders-qml/main.cpp b/examples/qt3d/simple-shaders-qml/main.cpp index 1141958fd..7f7afd225 100644 --- a/examples/qt3d/simple-shaders-qml/main.cpp +++ b/examples/qt3d/simple-shaders-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/skybox/main.cpp b/examples/qt3d/skybox/main.cpp index 318b5181f..c585bf5fb 100644 --- a/examples/qt3d/skybox/main.cpp +++ b/examples/qt3d/skybox/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/tessellation-modes/main.cpp b/examples/qt3d/tessellation-modes/main.cpp index df1ba87de..eee73d435 100644 --- a/examples/qt3d/tessellation-modes/main.cpp +++ b/examples/qt3d/tessellation-modes/main.cpp @@ -36,7 +36,7 @@ #include "tessellatedquadmesh.h" -#include +#include #include #include #include @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/torus-qml/main.cpp b/examples/qt3d/torus-qml/main.cpp index d9c0ede88..d8fcbc269 100644 --- a/examples/qt3d/torus-qml/main.cpp +++ b/examples/qt3d/torus-qml/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/wave/main.cpp b/examples/qt3d/wave/main.cpp index b30248031..bd2e79f3e 100644 --- a/examples/qt3d/wave/main.cpp +++ b/examples/qt3d/wave/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/examples/qt3d/wireframe/main.cpp b/examples/qt3d/wireframe/main.cpp index e869a2fb4..a92e10a23 100644 --- a/examples/qt3d/wireframe/main.cpp +++ b/examples/qt3d/wireframe/main.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); - Qt3D::Window view; + Window view; Qt3D::Quick::QQmlAspectEngine engine; engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect()); diff --git a/src/core/core.pri b/src/core/core.pri index 32bd30bc9..fc533627a 100644 --- a/src/core/core.pri +++ b/src/core/core.pri @@ -21,7 +21,6 @@ include (./services/services.pri) HEADERS += \ $$PWD/qt3dcore_global.h \ - $$PWD/window.h \ $$PWD/qtickclock_p.h \ $$PWD/qscheduler_p.h \ $$PWD/corelogging_p.h \ @@ -44,7 +43,6 @@ HEADERS += \ $$PWD/qt3dcore_global_p.h SOURCES += \ - $$PWD/window.cpp \ $$PWD/qtickclock.cpp \ $$PWD/qscheduler.cpp \ $$PWD/qchangearbiter.cpp \ diff --git a/src/core/window.cpp b/src/core/window.cpp deleted file mode 100644 index 9a71b6f7b..000000000 --- a/src/core/window.cpp +++ /dev/null @@ -1,92 +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 "window.h" - -#include -#include -#include -#include - -#include "qnode.h" -#include "qcamera.h" -#include "qentity.h" -#include "qaspectengine.h" -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3D { - -Window::Window(QScreen *screen) - : QWindow(screen) - -{ - setSurfaceType(QSurface::OpenGLSurface); - - resize(1024, 768); - - QSurfaceFormat format; - if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { - format.setVersion(4, 3); - format.setProfile(QSurfaceFormat::CoreProfile); - } - format.setDepthBufferSize( 24 ); - format.setSamples( 4 ); - setFormat(format); - create(); -} - -Window::~Window() -{ -} - -void Window::keyPressEvent( QKeyEvent* e ) -{ - switch ( e->key() ) - { - case Qt::Key_Escape: - QGuiApplication::quit(); - break; - - default: - QWindow::keyPressEvent( e ); - } -} - -} // namespace Qt3D - -QT_END_NAMESPACE diff --git a/src/core/window.h b/src/core/window.h deleted file mode 100644 index 3b7a7c990..000000000 --- a/src/core/window.h +++ /dev/null @@ -1,62 +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_WINDOW_H -#define QT3D_WINDOW_H - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3D { - -class QT3DCORESHARED_EXPORT Window : public QWindow -{ - Q_OBJECT -public: - explicit Window(QScreen *screen = 0); - ~Window(); - -protected: - virtual void keyPressEvent(QKeyEvent *e); -}; - -} // namespace Qt3D - -QT_END_NAMESPACE - -#endif // QT3D_WINDOW_H -- cgit v1.2.3 From 137bd818e743dc97fdceb9b8870adf370c2fd289 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 11 Jun 2015 10:05:48 +0100 Subject: Move Qt3D generic index to Qt3DCore index There is no Qt3D library, there is only Qt3DCore, Qt3DRenderer and Qt3DInput so we put the global stuff into the Qt3DCore docs. Change-Id: I31077581ba159d828d0f64968a83920308676007 Reviewed-by: Paul Lemire --- src/core/doc/src/qt3d-index.qdoc | 75 ------------------------------------ src/core/doc/src/qt3dcore-index.qdoc | 53 +++++++++++++++++-------- 2 files changed, 38 insertions(+), 90 deletions(-) delete mode 100644 src/core/doc/src/qt3d-index.qdoc diff --git a/src/core/doc/src/qt3d-index.qdoc b/src/core/doc/src/qt3d-index.qdoc deleted file mode 100644 index 81da5d0c2..000000000 --- a/src/core/doc/src/qt3d-index.qdoc +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qt3d-index.html - \title Qt3D Module - - \e Qt3D provides functionality for near-realtime simulation systems - with support for 2D and 3D rendering in both Qt C++ and Qt Quick - applications. - - The functionality in Qt3D is divided into the following modules: - - \annotatedlist qt3d-modules - - Classes, types and functions are declared under the \l Qt3D namespace. - - \section1 Getting Started - - For a C++ application that performs 2D or 3D rendering and also handles user - input, add the following line to your \l qmake \c .pro file: - - \badcode - QT += 3dcore 3drenderer 3dinput - \endcode - - To include the definitions of the modules' classes, use the following - directives: - - \badcode - #include - #include - #include - \endcode - - A Qt Quick application requires also additional dependencies: - - \badcode - QT += 3dcore 3drenderer 3dinput qml quick 3dquick - \endcode - - \section1 Overview - - \section1 Reference - \list - \li \l {Qt3D}{Qt3D namespace} - \li \l {Qt3D Core C++ Classes} - \li \l {Qt3D Render C++ Classes} - \li \l {Qt3D Examples} - \endlist -*/ diff --git a/src/core/doc/src/qt3dcore-index.qdoc b/src/core/doc/src/qt3dcore-index.qdoc index b2908264b..8401e13a6 100644 --- a/src/core/doc/src/qt3dcore-index.qdoc +++ b/src/core/doc/src/qt3dcore-index.qdoc @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt-project.org/legal ** @@ -35,31 +36,53 @@ ****************************************************************************/ /*! - \title Qt3D Core - \page qt3dcore-index.html - \brief The Qt3D Core module contains functionality to support near-realtime simulation systems. - \ingroup qt3d-modules + \page qt3dcore-index.html + \title Qt3D Module + + \e Qt3D provides functionality for near-realtime simulation systems + with support for 2D and 3D rendering in both Qt C++ and Qt Quick + applications. + + The functionality in Qt3D is divided into the following modules: + + \annotatedlist qt3d-modules + + Classes, types and functions are declared under the \l Qt3D namespace. \section1 Getting Started - To use Qt3D classes, add this directive into the C++ files: + For a C++ application that performs 2D or 3D rendering and also handles user + input, add the following line to your \l qmake \c .pro file: - \code - #include + \badcode + QT += 3dcore 3drenderer 3dinput \endcode - To link against the corresponding C++ libraries, add the following to your qmake project file: + To include the definitions of the modules' classes, use the following + directives: - \code - QT += 3dcore + \badcode + #include + #include + #include \endcode - \section1 Reference + A Qt Quick application requires also additional dependencies: + \badcode + QT += 3dcore 3drenderer 3dinput qml quick 3dquick + \endcode + + \section1 Overview + + The high level design and motivation for Qt3D is described in the + \l {Qt3D Overview}. + + \section1 Reference \list - \li \l {Qt3D Core C++ Classes} - \li \l {Qt3D Core QML Types} - \li \l {Qt3D Examples} + \li \l {Qt3D}{Qt3D namespace} + \li \l {Qt3D Core C++ Classes} + \li \l {Qt3D Render C++ Classes} + \li \l {Qt3D Examples} \endlist - */ -- cgit v1.2.3 From 48915a86510d8ed3c65c039e84e473c06c61d7cb Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 11 Jun 2015 10:19:01 +0100 Subject: Add list of platform support levels To help adjust expectations. Change-Id: I5a2363c04ed6272d304f55ba7a3e5de3f3920088 Reviewed-by: Paul Lemire --- src/core/doc/src/qt3dcore-index.qdoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/doc/src/qt3dcore-index.qdoc b/src/core/doc/src/qt3dcore-index.qdoc index 8401e13a6..ec8c6c1b7 100644 --- a/src/core/doc/src/qt3dcore-index.qdoc +++ b/src/core/doc/src/qt3dcore-index.qdoc @@ -85,4 +85,19 @@ \li \l {Qt3D Render C++ Classes} \li \l {Qt3D Examples} \endlist + + \section1 Qt3D Platform Support + + In this Technology Preview Qt3D has the following support for platforms: + + \list + \li Microsoft Windows (win32) - Supported + \li Linux X11 - Supported + \li OS X - Supported although there may be some retina scaling issues + \li Android - Supported + \li Embedded Linux - Supported + \li iOS - Not supported yet (coming in Qt 5.6) + \li WinRT - Not supported yet + \li Windows CE - Compiles but not tested + \endlist */ -- cgit v1.2.3 From 301be51c4c53668de48ed18040e12c74896c58e4 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 11 Jun 2015 12:35:31 +0100 Subject: Use Qt3DRenderer consistently for documentation configuration Change-Id: Ibea422bfe658c89dad919f98b7269bc801c9c295 Reviewed-by: Kai Koehne Reviewed-by: Paul Lemire --- src/core/doc/qt3dcore.qdocconf | 2 +- src/render/doc/qt3drender.qdocconf | 44 ----------------- src/render/doc/qt3drenderer.qdocconf | 44 +++++++++++++++++ src/render/doc/src/qt3drender-index.qdoc | 77 ----------------------------- src/render/doc/src/qt3drender-module.qdoc | 63 ----------------------- src/render/doc/src/qt3drenderer-index.qdoc | 77 +++++++++++++++++++++++++++++ src/render/doc/src/qt3drenderer-module.qdoc | 63 +++++++++++++++++++++++ src/render/render.pro | 2 +- 8 files changed, 186 insertions(+), 186 deletions(-) delete mode 100644 src/render/doc/qt3drender.qdocconf create mode 100644 src/render/doc/qt3drenderer.qdocconf delete mode 100644 src/render/doc/src/qt3drender-index.qdoc delete mode 100644 src/render/doc/src/qt3drender-module.qdoc create mode 100644 src/render/doc/src/qt3drenderer-index.qdoc create mode 100644 src/render/doc/src/qt3drenderer-module.qdoc diff --git a/src/core/doc/qt3dcore.qdocconf b/src/core/doc/qt3dcore.qdocconf index db2848ae8..251c0ab67 100644 --- a/src/core/doc/qt3dcore.qdocconf +++ b/src/core/doc/qt3dcore.qdocconf @@ -32,7 +32,7 @@ qhp.Qt3DCore.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qt3dcore/qt3dcore.tags -depends += qtcore qtqml qtquick qtdoc qt3drender +depends += qtcore qtqml qtquick qtdoc qt3drenderer headerdirs += .. \ ../../plugins \ diff --git a/src/render/doc/qt3drender.qdocconf b/src/render/doc/qt3drender.qdocconf deleted file mode 100644 index 204f96baa..000000000 --- a/src/render/doc/qt3drender.qdocconf +++ /dev/null @@ -1,44 +0,0 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) - -project = Qt3DRender -description = Qt3D Render Reference Documentation -version = $QT_VERSION - -examplesinstallpath = qt3d - -qhp.projects = Qt3DRender - -qhp.Qt3DRender.file = qt3drender.qhp -qhp.Qt3DRender.namespace = org.qt-project.qt3drender.$QT_VERSION_TAG -qhp.Qt3DRender.virtualFolder = qt3drender -qhp.Qt3DRender.indexTitle = Qt3D Render -qhp.Qt3DRender.indexRoot = - -qhp.Qt3DRender.filterAttributes = qt3drender $QT_VERSION qtrefdoc -qhp.Qt3DRender.customFilters.Qt.name = Qt3DRender $QT_VERSION -qhp.Qt3DRender.customFilters.Qt.filterAttributes = qt3drender $QT_VERSION - -qhp.Qt3DRender.subprojects = classes -qhp.Qt3DRender.subprojects.classes.title = C++ Classes -qhp.Qt3DRender.subprojects.classes.indexTitle = Qt3D Render C++ Classes -qhp.Qt3DRender.subprojects.classes.selectors = class fake:headerfile -qhp.Qt3DRender.subprojects.classes.sortPages = true - -tagfile = ../../../doc/qt3drender/qt3drender.tags - -depends += qtcore qtqml qtquick qt3dcore qtdoc - -headerdirs += .. -sourcedirs += .. -exampledirs += ../../../examples/qt3d \ - src/snippets - -imagedirs += images - -Cpp.ignoretokens += QT3DRENDERERSHARED_EXPORT \ - QT3DRENDERERSHARED_PRIVATE_EXPORT - -Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY - -navigation.landingpage = "Qt3D Render" -navigation.cppclassespage = "Qt3D Render C++ Classes" diff --git a/src/render/doc/qt3drenderer.qdocconf b/src/render/doc/qt3drenderer.qdocconf new file mode 100644 index 000000000..4214188db --- /dev/null +++ b/src/render/doc/qt3drenderer.qdocconf @@ -0,0 +1,44 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = Qt3DRenderer +description = Qt3D Renderer Reference Documentation +version = $QT_VERSION + +examplesinstallpath = qt3d + +qhp.projects = Qt3DRenderer + +qhp.Qt3DRenderer.file = qt3drenderer.qhp +qhp.Qt3DRenderer.namespace = org.qt-project.qt3drenderer.$QT_VERSION_TAG +qhp.Qt3DRenderer.virtualFolder = qt3drenderer +qhp.Qt3DRenderer.indexTitle = Qt3D Renderer +qhp.Qt3DRenderer.indexRoot = + +qhp.Qt3DRenderer.filterAttributes = qt3drenderer $QT_VERSION qtrefdoc +qhp.Qt3DRenderer.customFilters.Qt.name = Qt3DRenderer $QT_VERSION +qhp.Qt3DRenderer.customFilters.Qt.filterAttributes = qt3drenderer $QT_VERSION + +qhp.Qt3DRenderer.subprojects = classes +qhp.Qt3DRenderer.subprojects.classes.title = C++ Classes +qhp.Qt3DRenderer.subprojects.classes.indexTitle = Qt3D Renderer C++ Classes +qhp.Qt3DRenderer.subprojects.classes.selectors = class fake:headerfile +qhp.Qt3DRenderer.subprojects.classes.sortPages = true + +tagfile = ../../../doc/qt3drenderer/qt3drenderer.tags + +depends += qtcore qtqml qtquick qt3dcore qtdoc + +headerdirs += .. +sourcedirs += .. +exampledirs += ../../../examples/qt3d \ + src/snippets + +imagedirs += images + +Cpp.ignoretokens += QT3DRENDERERSHARED_EXPORT \ + QT3DRENDERERSHARED_PRIVATE_EXPORT + +Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY + +navigation.landingpage = "Qt3D Renderer" +navigation.cppclassespage = "Qt3D Renderer C++ Classes" diff --git a/src/render/doc/src/qt3drender-index.qdoc b/src/render/doc/src/qt3drender-index.qdoc deleted file mode 100644 index 2a517ac81..000000000 --- a/src/render/doc/src/qt3drender-index.qdoc +++ /dev/null @@ -1,77 +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$ -** -****************************************************************************/ - -/*! - \page qt3drender-index.html - \title Qt3D Render - \ingroup qt3d-modules - \brief The Qt3D Render module contains functionality to support 2D and 3D rendering using Qt3D. - - \section1 Getting Started - - To use Qt3D classes, add this directive into the C++ files: - - \code - #include - \endcode - - To link against the corresponding C++ libraries, add the following to your qmake project file: - - \code - QT += 3drenderer - \endcode - - \section1 Reference - \list - \li \l {Qt3D Render C++ Classes} - \li \l {Qt3D Examples} - \endlist -*/ - -/*! - \page qt3d-examples.html - \ingroup all-examples - \title Qt3D Examples - \brief Examples that demostrate 2D and 3D rendering using Qt3D. - - The following examples demonstrate 2D and 3D rendering using Qt3D. - - \section1 QML Examples - \annotatedlist qt3d-examples-qml - - \section1 C++ Examples - \annotatedlist qt3d-examples-cpp -*/ diff --git a/src/render/doc/src/qt3drender-module.qdoc b/src/render/doc/src/qt3drender-module.qdoc deleted file mode 100644 index 1deb4bff8..000000000 --- a/src/render/doc/src/qt3drender-module.qdoc +++ /dev/null @@ -1,63 +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$ -** -****************************************************************************/ - -/*! - \module Qt3DRender - \title Qt3D Render C++ Classes - \brief The Qt3D Render module contains functionality to support 2D and 3D rendering using Qt3D. - - \ingroup modules - \qtvariable 3drender - - The Qt3D Render module provides an aspect, components, and other supporting types necessary - to implement 2D and 3D rendering as part of the Qt3D framework. - - Classes, types, and functions are declared under the \l [Qt3DCore]{Qt3D} namespace. -*/ - -/*! - \qmlmodule Qt3D.Render 2.0 - \title Qt3D Render QML Types - \ingroup qmlmodules - - \brief Provides Qt3D QML types for rendering. - - To import and use the module's QML types, use the following statement: - - \badcode - import Qt3D.Render 2.0 - \endcode -*/ diff --git a/src/render/doc/src/qt3drenderer-index.qdoc b/src/render/doc/src/qt3drenderer-index.qdoc new file mode 100644 index 000000000..0aa93fc9c --- /dev/null +++ b/src/render/doc/src/qt3drenderer-index.qdoc @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \page qt3drender-index.html + \title Qt3D Renderer + \ingroup qt3d-modules + \brief The Qt3D Renderer module contains functionality to support 2D and 3D rendering using Qt3D. + + \section1 Getting Started + + To use Qt3D classes, add this directive into the C++ files: + + \code + #include + \endcode + + To link against the corresponding C++ libraries, add the following to your qmake project file: + + \code + QT += 3drenderer + \endcode + + \section1 Reference + \list + \li \l {Qt3D Renderer C++ Classes} + \li \l {Qt3D Examples} + \endlist +*/ + +/*! + \page qt3d-examples.html + \ingroup all-examples + \title Qt3D Examples + \brief Examples that demostrate 2D and 3D rendering using Qt3D. + + The following examples demonstrate 2D and 3D rendering using Qt3D. + + \section1 QML Examples + \annotatedlist qt3d-examples-qml + + \section1 C++ Examples + \annotatedlist qt3d-examples-cpp +*/ diff --git a/src/render/doc/src/qt3drenderer-module.qdoc b/src/render/doc/src/qt3drenderer-module.qdoc new file mode 100644 index 000000000..25b551ce4 --- /dev/null +++ b/src/render/doc/src/qt3drenderer-module.qdoc @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \module Qt3DRenderer + \title Qt3D Renderer C++ Classes + \brief The Qt3D Renderer module contains functionality to support 2D and 3D rendering using Qt3D. + + \ingroup modules + \qtvariable 3drenderer + + The Qt3D Renderer module provides an aspect, components, and other supporting types necessary + to implement 2D and 3D rendering as part of the Qt3D framework. + + Classes, types, and functions are declared under the \l [Qt3DCore]{Qt3D} namespace. +*/ + +/*! + \qmlmodule Qt3D.Renderer 2.0 + \title Qt3D Renderer QML Types + \ingroup qmlmodules + + \brief Provides Qt3D QML types for rendering. + + To import and use the module's QML types, use the following statement: + + \badcode + import Qt3D.Renderer 2.0 + \endcode +*/ diff --git a/src/render/render.pro b/src/render/render.pro index 2d9c2d3bd..03f05e9ba 100644 --- a/src/render/render.pro +++ b/src/render/render.pro @@ -11,7 +11,7 @@ MODULE_PLUGIN_TYPES = \ load(qt_module) -QMAKE_DOCS = $$PWD/doc/qt3drender.qdocconf +QMAKE_DOCS = $$PWD/doc/qt3drenderer.qdocconf include (backend/render-backend.pri) include (frontend/render-frontend.pri) -- cgit v1.2.3 From 714dddb0d7974cc770fbc13f6aafdcfc0023ac8d Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 11 Jun 2015 12:10:31 +0200 Subject: Add an overview of Qt3D and its motivation and architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I29c3b972cc9847ecd28a22e9de484aef0f3ac185 Reviewed-by: Paul Lemire Reviewed-by: Topi Reiniö --- src/core/doc/images/Space-invaders.jpg | Bin 0 -> 40836 bytes src/core/doc/images/ecs-1.png | Bin 0 -> 11162 bytes src/core/doc/images/ecs-2.png | Bin 0 -> 16250 bytes src/core/doc/src/qt3d-overview.qdoc | 273 +++++++++++++++++++++++++++++++++ 4 files changed, 273 insertions(+) create mode 100644 src/core/doc/images/Space-invaders.jpg create mode 100644 src/core/doc/images/ecs-1.png create mode 100644 src/core/doc/images/ecs-2.png create mode 100644 src/core/doc/src/qt3d-overview.qdoc diff --git a/src/core/doc/images/Space-invaders.jpg b/src/core/doc/images/Space-invaders.jpg new file mode 100644 index 000000000..feea250bb Binary files /dev/null and b/src/core/doc/images/Space-invaders.jpg differ diff --git a/src/core/doc/images/ecs-1.png b/src/core/doc/images/ecs-1.png new file mode 100644 index 000000000..6ea006f00 Binary files /dev/null and b/src/core/doc/images/ecs-1.png differ diff --git a/src/core/doc/images/ecs-2.png b/src/core/doc/images/ecs-2.png new file mode 100644 index 000000000..749195eaa Binary files /dev/null and b/src/core/doc/images/ecs-2.png differ diff --git a/src/core/doc/src/qt3d-overview.qdoc b/src/core/doc/src/qt3d-overview.qdoc new file mode 100644 index 000000000..48788b5c7 --- /dev/null +++ b/src/core/doc/src/qt3d-overview.qdoc @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \page qt3d-overview.html + \title Qt3D Overview + + \brief Qt3D provides C++ and QML APIs to incorporate 3D content into Qt + applications. + + Qt3D provides a fully configurable renderer that enables developers to + quickly implement any rendering pipeline that they need. Further, Qt3D + provides a generic framework for near-realtime simulations beyond rendering. + + Qt3D is cleanly separated into a core and any number of \e aspects that can + implement any functionality they wish. The aspects interact with + \e components and \e entities to provide some slice of functionality. + Examples of aspects include physics, audio, collision, artificial + intelligence (AI), and path finding. + + \section1 Basic 3D Features + + Qt3D is a 3D framework that enables the drawing of 3D shapes and moving + them around, as well as moving the camera. It supports the following basic + features: + + \list + \li 2D and 3D rendering for C++ and Qt Quick applications + \li Meshes + \li Materials + \li Shadows + \li Shaders + \li Ambient occlusion + \li High dynamic range + \li Deferred rendering + \li Multitexturing + \li Instancing + \li Uniform Buffer Objects + \endlist + + \section1 Configurable Renderer + + To combine support for both C++ and QML APIs with having a fully + configurable renderer, the concept of a \e framegraph was introduced. + While a \e scenegraph is a data-driven description of \e what to render, a + framegraph is a data-driven description of \e how to render it. + + A framegraph enables developers to choose between a simple forward renderer, + including a z-fill pass, or using a deferred renderer for example. It also + gives them control over when to render any transparent objects, and so on. + Since this is all configured purely from data, it is very easy to modify even + dynamically at runtime without touching any C++ code. It is possible to + extend Qt3D by creating your own framegraphs that implement custom + rendering algorithms. + + \section1 3D Extensions + + Beyond the essentials of displaying 3D content on the screen, Qt3D is + extensible and flexible enough to act as a host for following types of + extensions related to the 3D objects: + + \list + \li Physics simulation + \li Collision detection + \li 3D positional audio + \li Rigid body, skeletal, and morph target animation + \li Path finding and other AI + \li Picking + \li Particles + \li Object spawning + \endlist + + \section1 Performance + + Qt3D is designed to perform well and scale up with the number of available + CPU cores, because modern hardware improves performance by increasing the + numbers of cores rather than base clock speed. Using multiple cores works + well, because many tasks are independent of each other. For example, the + operations performed by a path finding module do not overlap strongly with + the tasks performed by a renderer, except maybe when rendering debug + information or statistics. + + \section1 Qt3D Architecture + + The main use cases of Qt3D are simulating objects in near-realtime and + rendering the state of those objects onto the screen. The Space Invaders + example contains the following objects: + + \image Space-invaders.jpg + + \list + \li The player's ground cannon + \li The ground + \li The defensive blocks + \li The enemy space invader ships + \li The enemy boss flying saucer + \li The bullets shot by the enemies and the player + \endlist + + In a traditional C++ design, these types of object would typically be + implemented as classes arranged in some kind of inheritance tree. Various + branches in the inheritance tree might add additional functionality to the + root class for features such as: + + \list + \li Accepts user input + \li Plays a sound + \li Is animated + \li Collides with other objects + \li Is drawn on screen + \endlist + + The types in the Space Invaders example can be classified against these + features. However, designing an elegant inheritance tree for even such a + simple example is not easy. + + This approach and other variations on inheritance present a number of + problems: + + \list + \li Deep and wide inheritance hierarchies are difficult to understand, + maintain and extend. + \li The inheritance taxonomy is set in stone at compile time. + \li Each level in the class inheritance tree can only classify upon a + single criteria or axis. + \li Shared functionality tends to \e {bubble up} the class hierarchy + over time. + \li It is impossible to predict what the developers will want to do. + \endlist + + Extending deep and wide inheritance trees usually requires understanding, + and agreeing with, the taxonomy used by the original author. Therefore, + Qt3D places focus on aggregation instead of inheritance as the means of + imparting functionality onto an instance of an object. Specifically, Qt3D + implements an Entity Component System (ECS). + + \section2 Using an ECS + + In an ECS, an entity represents a simulated object but by itself is devoid + of any specific behavior or characteristics. Additional behavior can be + grafted onto an entity by having the entity aggregate one or more + components. Each component is a vertical slice of behavior of an object + type. + + In the Space Invaders example, the ground is an entity with an attached + component that tells the system that the entity needs rendering and what + kind of rendering it needs. An enemy space invader ship is another entity + with attached components that cause the ship to be rendered, but also enable + it to emit sounds, be collided with, be animated, and be controlled by a + simple AI. + + The player's ground cannon entity has mostly similar components to the enemy + space invader ship, except that it does not have the AI component. In its + place, the cannon has an input component to enable the player to move it + around and to fire bullets. + + \section2 ECS Backend + + \image ecs-2.png + + The backend of Qt3D implements the \e system part of the ECS paradigm in + the form of \e aspects. An aspect implements the particular vertical slice + of the functionality provided to entities by a combination of one or more + of their aggregated components. + + For example, the renderer aspect looks for entities that have mesh, + material, and optionally transformation components. If the renderer aspect + finds such an entity, it knows how to take that data and draw something nice + from it. If an entity does not have those components, the renderer aspect + ignores it. + + Qt3D builds custom entities by aggregating components that provide + additional capabilities. The Qt3D engine uses aspects to process and + update entities with specific components. + + For example, a physics aspect looks for entities that have some kind of + collision volume component and another component that specifies other + properties needed by such simulations like mass, coefficient of friction, + and so on. An entity that emits sound has a component that specifies it is + a sound emitter, as well as specifying when and which sounds to play. + + Because ECS uses aggregation rather than inheritance, it is possible to + dynamically change how an object behaves at runtime simply by adding or + removing components. + + For example, to enable a player to suddenly run through walls after a + power-up, that entity's collision volume component can be removed + temporarily, until the power-up times out. There is no need to create a + special one-off subclass for \c PlayerWhoRunsThroughWalls. + + \section2 Qt3D ECS Implementation + + Qt3D implements ECS as a simple class hierarchy. The Qt3D base class is + Qt3D::QNode, which is a subclass of QObject. Qt3D::QNode adds to QObject the ability to + automatically communicate property changes to aspects and an ID that is + unique throughout an application. The aspects exist in additional threads + and Qt3D::QNode simplifies the data transfer between the user-facing objects and + the aspects. + + Typically, subclasses of Qt3D::QNode provide additional supporting data that is + referenced by components. For example, the QShaderProgram class specifies + the GLSL code to be used when rendering a set of entities. + + \image ecs-1.png + + Components in Qt3D are implemented by subclassing Qt3D::QComponent and adding the + data necessary for the corresponding aspect to do its work. For example, the + mesh component is used by the renderer aspect to retrieve the per-vertex + data that should be sent down the OpenGL pipeline. + + Finally, Qt3D::QEntity is simply an object that can aggregate zero or more + Qt3D::QComponent instances. + + \section1 Extending Qt3D + + Adding functionality to Qt3D, either as part of Qt or specific to your + own applications to benefit from the multi-threaded back-end consists of the + following tasks: + + \list + \li Identify and implement any necessary components and supporting data. + \li Register the components with the QML engine (only if you use the QML + API). + \li Subclass QAbstractAspect and implement the subsystem functionality. + \endlist + + \section1 Qt3D Task-Based Engine + + In Qt3D, aspects are asked in each frame for a set of \e tasks to execute + along with the \e dependencies between them. The tasks are distributed + across all the configured cores by a scheduler to improve performance. + + \section1 Qt3D's Aspects + + By default Qt3D provides the Qt3DRenderer and Qt3DInput aspects. The + components and other supporting classes provided by these aspects are + discussed in the documentation for those modules. + + Additional aspects providing more capabilities will be added in future + versions of Qt3D. -- cgit v1.2.3 From ddf59ad0d0cf6e81b8e7fa821f0466937bc143aa Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 15 Jun 2015 09:50:37 +0100 Subject: Fix crash on windows Q_DECLARE_METATYPE() is required, even for QObject subclass pointers, if you want to be able to call qMetaTypeId() for that type. Task-number: QTBUG-46661 Change-Id: Iaabf758f1d3b92569a463d2a5fb13389f086bd5c Reviewed-by: Paul Lemire --- src/quick3d/quick3drenderer/items/quick3dshaderdata.h | 2 ++ src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h | 2 ++ src/render/frontend/qshaderdata.h | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdata.h b/src/quick3d/quick3drenderer/items/quick3dshaderdata.h index 65b635fe7..56bd143f9 100644 --- a/src/quick3d/quick3drenderer/items/quick3dshaderdata.h +++ b/src/quick3d/quick3drenderer/items/quick3dshaderdata.h @@ -69,4 +69,6 @@ private: QT_END_NAMESPACE +Q_DECLARE_METATYPE(Qt3D::Render::Quick::Quick3DShaderData*) + #endif // QT3D_RENDER_QUICK_QUICK3DSHADERDATA_H diff --git a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h index e5ca26bf0..7e663fbb9 100644 --- a/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h +++ b/src/quick3d/quick3drenderer/items/quick3dshaderdataarray.h @@ -85,4 +85,6 @@ private: QT_END_NAMESPACE +Q_DECLARE_METATYPE(Qt3D::Render::Quick::Quick3DShaderDataArray*) + #endif // QT3D_RENDER_QUICK_QUICK3DSHADERDATAARRAY_H diff --git a/src/render/frontend/qshaderdata.h b/src/render/frontend/qshaderdata.h index 577d4fd79..b38409cfb 100644 --- a/src/render/frontend/qshaderdata.h +++ b/src/render/frontend/qshaderdata.h @@ -83,4 +83,7 @@ private: QT_END_NAMESPACE +Q_DECLARE_METATYPE(Qt3D::QShaderData*) +Q_DECLARE_METATYPE(QList) + #endif // QT3D_QSHADERDATA_H -- cgit v1.2.3 From 6f93508bcd38d8d0fa524ac00d65b518fac0d82a Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 12 Jun 2015 15:53:11 +0200 Subject: Doc: Add skeleton docs for Qt3D Input classes and QML types Not fully documented yet, but enables the classes and QML types to be visible in the documentation. Change-Id: I557aeae9ff6314b697bcc9313c1061543363b645 Reviewed-by: Leena Miettinen Reviewed-by: Sean Harmer --- src/core/doc/qt3dcore.qdocconf | 7 +- src/core/doc/src/qt3dinput-module.qdoc | 67 ++++++++++++ src/input/q3dkeyevent.cpp | 91 ++++++++++++++++ src/input/qinputaspect.cpp | 6 ++ src/input/qkeyboardcontroller.cpp | 19 ++++ src/input/qkeyboardinput.cpp | 186 +++++++++++++++++++++++++++++++++ 6 files changed, 374 insertions(+), 2 deletions(-) create mode 100644 src/core/doc/src/qt3dinput-module.qdoc diff --git a/src/core/doc/qt3dcore.qdocconf b/src/core/doc/qt3dcore.qdocconf index 251c0ab67..65e6e03fe 100644 --- a/src/core/doc/qt3dcore.qdocconf +++ b/src/core/doc/qt3dcore.qdocconf @@ -36,11 +36,13 @@ depends += qtcore qtqml qtquick qtdoc qt3drenderer headerdirs += .. \ ../../plugins \ - ../../quick3d/quick3d + ../../quick3d/quick3d \ + ../../input sourcedirs += .. \ ../../plugins \ - ../../quick3d/quick3d + ../../quick3d/quick3d \ + ../../input exampledirs += src/snippets @@ -49,6 +51,7 @@ exampledirs += src/snippets imagedirs += images Cpp.ignoretokens += QT3DCORE_PRIVATE_EXPORT \ + QT3DINPUTSHARED_EXPORT \ QT3DCORESHARED_EXPORT Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY diff --git a/src/core/doc/src/qt3dinput-module.qdoc b/src/core/doc/src/qt3dinput-module.qdoc new file mode 100644 index 000000000..b82de6862 --- /dev/null +++ b/src/core/doc/src/qt3dinput-module.qdoc @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \module Qt3DInput + \title Qt3D Input C++ Classes + \brief The Qt3D Input module provides classes for handling user input in + applications using Qt3D. + + \ingroup modules + \ingroup qt3d-modules + \qtvariable 3dinput + + To use classes from this module, add this directive into the C++ files: + + \code + #include + \endcode + + To link against the corresponding C++ libraries, add the following to your qmake project file: + + \badcode + QT += 3dinput + \endcode +*/ + +/*! + \qmlmodule Qt3D.Input 2.0 + \title Qt3D Input QML Types + \ingroup qmlmodules + \ingroup qt3d-qmlmodules + + \brief Provides QML types for Qt3D user input. + + To import and use the module's QML types, use the following statement: + + \badcode + import Qt3D.Input 2.0 + \endcode + + \section1 QML Types +*/ + diff --git a/src/input/q3dkeyevent.cpp b/src/input/q3dkeyevent.cpp index c0de3a293..bb1990955 100644 --- a/src/input/q3dkeyevent.cpp +++ b/src/input/q3dkeyevent.cpp @@ -42,6 +42,22 @@ namespace Qt3D { //Qt6: Move this into a QtQmlGui module and merge it with QQuickKeyEvent +/*! + \class Qt3D::Q3DKeyEvent + \inmodule Qt3DInput + \since 5.5 +*/ + +/*! + \qmltype KeyEvent + \inqmlmodule Qt3D.Input + \instantiates Qt3D::Q3DKeyEvent + \since 5.5 + + The KeyEvent QML type cannot be directly created. Objects of this type + are used as signal parameters in KeyboardInput. +*/ + Q3DKeyEvent::Q3DKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text, bool autorep, ushort count) : QObject() , m_event(type, key, modifiers, text, autorep, count) @@ -56,6 +72,81 @@ Q3DKeyEvent::Q3DKeyEvent(const QKeyEvent &ke) m_event.setAccepted(false); } +/*! + \qmlproperty int Qt3D.Input::KeyEvent::key + \readonly + + This property holds the code of the key that was pressed or released. + + See \l [CPP] {Qt::Key}{Qt.Key} for the list of keyboard codes. + + \sa {QtQuick::KeyEvent::key}{KeyEvent.key} +*/ + +/*! + \qmlproperty string Qt3D.Input::KeyEvent::text + \readonly + + This property holds the Unicode text that the key generated. The text + returned can be an empty string in cases where modifier keys, such as + Shift, Control, Alt, and Meta, are being pressed or released. In such + cases \l key will contain a valid value. +*/ + +/*! + \qmlproperty int Qt3D.Input::KeyEvent::modifiers + \readonly + + This property holds the keyboard modifier flags that existed immediately + before the event occurred. + + \sa {QtQuick::KeyEvent::modifiers}{KeyEvent.modifiers} +*/ + +/*! + \qmlproperty bool Qt3D.Input::KeyEvent::isAutoRepeat + \readonly + + Holds whether this event comes from an auto-repeating key. +*/ + +/*! + \qmlproperty int Qt3D.Input::KeyEvent::count + \readonly + + Holds the number of keys involved in this event. If \l text is not empty, + this is simply the length of the string. +*/ + +/*! + \qmlproperty quint32 Qt3D.Input::KeyEvent::nativeScanCodei + \readonly + + This property contains the native scan code of the key that was pressed. + It is passed through from QKeyEvent unchanged. + + \sa QKeyEvent::nativeScanCode() +*/ + +/*! + \qmlproperty bool Qt3D.Input::KeyEvent::accepted + + Setting \e accepted to \c true prevents the key event from being propagated + to the item's parent. + + Generally, if the item acts on the key event then it should be accepted so + that ancestor items do not also respond to the same event. +*/ + +/*! + \qmlmethod bool Qt3D.Input::KeyEvent::matches(StandardKey key) + + Returns \c true if the key event matches the given standard key; otherwise + returns \c false. + + \sa QKeySequence::StandardKey +*/ + } // Qt3D QT_END_NAMESPACE diff --git a/src/input/qinputaspect.cpp b/src/input/qinputaspect.cpp index fc7fb8e8c..c16f06dc3 100644 --- a/src/input/qinputaspect.cpp +++ b/src/input/qinputaspect.cpp @@ -62,6 +62,12 @@ QInputAspectPrivate::QInputAspectPrivate() m_aspectType = QAbstractAspect::AspectOther; } +/*! + \class Qt3D::QInputAspect + \inmodule Qt3DInput + \since 5.5 +*/ + QInputAspect::QInputAspect(QObject *parent) : QAbstractAspect(*new QInputAspectPrivate, parent) { diff --git a/src/input/qkeyboardcontroller.cpp b/src/input/qkeyboardcontroller.cpp index 69e93b479..25b9b30ed 100644 --- a/src/input/qkeyboardcontroller.cpp +++ b/src/input/qkeyboardcontroller.cpp @@ -53,11 +53,30 @@ QKeyboardControllerPrivate::QKeyboardControllerPrivate() { } +/*! + \class Qt3D::QKeyboardController + \inmodule Qt3DInput + \since 5.5 +*/ + +/*! + \qmltype KeyboardController + \inqmlmodule Qt3D.Input + \since 5.5 + \instantiates Qt3D::QKeyboardController + \inherits Node +*/ + QKeyboardController::QKeyboardController(QNode *parent) : QNode(*new QKeyboardControllerPrivate, parent) { } +/*! + \qmlproperty KeyboardInput Qt3D.Input::KeyboardController::activeInput + \readonly +*/ + QKeyboardInput *QKeyboardController::activeInput() const { Q_D(const QKeyboardController); diff --git a/src/input/qkeyboardinput.cpp b/src/input/qkeyboardinput.cpp index e7030799d..bf80abecf 100644 --- a/src/input/qkeyboardinput.cpp +++ b/src/input/qkeyboardinput.cpp @@ -55,6 +55,20 @@ QKeyboardInputPrivate::QKeyboardInputPrivate() m_shareable = false; } +/*! + \class Qt3D::QKeyboardInput + \inmodule Qt3DInput + \since 5.5 +*/ + +/*! + \qmltype KeyboardInput + \inqmlmodule Qt3D.Input + \instantiates Qt3D::QKeyboardInput + \inherits Component3D + \since 5.5 +*/ + /*! Constructs a new QKeyboardInput instance with parent \a parent. */ @@ -166,6 +180,10 @@ void QKeyboardInput::keyEvent(Q3DKeyEvent *event) } } +/*! + \qmlproperty KeyboardController Qt3D.Input::KeyboardInput::controller +*/ + /*! Sets the keyboard controller to \a controller. Without a valid controller, the QKeyboardInput won't receive any event. @@ -192,6 +210,10 @@ QKeyboardController *QKeyboardInput::controller() const return d->m_controller; } +/*! + \qmlproperty bool Qt3D.Input::KeyboardInput::focus +*/ + /*! \returns the current focus. */ @@ -213,6 +235,170 @@ void QKeyboardInput::setFocus(bool focus) } } +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit0Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit1Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit2Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit3Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit4Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit5Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit6Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit7Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit8Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::digit9Pressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::leftPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::rightPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::upPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::downPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::tabPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::backtabPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::asteriskPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::numberSignPressed(KeyEvent event) +*/ + +/*! + \qmlsignal Qt3D.Input::KeyboardInput::backtabPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::escapePressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::returnPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::enterPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::deletePressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::spacePressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::backPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::cancelPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::selectPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::yesPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::noPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::context1Pressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::context2Pressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::context3Pressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::context4Pressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::callPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::hangupPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::flipPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::menuPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::volumeUpPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::volumeDownPressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::pressed(KeyEvent event) +*/ + +/*! + qmlsignal Qt3D.Input::KeyboardInput::released(KeyEvent event) +*/ + } // Qt3D QT_END_NAMESPACE -- cgit v1.2.3 From 60cb61f9d70ec52f3193bac44384099d921827b3 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 12 Jun 2015 15:43:39 +0200 Subject: Doc: Fix multiple documentation issues - Restore qt3d-index.html as the main landing page. Needed for external linking. - Fix \inmodule commands for Renderer classes - Add proper group so that all three modules are listed on the landing page, both C++ and QML modules - Remove qt3drenderer-index.html (to be consistent with Qt3DCore), copy contents over to the module page and to a new file, qt3d-examples.qdoc. - Fix indexTitles in qdocconf files, and subprojects for Renderer QML types and Qt3D examples Change-Id: I0e2497771d0525d120ffa9d7d6338b01fdfa6963 Reviewed-by: Leena Miettinen --- src/core/doc/qt3dcore.qdocconf | 4 +- src/core/doc/src/qt3dcore-index.qdoc | 15 +++-- src/core/doc/src/qt3dcore-module.qdoc | 5 ++ src/render/defaults/qdiffusemapmaterial.cpp | 2 +- .../defaults/qdiffusespecularmapmaterial.cpp | 2 +- src/render/defaults/qforwardrenderer.cpp | 2 +- .../defaults/qnormaldiffusemapalphamaterial.cpp | 2 +- src/render/defaults/qnormaldiffusemapmaterial.cpp | 2 +- .../defaults/qnormaldiffusespecularmapmaterial.cpp | 2 +- src/render/defaults/qpervertexcolormaterial.cpp | 2 +- src/render/defaults/qphongmaterial.cpp | 2 +- src/render/doc/qt3drenderer.qdocconf | 17 ++++- src/render/doc/src/qt3d-examples.qdoc | 41 ++++++++++++ src/render/doc/src/qt3drenderer-index.qdoc | 77 ---------------------- src/render/doc/src/qt3drenderer-module.qdoc | 14 ++++ .../frontend/framegraph-components/qframegraph.cpp | 2 +- .../framegraph-components/qframegraphnode.cpp | 2 +- .../framegraph-components/qlayerfilter.cpp | 2 +- src/render/frontend/qabstracttextureimage.cpp | 2 +- src/render/frontend/qannotation.cpp | 2 +- src/render/frontend/qblendstate.cpp | 4 +- src/render/frontend/qlayer.cpp | 2 +- src/render/frontend/qopenglfilter.cpp | 2 +- src/render/frontend/qparametermapping.cpp | 2 +- src/render/frontend/qpointlight.cpp | 2 +- src/render/frontend/qspotlight.cpp | 2 +- src/render/frontend/qtextureimage.cpp | 2 +- 27 files changed, 106 insertions(+), 109 deletions(-) create mode 100644 src/render/doc/src/qt3d-examples.qdoc delete mode 100644 src/render/doc/src/qt3drenderer-index.qdoc diff --git a/src/core/doc/qt3dcore.qdocconf b/src/core/doc/qt3dcore.qdocconf index 65e6e03fe..28f985029 100644 --- a/src/core/doc/qt3dcore.qdocconf +++ b/src/core/doc/qt3dcore.qdocconf @@ -11,7 +11,7 @@ qhp.projects = Qt3DCore qhp.Qt3DCore.file = qt3dcore.qhp qhp.Qt3DCore.namespace = org.qt-project.qt3dcore.$QT_VERSION_TAG qhp.Qt3DCore.virtualFolder = qt3dcore -qhp.Qt3DCore.indexTitle = Qt3D Core +qhp.Qt3DCore.indexTitle = Qt3D Module qhp.Qt3DCore.indexRoot = qhp.Qt3DCore.filterAttributes = qt3dcore $QT_VERSION qtrefdoc @@ -56,6 +56,6 @@ Cpp.ignoretokens += QT3DCORE_PRIVATE_EXPORT \ Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY -navigation.landingpage = "Qt3D Core" +navigation.landingpage = "Qt3D Module" navigation.cppclassespage = "Qt3D Core C++ Classes" navigation.qmltypespage = "Qt3D Core QML Types" diff --git a/src/core/doc/src/qt3dcore-index.qdoc b/src/core/doc/src/qt3dcore-index.qdoc index ec8c6c1b7..5c3bc9794 100644 --- a/src/core/doc/src/qt3dcore-index.qdoc +++ b/src/core/doc/src/qt3dcore-index.qdoc @@ -36,18 +36,22 @@ ****************************************************************************/ /*! - \page qt3dcore-index.html + \page qt3d-index.html \title Qt3D Module \e Qt3D provides functionality for near-realtime simulation systems with support for 2D and 3D rendering in both Qt C++ and Qt Quick applications. - The functionality in Qt3D is divided into the following modules: + The functionality in Qt3D is divided into the following C++ modules: \annotatedlist qt3d-modules - Classes, types and functions are declared under the \l Qt3D namespace. + Classes, types and functions are declared under the \l [CPP] {Qt3D} namespace. + + For Qt Quick applications, Qt3D provides the following QML modules: + + \annotatedlist qt3d-qmlmodules \section1 Getting Started @@ -80,9 +84,8 @@ \section1 Reference \list - \li \l {Qt3D}{Qt3D namespace} - \li \l {Qt3D Core C++ Classes} - \li \l {Qt3D Render C++ Classes} + \li \l {Qt3D Overview} + \li \l [CPP] {Qt3D}{Qt3D Namespace} \li \l {Qt3D Examples} \endlist diff --git a/src/core/doc/src/qt3dcore-module.qdoc b/src/core/doc/src/qt3dcore-module.qdoc index d664b8bf6..e04c61737 100644 --- a/src/core/doc/src/qt3dcore-module.qdoc +++ b/src/core/doc/src/qt3dcore-module.qdoc @@ -40,6 +40,7 @@ \brief The Qt3D Core module contains functionality to support near-realtime simulation systems. \ingroup modules + \ingroup qt3d-modules \qtvariable 3dcore The Qt3D Core module provides the foundations and core types used for near-realtime @@ -49,6 +50,7 @@ /*! \namespace Qt3D \inmodule Qt3DCore + \ingroup qt3d-namespaces \brief Contains classes and types that are the foundation of the Qt3D simulation framework, as well as classes that provide the ability to render using the Qt3D @@ -59,6 +61,7 @@ \qmlmodule Qt3D 2.0 \title Qt3D Core QML Types \ingroup qmlmodules + \ingroup qt3d-qmlmodules \brief Provides core Qt3D QML types. @@ -67,4 +70,6 @@ \badcode import Qt3D 2.0 \endcode + + \section1 QML Types */ diff --git a/src/render/defaults/qdiffusemapmaterial.cpp b/src/render/defaults/qdiffusemapmaterial.cpp index bb2f05c67..b9ff33cfe 100644 --- a/src/render/defaults/qdiffusemapmaterial.cpp +++ b/src/render/defaults/qdiffusemapmaterial.cpp @@ -132,7 +132,7 @@ void QDiffuseMapMaterialPrivate::init() \class Qt3D::QDiffuseMapMaterial \brief The QDiffuseMapMaterial provides a default implementation of the phong lighting effect where the diffuse light component is read from a texture map. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/defaults/qdiffusespecularmapmaterial.cpp b/src/render/defaults/qdiffusespecularmapmaterial.cpp index aa72cfece..3cfa0a0cd 100644 --- a/src/render/defaults/qdiffusespecularmapmaterial.cpp +++ b/src/render/defaults/qdiffusespecularmapmaterial.cpp @@ -140,7 +140,7 @@ void QDiffuseSpecularMapMaterialPrivate::init() \class Qt3D::QDiffuseSpecularMapMaterial \brief The QDiffuseSpecularMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse and specular light components are read from texture maps. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/defaults/qforwardrenderer.cpp b/src/render/defaults/qforwardrenderer.cpp index 0daa26143..7453e1f1e 100644 --- a/src/render/defaults/qforwardrenderer.cpp +++ b/src/render/defaults/qforwardrenderer.cpp @@ -79,7 +79,7 @@ void QForwardRendererPrivate::init() /*! \class Qt3D::QForwardRenderer \brief The Qt3D::QForwardRenderer provides a default FrameGraph implementation of a forward renderer. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 Forward rendering is how OpenGL is traditionally. It renders directly to the backbuffer diff --git a/src/render/defaults/qnormaldiffusemapalphamaterial.cpp b/src/render/defaults/qnormaldiffusemapalphamaterial.cpp index 88b9280f4..03e3d9a4e 100644 --- a/src/render/defaults/qnormaldiffusemapalphamaterial.cpp +++ b/src/render/defaults/qnormaldiffusemapalphamaterial.cpp @@ -129,7 +129,7 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init() \brief The QNormalDiffuseMapAlphaMaterial provides a default implementation of the phong lighting and bump effect where the diffuse light component is read from a texture map and the normals of the mesh being rendered from a normal texture map. In addition, it defines an alpha to coverage and a depth test to be performed in the rendering pass. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/defaults/qnormaldiffusemapmaterial.cpp b/src/render/defaults/qnormaldiffusemapmaterial.cpp index 461d24d76..cbc7ee8b6 100644 --- a/src/render/defaults/qnormaldiffusemapmaterial.cpp +++ b/src/render/defaults/qnormaldiffusemapmaterial.cpp @@ -141,7 +141,7 @@ void QNormalDiffuseMapMaterialPrivate::init() \class Qt3D::QNormalDiffuseMapMaterial \brief The QNormalDiffuseMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse light component is read from a texture map and the normals of the mesh being rendered from a normal texture map. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp index ce154e0cf..2e77418c9 100644 --- a/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp +++ b/src/render/defaults/qnormaldiffusespecularmapmaterial.cpp @@ -147,7 +147,7 @@ void QNormalDiffuseSpecularMapMaterialPrivate::init() \class Qt3D::QNormalDiffuseSpecularMapMaterial \brief The QNormalDiffuseSpecularMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse and specular light components are read from texture maps and the normals of the mesh being rendered from a normal texture map. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/defaults/qpervertexcolormaterial.cpp b/src/render/defaults/qpervertexcolormaterial.cpp index c1c68ce0e..578ff35f4 100644 --- a/src/render/defaults/qpervertexcolormaterial.cpp +++ b/src/render/defaults/qpervertexcolormaterial.cpp @@ -74,7 +74,7 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() /*! \class Qt3D::QPerVertexColorMaterial \brief The QPerVertexColorMaterial class provides a default implementation for rendering the color properties set for each vertex. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 This lighting effect is based on the combination of 2 lighting components ambient and diffuse. Ambient is set by the vertex color. diff --git a/src/render/defaults/qphongmaterial.cpp b/src/render/defaults/qphongmaterial.cpp index 43e9f298c..a1d313c67 100644 --- a/src/render/defaults/qphongmaterial.cpp +++ b/src/render/defaults/qphongmaterial.cpp @@ -78,7 +78,7 @@ QPhongMaterialPrivate::QPhongMaterialPrivate() /*! \class Qt3D::QPhongMaterial \brief The QPhongMaterial class provides a default implementation of the phong lighting effect. - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. diff --git a/src/render/doc/qt3drenderer.qdocconf b/src/render/doc/qt3drenderer.qdocconf index 4214188db..e56b6f992 100644 --- a/src/render/doc/qt3drenderer.qdocconf +++ b/src/render/doc/qt3drenderer.qdocconf @@ -11,19 +11,29 @@ qhp.projects = Qt3DRenderer qhp.Qt3DRenderer.file = qt3drenderer.qhp qhp.Qt3DRenderer.namespace = org.qt-project.qt3drenderer.$QT_VERSION_TAG qhp.Qt3DRenderer.virtualFolder = qt3drenderer -qhp.Qt3DRenderer.indexTitle = Qt3D Renderer +qhp.Qt3DRenderer.indexTitle = Qt3D Renderer C++ Classes qhp.Qt3DRenderer.indexRoot = qhp.Qt3DRenderer.filterAttributes = qt3drenderer $QT_VERSION qtrefdoc qhp.Qt3DRenderer.customFilters.Qt.name = Qt3DRenderer $QT_VERSION qhp.Qt3DRenderer.customFilters.Qt.filterAttributes = qt3drenderer $QT_VERSION -qhp.Qt3DRenderer.subprojects = classes +qhp.Qt3DRenderer.subprojects = classes qmltypes examples qhp.Qt3DRenderer.subprojects.classes.title = C++ Classes qhp.Qt3DRenderer.subprojects.classes.indexTitle = Qt3D Renderer C++ Classes qhp.Qt3DRenderer.subprojects.classes.selectors = class fake:headerfile qhp.Qt3DRenderer.subprojects.classes.sortPages = true +qhp.Qt3DRenderer.subprojects.qmltypes.title = QML Types +qhp.Qt3DRenderer.subprojects.qmltypes.indexTitle = Qt3D Renderer QML Types +qhp.Qt3DRenderer.subprojects.qmltypes.selectors = qmlclass +qhp.Qt3DRenderer.subprojects.qmltypes.sortPages = true + +qhp.Qt3DRenderer.subprojects.examples.title = Examples +qhp.Qt3DRenderer.subprojects.examples.indexTitle = Qt3D Examples +qhp.Qt3DRenderer.subprojects.examples.selectors = fake:example +qhp.Qt3DRenderer.subprojects.examples.sortPages = true + tagfile = ../../../doc/qt3drenderer/qt3drenderer.tags depends += qtcore qtqml qtquick qt3dcore qtdoc @@ -40,5 +50,6 @@ Cpp.ignoretokens += QT3DRENDERERSHARED_EXPORT \ Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY -navigation.landingpage = "Qt3D Renderer" +navigation.landingpage = "Qt3D Module" navigation.cppclassespage = "Qt3D Renderer C++ Classes" +navigation.qmltypespage = "Qt3D Renderer QML Types" diff --git a/src/render/doc/src/qt3d-examples.qdoc b/src/render/doc/src/qt3d-examples.qdoc new file mode 100644 index 000000000..4ba413e50 --- /dev/null +++ b/src/render/doc/src/qt3d-examples.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qt3d-examples.html + \ingroup all-examples + \title Qt3D Examples + \brief Examples that demonstrate 2D and 3D rendering using Qt3D. + + The following examples demonstrate 2D and 3D rendering using Qt3D. + + \section1 QML Examples + \annotatedlist qt3d-examples-qml + + \section1 C++ Examples + \annotatedlist qt3d-examples-cpp +*/ diff --git a/src/render/doc/src/qt3drenderer-index.qdoc b/src/render/doc/src/qt3drenderer-index.qdoc deleted file mode 100644 index 0aa93fc9c..000000000 --- a/src/render/doc/src/qt3drenderer-index.qdoc +++ /dev/null @@ -1,77 +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$ -** -****************************************************************************/ - -/*! - \page qt3drender-index.html - \title Qt3D Renderer - \ingroup qt3d-modules - \brief The Qt3D Renderer module contains functionality to support 2D and 3D rendering using Qt3D. - - \section1 Getting Started - - To use Qt3D classes, add this directive into the C++ files: - - \code - #include - \endcode - - To link against the corresponding C++ libraries, add the following to your qmake project file: - - \code - QT += 3drenderer - \endcode - - \section1 Reference - \list - \li \l {Qt3D Renderer C++ Classes} - \li \l {Qt3D Examples} - \endlist -*/ - -/*! - \page qt3d-examples.html - \ingroup all-examples - \title Qt3D Examples - \brief Examples that demostrate 2D and 3D rendering using Qt3D. - - The following examples demonstrate 2D and 3D rendering using Qt3D. - - \section1 QML Examples - \annotatedlist qt3d-examples-qml - - \section1 C++ Examples - \annotatedlist qt3d-examples-cpp -*/ diff --git a/src/render/doc/src/qt3drenderer-module.qdoc b/src/render/doc/src/qt3drenderer-module.qdoc index 25b551ce4..d927070c3 100644 --- a/src/render/doc/src/qt3drenderer-module.qdoc +++ b/src/render/doc/src/qt3drenderer-module.qdoc @@ -40,11 +40,24 @@ \brief The Qt3D Renderer module contains functionality to support 2D and 3D rendering using Qt3D. \ingroup modules + \ingroup qt3d-modules \qtvariable 3drenderer The Qt3D Renderer module provides an aspect, components, and other supporting types necessary to implement 2D and 3D rendering as part of the Qt3D framework. + To use classes from this module, add this directive into the C++ files: + + \code + #include + \endcode + + To link against the corresponding C++ library, add the following to your qmake project file: + + \badcode + QT += 3drenderer + \endcode + Classes, types, and functions are declared under the \l [Qt3DCore]{Qt3D} namespace. */ @@ -52,6 +65,7 @@ \qmlmodule Qt3D.Renderer 2.0 \title Qt3D Renderer QML Types \ingroup qmlmodules + \ingroup qt3d-qmlmodules \brief Provides Qt3D QML types for rendering. diff --git a/src/render/frontend/framegraph-components/qframegraph.cpp b/src/render/frontend/framegraph-components/qframegraph.cpp index 345bff596..08636cc0f 100644 --- a/src/render/frontend/framegraph-components/qframegraph.cpp +++ b/src/render/frontend/framegraph-components/qframegraph.cpp @@ -57,7 +57,7 @@ QFrameGraphPrivate::QFrameGraphPrivate() /*! \class FrameGraph - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.3 \brief Defines the rendering method to be used by the renderer diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp index 9f4d10baa..56232a40a 100644 --- a/src/render/frontend/framegraph-components/qframegraphnode.cpp +++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp @@ -53,7 +53,7 @@ QFrameGraphNodePrivate::QFrameGraphNodePrivate() /*! \class QFrameGraphNode - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief Base class of all FrameGraph configuration nodes. diff --git a/src/render/frontend/framegraph-components/qlayerfilter.cpp b/src/render/frontend/framegraph-components/qlayerfilter.cpp index 5d52b517e..fd51419ca 100644 --- a/src/render/frontend/framegraph-components/qlayerfilter.cpp +++ b/src/render/frontend/framegraph-components/qlayerfilter.cpp @@ -53,7 +53,7 @@ QLayerFilterPrivate::QLayerFilterPrivate() /*! \class QLayerFilter - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief The QLayerFilter class provides ... */ diff --git a/src/render/frontend/qabstracttextureimage.cpp b/src/render/frontend/qabstracttextureimage.cpp index c26503db9..451b275b0 100644 --- a/src/render/frontend/qabstracttextureimage.cpp +++ b/src/render/frontend/qabstracttextureimage.cpp @@ -59,7 +59,7 @@ namespace Qt3D { /*! \class QAbstractTextureImage - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief Encapsulates the necessary information to create an OpenGL texture image. diff --git a/src/render/frontend/qannotation.cpp b/src/render/frontend/qannotation.cpp index e04c26047..567447a47 100644 --- a/src/render/frontend/qannotation.cpp +++ b/src/render/frontend/qannotation.cpp @@ -55,7 +55,7 @@ QAnnotationPrivate::QAnnotationPrivate() /*! \class QAnnotation - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief The QAnnotation class provides ... */ diff --git a/src/render/frontend/qblendstate.cpp b/src/render/frontend/qblendstate.cpp index b1c80f76e..479249fb0 100644 --- a/src/render/frontend/qblendstate.cpp +++ b/src/render/frontend/qblendstate.cpp @@ -66,7 +66,7 @@ public: /*! \class Qt3D::QBlendState - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief Encapsulates blending information. */ @@ -232,7 +232,7 @@ void QBlendState::setDstAlpha(QBlendState::Blending dstAlpha) /*! \class QBlendStateSeparate - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief Encapsulates blending information. */ diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp index c3767baf5..3540d9351 100644 --- a/src/render/frontend/qlayer.cpp +++ b/src/render/frontend/qlayer.cpp @@ -52,7 +52,7 @@ QLayerPrivate::QLayerPrivate() /*! \class QLayer - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief The QLayer class provides ... */ diff --git a/src/render/frontend/qopenglfilter.cpp b/src/render/frontend/qopenglfilter.cpp index 101c28366..6efd47955 100644 --- a/src/render/frontend/qopenglfilter.cpp +++ b/src/render/frontend/qopenglfilter.cpp @@ -65,7 +65,7 @@ public: /*! \class QOpenGLFilter - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief The QOpenGLFilter class provides ... */ diff --git a/src/render/frontend/qparametermapping.cpp b/src/render/frontend/qparametermapping.cpp index 6214e2a17..eff5b93db 100644 --- a/src/render/frontend/qparametermapping.cpp +++ b/src/render/frontend/qparametermapping.cpp @@ -52,7 +52,7 @@ QParameterMappingPrivate::QParameterMappingPrivate() } /*! \class QParameterMapping - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief The QParameterMapping class provides ... */ diff --git a/src/render/frontend/qpointlight.cpp b/src/render/frontend/qpointlight.cpp index f4ade9b5d..c474c1285 100644 --- a/src/render/frontend/qpointlight.cpp +++ b/src/render/frontend/qpointlight.cpp @@ -69,7 +69,7 @@ QPointLightPrivate::QPointLightPrivate() /*! \class QPointLight - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 */ diff --git a/src/render/frontend/qspotlight.cpp b/src/render/frontend/qspotlight.cpp index 2eb947d64..58901b4fd 100644 --- a/src/render/frontend/qspotlight.cpp +++ b/src/render/frontend/qspotlight.cpp @@ -74,7 +74,7 @@ QSpotLightPrivate::QSpotLightPrivate() /*! \class QSpotLight - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 */ diff --git a/src/render/frontend/qtextureimage.cpp b/src/render/frontend/qtextureimage.cpp index 4596bf943..cc3725ebc 100644 --- a/src/render/frontend/qtextureimage.cpp +++ b/src/render/frontend/qtextureimage.cpp @@ -93,7 +93,7 @@ private: /*! \class QTextureImage - \inmodule Qt3DRender + \inmodule Qt3DRenderer \since 5.5 \brief Encapsulates the necessary information to create an OpenGL texture image from an image source. -- cgit v1.2.3 From 5d2cbfa6535e2594fe6f9cc71d08085973b2d908 Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Tue, 16 Jun 2015 10:54:29 +0300 Subject: Documentation for basic shapes example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the documentation for the basic shapes example. Change-Id: I9a69198ddbd188ddaa7bd4ab0fae0dc2315719a9 Reviewed-by: Tomi Korpipää Reviewed-by: Sean Harmer --- .../doc/images/basicshapes-cpp-example.jpg | Bin 0 -> 65014 bytes .../qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc | 37 +++++++++++++++++++++ examples/qt3d/basicshapes-cpp/main.cpp | 7 ++-- examples/qt3d/basicshapes-cpp/scenemodifier.cpp | 11 ++++++ 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg diff --git a/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg b/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg new file mode 100644 index 000000000..cdf694427 Binary files /dev/null and b/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg differ diff --git a/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc index f408bc43b..004b06817 100644 --- a/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc +++ b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc @@ -29,4 +29,41 @@ \example basicshapes-cpp \title Qt3D: Basic Shapes C++ Example \ingroup qt3d-examples-cpp + \brief Shows four basic shapes that Qt3D offers. + + The Basic Shapes examples shows four basic shapes that Qt3D offers, a torus, + a cylinder, a cube and a sphere. The example also shows how to embed a Qt3D scene + into a widget and connect with other widgets. + + \image basicshapes-cpp-example.jpg + + As an example let's go through how to set up a torus mesh. First instantiate + the \c QTorusMesh, and then set the mesh specific parameters, that for torus are + radius, minor radius and how many rings and slices. + + \snippet basicshapes-cpp/scenemodifier.cpp 0 + + The size and position of the torus can be adjusted with transform components. + We create scale, translation and rotation components and add them into the + \c QTransform component. + + \snippet basicshapes-cpp/scenemodifier.cpp 1 + + To change the diffuse color of the mesh we create a \c QPhongMaterial and set + its diffuse color. + + \snippet basicshapes-cpp/scenemodifier.cpp 2 + + The final step is to add the torus into an entity tree, and we do that by creating + a \c QEntity with parent entity and adding the previously created mesh, material + and transform components into it. + + \snippet basicshapes-cpp/scenemodifier.cpp 3 + + You can control the visibility of the entity by defining if it has parent + or not, i.e. whether it is part of entity tree or not. + + \snippet basicshapes-cpp/scenemodifier.cpp 4 + + */ diff --git a/examples/qt3d/basicshapes-cpp/main.cpp b/examples/qt3d/basicshapes-cpp/main.cpp index dc2317948..1e122c65e 100644 --- a/examples/qt3d/basicshapes-cpp/main.cpp +++ b/examples/qt3d/basicshapes-cpp/main.cpp @@ -76,12 +76,9 @@ int main(int argc, char **argv) QApplication app(argc, argv); Window *view = new Window(); QWidget *container = QWidget::createWindowContainer(view); - QSize screenSize = view->screen()->size(); - container->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 1.5)); + container->setMinimumSize(QSize(200, 100)); container->setMaximumSize(screenSize); - container->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - container->setFocusPolicy(Qt::StrongFocus); QWidget *widget = new QWidget; QHBoxLayout *hLayout = new QHBoxLayout(widget); @@ -176,7 +173,7 @@ int main(int argc, char **argv) // Show window widget->show(); - widget->resize(1280, 600); + widget->resize(1200, 800); // Update the aspect ratio QSize widgetSize = container->size(); diff --git a/examples/qt3d/basicshapes-cpp/scenemodifier.cpp b/examples/qt3d/basicshapes-cpp/scenemodifier.cpp index 030db1596..b5c636b0f 100644 --- a/examples/qt3d/basicshapes-cpp/scenemodifier.cpp +++ b/examples/qt3d/basicshapes-cpp/scenemodifier.cpp @@ -41,14 +41,18 @@ SceneModifier::SceneModifier(Qt3D::QEntity *rootEntity) : m_rootEntity(rootEntity) { + // Torus shape data + //! [0] m_torus = new Qt3D::QTorusMesh(); m_torus->setRadius(1.0f); m_torus->setMinorRadius(0.4f); m_torus->setRings(100); m_torus->setSlices(20); + //! [0] // TorusMesh Transform + //! [1] Qt3D::QScaleTransform *torusScale = new Qt3D::QScaleTransform(); Qt3D::QTranslateTransform *torusTranslation = new Qt3D::QTranslateTransform(); Qt3D::QRotateTransform *torusRotation = new Qt3D::QRotateTransform(); @@ -62,15 +66,20 @@ SceneModifier::SceneModifier(Qt3D::QEntity *rootEntity) torusTransforms->addTransform(torusRotation); torusTransforms->addTransform(torusTranslation); torusTransforms->addTransform(torusScale); + //! [1] + //! [2] Qt3D::QPhongMaterial *torusMaterial = new Qt3D::QPhongMaterial(); torusMaterial->setDiffuse(QColor(QRgb(0xbeb32b))); + //! [2] // Torus + //! [3] m_torusEntity = new Qt3D::QEntity(m_rootEntity); m_torusEntity->addComponent(m_torus); m_torusEntity->addComponent(torusMaterial); m_torusEntity->addComponent(torusTransforms); + //! [3] // Cylinder shape data Qt3D::QCylinderMesh *cylinder = new Qt3D::QCylinderMesh(); @@ -157,10 +166,12 @@ SceneModifier::~SceneModifier() { } +//! [4] void SceneModifier::enableTorus(bool enabled) { m_torusEntity->setParent(enabled ? m_rootEntity : Q_NULLPTR); } +//! [4] void SceneModifier::enableCylinder(bool enabled) { -- cgit v1.2.3 From b3479775e23f42f0314af54442133e86f9737301 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 18 Jun 2015 13:51:18 +0100 Subject: Use fully qualified argument types in signals Task-number: QTBUG-46752 Change-Id: I72f9c778eebf327d87d42a1eb20093700ee3e9eb Reviewed-by: Paul Lemire Reviewed-by: Marc Mutz --- src/input/qkeyboardinput.h | 86 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/input/qkeyboardinput.h b/src/input/qkeyboardinput.h index 5875a84d9..d94d7b6f5 100644 --- a/src/input/qkeyboardinput.h +++ b/src/input/qkeyboardinput.h @@ -65,49 +65,49 @@ Q_SIGNALS: void controllerChanged(); void focusChanged(); - void digit0Pressed(Q3DKeyEvent *event); - void digit1Pressed(Q3DKeyEvent *event); - void digit2Pressed(Q3DKeyEvent *event); - void digit3Pressed(Q3DKeyEvent *event); - void digit4Pressed(Q3DKeyEvent *event); - void digit5Pressed(Q3DKeyEvent *event); - void digit6Pressed(Q3DKeyEvent *event); - void digit7Pressed(Q3DKeyEvent *event); - void digit8Pressed(Q3DKeyEvent *event); - void digit9Pressed(Q3DKeyEvent *event); - - void leftPressed(Q3DKeyEvent *event); - void rightPressed(Q3DKeyEvent *event); - void upPressed(Q3DKeyEvent *event); - void downPressed(Q3DKeyEvent *event); - void tabPressed(Q3DKeyEvent *event); - void backtabPressed(Q3DKeyEvent *event); - - void asteriskPressed(Q3DKeyEvent *event); - void numberSignPressed(Q3DKeyEvent *event); - void escapePressed(Q3DKeyEvent *event); - void returnPressed(Q3DKeyEvent *event); - void enterPressed(Q3DKeyEvent *event); - void deletePressed(Q3DKeyEvent *event); - void spacePressed(Q3DKeyEvent *event); - void backPressed(Q3DKeyEvent *event); - void cancelPressed(Q3DKeyEvent *event); - void selectPressed(Q3DKeyEvent *event); - void yesPressed(Q3DKeyEvent *event); - void noPressed(Q3DKeyEvent *event); - void context1Pressed(Q3DKeyEvent *event); - void context2Pressed(Q3DKeyEvent *event); - void context3Pressed(Q3DKeyEvent *event); - void context4Pressed(Q3DKeyEvent *event); - void callPressed(Q3DKeyEvent *event); - void hangupPressed(Q3DKeyEvent *event); - void flipPressed(Q3DKeyEvent *event); - void menuPressed(Q3DKeyEvent *event); - void volumeUpPressed(Q3DKeyEvent *event); - void volumeDownPressed(Q3DKeyEvent *event); - - void pressed(Q3DKeyEvent *event); - void released(Q3DKeyEvent *event); + void digit0Pressed(Qt3D::Q3DKeyEvent *event); + void digit1Pressed(Qt3D::Q3DKeyEvent *event); + void digit2Pressed(Qt3D::Q3DKeyEvent *event); + void digit3Pressed(Qt3D::Q3DKeyEvent *event); + void digit4Pressed(Qt3D::Q3DKeyEvent *event); + void digit5Pressed(Qt3D::Q3DKeyEvent *event); + void digit6Pressed(Qt3D::Q3DKeyEvent *event); + void digit7Pressed(Qt3D::Q3DKeyEvent *event); + void digit8Pressed(Qt3D::Q3DKeyEvent *event); + void digit9Pressed(Qt3D::Q3DKeyEvent *event); + + void leftPressed(Qt3D::Q3DKeyEvent *event); + void rightPressed(Qt3D::Q3DKeyEvent *event); + void upPressed(Qt3D::Q3DKeyEvent *event); + void downPressed(Qt3D::Q3DKeyEvent *event); + void tabPressed(Qt3D::Q3DKeyEvent *event); + void backtabPressed(Qt3D::Q3DKeyEvent *event); + + void asteriskPressed(Qt3D::Q3DKeyEvent *event); + void numberSignPressed(Qt3D::Q3DKeyEvent *event); + void escapePressed(Qt3D::Q3DKeyEvent *event); + void returnPressed(Qt3D::Q3DKeyEvent *event); + void enterPressed(Qt3D::Q3DKeyEvent *event); + void deletePressed(Qt3D::Q3DKeyEvent *event); + void spacePressed(Qt3D::Q3DKeyEvent *event); + void backPressed(Qt3D::Q3DKeyEvent *event); + void cancelPressed(Qt3D::Q3DKeyEvent *event); + void selectPressed(Qt3D::Q3DKeyEvent *event); + void yesPressed(Qt3D::Q3DKeyEvent *event); + void noPressed(Qt3D::Q3DKeyEvent *event); + void context1Pressed(Qt3D::Q3DKeyEvent *event); + void context2Pressed(Qt3D::Q3DKeyEvent *event); + void context3Pressed(Qt3D::Q3DKeyEvent *event); + void context4Pressed(Qt3D::Q3DKeyEvent *event); + void callPressed(Qt3D::Q3DKeyEvent *event); + void hangupPressed(Qt3D::Q3DKeyEvent *event); + void flipPressed(Qt3D::Q3DKeyEvent *event); + void menuPressed(Qt3D::Q3DKeyEvent *event); + void volumeUpPressed(Qt3D::Q3DKeyEvent *event); + void volumeDownPressed(Qt3D::Q3DKeyEvent *event); + + void pressed(Qt3D::Q3DKeyEvent *event); + void released(Qt3D::Q3DKeyEvent *event); protected: QKeyboardInput(QKeyboardInputPrivate &dd, QNode *parent = 0); -- cgit v1.2.3 From b71f09d143002f15abfd4a407651544942a75c44 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Fri, 12 Jun 2015 19:08:00 +0100 Subject: Add some documentation about the framegraph concepts Change-Id: I9f2e21d3277d69a396a564ffd58c53ee91b37d45 Reviewed-by: Leena Miettinen Reviewed-by: Sean Harmer --- src/core/doc/src/qt3d-overview.qdoc | 7 +- src/core/doc/src/qt3dcore-index.qdoc | 5 +- src/render/doc/images/deferred-framegraph.png | Bin 0 -> 40467 bytes .../doc/images/framegraph-parallel-build.png | Bin 0 -> 90073 bytes src/render/doc/images/multiviewport-1.png | Bin 0 -> 49171 bytes src/render/doc/images/multiviewport-2.png | Bin 0 -> 54477 bytes src/render/doc/images/multiviewport.png | Bin 0 -> 549293 bytes src/render/doc/images/simple-framegraph.png | Bin 0 -> 37502 bytes src/render/doc/src/externalresources.qdoc | 40 ++ src/render/doc/src/qt3drenderer-framegraph.qdoc | 513 +++++++++++++++++++++ src/render/doc/src/qt3drenderer-module.qdoc | 11 + 11 files changed, 571 insertions(+), 5 deletions(-) create mode 100644 src/render/doc/images/deferred-framegraph.png create mode 100644 src/render/doc/images/framegraph-parallel-build.png create mode 100644 src/render/doc/images/multiviewport-1.png create mode 100644 src/render/doc/images/multiviewport-2.png create mode 100644 src/render/doc/images/multiviewport.png create mode 100644 src/render/doc/images/simple-framegraph.png create mode 100644 src/render/doc/src/externalresources.qdoc create mode 100644 src/render/doc/src/qt3drenderer-framegraph.qdoc diff --git a/src/core/doc/src/qt3d-overview.qdoc b/src/core/doc/src/qt3d-overview.qdoc index 48788b5c7..a02f32d83 100644 --- a/src/core/doc/src/qt3d-overview.qdoc +++ b/src/core/doc/src/qt3d-overview.qdoc @@ -74,9 +74,10 @@ \section1 Configurable Renderer To combine support for both C++ and QML APIs with having a fully - configurable renderer, the concept of a \e framegraph was introduced. - While a \e scenegraph is a data-driven description of \e what to render, a - framegraph is a data-driven description of \e how to render it. + configurable renderer, the concept of a \e framegraph was introduced. While + a \e scenegraph is a data-driven description of \e what to render, a \l + {Qt3D Renderer Framegraph}{framegraph} is a data-driven description of \e + how to render it. A framegraph enables developers to choose between a simple forward renderer, including a z-fill pass, or using a deferred renderer for example. It also diff --git a/src/core/doc/src/qt3dcore-index.qdoc b/src/core/doc/src/qt3dcore-index.qdoc index 5c3bc9794..9e01e25ff 100644 --- a/src/core/doc/src/qt3dcore-index.qdoc +++ b/src/core/doc/src/qt3dcore-index.qdoc @@ -79,8 +79,9 @@ \section1 Overview - The high level design and motivation for Qt3D is described in the - \l {Qt3D Overview}. + The high level design and motivation for Qt3D is described in the \l {Qt3D + Overview}. The Qt3D Renderer aspect offers support for data-driven + configuration as described in \l {Qt3D Renderer Framegraph}. \section1 Reference \list diff --git a/src/render/doc/images/deferred-framegraph.png b/src/render/doc/images/deferred-framegraph.png new file mode 100644 index 000000000..913539d50 Binary files /dev/null and b/src/render/doc/images/deferred-framegraph.png differ diff --git a/src/render/doc/images/framegraph-parallel-build.png b/src/render/doc/images/framegraph-parallel-build.png new file mode 100644 index 000000000..fe3fdd176 Binary files /dev/null and b/src/render/doc/images/framegraph-parallel-build.png differ diff --git a/src/render/doc/images/multiviewport-1.png b/src/render/doc/images/multiviewport-1.png new file mode 100644 index 000000000..27b9c04d5 Binary files /dev/null and b/src/render/doc/images/multiviewport-1.png differ diff --git a/src/render/doc/images/multiviewport-2.png b/src/render/doc/images/multiviewport-2.png new file mode 100644 index 000000000..397cde96f Binary files /dev/null and b/src/render/doc/images/multiviewport-2.png differ diff --git a/src/render/doc/images/multiviewport.png b/src/render/doc/images/multiviewport.png new file mode 100644 index 000000000..1ad5f3a5c Binary files /dev/null and b/src/render/doc/images/multiviewport.png differ diff --git a/src/render/doc/images/simple-framegraph.png b/src/render/doc/images/simple-framegraph.png new file mode 100644 index 000000000..334e995f0 Binary files /dev/null and b/src/render/doc/images/simple-framegraph.png differ diff --git a/src/render/doc/src/externalresources.qdoc b/src/render/doc/src/externalresources.qdoc new file mode 100644 index 000000000..158ca1ed2 --- /dev/null +++ b/src/render/doc/src/externalresources.qdoc @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \externalpage http://en.wikipedia.org/wiki/Z-buffering + \title early z-fill pass +*/ diff --git a/src/render/doc/src/qt3drenderer-framegraph.qdoc b/src/render/doc/src/qt3drenderer-framegraph.qdoc new file mode 100644 index 000000000..2fddec27f --- /dev/null +++ b/src/render/doc/src/qt3drenderer-framegraph.qdoc @@ -0,0 +1,513 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \page qt3drenderer-framegraph.html + \title Qt3D Renderer Framegraph + + \brief A framegraph is the data structure that controls how a scene is + rendered. + + The Qt3D Renderer aspect allows for the rendering algorithm to be entirely + data-driven. The controlling data structure is known as the \e framegraph. + Similar to how the Qt3D ECS (entity component system) allows you to define + a so-called Scenegraph by building a scene from a tree of Entities and + Components, the framegraph is also a tree structure but one used for a + different purpose. Namely, controlling \e how the scene is rendered. + + Over the course of rendering a single frame, a 3D renderer will likely + change state many times. The number and nature of these state changes + depends upon not only which materials (shaders, mesh geometry, textures and + uniform variables) are found within the scene, but also upon which high + level rendering scheme you are using. + + For example, using a traditional simple \e{forward rendering} scheme is + very different to using a \e{deferred rendering} approach. Other features + such as reflections, shadows, multiple viewports, and early z-fill passes + all change which states a renderer needs to set over the course of a frame + and when those state changes need to occur. + + As a comparison, the \l {qtquick-visualcanvas-scenegraph}{Qt Quick 2 + scenegraph renderer} responsible for drawing Qt Quick 2 scenes is + hard-wired in C++ to do things like batching of primitives and rendering + opaque items followed by rendering of transparent items. In the case of Qt + Quick 2 that is perfectly fine as that covers all of the requirements. As + you can see from some of the examples listed above, such a hard-wired + renderer is not likely to be flexible enough for generic 3D scenes given + the multitude of rendering methods available. Or if a renderer could be + made flexible enough to cover all such cases, its performance would likely + suffer from being too general. To make matters worse, more rendering + methods are being researched all of the time. We therefore needed an + approach that is \e {both flexible and extensible} whilst being simple to + use and maintain. Enter the framegraph! + + Each node in the framegraph defines a part of the configuration the + renderer will use to render the scene. The position of a node in the + framegraph tree determines when and where the subtree rooted at that node + will be the active configuration in the rendering pipeline. As we will see + later, the renderer traverses this tree in order to build up the state + needed for your rendering algorithm at each point in the frame. + + Obviously if you just want to render a simple cube onscreen you may think + this is overkill. However, as soon as you want to start doing slightly more + complex scenes this comes in handy. For the common cases, Qt3D provides + some example framegraphs that are ready to use out of the box. + + We will demonstrate the flexibility of the framegraph concept by presenting a few + examples and the resulting framegraphs. + + Please note that unlike the Scenegraph which is composed of Entities and + Components, the framegraph is only composed of nested nodes which are all + subclasses of Qt3D::QFrameGraphNode. This is because the framegraph nodes + are not simulated objects in our virtual world, but rather supporting + information. + + We will soon see how to + construct our first simple framegraph but before that we will introduce + the framegraph nodes available to you. Also as with the Scenegraph tree, + the QML and C++ APIs are a 1 to 1 match so you can favor the one you like + best. For the sake of readability and conciseness, the QML API was chosen + for this article. + + // TODO: Add list of framegraph node types + + The beauty of the framegraph is that combining these simple node types, it + is possible to configure the renderer to suit your specific needs without + touching any hairy, low-level C/C++ rendering code at all. + + \section1 FrameGraph Rules + + In order to construct a correctly functioning framegraph tree, + you should know a few rules about how it is traversed and how to feed it to + the Qt3D renderer. + + \section2 Setting the Framegraph + + The FrameGraph tree should be assigned to the activeFrameGraph property of + a QFrameGraph component, itself being a component of the root entity in the + Qt3D scene. This is what makes it the active framegraph for the renderer. + Of course, since this is a QML property binding, the active framegraph (or + parts of it) can be changed on the fly at runtime. For example, if you want + to use different rendering approaches for indoor and outdoor scenes or to + enable or disable some special effect. + + \badcode + Entity { + id: sceneRoot + components: FrameGraph { + activeFrameGraph: ... // FrameGraph tree + } + } + \endcode + + \note activeFrameGraph is the default property of the FrameGraph component + in QML. + + \badcode + Entity { + id: sceneRoot + components: FrameGraph { + ... // FrameGraph tree + } + } + \endcode + + \section2 How the Framegraph Is Used + + \list + \li The Qt3D renderer performs a \e{depth first traversal} of the + framegraph tree. Note that, because the traversal is depth first, + the \e {order in which you define nodes is important}. + \li When the renderer reaches a leaf node of the framegraph, it + collects together all of the state specified by the path from the + leaf node to the root node. This defines the state used to render + a section of the frame. If you are interested in the internals of + Qt3D, this collection of state is called a \e RenderView. + \li Given the configuration contained in a RenderView, the renderer + collects together all of the Entities in the Scenegraph to be + rendered, and from them builds a set of \e RenderCommands and + associates them with the RenderView. + \li The combination of RenderView and set of RenderCommands is passed + over for submission to OpenGL. + \li When this is repeated for each leaf node in the framegraph, the + frame is complete and the renderer calls + QOpenGLContext::swapBuffers() to display the frame. + \endlist + + At its heart, the framegraph is a data-driven method for configuring the + Qt3D renderer. Due to its data-driven nature, we can change configuration + at runtime, allow non-C++ developers or designers to change the structure + of a frame, and try out new rendering approaches without having to write + thousands of lines of boiler plate code. + + + \section1 Framegraph Examples + + Now that you know the rules to abide by when writing a framegraph tree, we + will go over a few examples and break them down. + + \section2 A Simple Forward Renderer + + Forward rendering is when you use OpenGL in its traditional manner and + render directly to the backbuffer one object at a time shading each one as + we go. This is opposed to \l {Deferred Renderer}{deferred rendering} where + we render to an intermediate \e G-buffer. Here is a simple FrameGraph that + can be used for forward rendering: + + \badcode + Viewport { + rect: Qt.rect(0.0, 0.0, 1.0, 1.0) + property alias camera: cameraSelector.camera + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + + CameraSelector { + id: cameraSelector + } + } + } + \endcode + + As you can see, this tree has a single leaf and is composed of 3 nodes in + total as shown in the following diagram. + + \image simple-framegraph.png + + Using the rules defined \l {Framegraph Rules}{above}, this framegraph tree yields a single + RenderView with the following configuration: + + \list + \li Leaf Node -> RenderView + \list + \li Viewport that fills the entire screen (uses normalized + coordinates to make it easy to support nested viewports) + \li Color and Depth buffers are set to be cleared + \li Camera specified in the exposed camera property + \endlist + \endlist + + Several different FrameGraph trees can produce the same rendering result. + As long as the state collected from leaf to root is the same, the result + will also be the same. It is best to put state that remains constant longest + nearer to the root of the framegraph as this will result in fewer leaf + nodes, and hence, fewer RenderViews overall. + + \badcode + Viewport { + rect: Qt.rect(0.0, 0.0, 1.0, 1.0) + property alias camera: cameraSelector.camera + + CameraSelector { + id: cameraSelector + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + } + } + } + \endcode + + \badcode + CameraSelector { + Viewport { + rect: Qt.rect(0.0, 0.0, 1.0, 1.0) + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + } + } + } + \endcode + + \section2 A Multi Viewport FrameGraph + + Let us move on to a slightly more complex example that renders a Scenegraph + from the point of view of 4 virtual cameras into the 4 quadrants of the + window. This is a common configuration for 3D CAD or modelling tools or + could be adjusted to help with rendering a rear-view mirror in a car racing + game or a CCTV camera display. + + \image multiviewport.png + + \badcode + Viewport { + id: mainViewport + rect: Qt.rect(0, 0, 1, 1) + property alias Camera: cameraSelectorTopLeftViewport.camera + property alias Camera: cameraSelectorTopRightViewport.camera + property alias Camera: cameraSelectorBottomLeftViewport.camera + property alias Camera: cameraSelectorBottomRightViewport.camera + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + } + + Viewport { + id: topLeftViewport + rect: Qt.rect(0, 0, 0.5, 0.5) + CameraSelector { id: cameraSelectorTopLeftViewport } + } + + Viewport { + id: topRightViewport + rect: Qt.rect(0.5, 0, 0.5, 0.5) + CameraSelector { id: cameraSelectorTopRightViewport } + } + + Viewport { + id: bottomLeftViewport + rect: Qt.rect(0, 0.5, 0.5, 0.5) + CameraSelector { id: cameraSelectorBottomLeftViewport } + } + + Viewport { + id: bottomRightViewport + rect: Qt.rect(0.5, 0.5, 0.5, 0.5) + CameraSelector { id: cameraSelectorBottomRightViewport } + } + } + \endcode + + This tree is a bit more complex with 5 leaves. Following the same rules as + before we construct 5 RenderView objects from the FrameGraph. The following + diagrams show the construction for the first two RenderViews. The remaining + RenderViews are very similar to the second diagram just with the other + sub-trees. + + \image multiviewport-1.png + + \image multiviewport-2.png + + In full, the RenderViews created are: + + \list + \li RenderView (1) + \list + \li Fullscreen viewport defined + \li Color and Depth buffers are set to be cleared + \endlist + + \li RenderView (2) + \list + \li Fullscreen viewport defined + \li Sub viewport defined (rendering viewport will be scaled relative to its parent) + \li CameraSelector specified + \endlist + + \li RenderView (3) + \list + \li Fullscreen viewport defined + \li Sub viewport defined (rendering viewport will be scaled relative to its parent) + \li CameraSelector specified + \endlist + + \li RenderView (4) + \list + \li Fullscreen viewport defined + \li Sub viewport defined (rendering viewport will be scaled relative to its parent) + \li CameraSelector specified + \endlist + + \li RenderView (5) + \list + \li Fullscreen viewport defined + \li Sub viewport defined (rendering viewport will be scaled relative to its parent) + \li CameraSelector specified + \endlist + \endlist + + However, in this case the \e {order is important}. If the ClearBuffer node + were to be the last instead of the first, this would result in a black + screen for the simple reason that everything would be cleared right after + having been so carefully rendered. For a similar reason, it could not be + used as the root of the FrameGraph as that would result in a call to clear + the whole screen for each of our viewports. + + Although the declaration order of the FrameGraph is important, Qt3D is able + to process each RenderView in parallel as each RenderView is independent of + the others for the purposes of generating a set of RenderCommands to be + submitted whilst the RenderView's state is in effect. + + Qt3D uses a task-based approach to parallelism which naturally scales up + with the number of available cores. This is shown in the following diagram + for the previous example. + + \image framegraph-parallel-build.png + + The RenderCommands for the RenderViews can be generated in parallel across + many cores, and as long as we take care to submit the RenderViews in the + correct order on the dedicated OpenGL submission thread, the resulting + scene will be rendered correctly. + + \section2 Deferred Renderer + + When it comes to rendering, deferred rendering is a different beast in + terms of renderer configuration compared to forward rendering. Instead of + drawing each mesh and applying a shader effect to shade it, deferred + rendering adopts a \e {two render pass} method. + + First all the meshes in the scene are drawn using the same shader that will + output, usually for each fragment, at least four values: + + \list + \li World normal vector + \li Color (or some other material properties) + \li Depth + \li World position vector + \endlist + + Each of these values will be stored in a texture. The normal, color, depth, + and position textures form what is called the G-Buffer. Nothing is drawn + onscreen during the first pass, but rather drawn into the G-Buffer ready + for later use. + + Once all the meshes have been drawn, the G-Buffer is filled with all the + meshes that can currently be seen by the camera. The second render pass is + then used to render the scene to the back buffer with the final color + shading by reading the normal, color, and position values from the G-buffer + textures and outputting a color onto a full screen quad. + + The advantage of that technique is that the heavy computing power required + for complex effects is only used during the second pass only on the + elements that are actually being seen by the camera. The first pass does + not cost much processing power as every mesh is being drawn with a simple + shader. Deferred rendering, therefore, decouples shading and lighting from + the number of objects in a scene and instead couples it to the resolution + of the screen (and G-Buffer). This is a technique that has been used in + many games due to the ability to use large numbers of dynamic lights at + the expense of additional GPU memory usage. + + \badcode + Viewport { + rect: Qt.rect(0.0, 0.0, 1.0, 1.0) + + property alias gBuffer: gBufferTargetSelector.target + property alias camera: sceneCameraSelector.camera + + LayerFilter { + layers: "scene" + + RenderTargetSelector { + id: gBufferTargetSelector + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + + RenderPassFilter { + id: geometryPass + includes: Annotation { name: "pass"; value: "geometry" } + + CameraSelector { + id: sceneCameraSelector + } + } + } + } + } + + LayerFilter { + layers: "screenQuad" + + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer + + RenderPassFilter { + id: finalPass + includes: Annotation { name: "pass"; value: "final" } + } + } + } + } + \endcode + + Graphically, the resulting framegraph looks like: + + \image deferred-framegraph.png + + And the resulting RenderViews are: + + \list + \li RenderView (1) + \list + \li Define a viewport that fills the whole screen + \li Select all Entities that have a Layer component matching + \c "scene" + \li Set the \c gBuffer as the active render target + \li Clear the color and depth on the currently bound render target + (the \c gBuffer) + \li Select only Entities in the scene that have a Material and + Technique matching the annotations in the RenderPassFilter + \li Specify which camera should be used + \endlist + + \li RenderView (2) + \list + \li Define a viewport that fills the whole screen + \li Select all Entities that have a Layer component matching + \c "screenQuad" + \li Clear the color and depth buffers on the currently bound + framebuffer (the screen) + \li Select only Entities in the scene that have a Material and + Technique matching the annotations in the RenderPassFilter + \endlist + \endlist + + \section1 Other Benefits of the framegraph + + Since the FrameGraph tree is entirely data-driven and can be modified dynamically at runtime, you can: + + \list + \li Have different framegraph trees for different platforms and + hardware and select the most appropriate at runtime + \li Easily add and enable visual debugging in a scene + \li Use different FrameGraph trees depending on the nature of what + you need to render for a particular region of the scene + \li Implement a new rendering technique without having to + modify Qt3D's internals + \endlist + + \section1 Conclusion + + We have introduced the FrameGraph and the node types that compose it. We + then went on to discuss a few examples to illustrate the framegraph + building rules and how the Qt3D engine uses the framegraph behind the + scenes. By now you should have a pretty good overview of the FrameGraph and + how it can be used (perhaps to add an \l {early z-fill pass} to a + forward renderer). Also you should always keep in mind that the FrameGraph + is a tool for you to use so that you are not tied down to the provided + renderer and materials that Qt3D provides out of the box. +*/ diff --git a/src/render/doc/src/qt3drenderer-module.qdoc b/src/render/doc/src/qt3drenderer-module.qdoc index d927070c3..437920301 100644 --- a/src/render/doc/src/qt3drenderer-module.qdoc +++ b/src/render/doc/src/qt3drenderer-module.qdoc @@ -59,6 +59,17 @@ \endcode Classes, types, and functions are declared under the \l [Qt3DCore]{Qt3D} namespace. + + \section1 Overview + + The Qt3D Renderer aspect offers support for data-driven configuration as described + in \l {Qt3D Renderer Framegraph}. + + \section1 Reference + \list + \li \l {Qt3D Renderer C++ Classes} + \li \l {Qt3D Examples} + \endlist */ /*! -- cgit v1.2.3