1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DFOG_P_H
5#define QQUICK3DFOG_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3D/private/qquick3dnode_p.h>
19#include <QtGui/qcolor.h>
20
21QT_BEGIN_NAMESPACE
22
23class Q_QUICK3D_EXPORT QQuick3DFog : public QObject
24{
25 Q_OBJECT
26 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
27 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
28 Q_PROPERTY(float density READ density WRITE setDensity NOTIFY densityChanged)
29 Q_PROPERTY(bool depthEnabled READ isDepthEnabled WRITE setDepthEnabled NOTIFY depthEnabledChanged)
30 Q_PROPERTY(float depthNear READ depthNear WRITE setDepthNear NOTIFY depthNearChanged)
31 Q_PROPERTY(float depthFar READ depthFar WRITE setDepthFar NOTIFY depthFarChanged)
32 Q_PROPERTY(float depthCurve READ depthCurve WRITE setDepthCurve NOTIFY depthCurveChanged)
33 Q_PROPERTY(bool heightEnabled READ isHeightEnabled WRITE setHeightEnabled NOTIFY heightEnabledChanged)
34 Q_PROPERTY(float leastIntenseY READ leastIntenseY WRITE setLeastIntenseY NOTIFY leastIntenseYChanged)
35 Q_PROPERTY(float mostIntenseY READ mostIntenseY WRITE setMostIntenseY NOTIFY mostIntenseYChanged)
36 Q_PROPERTY(float heightCurve READ heightCurve WRITE setHeightCurve NOTIFY heightCurveChanged)
37 Q_PROPERTY(bool transmitEnabled READ isTransmitEnabled WRITE setTransmitEnabled NOTIFY transmitEnabledChanged)
38 Q_PROPERTY(float transmitCurve READ transmitCurve WRITE setTransmitCurve NOTIFY transmitCurveChanged)
39
40 QML_NAMED_ELEMENT(Fog)
41
42public:
43 bool isEnabled() const;
44 QColor color() const;
45 float density() const;
46 bool isDepthEnabled() const;
47 float depthNear() const;
48 float depthFar() const;
49 float depthCurve() const;
50 bool isHeightEnabled() const;
51 float leastIntenseY() const;
52 float mostIntenseY() const;
53 float heightCurve() const;
54 bool isTransmitEnabled() const;
55 float transmitCurve() const;
56
57public Q_SLOTS:
58 void setEnabled(bool newEnabled);
59 void setColor(const QColor &newColor);
60 void setDensity(float newDensity);
61 void setDepthEnabled(bool newDepthEnabled);
62 void setDepthNear(float newDepthNear);
63 void setDepthFar(float newDepthFar);
64 void setDepthCurve(float newDepthCurve);
65 void setHeightEnabled(bool newHeightEnabled);
66 void setLeastIntenseY(float newleastIntenseY);
67 void setMostIntenseY(float newmostIntenseY);
68 void setHeightCurve(float newHeightCurve);
69 void setTransmitEnabled(bool newTransmitEnabled);
70 void setTransmitCurve(float newTransmitCurve);
71
72Q_SIGNALS:
73 void changed();
74 void enabledChanged();
75 void colorChanged();
76 void densityChanged();
77 void depthEnabledChanged();
78 void depthNearChanged();
79 void depthFarChanged();
80 void depthCurveChanged();
81 void heightEnabledChanged();
82 void leastIntenseYChanged();
83 void mostIntenseYChanged();
84 void heightCurveChanged();
85 void transmitEnabledChanged();
86 void transmitCurveChanged();
87
88private:
89 bool m_enabled = false;
90 QColor m_color = QColor::fromRgbF(r: 0.5f, g: 0.6f, b: 0.7f, a: 1.0f);
91 float m_density = 1.0f;
92 bool m_depthEnabled = false;
93 float m_depthNear = 10.0f;
94 float m_depthFar = 1000.0f;
95 float m_depthCurve = 1.0f;
96 bool m_heightEnabled = false;
97 float m_leastIntenseY = 10.0f;
98 float m_mostIntenseY = 0.0f;
99 float m_heightCurve = 1.0f;
100 bool m_transmitEnabled = false;
101 float m_transmitCurve = 1.0f;
102};
103
104QT_END_NAMESPACE
105
106#endif // QQUICK3DFOG_P_H
107

source code of qtquick3d/src/quick3d/qquick3dfog_p.h