QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
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.
 
QgsPointLightSettingsclone () 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 QgsLightSourcecreateFromXml (const QDomElement &element, const QgsReadWriteContext &context)
 Creates a new light source from an XML element.
 

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: