| 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 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | namespace Qt3DRender { |
| 16 | |
| 17 | class QAbstractLightPrivate; |
| 18 | |
| 19 | class 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 | |
| 26 | public: |
| 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 | |
| 40 | public Q_SLOTS: |
| 41 | void setColor(const QColor &color); |
| 42 | void setIntensity(float intensity); |
| 43 | |
| 44 | protected: |
| 45 | explicit QAbstractLight(QAbstractLightPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
| 46 | |
| 47 | Q_SIGNALS: |
| 48 | void colorChanged(const QColor &color); |
| 49 | void intensityChanged(float intensity); |
| 50 | |
| 51 | private: |
| 52 | Q_DECLARE_PRIVATE(QAbstractLight) |
| 53 | }; |
| 54 | |
| 55 | } // namespace Qt3DRender |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | |
| 59 | #endif // QT3DRENDER_QABSTRACTLIGHT_H |
| 60 | |