QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Types | Public Slots | Signals | Public Member Functions | List of all members
Qgs3DMapScene Class Reference

3 More...

#include <qgs3dmapscene.h>

Inheritance diagram for Qgs3DMapScene:
Inheritance graph
[legend]

Public Types

enum  SceneState { Ready , Updating }
 Enumeration of possible states of the 3D scene. More...
 

Public Slots

void updateTemporal ()
 Updates the temporale entities. More...
 

Signals

void fpsCountChanged (float fpsCount)
 Emitted when the FPS count changes. More...
 
void fpsCounterEnabledChanged (bool fpsCounterEnabled)
 Emitted when the FPS counter is activated or deactivated. More...
 
void sceneStateChanged ()
 Emitted when the scene's state has changed. More...
 
void terrainEntityChanged ()
 Emitted when the current terrain entity is replaced by a new one. More...
 
void terrainPendingJobsCountChanged ()
 Emitted when the number of terrain's pending jobs changes. More...
 
void totalPendingJobsCountChanged ()
 Emitted when the total number of pending jobs changes. More...
 

Public Member Functions

 Qgs3DMapScene (const Qgs3DMapSettings &map, QgsAbstract3DEngine *engine)
 Constructs a 3D scene based on map settings and Qt 3D renderer configuration. More...
 
QgsCameraControllercameraController ()
 Returns camera controller. More...
 
void exportScene (const Qgs3DMapExportSettings &exportSettings)
 Exports the scene according to the scene export settings. More...
 
QVector< const QgsChunkNode * > getLayerActiveChunkNodes (QgsMapLayer *layer)
 Returns the active chunk nodes of layer. More...
 
void registerPickHandler (Qgs3DMapScenePickHandler *pickHandler)
 Registers an object that will get results of pick events on 3D entities. Does not take ownership of the pick handler. Adds object picker components to 3D entities. More...
 
SceneState sceneState () const
 Returns the current state of the scene. More...
 
QgsTerrainEntity * terrainEntity ()
 Returns terrain entity (may be temporarily nullptr) More...
 
int terrainPendingJobsCount () const
 Returns number of pending jobs of the terrain entity. More...
 
int totalPendingJobsCount () const
 Returns number of pending jobs for all chunked entities. More...
 
void unregisterPickHandler (Qgs3DMapScenePickHandler *pickHandler)
 Unregisters previously registered pick handler. Pick handler is not deleted. Also removes object picker components from 3D entities. More...
 
void viewZoomFull ()
 Resets camera view to show the whole scene (top view) More...
 
float worldSpaceError (float epsilon, float distance)
 Given screen error (in pixels) and distance from camera (in 3D world coordinates), this function estimates the error in world space. More...
 

Detailed Description

3

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

Note
Not available in Python bindings
Since
QGIS 3.0

Definition at line 69 of file qgs3dmapscene.h.

Member Enumeration Documentation

◆ SceneState

Enumeration of possible states of the 3D scene.

Enumerator
Ready 

The scene is fully loaded/updated.

Updating 

The scene is still being loaded/updated.

Definition at line 94 of file qgs3dmapscene.h.

Constructor & Destructor Documentation

◆ Qgs3DMapScene()

Qgs3DMapScene::Qgs3DMapScene ( const Qgs3DMapSettings map,
QgsAbstract3DEngine engine 
)

Constructs a 3D scene based on map settings and Qt 3D renderer configuration.

Definition at line 86 of file qgs3dmapscene.cpp.

Member Function Documentation

◆ cameraController()

QgsCameraController* Qgs3DMapScene::cameraController ( )
inline

Returns camera controller.

Definition at line 77 of file qgs3dmapscene.h.

◆ exportScene()

void Qgs3DMapScene::exportScene ( const Qgs3DMapExportSettings exportSettings)

Exports the scene according to the scene export settings.

Definition at line 1051 of file qgs3dmapscene.cpp.

◆ fpsCountChanged

void Qgs3DMapScene::fpsCountChanged ( float  fpsCount)
signal

Emitted when the FPS count changes.

◆ fpsCounterEnabledChanged

void Qgs3DMapScene::fpsCounterEnabledChanged ( bool  fpsCounterEnabled)
signal

Emitted when the FPS counter is activated or deactivated.

◆ getLayerActiveChunkNodes()

QVector< const QgsChunkNode * > Qgs3DMapScene::getLayerActiveChunkNodes ( QgsMapLayer layer)

Returns the active chunk nodes of layer.

Since
QGIS 3.18

Definition at line 1099 of file qgs3dmapscene.cpp.

◆ registerPickHandler()

void Qgs3DMapScene::registerPickHandler ( Qgs3DMapScenePickHandler pickHandler)

Registers an object that will get results of pick events on 3D entities. Does not take ownership of the pick handler. Adds object picker components to 3D entities.

Definition at line 259 of file qgs3dmapscene.cpp.

◆ sceneState()

SceneState Qgs3DMapScene::sceneState ( ) const
inline

Returns the current state of the scene.

Definition at line 101 of file qgs3dmapscene.h.

◆ sceneStateChanged

void Qgs3DMapScene::sceneStateChanged ( )
signal

Emitted when the scene's state has changed.

◆ terrainEntity()

QgsTerrainEntity* Qgs3DMapScene::terrainEntity ( )
inline

Returns terrain entity (may be temporarily nullptr)

Definition at line 79 of file qgs3dmapscene.h.

◆ terrainEntityChanged

void Qgs3DMapScene::terrainEntityChanged ( )
signal

Emitted when the current terrain entity is replaced by a new one.

◆ terrainPendingJobsCount()

int Qgs3DMapScene::terrainPendingJobsCount ( ) const

Returns number of pending jobs of the terrain entity.

Definition at line 246 of file qgs3dmapscene.cpp.

◆ terrainPendingJobsCountChanged

void Qgs3DMapScene::terrainPendingJobsCountChanged ( )
signal

Emitted when the number of terrain's pending jobs changes.

◆ totalPendingJobsCount()

int Qgs3DMapScene::totalPendingJobsCount ( ) const

Returns number of pending jobs for all chunked entities.

Since
QGIS 3.12

Definition at line 251 of file qgs3dmapscene.cpp.

◆ totalPendingJobsCountChanged

void Qgs3DMapScene::totalPendingJobsCountChanged ( )
signal

Emitted when the total number of pending jobs changes.

Since
QGIS 3.12

◆ unregisterPickHandler()

void Qgs3DMapScene::unregisterPickHandler ( Qgs3DMapScenePickHandler pickHandler)

Unregisters previously registered pick handler. Pick handler is not deleted. Also removes object picker components from 3D entities.

Definition at line 274 of file qgs3dmapscene.cpp.

◆ updateTemporal

void Qgs3DMapScene::updateTemporal ( )
slot

Updates the temporale entities.

Definition at line 734 of file qgs3dmapscene.cpp.

◆ viewZoomFull()

void Qgs3DMapScene::viewZoomFull ( )

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

Definition at line 239 of file qgs3dmapscene.cpp.

◆ worldSpaceError()

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

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.

Definition at line 305 of file qgs3dmapscene.cpp.


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