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