37#include <QDomDocument>
41#include "moc_qgs3dmapsettings.cpp"
43using namespace Qt::StringLiterals;
49 connectChangedSignalsToSettingsChanged();
50 mTerrainSettings = std::make_unique<QgsFlatTerrainSettings>();
56 , mOrigin( other.mOrigin )
58 , mBackgroundColor( other.mBackgroundColor )
59 , mSelectionColor( other.mSelectionColor )
60 , mTerrainShadingEnabled( other.mTerrainShadingEnabled )
61 , mTerrainShadingMaterial( other.mTerrainShadingMaterial )
62 , mTerrainMapTheme( other.mTerrainMapTheme )
63 , mShowTerrainBoundingBoxes( other.mShowTerrainBoundingBoxes )
64 , mShowTerrainTileInfo( other.mShowTerrainTileInfo )
65 , mShowCameraViewCenter( other.mShowCameraViewCenter )
66 , mShowCameraRotationCenter( other.mShowCameraRotationCenter )
67 , mShowLightSources( other.mShowLightSources )
68 , mShowLabels( other.mShowLabels )
69 , mStopUpdates( other.mStopUpdates )
70 , mShowDebugPanel( other.mShowDebugPanel )
71 , mFieldOfView( other.mFieldOfView )
72 , mProjectionType( other.mProjectionType )
73 , mCameraNavigationMode( other.mCameraNavigationMode )
74 , mCameraMovementSpeed( other.mCameraMovementSpeed )
75 , mLayers( other.mLayers )
76 , mTransformContext( other.mTransformContext )
77 , mPathResolver( other.mPathResolver )
78 , mMapThemes( other.mMapThemes )
80 , mIsFpsCounterEnabled( other.mIsFpsCounterEnabled )
81 , mShadowSettings( other.mShadowSettings )
82 , mAmbientOcclusionSettings( other.mAmbientOcclusionSettings )
83 , mEyeDomeLightingEnabled( other.mEyeDomeLightingEnabled )
84 , mEyeDomeLightingStrength( other.mEyeDomeLightingStrength )
85 , mEyeDomeLightingDistance( other.mEyeDomeLightingDistance )
86 , mMsaaEnabled( other.mMsaaEnabled )
87 , mTextureFilterQuality( other.mTextureFilterQuality )
88 , mViewSyncMode( other.mViewSyncMode )
89 , mVisualizeViewFrustum( other.mVisualizeViewFrustum )
90 , mDebugShadowMapEnabled( other.mDebugShadowMapEnabled )
91 , mDebugShadowMapCorner( other.mDebugShadowMapCorner )
92 , mDebugShadowMapSize( other.mDebugShadowMapSize )
93 , mDebugDepthMapEnabled( other.mDebugDepthMapEnabled )
94 , mDebugDepthMapCorner( other.mDebugDepthMapCorner )
95 , mDebugDepthMapSize( other.mDebugDepthMapSize )
96 , mTerrainRenderingEnabled( other.mTerrainRenderingEnabled )
97 , mRendererUsage( other.mRendererUsage )
98 , m3dAxisSettings( other.m3dAxisSettings )
99 , mIsDebugOverlayEnabled( other.mIsDebugOverlayEnabled )
100 , mExtent( other.mExtent )
101 , mShowExtentIn2DView( other.mShowExtentIn2DView )
102 , mShow2DMapOverlay( other.mShow2DMapOverlay )
106 if ( other.mBackgroundSettings )
107 mBackgroundSettings.reset( other.mBackgroundSettings->clone() );
109 for (
QgsLightSource *source : std::as_const( other.mLightSources ) )
112 mLightSources << source->clone();
116 connectChangedSignalsToSettingsChanged();
121 qDeleteAll( mLightSources );
129 QDomElement elemOrigin = elem.firstChildElement( u
"origin"_s );
132 elemOrigin.attribute( u
"x"_s ).toDouble(),
133 elemOrigin.attribute( u
"y"_s ).toDouble(),
134 elemOrigin.attribute( u
"z"_s ).toDouble()
138 QDomElement elemExtent = elem.firstChildElement( u
"extent"_s );
139 if ( !elemExtent.isNull() )
143 elemExtent.attribute( u
"xMin"_s ).toDouble(),
144 elemExtent.attribute( u
"yMin"_s ).toDouble(),
145 elemExtent.attribute( u
"xMax"_s ).toDouble(),
146 elemExtent.attribute( u
"yMax"_s ).toDouble()
150 mShowExtentIn2DView = elemExtent.attribute( u
"showIn2dView"_s, u
"0"_s ).toInt();
157 QDomElement elemCamera = elem.firstChildElement( u
"camera"_s );
158 if ( !elemCamera.isNull() )
160 mFieldOfView = elemCamera.attribute( u
"field-of-view"_s, u
"45"_s ).toFloat();
161 mProjectionType =
static_cast<Qt3DRender::QCameraLens::ProjectionType
>( elemCamera.attribute( u
"projection-type"_s, u
"1"_s ).toInt() );
162 QString
cameraNavigationMode = elemCamera.attribute( u
"camera-navigation-mode"_s, u
"basic-navigation"_s );
169 mCameraMovementSpeed = elemCamera.attribute( u
"camera-movement-speed"_s, u
"5.0"_s ).toDouble();
172 QDomElement elemColor = elem.firstChildElement( u
"color"_s );
173 if ( !elemColor.isNull() )
179 QDomElement elemCrs = elem.firstChildElement( u
"crs"_s );
180 mCrs.readXml( elemCrs );
182 QDomElement elemTerrain = elem.firstChildElement( u
"terrain"_s );
183 mTerrainRenderingEnabled = elemTerrain.attribute( u
"terrain-rendering-enabled"_s, u
"1"_s ).toInt();
184 mTerrainShadingEnabled = elemTerrain.attribute( u
"shading-enabled"_s, u
"0"_s ).toInt();
186 QDomElement elemTerrainShadingMaterial = elemTerrain.firstChildElement( u
"shading-material"_s );
187 if ( !elemTerrainShadingMaterial.isNull() )
188 mTerrainShadingMaterial.readXml( elemTerrainShadingMaterial, context );
189 mTerrainMapTheme = elemTerrain.attribute( u
"map-theme"_s );
190 mShowLabels = elemTerrain.attribute( u
"show-labels"_s, u
"0"_s ).toInt();
192 qDeleteAll( mLightSources );
193 mLightSources.clear();
194 const QDomElement lightsElem = elem.firstChildElement( u
"lights"_s );
195 if ( !lightsElem.isNull() )
197 const QDomNodeList lightNodes = lightsElem.childNodes();
198 for (
int i = 0; i < lightNodes.size(); ++i )
200 const QDomElement lightElement = lightNodes.at( i ).toElement();
202 mLightSources << light;
208 QDomElement elemPointLights = elem.firstChildElement( u
"point-lights"_s );
209 if ( !elemPointLights.isNull() )
211 QDomElement elemPointLight = elemPointLights.firstChildElement( u
"point-light"_s );
212 while ( !elemPointLight.isNull() )
214 auto pointLight = std::make_unique<QgsPointLightSettings>();
215 pointLight->readXml( elemPointLight, context );
216 mLightSources << pointLight.release();
217 elemPointLight = elemPointLight.nextSiblingElement( u
"point-light"_s );
223 auto defaultLight = std::make_unique<QgsPointLightSettings>();
224 defaultLight->setPosition(
QgsVector3D( 0, 1000, 0 ) );
225 mLightSources << defaultLight.release();
228 QDomElement elemDirectionalLights = elem.firstChildElement( u
"directional-lights"_s );
229 if ( !elemDirectionalLights.isNull() )
231 QDomElement elemDirectionalLight = elemDirectionalLights.firstChildElement( u
"directional-light"_s );
232 while ( !elemDirectionalLight.isNull() )
234 auto directionalLight = std::make_unique<QgsDirectionalLightSettings>();
235 directionalLight->readXml( elemDirectionalLight, context );
236 mLightSources << directionalLight.release();
237 elemDirectionalLight = elemDirectionalLight.nextSiblingElement( u
"directional-light"_s );
242 QDomElement elemMapLayers = elemTerrain.firstChildElement( u
"layers"_s );
243 QDomElement elemMapLayer = elemMapLayers.firstChildElement( u
"layer"_s );
244 QList<QgsMapLayerRef> mapLayers;
245 while ( !elemMapLayer.isNull() )
248 elemMapLayer = elemMapLayer.nextSiblingElement( u
"layer"_s );
252 QDomElement elemTerrainGenerator = elemTerrain.firstChildElement( u
"generator"_s );
253 const QString terrainGenType = elemTerrainGenerator.attribute( u
"type"_s );
261 mBackgroundSettings.reset();
262 QDomElement elemBackground = elem.firstChildElement( u
"background"_s );
263 if ( !elemBackground.isNull() )
269 auto skybox = std::make_unique<QgsSkyboxSettings>();
270 skybox->readXml( elemBackground, context );
271 mBackgroundSettings = std::move( skybox );
276 auto gradient = std::make_unique<QgsFixedGradientBackgroundSettings>();
277 gradient->readXml( elemBackground, context );
278 mBackgroundSettings = std::move( gradient );
286 QDomElement elemShadows = elem.firstChildElement( u
"shadow-rendering"_s );
287 mShadowSettings.readXml( elemShadows, context );
289 QDomElement elemAmbientOcclusion = elem.firstChildElement( u
"screen-space-ambient-occlusion"_s );
290 mAmbientOcclusionSettings.readXml( elemAmbientOcclusion, context );
292 QDomElement elemEyeDomeLighting = elem.firstChildElement( u
"eye-dome-lighting"_s );
293 mEyeDomeLightingEnabled = elemEyeDomeLighting.attribute(
"enabled", u
"0"_s ).toInt();
294 mEyeDomeLightingStrength = elemEyeDomeLighting.attribute(
"eye-dome-lighting-strength", u
"1000.0"_s ).toDouble();
295 mEyeDomeLightingDistance = elemEyeDomeLighting.attribute(
"eye-dome-lighting-distance", u
"1"_s ).toInt();
297 QDomElement elemNavigationSync = elem.firstChildElement( u
"navigation-sync"_s );
298 mViewSyncMode =
static_cast<Qgis::ViewSyncModeFlags>( elemNavigationSync.attribute( u
"view-sync-mode"_s, u
"0"_s ).toInt() );
299 mVisualizeViewFrustum = elemNavigationSync.attribute( u
"view-frustum-visualization-enabled"_s, u
"0"_s ).toInt();
301 QDomElement elemDebugSettings = elem.firstChildElement( u
"debug-settings"_s );
302 mDebugShadowMapEnabled = elemDebugSettings.attribute( u
"shadowmap-enabled"_s, u
"0"_s ).toInt();
303 mDebugShadowMapCorner =
static_cast<Qt::Corner
>( elemDebugSettings.attribute( u
"shadowmap-corner"_s,
"0" ).toInt() );
304 mDebugShadowMapSize = elemDebugSettings.attribute( u
"shadowmap-size"_s, u
"0.2"_s ).toDouble();
306 mDebugDepthMapEnabled = elemDebugSettings.attribute( u
"depthmap-enabled"_s, u
"0"_s ).toInt();
307 mDebugDepthMapCorner =
static_cast<Qt::Corner
>( elemDebugSettings.attribute( u
"depthmap-corner"_s, u
"1"_s ).toInt() );
308 mDebugDepthMapSize = elemDebugSettings.attribute( u
"depthmap-size"_s, u
"0.2"_s ).toDouble();
310 QDomElement elemDebug = elem.firstChildElement( u
"debug"_s );
311 mShowTerrainBoundingBoxes = elemDebug.attribute( u
"bounding-boxes"_s, u
"0"_s ).toInt();
312 mShowTerrainTileInfo = elemDebug.attribute( u
"terrain-tile-info"_s, u
"0"_s ).toInt();
313 mShowCameraViewCenter = elemDebug.attribute( u
"camera-view-center"_s, u
"0"_s ).toInt();
314 mShowCameraRotationCenter = elemDebug.attribute( u
"camera-rotation-center"_s, u
"0"_s ).toInt();
315 mShowLightSources = elemDebug.attribute( u
"show-light-sources"_s, u
"0"_s ).toInt();
316 mIsFpsCounterEnabled = elemDebug.attribute( u
"show-fps-counter"_s, u
"0"_s ).toInt();
317 mStopUpdates = elemDebug.attribute( u
"stop-updates"_s, u
"0"_s ).toInt();
318 mShowDebugPanel = elemDebug.attribute( u
"debug-panel"_s, u
"0"_s ).toInt();
320 QDomElement elemTemporalRange = elem.firstChildElement( u
"temporal-range"_s );
321 QDateTime start = QDateTime::fromString( elemTemporalRange.attribute( u
"start"_s ), Qt::ISODate );
322 QDateTime end = QDateTime::fromString( elemTemporalRange.attribute( u
"end"_s ), Qt::ISODate );
325 QDomElement elem3dAxis = elem.firstChildElement( u
"axis3d"_s );
326 m3dAxisSettings.readXml( elem3dAxis, context );
328 QDomElement elemMapOverlay = elem.firstChildElement( u
"map-overlay"_s );
329 if ( !elemMapOverlay.isNull() )
331 mShow2DMapOverlay = elemMapOverlay.attribute( u
"enabled"_s, u
"0"_s ).toInt();
335 mShow2DMapOverlay =
false;
343 QDomElement elem = doc.createElement( u
"qgis3d"_s );
345 QDomElement elemOrigin = doc.createElement( u
"origin"_s );
346 elemOrigin.setAttribute( u
"x"_s, QString::number( mOrigin.x() ) );
347 elemOrigin.setAttribute( u
"y"_s, QString::number( mOrigin.y() ) );
348 elemOrigin.setAttribute( u
"z"_s, QString::number( mOrigin.z() ) );
349 elem.appendChild( elemOrigin );
351 QDomElement elemExtent = doc.createElement( u
"extent"_s );
352 elemExtent.setAttribute( u
"xMin"_s, mExtent.xMinimum() );
353 elemExtent.setAttribute( u
"yMin"_s, mExtent.yMinimum() );
354 elemExtent.setAttribute( u
"xMax"_s, mExtent.xMaximum() );
355 elemExtent.setAttribute( u
"yMax"_s, mExtent.yMaximum() );
356 elemExtent.setAttribute( u
"showIn2dView"_s, mShowExtentIn2DView );
357 elem.appendChild( elemExtent );
359 QDomElement elemCamera = doc.createElement( u
"camera"_s );
360 elemCamera.setAttribute( u
"field-of-view"_s, mFieldOfView );
361 elemCamera.setAttribute( u
"projection-type"_s,
static_cast<int>( mProjectionType ) );
362 switch ( mCameraNavigationMode )
365 elemCamera.setAttribute( u
"camera-navigation-mode"_s, u
"terrain-based-navigation"_s );
368 elemCamera.setAttribute( u
"camera-navigation-mode"_s, u
"walk-navigation"_s );
371 elemCamera.setAttribute( u
"camera-navigation-mode"_s, u
"globe-terrain-based-navigation"_s );
374 elemCamera.setAttribute( u
"camera-movement-speed"_s, mCameraMovementSpeed );
375 elem.appendChild( elemCamera );
377 QDomElement elemColor = doc.createElement( u
"color"_s );
380 elem.appendChild( elemColor );
382 QDomElement elemCrs = doc.createElement( u
"crs"_s );
383 mCrs.writeXml( elemCrs, doc );
384 elem.appendChild( elemCrs );
386 QDomElement elemTerrain = doc.createElement( u
"terrain"_s );
387 elemTerrain.setAttribute( u
"terrain-rendering-enabled"_s, mTerrainRenderingEnabled ? 1 : 0 );
388 elemTerrain.setAttribute( u
"shading-enabled"_s, mTerrainShadingEnabled ? 1 : 0 );
390 QDomElement elemTerrainShadingMaterial = doc.createElement( u
"shading-material"_s );
391 mTerrainShadingMaterial.writeXml( elemTerrainShadingMaterial, context );
392 elemTerrain.appendChild( elemTerrainShadingMaterial );
393 elemTerrain.setAttribute( u
"map-theme"_s, mTerrainMapTheme );
394 elemTerrain.setAttribute( u
"show-labels"_s, mShowLabels ? 1 : 0 );
397 QDomElement elemLights = doc.createElement( u
"lights"_s );
400 const QDomElement elemLight = light->writeXml( doc, context );
401 elemLights.appendChild( elemLight );
403 elem.appendChild( elemLights );
406 QDomElement elemMapLayers = doc.createElement( u
"layers"_s );
409 QDomElement elemMapLayer = doc.createElement( u
"layer"_s );
410 elemMapLayer.setAttribute( u
"id"_s, layerRef.layerId );
411 elemMapLayers.appendChild( elemMapLayer );
413 elemTerrain.appendChild( elemMapLayers );
415 QDomElement elemTerrainGenerator = doc.createElement( u
"generator"_s );
416 elemTerrainGenerator.setAttribute( u
"type"_s, mTerrainSettings->type() );
417 mTerrainSettings->writeXml( elemTerrain, context );
418 elemTerrain.appendChild( elemTerrainGenerator );
419 elem.appendChild( elemTerrain );
421 if ( mBackgroundSettings )
423 QDomElement elemBackground = doc.createElement( u
"background"_s );
424 elemBackground.setAttribute( u
"type"_s,
qgsEnumValueToKey( mBackgroundSettings->type() ) );
425 mBackgroundSettings->writeXml( elemBackground, context );
426 elem.appendChild( elemBackground );
429 QDomElement elemShadows = doc.createElement( u
"shadow-rendering"_s );
430 mShadowSettings.writeXml( elemShadows, context );
431 elem.appendChild( elemShadows );
433 QDomElement elemAmbientOcclusion = doc.createElement( u
"screen-space-ambient-occlusion"_s );
434 mAmbientOcclusionSettings.writeXml( elemAmbientOcclusion, context );
435 elem.appendChild( elemAmbientOcclusion );
437 QDomElement elemDebug = doc.createElement( u
"debug"_s );
438 elemDebug.setAttribute( u
"bounding-boxes"_s, mShowTerrainBoundingBoxes ? 1 : 0 );
439 elemDebug.setAttribute( u
"terrain-tile-info"_s, mShowTerrainTileInfo ? 1 : 0 );
440 elemDebug.setAttribute( u
"camera-view-center"_s, mShowCameraViewCenter ? 1 : 0 );
441 elemDebug.setAttribute( u
"camera-rotation-center"_s, mShowCameraRotationCenter ? 1 : 0 );
442 elemDebug.setAttribute( u
"show-light-sources"_s, mShowLightSources ? 1 : 0 );
443 elemDebug.setAttribute( u
"show-fps-counter"_s, mIsFpsCounterEnabled ? 1 : 0 );
444 elemDebug.setAttribute( u
"stop-updates"_s, mStopUpdates ? 1 : 0 );
445 elemDebug.setAttribute( u
"debug-panel"_s, mShowDebugPanel ? 1 : 0 );
446 elem.appendChild( elemDebug );
448 QDomElement elemEyeDomeLighting = doc.createElement( u
"eye-dome-lighting"_s );
449 elemEyeDomeLighting.setAttribute( u
"enabled"_s, mEyeDomeLightingEnabled ? 1 : 0 );
450 elemEyeDomeLighting.setAttribute( u
"eye-dome-lighting-strength"_s, mEyeDomeLightingStrength );
451 elemEyeDomeLighting.setAttribute( u
"eye-dome-lighting-distance"_s, mEyeDomeLightingDistance );
452 elem.appendChild( elemEyeDomeLighting );
454 QDomElement elemNavigationSync = doc.createElement( u
"navigation-sync"_s );
455 elemNavigationSync.setAttribute( u
"view-sync-mode"_s, (
int ) mViewSyncMode );
456 elemNavigationSync.setAttribute( u
"view-frustum-visualization-enabled"_s, mVisualizeViewFrustum ? 1 : 0 );
457 elem.appendChild( elemNavigationSync );
459 QDomElement elemDebugSettings = doc.createElement( u
"debug-settings"_s );
460 elemDebugSettings.setAttribute( u
"shadowmap-enabled"_s, mDebugShadowMapEnabled );
461 elemDebugSettings.setAttribute( u
"shadowmap-corner"_s, mDebugShadowMapCorner );
462 elemDebugSettings.setAttribute( u
"shadowmap-size"_s, mDebugShadowMapSize );
463 elemDebugSettings.setAttribute( u
"depthmap-enabled"_s, mDebugDepthMapEnabled );
464 elemDebugSettings.setAttribute( u
"depthmap-corner"_s, mDebugDepthMapCorner );
465 elemDebugSettings.setAttribute( u
"depthmap-size"_s, mDebugDepthMapSize );
466 elem.appendChild( elemDebugSettings );
468 QDomElement elemTemporalRange = doc.createElement( u
"temporal-range"_s );
469 elemTemporalRange.setAttribute( u
"start"_s,
temporalRange().begin().toString( Qt::ISODate ) );
470 elemTemporalRange.setAttribute( u
"end"_s,
temporalRange().end().toString( Qt::ISODate ) );
472 QDomElement elem3dAxis = doc.createElement( u
"axis3d"_s );
473 m3dAxisSettings.writeXml( elem3dAxis, context );
474 elem.appendChild( elem3dAxis );
476 if ( mShow2DMapOverlay )
478 QDomElement elemMapOverlay = doc.createElement( u
"map-overlay"_s );
479 elemMapOverlay.setAttribute( u
"enabled"_s, 1 );
480 elem.appendChild( elemMapOverlay );
490 for (
int i = 0; i < mLayers.count(); ++i )
496 if ( mTerrainSettings )
498 mTerrainSettings->resolveReferences( &project );
515 QgsDebugError( u
"extent() should not be used with globe!"_s );
530 QgsDebugError( u
"setExtent() should not be used with globe!"_s );
536 if ( mTerrainGenerator )
539 mTerrainGenerator->setExtent( terrainExtent );
611 return mTransformContext;
618 mTransformContext = context;
625 return mPathResolver;
632 mPathResolver = resolver;
646 mMapThemes = mapThemes;
653 if ( color == mBackgroundColor )
656 mBackgroundColor = color;
664 return mBackgroundColor;
671 return mBackgroundSettings.get();
678 mBackgroundSettings.reset( settings );
686 if ( color == mSelectionColor )
689 mSelectionColor = color;
697 return mSelectionColor;
704 if ( zScale == mTerrainSettings->verticalScale() )
707 mTerrainSettings->setVerticalScale( zScale );
718 return mTerrainSettings->verticalScale();
725 const QList<QgsMapLayer *> raw = _qgis_listRefToRaw( mLayers );
730 mLayers = _qgis_listRawToRef(
layers );
738 QList<QgsMapLayer *> lst;
739 lst.reserve( mLayers.count() );
742 if ( layerRef.layer )
743 lst.append( layerRef.layer );
765 return mTerrainSettings.get();
772 bool hasChanged =
false;
773 if ( settings == mTerrainSettings.get() )
781 hasChanged = !settings->
equals( mTerrainSettings.get() ) || !mTerrainGenerator;
782 mTerrainSettings.reset( settings );
810 if ( mTerrainSettings->mapTileResolution() == res )
813 mTerrainSettings->setMapTileResolution( res );
824 return mTerrainSettings->mapTileResolution();
831 if ( mTerrainSettings->maximumScreenError() == error )
834 mTerrainSettings->setMaximumScreenError( error );
845 return mTerrainSettings->maximumScreenError();
852 if ( mTerrainSettings->maximumGroundError() == error )
855 mTerrainSettings->setMaximumGroundError( error );
867 if ( mTerrainSettings->elevationOffset() == offset )
869 mTerrainSettings->setElevationOffset( offset );
880 return mTerrainSettings->elevationOffset();
887 return mTerrainSettings->maximumGroundError();
894 if ( mTerrainGenerator )
904 mTerrainGenerator.reset( gen );
914 return mTerrainGenerator.get();
921 if ( mTerrainShadingEnabled == enabled )
924 mTerrainShadingEnabled = enabled;
932 return mTerrainShadingEnabled;
939 if ( mTerrainShadingMaterial == material )
942 mTerrainShadingMaterial = material;
950 return mTerrainShadingMaterial;
957 if ( mTerrainMapTheme == theme )
960 mTerrainMapTheme = theme;
968 return mTerrainMapTheme;
975 if ( mShowTerrainBoundingBoxes == enabled )
978 mShowTerrainBoundingBoxes = enabled;
986 return mShowTerrainBoundingBoxes;
994 if ( mShowTerrainTileInfo == enabled )
997 mShowTerrainTileInfo = enabled;
1005 return mShowTerrainTileInfo;
1012 if ( mShowCameraViewCenter == enabled )
1015 mShowCameraViewCenter = enabled;
1023 return mShowCameraViewCenter;
1030 if ( mShowCameraRotationCenter == enabled )
1033 mShowCameraRotationCenter = enabled;
1041 return mShowCameraRotationCenter;
1048 if ( mShowLightSources == enabled )
1051 mShowLightSources = enabled;
1059 return mShowLightSources;
1066 if ( mShowLabels == enabled )
1069 mShowLabels = enabled;
1084 if ( mStopUpdates == enabled )
1087 mStopUpdates = enabled;
1095 return mStopUpdates;
1102 if ( mEyeDomeLightingEnabled == enabled )
1104 mEyeDomeLightingEnabled = enabled;
1112 return mEyeDomeLightingEnabled;
1119 if ( mEyeDomeLightingStrength == strength )
1121 mEyeDomeLightingStrength = strength;
1129 return mEyeDomeLightingStrength;
1136 if ( mEyeDomeLightingDistance == distance )
1138 mEyeDomeLightingDistance = distance;
1146 return mEyeDomeLightingDistance;
1153 if ( mMsaaEnabled == enabled )
1156 mMsaaEnabled = enabled;
1164 return mMsaaEnabled;
1171 return mLightSources;
1179 if ( mLightSources.count() == lights.count() )
1182 for (
int i = 0; i < mLightSources.count(); ++i )
1184 if ( mLightSources[i]->type() == lights[i]->type() )
1186 switch ( mLightSources[i]->type() )
1203 qDeleteAll( lights );
1208 qDeleteAll( mLightSources );
1209 mLightSources = lights;
1220 return mFieldOfView;
1238 return mProjectionType;
1256 return mCameraNavigationMode;
1263 if ( mCameraNavigationMode == navigationMode )
1266 mCameraNavigationMode = navigationMode;
1274 return mCameraMovementSpeed;
1281 if ( mCameraMovementSpeed == movementSpeed )
1284 mCameraMovementSpeed = movementSpeed;
1315 return mShadowSettings;
1322 return mAmbientOcclusionSettings;
1369 return mIsFpsCounterEnabled;
1376 if ( mShowDebugPanel == enabled )
1379 mShowDebugPanel = enabled;
1387 return mShowDebugPanel;
1394 mDebugShadowMapEnabled = enabled;
1395 mDebugShadowMapCorner = corner;
1396 mDebugShadowMapSize = size;
1404 return mDebugShadowMapEnabled;
1411 return mDebugShadowMapCorner;
1418 return mDebugShadowMapSize;
1425 mDebugDepthMapEnabled = enabled;
1426 mDebugDepthMapCorner = corner;
1427 mDebugDepthMapSize = size;
1435 return mDebugDepthMapEnabled;
1442 return mDebugDepthMapCorner;
1449 return mDebugDepthMapSize;
1456 if ( fpsCounterEnabled == mIsFpsCounterEnabled )
1458 mIsFpsCounterEnabled = fpsCounterEnabled;
1466 return mTerrainRenderingEnabled;
1483 return mRendererUsage;
1497 return mViewSyncMode;
1504 mViewSyncMode = mode;
1511 return mVisualizeViewFrustum;
1518 if ( mVisualizeViewFrustum != enabled )
1520 mVisualizeViewFrustum = enabled;
1529 return m3dAxisSettings;
1536 if ( debugOverlayEnabled == mIsDebugOverlayEnabled )
1539 mIsDebugOverlayEnabled = debugOverlayEnabled;
1547 return mShowExtentIn2DView;
1550void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
1592 if ( axisSettings == m3dAxisSettings )
1604 m3dAxisSettings = axisSettings;
1613 return mIsDebugOverlayEnabled;
1620 if ( show == mShowExtentIn2DView )
1623 mShowExtentIn2DView = show;
1631 return mShow2DMapOverlay;
1638 if ( mShow2DMapOverlay == enabled )
1641 mShow2DMapOverlay = enabled;
@ DistinctTextureSkybox
Skybox with 6 distinct textures for different faces.
@ NoBackground
No background.
@ FixedGradientBackground
Two color gradient, fixed in place.
@ Geocentric
Geocentric CRS.
QFlags< ViewSyncModeFlag > ViewSyncModeFlags
NavigationMode
The navigation mode used by 3D cameras.
@ TerrainBased
The default navigation based on the terrain.
@ Walk
Uses WASD keys or arrows to navigate in walking (first person) manner.
@ GlobeTerrainBased
Navigation similar to TerrainBased, but for use with globe.
RendererUsage
Usage of the renderer.
SceneMode
The 3D scene mode used in 3D map views.
@ Globe
Scene is represented as a globe using a geocentric CRS.
@ Local
Local scene based on a projected CRS.
@ Point
Point light source.
@ Directional
Directional light source.
Contains the configuration of a 3d axis.
void extentChanged()
Emitted when the 3d view's 2d extent has changed.
void setEyeDomeLightingStrength(double strength)
Sets the eye dome lighting strength value.
bool isDebugOverlayEnabled() const
Returns whether debug overlay is enabled.
Qt::Corner debugDepthMapCorner() const
Returns the corner where the shadow map preview is displayed.
void originChanged()
Emitted when the world's origin point has been shifted.
void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the coordinate transform context, which stores various information regarding which datum transfo...
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 readXml(const QDomElement &elem, const QgsReadWriteContext &context)
Reads configuration from a DOM element previously written by writeXml().
void terrainShadingChanged()
Emitted when terrain shading enabled flag or terrain shading material has changed.
bool isMsaaEnabled() const
Returns whether multisample anti-aliasing (MSAA) is enabled.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
void setAmbientOcclusionSettings(const QgsAmbientOcclusionSettings &ambientOcclusionSettings)
Sets the current configuration of screen space ambient occlusion.
void setShowTerrainTilesInfo(bool enabled)
Sets whether to display extra tile info on top of terrain tiles (for debugging).
QgsVector3D mapToWorldCoordinates(const QgsVector3D &mapCoords) const
Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,...
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.
void setEyeDomeLightingEnabled(bool enabled)
Sets whether eye dome lighting will be used.
void showDebugPanelChanged(bool shown)
Emitted when the Show debug panel checkbox changes value.
bool debugDepthMapEnabled() const
Returns whether the shadow map debugging is enabled.
Q_DECL_DEPRECATED bool isSkyboxEnabled() const
Returns whether the skybox is enabled.
void setFieldOfView(const float fieldOfView)
Sets the camera lens' field of view.
void debugDepthMapSettingsChanged()
Emitted when depth map debugging has changed.
Q_DECL_DEPRECATED double terrainElevationOffset() const
Returns the elevation offset of the terrain (used to move the terrain up or down).
void setLightSources(const QList< QgsLightSource * > &lights)
Sets the list of light sources defined in the scene.
void backgroundSettingsChanged()
Emitted when background settings are 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.
Q_DECL_DEPRECATED void setMaxTerrainGroundError(double error)
Sets the maximum ground error of terrain tiles in world units.
Q_DECL_DEPRECATED void terrainElevationOffsetChanged(double newElevation)
Emitted when the terrain elevation offset is 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.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const
Writes configuration to a DOM element, to be used later with readXml().
void setDebugDepthMapSettings(bool enabled, Qt::Corner corner, double size)
Sets the debugging settings of the depth map.
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.
QColor selectionColor() const
Returns color used for selected features.
void directionalLightsChanged()
Emitted when the list of directional lights changes.
void setTerrainShadingMaterial(const QgsPhongMaterialSettings &material)
Sets terrain shading material.
const QgsAbstractTerrainSettings * terrainSettings() const
Returns the terrain settings.
Q_DECL_DEPRECATED void maxTerrainScreenErrorChanged()
Emitted when the maximum terrain screen error has changed.
void cameraNavigationModeChanged()
Emitted when the camera navigation mode was changed.
void shadowSettingsChanged()
Emitted when shadow rendering settings are changed.
void show2DMapOverlayChanged()
Emitted when the 2D map overlay is enabled or disabled.
bool stopUpdates() const
Returns whether the scene updates on camera movement.
void setViewFrustumVisualizationEnabled(bool enabled)
Sets whether the camera's view frustum is visualized on the 2D map canvas.
void setShowCameraRotationCenter(bool enabled)
Sets whether to show camera's rotation center as a sphere (for debugging).
void setExtent(const QgsRectangle &extent)
Sets the 3D scene's 2D extent in the 3D scene's CRS, while also setting the scene's origin to the ext...
void eyeDomeLightingEnabledChanged()
Emitted when the flag whether eye dome lighting is used has changed.
Q_DECL_DEPRECATED void setTerrainVerticalScale(double zScale)
Sets vertical scale (exaggeration) of terrain (1 = true scale, > 1 = hills get more pronounced).
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.
Q_DECL_DEPRECATED void setIsSkyboxEnabled(bool enabled)
Sets whether the skybox is enabled.
Qgis::SceneMode sceneMode() const
Returns mode of the 3D scene - whether it is represented as a globe (when using Geocentric CRS such a...
void setShowLabels(bool enabled)
Sets whether to display labels on terrain tiles.
Q_DECL_DEPRECATED double terrainVerticalScale() const
Returns vertical scale (exaggeration) of terrain.
void setViewSyncMode(Qgis::ViewSyncModeFlags mode)
Sets the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation).
void setOrigin(const QgsVector3D &origin)
Sets coordinates in map CRS at which our 3D world has origin (0,0,0).
Q_DECL_DEPRECATED void setSkyboxSettings(const QgsSkyboxSettings &skyboxSettings)
Sets the current configuration of the skybox.
Q_DECL_DEPRECATED void setMapTileResolution(int res)
Sets resolution (in pixels) of the texture of a terrain tile.
void setLayers(const QList< QgsMapLayer * > &layers)
Sets the list of 3D map layers to be rendered in the scene.
void setShowDebugPanel(bool enabled)
Sets whether the debug side panel is shown.
QgsShadowSettings shadowSettings() const
Returns the current configuration of shadows.
void terrainMapThemeChanged()
Emitted when terrain's map theme has changed.
void setShadowSettings(const QgsShadowSettings &shadowSettings)
Sets the current configuration of shadow rendering.
void msaaEnabledChanged()
Emitted when the MSAA enabled flag has changed.
void setIsDebugOverlayEnabled(bool debugOverlayEnabled)
Sets whether debug overlay is enabled The debug overlay displays some debugging and profiling informa...
void pointLightsChanged()
Emitted when the list of point lights changes.
QList< QgsLightSource * > lightSources() const
Returns list of directional light sources defined in the scene.
double debugDepthMapSize() const
Returns the size of the shadow map preview.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets coordinate reference system used in the 3D scene.
Q_DECL_DEPRECATED double maxTerrainScreenError() const
Returns maximum allowed screen error of terrain tiles in pixels.
void setBackgroundSettings(QgsAbstract3DMapBackgroundSettings *settings)
Sets the background settings for the 3D scene.
Qgs3DAxisSettings get3DAxisSettings() const
Returns the current configuration of 3d axis.
void setEyeDomeLightingDistance(int distance)
Sets the eye dome lighting distance value (contributes to the contrast of the image.
Q_DECL_DEPRECATED void maxTerrainGroundErrorChanged()
Emitted when the maximum terrain ground error has changed.
bool viewFrustumVisualizationEnabled() const
Returns whether the camera's view frustum is visualized on the 2D map canvas.
void setShowLightSourceOrigins(bool enabled)
Sets whether to show light source origins as a sphere (for debugging).
bool showDebugPanel() const
Returns whether the debug side panel is shown.
bool is2DMapOverlayEnabled() const
Returns whether 2D map overlay is enabled.
void setIs2DMapOverlayEnabled(bool enabled)
Sets whether 2D map overlay is enabled.
void setShowExtentIn2DView(bool show)
Sets whether the extent is displayed on the main 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.
void setTerrainShadingEnabled(bool enabled)
Sets whether terrain shading is enabled.
Qgis::ViewSyncModeFlags viewSyncMode() const
Returns the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation).
Q_DECL_DEPRECATED void mapTileResolutionChanged()
Emitted when the map tile resoulution has changed.
void stopUpdatesChanged()
Emitted when the flag whether to keep updating scene has changed.
void setDebugShadowMapSettings(bool enabled, Qt::Corner corner, double size)
Sets the debugging settings of the shadow map.
void setMsaaEnabled(bool enabled)
Sets whether multisample anti-aliasing (MSAA) is enabled.
int eyeDomeLightingDistance() const
Returns the eye dome lighting distance value (contributes to the contrast of the image).
void setSelectionColor(const QColor &color)
Sets color used for selected features.
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.
const QgsAbstract3DMapBackgroundSettings * backgroundSettings() const
Returns the background settings for the 3D scene, or null if no background is set.
void setCameraNavigationMode(Qgis::NavigationMode navigationMode)
Sets the navigation mode for the camera.
QColor backgroundColor() const
Returns background color of the 3D map view.
void terrainSettingsChanged()
Emitted when the terrain settings are changed.
void resolveReferences(const QgsProject &project)
Resolves references to other objects (map layers) after the call to readXml().
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...
QgsVector3D worldToMapCoordinates(const QgsVector3D &worldCoords) const
Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,...
bool showTerrainBoundingBoxes() const
Returns whether to display bounding boxes of terrain tiles (for debugging).
~Qgs3DMapSettings() override
void showLabelsChanged()
Emitted when the flag whether labels are displayed on terrain tiles has changed.
void setStopUpdates(bool enabled)
Sets whether scene updates on camera movement should be enabled.
void setShowCameraViewCenter(bool enabled)
Sets whether to show camera's view center as a sphere (for debugging).
Q_DECL_DEPRECATED int mapTileResolution() const
Returns resolution (in pixels) of the texture of a terrain tile.
bool showLabels() const
Returns whether to display labels on terrain tiles.
void setTerrainSettings(QgsAbstractTerrainSettings *settings)
Sets the terrain settings.
void set3DAxisSettings(const Qgs3DAxisSettings &axisSettings, bool force=false)
Sets the current configuration of 3d axis.
void setCameraMovementSpeed(double movementSpeed)
Sets the camera movement speed.
void setTerrainRenderingEnabled(bool terrainRenderingEnabled)
Sets whether the 2D terrain surface will be rendered in.
bool debugShadowMapEnabled() const
Returns whether the shadow map debugging is enabled.
Q_DECL_DEPRECATED void setMaxTerrainScreenError(double error)
Sets maximum allowed screen error of terrain tiles in pixels.
void setBackgroundColor(const QColor &color)
Sets background color of the 3D map view.
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 setProjectionType(const Qt3DRender::QCameraLens::ProjectionType projectionType)
Sets the camera lens' projection type.
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 configureTerrainFromProject(QgsProjectElevationProperties *properties, const QgsRectangle &fullExtent)
Configures the map's terrain settings directly from a project's elevation properties.
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.
Q_DECL_DEPRECATED QgsSkyboxSettings skyboxSettings() const
Returns the current configuration of the skybox.
Q_DECL_DEPRECATED double maxTerrainGroundError() const
Returns maximum ground error of terrain tiles in world units.
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.
void setRendererUsage(Qgis::RendererUsage rendererUsage)
Sets the renderer usage.
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 setShowTerrainBoundingBoxes(bool enabled)
Sets whether to display bounding boxes of terrain tiles (for debugging).
void fieldOfViewChanged()
Emitted when the camera lens field of view changes.
Qgis::RendererUsage rendererUsage() const
Returns the renderer usage.
void setIsFpsCounterEnabled(bool fpsCounterEnabled)
Sets whether FPS counter label is enabled.
QgsMapThemeCollection * mapThemeCollection() const
Returns pointer to the collection of map themes.
QList< QgsMapLayer * > layers() const
Returns the list of 3D map layers to be rendered in the scene.
void setTerrainMapTheme(const QString &theme)
Sets name of the map theme.
Q_DECL_DEPRECATED void setTerrainElevationOffset(double offset)
Sets the terrain elevation offset (used to move the terrain up or down).
Q_DECL_DEPRECATED void terrainVerticalScaleChanged()
Emitted when the vertical scale of the terrain has changed.
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 setTerrainGenerator(QgsTerrainGenerator *gen)
Sets terrain generator and sets extent() as the generator's extent.
void debugShadowMapSettingsChanged()
Emitted when shadow map debugging has changed.
void showCameraViewCenterChanged()
Emitted when the flag whether camera's view center is shown has changed.
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
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).
static Qgs3DRenderContext fromMapSettings(const Qgs3DMapSettings *mapSettings)
Creates an initialized Qgs3DRenderContext instance from given Qgs3DMapSettings.
static QgsRectangle tryReprojectExtent2D(const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs1, const QgsCoordinateReferenceSystem &crs2, const QgsCoordinateTransformContext &context)
Reprojects extent from crs1 to crs2 coordinate reference system with context context.
static QgsVector3D worldToMapCoordinates(const QgsVector3D &worldCoords, const QgsVector3D &origin)
Converts 3D world coordinates to map coordinates (applies offset).
static QgsVector3D mapToWorldCoordinates(const QgsVector3D &mapCoords, const QgsVector3D &origin)
Converts map coordinates to 3D world coordinates (applies offset).
static Qgs3DTerrainRegistry * terrainRegistry()
Returns the terrain registry, used for managing 3D terrains.
Base class for all background settings classes used in a 3D map view.
Base class for all terrain settings classes.
virtual bool equals(const QgsAbstractTerrainSettings *other) const =0
Returns true if this settings is exactly equal to another other settings.
Contains the configuration of ambient occlusion rendering.
static QColor colorFromString(const QString &string)
Decodes a string into a color value.
static QString colorToString(const QColor &color)
Encodes a color into a string value.
Represents a coordinate reference system (CRS).
bool isValid() const
Returns whether this CRS is correctly initialized and usable.
Contains information about the context in which a coordinate transform is executed.
Definition of a directional light in a 3D map scene.
Terrain settings for a simple flat area terrain.
Base class for light sources in 3d scenes.
static QgsLightSource * createFromXml(const QDomElement &element, const QgsReadWriteContext &context)
Creates a new light source from an XML element.
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.
Basic shading material used for rendering based on the Phong shading model with three color component...
Definition of a point light in a 3D map scene.
Temporarily blocks QgsProject "dirtying" for the lifetime of the object.
Contains elevation properties for a QgsProject.
QgsReferencedRectangle fullExtent() const
Returns the full extent of the project, which represents the maximal limits of the project.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
void setDirty(bool b=true)
Flag the project as dirty (modified).
const QgsProjectViewSettings * viewSettings() const
Returns the project's view settings, which contains settings and properties relating to how a QgsProj...
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Contains configuration for rendering shadows.
Contains the configuration of a skybox entity.
const QgsDateTimeRange & temporalRange() const
Returns the datetime range for the object.
QgsTemporalRangeObject(bool enabled=false)
Constructor QgsTemporalRangeObject.
void setTemporalRange(const QgsDateTimeRange &range)
Sets the temporal range for the object.
Base class for generators of terrain.
void terrainChanged()
Emitted when the terrain changed (for example, raster DEM or mesh have data changed).
virtual void setExtent(const QgsRectangle &extent)
sets the extent of the terrain in terrain's CRS
virtual QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
#define Q_NOWARN_DEPRECATED_POP
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
#define Q_NOWARN_DEPRECATED_PUSH
#define QgsDebugError(str)
_LayerRef< QgsMapLayer > QgsMapLayerRef
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
#define QGIS_PROTECT_QOBJECT_THREAD_ACCESS
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
QString layerId
Original layer ID.