QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Signals | Public Member Functions | List of all members
Qgs3DMapSettings Class Reference

3 Definition of the world More...

#include <qgs3dmapsettings.h>

Inheritance diagram for Qgs3DMapSettings:
Inheritance graph
[legend]

Signals

void backgroundColorChanged ()
 Emitted when the background color has changed. More...
 
void directionalLightsChanged ()
 Emitted when the list of directional lights changes. More...
 
void fieldOfViewChanged ()
 Emitted when the camera lens field of view changes. More...
 
void layersChanged ()
 Emitted when the list of map layers for 3d rendering has changed. More...
 
void mapTileResolutionChanged ()
 Emitted when the map tile resoulution has changed. More...
 
void maxTerrainGroundErrorChanged ()
 Emitted when the maximum terrain ground error has changed. More...
 
void maxTerrainScreenErrorChanged ()
 Emitted when the maximum terrain screen error has changed. More...
 
void pointLightsChanged ()
 Emitted when the list of point lights changes. More...
 
void renderersChanged ()
 Emitted when the list of map's extra renderers have been modified. More...
 
void selectionColorChanged ()
 Emitted when the selection color has changed. More...
 
void shadowSettingsChanged ()
 Emitted when shadow rendering settings are changed. More...
 
void showCameraViewCenterChanged ()
 Emitted when the flag whether camera's view center is shown has changed. More...
 
void showLabelsChanged ()
 Emitted when the flag whether labels are displayed on terrain tiles has changed. More...
 
void showLightSourceOriginsChanged ()
 Emitted when the flag whether light source origins are shown has changed. More...
 
void showTerrainBoundingBoxesChanged ()
 Emitted when the flag whether terrain's bounding boxes are shown has changed. More...
 
void showTerrainTilesInfoChanged ()
 Emitted when the flag whether terrain's tile info is shown has changed. More...
 
void skyboxSettingsChanged ()
 Emitted when skybox settings are changed. More...
 
void terrainGeneratorChanged ()
 Emitted when the terrain generator has changed. More...
 
void terrainLayersChanged ()
 Emitted when the list of map layers for terrain texture has changed. More...
 
void terrainMapThemeChanged ()
 Emitted when terrain's map theme has changed. More...
 
void terrainShadingChanged ()
 Emitted when terrain shading enabled flag or terrain shading material has changed. More...
 
void terrainVerticalScaleChanged ()
 Emitted when the vertical scale of the terrain has changed. More...
 

Public Member Functions

 Qgs3DMapSettings ()=default
 Constructor for Qgs3DMapSettings. More...
 
 Qgs3DMapSettings (const Qgs3DMapSettings &other)
 Copy constructor. More...
 
 ~Qgs3DMapSettings () override
 
QColor backgroundColor () const
 Returns background color of the 3D map view. More...
 
QgsCoordinateReferenceSystem crs () const
 Returns coordinate reference system used in the 3D scene. More...
 
QList< QgsDirectionalLightSettingsdirectionalLights () const
 Returns list of directional lights defined in the scene. More...
 
float fieldOfView () const
 Returns the camera lens' field of view. More...
 
bool isSkyboxEnabled () const
 Returns whether the skybox is enabled. More...
 
bool isTerrainShadingEnabled () const
 Returns whether terrain shading is enabled. More...
 
QList< QgsMapLayer * > layers () const
 Returns the list of 3D map layers to be rendered in the scene. More...
 
QgsMapThemeCollectionmapThemeCollection () const
 Returns pointer to the collection of map themes. More...
 
int mapTileResolution () const
 Returns resolution (in pixels) of the texture of a terrain tile. More...
 
QgsVector3D mapToWorldCoordinates (const QgsVector3D &mapCoords) const
 Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y)) More...
 
float maxTerrainGroundError () const
 Returns maximum ground error of terrain tiles in world units. More...
 
float maxTerrainScreenError () const
 Returns maximum allowed screen error of terrain tiles in pixels. More...
 
Qgs3DMapSettingsoperator= (Qgs3DMapSettings const &)=delete
 
QgsVector3D origin () const
 Returns coordinates in map CRS at which 3D scene has origin (0,0,0) More...
 
