diff options
Diffstat (limited to 'src/quick3d/quick3drender')
48 files changed, 1096 insertions, 994 deletions
diff --git a/src/quick3d/quick3drender/items/items.pri b/src/quick3d/quick3drender/items/items.pri index 99ffbc801..82fbdebc0 100644 --- a/src/quick3d/quick3drender/items/items.pri +++ b/src/quick3d/quick3drender/items/items.pri @@ -3,40 +3,40 @@ HEADERS += \ $$PWD/quick3dbuffer_p.h \ $$PWD/quick3deffect_p.h \ $$PWD/quick3dgeometry_p.h \ + $$PWD/quick3dlayerfilter_p.h \ $$PWD/quick3dmaterial_p.h \ $$PWD/quick3drenderpass_p.h \ $$PWD/quick3drenderpassfilter_p.h \ - $$PWD/quick3drendertarget_p.h \ $$PWD/quick3drendertargetselector_p.h \ $$PWD/quick3dscene_p.h \ $$PWD/quick3dshaderdata_p.h \ $$PWD/quick3dshaderdataarray_p.h \ - $$PWD/quick3dsortmethod_p.h \ $$PWD/quick3dstateset_p.h \ $$PWD/quick3dtechnique_p.h \ $$PWD/quick3dtexture_p.h \ $$PWD/quick3dviewport_p.h \ $$PWD/quick3dparameter_p_p.h \ - $$PWD/quick3dparameter_p.h + $$PWD/quick3dparameter_p.h \ + $$PWD/quick3drendertargetoutput_p.h SOURCES += \ $$PWD/quick3drenderpassfilter.cpp \ - $$PWD/quick3drendertarget.cpp \ $$PWD/quick3dtechniquefilter.cpp \ $$PWD/quick3dviewport.cpp \ + $$PWD/quick3dlayerfilter.cpp \ $$PWD/quick3dmaterial.cpp \ $$PWD/quick3dtechnique.cpp \ $$PWD/quick3deffect.cpp \ $$PWD/quick3dscene.cpp \ $$PWD/quick3dtexture.cpp \ $$PWD/quick3drenderpass.cpp \ - $$PWD/quick3dsortmethod.cpp \ $$PWD/quick3dparameter.cpp \ $$PWD/quick3dshaderdata.cpp \ $$PWD/quick3dshaderdataarray.cpp \ $$PWD/quick3dstateset.cpp \ $$PWD/quick3drendertargetselector.cpp \ $$PWD/quick3dgeometry.cpp \ - $$PWD/quick3dbuffer.cpp + $$PWD/quick3dbuffer.cpp \ + $$PWD/quick3drendertargetoutput.cpp INCLUDEPATH += $$PWD diff --git a/src/quick3d/quick3drender/items/quick3dbuffer.cpp b/src/quick3d/quick3drender/items/quick3dbuffer.cpp index 70753d6ab..e2a40da78 100644 --- a/src/quick3d/quick3drender/items/quick3dbuffer.cpp +++ b/src/quick3d/quick3drender/items/quick3dbuffer.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -52,10 +55,10 @@ namespace Quick { Quick3DBuffer::Quick3DBuffer(QObject *parent) : QObject(parent) - , m_engine(Q_NULLPTR) - , m_v4engine(Q_NULLPTR) + , m_engine(nullptr) + , m_v4engine(nullptr) { - QObject::connect(parentBuffer(), &Qt3DRender::QAbstractBuffer::dataChanged, this, &Quick3DBuffer::bufferDataChanged); + QObject::connect(parentBuffer(), &Qt3DRender::QBuffer::dataChanged, this, &Quick3DBuffer::bufferDataChanged); } QByteArray Quick3DBuffer::convertToRawData(const QJSValue &jsValue) @@ -87,7 +90,7 @@ void Quick3DBuffer::setBufferData(const QVariant &bufferData) void Quick3DBuffer::initEngines() { - if (m_engine == Q_NULLPTR) { + if (m_engine == nullptr) { m_engine = qmlEngine(parent()); m_v4engine = QQmlEnginePrivate::getV4Engine(m_engine); } diff --git a/src/quick3d/quick3drender/items/quick3dbuffer_p.h b/src/quick3d/quick3drender/items/quick3dbuffer_p.h index d2933ddc9..512e6936c 100644 --- a/src/quick3d/quick3drender/items/quick3dbuffer_p.h +++ b/src/quick3d/quick3drender/items/quick3dbuffer_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -71,7 +74,7 @@ class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DBuffer : public QObject Q_OBJECT Q_PROPERTY(QVariant data READ bufferData WRITE setBufferData NOTIFY bufferDataChanged) public: - explicit Quick3DBuffer(QObject *parent = Q_NULLPTR); + explicit Quick3DBuffer(QObject *parent = nullptr); inline QBuffer *parentBuffer() const { return qobject_cast<QBuffer *>(parent()); } QVariant bufferData() const; diff --git a/src/quick3d/quick3drender/items/quick3deffect.cpp b/src/quick3d/quick3drender/items/quick3deffect.cpp index 885cb4112..9d4ce934a 100644 --- a/src/quick3d/quick3drender/items/quick3deffect.cpp +++ b/src/quick3d/quick3drender/items/quick3deffect.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -79,7 +82,7 @@ QTechnique *Quick3DEffect::techniqueAt(QQmlListProperty<QTechnique> *list, int i Quick3DEffect *eff = qobject_cast<Quick3DEffect*>(list->object); if (eff) return qobject_cast<QTechnique*>(eff->parentEffect()->techniques().at(index)); - return Q_NULLPTR; + return nullptr; } int Quick3DEffect::techniqueCount(QQmlListProperty<QTechnique> *list) @@ -96,7 +99,8 @@ void Quick3DEffect::clearTechniqueList(QQmlListProperty<QTechnique> *list) if (eff) { // Ownership of techniques is handled by the QmlEngine so we shouldn't class clearTechniques // which deletes techniques - Q_FOREACH (QTechnique *tech, eff->parentEffect()->techniques()) + const auto techniques = eff->parentEffect()->techniques(); + for (QTechnique *tech : techniques) eff->parentEffect()->removeTechnique(tech); } } @@ -122,7 +126,8 @@ int Quick3DEffect::parametersCount(QQmlListProperty<QParameter> *list) void Quick3DEffect::clearParameterList(QQmlListProperty<QParameter> *list) { Quick3DEffect *effect = qobject_cast<Quick3DEffect *>(list->object); - Q_FOREACH (QParameter *p, qobject_cast<QEffect *>(effect->parentEffect())->parameters()) + const auto parameters = qobject_cast<QEffect *>(effect->parentEffect())->parameters(); + for (QParameter *p : parameters) qobject_cast<QEffect *>(effect->parentEffect())->removeParameter(p); } diff --git a/src/quick3d/quick3drender/items/quick3deffect_p.h b/src/quick3d/quick3drender/items/quick3deffect_p.h index 51d9428c3..50152e2af 100644 --- a/src/quick3d/quick3drender/items/quick3deffect_p.h +++ b/src/quick3d/quick3drender/items/quick3deffect_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3dgeometry.cpp b/src/quick3d/quick3drender/items/quick3dgeometry.cpp index 5b7e35722..84c02d7c9 100644 --- a/src/quick3d/quick3drender/items/quick3dgeometry.cpp +++ b/src/quick3d/quick3drender/items/quick3dgeometry.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -47,41 +50,40 @@ Quick3DGeometry::Quick3DGeometry(QObject *parent) { } -QQmlListProperty<Qt3DRender::QAbstractAttribute> Quick3DGeometry::attributeList() +QQmlListProperty<Qt3DRender::QAttribute> Quick3DGeometry::attributeList() { - return QQmlListProperty<Qt3DRender::QAbstractAttribute>(this, 0, + return QQmlListProperty<Qt3DRender::QAttribute>(this, 0, &Quick3DGeometry::appendAttribute, &Quick3DGeometry::attributesCount, &Quick3DGeometry::attributeAt, &Quick3DGeometry::clearAttributes); } -void Quick3DGeometry::appendAttribute(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list, Qt3DRender::QAbstractAttribute *attribute) +void Quick3DGeometry::appendAttribute(QQmlListProperty<Qt3DRender::QAttribute> *list, Qt3DRender::QAttribute *attribute) { Quick3DGeometry *geometry = static_cast<Quick3DGeometry *>(list->object); geometry->m_managedAttributes.append(attribute); geometry->parentGeometry()->addAttribute(attribute); } -Qt3DRender::QAbstractAttribute *Quick3DGeometry::attributeAt(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list, int index) +Qt3DRender::QAttribute *Quick3DGeometry::attributeAt(QQmlListProperty<Qt3DRender::QAttribute> *list, int index) { Quick3DGeometry *geometry = static_cast<Quick3DGeometry *>(list->object); return geometry->parentGeometry()->attributes().at(index); } -int Quick3DGeometry::attributesCount(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list) +int Quick3DGeometry::attributesCount(QQmlListProperty<Qt3DRender::QAttribute> *list) { Quick3DGeometry *geometry = static_cast<Quick3DGeometry *>(list->object); return geometry->parentGeometry()->attributes().count(); } -void Quick3DGeometry::clearAttributes(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list) +void Quick3DGeometry::clearAttributes(QQmlListProperty<Qt3DRender::QAttribute> *list) { Quick3DGeometry *geometry = static_cast<Quick3DGeometry *>(list->object); - QVector<Qt3DRender::QAbstractAttribute *> &managedAttributes = geometry->m_managedAttributes; - Q_FOREACH (Qt3DRender::QAbstractAttribute *attribute, managedAttributes) + for (Qt3DRender::QAttribute *attribute : qAsConst(geometry->m_managedAttributes)) geometry->parentGeometry()->removeAttribute(attribute); - managedAttributes.clear(); + geometry->m_managedAttributes.clear(); } } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dgeometry_p.h b/src/quick3d/quick3drender/items/quick3dgeometry_p.h index 2983fe03e..4c020b0e2 100644 --- a/src/quick3d/quick3drender/items/quick3dgeometry_p.h +++ b/src/quick3d/quick3drender/items/quick3dgeometry_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -61,22 +64,22 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DGeometry : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QAbstractAttribute> attributes READ attributeList) + Q_PROPERTY(QQmlListProperty<Qt3DRender::QAttribute> attributes READ attributeList) Q_CLASSINFO("DefaultProperty", "attributes") public: explicit Quick3DGeometry(QObject *parent = 0); inline QGeometry *parentGeometry() const { return qobject_cast<QGeometry *>(parent()); } - QQmlListProperty<Qt3DRender::QAbstractAttribute> attributeList(); + QQmlListProperty<Qt3DRender::QAttribute> attributeList(); private: - static void appendAttribute(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list, Qt3DRender::QAbstractAttribute *provider); - static Qt3DRender::QAbstractAttribute *attributeAt(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list, int index); - static int attributesCount(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list); - static void clearAttributes(QQmlListProperty<Qt3DRender::QAbstractAttribute> *list); + static void appendAttribute(QQmlListProperty<Qt3DRender::QAttribute> *list, Qt3DRender::QAttribute *provider); + static Qt3DRender::QAttribute *attributeAt(QQmlListProperty<Qt3DRender::QAttribute> *list, int index); + static int attributesCount(QQmlListProperty<Qt3DRender::QAttribute> *list); + static void clearAttributes(QQmlListProperty<Qt3DRender::QAttribute> *list); - QVector<Qt3DRender::QAbstractAttribute *> m_managedAttributes; + QVector<Qt3DRender::QAttribute *> m_managedAttributes; }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp new file mode 100644 index 000000000..6f7efcd23 --- /dev/null +++ b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quick3dlayerfilter_p.h" +#include <Qt3DRender/qtexture.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +namespace Render { + +namespace Quick { + +Quick3DLayerFilter::Quick3DLayerFilter(QObject *parent) + : QObject(parent) +{ +} + +QQmlListProperty<QLayer> Quick3DLayerFilter::qmlLayers() +{ + return QQmlListProperty<QLayer>(this, 0, + &Quick3DLayerFilter::appendLayer, + &Quick3DLayerFilter::layerCount, + &Quick3DLayerFilter::layerAt, + &Quick3DLayerFilter::clearLayers); +} + +void Quick3DLayerFilter::appendLayer(QQmlListProperty<QLayer> *list, QLayer *layer) +{ + Quick3DLayerFilter *filter = qobject_cast<Quick3DLayerFilter *>(list->object); + if (filter) { + filter->parentFilter()->addLayer(layer); + } +} + +QLayer *Quick3DLayerFilter::layerAt(QQmlListProperty<QLayer> *list, int index) +{ + Quick3DLayerFilter *filter = qobject_cast<Quick3DLayerFilter *>(list->object); + if (filter) { + return filter->parentFilter()->layers().at(index); + } + return 0; +} + +int Quick3DLayerFilter::layerCount(QQmlListProperty<QLayer> *list) +{ + Quick3DLayerFilter *filter = qobject_cast<Quick3DLayerFilter *>(list->object); + if (filter) { + return filter->parentFilter()->layers().count(); + } + return 0; +} + +void Quick3DLayerFilter::clearLayers(QQmlListProperty<QLayer> *list) +{ + Quick3DLayerFilter *filter = qobject_cast<Quick3DLayerFilter *>(list->object); + if (filter) { + const auto layers = filter->parentFilter()->layers(); + for (QLayer *layer : layers) + filter->parentFilter()->removeLayer(layer); + } +} + +} // Quick + +} // namespace Render + +} // Qt3D + +QT_END_NAMESPACE diff --git a/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h b/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h new file mode 100644 index 000000000..b2e7e2d11 --- /dev/null +++ b/src/quick3d/quick3drender/items/quick3dlayerfilter_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_RENDER_QUICK_QUICK3DLAYERFILTER_P_H +#define QT3DRENDER_RENDER_QUICK_QUICK3DLAYERFILTER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> +#include <Qt3DRender/qlayerfilter.h> +#include <Qt3DRender/qlayer.h> +#include <QQmlListProperty> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { +namespace Render { +namespace Quick { + +class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DLayerFilter : public QObject +{ + Q_OBJECT + Q_PROPERTY(QQmlListProperty<Qt3DRender::QLayer> layers READ qmlLayers) + +public: + explicit Quick3DLayerFilter(QObject *parent = 0); + + inline QLayerFilter *parentFilter() const { return qobject_cast<QLayerFilter*>(parent()); } + + QQmlListProperty<QLayer> qmlLayers(); + +private: + static void appendLayer(QQmlListProperty<QLayer> *list, QLayer *bar); + static QLayer *layerAt(QQmlListProperty<QLayer> *list, int index); + static int layerCount(QQmlListProperty<QLayer> *list); + static void clearLayers(QQmlListProperty<QLayer> *list); +}; + +} // namespace Quick +} // namespace Render +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_RENDER_QUICK_QUICK3DLAYERFILTER_P_H diff --git a/src/quick3d/quick3drender/items/quick3dmaterial.cpp b/src/quick3d/quick3drender/items/quick3dmaterial.cpp index 672a203f6..50b064bc2 100644 --- a/src/quick3d/quick3drender/items/quick3dmaterial.cpp +++ b/src/quick3d/quick3drender/items/quick3dmaterial.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -88,9 +91,9 @@ void Quick3DMaterial::clearParameters(QQmlListProperty<QParameter> *list) { Quick3DMaterial *mat = qobject_cast<Quick3DMaterial *>(list->object); if (mat) { - Q_FOREACH (QParameter *p, mat->parentMaterial()->parameters()) { + const auto parameters = mat->parentMaterial()->parameters(); + for (QParameter *p : parameters) mat->parentMaterial()->removeParameter(p); - } } } diff --git a/src/quick3d/quick3drender/items/quick3dmaterial_p.h b/src/quick3d/quick3drender/items/quick3dmaterial_p.h index 691ff276e..48b60df62 100644 --- a/src/quick3d/quick3drender/items/quick3dmaterial_p.h +++ b/src/quick3d/quick3drender/items/quick3dmaterial_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3dparameter.cpp b/src/quick3d/quick3drender/items/quick3dparameter.cpp index 9f2dfb59b..22b6bba96 100644 --- a/src/quick3d/quick3drender/items/quick3dparameter.cpp +++ b/src/quick3d/quick3drender/items/quick3dparameter.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3dparameter_p.h b/src/quick3d/quick3drender/items/quick3dparameter_p.h index 6e3cfe61d..60493973d 100644 --- a/src/quick3d/quick3drender/items/quick3dparameter_p.h +++ b/src/quick3d/quick3drender/items/quick3dparameter_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -70,7 +73,6 @@ private: protected: Quick3DParameter(Quick3DParameterPrivate &dd, QNode *parent = 0); - QT3D_CLONEABLE(Quick3DParameter) }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dparameter_p_p.h b/src/quick3d/quick3drender/items/quick3dparameter_p_p.h index 429608024..0432642f3 100644 --- a/src/quick3d/quick3drender/items/quick3dparameter_p_p.h +++ b/src/quick3d/quick3drender/items/quick3dparameter_p_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3drenderpass.cpp b/src/quick3d/quick3drender/items/quick3drenderpass.cpp index b1524dcbf..d5f16fab6 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpass.cpp +++ b/src/quick3d/quick3drender/items/quick3drenderpass.cpp @@ -1,42 +1,44 @@ /**************************************************************************** ** ** 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 +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "quick3drenderpass_p.h" -#include <Qt3DRender/qparametermapping.h> QT_BEGIN_NAMESPACE @@ -49,22 +51,13 @@ Quick3DRenderPass::Quick3DRenderPass(QObject *parent) { } -QQmlListProperty<QAnnotation> Quick3DRenderPass::annotationList() +QQmlListProperty<QFilterKey> Quick3DRenderPass::filterKeyList() { - return QQmlListProperty<QAnnotation>(this, 0, - &Quick3DRenderPass::appendAnnotation, - &Quick3DRenderPass::annotationsCount, - &Quick3DRenderPass::annotationAt, - &Quick3DRenderPass::clearAnnotations); -} - -QQmlListProperty<QParameterMapping> Quick3DRenderPass::bindingList() -{ - return QQmlListProperty<QParameterMapping>(this, 0, - &Quick3DRenderPass::appendBinding, - &Quick3DRenderPass::bindingsCount, - &Quick3DRenderPass::bindingAt, - &Quick3DRenderPass::clearBindings); + return QQmlListProperty<QFilterKey>(this, 0, + &Quick3DRenderPass::appendFilterKey, + &Quick3DRenderPass::filterKeysCount, + &Quick3DRenderPass::filterKeyAt, + &Quick3DRenderPass::clearFilterKey); } QQmlListProperty<QRenderState> Quick3DRenderPass::renderStateList() @@ -85,54 +78,30 @@ QQmlListProperty<QParameter> Quick3DRenderPass::parameterList() &Quick3DRenderPass::clearParameterList); } -void Quick3DRenderPass::appendAnnotation(QQmlListProperty<QAnnotation> *list, QAnnotation *annotation) -{ - Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - rPass->parentRenderPass()->addAnnotation(annotation); -} - -QAnnotation *Quick3DRenderPass::annotationAt(QQmlListProperty<QAnnotation> *list, int index) -{ - Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - return rPass->parentRenderPass()->annotations().at(index); -} - -int Quick3DRenderPass::annotationsCount(QQmlListProperty<QAnnotation> *list) -{ - Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - return rPass->parentRenderPass()->annotations().count(); -} - -void Quick3DRenderPass::clearAnnotations(QQmlListProperty<QAnnotation> *list) -{ - Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - Q_FOREACH (QAnnotation *c, rPass->parentRenderPass()->annotations()) - rPass->parentRenderPass()->removeAnnotation(c); -} - -void Quick3DRenderPass::appendBinding(QQmlListProperty<QParameterMapping> *list, QParameterMapping *binding) +void Quick3DRenderPass::appendFilterKey(QQmlListProperty<QFilterKey> *list, QFilterKey *filterKey) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - rPass->parentRenderPass()->addBinding(binding); + rPass->parentRenderPass()->addFilterKey(filterKey); } -QParameterMapping *Quick3DRenderPass::bindingAt(QQmlListProperty<QParameterMapping> *list, int index) +QFilterKey *Quick3DRenderPass::filterKeyAt(QQmlListProperty<QFilterKey> *list, int index) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - return rPass->parentRenderPass()->bindings().at(index); + return rPass->parentRenderPass()->filterKeys().at(index); } -int Quick3DRenderPass::bindingsCount(QQmlListProperty<QParameterMapping> *list) +int Quick3DRenderPass::filterKeysCount(QQmlListProperty<QFilterKey> *list) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - return rPass->parentRenderPass()->bindings().count(); + return rPass->parentRenderPass()->filterKeys().count(); } -void Quick3DRenderPass::clearBindings(QQmlListProperty<QParameterMapping> *list) +void Quick3DRenderPass::clearFilterKey(QQmlListProperty<QFilterKey> *list) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - Q_FOREACH (QParameterMapping *binding, rPass->parentRenderPass()->bindings()) - rPass->parentRenderPass()->removeBinding(binding); + const auto keys = rPass->parentRenderPass()->filterKeys(); + for (QFilterKey *c : keys) + rPass->parentRenderPass()->removeFilterKey(c); } void Quick3DRenderPass::appendRenderState(QQmlListProperty<QRenderState> *list, QRenderState *state) @@ -156,7 +125,8 @@ int Quick3DRenderPass::renderStateCount(QQmlListProperty<QRenderState> *list) void Quick3DRenderPass::clearRenderStates(QQmlListProperty<QRenderState> *list) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - Q_FOREACH (QRenderState *s, rPass->parentRenderPass()->renderStates()) + const auto states = rPass->parentRenderPass()->renderStates(); + for (QRenderState *s : states) rPass->parentRenderPass()->removeRenderState(s); } @@ -181,7 +151,8 @@ int Quick3DRenderPass::parametersCount(QQmlListProperty<QParameter> *list) void Quick3DRenderPass::clearParameterList(QQmlListProperty<QParameter> *list) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); - Q_FOREACH (QParameter *p, rPass->parentRenderPass()->parameters()) + const auto parameters = rPass->parentRenderPass()->parameters(); + for (QParameter *p : parameters) rPass->parentRenderPass()->removeParameter(p); } diff --git a/src/quick3d/quick3drender/items/quick3drenderpass_p.h b/src/quick3d/quick3drender/items/quick3drenderpass_p.h index 536bd6b4a..6ac940e23 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpass_p.h +++ b/src/quick3d/quick3drender/items/quick3drenderpass_p.h @@ -1,35 +1,38 @@ /**************************************************************************** ** ** 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 +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -62,30 +65,23 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DRenderPass : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QAnnotation> annotations READ annotationList) - Q_PROPERTY(QQmlListProperty<Qt3DRender::QParameterMapping> bindings READ bindingList) + Q_PROPERTY(QQmlListProperty<Qt3DRender::QFilterKey> filterKeys READ filterKeyList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QRenderState> renderStates READ renderStateList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QParameter> parameters READ parameterList) public: explicit Quick3DRenderPass(QObject *parent = 0); - QQmlListProperty<QAnnotation> annotationList(); - QQmlListProperty<QParameterMapping> bindingList(); + QQmlListProperty<QFilterKey> filterKeyList(); QQmlListProperty<QRenderState> renderStateList(); QQmlListProperty<QParameter> parameterList(); inline QRenderPass *parentRenderPass() const { return qobject_cast<QRenderPass *>(parent()); } private: - static void appendAnnotation(QQmlListProperty<QAnnotation> *list, QAnnotation *criterion); - static QAnnotation *annotationAt(QQmlListProperty<QAnnotation> *list, int index); - static int annotationsCount(QQmlListProperty<QAnnotation> *list); - static void clearAnnotations(QQmlListProperty<QAnnotation> *list); - - static void appendBinding(QQmlListProperty<QParameterMapping> *list, QParameterMapping *binding); - static QParameterMapping *bindingAt(QQmlListProperty<QParameterMapping> *list, int index); - static int bindingsCount(QQmlListProperty<QParameterMapping> *list); - static void clearBindings(QQmlListProperty<QParameterMapping> *list); + static void appendFilterKey(QQmlListProperty<QFilterKey> *list, QFilterKey *filterKey); + static QFilterKey *filterKeyAt(QQmlListProperty<QFilterKey> *list, int index); + static int filterKeysCount(QQmlListProperty<QFilterKey> *list); + static void clearFilterKey(QQmlListProperty<QFilterKey> *list); static void appendRenderState(QQmlListProperty<QRenderState> *list, QRenderState *state); static QRenderState *renderStateAt(QQmlListProperty<QRenderState> *list, int index); diff --git a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp index 127c2e9f3..8b51a79ef 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp +++ b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -47,9 +50,9 @@ Quick3DRenderPassFilter::Quick3DRenderPassFilter(QObject *parent) { } -QQmlListProperty<QAnnotation> Quick3DRenderPassFilter::includeList() +QQmlListProperty<QFilterKey> Quick3DRenderPassFilter::includeList() { - return QQmlListProperty<QAnnotation>(this, 0, + return QQmlListProperty<QFilterKey>(this, 0, &Quick3DRenderPassFilter::appendInclude, &Quick3DRenderPassFilter::includesCount, &Quick3DRenderPassFilter::includeAt, @@ -66,37 +69,38 @@ QQmlListProperty<QParameter> Quick3DRenderPassFilter::parameterList() } -void Quick3DRenderPassFilter::appendInclude(QQmlListProperty<QAnnotation> *list, QAnnotation *annotation) +void Quick3DRenderPassFilter::appendInclude(QQmlListProperty<QFilterKey> *list, QFilterKey *annotation) { Quick3DRenderPassFilter *filter = qobject_cast<Quick3DRenderPassFilter *>(list->object); if (filter) { annotation->setParent(filter->parentRenderPassFilter()); - filter->parentRenderPassFilter()->addInclude(annotation); + filter->parentRenderPassFilter()->addMatch(annotation); } } -QAnnotation *Quick3DRenderPassFilter::includeAt(QQmlListProperty<QAnnotation> *list, int index) +QFilterKey *Quick3DRenderPassFilter::includeAt(QQmlListProperty<QFilterKey> *list, int index) { Quick3DRenderPassFilter *filter = qobject_cast<Quick3DRenderPassFilter *>(list->object); if (filter) - return filter->parentRenderPassFilter()->includes().at(index); + return filter->parentRenderPassFilter()->matchAny().at(index); return 0; } -int Quick3DRenderPassFilter::includesCount(QQmlListProperty<QAnnotation> *list) +int Quick3DRenderPassFilter::includesCount(QQmlListProperty<QFilterKey> *list) { Quick3DRenderPassFilter *filter = qobject_cast<Quick3DRenderPassFilter *>(list->object); if (filter) - return filter->parentRenderPassFilter()->includes().count(); + return filter->parentRenderPassFilter()->matchAny().count(); return 0; } -void Quick3DRenderPassFilter::clearIncludes(QQmlListProperty<QAnnotation> *list) +void Quick3DRenderPassFilter::clearIncludes(QQmlListProperty<QFilterKey> *list) { Quick3DRenderPassFilter *filter = qobject_cast<Quick3DRenderPassFilter *>(list->object); if (filter) { - Q_FOREACH (QAnnotation *criterion, filter->parentRenderPassFilter()->includes()) - filter->parentRenderPassFilter()->removeInclude(criterion); + const auto criteria = filter->parentRenderPassFilter()->matchAny(); + for (QFilterKey *criterion : criteria) + filter->parentRenderPassFilter()->removeMatch(criterion); } } @@ -121,7 +125,8 @@ int Quick3DRenderPassFilter::parametersCount(QQmlListProperty<QParameter> *list) void Quick3DRenderPassFilter::clearParameterList(QQmlListProperty<QParameter> *list) { Quick3DRenderPassFilter *rPassFilter = qobject_cast<Quick3DRenderPassFilter *>(list->object); - Q_FOREACH (QParameter *p, rPassFilter->parentRenderPassFilter()->parameters()) + const auto parameters = rPassFilter->parentRenderPassFilter()->parameters(); + for (QParameter *p : parameters) rPassFilter->parentRenderPassFilter()->removeParameter(p); } diff --git a/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h b/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h index 82d713bb5..3acd32270 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h +++ b/src/quick3d/quick3drender/items/quick3drenderpassfilter_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -50,7 +53,7 @@ #include <Qt3DQuick/private/quick3dnode_p.h> #include <Qt3DRender/qrenderpassfilter.h> -#include <Qt3DRender/qannotation.h> +#include <Qt3DRender/qfilterkey.h> #include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> #include <QQmlListProperty> @@ -63,22 +66,22 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DRenderPassFilter : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QAnnotation> includes READ includeList) + Q_PROPERTY(QQmlListProperty<Qt3DRender::QFilterKey> matchAny READ includeList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QParameter> parameters READ parameterList) public: explicit Quick3DRenderPassFilter(QObject *parent = 0); - QQmlListProperty<QAnnotation> includeList(); + QQmlListProperty<QFilterKey> includeList(); QQmlListProperty<QParameter> parameterList(); inline QRenderPassFilter *parentRenderPassFilter() const { return qobject_cast<Qt3DRender::QRenderPassFilter*>(parent()); } private: - static void appendInclude(QQmlListProperty<QAnnotation> *list, QAnnotation *criterion); - static QAnnotation *includeAt(QQmlListProperty<QAnnotation> *list, int index); - static int includesCount(QQmlListProperty<QAnnotation> *list); - static void clearIncludes(QQmlListProperty<QAnnotation> *list); + static void appendInclude(QQmlListProperty<QFilterKey> *list, QFilterKey *criterion); + static QFilterKey *includeAt(QQmlListProperty<QFilterKey> *list, int index); + static int includesCount(QQmlListProperty<QFilterKey> *list); + static void clearIncludes(QQmlListProperty<QFilterKey> *list); static void appendParameter(QQmlListProperty<QParameter> *list, QParameter *param); static QParameter *parameterAt(QQmlListProperty<QParameter> *list, int index); diff --git a/src/quick3d/quick3drender/items/quick3drendertarget.cpp b/src/quick3d/quick3drender/items/quick3drendertarget.cpp deleted file mode 100644 index 5f3916b45..000000000 --- a/src/quick3d/quick3drender/items/quick3drendertarget.cpp +++ /dev/null @@ -1,95 +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 "quick3drendertarget_p.h" - -QT_BEGIN_NAMESPACE - -namespace Qt3DRender { -namespace Render { -namespace Quick { - -Quick3DRenderTarget::Quick3DRenderTarget(QObject * parent) - : QObject(parent) -{ -} - -QQmlListProperty<QRenderAttachment> Quick3DRenderTarget::qmlAttachments() -{ - return QQmlListProperty<QRenderAttachment>(this, 0, - &Quick3DRenderTarget::appendRenderAttachment, - &Quick3DRenderTarget::renderAttachmentCount, - &Quick3DRenderTarget::renderAttachmentAt, - &Quick3DRenderTarget::clearRenderAttachments); -} - -void Quick3DRenderTarget::appendRenderAttachment(QQmlListProperty<QRenderAttachment> *list, QRenderAttachment *attachment) -{ - Quick3DRenderTarget *rT = qobject_cast<Quick3DRenderTarget *>(list->object); - if (rT) - rT->parentRenderTarget()->addAttachment(attachment); -} - -QRenderAttachment *Quick3DRenderTarget::renderAttachmentAt(QQmlListProperty<QRenderAttachment> *list, int index) -{ - Quick3DRenderTarget *rT = qobject_cast<Quick3DRenderTarget *>(list->object); - if (rT) - return rT->parentRenderTarget()->attachments().at(index); - return Q_NULLPTR; -} - -int Quick3DRenderTarget::renderAttachmentCount(QQmlListProperty<QRenderAttachment> *list) -{ - Quick3DRenderTarget *rT = qobject_cast<Quick3DRenderTarget *>(list->object); - if (rT) - return rT->parentRenderTarget()->attachments().count(); - return -1; -} - -void Quick3DRenderTarget::clearRenderAttachments(QQmlListProperty<QRenderAttachment> *list) -{ - Quick3DRenderTarget *rT = qobject_cast<Quick3DRenderTarget *>(list->object); - if (rT) { - Q_FOREACH (QRenderAttachment *att, rT->parentRenderTarget()->attachments()) - rT->parentRenderTarget()->removeAttachment(att); - } -} - -} // namespace Quick -} // namespace Render -} // namespace Qt3DRender - -QT_END_NAMESPACE diff --git a/src/quick3d/quick3drender/items/quick3drendertarget_p.h b/src/quick3d/quick3drender/items/quick3drendertarget_p.h deleted file mode 100644 index f64605c6a..000000000 --- a/src/quick3d/quick3drender/items/quick3drendertarget_p.h +++ /dev/null @@ -1,85 +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 QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGET_P_H -#define QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGET_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> -#include <Qt3DRender/qrendertarget.h> -#include <Qt3DRender/qrenderattachment.h> -#include <QQmlListProperty> - -QT_BEGIN_NAMESPACE - -namespace Qt3DRender { -namespace Render { -namespace Quick { - -class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DRenderTarget : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QRenderAttachment> attachments READ qmlAttachments) -public: - explicit Quick3DRenderTarget(QObject *parent = 0); - - inline QRenderTarget *parentRenderTarget() const { return qobject_cast<QRenderTarget *>(parent()); } - QQmlListProperty<QRenderAttachment> qmlAttachments(); - -private: - static void appendRenderAttachment(QQmlListProperty<QRenderAttachment> *list, QRenderAttachment *attachment); - static QRenderAttachment *renderAttachmentAt(QQmlListProperty<QRenderAttachment> *list, int index); - static int renderAttachmentCount(QQmlListProperty<QRenderAttachment> *list); - static void clearRenderAttachments(QQmlListProperty<QRenderAttachment> *list); -}; - -} // namespace Quick -} // namespace Render -} // namespace Qt3DRender - -QT_END_NAMESPACE - -#endif // QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGET_P_H diff --git a/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp new file mode 100644 index 000000000..e3b40243a --- /dev/null +++ b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "quick3drendertargetoutput_p.h" + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { +namespace Render { +namespace Quick { + +Quick3DRenderTargetOutput::Quick3DRenderTargetOutput(QObject * parent) + : QObject(parent) +{ +} + +QQmlListProperty<QRenderTargetOutput> Quick3DRenderTargetOutput::qmlAttachments() +{ + return QQmlListProperty<QRenderTargetOutput>(this, 0, + &Quick3DRenderTargetOutput::appendRenderAttachment, + &Quick3DRenderTargetOutput::renderAttachmentCount, + &Quick3DRenderTargetOutput::renderAttachmentAt, + &Quick3DRenderTargetOutput::clearRenderAttachments); +} + +void Quick3DRenderTargetOutput::appendRenderAttachment(QQmlListProperty<QRenderTargetOutput> *list, QRenderTargetOutput *output) +{ + Quick3DRenderTargetOutput *rT = qobject_cast<Quick3DRenderTargetOutput *>(list->object); + if (rT) + rT->parentRenderTarget()->addOutput(output); +} + +QRenderTargetOutput *Quick3DRenderTargetOutput::renderAttachmentAt(QQmlListProperty<QRenderTargetOutput> *list, int index) +{ + Quick3DRenderTargetOutput *rT = qobject_cast<Quick3DRenderTargetOutput *>(list->object); + if (rT) + return rT->parentRenderTarget()->outputs().at(index); + return nullptr; +} + +int Quick3DRenderTargetOutput::renderAttachmentCount(QQmlListProperty<QRenderTargetOutput> *list) +{ + Quick3DRenderTargetOutput *rT = qobject_cast<Quick3DRenderTargetOutput *>(list->object); + if (rT) + return rT->parentRenderTarget()->outputs().count(); + return -1; +} + +void Quick3DRenderTargetOutput::clearRenderAttachments(QQmlListProperty<QRenderTargetOutput> *list) +{ + Quick3DRenderTargetOutput *rT = qobject_cast<Quick3DRenderTargetOutput *>(list->object); + if (rT) { + const auto outputs = rT->parentRenderTarget()->outputs(); + for (QRenderTargetOutput *output : outputs) + rT->parentRenderTarget()->removeOutput(output); + } +} + +} // namespace Quick +} // namespace Render +} // namespace Qt3DRender + +QT_END_NAMESPACE diff --git a/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h b/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h new file mode 100644 index 000000000..5a2c8ea54 --- /dev/null +++ b/src/quick3d/quick3drender/items/quick3drendertargetoutput_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGETOUTPUT_P_H +#define QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGETOUTPUT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> +#include <Qt3DRender/qrendertarget.h> +#include <Qt3DRender/qrendertargetoutput.h> +#include <QQmlListProperty> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { +namespace Render { +namespace Quick { + +class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DRenderTargetOutput : public QObject +{ + Q_OBJECT + Q_PROPERTY(QQmlListProperty<Qt3DRender::QRenderTargetOutput> attachments READ qmlAttachments) +public: + explicit Quick3DRenderTargetOutput(QObject *parent = 0); + + inline QRenderTarget *parentRenderTarget() const { return qobject_cast<QRenderTarget *>(parent()); } + QQmlListProperty<QRenderTargetOutput> qmlAttachments(); + +private: + static void appendRenderAttachment(QQmlListProperty<QRenderTargetOutput> *list, QRenderTargetOutput *attachment); + static QRenderTargetOutput *renderAttachmentAt(QQmlListProperty<QRenderTargetOutput> *list, int index); + static int renderAttachmentCount(QQmlListProperty<QRenderTargetOutput> *list); + static void clearRenderAttachments(QQmlListProperty<QRenderTargetOutput> *list); +}; + +} // namespace Quick +} // namespace Render +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_RENDER_QUICK_QUICK3DRENDERTARGETOUTPUT_P_H diff --git a/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp b/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp index dcc5dd2bd..b61c7ed12 100644 --- a/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp +++ b/src/quick3d/quick3drender/items/quick3drendertargetselector.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -55,7 +58,9 @@ QVariantList Quick3DRenderTargetSelector::drawBuffers() const { // Converts RenderAttachmentType to int QVariantList l; - Q_FOREACH (const QRenderAttachment::RenderAttachmentType &b, parentRenderTargetSelector()->drawBuffers()) + const auto outputs = parentRenderTargetSelector()->outputs(); + l.reserve(outputs.size()); + for (const QRenderTargetOutput::AttachmentPoint &b : outputs) l.append(static_cast<int>(b)); return l; } @@ -65,11 +70,12 @@ void Quick3DRenderTargetSelector::setDrawBuffers(const QVariantList &buffers) if (buffers != drawBuffers()) { // Converts int to RenderAttachmentType - QList<QRenderAttachment::RenderAttachmentType> drawBuffersList; - Q_FOREACH (const QVariant &buf, buffers) - drawBuffersList.append(static_cast<QRenderAttachment::RenderAttachmentType>(buf.toInt())); + QVector<QRenderTargetOutput::AttachmentPoint> drawBuffersList; + drawBuffersList.reserve(buffers.size()); + for (const QVariant &buf : buffers) + drawBuffersList.append(static_cast<QRenderTargetOutput::AttachmentPoint>(buf.toInt())); - parentRenderTargetSelector()->setDrawBuffers(drawBuffersList); + parentRenderTargetSelector()->setOutputs(drawBuffersList); emit drawBuffersChanged(); } } diff --git a/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h b/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h index 09f594580..a24a6a71f 100644 --- a/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h +++ b/src/quick3d/quick3drender/items/quick3drendertargetselector_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -49,7 +52,7 @@ // #include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> -#include <Qt3DRender/qrenderattachment.h> +#include <Qt3DRender/qrendertargetoutput.h> #include <Qt3DRender/qrendertargetselector.h> #include <QQmlListProperty> #include <QVariantList> diff --git a/src/quick3d/quick3drender/items/quick3dscene.cpp b/src/quick3d/quick3drender/items/quick3dscene.cpp index 95a833448..4062904f2 100644 --- a/src/quick3d/quick3drender/items/quick3dscene.cpp +++ b/src/quick3d/quick3drender/items/quick3dscene.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3dscene_p.h b/src/quick3d/quick3drender/items/quick3dscene_p.h index f607aaeeb..60c2d2ab5 100644 --- a/src/quick3d/quick3drender/items/quick3dscene_p.h +++ b/src/quick3d/quick3drender/items/quick3dscene_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -50,7 +53,7 @@ #include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> #include <Qt3DQuick/private/quick3dentity_p.h> -#include <Qt3DRender/qabstractsceneloader.h> +#include <Qt3DRender/qsceneloader.h> QT_BEGIN_NAMESPACE @@ -64,7 +67,7 @@ class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DScene : public QObject public: explicit Quick3DScene(QObject *parent = 0); - inline QAbstractSceneLoader *parentScene() const { return qobject_cast<QAbstractSceneLoader *>(parent()); } + inline QSceneLoader *parentScene() const { return qobject_cast<QSceneLoader *>(parent()); } }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp index 1dd9ac323..e5901e8fb 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdata.cpp +++ b/src/quick3d/quick3drender/items/quick3dshaderdata.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -74,7 +77,8 @@ public: Quick3DShaderDataArray *array = v.value<Quick3DShaderDataArray *>(); QVariantList innerValues; if (array) { - Q_FOREACH (QShaderData *d, array->values()) { + const auto values = array->values(); + for (QShaderData *d : values) { if (d) innerValues.append(QVariant::fromValue(d->id())); } diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h index cb7e0fe7c..72c117c90 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h +++ b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -65,9 +68,6 @@ class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DShaderData : public QShaderDat Q_OBJECT public: explicit Quick3DShaderData(QNode *parent = 0); - -private: - QT3D_CLONEABLE(Quick3DShaderData) }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp index 3306cf226..21dd2525a 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp +++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -50,7 +53,7 @@ public: : QNodePrivate() {} - QList<QShaderData *> m_values; + QVector<QShaderData *> m_values; }; Quick3DShaderDataArray::Quick3DShaderDataArray(QNode *parent) @@ -58,11 +61,6 @@ Quick3DShaderDataArray::Quick3DShaderDataArray(QNode *parent) { } -Quick3DShaderDataArray::~Quick3DShaderDataArray() -{ - QNode::cleanup(); -} - QQmlListProperty<QShaderData> Quick3DShaderDataArray::valuesList() { return QQmlListProperty<QShaderData>(this, 0, @@ -72,19 +70,20 @@ QQmlListProperty<QShaderData> Quick3DShaderDataArray::valuesList() &Quick3DShaderDataArray::clearValues); } -QList<QShaderData *> Quick3DShaderDataArray::values() const +QVector<QShaderData *> Quick3DShaderDataArray::values() const { Q_D(const Quick3DShaderDataArray); return d->m_values; } -void Quick3DShaderDataArray::copy(const QNode *ref) -{ - QNode::copy(ref); - const Quick3DShaderDataArray *dataArray = static_cast<const Quick3DShaderDataArray *>(ref); - Q_FOREACH (QShaderData *v, dataArray->d_func()->m_values) - d_func()->m_values.append(static_cast<QShaderData *>(QNode::clone(v))); -} +// TODO: Avoid cloning here +//void Quick3DShaderDataArray::copy(const QNode *ref) +//{ +// QNode::copy(ref); +// const Quick3DShaderDataArray *dataArray = static_cast<const Quick3DShaderDataArray *>(ref); +// Q_FOREACH (QShaderData *v, dataArray->d_func()->m_values) +// d_func()->m_values.append(static_cast<QShaderData *>(QNode::clone(v))); +//} void Quick3DShaderDataArray::appendValue(QQmlListProperty<QShaderData> *list, QShaderData *bar) { diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h index df49c1f98..effd18b32 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h +++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -73,12 +76,8 @@ class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DShaderDataArray : public Qt3DC public: explicit Quick3DShaderDataArray(Qt3DCore::QNode *parent = 0); - ~Quick3DShaderDataArray(); QQmlListProperty<QShaderData> valuesList(); - QList<QShaderData *> values() const; - -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + QVector<QShaderData *> values() const; private: static void appendValue(QQmlListProperty<QShaderData> *list, QShaderData *bar); @@ -86,7 +85,6 @@ private: static int valueCount(QQmlListProperty<QShaderData> *list); static void clearValues(QQmlListProperty<QShaderData> *list); Q_DECLARE_PRIVATE(Quick3DShaderDataArray) - QT3D_CLONEABLE(Quick3DShaderDataArray) }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dsortmethod.cpp b/src/quick3d/quick3drender/items/quick3dsortmethod.cpp deleted file mode 100644 index 71d121682..000000000 --- a/src/quick3d/quick3drender/items/quick3dsortmethod.cpp +++ /dev/null @@ -1,95 +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 "quick3dsortmethod_p.h" - -QT_BEGIN_NAMESPACE - -namespace Qt3DRender { -namespace Render { -namespace Quick { - -Quick3DSortMethod::Quick3DSortMethod(QObject *parent) - : QObject(parent) -{ -} - -QQmlListProperty<QSortCriterion> Quick3DSortMethod::criteriaList() -{ - return QQmlListProperty<QSortCriterion>(this, 0, - &Quick3DSortMethod::appendCriterion, - &Quick3DSortMethod::criteriaCount, - &Quick3DSortMethod::criterionAt, - &Quick3DSortMethod::clearCriteria); -} - -void Quick3DSortMethod::appendCriterion(QQmlListProperty<QSortCriterion> *list, QSortCriterion *criterion) -{ - Quick3DSortMethod *sM = qobject_cast<Quick3DSortMethod *>(list->object); - if (sM != Q_NULLPTR) - sM->parentSortMethod()->addCriterion(criterion); -} - -QSortCriterion *Quick3DSortMethod::criterionAt(QQmlListProperty<QSortCriterion> *list, int index) -{ - Quick3DSortMethod *sM = qobject_cast<Quick3DSortMethod *>(list->object); - if (sM != Q_NULLPTR) - return sM->parentSortMethod()->criteria().at(index); - return Q_NULLPTR; -} - -int Quick3DSortMethod::criteriaCount(QQmlListProperty<QSortCriterion> *list) -{ - Quick3DSortMethod *sM = qobject_cast<Quick3DSortMethod *>(list->object); - if (sM != Q_NULLPTR) - return sM->parentSortMethod()->criteria().count(); - return -1; -} - -void Quick3DSortMethod::clearCriteria(QQmlListProperty<QSortCriterion> *list) -{ - Quick3DSortMethod *sM = qobject_cast<Quick3DSortMethod *>(list->object); - if (sM != Q_NULLPTR) { - Q_FOREACH (QSortCriterion *c, sM->parentSortMethod()->criteria()) - sM->parentSortMethod()->removeCriterion(c); - } -} - -} // namespace Quick -} // namespace Render -} // namespace Qt3DRender - -QT_END_NAMESPACE diff --git a/src/quick3d/quick3drender/items/quick3dsortmethod_p.h b/src/quick3d/quick3drender/items/quick3dsortmethod_p.h deleted file mode 100644 index 9e1db429b..000000000 --- a/src/quick3d/quick3drender/items/quick3dsortmethod_p.h +++ /dev/null @@ -1,86 +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 QT3DRENDER_RENDER_QUICK_QUICK3DSORTMETHOD_P_H -#define QT3DRENDER_RENDER_QUICK_QUICK3DSORTMETHOD_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> -#include <Qt3DRender/qsortmethod.h> -#include <Qt3DRender/qsortcriterion.h> -#include <QQmlListProperty> - -QT_BEGIN_NAMESPACE - -namespace Qt3DRender { -namespace Render { -namespace Quick { - -class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DSortMethod : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QSortCriterion> criteria READ criteriaList) -public: - explicit Quick3DSortMethod(QObject *parent = 0); - - inline QSortMethod *parentSortMethod() const { return qobject_cast<QSortMethod *>(parent()); } - - QQmlListProperty<QSortCriterion> criteriaList(); - -private: - static void appendCriterion(QQmlListProperty<QSortCriterion> *list, QSortCriterion *criterion); - static QSortCriterion *criterionAt(QQmlListProperty<QSortCriterion> *list, int index); - static int criteriaCount(QQmlListProperty<QSortCriterion> *list); - static void clearCriteria(QQmlListProperty<QSortCriterion> *list); -}; - -} // namespace Quick -} // namespace Render -} // namespace Qt3DRender - -QT_END_NAMESPACE - -#endif // QT3DRENDER_RENDER_QUICK_QUICK3DSORTMETHOD_P_H diff --git a/src/quick3d/quick3drender/items/quick3dstateset.cpp b/src/quick3d/quick3drender/items/quick3dstateset.cpp index f97363a9c..d7d74e5ad 100644 --- a/src/quick3d/quick3drender/items/quick3dstateset.cpp +++ b/src/quick3d/quick3drender/items/quick3dstateset.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -82,7 +85,8 @@ int Quick3DStateSet::renderStateCount(QQmlListProperty<QRenderState> *list) void Quick3DStateSet::clearRenderStates(QQmlListProperty<QRenderState> *list) { Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object); - Q_FOREACH (QRenderState *s, stateSet->parentStateSet()->renderStates()) + const auto states = stateSet->parentStateSet()->renderStates(); + for (QRenderState *s : states) stateSet->parentStateSet()->removeRenderState(s); } diff --git a/src/quick3d/quick3drender/items/quick3dstateset_p.h b/src/quick3d/quick3drender/items/quick3dstateset_p.h index a1312c5ca..4bb9b6cec 100644 --- a/src/quick3d/quick3drender/items/quick3dstateset_p.h +++ b/src/quick3d/quick3drender/items/quick3dstateset_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -49,7 +52,7 @@ // #include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> -#include <Qt3DRender/qstateset.h> +#include <Qt3DRender/qrenderstateset.h> #include <QQmlListProperty> QT_BEGIN_NAMESPACE @@ -67,7 +70,7 @@ public: ~Quick3DStateSet(); QQmlListProperty<QRenderState> renderStateList(); - inline QStateSet *parentStateSet() const { return qobject_cast<QStateSet *>(parent()); } + inline QRenderStateSet *parentStateSet() const { return qobject_cast<QRenderStateSet *>(parent()); } private: static void appendRenderState(QQmlListProperty<QRenderState> *list, QRenderState *state); diff --git a/src/quick3d/quick3drender/items/quick3dtechnique.cpp b/src/quick3d/quick3drender/items/quick3dtechnique.cpp index d5be802e4..123050645 100644 --- a/src/quick3d/quick3drender/items/quick3dtechnique.cpp +++ b/src/quick3d/quick3drender/items/quick3dtechnique.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -86,7 +89,8 @@ int Quick3DTechnique::parametersCount(QQmlListProperty<QParameter> *list) void Quick3DTechnique::clearParameterList(QQmlListProperty<QParameter> *list) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); - Q_FOREACH (QParameter *p, technique->parentTechnique()->parameters()) + const auto parameters = technique->parentTechnique()->parameters(); + for (QParameter *p : parameters) technique->parentTechnique()->removeParameter(p); } @@ -94,7 +98,7 @@ void Quick3DTechnique::appendRenderPass(QQmlListProperty<QRenderPass> *list, QRe { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) { - technique->parentTechnique()->addPass(renderPass); + technique->parentTechnique()->addRenderPass(renderPass); } } @@ -118,52 +122,54 @@ void Quick3DTechnique::clearRenderPasses(QQmlListProperty<QRenderPass> *list) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) { - Q_FOREACH (QRenderPass *pass, technique->parentTechnique()->renderPasses()) - technique->parentTechnique()->removePass(pass); + const auto passes = technique->parentTechnique()->renderPasses(); + for (QRenderPass *pass : passes) + technique->parentTechnique()->removeRenderPass(pass); } } -QQmlListProperty<QAnnotation> Quick3DTechnique::annotationList() +QQmlListProperty<QFilterKey> Quick3DTechnique::filterKeyList() { - return QQmlListProperty<QAnnotation>(this, 0, - &Quick3DTechnique::appendAnnotation, - &Quick3DTechnique::annotationCount, - &Quick3DTechnique::annotationAt, - &Quick3DTechnique::clearAnnotationList); + return QQmlListProperty<QFilterKey>(this, 0, + &Quick3DTechnique::appendFilterKey, + &Quick3DTechnique::filterKeyCount, + &Quick3DTechnique::filterKeyAt, + &Quick3DTechnique::clearFilterKeyList); } -void Quick3DTechnique::appendAnnotation(QQmlListProperty<QAnnotation> *list, QAnnotation *annotation) +void Quick3DTechnique::appendFilterKey(QQmlListProperty<QFilterKey> *list, QFilterKey *filterKey) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) { - if (!annotation->parent()) - annotation->setParent(technique->parentTechnique()); - technique->parentTechnique()->addAnnotation(annotation); + if (!filterKey->parent()) + filterKey->setParent(technique->parentTechnique()); + technique->parentTechnique()->addFilterKey(filterKey); } } -QAnnotation *Quick3DTechnique::annotationAt(QQmlListProperty<QAnnotation> *list, int index) +QFilterKey *Quick3DTechnique::filterKeyAt(QQmlListProperty<QFilterKey> *list, int index) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) - return technique->parentTechnique()->annotations().at(index); + return technique->parentTechnique()->filterKeys().at(index); return 0; } -int Quick3DTechnique::annotationCount(QQmlListProperty<QAnnotation> *list) +int Quick3DTechnique::filterKeyCount(QQmlListProperty<QFilterKey> *list) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) - return technique->parentTechnique()->annotations().size(); + return technique->parentTechnique()->filterKeys().size(); return 0; } -void Quick3DTechnique::clearAnnotationList(QQmlListProperty<QAnnotation> *list) +void Quick3DTechnique::clearFilterKeyList(QQmlListProperty<QFilterKey> *list) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); if (technique) { - Q_FOREACH (QAnnotation *a, technique->parentTechnique()->annotations()) - technique->parentTechnique()->removeAnnotation(a); + const auto keys = technique->parentTechnique()->filterKeys(); + for (QFilterKey *a : keys) + technique->parentTechnique()->removeFilterKey(a); } } diff --git a/src/quick3d/quick3drender/items/quick3dtechnique_p.h b/src/quick3d/quick3drender/items/quick3dtechnique_p.h index ee96c243a..203befcb7 100644 --- a/src/quick3d/quick3drender/items/quick3dtechnique_p.h +++ b/src/quick3d/quick3drender/items/quick3dtechnique_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -61,13 +64,13 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DTechnique : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QAnnotation> annotations READ annotationList) + Q_PROPERTY(QQmlListProperty<Qt3DRender::QFilterKey> filterKeys READ filterKeyList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QRenderPass> renderPasses READ renderPassList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QParameter> parameters READ parameterList) public: explicit Quick3DTechnique(QObject *parent = 0); - QQmlListProperty<QAnnotation> annotationList(); + QQmlListProperty<QFilterKey> filterKeyList(); QQmlListProperty<QRenderPass> renderPassList(); QQmlListProperty<QParameter> parameterList(); @@ -81,10 +84,10 @@ private: static int parametersCount(QQmlListProperty<QParameter> *list); static void clearParameterList(QQmlListProperty<QParameter> *list); - static void appendAnnotation(QQmlListProperty<QAnnotation> *list, QAnnotation *Annotation); - static QAnnotation *annotationAt(QQmlListProperty<QAnnotation> *list, int index); - static int annotationCount(QQmlListProperty<QAnnotation> *list); - static void clearAnnotationList(QQmlListProperty<QAnnotation> *list); + static void appendFilterKey(QQmlListProperty<QFilterKey> *list, QFilterKey *filterKey); + static QFilterKey *filterKeyAt(QQmlListProperty<QFilterKey> *list, int index); + static int filterKeyCount(QQmlListProperty<QFilterKey> *list); + static void clearFilterKeyList(QQmlListProperty<QFilterKey> *list); static void appendRenderPass(QQmlListProperty<QRenderPass> *list, QRenderPass* renderPass); static QRenderPass *renderPassAt(QQmlListProperty<QRenderPass> *list, int index); diff --git a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp index 50334de28..b27d46c31 100644 --- a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp +++ b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -47,9 +50,9 @@ Quick3DTechniqueFilter::Quick3DTechniqueFilter(QObject *parent) { } -QQmlListProperty<QAnnotation> Quick3DTechniqueFilter::requireList() +QQmlListProperty<QFilterKey> Quick3DTechniqueFilter::matchList() { - return QQmlListProperty<QAnnotation>(this, 0, + return QQmlListProperty<QFilterKey>(this, 0, &Quick3DTechniqueFilter::appendRequire, &Quick3DTechniqueFilter::requiresCount, &Quick3DTechniqueFilter::requireAt, @@ -65,37 +68,38 @@ QQmlListProperty<QParameter> Quick3DTechniqueFilter::parameterList() &Quick3DTechniqueFilter::clearParameterList); } -void Quick3DTechniqueFilter::appendRequire(QQmlListProperty<QAnnotation> *list, QAnnotation *criterion) +void Quick3DTechniqueFilter::appendRequire(QQmlListProperty<QFilterKey> *list, QFilterKey *criterion) { Quick3DTechniqueFilter *filter = qobject_cast<Quick3DTechniqueFilter *>(list->object); if (filter) { criterion->setParent(filter->parentTechniqueFilter()); - filter->parentTechniqueFilter()->addRequirement(criterion); + filter->parentTechniqueFilter()->addMatch(criterion); } } -QAnnotation *Quick3DTechniqueFilter::requireAt(QQmlListProperty<QAnnotation> *list, int index) +QFilterKey *Quick3DTechniqueFilter::requireAt(QQmlListProperty<QFilterKey> *list, int index) { Quick3DTechniqueFilter *filter = qobject_cast<Quick3DTechniqueFilter *>(list->object); if (filter) - return filter->parentTechniqueFilter()->criteria().at(index); + return filter->parentTechniqueFilter()->matchAll().at(index); return 0; } -int Quick3DTechniqueFilter::requiresCount(QQmlListProperty<QAnnotation> *list) +int Quick3DTechniqueFilter::requiresCount(QQmlListProperty<QFilterKey> *list) { Quick3DTechniqueFilter *filter = qobject_cast<Quick3DTechniqueFilter *>(list->object); if (filter) - return filter->parentTechniqueFilter()->criteria().size(); + return filter->parentTechniqueFilter()->matchAll().size(); return 0; } -void Quick3DTechniqueFilter::clearRequires(QQmlListProperty<QAnnotation> *list) +void Quick3DTechniqueFilter::clearRequires(QQmlListProperty<QFilterKey> *list) { Quick3DTechniqueFilter *filter = qobject_cast<Quick3DTechniqueFilter *>(list->object); if (filter) { - Q_FOREACH (QAnnotation *criterion, filter->parentTechniqueFilter()->criteria()) - filter->parentTechniqueFilter()->removeRequirement(criterion); + const auto criteria = filter->parentTechniqueFilter()->matchAll(); + for (QFilterKey *criterion : criteria) + filter->parentTechniqueFilter()->removeMatch(criterion); } } @@ -120,7 +124,8 @@ int Quick3DTechniqueFilter::parametersCount(QQmlListProperty<QParameter> *list) void Quick3DTechniqueFilter::clearParameterList(QQmlListProperty<QParameter> *list) { Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object); - Q_FOREACH (QParameter *p, techniqueFilter->parentTechniqueFilter()->parameters()) + const auto parameters = techniqueFilter->parentTechniqueFilter()->parameters(); + for (QParameter *p : parameters) techniqueFilter->parentTechniqueFilter()->removeParameter(p); } diff --git a/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h b/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h index d8d4e4478..27d637e23 100644 --- a/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h +++ b/src/quick3d/quick3drender/items/quick3dtechniquefilter_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -50,7 +53,7 @@ #include <Qt3DQuickRender/private/qt3dquickrender_global_p.h> #include <Qt3DRender/qtechniquefilter.h> -#include <Qt3DRender/qannotation.h> +#include <Qt3DRender/qfilterkey.h> #include <Qt3DQuick/private/quick3dnode_p.h> #include <QQmlListProperty> @@ -63,22 +66,22 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DTechniqueFilter : public QObject { Q_OBJECT - Q_PROPERTY(QQmlListProperty<Qt3DRender::QAnnotation> requires READ requireList) + Q_PROPERTY(QQmlListProperty<Qt3DRender::QFilterKey> matchAll READ matchList) Q_PROPERTY(QQmlListProperty<Qt3DRender::QParameter> parameters READ parameterList) public: explicit Quick3DTechniqueFilter(QObject *parent = 0); - QQmlListProperty<QAnnotation> requireList(); + QQmlListProperty<QFilterKey> matchList(); QQmlListProperty<QParameter> parameterList(); inline QTechniqueFilter *parentTechniqueFilter() const { return qobject_cast<QTechniqueFilter*>(parent()); } private: - static void appendRequire(QQmlListProperty<QAnnotation> *list, QAnnotation *criterion); - static QAnnotation *requireAt(QQmlListProperty<QAnnotation> *list, int index); - static int requiresCount(QQmlListProperty<QAnnotation> *list); - static void clearRequires(QQmlListProperty<QAnnotation> *list); + static void appendRequire(QQmlListProperty<QFilterKey> *list, QFilterKey *criterion); + static QFilterKey *requireAt(QQmlListProperty<QFilterKey> *list, int index); + static int requiresCount(QQmlListProperty<QFilterKey> *list); + static void clearRequires(QQmlListProperty<QFilterKey> *list); static void appendParameter(QQmlListProperty<QParameter> *list, QParameter *param); static QParameter *parameterAt(QQmlListProperty<QParameter> *list, int index); diff --git a/src/quick3d/quick3drender/items/quick3dtexture.cpp b/src/quick3d/quick3drender/items/quick3dtexture.cpp index 90bd564f2..9c528996c 100644 --- a/src/quick3d/quick3drender/items/quick3dtexture.cpp +++ b/src/quick3d/quick3drender/items/quick3dtexture.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -69,7 +72,7 @@ QAbstractTextureImage *Quick3DTextureExtension::textureImageAt(QQmlListProperty< Quick3DTextureExtension *self = qobject_cast<Quick3DTextureExtension *>(list->object); if (self) return self->parentTexture()->textureImages().at(index); - return Q_NULLPTR; + return nullptr; } int Quick3DTextureExtension::textureImageCount(QQmlListProperty<QAbstractTextureImage> *list) @@ -82,10 +85,11 @@ int Quick3DTextureExtension::textureImageCount(QQmlListProperty<QAbstractTexture void Quick3DTextureExtension::clearTextureImageList(QQmlListProperty<QAbstractTextureImage> *list) { - Quick3DTextureExtension *self = qobject_cast<Quick3DTextureExtension *>(list->object); - if (self) - Q_FOREACH (QAbstractTextureImage *img, self->parentTexture()->textureImages()) + if (Quick3DTextureExtension *self = qobject_cast<Quick3DTextureExtension *>(list->object)) { + const auto images = self->parentTexture()->textureImages(); + for (QAbstractTextureImage *img : images) self->parentTexture()->removeTextureImage(img); + } } } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dtexture_p.h b/src/quick3d/quick3drender/items/quick3dtexture_p.h index 1089bb616..a1e2ad6b8 100644 --- a/src/quick3d/quick3drender/items/quick3dtexture_p.h +++ b/src/quick3d/quick3drender/items/quick3dtexture_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -70,7 +73,7 @@ public: explicit Quick3DTextureExtension(QObject *parent = 0); QQmlListProperty<QAbstractTextureImage> textureImages(); - inline QAbstractTextureProvider *parentTexture() const { return qobject_cast<QAbstractTextureProvider *>(parent()); } + inline QAbstractTexture *parentTexture() const { return qobject_cast<QAbstractTexture *>(parent()); } private: static void appendTextureImage(QQmlListProperty<QAbstractTextureImage> *list, QAbstractTextureImage *textureImage); diff --git a/src/quick3d/quick3drender/items/quick3dviewport.cpp b/src/quick3d/quick3drender/items/quick3dviewport.cpp index 5cb89a1b0..5d490018f 100644 --- a/src/quick3d/quick3drender/items/quick3dviewport.cpp +++ b/src/quick3d/quick3drender/items/quick3dviewport.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/items/quick3dviewport_p.h b/src/quick3d/quick3drender/items/quick3dviewport_p.h index a5eceadd0..877900365 100644 --- a/src/quick3d/quick3drender/items/quick3dviewport_p.h +++ b/src/quick3d/quick3drender/items/quick3dviewport_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/qt3dquickrender_global.cpp b/src/quick3d/quick3drender/qt3dquickrender_global.cpp index 1b8323c5c..0706185fe 100644 --- a/src/quick3d/quick3drender/qt3dquickrender_global.cpp +++ b/src/quick3d/quick3drender/qt3dquickrender_global.cpp @@ -1,35 +1,38 @@ /**************************************************************************** ** ** 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 +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/qt3dquickrender_global.h b/src/quick3d/quick3drender/qt3dquickrender_global.h index e92fbdbc9..7c21243e3 100644 --- a/src/quick3d/quick3drender/qt3dquickrender_global.h +++ b/src/quick3d/quick3drender/qt3dquickrender_global.h @@ -1,34 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt-project.org/legal +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -37,7 +40,7 @@ #ifndef QT3DQUICKRENDER_GLOBAL_H #define QT3DQUICKRENDER_GLOBAL_H -#include <QtCore/qglobal.h> +#include <Qt3DCore/qt3dcore_global.h> QT_BEGIN_NAMESPACE diff --git a/src/quick3d/quick3drender/qt3dquickrender_global_p.h b/src/quick3d/quick3drender/qt3dquickrender_global_p.h index 45d27d752..77378f41b 100644 --- a/src/quick3d/quick3drender/qt3dquickrender_global_p.h +++ b/src/quick3d/quick3drender/qt3dquickrender_global_p.h @@ -1,35 +1,38 @@ /**************************************************************************** ** ** 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 +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp index dd2265f1d..2d9456d12 100644 --- a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp +++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -56,7 +59,7 @@ void QuickRenderNodeFactory::registerType(const char *className, const char *qui Qt3DCore::QNode *QuickRenderNodeFactory::createNode(const char *type) { if (!m_types.contains(type)) - return Q_NULLPTR; + return nullptr; Type &typeInfo(m_types[type]); @@ -65,7 +68,7 @@ Qt3DCore::QNode *QuickRenderNodeFactory::createNode(const char *type) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); } - return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : Q_NULLPTR; + return typeInfo.t ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t->create()) : nullptr; } } // namespace Qt3DRender diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h index cd7ca2606..863a97f0b 100644 --- a/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h +++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory_p.h @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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 +** Foundation and appearing in the file LICENSE.LGPL3 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. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.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. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -48,7 +51,7 @@ // We mean it. // -#include <Qt3DCore/qabstractnodefactory.h> +#include <Qt3DCore/private/qabstractnodefactory_p.h> #include <QtCore/qhash.h> QT_BEGIN_NAMESPACE @@ -68,9 +71,9 @@ public: private: struct Type { - Type() : t(Q_NULLPTR), resolved(false) { } + Type() : t(nullptr), resolved(false) { } Type(const char *quickName, int major, int minor) - : quickName(quickName), version(major, minor), t(Q_NULLPTR), resolved(false) { } + : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { } QByteArray quickName; QPair<int, int> version; QQmlType *t; diff --git a/src/quick3d/quick3drender/quick3drender.pro b/src/quick3d/quick3drender/quick3drender.pro index f9d711dd6..959834870 100644 --- a/src/quick3d/quick3drender/quick3drender.pro +++ b/src/quick3d/quick3drender/quick3drender.pro @@ -4,6 +4,9 @@ MODULE = 3dquickrender QT += core core-private qml qml-private 3dcore 3drender 3dquick 3dquick-private 3dcore-private 3drender-private CONFIG -= precompile_header +# Qt3D is free of Q_FOREACH - make sure it stays that way: +DEFINES += QT_NO_FOREACH + gcov { CONFIG += static QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage |