diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2016-04-26 09:56:42 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-28 07:50:56 +0000 |
commit | e1b2b6d0660fc73ca339d3a0e9bb62b2dc79126a (patch) | |
tree | 5c6ac3373549da0a7c50d5119d2757fdafa60219 /src/render/lights | |
parent | 7d124092eb40dac7829475a36f748688af2e47dc (diff) |
Rename QLight to QAbstractLight
Change-Id: I3ee3f6e3c9eef554fce7d79407825894b1be2450
Task-number: QTBUG-51489
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/lights')
-rw-r--r-- | src/render/lights/light.cpp | 2 | ||||
-rw-r--r-- | src/render/lights/lights.pri | 6 | ||||
-rw-r--r-- | src/render/lights/qabstractlight.cpp (renamed from src/render/lights/qlight.cpp) | 56 | ||||
-rw-r--r-- | src/render/lights/qabstractlight.h (renamed from src/render/lights/qlight.h) | 18 | ||||
-rw-r--r-- | src/render/lights/qabstractlight_p.h (renamed from src/render/lights/qlight_p.h) | 16 | ||||
-rw-r--r-- | src/render/lights/qdirectionallight.cpp | 8 | ||||
-rw-r--r-- | src/render/lights/qdirectionallight.h | 4 | ||||
-rw-r--r-- | src/render/lights/qdirectionallight_p.h | 4 | ||||
-rw-r--r-- | src/render/lights/qpointlight.cpp | 10 | ||||
-rw-r--r-- | src/render/lights/qpointlight.h | 4 | ||||
-rw-r--r-- | src/render/lights/qpointlight_p.h | 6 | ||||
-rw-r--r-- | src/render/lights/qspotlight.cpp | 10 | ||||
-rw-r--r-- | src/render/lights/qspotlight.h | 4 | ||||
-rw-r--r-- | src/render/lights/qspotlight_p.h | 4 |
14 files changed, 76 insertions, 76 deletions
diff --git a/src/render/lights/light.cpp b/src/render/lights/light.cpp index 9193462cb..8485ad48e 100644 --- a/src/render/lights/light.cpp +++ b/src/render/lights/light.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "light_p.h" -#include "qlight.h" +#include "qabstractlight.h" #include <Qt3DCore/qnodepropertychange.h> #include <private/abstractrenderer_p.h> #include <private/nodemanagers_p.h> diff --git a/src/render/lights/lights.pri b/src/render/lights/lights.pri index ade6d29d7..1a7e8295c 100644 --- a/src/render/lights/lights.pri +++ b/src/render/lights/lights.pri @@ -1,8 +1,8 @@ INCLUDEPATH += $$PWD HEADERS += \ - $$PWD/qlight.h \ - $$PWD/qlight_p.h \ + $$PWD/qabstractlight.h \ + $$PWD/qabstractlight_p.h \ $$PWD/qdirectionallight.h \ $$PWD/qdirectionallight_p.h \ $$PWD/qpointlight.h \ @@ -12,7 +12,7 @@ HEADERS += \ $$PWD/light_p.h SOURCES += \ - $$PWD/qlight.cpp \ + $$PWD/qabstractlight.cpp \ $$PWD/qdirectionallight.cpp \ $$PWD/qpointlight.cpp \ $$PWD/qspotlight.cpp \ diff --git a/src/render/lights/qlight.cpp b/src/render/lights/qabstractlight.cpp index f86e709e4..604fdf4eb 100644 --- a/src/render/lights/qlight.cpp +++ b/src/render/lights/qabstractlight.cpp @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#include "qlight.h" -#include "qlight_p.h" +#include "qabstractlight.h" +#include "qabstractlight_p.h" QT_BEGIN_NAMESPACE @@ -48,22 +48,22 @@ namespace Qt3DRender /*! * \qmltype Light * \inqmlmodule Qt3D.Render - * \instantiates Qt3DRender::QLight - * \brief Encapsulate a QLight object in a Qt 3D scene. + * \instantiates Qt3DRender::QAbstractLight + * \brief Encapsulate a QAbstractLight object in a Qt 3D scene. * \since 5.6 */ -QLightPrivate::QLightPrivate(QLight::Type type) +QAbstractLightPrivate::QAbstractLightPrivate(QAbstractLight::Type type) : m_type(type) , m_color(QColor(255, 255, 255)) , m_intensity(1.0f) { } -void QLight::copy(const QNode *ref) +void QAbstractLight::copy(const QNode *ref) { - const QLight *light = static_cast<const QLight*>(ref); + const QAbstractLight *light = static_cast<const QAbstractLight*>(ref); d_func()->m_type = light->d_func()->m_type; d_func()->m_color = light->d_func()->m_color; d_func()->m_intensity = light->d_func()->m_intensity; @@ -71,33 +71,33 @@ void QLight::copy(const QNode *ref) } /*! - \class Qt3DRender::QLight + \class Qt3DRender::QAbstractLight \inmodule Qt3DRender */ /*! - * Constructs a new QLight with the given \a parent. + * Constructs a new QAbstractLight with the given \a parent. */ -QLight::QLight(Qt3DCore::QNode *parent) : - QShaderData(*new QLightPrivate(PointLight), parent) +QAbstractLight::QAbstractLight(Qt3DCore::QNode *parent) : + QShaderData(*new QAbstractLightPrivate(PointLight), parent) { } /*! \internal */ -QLight::QLight(QLightPrivate &dd, QNode *parent) +QAbstractLight::QAbstractLight(QAbstractLightPrivate &dd, QNode *parent) : QShaderData(dd, parent) { } -QLight::Type QLight::type() const +QAbstractLight::Type QAbstractLight::type() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_type; } -void QLight::setType(Type type) +void QAbstractLight::setType(Type type) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_type != type) { d->m_type = type; emit typeChanged(type); @@ -105,19 +105,19 @@ void QLight::setType(Type type) } /*! - * \property Qt3DRender::QLight::color + * \property Qt3DRender::QAbstractLight::color * - * Holds the current QLight color. + * Holds the current QAbstractLight color. */ -QColor QLight::color() const +QColor QAbstractLight::color() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_color; } -void QLight::setColor(const QColor &color) +void QAbstractLight::setColor(const QColor &color) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_color != color) { d->m_color = color; emit colorChanged(color); @@ -125,19 +125,19 @@ void QLight::setColor(const QColor &color) } /*! - \property Qt3DRender::QLight::intensity + \property Qt3DRender::QAbstractLight::intensity - Holds the current QLight intensity. + Holds the current QAbstractLight intensity. */ -float QLight::intensity() const +float QAbstractLight::intensity() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_intensity; } -void QLight::setIntensity(float intensity) +void QAbstractLight::setIntensity(float intensity) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_intensity != intensity) { d->m_intensity = intensity; emit intensityChanged(intensity); diff --git a/src/render/lights/qlight.h b/src/render/lights/qabstractlight.h index 369d35526..15a7ed069 100644 --- a/src/render/lights/qlight.h +++ b/src/render/lights/qabstractlight.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef QT3DRENDER_QLIGHT_H -#define QT3DRENDER_QLIGHT_H +#ifndef QT3DRENDER_QABSTRACTLIGHT_H +#define QT3DRENDER_QABSTRACTLIGHT_H #include <Qt3DRender/qt3drender_global.h> #include <Qt3DRender/qshaderdata.h> @@ -50,9 +50,9 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QLightPrivate; +class QAbstractLightPrivate; -class QT3DRENDERSHARED_EXPORT QLight : public QShaderData +class QT3DRENDERSHARED_EXPORT QAbstractLight : public QShaderData { Q_OBJECT Q_PROPERTY(Type type READ type WRITE setType NOTIFY typeChanged) @@ -67,7 +67,7 @@ public : }; Q_ENUM(Type) - explicit QLight(Qt3DCore::QNode *parent = Q_NULLPTR); + explicit QAbstractLight(Qt3DCore::QNode *parent = Q_NULLPTR); Type type() const; QColor color() const; @@ -79,7 +79,7 @@ public Q_SLOTS: void setIntensity(float intensity); protected : - QLight(QLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); + QAbstractLight(QAbstractLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; Q_SIGNALS: @@ -88,12 +88,12 @@ Q_SIGNALS: void intensityChanged(float intensity); private: - Q_DECLARE_PRIVATE(QLight) - QT3D_CLONEABLE(QLight) + Q_DECLARE_PRIVATE(QAbstractLight) + QT3D_CLONEABLE(QAbstractLight) }; } // namespace Qt3DRender QT_END_NAMESPACE -#endif // QT3DRENDER_QLIGHT_H +#endif // QT3DRENDER_QABSTRACTLIGHT_H diff --git a/src/render/lights/qlight_p.h b/src/render/lights/qabstractlight_p.h index f21939f03..3f3b4cc0d 100644 --- a/src/render/lights/qlight_p.h +++ b/src/render/lights/qabstractlight_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef QT3DRENDER_QLIGHT_P_H -#define QT3DRENDER_QLIGHT_P_H +#ifndef QT3DRENDER_QABSTRACTLIGHT_P_H +#define QT3DRENDER_QABSTRACTLIGHT_P_H // // W A R N I N G @@ -57,15 +57,15 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QLight; +class QAbstractLight; -class QLightPrivate : public QShaderDataPrivate +class QAbstractLightPrivate : public QShaderDataPrivate { public: - QLightPrivate(QLight::Type type); + QAbstractLightPrivate(QAbstractLight::Type type); - Q_DECLARE_PUBLIC(QLight) - QLight::Type m_type; + Q_DECLARE_PUBLIC(QAbstractLight) + QAbstractLight::Type m_type; QColor m_color; float m_intensity; }; @@ -74,4 +74,4 @@ public: QT_END_NAMESPACE -#endif // QT3DRENDER_QLIGHT_P_H +#endif // QT3DRENDER_QABSTRACTLIGHT_P_H diff --git a/src/render/lights/qdirectionallight.cpp b/src/render/lights/qdirectionallight.cpp index e5265a0fb..ff1ca1a8d 100644 --- a/src/render/lights/qdirectionallight.cpp +++ b/src/render/lights/qdirectionallight.cpp @@ -65,7 +65,7 @@ namespace Qt3DRender { */ QDirectionalLightPrivate::QDirectionalLightPrivate() - : QLightPrivate(QLight::DirectionalLight) + : QAbstractLightPrivate(QAbstractLight::DirectionalLight) , m_worldDirection(0.0f, -1.0f, 0.0f) { } @@ -76,17 +76,17 @@ void QDirectionalLight::copy(const QNode *ref) d_func()->m_worldDirection = light->d_func()->m_worldDirection; // This needs to be last otherwise, properties value won't be copied // as we use shader introspection in QShaderData::copy - QLight::copy(ref); + QAbstractLight::copy(ref); } QDirectionalLight::QDirectionalLight(QNode *parent) - : QLight(*new QDirectionalLightPrivate, parent) + : QAbstractLight(*new QDirectionalLightPrivate, parent) { } /*! \internal */ QDirectionalLight::QDirectionalLight(QDirectionalLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qdirectionallight.h b/src/render/lights/qdirectionallight.h index 636a5a00b..ec2e960db 100644 --- a/src/render/lights/qdirectionallight.h +++ b/src/render/lights/qdirectionallight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QDIRECTIONALLIGHT_H #define QT3DRENDER_QDIRECTIONALLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QDirectionalLightPrivate; -class QT3DRENDERSHARED_EXPORT QDirectionalLight : public QLight +class QT3DRENDERSHARED_EXPORT QDirectionalLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(QVector3D worldDirection READ worldDirection WRITE setWorldDirection NOTIFY worldDirectionChanged) diff --git a/src/render/lights/qdirectionallight_p.h b/src/render/lights/qdirectionallight_p.h index 486458180..b560e4348 100644 --- a/src/render/lights/qdirectionallight_p.h +++ b/src/render/lights/qdirectionallight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,7 +59,7 @@ namespace Qt3DRender { class QDirectionalLight; -class QDirectionalLightPrivate : QLightPrivate +class QDirectionalLightPrivate : QAbstractLightPrivate { public: QDirectionalLightPrivate(); diff --git a/src/render/lights/qpointlight.cpp b/src/render/lights/qpointlight.cpp index 57b276c6f..86455be84 100644 --- a/src/render/lights/qpointlight.cpp +++ b/src/render/lights/qpointlight.cpp @@ -61,11 +61,11 @@ namespace Qt3DRender { \endcode */ -QPointLightPrivate::QPointLightPrivate(QLight::Type type) - : QLightPrivate(type) +QPointLightPrivate::QPointLightPrivate(QAbstractLight::Type type) + : QAbstractLightPrivate(type) , m_constantAttenuation(0.0f) , m_linearAttenuation(0.0f) - , m_quadraticAttenuation(0.002f) + , m_quadraticAttenuation(0.0f) { } @@ -90,13 +90,13 @@ QPointLightPrivate::QPointLightPrivate(QLight::Type type) Constructs a new QPointLight with the specified \a parent. */ QPointLight::QPointLight(QNode *parent) - : QLight(*new QPointLightPrivate, parent) + : QAbstractLight(*new QPointLightPrivate, parent) { } /*! \internal */ QPointLight::QPointLight(QPointLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qpointlight.h b/src/render/lights/qpointlight.h index 7298997d2..972a19b20 100644 --- a/src/render/lights/qpointlight.h +++ b/src/render/lights/qpointlight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QPOINTLIGHT_H #define QT3DRENDER_QPOINTLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QPointLightPrivate; -class QT3DRENDERSHARED_EXPORT QPointLight : public QLight +class QT3DRENDERSHARED_EXPORT QPointLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(float constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged) diff --git a/src/render/lights/qpointlight_p.h b/src/render/lights/qpointlight_p.h index 74f32910b..1a08b1d0c 100644 --- a/src/render/lights/qpointlight_p.h +++ b/src/render/lights/qpointlight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,10 +59,10 @@ namespace Qt3DRender { class QPointLight; -class QPointLightPrivate : public QLightPrivate +class QPointLightPrivate : public QAbstractLightPrivate { public: - QPointLightPrivate(QLight::Type type = QLight::PointLight); + QPointLightPrivate(QAbstractLight::Type type = QAbstractLight::PointLight); float m_constantAttenuation; float m_linearAttenuation; diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp index cb94e2bf5..55e3c079e 100644 --- a/src/render/lights/qspotlight.cpp +++ b/src/render/lights/qspotlight.cpp @@ -66,10 +66,10 @@ namespace Qt3DRender { */ QSpotLightPrivate::QSpotLightPrivate() - : QLightPrivate(QLight::SpotLight) + : QAbstractLightPrivate(QAbstractLight::SpotLight) , m_constantAttenuation(0.0f) , m_linearAttenuation(0.0f) - , m_quadraticAttenuation(0.002f) + , m_quadraticAttenuation(0.0f) , m_localDirection(0.0f, -1.0f, 0.0f) , m_cutOffAngle(45.0f) { @@ -100,7 +100,7 @@ void QSpotLight::copy(const QNode *ref) const QSpotLight *light = static_cast<const QSpotLight*>(ref); d_func()->m_localDirection = light->d_func()->m_localDirection; d_func()->m_cutOffAngle = light->d_func()->m_cutOffAngle; - QLight::copy(ref); + QAbstractLight::copy(ref); } @@ -109,13 +109,13 @@ void QSpotLight::copy(const QNode *ref) Constructs a new QSpotLight with the specified \a parent. */ QSpotLight::QSpotLight(QNode *parent) - : QLight(*new QSpotLightPrivate, parent) + : QAbstractLight(*new QSpotLightPrivate, parent) { } /*! \internal */ QSpotLight::QSpotLight(QSpotLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qspotlight.h b/src/render/lights/qspotlight.h index a02809082..3d7889156 100644 --- a/src/render/lights/qspotlight.h +++ b/src/render/lights/qspotlight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QSPOTLIGHT_H #define QT3DRENDER_QSPOTLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QSpotLightPrivate; -class QT3DRENDERSHARED_EXPORT QSpotLight : public QLight +class QT3DRENDERSHARED_EXPORT QSpotLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(float constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged) diff --git a/src/render/lights/qspotlight_p.h b/src/render/lights/qspotlight_p.h index 20d9b6042..19a132b34 100644 --- a/src/render/lights/qspotlight_p.h +++ b/src/render/lights/qspotlight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,7 +59,7 @@ namespace Qt3DRender { class QSpotLight; -class QSpotLightPrivate : public QLightPrivate +class QSpotLightPrivate : public QAbstractLightPrivate { public: QSpotLightPrivate(); |