double outputDpi () const
 Returns DPI used for conversion between real world units (e.g. More...
 
const QgsPathResolverpathResolver () const
 Returns the path resolver for conversion between relative and absolute paths during rendering operations, e.g. More...
 
QList< QgsPointLightSettingspointLights () const
 Returns list of point lights defined in the scene. More...
 
void readXml (const QDomElement &elem, const QgsReadWriteContext &context)
 Reads configuration from a DOM element previously written by writeXml() More...
 
QList< QgsAbstract3DRenderer * > renderers () const
 Returns list of extra 3D renderers. More...
 
void resolveReferences (const QgsProject &project)
 Resolves references to other objects (map layers) after the call to readXml() More...
 
QColor selectionColor () const
 Returns color used for selected features. More...
 
void setBackgroundColor (const QColor &color)
 Sets background color of the 3D map view. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets coordinate reference system used in the 3D scene. More...
 
void setDirectionalLights (const QList< QgsDirectionalLightSettings > &directionalLights)
 Sets list of directional lights defined in the scene. More...
 
void setFieldOfView (const float fieldOfView)
 Sets the camera lens' field of view. More...
 
void setIsSkyboxEnabled (bool enabled)
 Sets whether the skybox is enabled. More...
 
void setLayers (const QList< QgsMapLayer * > &layers)
 Sets the list of 3D map layers to be rendered in the scene. More...
 
void setMapThemeCollection (QgsMapThemeCollection *mapThemes)
 Sets pointer to the collection of map themes. More...
 
void setMapTileResolution (int res)
 Sets resolution (in pixels) of the texture of a terrain tile. More...
 
void setMaxTerrainGroundError (float error)
 Returns maximum ground error of terrain tiles in world units. More...
 
void setMaxTerrainScreenError (float error)
 Sets maximum allowed screen error of terrain tiles in pixels. More...
 
void setOrigin (const QgsVector3D &origin)
 Sets coordinates in map CRS at which our 3D world has origin (0,0,0) More...
 
void setOutputDpi (const double dpi)
 Sets DPI used for conversion between real world units (e.g. More...
 
void setPathResolver (const QgsPathResolver &resolver)
 Sets the path resolver for conversion between relative and absolute paths during rendering operations, e.g. More...
 
void setPointLights (const QList< QgsPointLightSettings > &pointLights)
 Sets list of point lights defined in the scene. More...
 
void setRenderers (const QList< QgsAbstract3DRenderer * > &renderers)
 Sets list of extra 3D renderers to use in the scene. Takes ownership of the objects. More...
 
void setSelectionColor (const QColor &color)
 Sets color used for selected features. More...
 
void setShadowSettings (const QgsShadowSettings &shadowSettings)
 Sets the current configuration of shadow rendering. More...
 
void setShowCameraViewCenter (bool enabled)
 Sets whether to show camera's view center as a sphere (for debugging) More...
 
void setShowLabels (bool enabled)
 Sets whether to display labels on terrain tiles. More...
 
void setShowLightSourceOrigins (bool enabled)
 Sets whether to show light source origins as a sphere (for debugging) More...
 
void setShowTerrainBoundingBoxes (bool enabled)
 Sets whether to display bounding boxes of terrain tiles (for debugging) More...
 
void setShowTerrainTilesInfo (bool enabled)
 Sets whether to display extra tile info on top of terrain tiles (for debugging) More...
 
void setSkyboxSettings (const QgsSkyboxSettings &skyboxSettings)
 Sets the current configuration of the skybox. More...
 
void setTerrainGenerator (QgsTerrainGenerator *gen)
 Sets terrain generator. More...
 
void setTerrainLayers (const QList< QgsMapLayer * > &layers)
 Sets the list of 2d map layers to be rendered in the terrain. More...
 
void setTerrainMapTheme (const QString &theme)
 Sets name of the map theme. More...
 
void setTerrainShadingEnabled (bool enabled)
 Sets whether terrain shading is enabled. More...
 
void setTerrainShadingMaterial (const QgsPhongMaterialSettings &material)
 Sets terrain shading material. More...
 
void setTerrainVerticalScale (double zScale)
 Sets vertical scale (exaggeration) of terrain (1 = true scale, > 1 = hills get more pronounced) More...
 
void setTransformContext (const QgsCoordinateTransformContext &context)
 Sets the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system. More...
 
QgsShadowSettings shadowSettings () const
 Returns the current configuration of shadows. More...
 
bool showCameraViewCenter () const
 Returns whether to show camera's view center as a sphere (for debugging) More...
 
bool showLabels () const
 Returns whether to display labels on terrain tiles. More...
 
bool showLightSourceOrigins () const
 Returns whether to show light source origins as a sphere (for debugging) More...
 
bool showTerrainBoundingBoxes () const
 Returns whether to display bounding boxes of terrain tiles (for debugging) More...
 
bool showTerrainTilesInfo () const
 Returns whether to display extra tile info on top of terrain tiles (for debugging) More...
 
QgsSkyboxSettings skyboxSettings () const
 Returns the current configuration of the skybox. More...
 
QgsTerrainGeneratorterrainGenerator () const
 Returns terrain generator. It takes care of producing terrain tiles from the input data. More...
 
QList< QgsMapLayer * > terrainLayers () const
 Returns the list of map layers to be rendered as a texture of the terrain. More...
 
QString terrainMapTheme () const
 Returns name of the map theme (from the active project) that will be used for terrain's texture. More...
 
QgsPhongMaterialSettings terrainShadingMaterial () const
 Returns terrain shading material. More...
 
double terrainVerticalScale () const
 Returns vertical scale (exaggeration) of terrain. More...
 
QgsCoordinateTransformContext transformContext () const
 Returns the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system. More...
 
QgsVector3D worldToMapCoordinates (const QgsVector3D &worldCoords) const
 Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y)) More...
 
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const
 Writes configuration to a DOM element, to be used later with readXml() More...
 
