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_QDIFFUSEMAPMATERIAL_H |
5 | #define QT3DEXTRAS_QDIFFUSEMAPMATERIAL_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 Qt3DRender { |
14 | |
15 | class QAbstractTexture; |
16 | |
17 | } // namespace Qt3DRender |
18 | |
19 | namespace Qt3DExtras { |
20 | |
21 | class QDiffuseMapMaterialPrivate; |
22 | |
23 | class Q_3DEXTRASSHARED_EXPORT QDiffuseMapMaterial : public Qt3DRender::QMaterial |
24 | { |
25 | Q_OBJECT |
26 | Q_PROPERTY(QColor ambient READ ambient WRITE setAmbient NOTIFY ambientChanged) |
27 | Q_PROPERTY(QColor specular READ specular WRITE setSpecular NOTIFY specularChanged) |
28 | Q_PROPERTY(float shininess READ shininess WRITE setShininess NOTIFY shininessChanged) |
29 | Q_PROPERTY(Qt3DRender::QAbstractTexture *diffuse READ diffuse WRITE setDiffuse NOTIFY diffuseChanged) |
30 | Q_PROPERTY(float textureScale READ textureScale WRITE setTextureScale NOTIFY textureScaleChanged) |
31 | |
32 | public: |
33 | explicit QDiffuseMapMaterial(Qt3DCore::QNode *parent = nullptr); |
34 | ~QDiffuseMapMaterial(); |
35 | |
36 | QColor ambient() const; |
37 | QColor specular() const; |
38 | float shininess() const; |
39 | Qt3DRender::QAbstractTexture *diffuse() const; |
40 | float textureScale() const; |
41 | |
42 | public Q_SLOTS: |
43 | void setAmbient(const QColor &color); |
44 | void setSpecular(const QColor &specular); |
45 | void setShininess(float shininess); |
46 | void setDiffuse(Qt3DRender::QAbstractTexture *diffuse); |
47 | void setTextureScale(float textureScale); |
48 | |
49 | Q_SIGNALS: |
50 | void ambientChanged(const QColor &ambient); |
51 | void diffuseChanged(Qt3DRender::QAbstractTexture *diffuse); |
52 | void specularChanged(const QColor &specular); |
53 | void shininessChanged(float shininess); |
54 | void textureScaleChanged(float textureScale); |
55 | |
56 | private: |
57 | Q_DECLARE_PRIVATE(QDiffuseMapMaterial) |
58 | }; |
59 | |
60 | } // Qt3DExtras |
61 | |
62 | QT_END_NAMESPACE |
63 | |
64 | #endif // QT3DEXTRASQDIFFUSEMAPMATERIAL_H |
65 |
Definitions
Learn Advanced QML with KDAB
Find out more