diff options
Diffstat (limited to 'src/extras')
159 files changed, 978 insertions, 6648 deletions
diff --git a/src/extras/3dtext/3dtext.pri b/src/extras/3dtext/3dtext.pri deleted file mode 100644 index d7855f1b0..000000000 --- a/src/extras/3dtext/3dtext.pri +++ /dev/null @@ -1,11 +0,0 @@ - -SOURCES += \ - $$PWD/qextrudedtextgeometry.cpp \ - $$PWD/qextrudedtextmesh.cpp - -HEADERS += \ - $$PWD/qextrudedtextgeometry.h \ - $$PWD/qextrudedtextgeometry_p.h \ - $$PWD/qextrudedtextmesh.h - -INCLUDEPATH += $$PWD diff --git a/src/extras/3dtext/qextrudedtextgeometry.cpp b/src/extras/3dtext/qextrudedtextgeometry.cpp index 1c9208ea9..82ca6dae5 100644 --- a/src/extras/3dtext/qextrudedtextgeometry.cpp +++ b/src/extras/3dtext/qextrudedtextgeometry.cpp @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include "qextrudedtextgeometry.h" #include "qextrudedtextgeometry_p.h" @@ -94,7 +47,7 @@ TriangulationData triangulate(const QString &text, const QFont &font) QList<QPolygonF> polygons = path.toSubpathPolygons(QTransform().scale(1., -1.)); // maybe glyph has no geometry - if (polygons.size() == 0) + if (polygons.empty()) return result; const size_t prevNumIndices = result.indices.size(); @@ -130,11 +83,11 @@ TriangulationData triangulate(const QString &text, const QFont &font) result.indices.resize(result.indices.size() + size_t(triangles.indices.size())); memcpy(&result.indices[prevNumIndices], triangles.indices.data(), size_t(triangles.indices.size()) * sizeof(IndexType)); for (size_t i = prevNumIndices, m = result.indices.size(); i < m; ++i) - result.indices[i] += result.vertices.size(); + result.indices[i] += IndexType(result.vertices.size()); // Append new triangles to result.vertices result.vertices.reserve(size_t(triangles.vertices.size()) / 2); - for (int i = 0, m = triangles.vertices.size(); i < m; i += 2) + for (qsizetype i = 0, m = triangles.vertices.size(); i < m; i += 2) result.vertices.push_back(QVector3D(triangles.vertices[i] / font.pointSizeF(), triangles.vertices[i + 1] / font.pointSizeF(), 0.0f)); return result; @@ -307,7 +260,7 @@ void QExtrudedTextGeometryPrivate::update() TriangulationData data = triangulate(m_text, m_font); - const size_t numVertices = data.vertices.size(); + const IndexType numVertices = IndexType(data.vertices.size()); const size_t numIndices = data.indices.size(); struct Vertex { @@ -327,7 +280,8 @@ void QExtrudedTextGeometryPrivate::update() vertices.push_back({ QVector3D(v.x(), v.y(), m_depth), // vertex QVector3D(0.0f, 0.0f, 1.0f) }); // normal - for (size_t i = 0, verticesIndex = vertices.size(); i < data.outlines.size(); ++i) { + int verticesIndex = int(vertices.size()); + for (size_t i = 0; i < data.outlines.size(); ++i) { const int begin = data.outlines[i].begin; const int end = data.outlines[i].end; const int verticesIndexBegin = verticesIndex; @@ -380,12 +334,12 @@ void QExtrudedTextGeometryPrivate::update() memcpy(data.data(), vertices.data(), vertices.size() * sizeof(Vertex)); m_vertexBuffer->setData(data); - m_positionAttribute->setCount(vertices.size()); - m_normalAttribute->setCount(vertices.size()); + m_positionAttribute->setCount(int(vertices.size())); + m_normalAttribute->setCount(int(vertices.size())); } // resize for following insertions - const int indicesOffset = indices.size(); + const int indicesOffset = int(indices.size()); indices.resize(indices.size() + numIndices * 2); // copy values for back faces @@ -405,7 +359,7 @@ void QExtrudedTextGeometryPrivate::update() memcpy(data.data(), indices.data(), indices.size() * sizeof(IndexType)); m_indexBuffer->setData(data); - m_indexAttribute->setCount(indices.size()); + m_indexAttribute->setCount(uint(indices.size())); } } @@ -440,7 +394,7 @@ void QExtrudedTextGeometry::setDepth(float depth) } /*! - * \property QExtrudedTextGeometry::text + * \property Qt3DExtras::QExtrudedTextGeometry::text * * Holds the text used for the mesh. */ @@ -451,7 +405,7 @@ QString QExtrudedTextGeometry::text() const } /*! - * \property QExtrudedTextGeometry::font + * \property Qt3DExtras::QExtrudedTextGeometry::font * * Holds the font of the text. * @@ -466,7 +420,7 @@ QFont QExtrudedTextGeometry::font() const } /*! - * \property QExtrudedTextGeometry::extrusionLength + * \property Qt3DExtras::QExtrudedTextGeometry::extrusionLength * * Holds the extrusion length of the text. */ @@ -477,7 +431,7 @@ float QExtrudedTextGeometry::extrusionLength() const } /*! - * \property QExtrudedTextGeometry::positionAttribute + * \property Qt3DExtras::QExtrudedTextGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -488,7 +442,7 @@ Qt3DCore::QAttribute *QExtrudedTextGeometry::positionAttribute() const } /*! - * \property QExtrudedTextGeometry::normalAttribute + * \property Qt3DExtras::QExtrudedTextGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -499,7 +453,7 @@ Qt3DCore::QAttribute *QExtrudedTextGeometry::normalAttribute() const } /*! - * \property QExtrudedTextGeometry::indexAttribute + * \property Qt3DExtras::QExtrudedTextGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -512,3 +466,5 @@ Qt3DCore::QAttribute *QExtrudedTextGeometry::indexAttribute() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qextrudedtextgeometry.cpp" diff --git a/src/extras/3dtext/qextrudedtextgeometry.h b/src/extras/3dtext/qextrudedtextgeometry.h index 0a92932af..dd63f61a1 100644 --- a/src/extras/3dtext/qextrudedtextgeometry.h +++ b/src/extras/3dtext/qextrudedtextgeometry.h @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H #define QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H diff --git a/src/extras/3dtext/qextrudedtextgeometry_p.h b/src/extras/3dtext/qextrudedtextgeometry_p.h index fd692beaf..1b9cd7cca 100644 --- a/src/extras/3dtext/qextrudedtextgeometry_p.h +++ b/src/extras/3dtext/qextrudedtextgeometry_p.h @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_P_H #define QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_P_H diff --git a/src/extras/3dtext/qextrudedtextmesh.cpp b/src/extras/3dtext/qextrudedtextmesh.cpp index fc93726d2..9c141f2c7 100644 --- a/src/extras/3dtext/qextrudedtextmesh.cpp +++ b/src/extras/3dtext/qextrudedtextmesh.cpp @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include "qextrudedtextmesh.h" #include "qextrudedtextgeometry.h" @@ -65,13 +18,13 @@ namespace Qt3DExtras { */ /*! - * \qmlproperty QString Qt3DExtras::ExtrudedTextMesh::text + * \qmlproperty QString Qt3D.Extras::ExtrudedTextMesh::text * * Holds the text used for the mesh. */ /*! - * \qmlproperty QFont Qt3DExtras::ExtrudedTextMesh::font + * \qmlproperty QFont Qt3D.Extras::ExtrudedTextMesh::font * * Holds the font of the text. @@ -81,7 +34,7 @@ namespace Qt3DExtras { */ /*! - * \qmlproperty float Qt3DExtras::ExtrudedTextMesh::depth + * \qmlproperty float Qt3D.Extras::ExtrudedTextMesh::depth * * Holds the extrusion depth of the text. */ @@ -131,7 +84,7 @@ void QExtrudedTextMesh::setDepth(float depth) } /*! - * \property QExtrudedTextMesh::text + * \property Qt3DExtras::QExtrudedTextMesh::text * * Holds the text used for the mesh. */ @@ -141,7 +94,7 @@ QString QExtrudedTextMesh::text() const } /*! - * \property QExtrudedTextMesh::font + * \property Qt3DExtras::QExtrudedTextMesh::font * * Holds the font of the text. * @@ -155,7 +108,7 @@ QFont QExtrudedTextMesh::font() const } /*! - * \property QExtrudedTextMesh::depth + * \property Qt3DExtras::QExtrudedTextMesh::depth * * Holds the extrusion depth of the text. */ @@ -167,3 +120,5 @@ float QExtrudedTextMesh::depth() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qextrudedtextmesh.cpp" diff --git a/src/extras/3dtext/qextrudedtextmesh.h b/src/extras/3dtext/qextrudedtextmesh.h index 8cbfb6cfd..57ae9d96e 100644 --- a/src/extras/3dtext/qextrudedtextmesh.h +++ b/src/extras/3dtext/qextrudedtextmesh.h @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef QT3DEXTRAS_QEXTRUDEDTEXTMESH_H #define QT3DEXTRAS_QEXTRUDEDTEXTMESH_H diff --git a/src/extras/CMakeLists.txt b/src/extras/CMakeLists.txt index 85d480a5e..7e55cffa9 100644 --- a/src/extras/CMakeLists.txt +++ b/src/extras/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # Generated from extras.pro. ##################################################################### @@ -83,6 +86,9 @@ qt_internal_add_module(3DExtras Qt::CorePrivate ) +# QTransform conflicts +set_target_properties(3DExtras PROPERTIES UNITY_BUILD OFF) + # Resources: set(extras_resource_files "shaders/es2/coordinatesystems.inc" diff --git a/src/extras/defaults/defaults.pri b/src/extras/defaults/defaults.pri deleted file mode 100644 index cbd3bb8fe..000000000 --- a/src/extras/defaults/defaults.pri +++ /dev/null @@ -1,74 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/qdiffusespecularmaterial.h \ - $$PWD/qdiffusespecularmaterial_p.h \ - $$PWD/qphongmaterial.h \ - $$PWD/qphongmaterial_p.h \ - $$PWD/qdiffusemapmaterial_p.h \ - $$PWD/qdiffusemapmaterial.h \ - $$PWD/qnormaldiffusespecularmapmaterial.h \ - $$PWD/qnormaldiffusespecularmapmaterial_p.h \ - $$PWD/qnormaldiffusemapmaterial.h \ - $$PWD/qnormaldiffusemapmaterial_p.h \ - $$PWD/qnormaldiffusemapalphamaterial.h \ - $$PWD/qnormaldiffusemapalphamaterial_p.h \ - $$PWD/qdiffusespecularmapmaterial.h \ - $$PWD/qdiffusespecularmapmaterial_p.h \ - $$PWD/qforwardrenderer.h \ - $$PWD/qforwardrenderer_p.h \ - $$PWD/qpervertexcolormaterial.h \ - $$PWD/qpervertexcolormaterial_p.h \ - $$PWD/qskyboxentity.h \ - $$PWD/qskyboxentity_p.h \ - $$PWD/qgoochmaterial.h \ - $$PWD/qgoochmaterial_p.h \ - $$PWD/qphongalphamaterial.h \ - $$PWD/qphongalphamaterial_p.h \ - $$PWD/qt3dwindow.h \ - $$PWD/qt3dwindow_p.h \ - $$PWD/qabstractcameracontroller.h \ - $$PWD/qabstractcameracontroller_p.h \ - $$PWD/qfirstpersoncameracontroller.h \ - $$PWD/qorbitcameracontroller.h \ - $$PWD/qorbitcameracontroller_p.h \ - $$PWD/qabstractspritesheet.h \ - $$PWD/qabstractspritesheet_p.h \ - $$PWD/qspritegrid.h \ - $$PWD/qspritegrid_p.h \ - $$PWD/qspritesheet.h \ - $$PWD/qspritesheet_p.h \ - $$PWD/qspritesheetitem.h \ - $$PWD/qspritesheetitem_p.h \ - $$PWD/qtexturematerial.h \ - $$PWD/qtexturematerial_p.h \ - $$PWD/qmetalroughmaterial.h \ - $$PWD/qmetalroughmaterial_p.h \ - $$PWD/qmorphphongmaterial.h \ - $$PWD/qmorphphongmaterial_p.h - -SOURCES += \ - $$PWD/qdiffusespecularmaterial.cpp \ - $$PWD/qphongmaterial.cpp \ - $$PWD/qdiffusemapmaterial.cpp \ - $$PWD/qnormaldiffusespecularmapmaterial.cpp \ - $$PWD/qnormaldiffusemapmaterial.cpp \ - $$PWD/qnormaldiffusemapalphamaterial.cpp \ - $$PWD/qdiffusespecularmapmaterial.cpp \ - $$PWD/qforwardrenderer.cpp \ - $$PWD/qpervertexcolormaterial.cpp \ - $$PWD/qskyboxentity.cpp \ - $$PWD/qgoochmaterial.cpp \ - $$PWD/qphongalphamaterial.cpp \ - $$PWD/qt3dwindow.cpp \ - $$PWD/qabstractcameracontroller.cpp \ - $$PWD/qfirstpersoncameracontroller.cpp \ - $$PWD/qorbitcameracontroller.cpp \ - $$PWD/qabstractspritesheet.cpp \ - $$PWD/qspritegrid.cpp \ - $$PWD/qspritesheet.cpp \ - $$PWD/qspritesheetitem.cpp \ - $$PWD/qtexturematerial.cpp \ - $$PWD/qmetalroughmaterial.cpp \ - $$PWD/qmorphphongmaterial.cpp - diff --git a/src/extras/defaults/qabstractcameracontroller.cpp b/src/extras/defaults/qabstractcameracontroller.cpp index dafe1fde8..fdf81aac1 100644 --- a/src/extras/defaults/qabstractcameracontroller.cpp +++ b/src/extras/defaults/qabstractcameracontroller.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qabstractcameracontroller.h" #include "qabstractcameracontroller_p.h" @@ -259,9 +223,6 @@ void QAbstractCameraControllerPrivate::applyInputAccelerations() mouse, and other devices. QAbstractCameraController is an abstract class and cannot itself be instantiated. It provides a standard interface for camera controllers. - - Derived classes need only implement the frameActionTriggered() - method to move the camera. */ /*! @@ -288,7 +249,8 @@ QAbstractCameraController::QAbstractCameraController(QAbstractCameraControllerPr d->init(); QObject::connect(d->m_frameAction, &Qt3DLogic::QFrameAction::triggered, - this, [=] (float dt) { + this, [this] (float dt) { + Q_D(const QAbstractCameraController); InputState state; state.rxAxisValue = d->m_rxAxis->value(); diff --git a/src/extras/defaults/qabstractcameracontroller.h b/src/extras/defaults/qabstractcameracontroller.h index a88f1e05f..9d8ce8cd9 100644 --- a/src/extras/defaults/qabstractcameracontroller.h +++ b/src/extras/defaults/qabstractcameracontroller.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H #define QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H diff --git a/src/extras/defaults/qabstractcameracontroller_p.h b/src/extras/defaults/qabstractcameracontroller_p.h index c27f8dcee..9adb63987 100644 --- a/src/extras/defaults/qabstractcameracontroller_p.h +++ b/src/extras/defaults/qabstractcameracontroller_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_P_H #define QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_P_H diff --git a/src/extras/defaults/qabstractspritesheet.cpp b/src/extras/defaults/qabstractspritesheet.cpp index 2cf134f7c..ad7de0491 100644 --- a/src/extras/defaults/qabstractspritesheet.cpp +++ b/src/extras/defaults/qabstractspritesheet.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qabstractspritesheet.h" #include "qabstractspritesheet_p.h" @@ -44,10 +8,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QAbstractSpriteSheetPrivate::QAbstractSpriteSheetPrivate() : QNodePrivate() , m_texture(nullptr) @@ -141,3 +106,5 @@ void QAbstractSpriteSheet::setCurrentIndex(int currentIndex) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qabstractspritesheet.cpp" diff --git a/src/extras/defaults/qabstractspritesheet.h b/src/extras/defaults/qabstractspritesheet.h index d52d801fd..bc63ae371 100644 --- a/src/extras/defaults/qabstractspritesheet.h +++ b/src/extras/defaults/qabstractspritesheet.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QABSTRACTSPRITESHEET_H #define QT3DEXTRAS_QABSTRACTSPRITESHEET_H diff --git a/src/extras/defaults/qabstractspritesheet_p.h b/src/extras/defaults/qabstractspritesheet_p.h index 604fc3c62..f4d7b67b3 100644 --- a/src/extras/defaults/qabstractspritesheet_p.h +++ b/src/extras/defaults/qabstractspritesheet_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QABSTRACTSPRITESHEET_P_H #define QT3DEXTRAS_QABSTRACTSPRITESHEET_P_H diff --git a/src/extras/defaults/qdiffusemapmaterial.cpp b/src/extras/defaults/qdiffusemapmaterial.cpp index bd9785e2e..cfdcc9c56 100644 --- a/src/extras/defaults/qdiffusemapmaterial.cpp +++ b/src/extras/defaults/qdiffusemapmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qdiffusemapmaterial.h" #include "qdiffusemapmaterial_p.h" @@ -56,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseMapMaterialPrivate::QDiffuseMapMaterialPrivate() : QMaterialPrivate() , m_diffuseMapEffect(new QEffect()) @@ -257,7 +221,7 @@ QDiffuseMapMaterial::~QDiffuseMapMaterial() } /*! - \property QDiffuseMapMaterial::ambient + \property Qt3DExtras::QDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -269,7 +233,7 @@ QColor QDiffuseMapMaterial::ambient() const } /*! - \property QDiffuseMapMaterial::specular + \property Qt3DExtras::QDiffuseMapMaterial::specular Holds the current specular color. */ @@ -280,7 +244,7 @@ QColor QDiffuseMapMaterial::specular() const } /*! - \property QDiffuseMapMaterial::shininess + \property Qt3DExtras::QDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -291,7 +255,7 @@ float QDiffuseMapMaterial::shininess() const } /*! - \property QDiffuseMapMaterial::diffuse + \property Qt3DExtras::QDiffuseMapMaterial::diffuse Holds the current texture used as the diffuse map. @@ -311,7 +275,7 @@ QAbstractTexture *QDiffuseMapMaterial::diffuse() const } /*! - \property QDiffuseMapMaterial::textureScale + \property Qt3DExtras::QDiffuseMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -359,3 +323,5 @@ void QDiffuseMapMaterial::setTextureScale(float textureScale) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qdiffusemapmaterial.cpp" diff --git a/src/extras/defaults/qdiffusemapmaterial.h b/src/extras/defaults/qdiffusemapmaterial.h index 221e82859..546409f29 100644 --- a/src/extras/defaults/qdiffusemapmaterial.h +++ b/src/extras/defaults/qdiffusemapmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSEMAPMATERIAL_H #define QT3DEXTRAS_QDIFFUSEMAPMATERIAL_H diff --git a/src/extras/defaults/qdiffusemapmaterial_p.h b/src/extras/defaults/qdiffusemapmaterial_p.h index b49c4a86a..045c8e1e6 100644 --- a/src/extras/defaults/qdiffusemapmaterial_p.h +++ b/src/extras/defaults/qdiffusemapmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSEMAPMATERIAL_P_H #define QT3DEXTRAS_QDIFFUSEMAPMATERIAL_P_H diff --git a/src/extras/defaults/qdiffusespecularmapmaterial.cpp b/src/extras/defaults/qdiffusespecularmapmaterial.cpp index 8f1dd66e1..c791d02a8 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmapmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qdiffusespecularmapmaterial.h" #include "qdiffusespecularmapmaterial_p.h" @@ -56,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseSpecularMapMaterialPrivate::QDiffuseSpecularMapMaterialPrivate() : QMaterialPrivate() , m_diffuseSpecularMapEffect(new QEffect()) @@ -264,7 +228,7 @@ QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial() } /*! - \property QDiffuseSpecularMapMaterial::ambient + \property Qt3DExtras::QDiffuseSpecularMapMaterial::ambient Holds the current ambient color that is emitted by an object without any other light source. @@ -276,7 +240,7 @@ QColor QDiffuseSpecularMapMaterial::ambient() const } /*! - \property QDiffuseSpecularMapMaterial::diffuse + \property Qt3DExtras::QDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -296,7 +260,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::diffuse() const } /*! - \property QDiffuseSpecularMapMaterial::specular + \property Qt3DExtras::QDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -316,7 +280,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::specular() const } /*! - \property QDiffuseSpecularMapMaterial::shininess + \property Qt3DExtras::QDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. Higher values of shininess result in a smaller and brighter highlight. @@ -330,7 +294,7 @@ float QDiffuseSpecularMapMaterial::shininess() const } /*! - \property QDiffuseSpecularMapMaterial::textureScale + \property Qt3DExtras::QDiffuseSpecularMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -378,3 +342,5 @@ void QDiffuseSpecularMapMaterial::setTextureScale(float textureScale) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qdiffusespecularmapmaterial.cpp" diff --git a/src/extras/defaults/qdiffusespecularmapmaterial.h b/src/extras/defaults/qdiffusespecularmapmaterial.h index bbf060397..dd01ac7c9 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial.h +++ b/src/extras/defaults/qdiffusespecularmapmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSESPECULARMAPMATERIAL_H #define QT3DEXTRAS_QDIFFUSESPECULARMAPMATERIAL_H diff --git a/src/extras/defaults/qdiffusespecularmapmaterial_p.h b/src/extras/defaults/qdiffusespecularmapmaterial_p.h index 021836c14..39a0c27dd 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial_p.h +++ b/src/extras/defaults/qdiffusespecularmapmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSESPECULARMAPMATERIAL_P_H #define QT3DEXTRAS_QDIFFUSESPECULARMAPMATERIAL_P_H diff --git a/src/extras/defaults/qdiffusespecularmaterial.cpp b/src/extras/defaults/qdiffusespecularmaterial.cpp index 2a1139aef..7dd5fbbf9 100644 --- a/src/extras/defaults/qdiffusespecularmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qdiffusespecularmaterial.h" #include "qdiffusespecularmaterial_p.h" @@ -60,10 +24,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseSpecularMaterialPrivate::QDiffuseSpecularMaterialPrivate() : QMaterialPrivate() , m_effect(new QEffect()) @@ -307,7 +271,7 @@ QDiffuseSpecularMaterial::~QDiffuseSpecularMaterial() } /*! - \property QDiffuseSpecularMaterial::ambient + \property Qt3DExtras::QDiffuseSpecularMaterial::ambient Holds the ambient color that is emitted by an object without any other light source. @@ -325,7 +289,7 @@ QColor QDiffuseSpecularMaterial::ambient() const } /*! - \property QDiffuseSpecularMaterial::diffuse + \property Qt3DExtras::QDiffuseSpecularMaterial::diffuse Holds the diffuse color of the material that is emitted for rough surface reflections with the lights. This can be either a plain color value or a @@ -345,7 +309,7 @@ QVariant QDiffuseSpecularMaterial::diffuse() const } /*! - \property QDiffuseSpecularMaterial::specular + \property Qt3DExtras::QDiffuseSpecularMaterial::specular Holds the specular color of the material that is emitted for shiny surface reflections with the lights. This can be either a plain color value or a @@ -365,7 +329,7 @@ QVariant QDiffuseSpecularMaterial::specular() const } /*! - \property QDiffuseSpecularMaterial::shininess + \property Qt3DExtras::QDiffuseSpecularMaterial::shininess Holds the shininess exponent. Higher values of shininess result in a smaller and brighter highlight. @@ -387,7 +351,7 @@ float QDiffuseSpecularMaterial::shininess() const } /*! - \property QDiffuseSpecularMaterial::normal + \property Qt3DExtras::QDiffuseSpecularMaterial::normal Holds the current normal map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -405,7 +369,7 @@ QVariant QDiffuseSpecularMaterial::normal() const } /*! - \property QDiffuseSpecularMaterial::textureScale + \property Qt3DExtras::QDiffuseSpecularMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -431,7 +395,7 @@ float QDiffuseSpecularMaterial::textureScale() const } /*! - \property QDiffuseSpecularMaterial::alphaBlending + \property Qt3DExtras::QDiffuseSpecularMaterial::alphaBlending Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false. @@ -539,3 +503,5 @@ void QDiffuseSpecularMaterial::setAlphaBlendingEnabled(bool enabled) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qdiffusespecularmaterial.cpp" diff --git a/src/extras/defaults/qdiffusespecularmaterial.h b/src/extras/defaults/qdiffusespecularmaterial.h index 7ce1e65ba..ef59d5b09 100644 --- a/src/extras/defaults/qdiffusespecularmaterial.h +++ b/src/extras/defaults/qdiffusespecularmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSESPECULARMATERIAL_H #define QT3DEXTRAS_QDIFFUSESPECULARMATERIAL_H diff --git a/src/extras/defaults/qdiffusespecularmaterial_p.h b/src/extras/defaults/qdiffusespecularmaterial_p.h index 9e2b2bbbb..001f0ded6 100644 --- a/src/extras/defaults/qdiffusespecularmaterial_p.h +++ b/src/extras/defaults/qdiffusespecularmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDIFFUSESPECULARMATERIAL_P_H #define QT3DEXTRAS_QDIFFUSESPECULARMATERIAL_P_H diff --git a/src/extras/defaults/qfirstpersoncameracontroller.cpp b/src/extras/defaults/qfirstpersoncameracontroller.cpp index 13fa590fe..1cd7c0000 100644 --- a/src/extras/defaults/qfirstpersoncameracontroller.cpp +++ b/src/extras/defaults/qfirstpersoncameracontroller.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qfirstpersoncameracontroller.h" diff --git a/src/extras/defaults/qfirstpersoncameracontroller.h b/src/extras/defaults/qfirstpersoncameracontroller.h index 1c92998e1..157441dbf 100644 --- a/src/extras/defaults/qfirstpersoncameracontroller.h +++ b/src/extras/defaults/qfirstpersoncameracontroller.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QFIRSTPERSONCAMERACONTROLLER_H #define QT3DEXTRAS_QFIRSTPERSONCAMERACONTROLLER_H diff --git a/src/extras/defaults/qforwardrenderer.cpp b/src/extras/defaults/qforwardrenderer.cpp index a31c9a188..e6a407f56 100644 --- a/src/extras/defaults/qforwardrenderer.cpp +++ b/src/extras/defaults/qforwardrenderer.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qforwardrenderer.h" #include "qforwardrenderer_p.h" @@ -58,10 +22,10 @@ static void initResources() QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QForwardRendererPrivate::QForwardRendererPrivate() : QTechniqueFilterPrivate() , m_surfaceSelector(new QRenderSurfaceSelector) @@ -218,7 +182,7 @@ void QForwardRenderer::setShowDebugOverlay(bool showDebugOverlay) Holds the current normalized viewport rectangle. */ /*! - \property QForwardRenderer::viewportRect + \property Qt3DExtras::QForwardRenderer::viewportRect Holds the current normalized viewport rectangle. */ @@ -235,7 +199,7 @@ QRectF QForwardRenderer::viewportRect() const before rendering. */ /*! - \property QForwardRenderer::clearColor + \property Qt3DExtras::QForwardRenderer::clearColor Holds the current clear color of the scene. The frame buffer is initialized to the clear color before rendering. @@ -253,7 +217,7 @@ QColor QForwardRenderer::clearColor() const \since 5.14 */ /*! - \property QForwardRenderer::buffersToClear + \property Qt3DExtras::QForwardRenderer::buffersToClear Holds the current buffers to be cleared. Default value is ColorDepthBuffer \since 5.14 @@ -272,7 +236,7 @@ QClearBuffers::BufferType QForwardRenderer::buffersToClear() const \note A camera is an Entity that has a CameraLens as one of its components. */ /*! - \property QForwardRenderer::camera + \property Qt3DExtras::QForwardRenderer::camera Holds the current camera entity used to render the scene. @@ -292,7 +256,7 @@ Qt3DCore::QEntity *QForwardRenderer::camera() const \deprecated */ /*! - \property QForwardRenderer::window + \property Qt3DExtras::QForwardRenderer::window Holds the current render surface. @@ -305,7 +269,7 @@ Qt3DCore::QEntity *QForwardRenderer::camera() const Holds the current render surface. */ /*! - \property QForwardRenderer::surface + \property Qt3DExtras::QForwardRenderer::surface Holds the current render surface. */ @@ -323,7 +287,7 @@ QObject *QForwardRenderer::surface() const surface (as set in \l {surface}). */ /*! - \property QForwardRenderer::externalRenderTargetSize + \property Qt3DExtras::QForwardRenderer::externalRenderTargetSize Contains the size of the external render target. External render targets are relevant when rendering does not target a window @@ -341,7 +305,7 @@ QSize QForwardRenderer::externalRenderTargetSize() const Indicates if the renderer applies frustum culling to the scene. */ /*! - \property QForwardRenderer::frustumCulling + \property Qt3DExtras::QForwardRenderer::frustumCulling Indicates if the renderer applies frustum culling to the scene. */ @@ -357,7 +321,7 @@ bool QForwardRenderer::isFrustumCullingEnabled() const Holds the gamma value the renderer applies to the scene. */ /*! - \property QForwardRenderer::gamma + \property Qt3DExtras::QForwardRenderer::gamma Holds the gamma value the renderer applies to the scene. */ @@ -377,7 +341,7 @@ float QForwardRenderer::gamma() const \since 5.15 */ /*! - \property QForwardRenderer::showDebugOverlay + \property Qt3DExtras::QForwardRenderer::showDebugOverlay If true, a debug overlay will be rendered over the scene. It will show detailed information about the runtime rendering state, let the user @@ -394,3 +358,5 @@ bool QForwardRenderer::showDebugOverlay() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qforwardrenderer.cpp" diff --git a/src/extras/defaults/qforwardrenderer.h b/src/extras/defaults/qforwardrenderer.h index 165b17a41..62db986ec 100644 --- a/src/extras/defaults/qforwardrenderer.h +++ b/src/extras/defaults/qforwardrenderer.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QFORWARDRENDERER_H #define QT3DEXTRAS_QFORWARDRENDERER_H diff --git a/src/extras/defaults/qforwardrenderer_p.h b/src/extras/defaults/qforwardrenderer_p.h index f1c95e132..7dabd924c 100644 --- a/src/extras/defaults/qforwardrenderer_p.h +++ b/src/extras/defaults/qforwardrenderer_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QFORWARDRENDERER_P_H #define QT3DEXTRAS_QFORWARDRENDERER_P_H diff --git a/src/extras/defaults/qgoochmaterial.cpp b/src/extras/defaults/qgoochmaterial.cpp index b5665d776..f652fda2e 100644 --- a/src/extras/defaults/qgoochmaterial.cpp +++ b/src/extras/defaults/qgoochmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qgoochmaterial.h" #include "qgoochmaterial_p.h" @@ -253,7 +217,7 @@ QGoochMaterial::QGoochMaterial(QGoochMaterialPrivate &dd, QNode *parent) } /*! - \property QGoochMaterial::diffuse + \property Qt3DExtras::QGoochMaterial::diffuse Holds the current diffuse color. */ @@ -264,7 +228,7 @@ QColor QGoochMaterial::diffuse() const } /*! - \property QGoochMaterial::specular + \property Qt3DExtras::QGoochMaterial::specular Holds the current specular color. */ @@ -275,7 +239,7 @@ QColor QGoochMaterial::specular() const } /*! - \property QGoochMaterial::cool + \property Qt3DExtras::QGoochMaterial::cool Holds the current cool color. */ @@ -286,7 +250,7 @@ QColor QGoochMaterial::cool() const } /*! - \property QGoochMaterial::warm + \property Qt3DExtras::QGoochMaterial::warm Holds the current warm color. */ @@ -297,7 +261,7 @@ QColor QGoochMaterial::warm() const } /*! - \property QGoochMaterial::alpha + \property Qt3DExtras::QGoochMaterial::alpha Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha * diffuse}. @@ -309,7 +273,7 @@ float QGoochMaterial::alpha() const } /*! - \property QGoochMaterial::beta + \property Qt3DExtras::QGoochMaterial::beta Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta * diffuse}. @@ -321,7 +285,7 @@ float QGoochMaterial::beta() const } /*! - \property QGoochMaterial::shininess + \property Qt3DExtras::QGoochMaterial::shininess Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight. @@ -377,3 +341,5 @@ void QGoochMaterial::setShininess(float shininess) } QT_END_NAMESPACE + +#include "moc_qgoochmaterial.cpp" diff --git a/src/extras/defaults/qgoochmaterial.h b/src/extras/defaults/qgoochmaterial.h index 293ce0dbe..2269cc168 100644 --- a/src/extras/defaults/qgoochmaterial.h +++ b/src/extras/defaults/qgoochmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QGOOCHMATERIAL_H #define QT3DEXTRAS_QGOOCHMATERIAL_H diff --git a/src/extras/defaults/qgoochmaterial_p.h b/src/extras/defaults/qgoochmaterial_p.h index aca9ce639..6af36cb71 100644 --- a/src/extras/defaults/qgoochmaterial_p.h +++ b/src/extras/defaults/qgoochmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QGOOCHMATERIAL_P_H #define QT3DEXTRAS_QGOOCHMATERIAL_P_H diff --git a/src/extras/defaults/qmetalroughmaterial.cpp b/src/extras/defaults/qmetalroughmaterial.cpp index 79ff94337..edbef486f 100644 --- a/src/extras/defaults/qmetalroughmaterial.cpp +++ b/src/extras/defaults/qmetalroughmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qmetalroughmaterial.h" #include "qmetalroughmaterial_p.h" @@ -55,13 +19,13 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QMetalRoughMaterialPrivate::QMetalRoughMaterialPrivate() : QMaterialPrivate() - , m_baseColorParameter(new QParameter(QStringLiteral("baseColor"), QColor("grey"))) + , m_baseColorParameter(new QParameter(QStringLiteral("baseColor"), QColor::fromString("grey"))) , m_metalnessParameter(new QParameter(QStringLiteral("metalness"), 0.0f)) , m_roughnessParameter(new QParameter(QStringLiteral("roughness"), 0.0f)) , m_baseColorMapParameter(new QParameter(QStringLiteral("baseColorMap"), QVariant())) @@ -268,7 +232,7 @@ QMetalRoughMaterial::~QMetalRoughMaterial() } /*! - \property QMetalRoughMaterial::baseColor + \property Qt3DExtras::QMetalRoughMaterial::baseColor Holds the current base color of the material. This can be either a plain color value or a texture. By default the value of this property is "grey". @@ -286,7 +250,7 @@ QVariant QMetalRoughMaterial::baseColor() const } /*! - \property QMetalRoughMaterial::metalness + \property Qt3DExtras::QMetalRoughMaterial::metalness Holds the current metalness level of the material, as a value between 0 (purely dielectric, the default) and 1 (purely metallic). This can be @@ -308,7 +272,7 @@ QVariant QMetalRoughMaterial::metalness() const } /*! - \property QMetalRoughMaterial::roughness + \property Qt3DExtras::QMetalRoughMaterial::roughness Holds the current roughness level of the material. This can be either a plain uniform value or a texture. By default the value of this property is @@ -328,7 +292,7 @@ QVariant QMetalRoughMaterial::roughness() const } /*! - \property QMetalRoughMaterial::ambientOcclusion + \property Qt3DExtras::QMetalRoughMaterial::ambientOcclusion Holds the current ambient occlusion map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -346,7 +310,7 @@ QVariant QMetalRoughMaterial::ambientOcclusion() const } /*! - \property QMetalRoughMaterial::normal + \property Qt3DExtras::QMetalRoughMaterial::normal Holds the current normal map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -364,7 +328,7 @@ QVariant QMetalRoughMaterial::normal() const } /*! - \property QMetalRoughMaterial::textureScale + \property Qt3DExtras::QMetalRoughMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -505,3 +469,5 @@ void QMetalRoughMaterial::setTextureScale(float textureScale) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qmetalroughmaterial.cpp" diff --git a/src/extras/defaults/qmetalroughmaterial.h b/src/extras/defaults/qmetalroughmaterial.h index c3c3d6da9..0d057f4c0 100644 --- a/src/extras/defaults/qmetalroughmaterial.h +++ b/src/extras/defaults/qmetalroughmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QMETALROUGHMATERIAL_H #define QT3DEXTRAS_QMETALROUGHMATERIAL_H diff --git a/src/extras/defaults/qmetalroughmaterial_p.h b/src/extras/defaults/qmetalroughmaterial_p.h index 931b6d8ce..95a1b0ffd 100644 --- a/src/extras/defaults/qmetalroughmaterial_p.h +++ b/src/extras/defaults/qmetalroughmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QMETALROUGHMATERIAL_P_H #define QT3DEXTRAS_QMETALROUGHMATERIAL_P_H diff --git a/src/extras/defaults/qmorphphongmaterial.cpp b/src/extras/defaults/qmorphphongmaterial.cpp index e5b94837c..712df2209 100644 --- a/src/extras/defaults/qmorphphongmaterial.cpp +++ b/src/extras/defaults/qmorphphongmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qmorphphongmaterial.h" #include "qmorphphongmaterial_p.h" @@ -54,16 +18,16 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QMorphPhongMaterialPrivate::QMorphPhongMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) - , m_ambientParameter(new QParameter(QStringLiteral("ka"), QColor::fromRgbF(0.05, 0.05, 0.05, 1.0))) - , m_diffuseParameter(new QParameter(QStringLiteral("kd"), QColor::fromRgbF(0.7, 0.7, 0.7, 1.0))) - , m_specularParameter(new QParameter(QStringLiteral("ks"), QColor::fromRgbF(0.01, 0.01, 0.01, 1.0))) + , m_ambientParameter(new QParameter(QStringLiteral("ka"), QColor::fromRgbF(0.05f, 0.05f, 0.05f, 1.0f))) + , m_diffuseParameter(new QParameter(QStringLiteral("kd"), QColor::fromRgbF(0.7f, 0.7f, 0.7f, 1.0f))) + , m_specularParameter(new QParameter(QStringLiteral("ks"), QColor::fromRgbF(0.01f, 0.01f, 0.01f, 1.0f))) , m_shininessParameter(new QParameter(QStringLiteral("shininess"), 150.0f)) , m_interpolatorParameter(new QParameter(QStringLiteral("interpolator"), 0.0f)) , m_phongGL3Technique(new QTechnique()) @@ -246,7 +210,7 @@ QMorphPhongMaterial::~QMorphPhongMaterial() } /*! - \property QMorphPhongMaterial::ambient + \property Qt3DExtras::QMorphPhongMaterial::ambient Holds the ambient color. */ @@ -257,7 +221,7 @@ QColor QMorphPhongMaterial::ambient() const } /*! - \property QMorphPhongMaterial::diffuse + \property Qt3DExtras::QMorphPhongMaterial::diffuse Holds the diffuse color. */ @@ -268,7 +232,7 @@ QColor QMorphPhongMaterial::diffuse() const } /*! - \property QMorphPhongMaterial::specular + \property Qt3DExtras::QMorphPhongMaterial::specular Holds the specular color. */ @@ -279,7 +243,7 @@ QColor QMorphPhongMaterial::specular() const } /*! - \property QMorphPhongMaterial::shininess + \property Qt3DExtras::QMorphPhongMaterial::shininess Holds the shininess exponent. */ @@ -290,7 +254,7 @@ float QMorphPhongMaterial::shininess() const } /*! - \property QMorphPhongMaterial::interpolator + \property Qt3DExtras::QMorphPhongMaterial::interpolator Contains the interpolation method of the Phong lighting effect. */ @@ -333,3 +297,5 @@ void QMorphPhongMaterial::setInterpolator(float interpolator) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qmorphphongmaterial.cpp" diff --git a/src/extras/defaults/qmorphphongmaterial.h b/src/extras/defaults/qmorphphongmaterial.h index b43d047a4..6985d2fcd 100644 --- a/src/extras/defaults/qmorphphongmaterial.h +++ b/src/extras/defaults/qmorphphongmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QMORPHPHONGMATERIAL_H #define QT3DEXTRAS_QMORPHPHONGMATERIAL_H diff --git a/src/extras/defaults/qmorphphongmaterial_p.h b/src/extras/defaults/qmorphphongmaterial_p.h index 41b020747..322ca7ba5 100644 --- a/src/extras/defaults/qmorphphongmaterial_p.h +++ b/src/extras/defaults/qmorphphongmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QMORPHPHONGMATERIAL_P_H #define QT3DEXTRAS_QMORPHPHONGMATERIAL_P_H diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp index b618742a0..19be3cfa9 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qnormaldiffusemapalphamaterial.h" #include "qnormaldiffusemapalphamaterial_p.h" @@ -56,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseMapAlphaMaterialPrivate::QNormalDiffuseMapAlphaMaterialPrivate() : QNormalDiffuseMapMaterialPrivate() @@ -219,3 +183,5 @@ QNormalDiffuseMapAlphaMaterial::~QNormalDiffuseMapAlphaMaterial() } // namespace Qt3DRender QT_END_NAMESPACE + +#include "moc_qnormaldiffusemapalphamaterial.cpp" diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.h b/src/extras/defaults/qnormaldiffusemapalphamaterial.h index 735430b37..ce7abac13 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial.h +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSEMAPALPHAMATERIAL_H #define QT3DEXTRAS_QNORMALDIFFUSEMAPALPHAMATERIAL_H diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial_p.h b/src/extras/defaults/qnormaldiffusemapalphamaterial_p.h index d6dfe6892..0aef0506d 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial_p.h +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSEMAPALPHAMATERIAL_P_H #define QT3DEXTRAS_QNORMALDIFFUSEMAPALPHAMATERIAL_P_H diff --git a/src/extras/defaults/qnormaldiffusemapmaterial.cpp b/src/extras/defaults/qnormaldiffusemapmaterial.cpp index 95e031233..6eb0d38a7 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qnormaldiffusemapmaterial.h" #include "qnormaldiffusemapmaterial_p.h" @@ -55,10 +19,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseMapMaterialPrivate::QNormalDiffuseMapMaterialPrivate() : QMaterialPrivate() , m_normalDiffuseEffect(new QEffect()) @@ -282,7 +246,7 @@ QNormalDiffuseMapMaterial::~QNormalDiffuseMapMaterial() } /*! - \property QNormalDiffuseMapMaterial::ambient + \property Qt3DExtras::QNormalDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -293,7 +257,7 @@ QColor QNormalDiffuseMapMaterial::ambient() const } /*! - \property QNormalDiffuseMapMaterial::specular + \property Qt3DExtras::QNormalDiffuseMapMaterial::specular Holds the current specular color. */ @@ -304,7 +268,7 @@ QColor QNormalDiffuseMapMaterial::specular() const } /*! - \property QNormalDiffuseMapMaterial::diffuse + \property Qt3DExtras::QNormalDiffuseMapMaterial::diffuse Holds the current diffuse map texture. @@ -324,7 +288,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::diffuse() const } /*! - \property QNormalDiffuseMapMaterial::normal + \property Qt3DExtras::QNormalDiffuseMapMaterial::normal Holds the current normal map texture. @@ -343,7 +307,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::normal() const } /*! - \property QNormalDiffuseMapMaterial::shininess + \property Qt3DExtras::QNormalDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -354,7 +318,7 @@ float QNormalDiffuseMapMaterial::shininess() const } /*! - \property QNormalDiffuseMapMaterial::textureScale + \property Qt3DExtras::QNormalDiffuseMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -408,3 +372,5 @@ void QNormalDiffuseMapMaterial::setTextureScale(float textureScale) } // namespace Qt3DRender QT_END_NAMESPACE + +#include "moc_qnormaldiffusemapmaterial.cpp" diff --git a/src/extras/defaults/qnormaldiffusemapmaterial.h b/src/extras/defaults/qnormaldiffusemapmaterial.h index a2db0d7f5..c7ff662e6 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial.h +++ b/src/extras/defaults/qnormaldiffusemapmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSEMAPMATERIAL_H #define QT3DEXTRAS_QNORMALDIFFUSEMAPMATERIAL_H diff --git a/src/extras/defaults/qnormaldiffusemapmaterial_p.h b/src/extras/defaults/qnormaldiffusemapmaterial_p.h index 5a5839682..056abedf9 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial_p.h +++ b/src/extras/defaults/qnormaldiffusemapmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSEMAPMATERIAL_P_H #define QT3DEXTRAS_QNORMALDIFFUSEMAPMATERIAL_P_H diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp index 69fd34e19..098b6b799 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qnormaldiffusespecularmapmaterial.h" #include "qnormaldiffusespecularmapmaterial_p.h" @@ -56,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseSpecularMapMaterialPrivate::QNormalDiffuseSpecularMapMaterialPrivate() : QMaterialPrivate() , m_normalDiffuseSpecularEffect(new QEffect()) @@ -290,7 +254,7 @@ QNormalDiffuseSpecularMapMaterial::~QNormalDiffuseSpecularMapMaterial() } /*! - \property QNormalDiffuseSpecularMapMaterial::ambient + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::ambient Holds the current ambient color. */ @@ -301,7 +265,7 @@ QColor QNormalDiffuseSpecularMapMaterial::ambient() const } /*! - \property QNormalDiffuseSpecularMapMaterial::diffuse + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -321,7 +285,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::diffuse() const } /*! - \property QNormalDiffuseSpecularMapMaterial::normal + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::normal Holds the current normal map texture. @@ -340,7 +304,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::normal() const } /*! - \property QNormalDiffuseSpecularMapMaterial::specular + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -360,7 +324,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::specular() const } /*! - \property QNormalDiffuseSpecularMapMaterial::shininess + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. */ @@ -371,7 +335,7 @@ float QNormalDiffuseSpecularMapMaterial::shininess() const } /*! - \property QNormalDiffuseSpecularMapMaterial::textureScale + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -425,3 +389,5 @@ void QNormalDiffuseSpecularMapMaterial::setTextureScale(float textureScale) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qnormaldiffusespecularmapmaterial.cpp" diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial.h b/src/extras/defaults/qnormaldiffusespecularmapmaterial.h index 77ae9a7b6..a6117f384 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial.h +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_H #define QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_H diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial_p.h b/src/extras/defaults/qnormaldiffusespecularmapmaterial_p.h index 0a0d519ad..1ed881452 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial_p.h +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_P_H #define QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_P_H diff --git a/src/extras/defaults/qorbitcameracontroller.cpp b/src/extras/defaults/qorbitcameracontroller.cpp index ec3a631c7..390a986f3 100644 --- a/src/extras/defaults/qorbitcameracontroller.cpp +++ b/src/extras/defaults/qorbitcameracontroller.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qorbitcameracontroller.h" #include "qorbitcameracontroller_p.h" @@ -48,6 +12,12 @@ namespace Qt3DExtras { QOrbitCameraControllerPrivate::QOrbitCameraControllerPrivate() : m_zoomInLimit(2.0f) + , m_upVector(0.0f, 1.0f, 0.0f) + , m_inverseXTranslate(false) + , m_inverseYTranslate(false) + , m_inversePan(false) + , m_inverseTilt(false) + , m_zoomTranslateViewCenter(true) {} /*! @@ -116,7 +86,7 @@ QOrbitCameraController::~QOrbitCameraController() } /*! - \property QOrbitCameraController::zoomInLimit + \property Qt3DExtras::QOrbitCameraController::zoomInLimit Holds the current zoom-in limit. The zoom-in limit determines how close to the view center the camera can be zoomed. @@ -136,6 +106,95 @@ void QOrbitCameraController::setZoomInLimit(float zoomInLimit) } } +QVector3D QOrbitCameraController::upVector() const { + Q_D(const QOrbitCameraController); + return d->m_upVector; +} + +void QOrbitCameraController::setUpVector(const QVector3D& upVector) +{ + Q_D(QOrbitCameraController); + if (d->m_upVector != upVector) { + d->m_upVector = upVector; + emit upVectorChanged(d->m_upVector); + } +} + +bool QOrbitCameraController::inverseXTranslate() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseXTranslate; +} + +void QOrbitCameraController::setInverseXTranslate(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseXTranslate != isInverse) { + d->m_inverseXTranslate = isInverse; + emit inverseXTranslateChanged(d->m_inverseXTranslate); + } +} + +bool QOrbitCameraController::inverseYTranslate() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseYTranslate; +} + +void QOrbitCameraController::setInverseYTranslate(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseYTranslate != isInverse) { + d->m_inverseYTranslate = isInverse; + emit inverseYTranslateChanged(d->m_inverseYTranslate); + } +} + +bool QOrbitCameraController::inversePan() const +{ + Q_D(const QOrbitCameraController); + return d->m_inversePan; +} + +void QOrbitCameraController::setInversePan(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inversePan != isInverse) { + d->m_inversePan = isInverse; + emit inversePanChanged(d->m_inversePan); + } +} + +bool QOrbitCameraController::inverseTilt() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseTilt; +} + +void QOrbitCameraController::setInverseTilt(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseTilt != isInverse) { + d->m_inverseTilt = isInverse; + emit inverseTiltChanged(d->m_inverseTilt); + } +} + +bool QOrbitCameraController::zoomTranslateViewCenter() const +{ + Q_D(const QOrbitCameraController); + return d->m_zoomTranslateViewCenter; +} + +void QOrbitCameraController::setZoomTranslateViewCenter(bool isTranslate) +{ + Q_D(QOrbitCameraController); + if (d->m_zoomTranslateViewCenter != isTranslate) { + d->m_zoomTranslateViewCenter = isTranslate; + emit zoomTranslateViewCenterChanged(d->m_zoomTranslateViewCenter); + } +} + inline float clampInputs(float input1, float input2) { float axisValue = input1 + input2; @@ -156,8 +215,6 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt if (theCamera == nullptr) return; - const QVector3D upVector(0.0f, 1.0f, 0.0f); - // Mouse input if (state.leftMouseButtonActive) { if (state.rightMouseButtonActive) { @@ -169,22 +226,22 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt } } else { // Translate - theCamera->translate(QVector3D(clampInputs(state.rxAxisValue, state.txAxisValue) * linearSpeed(), - clampInputs(state.ryAxisValue, state.tyAxisValue) * linearSpeed(), - 0) * dt); + theCamera->translate(QVector3D((d->m_inverseXTranslate ? -1.0f : 1.0f) * clampInputs(state.rxAxisValue, state.txAxisValue) * linearSpeed(), + (d->m_inverseYTranslate ? -1.0f : 1.0f) * clampInputs(state.ryAxisValue, state.tyAxisValue) * linearSpeed(), + 0) * dt); } return; } else if (state.rightMouseButtonActive) { // Orbit - theCamera->panAboutViewCenter((state.rxAxisValue * lookSpeed()) * dt, upVector); - theCamera->tiltAboutViewCenter((state.ryAxisValue * lookSpeed()) * dt); + theCamera->panAboutViewCenter((d->m_inversePan ? -1.0f : 1.0f) * (state.rxAxisValue * lookSpeed()) * dt, d->m_upVector); + theCamera->tiltAboutViewCenter((d->m_inverseTilt ? -1.0f : 1.0f) * (state.ryAxisValue * lookSpeed()) * dt); } // Keyboard Input if (state.altKeyActive) { // Orbit - theCamera->panAboutViewCenter((state.txAxisValue * lookSpeed()) * dt, upVector); + theCamera->panAboutViewCenter((state.txAxisValue * lookSpeed()) * dt, d->m_upVector); theCamera->tiltAboutViewCenter((state.tyAxisValue * lookSpeed()) * dt); } else if (state.shiftKeyActive) { if (zoomDistance(camera()->position(), theCamera->viewCenter()) > d->m_zoomInLimit * d->m_zoomInLimit) { @@ -197,7 +254,8 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt // Translate theCamera->translate(QVector3D(clampInputs(state.leftMouseButtonActive ? state.rxAxisValue : 0, state.txAxisValue) * linearSpeed(), clampInputs(state.leftMouseButtonActive ? state.ryAxisValue : 0, state.tyAxisValue) * linearSpeed(), - state.tzAxisValue * linearSpeed()) * dt); + state.tzAxisValue * linearSpeed()) * dt, + d->m_zoomTranslateViewCenter ? theCamera->TranslateViewCenter : theCamera->DontTranslateViewCenter); } } diff --git a/src/extras/defaults/qorbitcameracontroller.h b/src/extras/defaults/qorbitcameracontroller.h index 94f597181..07b8b3522 100644 --- a/src/extras/defaults/qorbitcameracontroller.h +++ b/src/extras/defaults/qorbitcameracontroller.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QORBITCAMERACONTROLLER_H #define QT3DEXTRAS_QORBITCAMERACONTROLLER_H @@ -52,17 +16,42 @@ class Q_3DEXTRASSHARED_EXPORT QOrbitCameraController : public QAbstractCameraCon { Q_OBJECT Q_PROPERTY(float zoomInLimit READ zoomInLimit WRITE setZoomInLimit NOTIFY zoomInLimitChanged) + Q_PROPERTY(QVector3D upVector READ upVector WRITE setUpVector NOTIFY upVectorChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseXTranslate READ inverseXTranslate WRITE setInverseXTranslate NOTIFY inverseXTranslateChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseYTranslate READ inverseYTranslate WRITE setInverseYTranslate NOTIFY inverseYTranslateChanged REVISION(6, 7)) + Q_PROPERTY(bool inversePan READ inversePan WRITE setInversePan NOTIFY inversePanChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseTilt READ inverseTilt WRITE setInverseTilt NOTIFY inverseTiltChanged REVISION(6, 7)) + Q_PROPERTY(bool zoomTranslateViewCenter READ zoomTranslateViewCenter WRITE setZoomTranslateViewCenter NOTIFY zoomTranslateViewCenterChanged REVISION(6, 7)) public: explicit QOrbitCameraController(Qt3DCore::QNode *parent = nullptr); ~QOrbitCameraController(); float zoomInLimit() const; - + QVector3D upVector() const; + bool inverseXTranslate() const; + bool inverseYTranslate() const; + bool inversePan() const; + bool inverseTilt() const; + bool zoomTranslateViewCenter() const; + +public Q_SLOTS: void setZoomInLimit(float zoomInLimit); + void setUpVector(const QVector3D& upVector); + void setInverseXTranslate(bool isInverse); + void setInverseYTranslate(bool isInverse); + void setInversePan(bool isInverse); + void setInverseTilt(bool isInverse); + void setZoomTranslateViewCenter(bool isTranslate); Q_SIGNALS: void zoomInLimitChanged(); + void upVectorChanged(const QVector3D &upVector); + void inverseXTranslateChanged(bool isInverse); + void inverseYTranslateChanged(bool isInverse); + void inversePanChanged(bool isInverse); + void inverseTiltChanged(bool isInverse); + void zoomTranslateViewCenterChanged(bool isTranslate); protected: QOrbitCameraController(QOrbitCameraControllerPrivate &dd, Qt3DCore::QNode *parent = nullptr); @@ -79,3 +68,4 @@ private: QT_END_NAMESPACE #endif // QT3DEXTRAS_QORBITCAMERACONTROLLER_H + diff --git a/src/extras/defaults/qorbitcameracontroller_p.h b/src/extras/defaults/qorbitcameracontroller_p.h index 9dd0931d4..720ed90b6 100644 --- a/src/extras/defaults/qorbitcameracontroller_p.h +++ b/src/extras/defaults/qorbitcameracontroller_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QORBITCAMERACONTROLLER_P_H #define QT3DEXTRAS_QORBITCAMERACONTROLLER_P_H @@ -67,6 +31,10 @@ public: void init(); float m_zoomInLimit; + QVector3D m_upVector; + bool m_inverseXTranslate, m_inverseYTranslate; + bool m_inversePan, m_inverseTilt; + bool m_zoomTranslateViewCenter; private: QOrbitCameraController *q_ptr; diff --git a/src/extras/defaults/qpervertexcolormaterial.cpp b/src/extras/defaults/qpervertexcolormaterial.cpp index ef41cbce7..ef4b26ad7 100644 --- a/src/extras/defaults/qpervertexcolormaterial.cpp +++ b/src/extras/defaults/qpervertexcolormaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Lorenz Esch (TU Ilmenau). -** 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Lorenz Esch (TU Ilmenau). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qpervertexcolormaterial.h" #include "qpervertexcolormaterial_p.h" @@ -54,10 +18,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() : QMaterialPrivate() , m_vertexEffect(new QEffect()) @@ -175,3 +139,5 @@ void QPerVertexColorMaterialPrivate::init() } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qpervertexcolormaterial.cpp" diff --git a/src/extras/defaults/qpervertexcolormaterial.h b/src/extras/defaults/qpervertexcolormaterial.h index 3b1b8bd6a..7fd4fc8d6 100644 --- a/src/extras/defaults/qpervertexcolormaterial.h +++ b/src/extras/defaults/qpervertexcolormaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Lorenz Esch (TU Ilmenau). -** 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Lorenz Esch (TU Ilmenau). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPERVERTEXCOLORMATERIAL_H #define QT3DEXTRAS_QPERVERTEXCOLORMATERIAL_H diff --git a/src/extras/defaults/qpervertexcolormaterial_p.h b/src/extras/defaults/qpervertexcolormaterial_p.h index 8c5c3eefa..75e97b52d 100644 --- a/src/extras/defaults/qpervertexcolormaterial_p.h +++ b/src/extras/defaults/qpervertexcolormaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Lorenz Esch (TU Ilmenau). -** 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Lorenz Esch (TU Ilmenau). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPERVERTEXCOLORMATERIAL_P_H #define QT3DEXTRAS_QPERVERTEXCOLORMATERIAL_P_H diff --git a/src/extras/defaults/qphongalphamaterial.cpp b/src/extras/defaults/qphongalphamaterial.cpp index 57c81b721..1e0ced28c 100644 --- a/src/extras/defaults/qphongalphamaterial.cpp +++ b/src/extras/defaults/qphongalphamaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qphongalphamaterial.h" #include "qphongalphamaterial_p.h" @@ -58,10 +22,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPhongAlphaMaterialPrivate::QPhongAlphaMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) @@ -281,7 +245,7 @@ QPhongAlphaMaterial::~QPhongAlphaMaterial() } /*! - \property QPhongAlphaMaterial::ambient + \property Qt3DExtras::QPhongAlphaMaterial::ambient Holds the ambient color. */ @@ -292,7 +256,7 @@ QColor QPhongAlphaMaterial::ambient() const } /*! - \property QPhongAlphaMaterial::diffuse + \property Qt3DExtras::QPhongAlphaMaterial::diffuse Holds the diffuse color. */ @@ -303,7 +267,7 @@ QColor QPhongAlphaMaterial::diffuse() const } /*! - \property QPhongAlphaMaterial::specular + \property Qt3DExtras::QPhongAlphaMaterial::specular Holds the specular color. */ @@ -314,7 +278,7 @@ QColor QPhongAlphaMaterial::specular() const } /*! - \property QPhongAlphaMaterial::shininess + \property Qt3DExtras::QPhongAlphaMaterial::shininess Holds the shininess exponent. */ @@ -325,7 +289,7 @@ float QPhongAlphaMaterial::shininess() const } /*! - \property QPhongAlphaMaterial::alpha + \property Qt3DExtras::QPhongAlphaMaterial::alpha Holds the alpha component of the object which varies between 0 and 1. @@ -338,7 +302,7 @@ float QPhongAlphaMaterial::alpha() const } /*! - \property QPhongAlphaMaterial::sourceRgbArg + \property Qt3DExtras::QPhongAlphaMaterial::sourceRgbArg Holds the blend equation source RGB blending argument. @@ -351,7 +315,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceRgbArg() const } /*! - \property QPhongAlphaMaterial::destinationRgbArg + \property Qt3DExtras::QPhongAlphaMaterial::destinationRgbArg Holds the blend equation destination RGB blending argument. @@ -364,7 +328,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationRgbArg() const } /*! - \property QPhongAlphaMaterial::sourceAlphaArg + \property Qt3DExtras::QPhongAlphaMaterial::sourceAlphaArg Holds the blend equation source alpha blending argument. @@ -377,7 +341,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceAlphaArg() const } /*! - \property QPhongAlphaMaterial::destinationAlphaArg + \property Qt3DExtras::QPhongAlphaMaterial::destinationAlphaArg Holds the blend equation destination alpha blending argument. @@ -390,7 +354,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationAlphaArg() con } /*! - \property QPhongAlphaMaterial::blendFunctionArg + \property Qt3DExtras::QPhongAlphaMaterial::blendFunctionArg Holds the blend equation function argument. @@ -470,3 +434,5 @@ void QPhongAlphaMaterial::setBlendFunctionArg(QBlendEquation::BlendFunction blen } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qphongalphamaterial.cpp" diff --git a/src/extras/defaults/qphongalphamaterial.h b/src/extras/defaults/qphongalphamaterial.h index 37c853e70..d71765eb2 100644 --- a/src/extras/defaults/qphongalphamaterial.h +++ b/src/extras/defaults/qphongalphamaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPHONGALPHAMATERIAL_H #define QT3DEXTRAS_QPHONGALPHAMATERIAL_H diff --git a/src/extras/defaults/qphongalphamaterial_p.h b/src/extras/defaults/qphongalphamaterial_p.h index 7909f4e34..aedb5f796 100644 --- a/src/extras/defaults/qphongalphamaterial_p.h +++ b/src/extras/defaults/qphongalphamaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPHONGALPHAMATERIAL_P_H #define QT3DEXTRAS_QPHONGALPHAMATERIAL_P_H diff --git a/src/extras/defaults/qphongmaterial.cpp b/src/extras/defaults/qphongmaterial.cpp index 465db7a5c..5d543e005 100644 --- a/src/extras/defaults/qphongmaterial.cpp +++ b/src/extras/defaults/qphongmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qphongmaterial.h" #include "qphongmaterial_p.h" @@ -56,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPhongMaterialPrivate::QPhongMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) @@ -240,7 +204,7 @@ QPhongMaterial::~QPhongMaterial() } /*! - \property QPhongMaterial::ambient + \property Qt3DExtras::QPhongMaterial::ambient Holds the ambient color. */ @@ -251,7 +215,7 @@ QColor QPhongMaterial::ambient() const } /*! - \property QPhongMaterial::diffuse + \property Qt3DExtras::QPhongMaterial::diffuse Holds the diffuse color. */ @@ -262,7 +226,7 @@ QColor QPhongMaterial::diffuse() const } /*! - \property QPhongMaterial::specular + \property Qt3DExtras::QPhongMaterial::specular Holds the specular color. */ @@ -273,7 +237,7 @@ QColor QPhongMaterial::specular() const } /*! - \property QPhongMaterial::shininess + \property Qt3DExtras::QPhongMaterial::shininess Holds the shininess exponent. */ @@ -310,3 +274,5 @@ void QPhongMaterial::setShininess(float shininess) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qphongmaterial.cpp" diff --git a/src/extras/defaults/qphongmaterial.h b/src/extras/defaults/qphongmaterial.h index eab7e311b..090c7f9da 100644 --- a/src/extras/defaults/qphongmaterial.h +++ b/src/extras/defaults/qphongmaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPHONGMATERIAL_H #define QT3DEXTRAS_QPHONGMATERIAL_H diff --git a/src/extras/defaults/qphongmaterial_p.h b/src/extras/defaults/qphongmaterial_p.h index 2d8ae1be2..ce20b9335 100644 --- a/src/extras/defaults/qphongmaterial_p.h +++ b/src/extras/defaults/qphongmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPHONGMATERIAL_P_H #define QT3DEXTRAS_QPHONGMATERIAL_P_H diff --git a/src/extras/defaults/qskyboxentity.cpp b/src/extras/defaults/qskyboxentity.cpp index 163cf63a4..273c5724d 100644 --- a/src/extras/defaults/qskyboxentity.cpp +++ b/src/extras/defaults/qskyboxentity.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qskyboxentity.h" #include "qskyboxentity_p.h" @@ -58,11 +22,12 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; -using namespace Qt3DRender; namespace Qt3DExtras { +using namespace Qt3DCore; +using namespace Qt3DRender; + QSkyboxEntityPrivate::QSkyboxEntityPrivate() : QEntityPrivate() , m_effect(new QEffect()) @@ -71,13 +36,16 @@ QSkyboxEntityPrivate::QSkyboxEntityPrivate() , m_loadedTexture(new QTextureLoader()) , m_gl3Shader(new QShaderProgram()) , m_gl2es2Shader(new QShaderProgram()) + , m_rhiShader(new QShaderProgram()) , m_gl2Technique(new QTechnique()) , m_es2Technique(new QTechnique()) , m_gl3Technique(new QTechnique()) + , m_rhiTechnique(new QTechnique()) , m_filterKey(new QFilterKey) , m_gl2RenderPass(new QRenderPass()) , m_es2RenderPass(new QRenderPass()) , m_gl3RenderPass(new QRenderPass()) + , m_rhiRenderPass(new QRenderPass()) , m_mesh(new QCuboidMesh()) , m_gammaStrengthParameter(new QParameter(QStringLiteral("gammaStrength"), 0.0f)) , m_textureParameter(new QParameter(QStringLiteral("skyboxTexture"), m_skyboxTexture)) @@ -102,6 +70,8 @@ void QSkyboxEntityPrivate::init() m_gl3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/skybox.frag")))); m_gl2es2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.vert")))); m_gl2es2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.frag")))); + m_rhiShader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/rhi/skybox.vert")))); + m_rhiShader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/rhi/skybox.frag")))); m_gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); m_gl3Technique->graphicsApiFilter()->setMajorVersion(3); @@ -118,6 +88,10 @@ void QSkyboxEntityPrivate::init() m_es2Technique->graphicsApiFilter()->setMinorVersion(0); m_es2Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::NoProfile); + m_rhiTechnique->graphicsApiFilter()->setApi(QGraphicsApiFilter::RHI); + m_rhiTechnique->graphicsApiFilter()->setMajorVersion(1); + m_rhiTechnique->graphicsApiFilter()->setMinorVersion(0); + m_filterKey->setParent(m_effect); m_filterKey->setName(QStringLiteral("renderingStyle")); m_filterKey->setValue(QStringLiteral("forward")); @@ -125,10 +99,12 @@ void QSkyboxEntityPrivate::init() m_gl3Technique->addFilterKey(m_filterKey); m_gl2Technique->addFilterKey(m_filterKey); m_es2Technique->addFilterKey(m_filterKey); + m_rhiTechnique->addFilterKey(m_filterKey); m_gl3RenderPass->setShaderProgram(m_gl3Shader); m_gl2RenderPass->setShaderProgram(m_gl2es2Shader); m_es2RenderPass->setShaderProgram(m_gl2es2Shader); + m_rhiRenderPass->setShaderProgram(m_rhiShader); QCullFace *cullFront = new QCullFace(); cullFront->setMode(QCullFace::Front); @@ -143,14 +119,18 @@ void QSkyboxEntityPrivate::init() m_gl2RenderPass->addRenderState(depthTest); m_es2RenderPass->addRenderState(cullFront); m_es2RenderPass->addRenderState(depthTest); + m_rhiRenderPass->addRenderState(cullFront); + m_rhiRenderPass->addRenderState(depthTest); m_gl3Technique->addRenderPass(m_gl3RenderPass); m_gl2Technique->addRenderPass(m_gl2RenderPass); m_es2Technique->addRenderPass(m_es2RenderPass); + m_rhiTechnique->addRenderPass(m_rhiRenderPass); m_effect->addTechnique(m_gl3Technique); m_effect->addTechnique(m_gl2Technique); m_effect->addTechnique(m_es2Technique); + m_effect->addTechnique(m_rhiTechnique); m_material->setEffect(m_effect); m_material->addParameter(m_gammaStrengthParameter); @@ -289,7 +269,7 @@ void QSkyboxEntity::setBaseName(const QString &baseName) } } /*! - \property QSkyboxEntity::baseName + \property Qt3DExtras::QSkyboxEntity::baseName Contains the base name of the Skybox. */ @@ -321,7 +301,7 @@ void QSkyboxEntity::setExtension(const QString &extension) } /*! - \property QSkyboxEntity::extension + \property Qt3DExtras::QSkyboxEntity::extension Contains the extension of the filename for the skybox image, including the leading '.'. @@ -372,7 +352,7 @@ bool QSkyboxEntity::isGammaCorrectEnabled() const } // namespace Qt3DExtras /*! - \property QSkyboxEntity::gammaCorrect + \property Qt3DExtras::QSkyboxEntity::gammaCorrect A boolean indicating whether gamma correction is enabled. \since 5.9 @@ -384,3 +364,5 @@ bool QSkyboxEntity::isGammaCorrectEnabled() const \since 5.9 */ QT_END_NAMESPACE + +#include "moc_qskyboxentity.cpp" diff --git a/src/extras/defaults/qskyboxentity.h b/src/extras/defaults/qskyboxentity.h index f0f2f3d63..5289e0851 100644 --- a/src/extras/defaults/qskyboxentity.h +++ b/src/extras/defaults/qskyboxentity.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSKYBOXENTITY_H #define QT3DEXTRAS_QSKYBOXENTITY_H diff --git a/src/extras/defaults/qskyboxentity_p.h b/src/extras/defaults/qskyboxentity_p.h index 945b42bf1..a335d472e 100644 --- a/src/extras/defaults/qskyboxentity_p.h +++ b/src/extras/defaults/qskyboxentity_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSKYBOXENTITY_P_H #define QT3DEXTRAS_QSKYBOXENTITY_P_H @@ -92,13 +56,16 @@ class QSkyboxEntityPrivate : public Qt3DCore::QEntityPrivate Qt3DRender::QTextureLoader *m_loadedTexture; Qt3DRender::QShaderProgram *m_gl3Shader; Qt3DRender::QShaderProgram *m_gl2es2Shader; + Qt3DRender::QShaderProgram *m_rhiShader; Qt3DRender::QTechnique *m_gl2Technique; Qt3DRender::QTechnique *m_es2Technique; Qt3DRender::QTechnique *m_gl3Technique; + Qt3DRender::QTechnique *m_rhiTechnique; Qt3DRender::QFilterKey *m_filterKey; Qt3DRender::QRenderPass *m_gl2RenderPass; Qt3DRender::QRenderPass *m_es2RenderPass; Qt3DRender::QRenderPass *m_gl3RenderPass; + Qt3DRender::QRenderPass *m_rhiRenderPass; QCuboidMesh *m_mesh; Qt3DRender::QParameter *m_gammaStrengthParameter; Qt3DRender::QParameter *m_textureParameter; diff --git a/src/extras/defaults/qspritegrid.cpp b/src/extras/defaults/qspritegrid.cpp index 15016a891..f0f09f1b2 100644 --- a/src/extras/defaults/qspritegrid.cpp +++ b/src/extras/defaults/qspritegrid.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspritegrid.h" #include "qspritegrid_p.h" @@ -44,10 +8,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteGridPrivate::QSpriteGridPrivate() : QAbstractSpriteSheetPrivate() , m_numColumns(1) @@ -154,3 +119,5 @@ void QSpriteGrid::setColumns(int columns) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qspritegrid.cpp" diff --git a/src/extras/defaults/qspritegrid.h b/src/extras/defaults/qspritegrid.h index 56f4b1976..b7efe16f6 100644 --- a/src/extras/defaults/qspritegrid.h +++ b/src/extras/defaults/qspritegrid.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPRITEGRID_H #define QT3DEXTRAS_QSPRITEGRID_H diff --git a/src/extras/defaults/qspritegrid_p.h b/src/extras/defaults/qspritegrid_p.h index 8d05b2bcc..1b4ee1c6c 100644 --- a/src/extras/defaults/qspritegrid_p.h +++ b/src/extras/defaults/qspritegrid_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPRITEGRID_P_H #define QT3DEXTRAS_QSPRITEGRID_P_H diff --git a/src/extras/defaults/qspritesheet.cpp b/src/extras/defaults/qspritesheet.cpp index 94f608f4a..ed20fda1e 100644 --- a/src/extras/defaults/qspritesheet.cpp +++ b/src/extras/defaults/qspritesheet.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspritesheet.h" #include "qspritesheetitem.h" @@ -45,10 +9,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteSheetPrivate::QSpriteSheetPrivate() : QAbstractSpriteSheetPrivate() { @@ -56,7 +21,7 @@ QSpriteSheetPrivate::QSpriteSheetPrivate() int QSpriteSheetPrivate::maxIndex() const { - return m_sprites.count() - 1; + return m_sprites.size() - 1; } void QSpriteSheetPrivate::updateSizes() @@ -171,3 +136,5 @@ void QSpriteSheet::setSprites(QList<QSpriteSheetItem *> sprites) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qspritesheet.cpp" diff --git a/src/extras/defaults/qspritesheet.h b/src/extras/defaults/qspritesheet.h index 8e69458cc..70645b417 100644 --- a/src/extras/defaults/qspritesheet.h +++ b/src/extras/defaults/qspritesheet.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPRITESHEET_H #define QT3DEXTRAS_QSPRITESHEET_H diff --git a/src/extras/defaults/qspritesheet_p.h b/src/extras/defaults/qspritesheet_p.h index c6b46eac7..1429dd133 100644 --- a/src/extras/defaults/qspritesheet_p.h +++ b/src/extras/defaults/qspritesheet_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPRITESHEET_P_H #define QT3DEXTRAS_QSPRITESHEET_P_H diff --git a/src/extras/defaults/qspritesheetitem.cpp b/src/extras/defaults/qspritesheetitem.cpp index b4e096ae9..85733a84d 100644 --- a/src/extras/defaults/qspritesheetitem.cpp +++ b/src/extras/defaults/qspritesheetitem.cpp @@ -1,51 +1,16 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspritesheetitem.h" #include "qspritesheetitem_p.h" QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteSheetItemPrivate::QSpriteSheetItemPrivate() : QNodePrivate() , m_x(0) @@ -125,3 +90,5 @@ void QSpriteSheetItem::setHeight(int height) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qspritesheetitem.cpp" diff --git a/src/extras/defaults/qspritesheetitem.h b/src/extras/defaults/qspritesheetitem.h index c98f3100e..32d37d68a 100644 --- a/src/extras/defaults/qspritesheetitem.h +++ b/src/extras/defaults/qspritesheetitem.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPRITESHEETITEM_H #define QT3DEXTRAS_QSPRITESHEETITEM_H diff --git a/src/extras/defaults/qspritesheetitem_p.h b/src/extras/defaults/qspritesheetitem_p.h index a74b7e704..a885f48ed 100644 --- a/src/extras/defaults/qspritesheetitem_p.h +++ b/src/extras/defaults/qspritesheetitem_p.h @@ -1,44 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QT3DEXTRAS_QSPRITESHEET_P_H -#define QT3DEXTRAS_QSPRITESHEET_P_H +#ifndef QT3DEXTRAS_QSPRITESHEETITEM_P_H +#define QT3DEXTRAS_QSPRITESHEETITEM_P_H // // W A R N I N G @@ -75,5 +39,5 @@ class QSpriteSheetItemPrivate: public Qt3DCore::QNodePrivate QT_END_NAMESPACE -#endif // QT3DEXTRAS_QSPRITESHEET_P_H +#endif // QT3DEXTRAS_QSPRITESHEETITEM_P_H diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index 04a0c5b5a..689a0e37e 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -1,56 +1,10 @@ -/**************************************************************************** -** -** 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include "qt3dwindow.h" #include "qt3dwindow_p.h" +#include <QtGui/qtguiglobal.h> #include <Qt3DCore/qaspectengine.h> #include <Qt3DCore/qentity.h> #include <Qt3DCore/qcoreaspect.h> @@ -61,7 +15,9 @@ #include <Qt3DInput/qinputsettings.h> #include <Qt3DLogic/qlogicaspect.h> #include <Qt3DRender/qcamera.h> -#include <Qt3DRender/private/vulkaninstance_p.h> +#if QT_CONFIG(vulkan) +# include <Qt3DRender/private/vulkaninstance_p.h> +#endif #include <Qt3DRender/qt3drender-config.h> #include <qopenglcontext.h> #include <private/qrendersettings_p.h> @@ -266,11 +222,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept } else if (userRequestedApi == QByteArrayLiteral("null")) { api = Qt3DRender::API::Null; } else if (userRequestedApi == QByteArrayLiteral("auto")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) api = Qt3DRender::API::RHI; -#else - api = Qt3DRender::API::OpenGL; -#endif } } @@ -279,7 +231,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept // backend is in use will get a valid value. bool useRhi = false; if (qEnvironmentVariableIsEmpty("QT3D_RENDERER")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_CONFIG(qt3d_rhi_renderer) +#if QT_CONFIG(qt3d_rhi_renderer) qputenv("QT3D_RENDERER", "rhi"); #else qputenv("QT3D_RENDERER", "opengl"); @@ -312,7 +264,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept break; case Qt3DRender::API::DirectX: qputenv("QSG_RHI_BACKEND", "d3d11"); - window->setSurfaceType(QSurface::OpenGLSurface); + window->setSurfaceType(QSurface::Direct3DSurface); break; case Qt3DRender::API::Null: qputenv("QSG_RHI_BACKEND", "null"); @@ -348,13 +300,11 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept format.setProfile(QSurfaceFormat::CoreProfile); } #endif - } else { - // This is used for RHI - format.setVersion(1, 0); } format.setDepthBufferSize(24); - format.setSamples(4); + if (!QSurfaceFormat::defaultFormat().stereo()) + format.setSamples(4); format.setStencilBufferSize(8); window->setFormat(format); QSurfaceFormat::setDefaultFormat(format); @@ -363,3 +313,5 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qt3dwindow.cpp" diff --git a/src/extras/defaults/qt3dwindow.h b/src/extras/defaults/qt3dwindow.h index 55a686dbe..0e742d369 100644 --- a/src/extras/defaults/qt3dwindow.h +++ b/src/extras/defaults/qt3dwindow.h @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef QT3DWINDOW_H #define QT3DWINDOW_H diff --git a/src/extras/defaults/qt3dwindow_p.h b/src/extras/defaults/qt3dwindow_p.h index 33c60326f..9444bb297 100644 --- a/src/extras/defaults/qt3dwindow_p.h +++ b/src/extras/defaults/qt3dwindow_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** 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$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DWINDOW_P_H #define QT3DWINDOW_P_H diff --git a/src/extras/defaults/qtexturematerial.cpp b/src/extras/defaults/qtexturematerial.cpp index b38d6551d..d81aab5f9 100644 --- a/src/extras/defaults/qtexturematerial.cpp +++ b/src/extras/defaults/qtexturematerial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtexturematerial.h" #include "qtexturematerial_p.h" @@ -55,10 +19,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QTextureMaterialPrivate::QTextureMaterialPrivate() : QMaterialPrivate() , m_textureEffect(new QEffect) @@ -214,7 +178,7 @@ QTextureMaterial::~QTextureMaterial() } /*! - \property QTextureMaterial::texture + \property Qt3DExtras::QTextureMaterial::texture Holds the current texture used by the material. */ @@ -225,7 +189,7 @@ QAbstractTexture *QTextureMaterial::texture() const } /*! - \property QTextureMaterial::textureOffset + \property Qt3DExtras::QTextureMaterial::textureOffset This is a utility property. It sets the translation component of the general texture transform matrix @@ -240,7 +204,7 @@ QVector2D QTextureMaterial::textureOffset() const /*! - \property QTextureMaterial::textureTransform + \property Qt3DExtras::QTextureMaterial::textureTransform Holds the current texture transform. It is applied to texture coordinates at render time. Defaults to identity matrix. @@ -274,7 +238,7 @@ void QTextureMaterial::setTextureTransform(const QMatrix3x3 &matrix) } /*! - \property QTextureMaterial::alphaBlending + \property Qt3DExtras::QTextureMaterial::alphaBlending Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false. @@ -302,3 +266,5 @@ void QTextureMaterial::setAlphaBlendingEnabled(bool enabled) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtexturematerial.cpp" diff --git a/src/extras/defaults/qtexturematerial.h b/src/extras/defaults/qtexturematerial.h index 87c522992..9e89e69d0 100644 --- a/src/extras/defaults/qtexturematerial.h +++ b/src/extras/defaults/qtexturematerial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXTUREMATERIAL_H #define QT3DEXTRAS_QTEXTUREMATERIAL_H diff --git a/src/extras/defaults/qtexturematerial_p.h b/src/extras/defaults/qtexturematerial_p.h index ca07f0260..9ab60e41d 100644 --- a/src/extras/defaults/qtexturematerial_p.h +++ b/src/extras/defaults/qtexturematerial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXTUREMATERIAL_P_H #define QT3DEXTRAS_QTEXTUREMATERIAL_P_H diff --git a/src/extras/extras.pro b/src/extras/extras.pro deleted file mode 100644 index 396c9aa91..000000000 --- a/src/extras/extras.pro +++ /dev/null @@ -1,18 +0,0 @@ -TARGET = Qt3DExtras -MODULE = 3dextras -QT += core-private 3dcore 3dcore-private 3drender 3drender-private 3dinput 3dlogic - -DEFINES += QT3DEXTRAS_LIBRARY - -load(qt_module) - -include (geometries/geometries.pri) -include (3dtext/3dtext.pri) -include (defaults/defaults.pri) -include (text/text.pri) - -HEADERS += \ - qt3dextras_global.h - -RESOURCES += $$PWD/extras.qrc - diff --git a/src/extras/geometries/geometries.pri b/src/extras/geometries/geometries.pri deleted file mode 100644 index 2e2efd24b..000000000 --- a/src/extras/geometries/geometries.pri +++ /dev/null @@ -1,47 +0,0 @@ -HEADERS += \ - $$PWD/qconegeometry.h \ - $$PWD/qconegeometry_p.h \ - $$PWD/qconegeometryview.h \ - $$PWD/qconemesh.h \ - $$PWD/qcuboidmesh.h \ - $$PWD/qcylindergeometry.h \ - $$PWD/qcylindergeometry_p.h \ - $$PWD/qcylindergeometryview.h \ - $$PWD/qcylindermesh.h \ - $$PWD/qplanemesh.h \ - $$PWD/qspheremesh.h \ - $$PWD/qtorusmesh.h \ - $$PWD/qtorusgeometry.h \ - $$PWD/qtorusgeometry_p.h \ - $$PWD/qtorusgeometryview.h \ - $$PWD/qspheregeometry.h \ - $$PWD/qspheregeometry_p.h \ - $$PWD/qspheregeometryview.h \ - $$PWD/qcuboidgeometry.h \ - $$PWD/qcuboidgeometry_p.h \ - $$PWD/qcuboidgeometryview.h \ - $$PWD/qplanegeometry.h \ - $$PWD/qplanegeometry_p.h \ - $$PWD/qplanegeometryview.h - -SOURCES += \ - $$PWD/qconegeometry.cpp \ - $$PWD/qconegeometryview.cpp \ - $$PWD/qconemesh.cpp \ - $$PWD/qcuboidmesh.cpp \ - $$PWD/qcylindergeometry.cpp \ - $$PWD/qcylindergeometryview.cpp \ - $$PWD/qcylindermesh.cpp \ - $$PWD/qplanemesh.cpp \ - $$PWD/qspheremesh.cpp \ - $$PWD/qtorusmesh.cpp \ - $$PWD/qtorusgeometry.cpp \ - $$PWD/qtorusgeometryview.cpp \ - $$PWD/qspheregeometry.cpp \ - $$PWD/qspheregeometryview.cpp \ - $$PWD/qcuboidgeometry.cpp \ - $$PWD/qcuboidgeometryview.cpp \ - $$PWD/qplanegeometry.cpp \ - $$PWD/qplanegeometryview.cpp - -INCLUDEPATH += $$PWD diff --git a/src/extras/geometries/qconegeometry.cpp b/src/extras/geometries/qconegeometry.cpp index e2165e6f8..5618b0029 100644 --- a/src/extras/geometries/qconegeometry.cpp +++ b/src/extras/geometries/qconegeometry.cpp @@ -1,45 +1,9 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only /*! * \class Qt3DExtras::QConeGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QConeGeometry * \inmodule Qt3DExtras * \brief The QConeGeometry class allows creation of a cone in 3D space. @@ -67,10 +31,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { int faceCount(int slices, int rings, int capCount) @@ -467,66 +432,66 @@ void QConeGeometry::updateIndices() } /*! - * \property QConeGeometry::hasTopEndcap + * \property Qt3DExtras::QConeGeometry::hasTopEndcap * * Determines if the cone top is capped or open. */ /*! - * \property QConeGeometry::hasBottomEndcap + * \property Qt3DExtras::QConeGeometry::hasBottomEndcap * * Determines if the cone bottom is capped or open. */ /*! - * \property QConeGeometry::rings + * \property Qt3DExtras::QConeGeometry::rings * * Holds the number of rings in the geometry. */ /*! - * \property QConeGeometry::slices + * \property Qt3DExtras::QConeGeometry::slices * * Holds the number of slices in the geometry. */ /*! - * \property QConeGeometry::topRadius + * \property Qt3DExtras::QConeGeometry::topRadius * * Holds the top radius of the cone. */ /*! - * \property QConeGeometry::bottomRadius + * \property Qt3DExtras::QConeGeometry::bottomRadius * * Holds the bottom radius of the cone. */ /*! - * \property QConeGeometry::length + * \property Qt3DExtras::QConeGeometry::length * * Holds the length of the cone. */ /*! - * \property QConeGeometry::positionAttribute + * \property Qt3DExtras::QConeGeometry::positionAttribute * * Holds the geometry position attribute. */ /*! - * \property QConeGeometry::normalAttribute + * \property Qt3DExtras::QConeGeometry::normalAttribute * * Holds the geometry normal attribute. */ /*! - * \property QConeGeometry::texCoordAttribute + * \property Qt3DExtras::QConeGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ /*! - * \property QConeGeometry::indexAttribute + * \property Qt3DExtras::QConeGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -673,3 +638,5 @@ QAttribute *QConeGeometry::indexAttribute() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qconegeometry.cpp" diff --git a/src/extras/geometries/qconegeometry.h b/src/extras/geometries/qconegeometry.h index cff40576e..0f352c856 100644 --- a/src/extras/geometries/qconegeometry.h +++ b/src/extras/geometries/qconegeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCONEGEOMETRY_H #define QT3DEXTRAS_QCONEGEOMETRY_H diff --git a/src/extras/geometries/qconegeometry_p.h b/src/extras/geometries/qconegeometry_p.h index a87aa41c6..7744def38 100644 --- a/src/extras/geometries/qconegeometry_p.h +++ b/src/extras/geometries/qconegeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCONEGEOMETRY_P_H #define QT3DEXTRAS_QCONEGEOMETRY_P_H diff --git a/src/extras/geometries/qconegeometryview.cpp b/src/extras/geometries/qconegeometryview.cpp index 28707d043..c094eb22a 100644 --- a/src/extras/geometries/qconegeometryview.cpp +++ b/src/extras/geometries/qconegeometryview.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qconegeometryview.h" @@ -166,7 +130,7 @@ void QConeGeometryView::setLength(float length) } /*! - * \property QConeGeometryView::hasTopEndcap + * \property Qt3DExtras::QConeGeometryView::hasTopEndcap * * Determines if the cone top is capped or open. */ @@ -176,7 +140,7 @@ bool QConeGeometryView::hasTopEndcap() const } /*! - * \property QConeGeometryView::hasBottomEndcap + * \property Qt3DExtras::QConeGeometryView::hasBottomEndcap * * Determines if the cone bottom is capped or open. */ @@ -186,7 +150,7 @@ bool QConeGeometryView::hasBottomEndcap() const } /*! - * \property QConeGeometryView::topRadius + * \property Qt3DExtras::QConeGeometryView::topRadius * * Holds the top radius of the cone. */ @@ -196,7 +160,7 @@ float QConeGeometryView::topRadius() const } /*! - * \property QConeGeometryView::bottomRadius + * \property Qt3DExtras::QConeGeometryView::bottomRadius * * Holds the bottom radius of the cone. */ @@ -206,7 +170,7 @@ float QConeGeometryView::bottomRadius() const } /*! - * \property QConeGeometryView::rings + * \property Qt3DExtras::QConeGeometryView::rings * * Holds the number of rings in the mesh. */ @@ -216,7 +180,7 @@ int QConeGeometryView::rings() const } /*! - * \property QConeGeometryView::slices + * \property Qt3DExtras::QConeGeometryView::slices * * Holds the number of slices in the mesh. */ @@ -226,7 +190,7 @@ int QConeGeometryView::slices() const } /*! - * \property QConeGeometryView::length + * \property Qt3DExtras::QConeGeometryView::length * * Holds the length of the cone. */ @@ -238,3 +202,5 @@ float QConeGeometryView::length() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qconegeometryview.cpp" diff --git a/src/extras/geometries/qconegeometryview.h b/src/extras/geometries/qconegeometryview.h index cdeb3703e..535bfdec9 100644 --- a/src/extras/geometries/qconegeometryview.h +++ b/src/extras/geometries/qconegeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCONEGEOMETRYVIEW_H #define QT3DEXTRAS_QCONEGEOMETRYVIEW_H diff --git a/src/extras/geometries/qconemesh.cpp b/src/extras/geometries/qconemesh.cpp index 5f4ebd369..6dd2a8983 100644 --- a/src/extras/geometries/qconemesh.cpp +++ b/src/extras/geometries/qconemesh.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qconemesh.h" @@ -101,7 +65,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QConeMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QConeMesh * \inmodule Qt3DExtras * @@ -166,7 +130,7 @@ void QConeMesh::setLength(float length) } /*! - * \property QConeMesh::hasTopEndcap + * \property Qt3DExtras::QConeMesh::hasTopEndcap * * Determines if the cone top is capped or open. */ @@ -176,7 +140,7 @@ bool QConeMesh::hasTopEndcap() const } /*! - * \property QConeMesh::hasBottomEndcap + * \property Qt3DExtras::QConeMesh::hasBottomEndcap * * Determines if the cone bottom is capped or open. */ @@ -186,7 +150,7 @@ bool QConeMesh::hasBottomEndcap() const } /*! - * \property QConeMesh::topRadius + * \property Qt3DExtras::QConeMesh::topRadius * * Holds the top radius of the cone. */ @@ -196,7 +160,7 @@ float QConeMesh::topRadius() const } /*! - * \property QConeMesh::bottomRadius + * \property Qt3DExtras::QConeMesh::bottomRadius * * Holds the bottom radius of the cone. */ @@ -206,7 +170,7 @@ float QConeMesh::bottomRadius() const } /*! - * \property QConeMesh::rings + * \property Qt3DExtras::QConeMesh::rings * * Holds the number of rings in the mesh. */ @@ -216,7 +180,7 @@ int QConeMesh::rings() const } /*! - * \property QConeMesh::slices + * \property Qt3DExtras::QConeMesh::slices * * Holds the number of slices in the mesh. */ @@ -226,7 +190,7 @@ int QConeMesh::slices() const } /*! - * \property QConeMesh::length + * \property Qt3DExtras::QConeMesh::length * * Holds the length of the cone. */ @@ -238,3 +202,5 @@ float QConeMesh::length() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qconemesh.cpp" diff --git a/src/extras/geometries/qconemesh.h b/src/extras/geometries/qconemesh.h index 57fe0c0fc..852463cfc 100644 --- a/src/extras/geometries/qconemesh.h +++ b/src/extras/geometries/qconemesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCONEMESH_H #define QT3DEXTRAS_QCONEMESH_H diff --git a/src/extras/geometries/qcuboidgeometry.cpp b/src/extras/geometries/qcuboidgeometry.cpp index 87707eefd..4c4e006f7 100644 --- a/src/extras/geometries/qcuboidgeometry.cpp +++ b/src/extras/geometries/qcuboidgeometry.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qcuboidgeometry.h" #include "qcuboidgeometry_p.h" @@ -44,15 +8,13 @@ #include <Qt3DCore/qbuffer.h> #include <Qt3DCore/private/corelogging_p.h> -#include <limits> - - QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { enum PlaneNormal { @@ -361,7 +323,7 @@ QByteArray createCuboidIndexData(const QSize &yzResolution, const int yzIndices = 2 * 3 * (yzResolution.width() - 1) * (yzResolution.height() - 1); const int xzIndices = 2 * 3 * (xzResolution.width() - 1) * (xzResolution.height() - 1); const int xyIndices = 2 * 3 * (xyResolution.width() - 1) * (xyResolution.height() - 1); - const int indexCount = 2 * (yzIndices + xzIndices + xyIndices); + const qsizetype indexCount = 2 * (yzIndices + xzIndices + xyIndices); QByteArray indexData; indexData.resize(indexCount * sizeof(quint16)); @@ -572,7 +534,7 @@ QByteArray QCuboidGeometryPrivate::generateIndexData() const /*! * \class Qt3DExtras::QCuboidGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCuboidGeometry * \inmodule Qt3DExtras * \brief The QCuboidGeometry class allows creation of a cuboid in 3D space. @@ -709,7 +671,7 @@ void QCuboidGeometry::setXYMeshResolution(const QSize &resolution) } /*! - * \property QCuboidGeometry::xExtent + * \property Qt3DExtras::QCuboidGeometry::xExtent * * Holds the x extent of the geometry. */ @@ -720,7 +682,7 @@ float QCuboidGeometry::xExtent() const } /*! - * \property QCuboidGeometry::yExtent + * \property Qt3DExtras::QCuboidGeometry::yExtent * * Holds the y extent of the geometry. */ @@ -731,7 +693,7 @@ float QCuboidGeometry::yExtent() const } /*! - * \property QCuboidGeometry::zExtent + * \property Qt3DExtras::QCuboidGeometry::zExtent * * Holds the z extent of the geometry. */ @@ -742,7 +704,7 @@ float QCuboidGeometry::zExtent() const } /*! - * \property QCuboidGeometry::yzMeshResolution + * \property Qt3DExtras::QCuboidGeometry::yzMeshResolution * * Holds the y-z resolution. * The width and height values of this property specify the number of vertices generated for @@ -755,7 +717,7 @@ QSize QCuboidGeometry::yzMeshResolution() const } /*! - * \property QCuboidGeometry::xzMeshResolution + * \property Qt3DExtras::QCuboidGeometry::xzMeshResolution * * Holds the x-z resolution. * The width and height values of this property specify the number of vertices generated for @@ -768,7 +730,7 @@ QSize QCuboidGeometry::xyMeshResolution() const } /*! - * \property QCuboidGeometry::xyMeshResolution + * \property Qt3DExtras::QCuboidGeometry::xyMeshResolution * * Holds the x-y resolution. * The width and height values of this property specify the number of vertices generated for @@ -781,7 +743,7 @@ QSize QCuboidGeometry::xzMeshResolution() const } /*! - * \property QCuboidGeometry::positionAttribute + * \property Qt3DExtras::QCuboidGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -792,7 +754,7 @@ QAttribute *QCuboidGeometry::positionAttribute() const } /*! - * \property QCuboidGeometry::normalAttribute + * \property Qt3DExtras::QCuboidGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -803,7 +765,7 @@ QAttribute *QCuboidGeometry::normalAttribute() const } /*! - * \property QCuboidGeometry::texCoordAttribute + * \property Qt3DExtras::QCuboidGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ @@ -814,7 +776,7 @@ QAttribute *QCuboidGeometry::texCoordAttribute() const } /*! - * \property QCuboidGeometry::tangentAttribute + * \property Qt3DExtras::QCuboidGeometry::tangentAttribute * * Holds the geometry tangent attribute. */ @@ -825,7 +787,7 @@ QAttribute *QCuboidGeometry::tangentAttribute() const } /*! - * \property QCuboidGeometry::indexAttribute + * \property Qt3DExtras::QCuboidGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -838,3 +800,5 @@ QAttribute *QCuboidGeometry::indexAttribute() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcuboidgeometry.cpp" diff --git a/src/extras/geometries/qcuboidgeometry.h b/src/extras/geometries/qcuboidgeometry.h index 1234c65be..903cd645f 100644 --- a/src/extras/geometries/qcuboidgeometry.h +++ b/src/extras/geometries/qcuboidgeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCUBOIDGEOMETRY_H #define QT3DEXTRAS_QCUBOIDGEOMETRY_H diff --git a/src/extras/geometries/qcuboidgeometry_p.h b/src/extras/geometries/qcuboidgeometry_p.h index 399ea5876..6b2eb1b7d 100644 --- a/src/extras/geometries/qcuboidgeometry_p.h +++ b/src/extras/geometries/qcuboidgeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCUBOIDGEOMETRY_P_H #define QT3DEXTRAS_QCUBOIDGEOMETRY_P_H diff --git a/src/extras/geometries/qcuboidgeometryview.cpp b/src/extras/geometries/qcuboidgeometryview.cpp index ee0977b71..6d7a0e34a 100644 --- a/src/extras/geometries/qcuboidgeometryview.cpp +++ b/src/extras/geometries/qcuboidgeometryview.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qcuboidgeometryview.h" @@ -132,7 +96,7 @@ void QCuboidGeometryView::setXExtent(float xExtent) } /*! - * \property QCuboidGeometryView::xExtent + * \property Qt3DExtras::QCuboidGeometryView::xExtent * * Holds the x extent of the mesh. */ @@ -147,7 +111,7 @@ void QCuboidGeometryView::setYExtent(float yExtent) } /*! - * \property QCuboidGeometryView::yExtent + * \property Qt3DExtras::QCuboidGeometryView::yExtent * * Holds the y extent of the mesh. */ @@ -162,7 +126,7 @@ void QCuboidGeometryView::setZExtent(float zExtent) } /*! - * \property QCuboidGeometryView::zExtent + * \property Qt3DExtras::QCuboidGeometryView::zExtent * * Holds the z extent of the mesh. */ @@ -177,7 +141,7 @@ void QCuboidGeometryView::setYZMeshResolution(const QSize &resolution) } /*! - * \property QCuboidGeometryView::yzMeshResolution + * \property Qt3DExtras::QCuboidGeometryView::yzMeshResolution * * Holds the y-z resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -194,7 +158,7 @@ void QCuboidGeometryView::setXZMeshResolution(const QSize &resolution) } /*! - * \property QCuboidGeometryView::xzMeshResolution + * \property Qt3DExtras::QCuboidGeometryView::xzMeshResolution * * Holds the x-z resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -211,7 +175,7 @@ void QCuboidGeometryView::setXYMeshResolution(const QSize &resolution) } /*! - * \property QCuboidGeometryView::xyMeshResolution + * \property Qt3DExtras::QCuboidGeometryView::xyMeshResolution * * Holds the x-y resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -225,3 +189,5 @@ QSize QCuboidGeometryView::xyMeshResolution() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcuboidgeometryview.cpp" diff --git a/src/extras/geometries/qcuboidgeometryview.h b/src/extras/geometries/qcuboidgeometryview.h index 2925c6dd6..ac28dd65f 100644 --- a/src/extras/geometries/qcuboidgeometryview.h +++ b/src/extras/geometries/qcuboidgeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_CUBOIDGEOMETRYVIEW_H #define QT3DEXTRAS_CUBOIDGEOMETRYVIEW_H diff --git a/src/extras/geometries/qcuboidmesh.cpp b/src/extras/geometries/qcuboidmesh.cpp index 5440ef0ba..18a4d1b69 100644 --- a/src/extras/geometries/qcuboidmesh.cpp +++ b/src/extras/geometries/qcuboidmesh.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qcuboidmesh.h" @@ -96,7 +60,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QCuboidMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCuboidMesh * \inmodule Qt3DExtras * @@ -132,7 +96,7 @@ void QCuboidMesh::setXExtent(float xExtent) } /*! - * \property QCuboidMesh::xExtent + * \property Qt3DExtras::QCuboidMesh::xExtent * * Holds the x extent of the mesh. */ @@ -147,7 +111,7 @@ void QCuboidMesh::setYExtent(float yExtent) } /*! - * \property QCuboidMesh::yExtent + * \property Qt3DExtras::QCuboidMesh::yExtent * * Holds the y extent of the mesh. */ @@ -162,7 +126,7 @@ void QCuboidMesh::setZExtent(float zExtent) } /*! - * \property QCuboidMesh::zExtent + * \property Qt3DExtras::QCuboidMesh::zExtent * * Holds the z extent of the mesh. */ @@ -177,7 +141,7 @@ void QCuboidMesh::setYZMeshResolution(const QSize &resolution) } /*! - * \property QCuboidMesh::yzMeshResolution + * \property Qt3DExtras::QCuboidMesh::yzMeshResolution * * Holds the y-z resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -194,7 +158,7 @@ void QCuboidMesh::setXZMeshResolution(const QSize &resolution) } /*! - * \property QCuboidMesh::xzMeshResolution + * \property Qt3DExtras::QCuboidMesh::xzMeshResolution * * Holds the x-z resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -211,7 +175,7 @@ void QCuboidMesh::setXYMeshResolution(const QSize &resolution) } /*! - * \property QCuboidMesh::xyMeshResolution + * \property Qt3DExtras::QCuboidMesh::xyMeshResolution * * Holds the x-y resolution of the mesh. * The width and height values of this property specify the number of vertices generated for @@ -225,3 +189,5 @@ QSize QCuboidMesh::xyMeshResolution() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcuboidmesh.cpp" diff --git a/src/extras/geometries/qcuboidmesh.h b/src/extras/geometries/qcuboidmesh.h index a945dbe2b..54c01e039 100644 --- a/src/extras/geometries/qcuboidmesh.h +++ b/src/extras/geometries/qcuboidmesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_CUBOIDMESH_H #define QT3DEXTRAS_CUBOIDMESH_H diff --git a/src/extras/geometries/qcylindergeometry.cpp b/src/extras/geometries/qcylindergeometry.cpp index 5d37b5ac8..4aa162859 100644 --- a/src/extras/geometries/qcylindergeometry.cpp +++ b/src/extras/geometries/qcylindergeometry.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES // For MSVC @@ -53,10 +17,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { int faceCount(int slices, int rings) @@ -348,7 +313,7 @@ QByteArray QCylinderGeometryPrivate::generateIndexData() const /*! * \class Qt3DExtras::QCylinderGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCylinderGeometry * \inmodule Qt3DExtras * \brief The QCylinderGeometry class allows creation of a cylinder in 3D space. @@ -456,7 +421,7 @@ void QCylinderGeometry::setLength(float length) } /*! - * \property QCylinderGeometry::rings + * \property Qt3DExtras::QCylinderGeometry::rings * * Holds the number of rings in the cylinder. */ @@ -467,7 +432,7 @@ int QCylinderGeometry::rings() const } /*! - * \property QCylinderGeometry::slices + * \property Qt3DExtras::QCylinderGeometry::slices * * Holds the number of slices in the cylinder. */ @@ -478,7 +443,7 @@ int QCylinderGeometry::slices() const } /*! - * \property QCylinderGeometry::radius + * \property Qt3DExtras::QCylinderGeometry::radius * * Holds the radius of the cylinder. */ @@ -489,7 +454,7 @@ float QCylinderGeometry::radius() const } /*! - * \property QCylinderGeometry::length + * \property Qt3DExtras::QCylinderGeometry::length * * Holds the length of the cylinder. */ @@ -500,7 +465,7 @@ float QCylinderGeometry::length() const } /*! - * \property QCylinderGeometry::positionAttribute + * \property Qt3DExtras::QCylinderGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -511,7 +476,7 @@ QAttribute *QCylinderGeometry::positionAttribute() const } /*! - * \property QCylinderGeometry::normalAttribute + * \property Qt3DExtras::QCylinderGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -522,7 +487,7 @@ QAttribute *QCylinderGeometry::normalAttribute() const } /*! - * \property QCylinderGeometry::texCoordAttribute + * \property Qt3DExtras::QCylinderGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ @@ -533,7 +498,7 @@ QAttribute *QCylinderGeometry::texCoordAttribute() const } /*! - * \property QCylinderGeometry::indexAttribute + * \property Qt3DExtras::QCylinderGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -546,3 +511,5 @@ QAttribute *QCylinderGeometry::indexAttribute() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcylindergeometry.cpp" diff --git a/src/extras/geometries/qcylindergeometry.h b/src/extras/geometries/qcylindergeometry.h index 4151aadb2..9b68fc687 100644 --- a/src/extras/geometries/qcylindergeometry.h +++ b/src/extras/geometries/qcylindergeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCYLINDERGEOMETRY_H #define QT3DEXTRAS_QCYLINDERGEOMETRY_H diff --git a/src/extras/geometries/qcylindergeometry_p.h b/src/extras/geometries/qcylindergeometry_p.h index 4803322e1..373c263e7 100644 --- a/src/extras/geometries/qcylindergeometry_p.h +++ b/src/extras/geometries/qcylindergeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCYLINDERGEOMETRY_P_H #define QT3DEXTRAS_QCYLINDERGEOMETRY_P_H diff --git a/src/extras/geometries/qcylindergeometryview.cpp b/src/extras/geometries/qcylindergeometryview.cpp index 9347f1134..29fbb1a98 100644 --- a/src/extras/geometries/qcylindergeometryview.cpp +++ b/src/extras/geometries/qcylindergeometryview.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES // For MSVC @@ -53,10 +17,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + /*! * \qmltype CylinderGeometryView * \instantiates Qt3DExtras::QCylinderGeometryView @@ -140,7 +105,7 @@ void QCylinderGeometryView::setLength(float length) } /*! - * \property QCylinderGeometryView::rings + * \property Qt3DExtras::QCylinderGeometryView::rings * * Holds the number of rings in the mesh. */ @@ -150,7 +115,7 @@ int QCylinderGeometryView::rings() const } /*! - * \property QCylinderGeometryView::slices + * \property Qt3DExtras::QCylinderGeometryView::slices * * Holds the number of slices in the mesh. */ @@ -160,7 +125,7 @@ int QCylinderGeometryView::slices() const } /*! - * \property QCylinderGeometryView::radius + * \property Qt3DExtras::QCylinderGeometryView::radius * * Holds the radius of the cylinder. */ @@ -170,7 +135,7 @@ float QCylinderGeometryView::radius() const } /*! - * \property QCylinderGeometryView::length + * \property Qt3DExtras::QCylinderGeometryView::length * * Holds the length of the cylinder. */ @@ -182,3 +147,5 @@ float QCylinderGeometryView::length() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcylindergeometryview.cpp" diff --git a/src/extras/geometries/qcylindergeometryview.h b/src/extras/geometries/qcylindergeometryview.h index 4a90c54d4..afa423448 100644 --- a/src/extras/geometries/qcylindergeometryview.h +++ b/src/extras/geometries/qcylindergeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCYLINDERGEOMETRYVIEW_H #define QT3DEXTRAS_QCYLINDERGEOMETRYVIEW_H diff --git a/src/extras/geometries/qcylindermesh.cpp b/src/extras/geometries/qcylindermesh.cpp index 2c2bb4d81..5473e2beb 100644 --- a/src/extras/geometries/qcylindermesh.cpp +++ b/src/extras/geometries/qcylindermesh.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES // For MSVC @@ -53,15 +17,19 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + /*! * \qmltype CylinderMesh * \instantiates Qt3DExtras::QCylinderMesh * \inqmlmodule Qt3D.Extras * \brief A cylindrical mesh. + * + * This component can be used to render a cylinder when combined with a + * material component. */ /*! @@ -90,13 +58,16 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QCylinderMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCylinderMesh * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * * \brief A cylindrical mesh. + * + * This component can be used to render a cylinder when combined with a + * material component. */ /*! @@ -140,7 +111,7 @@ void QCylinderMesh::setLength(float length) } /*! - * \property QCylinderMesh::rings + * \property Qt3DExtras::QCylinderMesh::rings * * Holds the number of rings in the mesh. */ @@ -150,7 +121,7 @@ int QCylinderMesh::rings() const } /*! - * \property QCylinderMesh::slices + * \property Qt3DExtras::QCylinderMesh::slices * * Holds the number of slices in the mesh. */ @@ -160,7 +131,7 @@ int QCylinderMesh::slices() const } /*! - * \property QCylinderMesh::radius + * \property Qt3DExtras::QCylinderMesh::radius * * Holds the radius of the cylinder. */ @@ -170,7 +141,7 @@ float QCylinderMesh::radius() const } /*! - * \property QCylinderMesh::length + * \property Qt3DExtras::QCylinderMesh::length * * Holds the length of the cylinder. */ @@ -182,3 +153,5 @@ float QCylinderMesh::length() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qcylindermesh.cpp" diff --git a/src/extras/geometries/qcylindermesh.h b/src/extras/geometries/qcylindermesh.h index f2c8fb01b..270a76c61 100644 --- a/src/extras/geometries/qcylindermesh.h +++ b/src/extras/geometries/qcylindermesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QCYLINDERMESH_H #define QT3DEXTRAS_QCYLINDERMESH_H diff --git a/src/extras/geometries/qplanegeometry.cpp b/src/extras/geometries/qplanegeometry.cpp index e83548ad5..85844867c 100644 --- a/src/extras/geometries/qplanegeometry.cpp +++ b/src/extras/geometries/qplanegeometry.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qplanegeometry.h" #include "qplanegeometry_p.h" @@ -47,10 +11,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { QByteArray createPlaneVertexData(float w, float h, const QSize &resolution, bool mirrored) @@ -116,7 +81,7 @@ QByteArray createPlaneIndexData(const QSize &resolution) { // Create the index data. 2 triangles per rectangular face const int faces = 2 * (resolution.width() - 1) * (resolution.height() - 1); - const int indices = 3 * faces; + const qsizetype indices = 3 * faces; Q_ASSERT(indices < std::numeric_limits<quint16>::max()); QByteArray indexBytes; indexBytes.resize(indices * sizeof(quint16)); @@ -212,7 +177,7 @@ QByteArray createPlaneIndexData(const QSize &resolution) /*! * \class Qt3DExtras::QPlaneGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QPlaneGeometry * \inmodule Qt3DExtras * \brief The QPlaneGeometry class allows creation of a plane in 3D space. @@ -322,7 +287,7 @@ void QPlaneGeometry::setMirrored(bool mirrored) } /*! - * \property QPlaneGeometry::resolution + * \property Qt3DExtras::QPlaneGeometry::resolution * * Holds the plane resolution. */ @@ -333,7 +298,7 @@ QSize QPlaneGeometry::resolution() const } /*! - * \property QPlaneGeometry::width + * \property Qt3DExtras::QPlaneGeometry::width * * Holds the plane width. */ @@ -344,7 +309,7 @@ float QPlaneGeometry::width() const } /*! - * \property QPlaneGeometry::height + * \property Qt3DExtras::QPlaneGeometry::height * * Holds the plane height. */ @@ -355,7 +320,7 @@ float QPlaneGeometry::height() const } /*! - * \property QPlaneGeometry::mirrored + * \property Qt3DExtras::QPlaneGeometry::mirrored * \since 5.9 * * Controls if the UV coordinates of the plane should be flipped vertically. @@ -367,7 +332,7 @@ bool QPlaneGeometry::mirrored() const } /*! - * \property QPlaneGeometry::positionAttribute + * \property Qt3DExtras::QPlaneGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -378,7 +343,7 @@ QAttribute *QPlaneGeometry::positionAttribute() const } /*! - * \property QPlaneGeometry::normalAttribute + * \property Qt3DExtras::QPlaneGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -389,7 +354,7 @@ QAttribute *QPlaneGeometry::normalAttribute() const } /*! - * \property QPlaneGeometry::texCoordAttribute + * \property Qt3DExtras::QPlaneGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ @@ -400,7 +365,7 @@ QAttribute *QPlaneGeometry::texCoordAttribute() const } /*! - * \property QPlaneGeometry::tangentAttribute + * \property Qt3DExtras::QPlaneGeometry::tangentAttribute * * Holds the geometry tangent attribute. */ @@ -411,7 +376,7 @@ QAttribute *QPlaneGeometry::tangentAttribute() const } /*! - * \property QPlaneGeometry::indexAttribute + * \property Qt3DExtras::QPlaneGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -517,3 +482,5 @@ QByteArray QPlaneGeometryPrivate::generateIndexData() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qplanegeometry.cpp" diff --git a/src/extras/geometries/qplanegeometry.h b/src/extras/geometries/qplanegeometry.h index 9cd51abea..6b5a8ceca 100644 --- a/src/extras/geometries/qplanegeometry.h +++ b/src/extras/geometries/qplanegeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPLANEGEOMETRY_H #define QT3DEXTRAS_QPLANEGEOMETRY_H diff --git a/src/extras/geometries/qplanegeometry_p.h b/src/extras/geometries/qplanegeometry_p.h index 4e87a3781..614cef995 100644 --- a/src/extras/geometries/qplanegeometry_p.h +++ b/src/extras/geometries/qplanegeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPLANEGEOMETRY_P_H #define QT3DEXTRAS_QPLANEGEOMETRY_P_H diff --git a/src/extras/geometries/qplanegeometryview.cpp b/src/extras/geometries/qplanegeometryview.cpp index dd1544b3b..159de8797 100644 --- a/src/extras/geometries/qplanegeometryview.cpp +++ b/src/extras/geometries/qplanegeometryview.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qplanegeometryview.h" @@ -114,7 +78,7 @@ void QPlaneGeometryView::setWidth(float width) } /*! - * \property QPlaneGeometryView::width + * \property Qt3DExtras::QPlaneGeometryView::width * * Holds the plane width. */ @@ -129,7 +93,7 @@ void QPlaneGeometryView::setHeight(float height) } /*! - * \property QPlaneGeometryView::height + * \property Qt3DExtras::QPlaneGeometryView::height * * Holds the plane height. */ @@ -144,7 +108,7 @@ void QPlaneGeometryView::setMeshResolution(const QSize &resolution) } /*! - * \property QPlaneGeometryView::meshResolution + * \property Qt3DExtras::QPlaneGeometryView::meshResolution * * Holds the plane resolution. * The width and height values of this property specify the number of vertices generated for @@ -161,7 +125,7 @@ void QPlaneGeometryView::setMirrored(bool mirrored) } /*! - * \property QPlaneGeometryView::mirrored + * \property Qt3DExtras::QPlaneGeometryView::mirrored * * Controls if the UV coordinates of the plane should be flipped vertically. */ @@ -173,3 +137,5 @@ bool QPlaneGeometryView::mirrored() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qplanegeometryview.cpp" diff --git a/src/extras/geometries/qplanegeometryview.h b/src/extras/geometries/qplanegeometryview.h index a268ded3a..938fd3021 100644 --- a/src/extras/geometries/qplanegeometryview.h +++ b/src/extras/geometries/qplanegeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPLANEGEOMETRYVIEW_H #define QT3DEXTRAS_QPLANEGEOMETRYVIEW_H diff --git a/src/extras/geometries/qplanemesh.cpp b/src/extras/geometries/qplanemesh.cpp index ebcaa1d9c..d14dd6097 100644 --- a/src/extras/geometries/qplanemesh.cpp +++ b/src/extras/geometries/qplanemesh.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qplanemesh.h" @@ -81,7 +45,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QPlaneMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QPlaneMesh * \inmodule Qt3DExtras * @@ -115,7 +79,7 @@ void QPlaneMesh::setWidth(float width) } /*! - * \property QPlaneMesh::width + * \property Qt3DExtras::QPlaneMesh::width * * Holds the plane width. */ @@ -130,7 +94,7 @@ void QPlaneMesh::setHeight(float height) } /*! - * \property QPlaneMesh::height + * \property Qt3DExtras::QPlaneMesh::height * * Holds the plane height. */ @@ -145,7 +109,7 @@ void QPlaneMesh::setMeshResolution(const QSize &resolution) } /*! - * \property QPlaneMesh::meshResolution + * \property Qt3DExtras::QPlaneMesh::meshResolution * * Holds the plane resolution. * The width and height values of this property specify the number of vertices generated for @@ -162,7 +126,7 @@ void QPlaneMesh::setMirrored(bool mirrored) } /*! - * \property QPlaneMesh::mirrored + * \property Qt3DExtras::QPlaneMesh::mirrored * \since 5.9 * * Controls if the UV coordinates of the plane should be flipped vertically. @@ -175,3 +139,5 @@ bool QPlaneMesh::mirrored() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qplanemesh.cpp" diff --git a/src/extras/geometries/qplanemesh.h b/src/extras/geometries/qplanemesh.h index 923af8897..ebdd0ad89 100644 --- a/src/extras/geometries/qplanemesh.h +++ b/src/extras/geometries/qplanemesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QPLANEMESH_H #define QT3DEXTRAS_QPLANEMESH_H diff --git a/src/extras/geometries/qspheregeometry.cpp b/src/extras/geometries/qspheregeometry.cpp index c780ba83c..1fff96ec2 100644 --- a/src/extras/geometries/qspheregeometry.cpp +++ b/src/extras/geometries/qspheregeometry.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspheregeometry.h" #include "qspheregeometry_p.h" @@ -52,10 +16,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { QByteArray createSphereMeshVertexData(float radius, int rings, int slices) @@ -116,7 +81,7 @@ QByteArray createSphereMeshIndexData(int rings, int slices) faces += 2 * slices; // tri per slice for both top and bottom QByteArray indexBytes; - const int indices = faces * 3; + const qsizetype indices = faces * 3; Q_ASSERT(indices < 65536); indexBytes.resize(indices * sizeof(quint16)); quint16 *indexPtr = reinterpret_cast<quint16*>(indexBytes.data()); @@ -328,7 +293,7 @@ QByteArray QSphereGeometryPrivate::generateIndexData() const /*! * \class Qt3DExtras::QSphereGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QSphereGeometry * \inmodule Qt3DExtras * \brief The QSphereGeometry class allows creation of a sphere in 3D space. @@ -438,7 +403,7 @@ void QSphereGeometry::setGenerateTangents(bool gen) } /*! - * \property QSphereGeometry::generateTangents + * \property Qt3DExtras::QSphereGeometry::generateTangents * * Holds the value of the automatic tangent vectors generation flag. * Tangent vectors are orthogonal to normal vectors. @@ -450,7 +415,7 @@ bool QSphereGeometry::generateTangents() const } /*! - * \property QSphereGeometry::rings + * \property Qt3DExtras::QSphereGeometry::rings * * Holds the number of rings in the sphere. */ @@ -461,7 +426,7 @@ int QSphereGeometry::rings() const } /*! - * \property QSphereGeometry::slices + * \property Qt3DExtras::QSphereGeometry::slices * * Holds the number of slices in the sphere. */ @@ -472,7 +437,7 @@ int QSphereGeometry::slices() const } /*! - * \property QSphereGeometry::radius + * \property Qt3DExtras::QSphereGeometry::radius * * Holds the radius of the sphere. */ @@ -483,7 +448,7 @@ float QSphereGeometry::radius() const } /*! - * \property QSphereGeometry::positionAttribute + * \property Qt3DExtras::QSphereGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -494,7 +459,7 @@ QAttribute *QSphereGeometry::positionAttribute() const } /*! - * \property QSphereGeometry::normalAttribute + * \property Qt3DExtras::QSphereGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -505,7 +470,7 @@ QAttribute *QSphereGeometry::normalAttribute() const } /*! - * \property QSphereGeometry::texCoordAttribute + * \property Qt3DExtras::QSphereGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ @@ -516,7 +481,7 @@ QAttribute *QSphereGeometry::texCoordAttribute() const } /*! - * \property QSphereGeometry::tangentAttribute + * \property Qt3DExtras::QSphereGeometry::tangentAttribute * * Holds the geometry tangent attribute. */ @@ -527,7 +492,7 @@ QAttribute *QSphereGeometry::tangentAttribute() const } /*! - * \property QSphereGeometry::indexAttribute + * \property Qt3DExtras::QSphereGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -541,3 +506,5 @@ QAttribute *QSphereGeometry::indexAttribute() const QT_END_NAMESPACE +#include "moc_qspheregeometry.cpp" + diff --git a/src/extras/geometries/qspheregeometry.h b/src/extras/geometries/qspheregeometry.h index 8f42e4a31..2c66b231c 100644 --- a/src/extras/geometries/qspheregeometry.h +++ b/src/extras/geometries/qspheregeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPHEREGEOMETRY_H #define QT3DEXTRAS_QSPHEREGEOMETRY_H diff --git a/src/extras/geometries/qspheregeometry_p.h b/src/extras/geometries/qspheregeometry_p.h index cf31e17c6..f5d3661a9 100644 --- a/src/extras/geometries/qspheregeometry_p.h +++ b/src/extras/geometries/qspheregeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Paul Lemire paul.lemire350@gmail.com -** 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Paul Lemire paul.lemire350@gmail.com +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPHEREGEOMETRY_P_H #define QT3DEXTRAS_QSPHEREGEOMETRY_P_H diff --git a/src/extras/geometries/qspheregeometryview.cpp b/src/extras/geometries/qspheregeometryview.cpp index 6ac72ad82..02b1f71f6 100644 --- a/src/extras/geometries/qspheregeometryview.cpp +++ b/src/extras/geometries/qspheregeometryview.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspheregeometryview.h" @@ -129,7 +93,7 @@ void QSphereGeometryView::setGenerateTangents(bool gen) } /*! - * \property QSphereGeometryView::generateTangents + * \property Qt3DExtras::QSphereGeometryView::generateTangents * * Holds the value of the automatic tangent vectors generation flag. * Tangent vectors are orthogonal to normal vectors. @@ -140,7 +104,7 @@ bool QSphereGeometryView::generateTangents() const } /*! - * \property QSphereGeometryView::rings + * \property Qt3DExtras::QSphereGeometryView::rings * * Holds the number of rings in the mesh. */ @@ -150,7 +114,7 @@ int QSphereGeometryView::rings() const } /*! - * \property QSphereGeometryView::slices + * \property Qt3DExtras::QSphereGeometryView::slices * * Holds the number of slices in the mesh. */ @@ -160,7 +124,7 @@ int QSphereGeometryView::slices() const } /*! - * \property QSphereGeometryView::radius + * \property Qt3DExtras::QSphereGeometryView::radius * * Holds the radius of the sphere. */ @@ -172,3 +136,5 @@ float QSphereGeometryView::radius() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qspheregeometryview.cpp" diff --git a/src/extras/geometries/qspheregeometryview.h b/src/extras/geometries/qspheregeometryview.h index b31fa941b..0cb7c4382 100644 --- a/src/extras/geometries/qspheregeometryview.h +++ b/src/extras/geometries/qspheregeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPHEREGEOMETRYVIEW_H #define QT3DEXTRAS_QSPHEREGEOMETRYVIEW_H diff --git a/src/extras/geometries/qspheremesh.cpp b/src/extras/geometries/qspheremesh.cpp index fa2b795c8..105102f62 100644 --- a/src/extras/geometries/qspheremesh.cpp +++ b/src/extras/geometries/qspheremesh.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qspheremesh.h" @@ -80,7 +44,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QSphereMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QSphereMesh * \inmodule Qt3DExtras * @@ -129,7 +93,7 @@ void QSphereMesh::setGenerateTangents(bool gen) } /*! - * \property QSphereMesh::generateTangents + * \property Qt3DExtras::QSphereMesh::generateTangents * * Holds the value of the automatic tangent vectors generation flag. * Tangent vectors are orthogonal to normal vectors. @@ -140,7 +104,7 @@ bool QSphereMesh::generateTangents() const } /*! - * \property QSphereMesh::rings + * \property Qt3DExtras::QSphereMesh::rings * * Holds the number of rings in the mesh. */ @@ -150,7 +114,7 @@ int QSphereMesh::rings() const } /*! - * \property QSphereMesh::slices + * \property Qt3DExtras::QSphereMesh::slices * * Holds the number of slices in the mesh. */ @@ -160,7 +124,7 @@ int QSphereMesh::slices() const } /*! - * \property QSphereMesh::radius + * \property Qt3DExtras::QSphereMesh::radius * * Holds the radius of the sphere. */ @@ -172,3 +136,5 @@ float QSphereMesh::radius() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qspheremesh.cpp" diff --git a/src/extras/geometries/qspheremesh.h b/src/extras/geometries/qspheremesh.h index 998cd7c0e..70c860d3d 100644 --- a/src/extras/geometries/qspheremesh.h +++ b/src/extras/geometries/qspheremesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QSPHEREMESH_H #define QT3DEXTRAS_QSPHEREMESH_H diff --git a/src/extras/geometries/qtorusgeometry.cpp b/src/extras/geometries/qtorusgeometry.cpp index c9b430043..30420969a 100644 --- a/src/extras/geometries/qtorusgeometry.cpp +++ b/src/extras/geometries/qtorusgeometry.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtorusgeometry.h" #include "qtorusgeometry_p.h" @@ -49,10 +13,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + namespace { int vertexCount(int requestedRings, int requestedSlices) @@ -127,7 +92,7 @@ QByteArray createTorusIndexData(int requestedRings, int requestedSlices) { const int slices = requestedSlices + 1; int triangles = triangleCount(requestedRings, requestedSlices); - int indices = triangles * 3; + qsizetype indices = triangles * 3; Q_ASSERT(indices < 65536); QByteArray indexBytes; indexBytes.resize(indices * sizeof(quint16)); @@ -305,7 +270,7 @@ QByteArray QTorusGeometryPrivate::generateIndexData() const /*! * \class Qt3DExtras::QTorusGeometry - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QTorusGeometry * \inmodule Qt3DExtras * \brief The QTorusGeometry class allows creation of a torus in 3D space. @@ -411,7 +376,7 @@ void QTorusGeometry::setMinorRadius(float minorRadius) } /*! - * \property QTorusGeometry::rings + * \property Qt3DExtras::QTorusGeometry::rings * * Holds the number of rings in the torus. */ @@ -422,7 +387,7 @@ int QTorusGeometry::rings() const } /*! - * \property QTorusGeometry::slices + * \property Qt3DExtras::QTorusGeometry::slices * * Holds the number of slices in the torus. */ @@ -433,7 +398,7 @@ int QTorusGeometry::slices() const } /*! - * \property QTorusGeometry::radius + * \property Qt3DExtras::QTorusGeometry::radius * * Holds the outer radius of the torus. */ @@ -444,7 +409,7 @@ float QTorusGeometry::radius() const } /*! - * \property QTorusGeometry::minorRadius + * \property Qt3DExtras::QTorusGeometry::minorRadius * * Holds the inner radius of the torus. */ @@ -455,7 +420,7 @@ float QTorusGeometry::minorRadius() const } /*! - * \property QTorusGeometry::positionAttribute + * \property Qt3DExtras::QTorusGeometry::positionAttribute * * Holds the geometry position attribute. */ @@ -466,7 +431,7 @@ QAttribute *QTorusGeometry::positionAttribute() const } /*! - * \property QTorusGeometry::normalAttribute + * \property Qt3DExtras::QTorusGeometry::normalAttribute * * Holds the geometry normal attribute. */ @@ -477,7 +442,7 @@ QAttribute *QTorusGeometry::normalAttribute() const } /*! - * \property QTorusGeometry::texCoordAttribute + * \property Qt3DExtras::QTorusGeometry::texCoordAttribute * * Holds the geometry texture coordinate attribute. */ @@ -488,7 +453,7 @@ QAttribute *QTorusGeometry::texCoordAttribute() const } /*! - * \property QTorusGeometry::indexAttribute + * \property Qt3DExtras::QTorusGeometry::indexAttribute * * Holds the geometry index attribute. */ @@ -501,3 +466,5 @@ QAttribute *QTorusGeometry::indexAttribute() const } // Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtorusgeometry.cpp" diff --git a/src/extras/geometries/qtorusgeometry.h b/src/extras/geometries/qtorusgeometry.h index 3fe159aa7..fd430a7e0 100644 --- a/src/extras/geometries/qtorusgeometry.h +++ b/src/extras/geometries/qtorusgeometry.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTORUSGEOMETRY_H #define QT3DEXTRAS_QTORUSGEOMETRY_H diff --git a/src/extras/geometries/qtorusgeometry_p.h b/src/extras/geometries/qtorusgeometry_p.h index 28572261e..8dba7fde9 100644 --- a/src/extras/geometries/qtorusgeometry_p.h +++ b/src/extras/geometries/qtorusgeometry_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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$ -** -****************************************************************************/ +// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTORUSGEOMETRY_P_H #define QT3DEXTRAS_QTORUSGEOMETRY_P_H diff --git a/src/extras/geometries/qtorusgeometryview.cpp b/src/extras/geometries/qtorusgeometryview.cpp index 958d17974..e500858d2 100644 --- a/src/extras/geometries/qtorusgeometryview.cpp +++ b/src/extras/geometries/qtorusgeometryview.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES // For MSVC @@ -133,7 +97,7 @@ void QTorusGeometryView::setMinorRadius(float minorRadius) } /*! - * \property QTorusGeometryView::rings + * \property Qt3DExtras::QTorusGeometryView::rings * * Holds the number of rings in the mesh. */ @@ -143,7 +107,7 @@ int QTorusGeometryView::rings() const } /*! - * \property QTorusGeometryView::slices + * \property Qt3DExtras::QTorusGeometryView::slices * * Holds the number of slices in the mesh. */ @@ -153,7 +117,7 @@ int QTorusGeometryView::slices() const } /*! - * \property QTorusGeometryView::radius + * \property Qt3DExtras::QTorusGeometryView::radius * * Holds the outer radius of the torus. */ @@ -163,7 +127,7 @@ float QTorusGeometryView::radius() const } /*! - * \property QTorusGeometryView::minorRadius + * \property Qt3DExtras::QTorusGeometryView::minorRadius * * Holds the inner radius of the torus. */ @@ -175,3 +139,5 @@ float QTorusGeometryView::minorRadius() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtorusgeometryview.cpp" diff --git a/src/extras/geometries/qtorusgeometryview.h b/src/extras/geometries/qtorusgeometryview.h index c8c6fd5ad..e65f523a3 100644 --- a/src/extras/geometries/qtorusgeometryview.h +++ b/src/extras/geometries/qtorusgeometryview.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTORUSGEOMETRYVIEW_H #define QT3DEXTRAS_QTORUSGEOMETRYVIEW_H diff --git a/src/extras/geometries/qtorusmesh.cpp b/src/extras/geometries/qtorusmesh.cpp index ddcec3ece..4bb0e1ae2 100644 --- a/src/extras/geometries/qtorusmesh.cpp +++ b/src/extras/geometries/qtorusmesh.cpp @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** 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: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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES // For MSVC @@ -84,7 +48,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QTorusMesh - \ingroup qt3d-extras-geometries + * \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QTorusMesh * \inmodule Qt3DExtras * @@ -134,7 +98,7 @@ void QTorusMesh::setMinorRadius(float minorRadius) } /*! - * \property QTorusMesh::rings + * \property Qt3DExtras::QTorusMesh::rings * * Holds the number of rings in the mesh. */ @@ -144,7 +108,7 @@ int QTorusMesh::rings() const } /*! - * \property QTorusMesh::slices + * \property Qt3DExtras::QTorusMesh::slices * * Holds the number of slices in the mesh. */ @@ -154,7 +118,7 @@ int QTorusMesh::slices() const } /*! - * \property QTorusMesh::radius + * \property Qt3DExtras::QTorusMesh::radius * * Holds the outer radius of the torus. */ @@ -164,7 +128,7 @@ float QTorusMesh::radius() const } /*! - * \property QTorusMesh::minorRadius + * \property Qt3DExtras::QTorusMesh::minorRadius * * Holds the inner radius of the torus. */ @@ -176,3 +140,5 @@ float QTorusMesh::minorRadius() const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtorusmesh.cpp" diff --git a/src/extras/geometries/qtorusmesh.h b/src/extras/geometries/qtorusmesh.h index 2fd9f0a23..e5cada323 100644 --- a/src/extras/geometries/qtorusmesh.h +++ b/src/extras/geometries/qtorusmesh.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTORUSMESH_H #define QT3DEXTRAS_QTORUSMESH_H diff --git a/src/extras/qt3dextras_global.h b/src/extras/qt3dextras_global.h index c4f649df3..d0003d505 100644 --- a/src/extras/qt3dextras_global.h +++ b/src/extras/qt3dextras_global.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_GLOBAL_H #define QT3DEXTRAS_GLOBAL_H diff --git a/src/extras/shaders/es2/coordinatesystems.inc b/src/extras/shaders/es2/coordinatesystems.inc index 5f6ee40f5..d6ec77536 100644 --- a/src/extras/shaders/es2/coordinatesystems.inc +++ b/src/extras/shaders/es2/coordinatesystems.inc @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #define FP highp diff --git a/src/extras/shaders/es2/default.vert b/src/extras/shaders/es2/default.vert index 810f658bc..84e0b609d 100644 --- a/src/extras/shaders/es2/default.vert +++ b/src/extras/shaders/es2/default.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause attribute vec3 vertexPosition; attribute vec3 vertexNormal; diff --git a/src/extras/shaders/es2/phong.inc.frag b/src/extras/shaders/es2/phong.inc.frag index a68e8124c..22fb5c2f6 100644 --- a/src/extras/shaders/es2/phong.inc.frag +++ b/src/extras/shaders/es2/phong.inc.frag @@ -1,58 +1,13 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #pragma include light.inc.frag void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3 vview, const in FP float shininess, + out FP vec3 ambientColor, out FP vec3 diffuseColor, out FP vec3 specularColor) { + ambientColor = vec3(0.0); diffuseColor = vec3(0.0); specularColor = vec3(0.0); @@ -105,6 +60,7 @@ void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3 specular = normFactor * pow( max( dot( r, vview ), 0.0 ), shininess ); } + ambientColor += att * light.intensity * 1.0 * light.color; diffuseColor += att * light.intensity * diffuse * light.color; specularColor += att * light.intensity * specular * light.color; } @@ -119,11 +75,12 @@ FP vec4 phongFunction(const in FP vec4 ambient, const in FP vec3 worldNormal) { // Calculate the lighting model, keeping the specular component separate - FP vec3 diffuseColor, specularColor; - adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); + FP vec3 ambientColor, diffuseColor, specularColor; + adsModel(worldPosition, worldNormal, worldView, shininess, ambientColor, diffuseColor, specularColor); - // Combine spec with ambient+diffuse for final fragment color - FP vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb + // Combine ambient, diffuse and specular components for final fragment color + FP vec3 color = ambientColor * ambient.rgb + + diffuseColor * diffuse.rgb + specularColor * specular.rgb; return vec4(color, diffuse.a); diff --git a/src/extras/shaders/es2/phong.inc.frag100 b/src/extras/shaders/es2/phong.inc.frag100 index c68c8e41a..7b651f904 100644 --- a/src/extras/shaders/es2/phong.inc.frag100 +++ b/src/extras/shaders/es2/phong.inc.frag100 @@ -1,58 +1,13 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #pragma include light.inc.frag void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3 vview, const in FP float shininess, + out FP vec3 ambientColor, out FP vec3 diffuseColor, out FP vec3 specularColor) { + ambientColor = vec3(0.0); diffuseColor = vec3(0.0); specularColor = vec3(0.0); @@ -122,6 +77,7 @@ void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3 specular = normFactor * pow( max( dot( r, vview ), 0.0 ), shininess ); } + ambientColor += att * lights[1].intensity * 1.0 * lights[1].color; diffuseColor += att * lights[1].intensity * diffuse * lights[1].color; specularColor += att * specular; } @@ -135,11 +91,12 @@ FP vec4 phongFunction(const in FP vec4 ambient, const in FP vec3 worldNormal) { // Calculate the lighting model, keeping the specular component separate - FP vec3 diffuseColor, specularColor; - adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); + FP vec3 ambientColor, diffuseColor, specularColor; + adsModel(worldPosition, worldNormal, worldView, shininess, ambientColor, diffuseColor, specularColor); - // Combine spec with ambient+diffuse for final fragment color - FP vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb + // Combine ambient, diffuse and specular components for final fragment color + FP vec3 color = ambientColor * ambient.rgb + + diffuseColor * diffuse.rgb + specularColor * specular.rgb; return vec4(color, diffuse.a); diff --git a/src/extras/shaders/es3/coordinatesystems.inc b/src/extras/shaders/es3/coordinatesystems.inc index 9c0f99ddd..300cb1fe0 100644 --- a/src/extras/shaders/es3/coordinatesystems.inc +++ b/src/extras/shaders/es3/coordinatesystems.inc @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2018 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef FP #define FP highp diff --git a/src/extras/shaders/es3/default.vert b/src/extras/shaders/es3/default.vert index 7641882f2..e7309aac8 100644 --- a/src/extras/shaders/es3/default.vert +++ b/src/extras/shaders/es3/default.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 300 es diff --git a/src/extras/shaders/es3/metalrough.inc.frag b/src/extras/shaders/es3/metalrough.inc.frag index fc014b81b..f9ec652f2 100644 --- a/src/extras/shaders/es3/metalrough.inc.frag +++ b/src/extras/shaders/es3/metalrough.inc.frag @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef FP #define FP highp diff --git a/src/extras/shaders/gl3/coordinatesystems.inc b/src/extras/shaders/gl3/coordinatesystems.inc index ed3d2cb92..06e96fb1a 100644 --- a/src/extras/shaders/gl3/coordinatesystems.inc +++ b/src/extras/shaders/gl3/coordinatesystems.inc @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause mat3 calcWorldSpaceToTangentSpaceMatrix(const in vec3 wNormal, const in vec4 wTangent) { diff --git a/src/extras/shaders/gl3/default.vert b/src/extras/shaders/gl3/default.vert index f97cd099d..da0a62371 100644 --- a/src/extras/shaders/gl3/default.vert +++ b/src/extras/shaders/gl3/default.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 150 core diff --git a/src/extras/shaders/gl3/metalrough.inc.frag b/src/extras/shaders/gl3/metalrough.inc.frag index f5fb81f51..f85ea019b 100644 --- a/src/extras/shaders/gl3/metalrough.inc.frag +++ b/src/extras/shaders/gl3/metalrough.inc.frag @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause // Exposure correction uniform float exposure = 0.0; diff --git a/src/extras/shaders/gl3/phong.inc.frag b/src/extras/shaders/gl3/phong.inc.frag index 47a6ecd4a..0bcd1dd1f 100644 --- a/src/extras/shaders/gl3/phong.inc.frag +++ b/src/extras/shaders/gl3/phong.inc.frag @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #pragma include light.inc.frag @@ -54,9 +7,11 @@ void adsModel(const in vec3 worldPos, const in vec3 worldNormal, const in vec3 worldView, const in float shininess, + out vec3 ambientColor, out vec3 diffuseColor, out vec3 specularColor) { + ambientColor = vec3(0.0); diffuseColor = vec3(0.0); specularColor = vec3(0.0); @@ -112,7 +67,8 @@ void adsModel(const in vec3 worldPos, specular = normFactor * pow(max(dot(r, worldView), 0.0), shininess); } - // Accumulate the diffuse and specular contributions + // Accumulate the ambient, diffuse and specular contributions + ambientColor += att * lights[i].intensity * 1.0 * lights[i].color; diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; specularColor += att * lights[i].intensity * specular * lights[i].color; } @@ -127,11 +83,12 @@ vec4 phongFunction(const in vec4 ambient, const in vec3 worldNormal) { // Calculate the lighting model, keeping the specular component separate - vec3 diffuseColor, specularColor; - adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); + vec3 ambientColor, diffuseColor, specularColor; + adsModel(worldPosition, worldNormal, worldView, shininess, ambientColor, diffuseColor, specularColor); - // Combine spec with ambient+diffuse for final fragment color - vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb + // Combine ambient, diffuse and specular components for final fragment color + vec3 color = ambientColor * ambient.rgb + + diffuseColor * diffuse.rgb + specularColor * specular.rgb; return vec4(color, diffuse.a); diff --git a/src/extras/shaders/rhi/coordinatesystems.inc b/src/extras/shaders/rhi/coordinatesystems.inc index ed3d2cb92..06e96fb1a 100644 --- a/src/extras/shaders/rhi/coordinatesystems.inc +++ b/src/extras/shaders/rhi/coordinatesystems.inc @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause mat3 calcWorldSpaceToTangentSpaceMatrix(const in vec3 wNormal, const in vec4 wTangent) { diff --git a/src/extras/shaders/rhi/default_pos_norm.vert b/src/extras/shaders/rhi/default_pos_norm.vert index 0d352123e..523d9582f 100644 --- a/src/extras/shaders/rhi/default_pos_norm.vert +++ b/src/extras/shaders/rhi/default_pos_norm.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 450 diff --git a/src/extras/shaders/rhi/default_pos_norm_tex.vert b/src/extras/shaders/rhi/default_pos_norm_tex.vert index 793b7e6e3..3e4583c5c 100644 --- a/src/extras/shaders/rhi/default_pos_norm_tex.vert +++ b/src/extras/shaders/rhi/default_pos_norm_tex.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 450 diff --git a/src/extras/shaders/rhi/default_pos_norm_tex_tan.vert b/src/extras/shaders/rhi/default_pos_norm_tex_tan.vert index 80ca6e55c..60a83f346 100644 --- a/src/extras/shaders/rhi/default_pos_norm_tex_tan.vert +++ b/src/extras/shaders/rhi/default_pos_norm_tex_tan.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 450 diff --git a/src/extras/shaders/rhi/default_pos_tex.vert b/src/extras/shaders/rhi/default_pos_tex.vert index d9d9cd512..d268eff9a 100644 --- a/src/extras/shaders/rhi/default_pos_tex.vert +++ b/src/extras/shaders/rhi/default_pos_tex.vert @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #version 450 diff --git a/src/extras/shaders/rhi/distancefieldtext.frag b/src/extras/shaders/rhi/distancefieldtext.frag index ec42f5056..4a71d3381 100644 --- a/src/extras/shaders/rhi/distancefieldtext.frag +++ b/src/extras/shaders/rhi/distancefieldtext.frag @@ -8,7 +8,7 @@ layout(location = 0) out vec4 fragColor; layout(std140, binding = 2) uniform qt3d_custom_uniforms { float minAlpha; float maxAlpha; - float textureSize; + float textureWidth; vec4 color; }; layout(binding = 3) uniform sampler2D distanceFieldTexture; @@ -19,7 +19,7 @@ void main() // (that is, how many pixels are drawn for each texel) vec2 texelDeltaX = abs(dFdx(texCoord)); vec2 texelDeltaY = abs(dFdy(texCoord)); - float avgTexelDelta = textureSize * 0.5 * (texelDeltaX.x + texelDeltaX.y + texelDeltaY.x + texelDeltaY.y); + float avgTexelDelta = textureWidth * 0.5 * (texelDeltaX.x + texelDeltaX.y + texelDeltaY.x + texelDeltaY.y); float texScale = 1.0 / avgTexelDelta; // scaled to interval [0.0, 0.15] diff --git a/src/extras/shaders/rhi/gooch.frag b/src/extras/shaders/rhi/gooch.frag index cfa40a17a..c7304a094 100644 --- a/src/extras/shaders/rhi/gooch.frag +++ b/src/extras/shaders/rhi/gooch.frag @@ -50,14 +50,17 @@ const int TYPE_DIRECTIONAL = 1; const int TYPE_SPOT = 2; struct Light { - int type; vec3 position; + int type; vec3 color; float intensity; vec3 direction; float constantAttenuation; + vec3 padding0; float linearAttenuation; + vec3 padding1; float quadraticAttenuation; + vec3 padding2; float cutOffAngle; }; diff --git a/src/extras/shaders/rhi/metalrough.inc.frag b/src/extras/shaders/rhi/metalrough.inc.frag index 817e1192c..27499eff8 100644 --- a/src/extras/shaders/rhi/metalrough.inc.frag +++ b/src/extras/shaders/rhi/metalrough.inc.frag @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #pragma include light.inc.frag diff --git a/src/extras/shaders/rhi/pervertexcolor.frag b/src/extras/shaders/rhi/pervertexcolor.frag index 156c595fd..4959e6f8f 100644 --- a/src/extras/shaders/rhi/pervertexcolor.frag +++ b/src/extras/shaders/rhi/pervertexcolor.frag @@ -6,144 +6,7 @@ layout(location = 2) in vec4 color; layout(location = 0) out vec4 fragColor; -layout(std140, binding = 0) uniform qt3d_render_view_uniforms { - mat4 viewMatrix; - mat4 projectionMatrix; - mat4 uncorrectedProjectionMatrix; - mat4 clipCorrectionMatrix; - mat4 viewProjectionMatrix; - mat4 inverseViewMatrix; - mat4 inverseProjectionMatrix; - mat4 inverseViewProjectionMatrix; - mat4 viewportMatrix; - mat4 inverseViewportMatrix; - vec4 textureTransformMatrix; - vec3 eyePosition; - float aspectRatio; - float gamma; - float exposure; - float time; -}; - -layout(std140, binding = 1) uniform qt3d_command_uniforms { - mat4 modelMatrix; - mat4 inverseModelMatrix; - mat4 modelViewMatrix; - mat3 modelNormalMatrix; - mat4 inverseModelViewMatrix; - mat4 mvp; - mat4 inverseModelViewProjectionMatrix; -}; - -const int MAX_LIGHTS = 8; -const int TYPE_POINT = 0; -const int TYPE_DIRECTIONAL = 1; -const int TYPE_SPOT = 2; - -struct Light { - int type; - vec3 position; - vec3 color; - float intensity; - vec3 direction; - float constantAttenuation; - float linearAttenuation; - float quadraticAttenuation; - float cutOffAngle; -}; - -layout(std140, binding = 2) uniform qt3d_light_uniforms { - uniform Light lights[MAX_LIGHTS]; - uniform int lightCount; - uniform int envLightCount; -}; - -void adsModel(const in vec3 worldPos, - const in vec3 worldNormal, - const in vec3 worldView, - const in float shininess, - out vec3 diffuseColor, - out vec3 specularColor) -{ - diffuseColor = vec3(0.0); - specularColor = vec3(0.0); - - // We perform all work in world space - vec3 n = normalize(worldNormal); - vec3 s = vec3(0.0); - - for (int i = 0; i < lightCount; ++i) { - float att = 1.0; - float sDotN = 0.0; - - if (lights[i].type != TYPE_DIRECTIONAL) { - // Point and Spot lights - - // Light position is already in world space - vec3 sUnnormalized = lights[i].position - worldPos; - s = normalize(sUnnormalized); // Light direction - - // Calculate the attenuation factor - sDotN = dot(s, n); - if (sDotN > 0.0) { - if (lights[i].constantAttenuation != 0.0 - || lights[i].linearAttenuation != 0.0 - || lights[i].quadraticAttenuation != 0.0) { - float dist = length(sUnnormalized); - att = 1.0 / (lights[i].constantAttenuation + - lights[i].linearAttenuation * dist + - lights[i].quadraticAttenuation * dist * dist); - } - - // The light direction is in world space already - if (lights[i].type == TYPE_SPOT) { - // Check if fragment is inside or outside of the spot light cone - if (degrees(acos(dot(-s, lights[i].direction))) > lights[i].cutOffAngle) - sDotN = 0.0; - } - } - } else { - // Directional lights - // The light direction is in world space already - s = normalize(-lights[i].direction); - sDotN = dot(s, n); - } - - // Calculate the diffuse factor - float diffuse = max(sDotN, 0.0); - - // Calculate the specular factor - float specular = 0.0; - if (diffuse > 0.0 && shininess > 0.0) { - float normFactor = (shininess + 2.0) / 2.0; - vec3 r = reflect(-s, n); // Reflection direction in world space - specular = normFactor * pow(max(dot(r, worldView), 0.0), shininess); - } - - // Accumulate the diffuse and specular contributions - diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; - specularColor += att * lights[i].intensity * specular * lights[i].color; - } -} - -vec4 phongFunction(const in vec4 ambient, - const in vec4 diffuse, - const in vec4 specular, - const in float shininess, - const in vec3 worldPosition, - const in vec3 worldView, - const in vec3 worldNormal) -{ - // Calculate the lighting model, keeping the specular component separate - vec3 diffuseColor, specularColor; - adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); - - // Combine spec with ambient+diffuse for final fragment color - vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb - + specularColor * specular.rgb; - - return vec4(color, diffuse.a); -} +#pragma include phong.inc.frag void main() { diff --git a/src/extras/shaders/rhi/phong.inc.frag b/src/extras/shaders/rhi/phong.inc.frag index 47a6ecd4a..0bcd1dd1f 100644 --- a/src/extras/shaders/rhi/phong.inc.frag +++ b/src/extras/shaders/rhi/phong.inc.frag @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #pragma include light.inc.frag @@ -54,9 +7,11 @@ void adsModel(const in vec3 worldPos, const in vec3 worldNormal, const in vec3 worldView, const in float shininess, + out vec3 ambientColor, out vec3 diffuseColor, out vec3 specularColor) { + ambientColor = vec3(0.0); diffuseColor = vec3(0.0); specularColor = vec3(0.0); @@ -112,7 +67,8 @@ void adsModel(const in vec3 worldPos, specular = normFactor * pow(max(dot(r, worldView), 0.0), shininess); } - // Accumulate the diffuse and specular contributions + // Accumulate the ambient, diffuse and specular contributions + ambientColor += att * lights[i].intensity * 1.0 * lights[i].color; diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; specularColor += att * lights[i].intensity * specular * lights[i].color; } @@ -127,11 +83,12 @@ vec4 phongFunction(const in vec4 ambient, const in vec3 worldNormal) { // Calculate the lighting model, keeping the specular component separate - vec3 diffuseColor, specularColor; - adsModel(worldPosition, worldNormal, worldView, shininess, diffuseColor, specularColor); + vec3 ambientColor, diffuseColor, specularColor; + adsModel(worldPosition, worldNormal, worldView, shininess, ambientColor, diffuseColor, specularColor); - // Combine spec with ambient+diffuse for final fragment color - vec3 color = (ambient.rgb + diffuseColor) * diffuse.rgb + // Combine ambient, diffuse and specular components for final fragment color + vec3 color = ambientColor * ambient.rgb + + diffuseColor * diffuse.rgb + specularColor * specular.rgb; return vec4(color, diffuse.a); diff --git a/src/extras/text/areaallocator.cpp b/src/extras/text/areaallocator.cpp index 61f1d5bc6..b2aedfd88 100644 --- a/src/extras/text/areaallocator.cpp +++ b/src/extras/text/areaallocator.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "areaallocator_p.h" @@ -51,16 +15,13 @@ QT_BEGIN_NAMESPACE namespace Qt3DExtras { -namespace +enum SplitType { - enum SplitType - { - VerticalSplit, - HorizontalSplit - }; + VerticalSplit, + HorizontalSplit +}; - static const int maxMargin = 2; -} +static const int maxMargin = 2; struct AreaAllocatorNode { diff --git a/src/extras/text/areaallocator_p.h b/src/extras/text/areaallocator_p.h index 468c922eb..bf5d0d2c3 100644 --- a/src/extras/text/areaallocator_p.h +++ b/src/extras/text/areaallocator_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_AREAALLOCATOR_P_H #define QT3DEXTRAS_AREAALLOCATOR_P_H diff --git a/src/extras/text/distancefieldtextrenderer.cpp b/src/extras/text/distancefieldtextrenderer.cpp index 3cafd93df..afade172c 100644 --- a/src/extras/text/distancefieldtextrenderer.cpp +++ b/src/extras/text/distancefieldtextrenderer.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include <Qt3DCore/qbuffer.h> #include <Qt3DCore/qattribute.h> @@ -154,3 +118,5 @@ void DistanceFieldTextRenderer::setColor(const QColor &color) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_distancefieldtextrenderer_p.cpp" diff --git a/src/extras/text/distancefieldtextrenderer_p.h b/src/extras/text/distancefieldtextrenderer_p.h index 7cb75c56c..8ed6d65e0 100644 --- a/src/extras/text/distancefieldtextrenderer_p.h +++ b/src/extras/text/distancefieldtextrenderer_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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$ -** -****************************************************************************/ +// Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_DISTANCEFIELDTEXTRENDERER_P_H #define QT3DEXTRAS_DISTANCEFIELDTEXTRENDERER_P_H diff --git a/src/extras/text/distancefieldtextrenderer_p_p.h b/src/extras/text/distancefieldtextrenderer_p_p.h index 76471c5ba..3a5ce11e8 100644 --- a/src/extras/text/distancefieldtextrenderer_p_p.h +++ b/src/extras/text/distancefieldtextrenderer_p_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_DISTANCEFIELDTEXTRENDERER_P_P_H #define QT3DEXTRAS_DISTANCEFIELDTEXTRENDERER_P_P_H diff --git a/src/extras/text/qdistancefieldglyphcache.cpp b/src/extras/text/qdistancefieldglyphcache.cpp index d367410c8..ae55a07c7 100644 --- a/src/extras/text/qdistancefieldglyphcache.cpp +++ b/src/extras/text/qdistancefieldglyphcache.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include <QtGui/qrawfont.h> #include <QtGui/qglyphrun.h> @@ -55,20 +19,20 @@ QT_BEGIN_NAMESPACE #define DEFAULT_IMAGE_PADDING 1 -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + // ref-count glyphs and keep track of where they are stored class StoredGlyph { public: StoredGlyph() = default; - StoredGlyph(const StoredGlyph &) = default; StoredGlyph(const QRawFont &font, quint32 glyph, bool doubleResolution); - int refCount() const { return m_ref; } + int refCount() const { return int(m_ref); } void ref() { ++m_ref; } - int deref() { return m_ref = std::max(m_ref - 1, (quint32) 0); } + int deref() { m_ref = std::max(m_ref - 1, quint32(0)); return int(m_ref); } bool addToTextureAtlas(QTextureAtlas *atlas); void removeFromTextureAtlas(); @@ -162,6 +126,7 @@ DistanceFieldFont::DistanceFieldFont(const QRawFont &font, bool doubleRes, Qt3DC , m_doubleGlyphResolution(doubleRes) , m_parentNode(parent) { + Q_ASSERT(m_parentNode); } DistanceFieldFont::~DistanceFieldFont() @@ -198,13 +163,14 @@ StoredGlyph DistanceFieldFont::refGlyph(quint32 glyph) // scenarios const int size = m_doubleGlyphResolution ? 512 : 256; - QTextureAtlas *atlas = new QTextureAtlas(m_parentNode); + QTextureAtlas *atlas = new QTextureAtlas(); atlas->setWidth(size); atlas->setHeight(size); atlas->setFormat(Qt3DRender::QAbstractTexture::R8_UNorm); atlas->setPixelFormat(QOpenGLTexture::Red); atlas->setMinificationFilter(Qt3DRender::QAbstractTexture::Linear); atlas->setMagnificationFilter(Qt3DRender::QAbstractTexture::Linear); + atlas->setParent(m_parentNode); m_atlasses << atlas; if (!storedGlyph.addToTextureAtlas(atlas)) @@ -237,7 +203,12 @@ void DistanceFieldFont::derefGlyph(quint32 glyph) Q_ASSERT(m_atlasses.contains(atlas)); m_atlasses.removeAll(atlas); - delete atlas; + + // This function might have been called as a result of destroying + // the scene root which traverses the entire scene tree. Calling + // delete on the atlas here could lead to dangling pointers in the + // least of children being traversed for destruction. + atlas->deleteLater(); } m_glyphs.erase(it); @@ -288,7 +259,8 @@ DistanceFieldFont* QDistanceFieldGlyphCache::getOrCreateDistanceFieldFont(const // create new font cache // we set the parent node to nullptr, since the parent node of QTextureAtlasses // will be set when we pass them to QText2DMaterial later - DistanceFieldFont *dff = new DistanceFieldFont(actualFont, useDoubleRes, nullptr); + Q_ASSERT(m_rootNode); + DistanceFieldFont *dff = new DistanceFieldFont(actualFont, useDoubleRes, m_rootNode); m_fonts.insert(key, dff); return dff; } @@ -325,11 +297,10 @@ QDistanceFieldGlyphCache::Glyph refAndGetGlyph(DistanceFieldFont *dff, quint32 g if (dff) { const auto entry = dff->refGlyph(glyph); - if (entry.atlas()) { - ret.glyphPathBoundingRect = entry.glyphPathBoundingRect(); - ret.texCoords = entry.texCoords(); - ret.texture = entry.atlas(); - } + Q_ASSERT(entry.atlas()); + ret.glyphPathBoundingRect = entry.glyphPathBoundingRect(); + ret.texCoords = entry.texCoords(); + ret.texture = entry.atlas(); } return ret; diff --git a/src/extras/text/qdistancefieldglyphcache_p.h b/src/extras/text/qdistancefieldglyphcache_p.h index afd1f9223..e7076ac23 100644 --- a/src/extras/text/qdistancefieldglyphcache_p.h +++ b/src/extras/text/qdistancefieldglyphcache_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QDISTANCEFIELDGLYPHCACHE_P_H #define QT3DEXTRAS_QDISTANCEFIELDGLYPHCACHE_P_H diff --git a/src/extras/text/qtext2dentity.cpp b/src/extras/text/qtext2dentity.cpp index f9edbe090..f118ff1fe 100644 --- a/src/extras/text/qtext2dentity.cpp +++ b/src/extras/text/qtext2dentity.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtext2dentity.h" #include "qtext2dentity_p.h" @@ -116,6 +80,12 @@ namespace Qt3DExtras { * Holds the height of the text's bounding rectangle. */ + /*! + * \qmlproperty Qt::Alignment Text2DEntity::alignment + * + * Holds the alignment of the text. + */ + /*! * \class Qt3DExtras::QText2DEntity @@ -144,6 +114,7 @@ QText2DEntityPrivate::QText2DEntityPrivate() , m_color(QColor(255, 255, 255, 255)) , m_width(0.0f) , m_height(0.0f) + , m_alignment(Qt::AlignTop | Qt::AlignLeft) { } @@ -310,8 +281,9 @@ void QText2DEntityPrivate::setCurrentGlyphRuns(const QList<QGlyphRun> &runs) delete m_renderers.takeLast(); while (m_renderers.size() < renderData.size()) { - DistanceFieldTextRenderer *renderer = new DistanceFieldTextRenderer(q_func()); + DistanceFieldTextRenderer *renderer = new DistanceFieldTextRenderer(); renderer->setColor(m_color); + renderer->setParent(q_func()); m_renderers << renderer; } @@ -340,6 +312,11 @@ void QText2DEntityPrivate::updateGlyphs() // collect all GlyphRuns generated by the QTextLayout if ((m_width > 0.0f || m_height > 0.0f) && !m_text.isEmpty()) { QTextLayout layout(m_text, m_scaledFont); + + QTextOption textOption = layout.textOption(); + textOption.setAlignment(m_alignment); + layout.setTextOption(textOption); + const float lineWidth = m_width / computeActualScale(); float height = 0; layout.beginLayout(); @@ -367,7 +344,7 @@ void QText2DEntityPrivate::updateGlyphs() } /*! - \property QText2DEntity::font + \property Qt3DExtras::QText2DEntity::font Holds the font for the text item that is displayed in the Qt Quick scene. @@ -397,7 +374,7 @@ void QText2DEntity::setFont(const QFont &font) } /*! - \property QText2DEntity::color + \property Qt3DExtras::QText2DEntity::color Holds the color for the text item that is displayed in the Qt Quick scene. @@ -416,13 +393,13 @@ void QText2DEntity::setColor(const QColor &color) emit colorChanged(color); - for (DistanceFieldTextRenderer *renderer : qAsConst(d->m_renderers)) + for (DistanceFieldTextRenderer *renderer : std::as_const(d->m_renderers)) renderer->setColor(color); } } /*! - \property QText2DEntity::text + \property Qt3DExtras::QText2DEntity::text Holds the text that is displayed in the Qt Quick scene. */ @@ -444,7 +421,7 @@ void QText2DEntity::setText(const QString &text) } /*! - \property QText2DEntity::width + \property Qt3DExtras::QText2DEntity::width Returns the width of the text item that is displayed in the Qt Quick scene. @@ -456,7 +433,7 @@ float QText2DEntity::width() const } /*! - \property QText2DEntity::height + \property Qt3DExtras::QText2DEntity::height Returns the height of the text item that is displayed in the Qt Quick scene. @@ -487,6 +464,31 @@ void QText2DEntity::setHeight(float height) } } +/*! + \property QText2DEntity::alignment + + Returns the alignment of the text item that is displayed in the + Qt Quick scene. + + The default alignment is top-left-aligned. +*/ +Qt::Alignment QText2DEntity::alignment() const +{ + Q_D(const QText2DEntity); + return d->m_alignment; +} + +void QText2DEntity::setAlignment(Qt::Alignment alignment) +{ + Q_D(QText2DEntity); + if (alignment != d->m_alignment) { + d->m_alignment = alignment; + d->updateGlyphs(); + } +} + } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtext2dentity.cpp" diff --git a/src/extras/text/qtext2dentity.h b/src/extras/text/qtext2dentity.h index 1083d1c85..7fc74dc77 100644 --- a/src/extras/text/qtext2dentity.h +++ b/src/extras/text/qtext2dentity.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXT2DENTITY_H #define QT3DEXTRAS_QTEXT2DENTITY_H @@ -60,6 +24,7 @@ class Q_3DEXTRASSHARED_EXPORT QText2DEntity : public Qt3DCore::QEntity Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(float width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(float height READ height WRITE setHeight NOTIFY heightChanged) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) public: explicit QText2DEntity(Qt3DCore::QNode *parent = nullptr); @@ -80,6 +45,9 @@ public: void setWidth(float width); void setHeight(float height); + Qt::Alignment alignment() const; + void setAlignment(Qt::Alignment alignment); + Q_SIGNALS: void fontChanged(const QFont &font); void colorChanged(const QColor &color); diff --git a/src/extras/text/qtext2dentity_p.h b/src/extras/text/qtext2dentity_p.h index 742c3613d..25e8df3a3 100644 --- a/src/extras/text/qtext2dentity_p.h +++ b/src/extras/text/qtext2dentity_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXT2DENTITY_P_H #define QT3DEXTRAS_QTEXT2DENTITY_P_H @@ -98,6 +62,7 @@ public: QString m_text; float m_width; float m_height; + Qt::Alignment m_alignment; QList<DistanceFieldTextRenderer*> m_renderers; diff --git a/src/extras/text/qtext2dmaterial.cpp b/src/extras/text/qtext2dmaterial.cpp index 2070bf15f..57ef9227d 100644 --- a/src/extras/text/qtext2dmaterial.cpp +++ b/src/extras/text/qtext2dmaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtext2dmaterial_p.h" #include "qtext2dmaterial_p_p.h" @@ -64,7 +28,7 @@ QText2DMaterialPrivate::QText2DMaterialPrivate() , m_effect(new Qt3DRender::QEffect()) , m_distanceFieldTexture(nullptr) , m_textureParameter(new Qt3DRender::QParameter(QStringLiteral("distanceFieldTexture"), QVariant(0))) - , m_textureSizeParameter(new Qt3DRender::QParameter(QStringLiteral("textureSize"), QVariant(256.f))) + , m_textureSizeParameter(new Qt3DRender::QParameter(QStringLiteral("textureWidth"), QVariant(256.f))) , m_colorParameter(new Qt3DRender::QParameter(QStringLiteral("color"), QVariant(QColor(255, 255, 255, 255)))) , m_gl3Technique(new Qt3DRender::QTechnique()) , m_gl2Technique(new Qt3DRender::QTechnique()) @@ -195,3 +159,5 @@ void QText2DMaterial::setDistanceFieldTexture(Qt3DRender::QAbstractTexture *tex) } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtext2dmaterial_p.cpp" diff --git a/src/extras/text/qtext2dmaterial_p.h b/src/extras/text/qtext2dmaterial_p.h index 9c944c034..e78d49028 100644 --- a/src/extras/text/qtext2dmaterial_p.h +++ b/src/extras/text/qtext2dmaterial_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXT2DMATERIAL_P_H #define QT3DEXTRAS_QTEXT2DMATERIAL_P_H diff --git a/src/extras/text/qtext2dmaterial_p_p.h b/src/extras/text/qtext2dmaterial_p_p.h index 09c8dad14..c13c568e1 100644 --- a/src/extras/text/qtext2dmaterial_p_p.h +++ b/src/extras/text/qtext2dmaterial_p_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXT2DMATERIAL_P_P_H #define QT3DEXTRAS_QTEXT2DMATERIAL_P_P_H diff --git a/src/extras/text/qtextureatlas.cpp b/src/extras/text/qtextureatlas.cpp index 97f9845e0..951f0cf31 100644 --- a/src/extras/text/qtextureatlas.cpp +++ b/src/extras/text/qtextureatlas.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qtextureatlas_p.h" #include "qtextureatlas_p_p.h" @@ -44,10 +8,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QTextureAtlasData::QTextureAtlasData(int w, int h, QImage::Format fmt) : m_image(w, h, fmt) { @@ -259,7 +224,7 @@ bool QTextureAtlas::hasImage(TextureId id) const return d->m_textures.contains(id); } -int QTextureAtlas::imageCount() const +qsizetype QTextureAtlas::imageCount() const { Q_D(const QTextureAtlas); return d->m_textures.size(); @@ -297,3 +262,5 @@ int QTextureAtlas::imagePadding(TextureId id) const } // namespace Qt3DExtras QT_END_NAMESPACE + +#include "moc_qtextureatlas_p.cpp" diff --git a/src/extras/text/qtextureatlas_p.h b/src/extras/text/qtextureatlas_p.h index 7d0979eae..8d65b15fe 100644 --- a/src/extras/text/qtextureatlas_p.h +++ b/src/extras/text/qtextureatlas_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXTUREATLAS_P_H #define QT3DEXTRAS_QTEXTUREATLAS_P_H @@ -78,7 +42,7 @@ public: TextureId addImage(const QImage &image, int padding); void removeImage(TextureId id); - int imageCount() const; + qsizetype imageCount() const; bool hasImage(TextureId id) const; QRect imagePosition(TextureId id) const; diff --git a/src/extras/text/qtextureatlas_p_p.h b/src/extras/text/qtextureatlas_p_p.h index f782abe19..fb27c4c74 100644 --- a/src/extras/text/qtextureatlas_p_p.h +++ b/src/extras/text/qtextureatlas_p_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT3DEXTRAS_QTEXTUREATLAS_P_P_H #define QT3DEXTRAS_QTEXTUREATLAS_P_P_H diff --git a/src/extras/text/text.pri b/src/extras/text/text.pri deleted file mode 100644 index 1d2cb793c..000000000 --- a/src/extras/text/text.pri +++ /dev/null @@ -1,21 +0,0 @@ -HEADERS += \ - $$PWD/distancefieldtextrenderer_p.h \ - $$PWD/distancefieldtextrenderer_p_p.h \ - $$PWD/areaallocator_p.h \ - $$PWD/qdistancefieldglyphcache_p.h \ - $$PWD/qtextureatlas_p_p.h \ - $$PWD/qtextureatlas_p.h \ - $$PWD/qtext2dentity_p.h \ - $$PWD/qtext2dentity.h \ - $$PWD/qtext2dmaterial_p_p.h \ - $$PWD/qtext2dmaterial_p.h - -SOURCES += \ - $$PWD/qtextureatlas.cpp \ - $$PWD/qdistancefieldglyphcache.cpp \ - $$PWD/distancefieldtextrenderer.cpp \ - $$PWD/areaallocator.cpp \ - $$PWD/qtext2dentity.cpp \ - $$PWD/qtext2dmaterial.cpp - -INCLUDEPATH += $$PWD |