- Public Member Functions inherited from QgsTemporalRangeObject
 QgsTemporalRangeObject (bool enabled=false)
 Constructor QgsTemporalRangeObject. More...
 
virtual ~QgsTemporalRangeObject ()=default
 
bool isTemporal () const
 Returns true if the object's temporal range is enabled, and the object will be filtered when rendering maps with a specific time range set. More...
 
void setIsTemporal (bool enabled)
 Sets whether the temporal range is enabled (i.e. More...
 
void setTemporalRange (const QgsDateTimeRange &range)
 Sets the temporal range for the object. More...
 
const QgsDateTimeRange & temporalRange () const
 Returns the datetime range for the object. More...
 

Detailed Description

3 Definition of the world

Since
QGIS 3.0

Definition at line 53 of file qgs3dmapsettings.h.

Constructor & Destructor Documentation

◆ Qgs3DMapSettings() [1/2]

Qgs3DMapSettings::Qgs3DMapSettings ( )
default

Constructor for Qgs3DMapSettings.

◆ Qgs3DMapSettings() [2/2]

Qgs3DMapSettings::Qgs3DMapSettings ( const Qgs3DMapSettings other)

Copy constructor.

Definition at line 32 of file qgs3dmapsettings.cpp.

◆ ~Qgs3DMapSettings()

Qgs3DMapSettings::~Qgs3DMapSettings ( )
override

Definition at line 71 of file qgs3dmapsettings.cpp.

Member Function Documentation

◆ backgroundColor()

QColor Qgs3DMapSettings::backgroundColor ( ) const

Returns background color of the 3D map view.

Definition at line 411 of file qgs3dmapsettings.cpp.

◆ backgroundColorChanged

void Qgs3DMapSettings::backgroundColorChanged ( )
signal

Emitted when the background color has changed.

◆ crs()

QgsCoordinateReferenceSystem Qgs3DMapSettings::crs ( ) const
inline

Returns coordinate reference system used in the 3D scene.

Definition at line 96 of file qgs3dmapsettings.h.

◆ directionalLights()

QList<QgsDirectionalLightSettings> Qgs3DMapSettings::directionalLights ( ) const
inline

Returns list of directional lights defined in the scene.

Since
QGIS 3.16

Definition at line 375 of file qgs3dmapsettings.h.

◆ directionalLightsChanged

void Qgs3DMapSettings::directionalLightsChanged ( )
signal

Emitted when the list of directional lights changes.

Since
QGIS 3.16

◆ fieldOfView()

float Qgs3DMapSettings::fieldOfView ( ) const
inline

Returns the camera lens' field of view.

Since
QGIS 3.8

Definition at line 393 of file qgs3dmapsettings.h.

◆ fieldOfViewChanged

void Qgs3DMapSettings::fieldOfViewChanged ( )
signal

Emitted when the camera lens field of view changes.

Since
QGIS 3.8

◆ isSkyboxEnabled()

bool Qgs3DMapSettings::isSkyboxEnabled ( ) const
inline

Returns whether the skybox is enabled.

See also
setIsSkyboxEnabled()
Since
QGIS 3.16

Definition at line 445 of file qgs3dmapsettings.h.

◆ isTerrainShadingEnabled()

bool Qgs3DMapSettings::isTerrainShadingEnabled ( ) const
inline

Returns whether terrain shading is enabled.

When enabled, in addition to the terrain texture generated from the map, the terrain rendering will take into account position of the lights, terrain normals and terrain shading material (ambient and specular colors, shininess).

Since
QGIS 3.6

Definition at line 287 of file qgs3dmapsettings.h.

◆ layers()

QList< QgsMapLayer * > Qgs3DMapSettings::layers ( ) const

Returns the list of 3D map layers to be rendered in the scene.

This setting dictates which layers are to be rendered using their 3D rendering configuration, if available.

Note
Layers which are rendered as part of the map terrain are retrieved via terrainLayers().
See also
setLayers()
layersChanged()
terrainLayers()

Definition at line 460 of file qgs3dmapsettings.cpp.

◆ layersChanged

void Qgs3DMapSettings::layersChanged ( )
signal

Emitted when the list of map layers for 3d rendering has changed.

See also
setLayers()
layers()
terrainLayersChanged()

◆ mapThemeCollection()

QgsMapThemeCollection* Qgs3DMapSettings::mapThemeCollection ( ) const
inline

Returns pointer to the collection of map themes.

Normally this would be QgsProject::mapThemeCollection() of the currently used project. Without a valid map theme collection object it is not possible to resolve map themes from their names.

Since
QGIS 3.6

Definition at line 140 of file qgs3dmapsettings.h.

◆ mapTileResolution()

int Qgs3DMapSettings::mapTileResolution ( ) const

Returns resolution (in pixels) of the texture of a terrain tile.

This parameter influences how many zoom levels for terrain tiles there will be (together with maxTerrainGroundError())

Definition at line 509 of file qgs3dmapsettings.cpp.

◆ mapTileResolutionChanged

void Qgs3DMapSettings::mapTileResolutionChanged ( )
signal

Emitted when the map tile resoulution has changed.

◆ mapToWorldCoordinates()

QgsVector3D Qgs3DMapSettings::mapToWorldCoordinates ( const QgsVector3D mapCoords) const

Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y))

