QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children. More...
#include <qgs3dmapscene.h>
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... | |
void | viewed2DExtentFrom3DChanged (QVector< QgsPointXY > extent) |
Emitted when the viewed 2D extent seen by the 3D camera has changed. More... | |
Public Member Functions | |
Qgs3DMapScene (Qgs3DMapSettings &map, QgsAbstract3DEngine *engine) | |
Constructs a 3D scene based on map settings and Qt 3D renderer configuration. More... | |
QgsCameraController * | cameraController () |
Returns camera controller. More... | |
QgsAbstract3DEngine * | engine () |
Returns the abstract 3D engine. More... | |
void | exportScene (const Qgs3DMapExportSettings &exportSettings) |
Exports the scene according to the scene export settings. More... | |
Qgs3DAxis * | get3DAxis () |
Returns the 3D axis object. 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... | |
QgsRectangle | sceneExtent () |
Returns the scene extent in the map's CRS. More... | |
SceneState | sceneState () const |
Returns the current state of the scene. More... | |
void | setViewFrom2DExtent (const QgsRectangle &extent) |
Resets camera view to show the extent extent (top view) 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... | |
QVector< QgsPointXY > | viewFrustum2DExtent () |
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid. 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... | |
Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.
3
Definition at line 70 of file qgs3dmapscene.h.
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 109 of file qgs3dmapscene.h.
Qgs3DMapScene::Qgs3DMapScene | ( | Qgs3DMapSettings & | map, |
QgsAbstract3DEngine * | engine | ||
) |
Constructs a 3D scene based on map settings and Qt 3D renderer configuration.
Definition at line 88 of file qgs3dmapscene.cpp.
|
inline |
Returns camera controller.
Definition at line 78 of file qgs3dmapscene.h.
|
inline |
void Qgs3DMapScene::exportScene | ( | const Qgs3DMapExportSettings & | exportSettings | ) |
Exports the scene according to the scene export settings.
Definition at line 1120 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the FPS count changes.
|
signal |
Emitted when the FPS counter is activated or deactivated.
|
inline |
QVector< const QgsChunkNode * > Qgs3DMapScene::getLayerActiveChunkNodes | ( | QgsMapLayer * | layer | ) |
Returns the active chunk nodes of layer.
Definition at line 1169 of file qgs3dmapscene.cpp.
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 323 of file qgs3dmapscene.cpp.
QgsRectangle Qgs3DMapScene::sceneExtent | ( | ) |
Returns the scene extent in the map's CRS.
Definition at line 1181 of file qgs3dmapscene.cpp.
|
inline |
Returns the current state of the scene.
Definition at line 116 of file qgs3dmapscene.h.
|
signal |
Emitted when the scene's state has changed.
void Qgs3DMapScene::setViewFrom2DExtent | ( | const QgsRectangle & | extent | ) |
Resets camera view to show the extent extent (top view)
Definition at line 256 of file qgs3dmapscene.cpp.
|
inline |
Returns terrain entity (may be temporarily nullptr
)
Definition at line 80 of file qgs3dmapscene.h.
|
signal |
Emitted when the current terrain entity is replaced by a new one.
int Qgs3DMapScene::terrainPendingJobsCount | ( | ) | const |
Returns number of pending jobs of the terrain entity.
Definition at line 310 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the number of terrain's pending jobs changes.
int Qgs3DMapScene::totalPendingJobsCount | ( | ) | const |
Returns number of pending jobs for all chunked entities.
Definition at line 315 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the total number of pending jobs changes.
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 338 of file qgs3dmapscene.cpp.
|
slot |
Updates the temporale entities.
Definition at line 748 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the viewed 2D extent seen by the 3D camera has changed.
QVector< QgsPointXY > Qgs3DMapScene::viewFrustum2DExtent | ( | ) |
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid.
Definition at line 279 of file qgs3dmapscene.cpp.
void Qgs3DMapScene::viewZoomFull | ( | ) |
Resets camera view to show the whole scene (top view)
Definition at line 247 of file qgs3dmapscene.cpp.
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 369 of file qgs3dmapscene.cpp.