QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGS3DMAPSETTINGS_H
17 #define QGS3DMAPSETTINGS_H
24 #include <Qt3DRender/QCamera>
74 void resolveReferences(
const QgsProject &project );
153 void setBackgroundColor(
const QColor &color );
155 QColor backgroundColor()
const;
158 void setSelectionColor(
const QColor &color );
160 QColor selectionColor()
const;
170 void setLayers(
const QList<QgsMapLayer *> &layers );
180 QList<QgsMapLayer *> layers()
const;
197 void setTerrainVerticalScale(
double zScale );
199 double terrainVerticalScale()
const;
205 void setMapTileResolution(
int res );
211 int mapTileResolution()
const;
217 void setMaxTerrainScreenError(
float error );
226 float maxTerrainScreenError()
const;
232 void setMaxTerrainGroundError(
float error );
240 float maxTerrainGroundError()
const;
247 void setTerrainElevationOffset(
float offset );
279 return mTerrainGenerator.get();
287 void setTerrainShadingEnabled(
bool enabled );
316 void setTerrainMapTheme(
const QString &theme );
331 void setRenderers(
const QList<QgsAbstract3DRenderer *> &renderers
SIP_TRANSFER );
333 QList<QgsAbstract3DRenderer *>
renderers()
const {
return mRenderers; }
336 void setShowTerrainBoundingBoxes(
bool enabled );
340 void setShowTerrainTilesInfo(
bool enabled );
348 void setShowCameraViewCenter(
bool enabled );
360 void setShowCameraRotationCenter(
bool enabled );
372 void setShowLightSourceOrigins(
bool enabled );
381 void setShowLabels(
bool enabled );
390 void setEyeDomeLightingEnabled(
bool enabled );
399 void setEyeDomeLightingStrength(
double strength );
408 void setEyeDomeLightingDistance(
int distance );
417 void setDebugShadowMapSettings(
bool enabled, Qt::Corner corner,
double size );
430 void setDebugDepthMapSettings(
bool enabled, Qt::Corner corner,
double size );
443 QList<QgsLightSource *> lightSources()
const;
453 void setLightSources(
const QList<QgsLightSource *> &lights
SIP_TRANSFER );
465 void setFieldOfView(
const float fieldOfView );
477 void setProjectionType(
const Qt3DRender::QCameraLens::ProjectionType projectionType )
SIP_SKIP;
504 void setCameraMovementSpeed(
double movementSpeed );
571 void setIsFpsCounterEnabled(
bool fpsCounterEnabled );
585 void setTerrainRenderingEnabled(
bool terrainRenderingEnabled );
615 void setViewSyncMode( Qgis::ViewSyncModeFlags mode );
629 void setViewFrustumVisualizationEnabled(
bool enabled );
658 void setIsDebugOverlayEnabled(
bool debugOverlayEnabled );
667 void settingsChanged();
670 void backgroundColorChanged();
672 void selectionColorChanged();
680 void layersChanged();
683 void terrainGeneratorChanged();
685 void terrainVerticalScaleChanged();
687 void mapTileResolutionChanged();
689 void maxTerrainScreenErrorChanged();
691 void maxTerrainGroundErrorChanged();
697 void terrainElevationOffsetChanged(
float newElevation );
703 void terrainShadingChanged();
709 void terrainMapThemeChanged();
715 void renderersChanged();
718 void showTerrainBoundingBoxesChanged();
720 void showTerrainTilesInfoChanged();
726 void showCameraViewCenterChanged();
732 void showCameraRotationCenterChanged();
738 void showLightSourceOriginsChanged();
741 void showLabelsChanged();
747 void eyeDomeLightingEnabledChanged();
753 void eyeDomeLightingStrengthChanged();
759 void eyeDomeLightingDistanceChanged();
765 void debugShadowMapSettingsChanged();
771 void debugDepthMapSettingsChanged();
777 void pointLightsChanged();
783 void lightSourcesChanged();
789 void directionalLightsChanged();
795 void fieldOfViewChanged();
801 void projectionTypeChanged();
807 void cameraNavigationModeChanged();
813 void cameraMovementSpeedChanged();
819 void skyboxSettingsChanged();
825 void shadowSettingsChanged();
831 void fpsCounterEnabledChanged(
bool fpsCounterEnabled );
838 void viewFrustumVisualizationEnabledChanged();
844 void axisSettingsChanged();
850 void debugOverlayEnabledChanged(
bool debugOverlayEnabled );
859 void connectChangedSignalsToSettingsChanged();
865 QColor mBackgroundColor = Qt::black;
866 QColor mSelectionColor;
867 double mTerrainVerticalScale = 1;
868 std::unique_ptr<QgsTerrainGenerator> mTerrainGenerator;
869 int mMapTileResolution = 512;
870 float mMaxTerrainScreenError = 3.f;
871 float mMaxTerrainGroundError = 1.f;
872 float mTerrainElevationOffset = 0.0f;
873 bool mTerrainShadingEnabled =
false;
875 QString mTerrainMapTheme;
876 bool mShowTerrainBoundingBoxes =
false;
877 bool mShowTerrainTileInfo =
false;
878 bool mShowCameraViewCenter =
false;
879 bool mShowCameraRotationCenter =
false;
880 bool mShowLightSources =
false;
881 bool mShowLabels =
false;
882 QList< QgsLightSource * > mLightSources;
883 float mFieldOfView = 45.0f;
884 Qt3DRender::QCameraLens::ProjectionType mProjectionType = Qt3DRender::QCameraLens::PerspectiveProjection;
886 double mCameraMovementSpeed = 5.0;
887 QList<QgsMapLayerRef> mLayers;
888 QList<QgsAbstract3DRenderer *> mRenderers;
894 bool mIsFpsCounterEnabled =
false;
896 bool mIsSkyboxEnabled =
false;
900 bool mEyeDomeLightingEnabled =
false;
901 double mEyeDomeLightingStrength = 1000.0;
902 int mEyeDomeLightingDistance = 1;
904 Qgis::ViewSyncModeFlags mViewSyncMode;
905 bool mVisualizeViewFrustum =
false;
907 bool mDebugShadowMapEnabled =
false;
908 Qt::Corner mDebugShadowMapCorner = Qt::Corner::TopLeftCorner;
909 double mDebugShadowMapSize = 0.2;
911 bool mDebugDepthMapEnabled =
false;
912 Qt::Corner mDebugDepthMapCorner = Qt::Corner::TopRightCorner;
913 double mDebugDepthMapSize = 0.2;
915 bool mTerrainRenderingEnabled =
true;
921 bool mIsDebugOverlayEnabled =
false;
926 #endif // QGS3DMAPSETTINGS_H
bool showLightSourceOrigins() const
Returns whether to show light source origins as a sphere (for debugging)
QgsCoordinateReferenceSystem crs() const
Returns coordinate reference system used in the 3D scene.
Contains information about the context in which a coordinate transform is executed.
QgsPhongMaterialSettings terrainShadingMaterial() const
Returns terrain shading material.
The class is used as a container of context for various read/write operations on other objects.
double outputDpi() const
Returns DPI used for conversion between real world units (e.g.
QgsMapThemeCollection * mapThemeCollection() const
Returns pointer to the collection of map themes.
bool terrainRenderingEnabled() const
Returns whether the 2D terrain surface will be rendered.
Base class for all renderers that may to participate in 3D view.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
const QgsCoordinateReferenceSystem & crs
Qgis::ViewSyncModeFlags viewSyncMode() const
Returns the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation)
int eyeDomeLightingDistance() const
Returns the eye dome lighting distance value (contributes to the contrast of the image)
Contains the configuration of a skybox entity.
bool viewFrustumVisualizationEnabled() const
Returns whether the camera's view frustum is visualized on the 2D map canvas.
Contains elevation properties for a QgsProject.
double debugShadowMapSize() const
Returns the size of the shadow map preview.
bool isDebugOverlayEnabled() const
Returns whether debug overlay is enabled.
Qt::Corner debugDepthMapCorner() const
Returns the corner where the shadow map preview is displayed.
QString terrainMapTheme() const
Returns name of the map theme (from the active project) that will be used for terrain's texture.
A rectangle specified with double values.
Qgs3DAxisSettings get3dAxisSettings() const
Returns the current configuration of 3d axis.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
bool showLabels() const
Returns whether to display labels on terrain tiles.
Basic shading material used for rendering based on the Phong shading model with three color component...
Qt3DRender::QCameraLens::ProjectionType projectionType() const
Returns the camera lens' projection type.
double cameraMovementSpeed() const
Returns the camera movement speed.
Qt::Corner debugShadowMapCorner() const
Returns the corner where the shadow map preview is displayed.
Base class for generators of terrain.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
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)
Contains the configuration of a 3d axis.
float fieldOfView() const
Returns the camera lens' field of view.
Represents a raster layer.
QgsVector3D origin() const
Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
This class represents a coordinate reference system (CRS).
float terrainElevationOffset() const
Returns the elevation offset of the terrain (used to move the terrain up or down)
QgsTerrainGenerator * terrainGenerator() const
Returns the terrain generator.
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
bool debugShadowMapEnabled() const
Returns whether the shadow map debugging is enabled.
bool debugDepthMapEnabled() const
Returns whether the shadow map debugging is enabled.
void setMapThemeCollection(QgsMapThemeCollection *mapThemes)
Sets pointer to the collection of map themes.
QgsShadowSettings shadowSettings() const
Returns the current configuration of shadows.
Base class for all map layer types. This is the base class for all map layer types (vector,...
QList< QgsAbstract3DRenderer * > renderers() const
Returns list of extra 3D renderers.
bool showCameraRotationCenter() const
Returns whether to show camera's rotation center as a sphere (for debugging)
class containing the configuration of shadows rendering
bool showTerrainBoundingBoxes() const
Returns whether to display bounding boxes of terrain tiles (for debugging)
double eyeDomeLightingStrength() const
Returns the eye dome lighting strength value.
bool eyeDomeLightingEnabled() const
Returns whether eye dome lighting is used.
RendererUsage
Usage of the renderer.
bool isFpsCounterEnabled() const
Returns whether FPS counter label is enabled.
bool showTerrainTilesInfo() const
Returns whether to display extra tile info on top of terrain tiles (for debugging)
double debugDepthMapSize() const
Returns the size of the shadow map preview.
Container class that allows storage of map themes consisting of visible map layers and layer styles.
bool showCameraViewCenter() const
Returns whether to show camera's view center as a sphere (for debugging)
QgsSkyboxSettings skyboxSettings() const
Returns the current configuration of the skybox.
bool isSkyboxEnabled() const
Returns whether the skybox is enabled.
Resolves relative paths into absolute paths and vice versa. Used for writing.
Base class for objects with an associated (optional) temporal range.
bool isTerrainShadingEnabled() const
Returns whether terrain shading is enabled.
NavigationMode
The navigation mode used by the camera.
QgsCameraController::NavigationMode cameraNavigationMode() const
Returns the navigation mode used by the camera.