16#ifndef QGS3DMAPSCENE_H
17#define QGS3DMAPSCENE_H
21#include <Qt3DCore/QEntity>
31 class QRenderSettings;
44 class QForwardRenderer;
56class QgsTerrainEntity;
57class QgsChunkedEntity;
109 QVector<QgsPointXY> viewFrustum2DExtent();
112 int terrainPendingJobsCount()
const;
118 int totalPendingJobsCount()
const;
139 float worldSpaceError(
float epsilon,
float distance );
194 static QMap< QString, Qgs3DMapScene * > openScenes();
229 void updateTemporal();
232 void onCameraChanged();
233 void onFrameTriggered(
float dt );
234 void createTerrain();
235 void onLayerRenderer3DChanged();
236 void onLayersChanged();
237 void createTerrainDeferred();
238 void onBackgroundColorChanged();
239 void onLayerEntityPickedObject( Qt3DRender::QPickEvent *pickEvent,
QgsFeatureId fid );
241 void updateCameraLens();
242 void onRenderersChanged();
243 void onSkyboxSettingsChanged();
244 void onShadowSettingsChanged();
245 void onAmbientOcclusionSettingsChanged();
246 void onEyeDomeShadingSettingsChanged();
247 void onDebugShadowMapSettingsChanged();
248 void onDebugDepthMapSettingsChanged();
249 void onCameraMovementSpeedChanged();
250 void onCameraNavigationModeChanged();
251 void onDebugOverlayEnabledChanged();
253 void on3DAxisSettingsChanged();
255 bool updateCameraNearFarPlanes();
265 void addCameraViewCenterEntity( Qt3DRender::QCamera *camera );
268 void updateSceneState();
270 void finalizeNewEntity( Qt3DCore::QEntity *newEntity );
271 int maximumTextureSize()
const;
277 Qt3DLogic::QFrameAction *mFrameAction =
nullptr;
279 QgsTerrainEntity *mTerrain =
nullptr;
280 QList<QgsChunkedEntity *> mChunkEntities;
282 Qt3DCore::QEntity *mEntityCameraViewCenter =
nullptr;
284 QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
285 QMap<const QgsAbstract3DRenderer *, Qt3DCore::QEntity *> mRenderersEntities;
286 bool mTerrainUpdateScheduled =
false;
289 QList<Qgs3DMapScenePickHandler *> mPickHandlers;
291 QList<Qt3DCore::QEntity *> mLightEntities;
292 QList<QgsMapLayer *> mModelVectorLayers;
295 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.
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.
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.
QgsCameraController * cameraController()
Returns camera controller.
static std::function< QMap< QString, Qgs3DMapScene * >() > sOpenScenesFunction
Static function for returning open 3D map scenes.
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.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features