Definition at line 377 of file qgs3dmapsettings.cpp.

◆ maxTerrainGroundError()

float Qgs3DMapSettings::maxTerrainGroundError ( ) const

Returns maximum ground error of terrain tiles in world units.

This parameter influences how many zoom levels there will be (together with mapTileResolution()). This value tells that when the given ground error is reached (e.g. 10 meters), it makes no sense to further split terrain tiles into finer ones because they will not add extra details anymore.

Definition at line 537 of file qgs3dmapsettings.cpp.

◆ maxTerrainGroundErrorChanged

void Qgs3DMapSettings::maxTerrainGroundErrorChanged ( )
signal

Emitted when the maximum terrain ground error has changed.

◆ maxTerrainScreenError()

float Qgs3DMapSettings::maxTerrainScreenError ( ) const

Returns maximum allowed screen error of terrain tiles in pixels.

This parameter decides how aggressively less detailed terrain tiles are swapped to more detailed ones as camera gets closer. Each tile has its error defined in world units - this error gets projected to screen pixels according to camera view and if the tile's error is greater than the allowed error, it will be swapped by more detailed tiles with lower error.

Definition at line 523 of file qgs3dmapsettings.cpp.

◆ maxTerrainScreenErrorChanged

void Qgs3DMapSettings::maxTerrainScreenErrorChanged ( )
signal

Emitted when the maximum terrain screen error has changed.

◆ operator=()

Qgs3DMapSettings& Qgs3DMapSettings::operator= ( Qgs3DMapSettings const &  )
delete

◆ origin()

QgsVector3D Qgs3DMapSettings::origin ( ) const
inline

Returns coordinates in map CRS at which 3D scene has origin (0,0,0)

Definition at line 86 of file qgs3dmapsettings.h.

◆ outputDpi()

double Qgs3DMapSettings::outputDpi ( ) const
inline

Returns DPI used for conversion between real world units (e.g.

mm) and pixels Default value is 96

Since
QGIS 3.10

Definition at line 414 of file qgs3dmapsettings.h.

◆ pathResolver()

