Class: Qgs3DMapSettings

Definition of the world.

Warning

Qgs3DMapSettings are a QObject subclass, and accordingly are not safe for access across different threads. See Qgs3DRenderContext instead for a safe snapshot of settings from Qgs3DMapSettings.

Class Hierarchy

Inheritance diagram of qgis._3d.Qgs3DMapSettings

Base classes

QObject

QgsTemporalRangeObject

Base class for objects with an associated (optional) temporal range.

class qgis._3d.Qgs3DMapSettings[source]

Bases: QObject, QgsTemporalRangeObject

signal ambientOcclusionSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal axisSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

backgroundColor(self) QColor[source]

Returns background color of the 3D map view

Return type:

QColor

signal backgroundColorChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

cameraMovementSpeed(self) float[source]

Returns the camera movement speed

Added in version 3.18.

Return type:

float

signal cameraMovementSpeedChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal cameraNavigationModeChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

crs(self) QgsCoordinateReferenceSystem[source]

Returns coordinate reference system used in the 3D scene.

See also

setCrs()

Return type:

QgsCoordinateReferenceSystem

debugDepthMapCorner(self) Qt.Corner[source]

Returns the corner where the shadow map preview is displayed

Return type:

Qt.Corner

debugDepthMapEnabled(self) bool[source]

Returns whether the shadow map debugging is enabled

Return type:

bool

signal debugDepthMapSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

debugDepthMapSize(self) float[source]

Returns the size of the shadow map preview

Return type:

float

signal debugOverlayEnabledChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

debugShadowMapCorner(self) Qt.Corner[source]

Returns the corner where the shadow map preview is displayed

Return type:

Qt.Corner

debugShadowMapEnabled(self) bool[source]

Returns whether the shadow map debugging is enabled

Return type:

bool

signal debugShadowMapSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

debugShadowMapSize(self) float[source]

Returns the size of the shadow map preview

Return type:

float

signal directionalLightsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

extent(self) QgsRectangle[source]

Returns the 3D scene’s 2D extent in the 3D scene’s CRS

The extent is ignored in globe scenes (which always show the whole globe).

See also

crs()

Added in version 3.30.

Return type:

QgsRectangle

signal extentChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

eyeDomeLightingDistance(self) int[source]

Returns the eye dome lighting distance value (contributes to the contrast of the image)

Return type:

int

signal eyeDomeLightingDistanceChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

eyeDomeLightingEnabled(self) bool[source]

Returns whether eye dome lighting is used

Return type:

bool

signal eyeDomeLightingEnabledChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

eyeDomeLightingStrength(self) float[source]

Returns the eye dome lighting strength value

Return type:

float

signal eyeDomeLightingStrengthChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

fieldOfView(self) float[source]

Returns the camera lens’ field of view

Added in version 3.8.

Return type:

float

signal fieldOfViewChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal fpsCounterEnabledChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

isDebugOverlayEnabled(self) bool[source]

Returns whether debug overlay is enabled

Added in version 3.26.

Return type:

bool

isFpsCounterEnabled(self) bool[source]

Returns whether FPS counter label is enabled

Added in version 3.18.

Return type:

bool

isSkyboxEnabled(self) bool[source]

Returns whether the skybox is enabled.

Added in version 3.16.

Return type:

bool

isTerrainShadingEnabled(self) bool[source]

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).

Added in version 3.6.

Return type:

bool

layers(self) List[QgsMapLayer]

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.

See also

setLayers()

See also

layersChanged()

Return type:

List[QgsMapLayer]

signal layersChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lightSources(self) List[QgsLightSource]

Returns list of directional light sources defined in the scene.

Added in version 3.26.

Return type:

List[QgsLightSource]

signal lightSourcesChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

mapThemeCollection(self) QgsMapThemeCollection | None[source]

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.

Added in version 3.6.

Return type:

Optional[QgsMapThemeCollection]

mapTileResolution(self) int[source]

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())

Deprecated since version 3.42: Use terrainSettings() instead.

Return type:

int

signal mapTileResolutionChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

mapToWorldCoordinates(self, mapCoords: QgsVector3D) QgsVector3D[source]

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

Parameters:

mapCoords (QgsVector3D)

Return type:

QgsVector3D

maxTerrainGroundError(self) float[source]

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.

Deprecated since version 3.42: Use terrainSettings() instead.

Return type:

float

signal maxTerrainGroundErrorChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

maxTerrainScreenError(self) float[source]

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.

Deprecated since version 3.42: Use terrainSettings() instead.

Return type:

float

signal maxTerrainScreenErrorChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

origin(self) QgsVector3D[source]

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

See also

setOrigin()

Return type:

QgsVector3D

signal originChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

outputDpi(self) float[source]

Returns DPI used for conversion between real world units (e.g. mm) and pixels Default value is 96

Added in version 3.10.

Return type:

float

pathResolver(self) QgsPathResolver

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

Return type:

QgsPathResolver

signal pointLightsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal projectionTypeChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

readXml(self, elem: QDomElement, context: QgsReadWriteContext)[source]

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

Parameters:
rendererUsage(self) Qgis.RendererUsage[source]

Returns the renderer usage

See also

rendererUsage()

Added in version 3.24.

Return type:

Qgis.RendererUsage

signal renderersChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

resolveReferences(self, project: QgsProject)[source]

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

Parameters:

project (QgsProject)

sceneMode(self) Qgis.SceneMode[source]

Returns mode of the 3D scene - whether it is represented as a globe (when using Geocentric CRS such as EPSG:4978), or whether it is a local scene when using a projected CRS.

In case of globe scene, we always show the whole globe and extent() is ignored.

Added in version 3.44.

Return type:

Qgis.SceneMode

selectionColor(self) QColor[source]

Returns color used for selected features

Return type:

QColor

signal selectionColorChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setBackgroundColor(self, color: QColor | Qt.GlobalColor)[source]

Sets background color of the 3D map view

Parameters:

color (Union[QColor, Qt.GlobalColor])

setCameraMovementSpeed(self, movementSpeed: float)[source]

Sets the camera movement speed

Added in version 3.18.

Parameters:

movementSpeed (float)

setCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets coordinate reference system used in the 3D scene.

See also

crs()

Parameters:

crs (QgsCoordinateReferenceSystem)

setDebugDepthMapSettings(self, enabled: bool, corner: Qt.Corner, size: float)[source]

Sets the debugging settings of the depth map

Added in version 3.18.

Parameters:
  • enabled (bool)

  • corner (Qt.Corner)

  • size (float)

setDebugShadowMapSettings(self, enabled: bool, corner: Qt.Corner, size: float)[source]

Sets the debugging settings of the shadow map

Added in version 3.18.

Parameters:
  • enabled (bool)

  • corner (Qt.Corner)

  • size (float)

setExtent(self, extent: QgsRectangle)[source]

Sets the 3D scene’s 2D extent in the 3D scene’s CRS, while also setting the scene’s origin to the extent’s center

This needs to be called during initialization, as terrain will only be generated within this extent and layer 3D data will only be loaded within this extent too.

The extent is ignored in globe scenes (which always show the whole globe).

See also

setOrigin()

See also

setCrs()

Added in version 3.30.

Parameters:

extent (QgsRectangle)

setEyeDomeLightingDistance(self, distance: int)[source]

