| 1 | // Copyright (C) 2014 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_QMATERIAL_H |
| 5 | #define QT3DRENDER_QMATERIAL_H |
| 6 | |
| 7 | #include <QtCore/QVariant> |
| 8 | |
| 9 | #include <Qt3DCore/qcomponent.h> |
| 10 | #include <Qt3DRender/qt3drender_global.h> |
| 11 | #include <Qt3DRender/qeffect.h> |
| 12 | #include <Qt3DRender/qabstracttexture.h> |
| 13 | |
| 14 | QT_BEGIN_NAMESPACE |
| 15 | |
| 16 | namespace Qt3DRender { |
| 17 | |
| 18 | class QParameter; |
| 19 | class QMaterialPrivate; |
| 20 | |
| 21 | class Q_3DRENDERSHARED_EXPORT QMaterial : public Qt3DCore::QComponent |
| 22 | { |
| 23 | Q_OBJECT |
| 24 | Q_PROPERTY(Qt3DRender::QEffect *effect READ effect WRITE setEffect NOTIFY effectChanged) |
| 25 | |
| 26 | public: |
| 27 | explicit QMaterial(Qt3DCore::QNode *parent = nullptr); |
| 28 | ~QMaterial(); |
| 29 | |
| 30 | QEffect *effect() const; |
| 31 | |
| 32 | void addParameter(QParameter *parameter); |
| 33 | void removeParameter(QParameter *parameter); |
| 34 | QList<QParameter *> parameters() const; |
| 35 | |
| 36 | public Q_SLOTS: |
| 37 | void setEffect(QEffect *effect); |
| 38 | |
| 39 | Q_SIGNALS: |
| 40 | void effectChanged(QEffect *effect); |
| 41 | |
| 42 | protected: |
| 43 | explicit QMaterial(QMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
| 44 | |
| 45 | private: |
| 46 | Q_DECLARE_PRIVATE(QMaterial) |
| 47 | }; |
| 48 | |
| 49 | } |
| 50 | |
| 51 | QT_END_NAMESPACE |
| 52 | |
| 53 | #endif // QT3DRENDER_QMATERIAL_H |
| 54 | |