1// Copyright (C) 2015 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_QGOOCHMATERIAL_H
5#define QT3DEXTRAS_QGOOCHMATERIAL_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 QGoochMaterialPrivate;
16
17class Q_3DEXTRASSHARED_EXPORT QGoochMaterial : public Qt3DRender::QMaterial
18{
19 Q_OBJECT
20 Q_PROPERTY(QColor diffuse READ diffuse WRITE setDiffuse NOTIFY diffuseChanged)
21 Q_PROPERTY(QColor specular READ specular WRITE setSpecular NOTIFY specularChanged)
22 Q_PROPERTY(QColor cool READ cool WRITE setCool NOTIFY coolChanged)
23 Q_PROPERTY(QColor warm READ warm WRITE setWarm NOTIFY warmChanged)
24 Q_PROPERTY(float alpha READ alpha WRITE setAlpha NOTIFY alphaChanged)
25 Q_PROPERTY(float beta READ beta WRITE setBeta NOTIFY betaChanged)
26 Q_PROPERTY(float shininess READ shininess WRITE setShininess NOTIFY shininessChanged)
27
28public:
29 explicit QGoochMaterial(Qt3DCore::QNode *parent = nullptr);
30 ~QGoochMaterial();
31
32 QColor diffuse() const;
33 QColor specular() const;
34 QColor cool() const;
35 QColor warm() const;
36 float alpha() const;
37 float beta() const;
38 float shininess() const;
39
40public Q_SLOTS:
41 void setDiffuse(const QColor &diffuse);
42 void setSpecular(const QColor &specular);
43 void setCool(const QColor &cool);
44 void setWarm(const QColor &warm);
45 void setAlpha(float alpha);
46 void setBeta(float beta);
47 void setShininess(float shininess);
48
49Q_SIGNALS:
50 void diffuseChanged(const QColor &diffuse);
51 void specularChanged(const QColor &specular);
52 void coolChanged(const QColor &cool);
53 void warmChanged(const QColor &warm);
54 void alphaChanged(float alpha);
55 void betaChanged(float beta);
56 void shininessChanged(float shininess);
57
58protected:
59 explicit QGoochMaterial(QGoochMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr);
60
61private:
62 Q_DECLARE_PRIVATE(QGoochMaterial)
63};
64
65} // namespace Qt3DExtras
66
67QT_END_NAMESPACE
68
69#endif // QT3DEXTRAS_QGOOCHMATERIAL_H
70

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