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 QT3DEXTRAS_QPHONGMATERIAL_H |
5 | #define QT3DEXTRAS_QPHONGMATERIAL_H |
6 | |
7 | #include <Qt3DExtras/qt3dextras_global.h> |
8 | #include <Qt3DRender/qmaterial.h> |
9 | #include <QtGui/QColor> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | namespace Qt3DExtras { |
14 | |
15 | class QPhongMaterialPrivate; |
16 | |
17 | class Q_3DEXTRASSHARED_EXPORT QPhongMaterial : public Qt3DRender::QMaterial |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(QColor ambient READ ambient WRITE setAmbient NOTIFY ambientChanged) |
21 | Q_PROPERTY(QColor diffuse READ diffuse WRITE setDiffuse NOTIFY diffuseChanged) |
22 | Q_PROPERTY(QColor specular READ specular WRITE setSpecular NOTIFY specularChanged) |
23 | Q_PROPERTY(float shininess READ shininess WRITE setShininess NOTIFY shininessChanged) |
24 | |
25 | public: |
26 | explicit QPhongMaterial(Qt3DCore::QNode *parent = nullptr); |
27 | ~QPhongMaterial(); |
28 | |
29 | QColor ambient() const; |
30 | QColor diffuse() const; |
31 | QColor specular() const; |
32 | float shininess() const; |
33 | |
34 | public Q_SLOTS: |
35 | void setAmbient(const QColor &ambient); |
36 | void setDiffuse(const QColor &diffuse); |
37 | void setSpecular(const QColor &specular); |
38 | void setShininess(float shininess); |
39 | |
40 | Q_SIGNALS: |
41 | void ambientChanged(const QColor &ambient); |
42 | void diffuseChanged(const QColor &diffuse); |
43 | void specularChanged(const QColor &specular); |
44 | void shininessChanged(float shininess); |
45 | |
46 | private: |
47 | Q_DECLARE_PRIVATE(QPhongMaterial) |
48 | }; |
49 | |
50 | } // namespace Qt3DExtras |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif // QT3DEXTRAS_QPHONGMATERIAL_H |
55 |