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
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DExtras {
14
15class QPhongMaterialPrivate;
16
17class 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
25public:
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
34public 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
40Q_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
46private:
47 Q_DECLARE_PRIVATE(QPhongMaterial)
48};
49
50} // namespace Qt3DExtras
51
52QT_END_NAMESPACE
53
54#endif // QT3DEXTRAS_QPHONGMATERIAL_H
55

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