const QgsPathResolver& Qgs3DMapSettings::pathResolver ( ) const
inline

Returns the path resolver for conversion between relative and absolute paths during rendering operations, e.g.

for resolving relative symbol paths.

See also
setPathResolver()
Since
QGIS 3.0

Definition at line 123 of file qgs3dmapsettings.h.

◆ pointLights()

QList<QgsPointLightSettings> Qgs3DMapSettings::pointLights ( ) const
inline

Returns list of point lights defined in the scene.

Since
QGIS 3.6

Definition at line 369 of file qgs3dmapsettings.h.

◆ pointLightsChanged

void Qgs3DMapSettings::pointLightsChanged ( )
signal

Emitted when the list of point lights changes.

Since
QGIS 3.6

◆ readXml()

void Qgs3DMapSettings::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context 
)

Reads configuration from a DOM element previously written by writeXml()

Definition at line 76 of file qgs3dmapsettings.cpp.

◆ renderers()

QList<QgsAbstract3DRenderer *> Qgs3DMapSettings::renderers ( ) const
inline

Returns list of extra 3D renderers.

Definition at line 325 of file qgs3dmapsettings.h.

◆ renderersChanged

void Qgs3DMapSettings::renderersChanged ( )
signal

Emitted when the list of map's extra renderers have been modified.

Since
QGIS 3.10

◆ resolveReferences()

void Qgs3DMapSettings::resolveReferences ( const QgsProject project)

Resolves references to other objects (map layers) after the call to readXml()

Definition at line 355 of file qgs3dmapsettings.cpp.

◆ selectionColor()

QColor Qgs3DMapSettings::selectionColor ( ) const

Returns color used for selected features.

Definition at line 425 of file qgs3dmapsettings.cpp.

◆ selectionColorChanged

void Qgs3DMapSettings::selectionColorChanged ( )
signal

Emitted when the selection color has changed.

◆ setBackgroundColor()

void Qgs3DMapSettings::setBackgroundColor ( const QColor &  color)

Sets background color of the 3D map view.

Definition at line 402 of file qgs3dmapsettings.cpp.

◆ setCrs()

void Qgs3DMapSettings::setCrs ( const QgsCoordinateReferenceSystem crs)

Sets coordinate reference system used in the 3D scene.

Definition at line 387 of file qgs3dmapsettings.cpp.

◆ setDirectionalLights()

void Qgs3DMapSettings::setDirectionalLights ( const QList< QgsDirectionalLightSettings > &  directionalLights)

Sets list of directional lights defined in the scene.

Since
QGIS 3.16

Definition at line 638 of file qgs3dmapsettings.cpp.

◆ setFieldOfView()

void Qgs3DMapSettings::setFieldOfView ( const float  fieldOfView)

Sets the camera lens' field of view.

Since
QGIS 3.8

Definition at line 647 of file qgs3dmapsettings.cpp.

◆ setIsSkyboxEnabled()

void Qgs3DMapSettings::setIsSkyboxEnabled ( bool  enabled)
inline

Sets whether the skybox is enabled.

See also
isSkyboxEnabled()
Since
QGIS 3.16

Definition at line 452 of file qgs3dmapsettings.h.

◆ setLayers()

void Qgs3DMapSettings::setLayers ( const QList< QgsMapLayer * > &  layers)

Sets the list of 3D map layers to be rendered in the scene.

This setting dictates which layers are to be rendered using their 3D rendering configuration, if available.

Note
Layers which are rendered as part of the map terrain are specified via setTerrainLayers().
See also
layers()
layersChanged()
setTerrainLayers()

Definition at line 444 of file qgs3dmapsettings.cpp.

◆ setMapThemeCollection()

void Qgs3DMapSettings::setMapThemeCollection ( QgsMapThemeCollection mapThemes)
inline

Sets pointer to the collection of map themes.

See also
mapThemeCollection()
Since
QGIS 3.6

Definition at line 147 of file qgs3dmapsettings.h.

◆ setMapTileResolution()

void Qgs3DMapSettings::setMapTileResolution ( int  res)

Sets resolution (in pixels) of the texture of a terrain tile.

See also
mapTileResolution()

Definition at line 500 of file qgs3dmapsettings.cpp.

◆ setMaxTerrainGroundError()

void Qgs3DMapSettings::setMaxTerrainGroundError ( float  error)

Returns maximum ground error of terrain tiles in world units.

See also
maxTerrainGroundError()

