QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
3 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. | |
Signals | |
void | fpsCountChanged (float fpsCount) |
Emitted when the FPS count changes. | |
void | fpsCounterEnabledChanged (bool fpsCounterEnabled) |
Emitted when the FPS counter is activated or deactivated. | |
void | gpuMemoryLimitReached () |
Emitted when one of the entities reaches its GPU memory limit and it is not possible to lower the GPU memory use by unloading data that's not currently needed. | |
void | sceneStateChanged () |
Emitted when the scene's state has changed. | |
void | terrainEntityChanged () |
Emitted when the current terrain entity is replaced by a new one. | |
void | terrainPendingJobsCountChanged () |
Emitted when the number of terrain's pending jobs changes. | |
void | totalPendingJobsCountChanged () |
Emitted when the total number of pending jobs changes. | |
void | viewed2DExtentFrom3DChanged (QVector< QgsPointXY > extent) |
Emitted when the viewed 2D extent seen by the 3D camera has changed. | |
Public Member Functions | |
Qgs3DMapScene (Qgs3DMapSettings &map, QgsAbstract3DEngine *engine) | |
Constructs a 3D scene based on map settings and Qt 3D renderer configuration. | |
QgsCameraController * | cameraController () const |
Returns camera controller. | |
QgsDoubleRange | elevationRange () const |
Returns the scene's elevation range. | |
QgsAbstract3DEngine * | engine () const |
Returns the abstract 3D engine. | |
void | exportScene (const Qgs3DMapExportSettings &exportSettings) |
Exports the scene according to the scene export settings. | |
Qgs3DAxis * | get3DAxis () const |
Returns the 3D axis object. | |
QVector< const QgsChunkNode * > | getLayerActiveChunkNodes (QgsMapLayer *layer) |
Returns the active chunk nodes of layer. | |
Qt3DCore::QEntity * | layerEntity (QgsMapLayer *layer) const |
Returns the entity belonging to layer. | |
QList< QgsMapLayer * > | layers () const |
Returns the layers that contain chunked entities. | |
Qgs3DMapSettings * | mapSettings () const |
Returns the 3D map settings. | |
QgsRectangle | sceneExtent () const |
Returns the scene extent in the map's CRS. | |
SceneState | sceneState () const |
Returns the current state of the scene. | |
void | setViewFrom2DExtent (const QgsRectangle &extent) |
Resets camera view to show the extent extent (top view) | |
QgsTerrainEntity * | terrainEntity () |
Returns terrain entity (may be temporarily nullptr ) | |
int | terrainPendingJobsCount () const |
Returns number of pending jobs of the terrain entity. | |
int | totalPendingJobsCount () const |
Returns number of pending jobs for all chunked entities. | |
QVector< QgsPointXY > | viewFrustum2DExtent () const |
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid. | |
void | viewZoomFull () |
Resets camera view to show the whole scene (top view) | |
float | worldSpaceError (float epsilon, float distance) const |
Given screen error (in pixels) and distance from camera (in 3D world coordinates), this function estimates the error in world space. | |
Static Public Member Functions | |
static Q_DECL_DEPRECATED QMap< QString, Qgs3DMapScene * > | openScenes () |
Returns a map of 3D map scenes (by name) open in the QGIS application. | |
Static Public Attributes | |
static std::function< QMap< QString, Qgs3DMapScene * >() > | sOpenScenesFunction = [] { return QMap< QString, Qgs3DMapScene * >(); } |
Static function for returning open 3D map scenes. | |
3
Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.
Definition at line 68 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 116 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 85 of file qgs3dmapscene.cpp.
|
inline |
Returns camera controller.
Definition at line 81 of file qgs3dmapscene.h.
QgsDoubleRange Qgs3DMapScene::elevationRange | ( | ) | const |
Returns the scene's elevation range.
Definition at line 1087 of file qgs3dmapscene.cpp.
|
inline |
void Qgs3DMapScene::exportScene | ( | const Qgs3DMapExportSettings & | exportSettings | ) |
Exports the scene according to the scene export settings.
Definition at line 1019 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 1069 of file qgs3dmapscene.cpp.
|
signal |
Emitted when one of the entities reaches its GPU memory limit and it is not possible to lower the GPU memory use by unloading data that's not currently needed.
|
inline |
Returns the entity belonging to layer.
Definition at line 153 of file qgs3dmapscene.h.
|
inline |
Returns the layers that contain chunked entities.
Definition at line 146 of file qgs3dmapscene.h.
|
inline |
|
static |
Returns a map of 3D map scenes (by name) open in the QGIS application.
Definition at line 1151 of file qgs3dmapscene.cpp.
QgsRectangle Qgs3DMapScene::sceneExtent | ( | ) | const |
Returns the scene extent in the map's CRS.
Definition at line 1082 of file qgs3dmapscene.cpp.
|
inline |
Returns the current state of the scene.
Definition at line 123 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 216 of file qgs3dmapscene.cpp.
|
inline |
Returns terrain entity (may be temporarily nullptr
)
Definition at line 87 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 269 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 274 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the total number of pending jobs changes.
|
slot |
Updates the temporale entities.
Definition at line 607 of file qgs3dmapscene.cpp.
|
signal |
Emitted when the viewed 2D extent seen by the 3D camera has changed.
QVector< QgsPointXY > Qgs3DMapScene::viewFrustum2DExtent | ( | ) | const |
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid.
Definition at line 239 of file qgs3dmapscene.cpp.
void Qgs3DMapScene::viewZoomFull | ( | ) |
Resets camera view to show the whole scene (top view)
Definition at line 205 of file qgs3dmapscene.cpp.
float Qgs3DMapScene::worldSpaceError | ( | float | epsilon, |
float | distance | ||
) | const |
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 282 of file qgs3dmapscene.cpp.
|
static |
Static function for returning open 3D map scenes.
Definition at line 83 of file qgs3dmapscene.h.