Sets the eye dome lighting distance value (contributes to the contrast of the image

Added in version 3.18.

Parameters:

distance (int)

setEyeDomeLightingEnabled(self, enabled: bool)[source]

Sets whether eye dome lighting will be used

Added in version 3.18.

Parameters:

enabled (bool)

setEyeDomeLightingStrength(self, strength: float)[source]

Sets the eye dome lighting strength value

Added in version 3.18.

Parameters:

strength (float)

setFieldOfView(self, fieldOfView: float)[source]

Sets the camera lens’ field of view

Added in version 3.8.

Parameters:

fieldOfView (float)

setIsDebugOverlayEnabled(self, debugOverlayEnabled: bool)[source]

Sets whether debug overlay is enabled The debug overlay displays some debugging and profiling information. It has been introduced in Qt version 5.15. This parameter is transient. It is not saved in the project parameters.

Added in version 3.26.

Parameters:

debugOverlayEnabled (bool)

setIsFpsCounterEnabled(self, fpsCounterEnabled: bool)[source]

Sets whether FPS counter label is enabled

Added in version 3.18.

Parameters:

fpsCounterEnabled (bool)

setIsSkyboxEnabled(self, enabled: bool)[source]

Sets whether the skybox is enabled.

Added in version 3.16.

Parameters:

enabled (bool)

setLayers(self, layers: Iterable[QgsMapLayer])[source]

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.

See also

layers()

See also

layersChanged()

Parameters:

layers (Iterable[QgsMapLayer])

setLightSources(self, lights: Iterable[QgsLightSource])[source]

Sets the list of light sources defined in the scene.

Ownership of the lights is transferred to the settings.

See also

lightSources()

Added in version 3.26.

Parameters:

lights (Iterable[QgsLightSource])

setMapThemeCollection(self, mapThemes: QgsMapThemeCollection | None)[source]

Sets pointer to the collection of map themes.

Added in version 3.6.

Parameters:

mapThemes (Optional[QgsMapThemeCollection])

setMapTileResolution(self, res: int)[source]

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

Deprecated since version 3.42: Use terrainSettings() instead.

Parameters:

res (int)

setMaxTerrainGroundError(self, error: float)[source]

Sets the maximum ground error of terrain tiles in world units.

Deprecated since version 3.42: Use terrainSettings() instead.

Parameters:

error (float)

setMaxTerrainScreenError(self, error: float)[source]

Sets maximum allowed screen error of terrain tiles in pixels.

Deprecated since version 3.42: Use terrainSettings() instead.

Parameters:

error (float)

setOrigin(self, origin: QgsVector3D)[source]

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.

See also

origin()

Parameters:

origin (QgsVector3D)

setOutputDpi(self, dpi: float)[source]

Sets DPI used for conversion between real world units (e.g. mm) and pixels

Parameters:

dpi (float) – the number of dot per inch

Added in version 3.10.

setPathResolver(self, resolver: QgsPathResolver)[source]

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

See also

pathResolver()

Parameters:

resolver (QgsPathResolver)

setRendererUsage(self, rendererUsage: Qgis.RendererUsage)[source]

Sets the renderer usage

See also

rendererUsage()

Added in version 3.24.

Parameters:

rendererUsage (Qgis.RendererUsage)

setSelectionColor(self, color: QColor | Qt.GlobalColor)[source]

Sets color used for selected features

Parameters:

color (Union[QColor, Qt.GlobalColor])

setShowCameraRotationCenter(self, enabled: bool)[source]

Sets whether to show camera’s rotation center as a sphere (for debugging)

Added in version 3.24.

Parameters:

enabled (bool)

setShowCameraViewCenter(self, enabled: bool)[source]

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

Added in version 3.4.

Parameters:

enabled (bool)

setShowDebugPanel(self, enabled: bool)[source]

Sets whether the debug side panel is shown

Added in version 3.42.

Parameters:

enabled (bool)

setShowExtentIn2DView(self, show: bool)[source]

Sets whether the extent is displayed on the main 2D map canvas

Added in version 3.32.

Parameters:

show (bool)

setShowLabels(self, enabled: bool)[source]

Sets whether to display labels on terrain tiles

Parameters:

enabled (bool)

setShowLightSourceOrigins(self, enabled: bool)[source]

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

Added in version 3.16.

Parameters:

enabled (bool)

setShowTerrainBoundingBoxes(self, enabled: bool)[source]

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

Parameters:

enabled (bool)

setShowTerrainTilesInfo(self, enabled: bool)[source]

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

Parameters:

enabled (bool)

setStopUpdates(self, enabled: bool)[source]

Sets whether scene updates on camera movement should be enabled

Note

By default, scene is updating on camera movement. Useful for debugging purposes.

Added in version 3.42.

Parameters:

enabled (bool)

setTerrainElevationOffset(self, offset: float)[source]

Sets the terrain elevation offset (used to move the terrain up or down)

Deprecated since version 3.42: Use terrainSettings() instead.

Parameters:

offset (float)

setTerrainMapTheme(self, theme: str | None)[source]

Sets name of the map theme.

Added in version 3.6.

Parameters:

theme (Optional[str])

setTerrainRenderingEnabled(self, terrainRenderingEnabled: bool)[source]

Sets whether the 2D terrain surface will be rendered in.

Added in version 3.22.

Parameters:

terrainRenderingEnabled (bool)

setTerrainSettings(self, settings: QgsAbstractTerrainSettings | None)[source]

Sets the terrain settings.

Added in version 3.42.

Parameters:

settings (Optional[QgsAbstractTerrainSettings])

setTerrainShadingEnabled(self, enabled: bool)[source]

Sets whether terrain shading is enabled.

Added in version 3.6.

Parameters:

enabled (bool)

setTerrainShadingMaterial(self, material: QgsPhongMaterialSettings)[source]

Sets terrain shading material.

Added in version 3.6.

Parameters:

material (QgsPhongMaterialSettings)

setTerrainVerticalScale(self, zScale: float)[source]

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

Deprecated since version 3.42: Use terrainSettings() instead.

Parameters:

zScale (float)

setTransformContext(self, context: QgsCoordinateTransformContext)[source]

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.

Parameters:

context (QgsCoordinateTransformContext)

setViewFrustumVisualizationEnabled(self, enabled: bool)[source]

Sets whether the camera’s view frustum is visualized on the 2D map canvas

Added in version 3.26.

Parameters:

enabled (bool)

setViewSyncMode(self, mode: Qgis.ViewSyncModeFlags | Qgis.ViewSyncModeFlag)[source]

Sets the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation)

