16#ifndef QGS3DMAPSCENE_H
17#define QGS3DMAPSCENE_H
21#include <Qt3DCore/QEntity>
29 class QRenderSettings;
40 class QForwardRenderer;
51class QgsTerrainEntity;
52class QgsChunkedEntity;
60class Qgs3DMapSceneEntity;
106 QVector<QgsPointXY> viewFrustum2DExtent();
109 int terrainPendingJobsCount()
const;
115 int totalPendingJobsCount()
const;
131 float worldSpaceError(
float epsilon,
float distance );
200 static QMap< QString, Qgs3DMapScene * > openScenes();
204 static std::function< QMap< QString, Qgs3DMapScene * >() > sOpenScenesFunction;
242 void updateTemporal();
245 void onCameraChanged();
246 void onFrameTriggered(
float dt );
247 void createTerrain();
248 void onLayerRenderer3DChanged();
249 void onLayersChanged();
250 void createTerrainDeferred();
251 void onBackgroundColorChanged();
253 void updateCameraLens();
254 void onSkyboxSettingsChanged();
255 void onShadowSettingsChanged();
256 void onAmbientOcclusionSettingsChanged();
257 void onEyeDomeShadingSettingsChanged();
258 void onDebugShadowMapSettingsChanged();
259 void onDebugDepthMapSettingsChanged();
260 void onCameraMovementSpeedChanged();
261 void onCameraNavigationModeChanged();
262 void onDebugOverlayEnabledChanged();
264 void on3DAxisSettingsChanged();
266 bool updateCameraNearFarPlanes();
276 void addCameraViewCenterEntity( Qt3DRender::QCamera *camera );
279 void updateSceneState();
281 void finalizeNewEntity( Qt3DCore::QEntity *newEntity );
282 int maximumTextureSize()
const;
288 Qt3DLogic::QFrameAction *mFrameAction =
nullptr;
290 QgsTerrainEntity *mTerrain =
nullptr;
291 QList<Qgs3DMapSceneEntity *> mSceneEntities;
293 Qt3DCore::QEntity *mEntityCameraViewCenter =
nullptr;
295 QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
296 bool mTerrainUpdateScheduled =
false;
299 QList<Qt3DCore::QEntity *> mLightEntities;
300 QList<QgsMapLayer *> mModelVectorLayers;
303 Qt3DCore::QEntity *mEntityRotationCenter =
nullptr;
Manages the various settings the user can choose from when exporting a 3D scene 3.
void terrainPendingJobsCountChanged()
Emitted when the number of terrain's pending jobs changes.
void viewed2DExtentFrom3DChanged(QVector< QgsPointXY > extent)
Emitted when the viewed 2D extent seen by the 3D camera has changed.
QgsAbstract3DEngine * engine()
Returns the abstract 3D engine.
void fpsCountChanged(float fpsCount)
Emitted when the FPS count changes.
Qgs3DMapSettings * mapSettings() const
Returns the 3D map settings.
void gpuMemoryLimitReached()
Emitted when one of the entities reaches its GPU memory limit and it is not possible to lower the GPU...
SceneState
Enumeration of possible states of the 3D scene.
@ Ready
The scene is fully loaded/updated.
@ Updating
The scene is still being loaded/updated.
QgsTerrainEntity * terrainEntity()
Returns terrain entity (may be temporarily nullptr)
void totalPendingJobsCountChanged()
Emitted when the total number of pending jobs changes.
Qt3DCore::QEntity * layerEntity(QgsMapLayer *layer) const
Returns the entity belonging to layer.
void fpsCounterEnabledChanged(bool fpsCounterEnabled)
Emitted when the FPS counter is activated or deactivated.
void sceneStateChanged()
Emitted when the scene's state has changed.
SceneState sceneState() const
Returns the current state of the scene.
void terrainEntityChanged()
Emitted when the current terrain entity is replaced by a new one.
Qgs3DAxis * get3DAxis()
Returns the 3D axis object.
QList< QgsMapLayer * > layers()
Returns the layers that contain chunked entities.
QgsCameraController * cameraController()
Returns camera controller.
Base class for all renderers that may to participate in 3D view.
QgsRange which stores a range of double values.
Base class for all map layer types.
A rectangle specified with double values.
Base class for all skybox types.
Contains the configuration of a skybox entity.