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 QT3DRENDER_QABSTRACTLIGHT_H
5#define QT3DRENDER_QABSTRACTLIGHT_H
6
7#include <Qt3DRender/qt3drender_global.h>
8#include <Qt3DCore/qcomponent.h>
9
10#include <QtGui/QVector3D>
11#include <QtGui/QColor>
12
13QT_BEGIN_NAMESPACE
14
15namespace Qt3DRender {
16
17class QAbstractLightPrivate;
18
19class Q_3DRENDERSHARED_EXPORT QAbstractLight : public Qt3DCore::QComponent
20{
21 Q_OBJECT
22 Q_PROPERTY(Type type READ type)
23 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
24 Q_PROPERTY(float intensity READ intensity WRITE setIntensity NOTIFY intensityChanged)
25
26public:
27 ~QAbstractLight();
28
29 enum Type {
30 PointLight = 0,
31 DirectionalLight,
32 SpotLight
33 };
34 Q_ENUM(Type) // LCOV_EXCL_LINE
35
36 Type type() const;
37 QColor color() const;
38 float intensity() const;
39
40public Q_SLOTS:
41 void setColor(const QColor &color);
42 void setIntensity(float intensity);
43
44protected:
45 explicit QAbstractLight(QAbstractLightPrivate &dd, Qt3DCore::QNode *parent = nullptr);
46
47Q_SIGNALS:
48 void colorChanged(const QColor &color);
49 void intensityChanged(float intensity);
50
51private:
52 Q_DECLARE_PRIVATE(QAbstractLight)
53};
54
55} // namespace Qt3DRender
56
57QT_END_NAMESPACE
58
59#endif // QT3DRENDER_QABSTRACTLIGHT_H
60

source code of qt3d/src/render/lights/qabstractlight.h