Added in version 3.26.

Parameters:

mode (Union[Qgis.ViewSyncModeFlags, Qgis.ViewSyncModeFlag])

signal settingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal shadowSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showCameraRotationCenter(self) bool[source]

Returns whether to show camera’s rotation center as a sphere (for debugging)

Added in version 3.24.

Return type:

bool

signal showCameraRotationCenterChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showCameraViewCenter(self) bool[source]

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

Added in version 3.4.

Return type:

bool

signal showCameraViewCenterChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showDebugPanel(self) bool[source]

Returns whether the debug side panel is shown

Added in version 3.42.

Return type:

bool

signal showDebugPanelChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showExtentIn2DView(self) bool[source]

Returns whether the extent is displayed on the main 2D map canvas

Added in version 3.32.

Return type:

bool

signal showExtentIn2DViewChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showLabels(self) bool[source]

Returns whether to display labels on terrain tiles

Return type:

bool

signal showLabelsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showLightSourceOrigins(self) bool[source]

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

Added in version 3.16.

Return type:

bool

signal showLightSourceOriginsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showTerrainBoundingBoxes(self) bool[source]

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

Return type:

bool

signal showTerrainBoundingBoxesChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

showTerrainTilesInfo(self) bool[source]

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

Return type:

bool

signal showTerrainTilesInfoChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal skyboxSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

stopUpdates(self) bool[source]

Returns whether the scene updates on camera movement

Added in version 3.42.

Return type:

bool

signal stopUpdatesChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

terrainElevationOffset(self) float[source]

Returns the elevation offset of the terrain (used to move the terrain up or down)

Deprecated since version 3.42: Use terrainSettings() instead.

Return type:

float

signal terrainElevationOffsetChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal terrainGeneratorChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

terrainMapTheme(self) str[source]

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)

Added in version 3.6.

Return type:

str

signal terrainMapThemeChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

terrainRenderingEnabled(self) bool[source]

Returns whether the 2D terrain surface will be rendered.

Added in version 3.22.

Return type:

bool

terrainSettings(self) QgsAbstractTerrainSettings | None[source]

Returns the terrain settings.

Warning

Modifications should never be made to the returned object. Instead use setTerrainSettings(), so that the corresponding changed signals are correctly emitted.

Added in version 3.42.

Return type:

Optional[QgsAbstractTerrainSettings]

signal terrainSettingsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal terrainShadingChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

terrainShadingMaterial(self) QgsPhongMaterialSettings[source]

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.

Added in version 3.6.

Return type:

QgsPhongMaterialSettings

terrainVerticalScale(self) float[source]

Returns vertical scale (exaggeration) of terrain

Deprecated since version 3.42: Use terrainSettings() instead.

Return type:

float

signal terrainVerticalScaleChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

transformContext(self) QgsCoordinateTransformContext[source]

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.

Return type:

QgsCoordinateTransformContext

viewFrustumVisualizationEnabled(self) bool[source]

Returns whether the camera’s view frustum is visualized on the 2D map canvas

Added in version 3.26.

Return type:

bool

signal viewFrustumVisualizationEnabledChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

viewSyncMode(self) Qgis.ViewSyncModeFlags[source]

Returns the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation)

Added in version 3.26.

Return type:

Qgis.ViewSyncModeFlags

worldToMapCoordinates(self, worldCoords: QgsVector3D) QgsVector3D[source]

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

Parameters:

worldCoords (QgsVector3D)

Return type:

QgsVector3D

writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

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

Parameters:
Return type:

QDomElement