Class: QgsPointLightSettings¶
- class qgis.3d.QgsPointLightSettings¶
Bases:
qgis._3d.QgsLightSource
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.
New in version 3.6.
QgsPointLightSettings() Construct a point light with default values
QgsPointLightSettings(
QgsPointLightSettings
)Methods
- rtype
QgsPointLightSettings
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)
- param elem
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)
- rtype
Qgis.LightSourceType
- param doc
- clone(self) QgsPointLightSettings ¶
- Return type
- 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, context: QgsReadWriteContext = QgsReadWriteContext())¶
- Parameters
elem (QDomElement) –
context (
QgsReadWriteContext
= QgsReadWriteContext()) –
- 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) –
- type(self) Qgis.LightSourceType ¶
- Return type
- writeXml(self, doc: QDomDocument, context: QgsReadWriteContext = QgsReadWriteContext()) QDomElement ¶
- Parameters
doc (QDomDocument) –
context (
QgsReadWriteContext
= QgsReadWriteContext()) –
- Return type
QDomElement