QGIS API Documentation 4.1.0-Master (ca2ac17535b)
Loading...
Searching...
No Matches
QgsShadowSettings Class Reference

Contains configuration for rendering shadows. More...

#include <qgsshadowsettings.h>

Public Member Functions

 QgsShadowSettings ()=default
 QgsShadowSettings (const QgsShadowSettings &other)
QString lightSource () const
 Returns the ID of the light source casting shadows.
double maximumShadowRenderingDistance () const
 Returns the maximum shadow rendering distance accounted for when rendering shadows Objects further away from the camera than the specified distance won't cast shadows This helps with producing a reasonable shadow resolution when looking at a large area or up to the sky.
QgsShadowSettingsoperator= (QgsShadowSettings const &rhs)
void readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads settings from a DOM element.
bool renderShadows () const
 Returns whether shadow rendering is enabled.
void setLightSource (const QString &id)
 Sets the id of the light source casting shadows.
void setMaximumShadowRenderingDistance (double distance)
 Sets the maximum shadow rendering distance accounted for when rendering shadows Objects further away from the camera than the specified distance won't cast shadows This helps with producing a reasonable shadow resolution when looking at a large area or up to the sky.
void setRenderShadows (bool enabled)
 Sets whether shadow rendering is enabled.
void setShadowBias (double shadowBias)
 Sets the shadow bias value Tweak this to reduce artifacts like self shadowing A reasonable range of values can be between a very small positive value like 0.00000001 and 0.1.
void setShadowQuality (Qgis::ShadowQuality quality)
 Sets the quality of the shadow map texture.
void setShowCascadeSplits (bool show)
 Sets whether the cascading shadow splits should be tinted in the view.
double shadowBias () const
 Returns the shadow bias used to correct the numerical imprecision of shadows (for the depth test) This helps with reducing the self shadowing artifact.
Qgis::ShadowQuality shadowQuality () const
 Returns the quality of the shadow map texture used to generate the shadows.
bool showCascadeSplits () const
 Returns true if the cascading shadow splits should be tinted in the view.
void writeXml (QDomElement &element, const QgsReadWriteContext &context) const
 Writes settings to a DOM element.

Static Public Member Functions

static int qualityToMapResolution (Qgis::ShadowQuality quality)
 Returns the shadow map resolution corresponding to the specified shadow quality.

Detailed Description

Contains configuration for rendering shadows.

Since
QGIS 3.16

Definition at line 36 of file qgsshadowsettings.h.

Constructor & Destructor Documentation

◆ QgsShadowSettings() [1/2]

QgsShadowSettings::QgsShadowSettings ( )
default

◆ QgsShadowSettings() [2/2]

QgsShadowSettings::QgsShadowSettings ( const QgsShadowSettings & other)

Definition at line 26 of file qgsshadowsettings.cpp.

Member Function Documentation

◆ lightSource()

QString QgsShadowSettings::lightSource ( ) const
inline

Returns the ID of the light source casting shadows.

See also
setLightSource()
Since
QGIS 4.2

Definition at line 57 of file qgsshadowsettings.h.

◆ maximumShadowRenderingDistance()

double QgsShadowSettings::maximumShadowRenderingDistance ( ) const
inline

Returns the maximum shadow rendering distance accounted for when rendering shadows Objects further away from the camera than the specified distance won't cast shadows This helps with producing a reasonable shadow resolution when looking at a large area or up to the sky.

Since
QGIS 3.16

Definition at line 65 of file qgsshadowsettings.h.

◆ operator=()

QgsShadowSettings & QgsShadowSettings::operator= ( QgsShadowSettings const & rhs)

Definition at line 35 of file qgsshadowsettings.cpp.

◆ qualityToMapResolution()

int QgsShadowSettings::qualityToMapResolution ( Qgis::ShadowQuality quality)
static

Returns the shadow map resolution corresponding to the specified shadow quality.

Since
QGIS 4.2

Definition at line 67 of file qgsshadowsettings.cpp.

◆ readXml()

void QgsShadowSettings::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )

Reads settings from a DOM element.

Definition at line 49 of file qgsshadowsettings.cpp.

◆ renderShadows()

bool QgsShadowSettings::renderShadows ( ) const
inline

Returns whether shadow rendering is enabled.

Definition at line 49 of file qgsshadowsettings.h.

◆ setLightSource()

void QgsShadowSettings::setLightSource ( const QString & id)
inline

Sets the id of the light source casting shadows.

See also
lightSource()
Since
QGIS 4.2

Definition at line 91 of file qgsshadowsettings.h.

◆ setMaximumShadowRenderingDistance()

void QgsShadowSettings::setMaximumShadowRenderingDistance ( double distance)
inline

Sets the maximum shadow rendering distance accounted for when rendering shadows Objects further away from the camera than the specified distance won't cast shadows This helps with producing a reasonable shadow resolution when looking at a large area or up to the sky.

Since
QGIS 3.16

Definition at line 99 of file qgsshadowsettings.h.

◆ setRenderShadows()

void QgsShadowSettings::setRenderShadows ( bool enabled)
inline

Sets whether shadow rendering is enabled.

Definition at line 83 of file qgsshadowsettings.h.

◆ setShadowBias()

void QgsShadowSettings::setShadowBias ( double shadowBias)
inline

Sets the shadow bias value Tweak this to reduce artifacts like self shadowing A reasonable range of values can be between a very small positive value like 0.00000001 and 0.1.

Since
QGIS 3.16

Definition at line 107 of file qgsshadowsettings.h.

◆ setShadowQuality()

void QgsShadowSettings::setShadowQuality ( Qgis::ShadowQuality quality)
inline

Sets the quality of the shadow map texture.

See also
shadowQuality()
Since
QGIS 4.2

Definition at line 115 of file qgsshadowsettings.h.

◆ setShowCascadeSplits()

void QgsShadowSettings::setShowCascadeSplits ( bool show)

Sets whether the cascading shadow splits should be tinted in the view.

For debugging and testing purposes only.

See also
showCascadeSplits()

Definition at line 90 of file qgsshadowsettings.cpp.

◆ shadowBias()

double QgsShadowSettings::shadowBias ( ) const
inline

Returns the shadow bias used to correct the numerical imprecision of shadows (for the depth test) This helps with reducing the self shadowing artifact.

Since
QGIS 3.16

Definition at line 72 of file qgsshadowsettings.h.

◆ shadowQuality()

Qgis::ShadowQuality QgsShadowSettings::shadowQuality ( ) const
inline

Returns the quality of the shadow map texture used to generate the shadows.

See also
setShadowQuality()
Since
QGIS 4.2

Definition at line 80 of file qgsshadowsettings.h.

◆ showCascadeSplits()

bool QgsShadowSettings::showCascadeSplits ( ) const

Returns true if the cascading shadow splits should be tinted in the view.

For debugging and testing purposes only.

See also
setShowCascadeSplits()

Definition at line 85 of file qgsshadowsettings.cpp.

◆ writeXml()

void QgsShadowSettings::writeXml ( QDomElement & element,
const QgsReadWriteContext & context ) const

Writes settings to a DOM element.

Definition at line 58 of file qgsshadowsettings.cpp.


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