| 1 | // Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_SCENE3DSGNODE_P_H |
| 5 | #define QT3DRENDER_SCENE3DSGNODE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtQuick/QSGGeometryNode> |
| 19 | |
| 20 | #include <private/scene3dsgmaterial_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QSGTexture; |
| 25 | |
| 26 | namespace Qt3DRender { |
| 27 | |
| 28 | class Scene3DSGNode : public QSGGeometryNode |
| 29 | { |
| 30 | public: |
| 31 | Scene3DSGNode(); |
| 32 | ~Scene3DSGNode(); |
| 33 | |
| 34 | void setTexture(QSGTexture *texture) noexcept |
| 35 | { |
| 36 | m_material.setTexture(texture); |
| 37 | m_opaqueMaterial.setTexture(texture); |
| 38 | markDirty(bits: DirtyMaterial); |
| 39 | } |
| 40 | QSGTexture *texture() const noexcept { return m_material.texture(); } |
| 41 | |
| 42 | void setRect(const QRectF &rect, bool mirrorVertically = false); |
| 43 | QRectF rect() const noexcept { return m_rect; } |
| 44 | |
| 45 | void show(); |
| 46 | |
| 47 | private: |
| 48 | Scene3DSGMaterial m_material; |
| 49 | Scene3DSGMaterial m_opaqueMaterial; |
| 50 | QSGGeometry m_geometry; |
| 51 | QRectF m_rect; |
| 52 | }; |
| 53 | |
| 54 | } // namespace Qt3DRender |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif // QT3DRENDER_SCENE3DSGNODE_P_H |
| 59 | |