16#ifndef QGS3DMAPSETTINGS_H
17#define QGS3DMAPSETTINGS_H
24#include <Qt3DRender/QCamera>
67 void resolveReferences(
const QgsProject &project );
163 void setBackgroundColor(
const QColor &color );
165 QColor backgroundColor()
const;
168 void setSelectionColor(
const QColor &color );
170 QColor selectionColor()
const;
180 void setLayers(
const QList<QgsMapLayer *> &layers );
190 QList<QgsMapLayer *> layers()
const;
207 void setTerrainVerticalScale(
double zScale );
209 double terrainVerticalScale()
const;
215 void setMapTileResolution(
int res );
221 int mapTileResolution()
const;
227 void setMaxTerrainScreenError(
float error );
236 float maxTerrainScreenError()
const;
242 void setMaxTerrainGroundError(
float error );
250 float maxTerrainGroundError()
const;
257 void setTerrainElevationOffset(
float offset );
290 return mTerrainGenerator.get();
298 void setTerrainShadingEnabled(
bool enabled );
327 void setTerrainMapTheme(
const QString &theme );
342 void setShowTerrainBoundingBoxes(
bool enabled );
346 void setShowTerrainTilesInfo(
bool enabled );
354 void setShowCameraViewCenter(
bool enabled );
366 void setShowCameraRotationCenter(
bool enabled );
378 void setShowLightSourceOrigins(
bool enabled );
387 void setShowLabels(
bool enabled );
396 void setEyeDomeLightingEnabled(
bool enabled );
405 void setEyeDomeLightingStrength(
double strength );
414 void setEyeDomeLightingDistance(
int distance );
423 void setDebugShadowMapSettings(
bool enabled, Qt::Corner corner,
double size );
436 void setDebugDepthMapSettings(
bool enabled, Qt::Corner corner,
double size );
449 QList<QgsLightSource *> lightSources()
const;
459 void setLightSources(
const QList<QgsLightSource *> &lights
SIP_TRANSFER );
471 void setFieldOfView(
const float fieldOfView );
483 void setProjectionType(
const Qt3DRender::QCameraLens::ProjectionType projectionType )
SIP_SKIP;
510 void setCameraMovementSpeed(
double movementSpeed );
589 void setIsFpsCounterEnabled(
bool fpsCounterEnabled );
603 void setTerrainRenderingEnabled(
bool terrainRenderingEnabled );
647 void setViewFrustumVisualizationEnabled(
bool enabled );
666 bool isDebugOverlayEnabled()
const {
return mIsDebugOverlayEnabled; }
676 void setIsDebugOverlayEnabled(
bool debugOverlayEnabled );
689 void setShowExtentIn2DView(
bool show );
911 void connectChangedSignalsToSettingsChanged();
917 QColor mBackgroundColor = Qt::black;
918 QColor mSelectionColor;
919 double mTerrainVerticalScale = 1;
920 std::unique_ptr<QgsTerrainGenerator> mTerrainGenerator;
921 int mMapTileResolution = 512;
922 float mMaxTerrainScreenError = 3.f;
923 float mMaxTerrainGroundError = 1.f;
924 float mTerrainElevationOffset = 0.0f;
925 bool mTerrainShadingEnabled =
false;
927 QString mTerrainMapTheme;
928 bool mShowTerrainBoundingBoxes =
false;
929 bool mShowTerrainTileInfo =
false;
930 bool mShowCameraViewCenter =
false;
931 bool mShowCameraRotationCenter =
false;
932 bool mShowLightSources =
false;
933 bool mShowLabels =
false;
934 QList< QgsLightSource * > mLightSources;
935 float mFieldOfView = 45.0f;
936 Qt3DRender::QCameraLens::ProjectionType mProjectionType = Qt3DRender::QCameraLens::PerspectiveProjection;
938 double mCameraMovementSpeed = 5.0;
939 QList<QgsMapLayerRef> mLayers;
945 bool mIsFpsCounterEnabled =
false;
947 bool mIsSkyboxEnabled =
false;
952 bool mEyeDomeLightingEnabled =
false;
953 double mEyeDomeLightingStrength = 1000.0;
954 int mEyeDomeLightingDistance = 1;
957 bool mVisualizeViewFrustum =
false;
959 bool mDebugShadowMapEnabled =
false;
960 Qt::Corner mDebugShadowMapCorner = Qt::Corner::TopLeftCorner;
961 double mDebugShadowMapSize = 0.2;
963 bool mDebugDepthMapEnabled =
false;
964 Qt::Corner mDebugDepthMapCorner = Qt::Corner::TopRightCorner;
965 double mDebugDepthMapSize = 0.2;
967 bool mTerrainRenderingEnabled =
true;
973 bool mIsDebugOverlayEnabled =
false;
977 bool mShowExtentIn2DView =
false;
QFlags< ViewSyncModeFlag > ViewSyncModeFlags
NavigationMode
The navigation mode used by 3D cameras.
@ TerrainBased
The default navigation based on the terrain.
RendererUsage
Usage of the renderer.
Contains the configuration of a 3d axis.
void extentChanged()
Emitted when the 3d view's 2d extent has changed.
void mapTileResolutionChanged()
Emitted when the map tile resoulution has changed.
void terrainVerticalScaleChanged()
Emitted when the vertical scale of the terrain has changed.
Qt::Corner debugDepthMapCorner() const
Returns the corner where the shadow map preview is displayed.
void settingsChanged()
Emitted when one of the configuration settings has changed.
void renderersChanged()
Emitted when the list of map's extra renderers have been modified.
void eyeDomeLightingDistanceChanged()
Emitted when the eye dome lighting distance has changed.
void terrainShadingChanged()
Emitted when terrain shading enabled flag or terrain shading material has changed.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
bool showExtentIn2DView() const
Returns whether the extent is displayed on the main 2D map canvas.
double cameraMovementSpeed() const
Returns the camera movement speed.
Qt3DRender::QCameraLens::ProjectionType projectionType() const
Returns the camera lens' projection type.
bool debugDepthMapEnabled() const
Returns whether the shadow map debugging is enabled.
bool isSkyboxEnabled() const
Returns whether the skybox is enabled.
void debugDepthMapSettingsChanged()
Emitted when depth map debugging has changed.
double outputDpi() const
Returns DPI used for conversion between real world units (e.g.
Qgis::NavigationMode cameraNavigationMode() const
Returns the navigation mode used by the camera.
double eyeDomeLightingStrength() const
Returns the eye dome lighting strength value.
void backgroundColorChanged()
Emitted when the background color has changed.
void showTerrainBoundingBoxesChanged()
Emitted when the flag whether terrain's bounding boxes are shown has changed.
Qt::Corner debugShadowMapCorner() const
Returns the corner where the shadow map preview is displayed.
void setMapThemeCollection(QgsMapThemeCollection *mapThemes)
Sets pointer to the collection of map themes.
bool showCameraViewCenter() const
Returns whether to show camera's view center as a sphere (for debugging)
void showCameraRotationCenterChanged()
Emitted when the flag whether camera's rotation center is shown has changed.
void directionalLightsChanged()
Emitted when the list of directional lights changes.
void cameraNavigationModeChanged()
Emitted when the camera navigation mode was changed.
void shadowSettingsChanged()
Emitted when shadow rendering settings are changed.
void eyeDomeLightingEnabledChanged()
Emitted when the flag whether eye dome lighting is used has changed.
void debugOverlayEnabledChanged(bool debugOverlayEnabled)
Emitted when the debug overaly is enabled or disabled.
void setOutputDpi(const double dpi)
Sets DPI used for conversion between real world units (e.g.
void setIsSkyboxEnabled(bool enabled)
Sets whether the skybox is enabled.
void setOrigin(const QgsVector3D &origin)
Sets coordinates in map CRS at which our 3D world has origin (0,0,0)
void skyboxSettingsChanged()
Emitted when skybox settings are changed.
QgsShadowSettings shadowSettings() const
Returns the current configuration of shadows.
void terrainMapThemeChanged()
Emitted when terrain's map theme has changed.
void pointLightsChanged()
Emitted when the list of point lights changes.
double debugDepthMapSize() const
Returns the size of the shadow map preview.
Qgs3DAxisSettings get3DAxisSettings() const
Returns the current configuration of 3d axis.
bool viewFrustumVisualizationEnabled() const
Returns whether the camera's view frustum is visualized on the 2D map canvas.
void projectionTypeChanged()
Emitted when the camera lens projection type changes.
float fieldOfView() const
Returns the camera lens' field of view.
void selectionColorChanged()
Emitted when the selection color has changed.
QgsAmbientOcclusionSettings ambientOcclusionSettings() const
Returns the current configuration of screen space ambient occlusion.
QgsRectangle extent() const
Returns the 3D scene's 2D extent in the 3D scene's CRS.
Qgis::ViewSyncModeFlags viewSyncMode() const
Returns the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation)
float terrainElevationOffset() const
Returns the elevation offset of the terrain (used to move the terrain up or down)
int eyeDomeLightingDistance() const
Returns the eye dome lighting distance value (contributes to the contrast of the image)
void lightSourcesChanged()
Emitted when any of the light source settings in the map changes.
void showLightSourceOriginsChanged()
Emitted when the flag whether light source origins are shown has changed.
QgsTerrainGenerator * terrainGenerator() const
Returns the terrain generator.
double debugShadowMapSize() const
Returns the size of the shadow map preview.
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
bool showTerrainBoundingBoxes() const
Returns whether to display bounding boxes of terrain tiles (for debugging)
void showLabelsChanged()
Emitted when the flag whether labels are displayed on terrain tiles has changed.
Qgs3DMapSettings & operator=(Qgs3DMapSettings const &)=delete
void maxTerrainScreenErrorChanged()
Emitted when the maximum terrain screen error has changed.
bool showLabels() const
Returns whether to display labels on terrain tiles.
void terrainElevationOffsetChanged(float newElevation)
Emitted when the terrain elevation offset is changed.
bool debugShadowMapEnabled() const
Returns whether the shadow map debugging is enabled.
bool terrainRenderingEnabled() const
Returns whether the 2D terrain surface will be rendered.
void fpsCounterEnabledChanged(bool fpsCounterEnabled)
Emitted when the FPS counter is enabled or disabled.
void axisSettingsChanged()
Emitted when 3d axis rendering settings are changed.
void viewFrustumVisualizationEnabledChanged()
Emitted when the camera's view frustum visualization on the main 2D map canvas is enabled or disabled...
void ambientOcclusionSettingsChanged()
Emitted when ambient occlusion rendering settings are changed.
bool showTerrainTilesInfo() const
Returns whether to display extra tile info on top of terrain tiles (for debugging)
void showExtentIn2DViewChanged()
Emitted when the parameter to display 3d view's extent in the 2D canvas has changed.
void layersChanged()
Emitted when the list of map layers for 3d rendering has changed.
void showTerrainTilesInfoChanged()
Emitted when the flag whether terrain's tile info is shown has changed.
void eyeDomeLightingStrengthChanged()
Emitted when the eye dome lighting strength has changed.
QgsSkyboxSettings skyboxSettings() const
Returns the current configuration of the skybox.
bool isTerrainShadingEnabled() const
Returns whether terrain shading is enabled.
void cameraMovementSpeedChanged()
Emitted when the camera movement speed was changed.
QgsCoordinateReferenceSystem crs() const
Returns coordinate reference system used in the 3D scene.
bool eyeDomeLightingEnabled() const
Returns whether eye dome lighting is used.
QgsPhongMaterialSettings terrainShadingMaterial() const
Returns terrain shading material.
bool isFpsCounterEnabled() const
Returns whether FPS counter label is enabled.
QString terrainMapTheme() const
Returns name of the map theme (from the active project) that will be used for terrain's texture.
void fieldOfViewChanged()
Emitted when the camera lens field of view changes.
QgsMapThemeCollection * mapThemeCollection() const
Returns pointer to the collection of map themes.
void terrainGeneratorChanged()
Emitted when the terrain generator has changed.
bool showLightSourceOrigins() const
Returns whether to show light source origins as a sphere (for debugging)
void debugShadowMapSettingsChanged()
Emitted when shadow map debugging has changed.
void showCameraViewCenterChanged()
Emitted when the flag whether camera's view center is shown has changed.
void maxTerrainGroundErrorChanged()
Emitted when the maximum terrain ground error has changed.
QgsVector3D origin() const
Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
bool showCameraRotationCenter() const
Returns whether to show camera's rotation center as a sphere (for debugging)
Base class for all renderers that may to participate in 3D view.
class containing the configuration of ambient occlusion rendering 3
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Base class for all map layer types.
Container class that allows storage of map themes consisting of visible map layers and layer styles.
Resolves relative paths into absolute paths and vice versa.
Contains elevation properties for a QgsProject.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Represents a raster layer.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
class containing the configuration of shadows rendering 3
Contains the configuration of a skybox entity.
Base class for objects with an associated (optional) temporal range.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
const QgsCoordinateReferenceSystem & crs