1
+ /* **************************************************************************
2
+ qgspointlightsettings.h
3
+ --------------------------------------
4
+ Date : November 2018
5
+ Copyright : (C) 2018 by Martin Dobias
6
+ Email : wonder dot sk at gmail dot com
7
+ ***************************************************************************
8
+ * *
9
+ * This program is free software; you can redistribute it and/or modify *
10
+ * it under the terms of the GNU General Public License as published by *
11
+ * the Free Software Foundation; either version 2 of the License, or *
12
+ * (at your option) any later version. *
13
+ * *
14
+ ***************************************************************************/
15
+
1
16
#ifndef QGSPOINTLIGHTSETTINGS_H
2
17
#define QGSPOINTLIGHTSETTINGS_H
3
18
@@ -10,6 +25,12 @@ class QDomElement;
10
25
/* *
11
26
* \ingroup 3d
12
27
* Definition of a point light in a 3D map scene
28
+ *
29
+ * Total light at the distance D from a point light with intensity I
30
+ * is (I / TA) where TA is total attenuation which is calculated as
31
+ * (A_0 + A_1 * D + A_2 * D^2). The terms A_0, A_1 and A_2 stand for
32
+ * constant, linear and quadratic attenuation.
33
+ *
13
34
* \since QGIS 3.6
14
35
*/
15
36
class QgsPointLightSettings
@@ -25,20 +46,26 @@ class QgsPointLightSettings
25
46
// ! Returns color of the light
26
47
QColor color () const { return mColor ; }
27
48
// ! Sets color of the light
28
- void setColor ( const QColor &c ) { mColor = c ; }
49
+ void setColor ( const QColor &color ) { mColor = color ; }
29
50
30
51
// ! Returns intensity of the light
31
52
float intensity () const { return mIntensity ; }
32
53
// ! Sets intensity of the light
33
54
void setIntensity ( float intensity ) { mIntensity = intensity; }
34
55
56
+ // ! Returns constant attenuation (A_0)
35
57
float constantAttenuation () const { return mConstantAttenuation ; }
58
+ // ! Sets constant attenuation (A_0)
36
59
void setConstantAttenuation ( float value ) { mConstantAttenuation = value; }
37
60
61
+ // ! Returns linear attenuation (A_1)
38
62
float linearAttenuation () const { return mLinearAttenuation ; }
63
+ // ! Sets linear attenuation (A_1)
39
64
void setLinearAttenuation ( float value ) { mLinearAttenuation = value; }
40
65
66
+ // ! Returns quadratic attenuation (A_2)
41
67
float quadraticAttenuation () const { return mQuadraticAttenuation ; }
68
+ // ! Sets quadratic attenuation (A_2)
42
69
void setQuadraticAttenuation ( float value ) { mQuadraticAttenuation = value; }
43
70
44
71
// ! Writes configuration to a new DOM element and returns it
0 commit comments