Definition at line 528 of file qgs3dmapsettings.cpp.

◆ setMaxTerrainScreenError()

void Qgs3DMapSettings::setMaxTerrainScreenError ( float  error)

Sets maximum allowed screen error of terrain tiles in pixels.

See also
maxTerrainScreenError()

Definition at line 514 of file qgs3dmapsettings.cpp.

◆ setOrigin()

void Qgs3DMapSettings::setOrigin ( const QgsVector3D origin)
inline

Sets coordinates in map CRS at which our 3D world has origin (0,0,0)

We move the 3D world origin to the center of the extent of our terrain: this is done to minimize the impact of numerical errors when operating with 32-bit floats. Unfortunately this is not enough when working with a large area (still results in jitter with scenes spanning hundreds of kilometers and zooming in a lot).

Need to look into more advanced techniques like "relative to center" or "relative to eye" to improve the precision.

Definition at line 84 of file qgs3dmapsettings.h.

◆ setOutputDpi()

void Qgs3DMapSettings::setOutputDpi ( const double  dpi)
inline

Sets DPI used for conversion between real world units (e.g.

mm) and pixels

Parameters
dpithe number of dot per inch
Since
QGIS 3.10

Definition at line 406 of file qgs3dmapsettings.h.

◆ setPathResolver()

void Qgs3DMapSettings::setPathResolver ( const QgsPathResolver resolver)
inline

Sets the path resolver for conversion between relative and absolute paths during rendering operations, e.g.

for resolving relative symbol paths.

See also
pathResolver()
Since
QGIS 3.0

Definition at line 132 of file qgs3dmapsettings.h.

◆ setPointLights()

void Qgs3DMapSettings::setPointLights ( const QList< QgsPointLightSettings > &  pointLights)

Sets list of point lights defined in the scene.

Since
QGIS 3.6

Definition at line 629 of file qgs3dmapsettings.cpp.

◆ setRenderers()

void Qgs3DMapSettings::setRenderers ( const QList< QgsAbstract3DRenderer * > &  renderers)

Sets list of extra 3D renderers to use in the scene. Takes ownership of the objects.

Definition at line 575 of file qgs3dmapsettings.cpp.

◆ setSelectionColor()

void Qgs3DMapSettings::setSelectionColor ( const QColor &  color)

Sets color used for selected features.

Definition at line 416 of file qgs3dmapsettings.cpp.

◆ setShadowSettings()

void Qgs3DMapSettings::setShadowSettings ( const QgsShadowSettings shadowSettings)

Sets the current configuration of shadow rendering.

Since
QGIS 3.16

Definition at line 662 of file qgs3dmapsettings.cpp.

◆ setShowCameraViewCenter()

void Qgs3DMapSettings::setShowCameraViewCenter ( bool  enabled)

Sets whether to show camera's view center as a sphere (for debugging)

Since
QGIS 3.4

Definition at line 602 of file qgs3dmapsettings.cpp.

◆ setShowLabels()

void Qgs3DMapSettings::setShowLabels ( bool  enabled)

Sets whether to display labels on terrain tiles.

Definition at line 620 of file qgs3dmapsettings.cpp.

◆ setShowLightSourceOrigins()

void Qgs3DMapSettings::setShowLightSourceOrigins ( bool  enabled)

Sets whether to show light source origins as a sphere (for debugging)

Since
QGIS 3.16

Definition at line 611 of file qgs3dmapsettings.cpp.

◆ setShowTerrainBoundingBoxes()

void Qgs3DMapSettings::setShowTerrainBoundingBoxes ( bool  enabled)

Sets whether to display bounding boxes of terrain tiles (for debugging)

Definition at line 584 of file qgs3dmapsettings.cpp.

◆ setShowTerrainTilesInfo()

void Qgs3DMapSettings::setShowTerrainTilesInfo ( bool  enabled)

Sets whether to display extra tile info on top of terrain tiles (for debugging)

Definition at line 593 of file qgs3dmapsettings.cpp.

◆ setSkyboxSettings()

void Qgs3DMapSettings::setSkyboxSettings ( const QgsSkyboxSettings skyboxSettings)

Sets the current configuration of the skybox.

Since
QGIS 3.16

Definition at line 656 of file qgs3dmapsettings.cpp.

◆ setTerrainGenerator()

void Qgs3DMapSettings::setTerrainGenerator ( QgsTerrainGenerator gen)

