16#ifndef QGS3DMAPSCENE_H
17#define QGS3DMAPSCENE_H
21#include <Qt3DCore/QEntity>
30 class QRenderSettings;
41 class QForwardRenderer;
52class QgsTerrainEntity;
54class QgsChunkedEntity;
60class Qgs3DMapSceneEntity;
113 QVector<QgsPointXY> viewFrustum2DExtent()
const;
119 int totalPendingJobsCount()
const;
135 float worldSpaceError(
float epsilon,
float distance )
const;
177 QgsDoubleRange elevationRange(
bool ignoreTerrain =
false )
const;
252 Q_DECL_DEPRECATED
static QMap<QString, Qgs3DMapScene *> openScenes()
SIP_DEPRECATED;
274 void enableClipping( const QList<QVector4D> &clipPlaneEquations );
282 void disableClipping();
290 void addSceneEntity( Qgs3DMapSceneEntity *entity )
SIP_SKIP;
297 void removeSceneEntity( Qgs3DMapSceneEntity *entity )
SIP_SKIP;
305 QList<QVector4D> clipPlaneEquations()
const {
return mClipPlanesEquations; };
309 static std::function<QMap<QString, Qgs3DMapScene *>()> sOpenScenesFunction;
345 void updateTemporal();
348 void onCameraChanged();
349 void onFrameTriggered(
float dt );
350 void createTerrain();
351 void onLayerRenderer3DChanged();
352 void onLayersChanged();
353 void createTerrainDeferred();
354 void onBackgroundColorChanged();
356 void updateCameraLens();
357 void onSkyboxSettingsChanged();
358 void onShadowSettingsChanged();
359 void onAmbientOcclusionSettingsChanged();
360 void onEyeDomeShadingSettingsChanged();
361 void onDebugShadowMapSettingsChanged();
362 void onDebugDepthMapSettingsChanged();
363 void onCameraMovementSpeedChanged();
364 void onCameraNavigationModeChanged();
365 void onDebugOverlayEnabledChanged();
366 void onStopUpdatesChanged();
367 void on3DAxisSettingsChanged();
369 void onOriginChanged();
371 bool updateCameraNearFarPlanes();
381 void addCameraViewCenterEntity( Qt3DRender::QCamera *camera );
384 void updateSceneState();
385 void updateScene(
bool forceUpdate =
false );
386 void finalizeNewEntity( Qt3DCore::QEntity *newEntity );
387 int maximumTextureSize()
const;
389 void handleClippingOnEntity( QEntity *entity )
const;
390 void handleClippingOnAllEntities()
const;
396 Qt3DLogic::QFrameAction *mFrameAction =
nullptr;
398 QgsTerrainEntity *mTerrain =
nullptr;
399 QgsGlobeEntity *mGlobe =
nullptr;
400 QList<Qgs3DMapSceneEntity *> mSceneEntities;
402 Qt3DCore::QEntity *mEntityCameraViewCenter =
nullptr;
404 QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
405 bool mTerrainUpdateScheduled =
false;
408 QList<Qt3DCore::QEntity *> mLightEntities;
409 QList<QgsMapLayer *> mModelVectorLayers;
412 Qt3DCore::QEntity *mEntityRotationCenter =
nullptr;
417 bool mSceneUpdatesEnabled =
true;
418 bool mSceneOriginShiftEnabled =
true;
420 QList<QVector4D> mClipPlanesEquations;
421 int mMaxClipPlanes = 6;
Display 3D ortho axis in the main 3D view.
Manages the various settings the user can choose from when exporting a 3D scene.
Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.
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.
QgsGlobeEntity * globeEntity()
Returns globe entity (may be nullptr if not using globe scene, terrain rendering is disabled or when ...
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.
QgsTerrainEntity * terrainEntity()
Returns terrain entity (may be nullptr if using globe scene, terrain rendering is disabled or when te...
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 3D engine implementation.
Base class for all renderers that participate in 3D views.
Object that controls camera movement based on user input.
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.