Class: Qgs3DMapScene

class qgis._3d.Qgs3DMapScene

Bases: PyQt5.QtCore.QObject

Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.

Note

Not available in Python bindings

Methods

cameraController

Returns camera controller

elevationRange

Returns the scene's elevation range

exportScene

Exports the scene according to the scene export settings

mapSettings

Returns the 3D map settings.

openScenes

Returns a map of 3D map scenes (by name) open in the QGIS application.

sceneExtent

Returns the scene extent in the map's CRS

sceneState

Returns the current state of the scene

setViewFrom2DExtent

Resets camera view to show the extent extent (top view)

terrainPendingJobsCount

Returns number of pending jobs of the terrain entity

totalPendingJobsCount

Returns number of pending jobs for all chunked entities

updateTemporal

Updates the temporale entities

viewFrustum2DExtent

Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid

viewZoomFull

Resets camera view to show the whole scene (top view)

worldSpaceError

Given screen error (in pixels) and distance from camera (in 3D world coordinates), this function estimates the error in world space.

Signals

fpsCountChanged

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

fpsCounterEnabledChanged

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

gpuMemoryLimitReached

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

sceneStateChanged

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

terrainEntityChanged

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

terrainPendingJobsCountChanged

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

totalPendingJobsCountChanged

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

viewed2DExtentFrom3DChanged

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

Attributes

Ready

Updating

Ready = 0
class SceneState

Bases: int

Updating = 1
cameraController(self) QgsCameraController

Returns camera controller

Return type:

QgsCameraController

elevationRange(self) QgsDoubleRange

Returns the scene’s elevation range

Note

Only some layer types are considered by this method (eg terrain, point cloud and mesh layers)

New in version 3.30.

Return type:

QgsDoubleRange

exportScene(self, exportSettings: Qgs3DMapExportSettings)

Exports the scene according to the scene export settings

Parameters:

exportSettings (Qgs3DMapExportSettings) –

fpsCountChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

fpsCounterEnabledChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

gpuMemoryLimitReached

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

mapSettings(self) Qgs3DMapSettings

Returns the 3D map settings.

New in version 3.30.

Return type:

Qgs3DMapSettings

openScenes() object

Returns a map of 3D map scenes (by name) open in the QGIS application.

Note

Only available from the QGIS desktop application.

Deprecated since version QGIS: 3.36 use QgisAppInterface.mapCanvases3D() instead.

New in version 3.30.

Return type:

object

sceneExtent(self) QgsRectangle

Returns the scene extent in the map’s CRS

New in version 3.20.

Return type:

QgsRectangle

sceneState(self) Qgs3DMapScene.SceneState

Returns the current state of the scene

Return type:

Qgs3DMapScene.SceneState

sceneStateChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

setViewFrom2DExtent(self, extent: QgsRectangle)

Resets camera view to show the extent extent (top view)

New in version 3.26.

Parameters:

extent (QgsRectangle) –

terrainEntityChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

terrainPendingJobsCount(self) int

Returns number of pending jobs of the terrain entity

Return type:

int

terrainPendingJobsCountChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

totalPendingJobsCount(self) int

Returns number of pending jobs for all chunked entities

New in version 3.12.

Return type:

int

totalPendingJobsCountChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

updateTemporal(self)

Updates the temporale entities

viewFrustum2DExtent(self) List[QgsPointXY]

Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid

New in version 3.26.

Return type:

List[QgsPointXY]

viewZoomFull(self)

Resets camera view to show the whole scene (top view)

viewed2DExtentFrom3DChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

worldSpaceError(self, epsilon: float, distance: float) float

Given screen error (in pixels) and distance from camera (in 3D world coordinates), this function estimates the error in world space. Takes into account camera’s field of view and the screen (3D view) size.

Parameters:
  • epsilon (float) –

  • distance (float) –

Return type:

float