Sets terrain generator.

It takes care of producing terrain tiles from the input data. Takes ownership of the generator

Definition at line 542 of file qgs3dmapsettings.cpp.

◆ setTerrainLayers()

void Qgs3DMapSettings::setTerrainLayers ( const QList< QgsMapLayer * > &  layers)

Sets the list of 2d map layers to be rendered in the terrain.

Note
Layers which are rendered as 3D layers as part of the scene are specified via setLayers().
If terrainMapTheme() is set, it has a priority over the list of layers specified here.
See also
terrainLayers()
terrainLayersChanged()
setLayers()
Since
QGIS 3.16

Definition at line 472 of file qgs3dmapsettings.cpp.

◆ setTerrainMapTheme()

void Qgs3DMapSettings::setTerrainMapTheme ( const QString &  theme)

Sets name of the map theme.

See also
terrainMapTheme()
Since
QGIS 3.6

Definition at line 566 of file qgs3dmapsettings.cpp.

◆ setTerrainShadingEnabled()

void Qgs3DMapSettings::setTerrainShadingEnabled ( bool  enabled)

Sets whether terrain shading is enabled.

See also
isTerrainShadingEnabled()
Since
QGIS 3.6

Definition at line 548 of file qgs3dmapsettings.cpp.

◆ setTerrainShadingMaterial()

void Qgs3DMapSettings::setTerrainShadingMaterial ( const QgsPhongMaterialSettings material)

Sets terrain shading material.

See also
terrainShadingMaterial()
Since
QGIS 3.6

Definition at line 557 of file qgs3dmapsettings.cpp.

◆ setTerrainVerticalScale()

void Qgs3DMapSettings::setTerrainVerticalScale ( double  zScale)

Sets vertical scale (exaggeration) of terrain (1 = true scale, > 1 = hills get more pronounced)

Definition at line 430 of file qgs3dmapsettings.cpp.

◆ setTransformContext()

void Qgs3DMapSettings::setTransformContext ( const QgsCoordinateTransformContext context)

Sets the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.

See also
transformContext()

Definition at line 397 of file qgs3dmapsettings.cpp.

◆ shadowSettings()

QgsShadowSettings Qgs3DMapSettings::shadowSettings ( ) const
inline

Returns the current configuration of shadows.

Returns
QGIS 3.16

Definition at line 426 of file qgs3dmapsettings.h.

◆ shadowSettingsChanged

void Qgs3DMapSettings::shadowSettingsChanged ( )
signal

Emitted when shadow rendering settings are changed.

Since
QGIS 3.16

◆ showCameraViewCenter()

bool Qgs3DMapSettings::showCameraViewCenter ( ) const
inline

Returns whether to show camera's view center as a sphere (for debugging)

Since
QGIS 3.4

Definition at line 346 of file qgs3dmapsettings.h.

◆ showCameraViewCenterChanged

void Qgs3DMapSettings::showCameraViewCenterChanged ( )
signal

Emitted when the flag whether camera's view center is shown has changed.

Since
QGIS 3.4

◆ showLabels()

bool Qgs3DMapSettings::showLabels ( ) const
inline

Returns whether to display labels on terrain tiles.

Definition at line 363 of file qgs3dmapsettings.h.

◆ showLabelsChanged

void Qgs3DMapSettings::showLabelsChanged ( )
signal

Emitted when the flag whether labels are displayed on terrain tiles has changed.

◆ showLightSourceOrigins()

bool Qgs3DMapSettings::showLightSourceOrigins ( ) const
inline

Returns whether to show light source origins as a sphere (for debugging)

Since
QGIS 3.16

Definition at line 358 of file qgs3dmapsettings.h.

◆ showLightSourceOriginsChanged

void Qgs3DMapSettings::showLightSourceOriginsChanged ( )
signal

Emitted when the flag whether light source origins are shown has changed.

Since
QGIS 3.15

◆ showTerrainBoundingBoxes()

bool Qgs3DMapSettings::showTerrainBoundingBoxes ( ) const
inline

Returns whether to display bounding boxes of terrain tiles (for debugging)

Definition at line 330 of file qgs3dmapsettings.h.

◆ showTerrainBoundingBoxesChanged

void Qgs3DMapSettings::showTerrainBoundingBoxesChanged ( )
signal

Emitted when the flag whether terrain's bounding boxes are shown has changed.

