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

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