Class: QgsPointLightSettings¶
-
class
qgis.3d.
QgsPointLightSettings
¶ Bases:
sip.wrapper
Construct a point light with default values
QgsPointLightSettings(
QgsPointLightSettings
)Definition of a point light in a 3D map scene
Total light at the distance D from a point light with intensity I is (I / TA) where TA is total attenuation which is calculated as (A_0 + A_1 * D + A_2 * D^2). The terms A_0, A_1 and A_2 stand for constant, linear and quadratic attenuation.
Methods
Returns color of the light
Returns constant attenuation (A_0)
Returns intensity of the light
Returns linear attenuation (A_1)
Returns position of the light (in 3D world coordinates)
Returns quadratic attenuation (A_2)
Reads configuration from a DOM element previously written using
writeXml()
Sets color of the light
Sets constant attenuation (A_0)
Sets intensity of the light
Sets linear attenuation (A_1)
Sets position of the light (in 3D world coordinates)
Sets quadratic attenuation (A_2)
Writes configuration to a new DOM element and returns it
-
color
(self) → QColor¶ Returns color of the light
- Return type
QColor
-
constantAttenuation
(self) → float¶ Returns constant attenuation (A_0)
- Return type
float
-
intensity
(self) → float¶ Returns intensity of the light
- Return type
float
-
linearAttenuation
(self) → float¶ Returns linear attenuation (A_1)
- Return type
float
-
position
(self) → QgsVector3D¶ Returns position of the light (in 3D world coordinates)
- Return type
-
quadraticAttenuation
(self) → float¶ Returns quadratic attenuation (A_2)
- Return type
float
-
readXml
(self, elem: QDomElement)¶ Reads configuration from a DOM element previously written using
writeXml()
- Parameters
elem (QDomElement) –
-
setColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets color of the light
- Parameters
color (Union[QColor) –
-
setConstantAttenuation
(self, value: float)¶ Sets constant attenuation (A_0)
- Parameters
value (float) –
-
setIntensity
(self, intensity: float)¶ Sets intensity of the light
- Parameters
intensity (float) –
-
setLinearAttenuation
(self, value: float)¶ Sets linear attenuation (A_1)
- Parameters
value (float) –
-
setPosition
(self, pos: QgsVector3D)¶ Sets position of the light (in 3D world coordinates)
- Parameters
pos (QgsVector3D) –
-
setQuadraticAttenuation
(self, value: float)¶ Sets quadratic attenuation (A_2)
- Parameters
value (float) –
-
writeXml
(self, doc: QDomDocument) → QDomElement¶ Writes configuration to a new DOM element and returns it
- Parameters
doc (QDomDocument) –
- Return type
QDomElement
-