QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsElevationShadingRenderer Class Reference

This class can render elevation shading on an image with different methods (eye dome lighting, hillshading, ...). More...

#include <qgselevationshadingrenderer.h>

Public Member Functions

 QgsElevationShadingRenderer ()
 
Qgis::ElevationMapCombineMethod combinedElevationMethod () const
 Returns the method used when conbining different elevation sources.
 
double eyeDomeLightingDistance () const
 Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
 
Qgis::RenderUnit eyeDomeLightingDistanceUnit () const
 Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance().
 
double eyeDomeLightingStrength () const
 Returns the strength of the eye dome lighting method.
 
double hillshadingZFactor () const
 Returns the z factor used by the hill shading method.
 
bool isActive () const
 Returns whether this shading renderer is active.
 
bool isActiveEyeDomeLighting () const
 Returns whether eye-dome lighting shading method is active.
 
bool isActiveHillshading () const
 Returns whether the hillshading is active.
 
bool isHillshadingMultidirectional () const
 Returns whether the hill shading method is multidirectional.
 
double lightAltitude () const
 Returns the altitude of the light (degree) that can be used by some methods (e.g.
 
double lightAzimuth () const
 Returns the azimuth of the light (degree) that can be used by some methods (e.g.
 
void readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads configuration from a DOM element.
 
void renderShading (const QgsElevationMap &elevation, QImage &image, const QgsRenderContext &context) const
 Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don't have same sizes, nothing happens.
 
void setActive (bool active)
 Sets whether this shading renderer is active.
 
void setActiveEyeDomeLighting (bool active)
 Sets active the eye-dome lighting shading method.
 
void setActiveHillshading (bool active)
 Sets active the hillshading.
 
void setCombinedElevationMethod (Qgis::ElevationMapCombineMethod method)
 Sets the method used when conbining different elevation sources.
 
void setEyeDomeLightingDistance (double distance)
 Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
 
void setEyeDomeLightingDistanceUnit (Qgis::RenderUnit unit)
 Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance().
 
void setEyeDomeLightingStrength (double strength)
 Sets the strength of the eye dome lighting method.
 
void setHillshadingMultidirectional (bool multiDirectional)
 Sets whether the hill shading method is multidirectional.
 
void setHillshadingZFactor (double zFactor)
 Sets the z factor used by the hill shading method.
 
void setLightAltitude (double lightAltitude)
 Sets the altitude of the light (degree) that can be used by some methods (e.g.
 
void setLightAzimuth (double lightAzimuth)
 Sets the azimuth of the light (degree) that can be used by some methods (e.g.
 
void writeXml (QDomElement &elem, const QgsReadWriteContext &context) const
 Writes configuration on a DOM element.
 

Detailed Description

This class can render elevation shading on an image with different methods (eye dome lighting, hillshading, ...).

An instance of this class supports the following settings:

To render shading on image the caller call renderShading() with the image and an elevation map (see QgsElevationMap()) as parameters. The shading is applied on the image in place. Elevation map and image must have same sizes.

Since
QGIS 3.30

Definition at line 47 of file qgselevationshadingrenderer.h.

Constructor & Destructor Documentation

◆ QgsElevationShadingRenderer()

QgsElevationShadingRenderer::QgsElevationShadingRenderer ( )

Definition at line 24 of file qgselevationshadingrenderer.cpp.

Member Function Documentation

◆ combinedElevationMethod()

Qgis::ElevationMapCombineMethod QgsElevationShadingRenderer::combinedElevationMethod ( ) const

Returns the method used when conbining different elevation sources.

See also
setCombinedElevationMethod()

Definition at line 165 of file qgselevationshadingrenderer.cpp.

◆ eyeDomeLightingDistance()

double QgsElevationShadingRenderer::eyeDomeLightingDistance ( ) const

Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

See also
setEyeDomeLightingDistance()

Definition at line 185 of file qgselevationshadingrenderer.cpp.

◆ eyeDomeLightingDistanceUnit()

Qgis::RenderUnit QgsElevationShadingRenderer::eyeDomeLightingDistanceUnit ( ) const

Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance().

See also
setEyeDomeLightingDistanceUnit()

Definition at line 175 of file qgselevationshadingrenderer.cpp.

◆ eyeDomeLightingStrength()

double QgsElevationShadingRenderer::eyeDomeLightingStrength ( ) const

Returns the strength of the eye dome lighting method.

See also
setEyeDomeLightingStrength()

Definition at line 195 of file qgselevationshadingrenderer.cpp.

◆ hillshadingZFactor()

double QgsElevationShadingRenderer::hillshadingZFactor ( ) const

Returns the z factor used by the hill shading method.

See also
setHillshadingZFactor()

Definition at line 70 of file qgselevationshadingrenderer.cpp.

◆ isActive()

bool QgsElevationShadingRenderer::isActive ( ) const

Returns whether this shading renderer is active.

Definition at line 45 of file qgselevationshadingrenderer.cpp.

◆ isActiveEyeDomeLighting()

bool QgsElevationShadingRenderer::isActiveEyeDomeLighting ( ) const

Returns whether eye-dome lighting shading method is active.

Definition at line 55 of file qgselevationshadingrenderer.cpp.

◆ isActiveHillshading()

bool QgsElevationShadingRenderer::isActiveHillshading ( ) const

Returns whether the hillshading is active.

Definition at line 65 of file qgselevationshadingrenderer.cpp.

◆ isHillshadingMultidirectional()

bool QgsElevationShadingRenderer::isHillshadingMultidirectional ( ) const

Returns whether the hill shading method is multidirectional.

See also
setHillshadingMultidirectional()

Definition at line 80 of file qgselevationshadingrenderer.cpp.

◆ lightAltitude()

double QgsElevationShadingRenderer::lightAltitude ( ) const

Returns the altitude of the light (degree) that can be used by some methods (e.g.

hill shading).

See also
setLightAltitude()

Definition at line 90 of file qgselevationshadingrenderer.cpp.

◆ lightAzimuth()

double QgsElevationShadingRenderer::lightAzimuth ( ) const

Returns the azimuth of the light (degree) that can be used by some methods (e.g.

hill shading).

See also
setLightAltitude()

Definition at line 100 of file qgselevationshadingrenderer.cpp.

◆ readXml()

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

Reads configuration from a DOM element.

Definition at line 129 of file qgselevationshadingrenderer.cpp.

◆ renderShading()

void QgsElevationShadingRenderer::renderShading ( const QgsElevationMap elevation,
QImage &  image,
const QgsRenderContext context 
) const

Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don't have same sizes, nothing happens.

Definition at line 28 of file qgselevationshadingrenderer.cpp.

◆ setActive()

void QgsElevationShadingRenderer::setActive ( bool  active)

Sets whether this shading renderer is active.

Definition at line 40 of file qgselevationshadingrenderer.cpp.

◆ setActiveEyeDomeLighting()

void QgsElevationShadingRenderer::setActiveEyeDomeLighting ( bool  active)

Sets active the eye-dome lighting shading method.

Definition at line 50 of file qgselevationshadingrenderer.cpp.

◆ setActiveHillshading()

void QgsElevationShadingRenderer::setActiveHillshading ( bool  active)

Sets active the hillshading.

Definition at line 60 of file qgselevationshadingrenderer.cpp.

◆ setCombinedElevationMethod()

void QgsElevationShadingRenderer::setCombinedElevationMethod ( Qgis::ElevationMapCombineMethod  method)

Sets the method used when conbining different elevation sources.

See also
combinedElevationMethod()

Definition at line 170 of file qgselevationshadingrenderer.cpp.

◆ setEyeDomeLightingDistance()

void QgsElevationShadingRenderer::setEyeDomeLightingDistance ( double  distance)

Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

See also
eyeDomeLightingDistance()

Definition at line 190 of file qgselevationshadingrenderer.cpp.

◆ setEyeDomeLightingDistanceUnit()

void QgsElevationShadingRenderer::setEyeDomeLightingDistanceUnit ( Qgis::RenderUnit  unit)

Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance().

See also
eyeDomeLightingDistanceUnit()

Definition at line 180 of file qgselevationshadingrenderer.cpp.

◆ setEyeDomeLightingStrength()

void QgsElevationShadingRenderer::setEyeDomeLightingStrength ( double  strength)

Sets the strength of the eye dome lighting method.

See also
eyeDomeLightingStrength()

Definition at line 200 of file qgselevationshadingrenderer.cpp.

◆ setHillshadingMultidirectional()

void QgsElevationShadingRenderer::setHillshadingMultidirectional ( bool  multiDirectional)

Sets whether the hill shading method is multidirectional.

See also
isHillshadingMultidirectional()

Definition at line 85 of file qgselevationshadingrenderer.cpp.

◆ setHillshadingZFactor()

void QgsElevationShadingRenderer::setHillshadingZFactor ( double  zFactor)

Sets the z factor used by the hill shading method.

See also
hillshadingZFactor()

Definition at line 75 of file qgselevationshadingrenderer.cpp.

◆ setLightAltitude()

void QgsElevationShadingRenderer::setLightAltitude ( double  lightAltitude)

Sets the altitude of the light (degree) that can be used by some methods (e.g.

hill shading).

See also
setLightAltitude()

Definition at line 95 of file qgselevationshadingrenderer.cpp.

◆ setLightAzimuth()

void QgsElevationShadingRenderer::setLightAzimuth ( double  lightAzimuth)

Sets the azimuth of the light (degree) that can be used by some methods (e.g.

hill shading).

See also
lightAzimuth()

Definition at line 105 of file qgselevationshadingrenderer.cpp.

◆ writeXml()

void QgsElevationShadingRenderer::writeXml ( QDomElement &  elem,
const QgsReadWriteContext context 
) const

Writes configuration on a DOM element.

Definition at line 110 of file qgselevationshadingrenderer.cpp.


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