◆ showTerrainTilesInfo()

bool Qgs3DMapSettings::showTerrainTilesInfo ( ) const
inline

Returns whether to display extra tile info on top of terrain tiles (for debugging)

Definition at line 334 of file qgs3dmapsettings.h.

◆ showTerrainTilesInfoChanged

void Qgs3DMapSettings::showTerrainTilesInfoChanged ( )
signal

Emitted when the flag whether terrain's tile info is shown has changed.

◆ skyboxSettings()

QgsSkyboxSettings Qgs3DMapSettings::skyboxSettings ( ) const
inline

Returns the current configuration of the skybox.

Since
QGIS 3.16

Definition at line 420 of file qgs3dmapsettings.h.

◆ skyboxSettingsChanged

void Qgs3DMapSettings::skyboxSettingsChanged ( )
signal

Emitted when skybox settings are changed.

Since
QGIS 3.16

◆ terrainGenerator()

QgsTerrainGenerator* Qgs3DMapSettings::terrainGenerator ( ) const
inline

Returns terrain generator. It takes care of producing terrain tiles from the input data.

Definition at line 272 of file qgs3dmapsettings.h.

◆ terrainGeneratorChanged

void Qgs3DMapSettings::terrainGeneratorChanged ( )
signal

Emitted when the terrain generator has changed.

◆ terrainLayers()

QList< QgsMapLayer * > Qgs3DMapSettings::terrainLayers ( ) const

Returns the list of map layers to be rendered as a texture of the terrain.

Note
Layers which are rendered as 3D layers as part of the scene are retrieved via layers().
If terrainMapTheme() is set, it has a priority over the list of layers returned here.
See also
setTerrainLayers()
terrainLayersChanged()
layers()
Since
QGIS 3.16

Definition at line 488 of file qgs3dmapsettings.cpp.

◆ terrainLayersChanged

void Qgs3DMapSettings::terrainLayersChanged ( )
signal

Emitted when the list of map layers for terrain texture has changed.

See also
terrainLayers()
setTerrainLayers()
layersChanged()
Since
QGIS 3.16

◆ terrainMapTheme()

QString Qgs3DMapSettings::terrainMapTheme ( ) const
inline

Returns name of the map theme (from the active project) that will be used for terrain's texture.

Empty map theme name means that the map theme is not overridden and the current map theme will be used.

Note
Support for map themes only works if mapThemeCollection() is a valid object (otherwise it is not possible to resolve map themes from names)
Since
QGIS 3.6

Definition at line 316 of file qgs3dmapsettings.h.

◆ terrainMapThemeChanged

void Qgs3DMapSettings::terrainMapThemeChanged ( )
signal

Emitted when terrain's map theme has changed.

Since
QGIS 3.6

◆ terrainShadingChanged

void Qgs3DMapSettings::terrainShadingChanged ( )
signal

Emitted when terrain shading enabled flag or terrain shading material has changed.

Since
QGIS 3.6

◆ terrainShadingMaterial()

QgsPhongMaterialSettings Qgs3DMapSettings::terrainShadingMaterial ( ) const
inline

Returns terrain shading material.

Diffuse color component is ignored since the diffuse component is provided by 2D rendered map texture. Only used when isTerrainShadingEnabled() is true.

Since
QGIS 3.6

Definition at line 301 of file qgs3dmapsettings.h.

◆ terrainVerticalScale()

double Qgs3DMapSettings::terrainVerticalScale ( ) const

Returns vertical scale (exaggeration) of terrain.

Definition at line 439 of file qgs3dmapsettings.cpp.

◆ terrainVerticalScaleChanged

void Qgs3DMapSettings::terrainVerticalScaleChanged ( )
signal

Emitted when the vertical scale of the terrain has changed.

◆ transformContext()

QgsCoordinateTransformContext Qgs3DMapSettings::transformContext ( ) const

Returns the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.

See also
setTransformContext()

Definition at line 392 of file qgs3dmapsettings.cpp.

◆ worldToMapCoordinates()

QgsVector3D Qgs3DMapSettings::worldToMapCoordinates ( const QgsVector3D worldCoords) const

Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y))

Definition at line 382 of file qgs3dmapsettings.cpp.

◆ writeXml()

QDomElement Qgs3DMapSettings::writeXml ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const

Writes configuration to a DOM element, to be used later with readXml()

Definition at line 247 of file qgs3dmapsettings.cpp.


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