16#ifndef QGS3DMAPSCENE_H
17#define QGS3DMAPSCENE_H
21#include <Qt3DCore/QEntity>
30 class QRenderSettings;
41 class QForwardRenderer;
52class QgsTerrainEntity;
53class QgsChunkedEntity;
60class Qgs3DMapSceneEntity;
87 QgsTerrainEntity *terrainEntity()
SIP_SKIP {
return mTerrain; }
104 QVector<QgsPointXY> viewFrustum2DExtent()
const;
107 int terrainPendingJobsCount()
const;
113 int totalPendingJobsCount()
const;
129 float worldSpaceError(
float epsilon,
float distance )
const;
246 Q_DECL_DEPRECATED
static QMap<QString, Qgs3DMapScene *> openScenes()
SIP_DEPRECATED;
268 void enableClipping( const QList<QVector4D> &clipPlaneEquations );
276 void disableClipping();
280 static std::function<QMap<QString, Qgs3DMapScene *>()> sOpenScenesFunction;
318 void updateTemporal();
321 void onCameraChanged();
322 void onFrameTriggered(
float dt );
323 void createTerrain();
324 void onLayerRenderer3DChanged();
325 void onLayersChanged();
326 void createTerrainDeferred();
327 void onBackgroundColorChanged();
329 void updateCameraLens();
330 void onSkyboxSettingsChanged();
331 void onShadowSettingsChanged();
332 void onAmbientOcclusionSettingsChanged();
333 void onEyeDomeShadingSettingsChanged();
334 void onDebugShadowMapSettingsChanged();
335 void onDebugDepthMapSettingsChanged();
336 void onCameraMovementSpeedChanged();
337 void onCameraNavigationModeChanged();
338 void onDebugOverlayEnabledChanged();
339 void onStopUpdatesChanged();
340 void on3DAxisSettingsChanged();
342 void onOriginChanged();
344 bool updateCameraNearFarPlanes();
354 void addCameraViewCenterEntity( Qt3DRender::QCamera *camera );
357 void updateSceneState();
358 void updateScene(
bool forceUpdate =
false );
359 void finalizeNewEntity( Qt3DCore::QEntity *newEntity );
360 int maximumTextureSize()
const;
362 void handleClippingOnEntity( QEntity *entity )
const;
363 void handleClippingOnAllEntities()
const;
369 Qt3DLogic::QFrameAction *mFrameAction =
nullptr;
371 QgsTerrainEntity *mTerrain =
nullptr;
372 QList<Qgs3DMapSceneEntity *> mSceneEntities;
374 Qt3DCore::QEntity *mEntityCameraViewCenter =
nullptr;
376 QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
377 bool mTerrainUpdateScheduled =
false;
380 QList<Qt3DCore::QEntity *> mLightEntities;
381 QList<QgsMapLayer *> mModelVectorLayers;
384 Qt3DCore::QEntity *mEntityRotationCenter =
nullptr;
389 bool mSceneUpdatesEnabled =
true;
390 bool mSceneOriginShiftEnabled =
true;
392 QList<QVector4D> mClipPlanesEquations;
393 int mMaxClipPlanes = 6;
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.
Qgs3DAxis * get3DAxis() const
Returns the 3D axis object.
void viewed2DExtentFrom3DChanged(QVector< QgsPointXY > extent)
Emitted when the viewed 2D extent seen by the 3D camera has changed.
void fpsCountChanged(float fpsCount)
Emitted when the FPS count changes.
Qgs3DMapSettings * mapSettings() const
Returns the 3D map settings.
QgsAbstract3DEngine * engine() const
Returns the abstract 3D engine.
void gpuMemoryLimitReached()
Emitted when one of the entities reaches its GPU memory limit and it is not possible to lower the GPU...
QgsCameraController * cameraController() const
Returns camera controller.
SceneState
Enumeration of possible states of the 3D scene.
@ Ready
The scene is fully loaded/updated.
@ Updating
The scene is still being loaded/updated.
bool hasSceneOriginShiftEnabled() const
Returns whether the 3D scene is allowed to automatically move the scene's origin.
bool hasSceneUpdatesEnabled() const
Returns whether updates of the 3D scene's entities are allowed.
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.
QList< QgsMapLayer * > layers() const
Returns the layers that contain chunked entities.
void terrainEntityChanged()
Emitted when the current terrain entity is replaced by a new one.
void setSceneUpdatesEnabled(bool enabled)
Sets whether updates of the 3D scene's entities are allowed.
void setSceneOriginShiftEnabled(bool enabled)
Returns whether the 3D scene is allowed to automatically move the scene's origin.
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.