21 #include "qgsmeshterraingenerator.h"
29 #include <QDomDocument>
30 #include <QDomElement>
42 connectChangedSignalsToSettingsChanged();
48 , mOrigin( other.mOrigin )
50 , mBackgroundColor( other.mBackgroundColor )
51 , mSelectionColor( other.mSelectionColor )
52 , mTerrainVerticalScale( other.mTerrainVerticalScale )
53 , mTerrainGenerator( other.mTerrainGenerator ? other.mTerrainGenerator->clone() : nullptr )
54 , mMapTileResolution( other.mMapTileResolution )
55 , mMaxTerrainScreenError( other.mMaxTerrainScreenError )
56 , mMaxTerrainGroundError( other.mMaxTerrainGroundError )
57 , mTerrainElevationOffset( other.mTerrainElevationOffset )
58 , mTerrainShadingEnabled( other.mTerrainShadingEnabled )
59 , mTerrainShadingMaterial( other.mTerrainShadingMaterial )
60 , mTerrainMapTheme( other.mTerrainMapTheme )
61 , mShowTerrainBoundingBoxes( other.mShowTerrainBoundingBoxes )
62 , mShowTerrainTileInfo( other.mShowTerrainTileInfo )
63 , mShowCameraViewCenter( other.mShowCameraViewCenter )
64 , mShowCameraRotationCenter( other.mShowCameraRotationCenter )
65 , mShowLightSources( other.mShowLightSources )
66 , mShowLabels( other.mShowLabels )
67 , mFieldOfView( other.mFieldOfView )
68 , mProjectionType( other.mProjectionType )
69 , mCameraNavigationMode( other.mCameraNavigationMode )
70 , mCameraMovementSpeed( other.mCameraMovementSpeed )
71 , mLayers( other.mLayers )
73 , mTransformContext( other.mTransformContext )
74 , mPathResolver( other.mPathResolver )
75 , mMapThemes( other.mMapThemes )
77 , mIsFpsCounterEnabled( other.mIsFpsCounterEnabled )
78 , mIsSkyboxEnabled( other.mIsSkyboxEnabled )
79 , mSkyboxSettings( other.mSkyboxSettings )
80 , mShadowSettings( other.mShadowSettings )
81 , mEyeDomeLightingEnabled( other.mEyeDomeLightingEnabled )
82 , mEyeDomeLightingStrength( other.mEyeDomeLightingStrength )
83 , mEyeDomeLightingDistance( other.mEyeDomeLightingDistance )
84 , mViewSyncMode( other.mViewSyncMode )
85 , mVisualizeViewFrustum( other.mVisualizeViewFrustum )
86 , mDebugShadowMapEnabled( other.mDebugShadowMapEnabled )
87 , mDebugShadowMapCorner( other.mDebugShadowMapCorner )
88 , mDebugShadowMapSize( other.mDebugShadowMapSize )
89 , mDebugDepthMapEnabled( other.mDebugDepthMapEnabled )
90 , mDebugDepthMapCorner( other.mDebugDepthMapCorner )
91 , mDebugDepthMapSize( other.mDebugDepthMapSize )
92 , mTerrainRenderingEnabled( other.mTerrainRenderingEnabled )
93 , mRendererUsage( other.mRendererUsage )
94 , m3dAxisSettings( other.m3dAxisSettings )
95 , mIsDebugOverlayEnabled( other.mIsDebugOverlayEnabled )
99 mRenderers << renderer->clone();
102 for (
QgsLightSource *source : std::as_const( other.mLightSources ) )
105 mLightSources << source->clone();
112 connectChangedSignalsToSettingsChanged();
117 qDeleteAll( mRenderers );
118 qDeleteAll( mLightSources );
124 QDomElement elemOrigin = elem.firstChildElement( QStringLiteral(
"origin" ) );
126 elemOrigin.attribute( QStringLiteral(
"x" ) ).toDouble(),
127 elemOrigin.attribute( QStringLiteral(
"y" ) ).toDouble(),
128 elemOrigin.attribute( QStringLiteral(
"z" ) ).toDouble() );
130 QDomElement elemCamera = elem.firstChildElement( QStringLiteral(
"camera" ) );
131 if ( !elemCamera.isNull() )
133 mFieldOfView = elemCamera.attribute( QStringLiteral(
"field-of-view" ), QStringLiteral(
"45" ) ).toFloat();
134 mProjectionType =
static_cast< Qt3DRender::QCameraLens::ProjectionType
>( elemCamera.attribute( QStringLiteral(
"projection-type" ), QStringLiteral(
"1" ) ).toInt() );
135 QString
cameraNavigationMode = elemCamera.attribute( QStringLiteral(
"camera-navigation-mode" ), QStringLiteral(
"basic-navigation" ) );
137 mCameraNavigationMode = QgsCameraController::NavigationMode::TerrainBasedNavigation;
139 mCameraNavigationMode = QgsCameraController::NavigationMode::WalkNavigation;
140 mCameraMovementSpeed = elemCamera.attribute( QStringLiteral(
"camera-movement-speed" ), QStringLiteral(
"5.0" ) ).toDouble();
143 QDomElement elemColor = elem.firstChildElement( QStringLiteral(
"color" ) );
144 if ( !elemColor.isNull() )
150 QDomElement elemCrs = elem.firstChildElement( QStringLiteral(
"crs" ) );
153 QDomElement elemTerrain = elem.firstChildElement( QStringLiteral(
"terrain" ) );
154 mTerrainRenderingEnabled = elemTerrain.attribute( QStringLiteral(
"terrain-rendering-enabled" ), QStringLiteral(
"1" ) ).toInt();
155 mTerrainVerticalScale = elemTerrain.attribute( QStringLiteral(
"exaggeration" ), QStringLiteral(
"1" ) ).toFloat();
156 mMapTileResolution = elemTerrain.attribute( QStringLiteral(
"texture-size" ), QStringLiteral(
"512" ) ).toInt();
157 mMaxTerrainScreenError = elemTerrain.attribute( QStringLiteral(
"max-terrain-error" ), QStringLiteral(
"3" ) ).toFloat();
158 mMaxTerrainGroundError = elemTerrain.attribute( QStringLiteral(
"max-ground-error" ), QStringLiteral(
"1" ) ).toFloat();
159 mTerrainShadingEnabled = elemTerrain.attribute( QStringLiteral(
"shading-enabled" ), QStringLiteral(
"0" ) ).toInt();
160 mTerrainElevationOffset = elemTerrain.attribute( QStringLiteral(
"elevation-offset" ), QStringLiteral(
"0.0" ) ).toFloat();
162 QDomElement elemTerrainShadingMaterial = elemTerrain.firstChildElement( QStringLiteral(
"shading-material" ) );
163 if ( !elemTerrainShadingMaterial.isNull() )
164 mTerrainShadingMaterial.
readXml( elemTerrainShadingMaterial, context );
165 mTerrainMapTheme = elemTerrain.attribute( QStringLiteral(
"map-theme" ) );
166 mShowLabels = elemTerrain.attribute( QStringLiteral(
"show-labels" ), QStringLiteral(
"0" ) ).toInt();
168 qDeleteAll( mLightSources );
169 mLightSources.clear();
170 const QDomElement lightsElem = elem.firstChildElement( QStringLiteral(
"lights" ) );
171 if ( !lightsElem.isNull() )
173 const QDomNodeList lightNodes = lightsElem.childNodes();
174 for (
int i = 0; i < lightNodes.size(); ++i )
176 const QDomElement lightElement = lightNodes.at( i ).toElement();
178 mLightSources << light;
184 QDomElement elemPointLights = elem.firstChildElement( QStringLiteral(
"point-lights" ) );
185 if ( !elemPointLights.isNull() )
187 QDomElement elemPointLight = elemPointLights.firstChildElement( QStringLiteral(
"point-light" ) );
188 while ( !elemPointLight.isNull() )
190 std::unique_ptr< QgsPointLightSettings > pointLight = std::make_unique< QgsPointLightSettings >();
191 pointLight->readXml( elemPointLight, context );
192 mLightSources << pointLight.release();
193 elemPointLight = elemPointLight.nextSiblingElement( QStringLiteral(
"point-light" ) );
199 std::unique_ptr< QgsPointLightSettings > defaultLight = std::make_unique< QgsPointLightSettings >();
200 defaultLight->setPosition(
QgsVector3D( 0, 1000, 0 ) );
201 mLightSources << defaultLight.release();
204 QDomElement elemDirectionalLights = elem.firstChildElement( QStringLiteral(
"directional-lights" ) );
205 if ( !elemDirectionalLights.isNull() )
207 QDomElement elemDirectionalLight = elemDirectionalLights.firstChildElement( QStringLiteral(
"directional-light" ) );
208 while ( !elemDirectionalLight.isNull() )
210 std::unique_ptr< QgsDirectionalLightSettings > directionalLight = std::make_unique< QgsDirectionalLightSettings >();
211 directionalLight->readXml( elemDirectionalLight, context );
212 mLightSources << directionalLight.release();
213 elemDirectionalLight = elemDirectionalLight.nextSiblingElement( QStringLiteral(
"directional-light" ) );
218 QDomElement elemMapLayers = elemTerrain.firstChildElement( QStringLiteral(
"layers" ) );
219 QDomElement elemMapLayer = elemMapLayers.firstChildElement( QStringLiteral(
"layer" ) );
220 QList<QgsMapLayerRef> mapLayers;
221 while ( !elemMapLayer.isNull() )
223 mapLayers <<
QgsMapLayerRef( elemMapLayer.attribute( QStringLiteral(
"id" ) ) );
224 elemMapLayer = elemMapLayer.nextSiblingElement( QStringLiteral(
"layer" ) );
228 QDomElement elemTerrainGenerator = elemTerrain.firstChildElement( QStringLiteral(
"generator" ) );
229 QString terrainGenType = elemTerrainGenerator.attribute( QStringLiteral(
"type" ) );
230 if ( terrainGenType == QLatin1String(
"dem" ) )
233 demTerrainGenerator->
setCrs( mCrs, mTransformContext );
236 else if ( terrainGenType == QLatin1String(
"online" ) )
239 onlineTerrainGenerator->
setCrs( mCrs, mTransformContext );
242 else if ( terrainGenType == QLatin1String(
"mesh" ) )
244 QgsMeshTerrainGenerator *meshTerrainGenerator =
new QgsMeshTerrainGenerator;
245 meshTerrainGenerator->setCrs( mCrs, mTransformContext );
254 mTerrainGenerator->readXml( elemTerrainGenerator );
256 qDeleteAll( mRenderers );
259 QDomElement elemRenderers = elem.firstChildElement( QStringLiteral(
"renderers" ) );
260 QDomElement elemRenderer = elemRenderers.firstChildElement( QStringLiteral(
"renderer" ) );
261 while ( !elemRenderer.isNull() )
264 QString type = elemRenderer.attribute( QStringLiteral(
"type" ) );
265 if ( type == QLatin1String(
"vector" ) )
269 else if ( type == QLatin1String(
"mesh" ) )
273 else if ( type == QLatin1String(
"pointcloud" ) )
280 renderer->
readXml( elemRenderer, context );
281 mRenderers.append( renderer );
283 elemRenderer = elemRenderer.nextSiblingElement( QStringLiteral(
"renderer" ) );
286 QDomElement elemSkybox = elem.firstChildElement( QStringLiteral(
"skybox" ) );
287 mIsSkyboxEnabled = elemSkybox.attribute( QStringLiteral(
"skybox-enabled" ) ).toInt();
288 mSkyboxSettings.
readXml( elemSkybox, context );
290 QDomElement elemShadows = elem.firstChildElement( QStringLiteral(
"shadow-rendering" ) );
291 mShadowSettings.
readXml( elemShadows, context );
293 QDomElement elemEyeDomeLighting = elem.firstChildElement( QStringLiteral(
"eye-dome-lighting" ) );
294 mEyeDomeLightingEnabled = elemEyeDomeLighting.attribute(
"enabled", QStringLiteral(
"0" ) ).toInt();
295 mEyeDomeLightingStrength = elemEyeDomeLighting.attribute(
"eye-dome-lighting-strength", QStringLiteral(
"1000.0" ) ).toDouble();
296 mEyeDomeLightingDistance = elemEyeDomeLighting.attribute(
"eye-dome-lighting-distance", QStringLiteral(
"1" ) ).toInt();
298 QDomElement elemNavigationSync = elem.firstChildElement( QStringLiteral(
"navigation-sync" ) );
299 mViewSyncMode = ( Qgis::ViewSyncModeFlags )( elemNavigationSync.attribute( QStringLiteral(
"view-sync-mode" ), QStringLiteral(
"0" ) ).toInt() );
300 mVisualizeViewFrustum = elemNavigationSync.attribute( QStringLiteral(
"view-frustum-visualization-enabled" ), QStringLiteral(
"0" ) ).toInt();
302 QDomElement elemDebugSettings = elem.firstChildElement( QStringLiteral(
"debug-settings" ) );
303 mDebugShadowMapEnabled = elemDebugSettings.attribute( QStringLiteral(
"shadowmap-enabled" ), QStringLiteral(
"0" ) ).toInt();
304 mDebugShadowMapCorner =
static_cast<Qt::Corner
>( elemDebugSettings.attribute( QStringLiteral(
"shadowmap-corner" ),
"0" ).toInt() );
305 mDebugShadowMapSize = elemDebugSettings.attribute( QStringLiteral(
"shadowmap-size" ), QStringLiteral(
"0.2" ) ).toDouble();
307 mDebugDepthMapEnabled = elemDebugSettings.attribute( QStringLiteral(
"depthmap-enabled" ), QStringLiteral(
"0" ) ).toInt();
308 mDebugDepthMapCorner =
static_cast<Qt::Corner
>( elemDebugSettings.attribute( QStringLiteral(
"depthmap-corner" ), QStringLiteral(
"1" ) ).toInt() );
309 mDebugDepthMapSize = elemDebugSettings.attribute( QStringLiteral(
"depthmap-size" ), QStringLiteral(
"0.2" ) ).toDouble();
311 QDomElement elemDebug = elem.firstChildElement( QStringLiteral(
"debug" ) );
312 mShowTerrainBoundingBoxes = elemDebug.attribute( QStringLiteral(
"bounding-boxes" ), QStringLiteral(
"0" ) ).toInt();
313 mShowTerrainTileInfo = elemDebug.attribute( QStringLiteral(
"terrain-tile-info" ), QStringLiteral(
"0" ) ).toInt();
314 mShowCameraViewCenter = elemDebug.attribute( QStringLiteral(
"camera-view-center" ), QStringLiteral(
"0" ) ).toInt();
315 mShowCameraRotationCenter = elemDebug.attribute( QStringLiteral(
"camera-rotation-center" ), QStringLiteral(
"0" ) ).toInt();
316 mShowLightSources = elemDebug.attribute( QStringLiteral(
"show-light-sources" ), QStringLiteral(
"0" ) ).toInt();
317 mIsFpsCounterEnabled = elemDebug.attribute( QStringLiteral(
"show-fps-counter" ), QStringLiteral(
"0" ) ).toInt();
319 QDomElement elemTemporalRange = elem.firstChildElement( QStringLiteral(
"temporal-range" ) );
320 QDateTime start = QDateTime::fromString( elemTemporalRange.attribute( QStringLiteral(
"start" ) ), Qt::ISODate );
321 QDateTime end = QDateTime::fromString( elemTemporalRange.attribute( QStringLiteral(
"end" ) ), Qt::ISODate );
324 QDomElement elem3dAxis = elem.firstChildElement( QStringLiteral(
"axis3d" ) );
325 m3dAxisSettings.
readXml( elem3dAxis, context );
331 QDomElement elem = doc.createElement( QStringLiteral(
"qgis3d" ) );
333 QDomElement elemOrigin = doc.createElement( QStringLiteral(
"origin" ) );
334 elemOrigin.setAttribute( QStringLiteral(
"x" ), QString::number( mOrigin.
x() ) );
335 elemOrigin.setAttribute( QStringLiteral(
"y" ), QString::number( mOrigin.
y() ) );
336 elemOrigin.setAttribute( QStringLiteral(
"z" ), QString::number( mOrigin.
z() ) );
337 elem.appendChild( elemOrigin );
339 QDomElement elemCamera = doc.createElement( QStringLiteral(
"camera" ) );
340 elemCamera.setAttribute( QStringLiteral(
"field-of-view" ), mFieldOfView );
341 elemCamera.setAttribute( QStringLiteral(
"projection-type" ),
static_cast< int >( mProjectionType ) );
342 switch ( mCameraNavigationMode )
345 elemCamera.setAttribute( QStringLiteral(
"camera-navigation-mode" ), QStringLiteral(
"terrain-based-navigation" ) );
348 elemCamera.setAttribute( QStringLiteral(
"camera-navigation-mode" ), QStringLiteral(
"walk-navigation" ) );
351 elemCamera.setAttribute( QStringLiteral(
"camera-movement-speed" ), mCameraMovementSpeed );
352 elem.appendChild( elemCamera );
354 QDomElement elemColor = doc.createElement( QStringLiteral(
"color" ) );
357 elem.appendChild( elemColor );
359 QDomElement elemCrs = doc.createElement( QStringLiteral(
"crs" ) );
361 elem.appendChild( elemCrs );
363 QDomElement elemTerrain = doc.createElement( QStringLiteral(
"terrain" ) );
364 elemTerrain.setAttribute( QStringLiteral(
"terrain-rendering-enabled" ), mTerrainRenderingEnabled ? 1 : 0 );
365 elemTerrain.setAttribute( QStringLiteral(
"exaggeration" ), QString::number( mTerrainVerticalScale ) );
366 elemTerrain.setAttribute( QStringLiteral(
"texture-size" ), mMapTileResolution );
367 elemTerrain.setAttribute( QStringLiteral(
"max-terrain-error" ), QString::number( mMaxTerrainScreenError ) );
368 elemTerrain.setAttribute( QStringLiteral(
"max-ground-error" ), QString::number( mMaxTerrainGroundError ) );
369 elemTerrain.setAttribute( QStringLiteral(
"shading-enabled" ), mTerrainShadingEnabled ? 1 : 0 );
370 elemTerrain.setAttribute( QStringLiteral(
"elevation-offset" ), mTerrainElevationOffset );
372 QDomElement elemTerrainShadingMaterial = doc.createElement( QStringLiteral(
"shading-material" ) );
373 mTerrainShadingMaterial.
writeXml( elemTerrainShadingMaterial, context );
374 elemTerrain.appendChild( elemTerrainShadingMaterial );
375 elemTerrain.setAttribute( QStringLiteral(
"map-theme" ), mTerrainMapTheme );
376 elemTerrain.setAttribute( QStringLiteral(
"show-labels" ), mShowLabels ? 1 : 0 );
379 QDomElement elemLights = doc.createElement( QStringLiteral(
"lights" ) );
382 const QDomElement elemLight = light->writeXml( doc, context );
383 elemLights.appendChild( elemLight );
385 elem.appendChild( elemLights );
388 QDomElement elemMapLayers = doc.createElement( QStringLiteral(
"layers" ) );
391 QDomElement elemMapLayer = doc.createElement( QStringLiteral(
"layer" ) );
392 elemMapLayer.setAttribute( QStringLiteral(
"id" ), layerRef.layerId );
393 elemMapLayers.appendChild( elemMapLayer );
395 elemTerrain.appendChild( elemMapLayers );
397 QDomElement elemTerrainGenerator = doc.createElement( QStringLiteral(
"generator" ) );
399 mTerrainGenerator->writeXml( elemTerrainGenerator );
400 elemTerrain.appendChild( elemTerrainGenerator );
401 elem.appendChild( elemTerrain );
403 QDomElement elemRenderers = doc.createElement( QStringLiteral(
"renderers" ) );
406 QDomElement elemRenderer = doc.createElement( QStringLiteral(
"renderer" ) );
407 elemRenderer.setAttribute( QStringLiteral(
"type" ), renderer->type() );
408 renderer->writeXml( elemRenderer, context );
409 elemRenderers.appendChild( elemRenderer );
411 elem.appendChild( elemRenderers );
413 QDomElement elemSkybox = doc.createElement( QStringLiteral(
"skybox" ) );
414 elemSkybox.setAttribute( QStringLiteral(
"skybox-enabled" ), mIsSkyboxEnabled );
415 mSkyboxSettings.
writeXml( elemSkybox, context );
416 elem.appendChild( elemSkybox );
418 QDomElement elemShadows = doc.createElement( QStringLiteral(
"shadow-rendering" ) );
419 mShadowSettings.
writeXml( elemShadows, context );
420 elem.appendChild( elemShadows );
422 QDomElement elemDebug = doc.createElement( QStringLiteral(
"debug" ) );
423 elemDebug.setAttribute( QStringLiteral(
"bounding-boxes" ), mShowTerrainBoundingBoxes ? 1 : 0 );
424 elemDebug.setAttribute( QStringLiteral(
"terrain-tile-info" ), mShowTerrainTileInfo ? 1 : 0 );
425 elemDebug.setAttribute( QStringLiteral(
"camera-view-center" ), mShowCameraViewCenter ? 1 : 0 );
426 elemDebug.setAttribute( QStringLiteral(
"camera-rotation-center" ), mShowCameraRotationCenter ? 1 : 0 );
427 elemDebug.setAttribute( QStringLiteral(
"show-light-sources" ), mShowLightSources ? 1 : 0 );
428 elemDebug.setAttribute( QStringLiteral(
"show-fps-counter" ), mIsFpsCounterEnabled ? 1 : 0 );
429 elem.appendChild( elemDebug );
431 QDomElement elemEyeDomeLighting = doc.createElement( QStringLiteral(
"eye-dome-lighting" ) );
432 elemEyeDomeLighting.setAttribute( QStringLiteral(
"enabled" ), mEyeDomeLightingEnabled ? 1 : 0 );
433 elemEyeDomeLighting.setAttribute( QStringLiteral(
"eye-dome-lighting-strength" ), mEyeDomeLightingStrength );
434 elemEyeDomeLighting.setAttribute( QStringLiteral(
"eye-dome-lighting-distance" ), mEyeDomeLightingDistance );
435 elem.appendChild( elemEyeDomeLighting );
437 QDomElement elemNavigationSync = doc.createElement( QStringLiteral(
"navigation-sync" ) );
438 elemNavigationSync.setAttribute( QStringLiteral(
"view-sync-mode" ), (
int )mViewSyncMode );
439 elemNavigationSync.setAttribute( QStringLiteral(
"view-frustum-visualization-enabled" ), mVisualizeViewFrustum ? 1 : 0 );
440 elem.appendChild( elemNavigationSync );
442 QDomElement elemDebugSettings = doc.createElement( QStringLiteral(
"debug-settings" ) );
443 elemDebugSettings.setAttribute( QStringLiteral(
"shadowmap-enabled" ), mDebugShadowMapEnabled );
444 elemDebugSettings.setAttribute( QStringLiteral(
"shadowmap-corner" ), mDebugShadowMapCorner );
445 elemDebugSettings.setAttribute( QStringLiteral(
"shadowmap-size" ), mDebugShadowMapSize );
446 elemDebugSettings.setAttribute( QStringLiteral(
"depthmap-enabled" ), mDebugDepthMapEnabled );
447 elemDebugSettings.setAttribute( QStringLiteral(
"depthmap-corner" ), mDebugDepthMapCorner );
448 elemDebugSettings.setAttribute( QStringLiteral(
"depthmap-size" ), mDebugDepthMapSize );
449 elem.appendChild( elemDebugSettings );
451 QDomElement elemTemporalRange = doc.createElement( QStringLiteral(
"temporal-range" ) );
452 elemTemporalRange.setAttribute( QStringLiteral(
"start" ),
temporalRange().begin().toString( Qt::ISODate ) );
453 elemTemporalRange.setAttribute( QStringLiteral(
"end" ),
temporalRange().end().toString( Qt::ISODate ) );
455 QDomElement elem3dAxis = doc.createElement( QStringLiteral(
"axis3d" ) );
456 m3dAxisSettings.
writeXml( elem3dAxis, context );
457 elem.appendChild( elem3dAxis );
464 for (
int i = 0; i < mLayers.count(); ++i )
470 mTerrainGenerator->resolveReferences( project );
472 for (
int i = 0; i < mRenderers.count(); ++i )
496 return mTransformContext;
501 mTransformContext = context;
506 if ( color == mBackgroundColor )
509 mBackgroundColor = color;
515 return mBackgroundColor;
520 if ( color == mSelectionColor )
523 mSelectionColor = color;
529 return mSelectionColor;
534 if ( zScale == mTerrainVerticalScale )
537 mTerrainVerticalScale = zScale;
543 return mTerrainVerticalScale;
548 QList<QgsMapLayerRef> lst;
549 lst.reserve(
layers.count() );
555 if ( mLayers == lst )
564 QList<QgsMapLayer *> lst;
565 lst.reserve( mLayers.count() );
568 if ( layerRef.layer )
569 lst.append( layerRef.layer );
601 QgsMeshTerrainGenerator *newTerrainGenerator =
new QgsMeshTerrainGenerator;
603 newTerrainGenerator->setLayer( meshProvider->
layer() );
604 std::unique_ptr< QgsMesh3DSymbol > symbol( newTerrainGenerator->symbol()->clone() );
606 newTerrainGenerator->setSymbol( symbol.release() );
623 if ( mMapTileResolution == res )
626 mMapTileResolution = res;
632 return mMapTileResolution;
637 if ( mMaxTerrainScreenError == error )
640 mMaxTerrainScreenError = error;
646 return mMaxTerrainScreenError;
651 if ( mMaxTerrainGroundError == error )
654 mMaxTerrainGroundError = error;
660 if ( mTerrainElevationOffset == offset )
662 mTerrainElevationOffset = offset;
668 return mMaxTerrainGroundError;
673 if ( mTerrainGenerator )
679 mTerrainGenerator.reset( gen );
688 if ( mTerrainShadingEnabled == enabled )
691 mTerrainShadingEnabled = enabled;
697 if ( mTerrainShadingMaterial == material )
700 mTerrainShadingMaterial = material;
706 if ( mTerrainMapTheme == theme )
709 mTerrainMapTheme = theme;
715 qDeleteAll( mRenderers );
724 if ( mShowTerrainBoundingBoxes == enabled )
727 mShowTerrainBoundingBoxes = enabled;
733 if ( mShowTerrainTileInfo == enabled )
736 mShowTerrainTileInfo = enabled;
742 if ( mShowCameraViewCenter == enabled )
745 mShowCameraViewCenter = enabled;
751 if ( mShowCameraRotationCenter == enabled )
754 mShowCameraRotationCenter = enabled;
761 if ( mShowLightSources == enabled )
764 mShowLightSources = enabled;
770 if ( mShowLabels == enabled )
773 mShowLabels = enabled;
779 if ( mEyeDomeLightingEnabled == enabled )
781 mEyeDomeLightingEnabled = enabled;
787 if ( mEyeDomeLightingStrength == strength )
789 mEyeDomeLightingStrength = strength;
795 if ( mEyeDomeLightingDistance == distance )
797 mEyeDomeLightingDistance = distance;
803 return mLightSources;
808 qDeleteAll( mLightSources );
809 mLightSources = lights;
836 if ( mCameraNavigationMode == navigationMode )
839 mCameraNavigationMode = navigationMode;
845 if ( mCameraMovementSpeed == movementSpeed )
848 mCameraMovementSpeed = movementSpeed;
866 mDebugShadowMapEnabled = enabled;
867 mDebugShadowMapCorner = corner;
868 mDebugShadowMapSize = size;
874 mDebugDepthMapEnabled = enabled;
875 mDebugDepthMapCorner = corner;
876 mDebugDepthMapSize = size;
882 if ( fpsCounterEnabled == mIsFpsCounterEnabled )
884 mIsFpsCounterEnabled = fpsCounterEnabled;
898 return mRendererUsage;
908 mViewSyncMode = mode;
913 if ( mVisualizeViewFrustum != enabled )
915 mVisualizeViewFrustum = enabled;
922 if ( debugOverlayEnabled == mIsDebugOverlayEnabled )
925 mIsDebugOverlayEnabled = debugOverlayEnabled;
930 void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
967 m3dAxisSettings = axisSettings;