QGIS API Documentation  3.25.0-Master (10b47c2603)
Public Member Functions | List of all members
QgsPointLightSettings Class Reference

3 More...

#include <qgspointlightsettings.h>

Inheritance diagram for QgsPointLightSettings:
Inheritance graph
[legend]

Public Member Functions

 QgsPointLightSettings ()=default
 Construct a point light with default values. More...
 
QgsPointLightSettingsclone () const override
 Returns a copy of the light source. More...
 
QColor color () const
 Returns color of the light. More...
 
float constantAttenuation () const
 Returns constant attenuation (A_0) More...
 
Qt3DCore::QEntity * createEntity (const Qgs3DMapSettings &map, Qt3DCore::QEntity *parent) const override
 Creates an entity representing the light source. More...
 
float intensity () const
 Returns intensity of the light. More...
 
float linearAttenuation () const
 Returns linear attenuation (A_1) More...
 
bool operator== (const QgsPointLightSettings &other)
 
QgsVector3D position () const
 Returns position of the light (in 3D world coordinates) More...
 
float quadraticAttenuation () const
 Returns quadratic attenuation (A_2) More...
 
void readXml (const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext()) override
 Reads configuration from a DOM element previously written using writeXml(). More...
 
void setColor (const QColor &color)
 Sets color of the light. More...
 
void setConstantAttenuation (float value)
 Sets constant attenuation (A_0) More...
 
void setIntensity (float intensity)
 Sets intensity of the light. More...
 
void setLinearAttenuation (float value)
 Sets linear attenuation (A_1) More...
 
void setPosition (const QgsVector3D &pos)
 Sets position of the light (in 3D world coordinates) More...
 
void setQuadraticAttenuation (float value)
 Sets quadratic attenuation (A_2) More...
 
Qgis::LightSourceType type () const override
 Returns the light source type. More...
 
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const override
 Writes the light source's configuration to a new DOM element and returns it. More...
 
- 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. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsLightSource
static QgsLightSourcecreateFromXml (const QDomElement &element, const QgsReadWriteContext &context)
 Creates a new light source from an XML element. More...
 

Detailed Description

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.

Since
QGIS 3.6

Definition at line 39 of file qgspointlightsettings.h.

Constructor & Destructor Documentation

◆ QgsPointLightSettings()

QgsPointLightSettings::QgsPointLightSettings ( )
default

Construct a point light with default values.

Member Function Documentation

◆ clone()

QgsPointLightSettings * QgsPointLightSettings::clone ( ) const
overridevirtual

Returns a copy of the light source.

Implements QgsLightSource.

Definition at line 32 of file qgspointlightsettings.cpp.

◆ color()

QColor QgsPointLightSettings::color ( ) const
inline

Returns color of the light.

Definition at line 57 of file qgspointlightsettings.h.

◆ constantAttenuation()

float QgsPointLightSettings::constantAttenuation ( ) const
inline

Returns constant attenuation (A_0)

Definition at line 67 of file qgspointlightsettings.h.

◆ createEntity()

Qt3DCore::QEntity * QgsPointLightSettings::createEntity ( const Qgs3DMapSettings map,
Qt3DCore::QEntity *  parent 
) const
overridevirtual

Creates an entity representing the light source.

Implements QgsLightSource.

Definition at line 37 of file qgspointlightsettings.cpp.

◆ intensity()

float QgsPointLightSettings::intensity ( ) const
inline

Returns intensity of the light.

Definition at line 62 of file qgspointlightsettings.h.

◆ linearAttenuation()

float QgsPointLightSettings::linearAttenuation ( ) const
inline

Returns linear attenuation (A_1)

Definition at line 72 of file qgspointlightsettings.h.

◆ operator==()

bool QgsPointLightSettings::operator== ( const QgsPointLightSettings other)

Definition at line 113 of file qgspointlightsettings.cpp.

◆ position()

QgsVector3D QgsPointLightSettings::position ( ) const
inline

Returns position of the light (in 3D world coordinates)

Definition at line 52 of file qgspointlightsettings.h.

◆ quadraticAttenuation()

float QgsPointLightSettings::quadraticAttenuation ( ) const
inline

Returns quadratic attenuation (A_2)

Definition at line 77 of file qgspointlightsettings.h.

◆ readXml()

void QgsPointLightSettings::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context = QgsReadWriteContext() 
)
overridevirtual

Reads configuration from a DOM element previously written using writeXml().

See also
writeXml()

Implements QgsLightSource.

Definition at line 101 of file qgspointlightsettings.cpp.

◆ setColor()

void QgsPointLightSettings::setColor ( const QColor &  color)
inline

Sets color of the light.

Definition at line 59 of file qgspointlightsettings.h.

◆ setConstantAttenuation()

void QgsPointLightSettings::setConstantAttenuation ( float  value)
inline

Sets constant attenuation (A_0)

Definition at line 69 of file qgspointlightsettings.h.

◆ setIntensity()

void QgsPointLightSettings::setIntensity ( float  intensity)
inline

Sets intensity of the light.

Definition at line 64 of file qgspointlightsettings.h.

◆ setLinearAttenuation()

void QgsPointLightSettings::setLinearAttenuation ( float  value)
inline

Sets linear attenuation (A_1)

Definition at line 74 of file qgspointlightsettings.h.

◆ setPosition()

void QgsPointLightSettings::setPosition ( const QgsVector3D pos)
inline

Sets position of the light (in 3D world coordinates)

Definition at line 54 of file qgspointlightsettings.h.

◆ setQuadraticAttenuation()

void QgsPointLightSettings::setQuadraticAttenuation ( float  value)
inline

Sets quadratic attenuation (A_2)

Definition at line 79 of file qgspointlightsettings.h.

◆ type()

Qgis::LightSourceType QgsPointLightSettings::type ( ) const
overridevirtual

Returns the light source type.

Implements QgsLightSource.

Definition at line 27 of file qgspointlightsettings.cpp.

◆ writeXml()

QDomElement QgsPointLightSettings::writeXml ( QDomDocument &  doc,
const QgsReadWriteContext context = QgsReadWriteContext() 
) const
overridevirtual

Writes the light source's configuration to a new DOM element and returns it.

See also
readXml()

Implements QgsLightSource.

Definition at line 87 of file qgspointlightsettings.cpp.


The documentation for this class was generated from the following files: