QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
3 More...
#include <qgspointlightsettings.h>
Public Member Functions | |
QgsPointLightSettings ()=default | |
Construct a point light with default values. | |
QgsPointLightSettings * | clone () const override |
Returns a copy of the light source. | |
QColor | color () const |
Returns color of the light. | |
float | constantAttenuation () const |
Returns constant attenuation (A_0) | |
Qt3DCore::QEntity * | createEntity (const Qgs3DMapSettings &map, Qt3DCore::QEntity *parent) const override |
Creates an entity representing the light source. | |
float | intensity () const |
Returns intensity of the light. | |
float | linearAttenuation () const |
Returns linear attenuation (A_1) | |
bool | operator== (const QgsPointLightSettings &other) |
QgsVector3D | position () const |
Returns position of the light (in 3D world coordinates) | |
float | quadraticAttenuation () const |
Returns quadratic attenuation (A_2) | |
void | readXml (const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext()) override |
Reads configuration from a DOM element previously written using writeXml(). | |
void | setColor (const QColor &color) |
Sets color of the light. | |
void | setConstantAttenuation (float value) |
Sets constant attenuation (A_0) | |
void | setIntensity (float intensity) |
Sets intensity of the light. | |
void | setLinearAttenuation (float value) |
Sets linear attenuation (A_1) | |
void | setPosition (const QgsVector3D &pos) |
Sets position of the light (in 3D world coordinates) | |
void | setQuadraticAttenuation (float value) |
Sets quadratic attenuation (A_2) | |
Qgis::LightSourceType | type () const override |
Returns the light source type. | |
QDomElement | writeXml (QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const override |
Writes the light source's configuration to a new DOM element and returns it. | |
Public Member Functions inherited from QgsLightSource | |
virtual | ~QgsLightSource () |
virtual void | resolveReferences (const QgsProject &project) |
After reading from XML, resolve references to any layers that have been read as layer IDs. | |
Additional Inherited Members | |
Static Public Member Functions inherited from QgsLightSource | |
static QgsLightSource * | createFromXml (const QDomElement &element, const QgsReadWriteContext &context) |
Creates a new light source from an XML element. | |
3
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.
Definition at line 39 of file qgspointlightsettings.h.
|
default |
Construct a point light with default values.
|
overridevirtual |
Returns a copy of the light source.
Implements QgsLightSource.
Definition at line 33 of file qgspointlightsettings.cpp.
|
inline |
Returns color of the light.
Definition at line 57 of file qgspointlightsettings.h.
|
inline |
Returns constant attenuation (A_0)
Definition at line 67 of file qgspointlightsettings.h.
|
overridevirtual |
Creates an entity representing the light source.
Implements QgsLightSource.
Definition at line 38 of file qgspointlightsettings.cpp.
|
inline |
Returns intensity of the light.
Definition at line 62 of file qgspointlightsettings.h.
|
inline |
Returns linear attenuation (A_1)
Definition at line 72 of file qgspointlightsettings.h.
bool QgsPointLightSettings::operator== | ( | const QgsPointLightSettings & | other | ) |
Definition at line 114 of file qgspointlightsettings.cpp.
|
inline |
Returns position of the light (in 3D world coordinates)
Definition at line 52 of file qgspointlightsettings.h.
|
inline |
Returns quadratic attenuation (A_2)
Definition at line 77 of file qgspointlightsettings.h.
|
overridevirtual |
Reads configuration from a DOM element previously written using writeXml().
Implements QgsLightSource.
Definition at line 102 of file qgspointlightsettings.cpp.
|
inline |
Sets color of the light.
Definition at line 59 of file qgspointlightsettings.h.
|
inline |
Sets constant attenuation (A_0)
Definition at line 69 of file qgspointlightsettings.h.
|
inline |
Sets intensity of the light.
Definition at line 64 of file qgspointlightsettings.h.
|
inline |
Sets linear attenuation (A_1)
Definition at line 74 of file qgspointlightsettings.h.
|
inline |
Sets position of the light (in 3D world coordinates)
Definition at line 54 of file qgspointlightsettings.h.
|
inline |
Sets quadratic attenuation (A_2)
Definition at line 79 of file qgspointlightsettings.h.
|
overridevirtual |
Returns the light source type.
Implements QgsLightSource.
Definition at line 28 of file qgspointlightsettings.cpp.
|
overridevirtual |
Writes the light source's configuration to a new DOM element and returns it.
Implements QgsLightSource.
Definition at line 88 of file qgspointlightsettings.cpp.