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
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DRender {
14
15class QAbstractTexture;
16
17} // namespace Qt3DRender
18
19namespace Qt3DExtras {
20
21class QDiffuseMapMaterialPrivate;
22
23class 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
32public:
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
42public 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
49Q_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
56private:
57 Q_DECLARE_PRIVATE(QDiffuseMapMaterial)
58};
59
60} // Qt3DExtras
61
62QT_END_NAMESPACE
63
64#endif // QT3DEXTRASQDIFFUSEMAPMATERIAL_H
65

source code of qt3d/src/extras/defaults/qdiffusemapmaterial.h