17#include "moc_qgs3dmapsettings.cpp" 
   36#include <QDomDocument> 
   46  connectChangedSignalsToSettingsChanged();
 
   47  mTerrainSettings = std::make_unique<QgsFlatTerrainSettings>();
 
 
   53  , mOrigin( other.mOrigin )
 
   55  , mBackgroundColor( other.mBackgroundColor )
 
   56  , mSelectionColor( other.mSelectionColor )
 
   57  , mTerrainShadingEnabled( other.mTerrainShadingEnabled )
 
   58  , mTerrainShadingMaterial( other.mTerrainShadingMaterial )
 
   59  , mTerrainMapTheme( other.mTerrainMapTheme )
 
   60  , mShowTerrainBoundingBoxes( other.mShowTerrainBoundingBoxes )
 
   61  , mShowTerrainTileInfo( other.mShowTerrainTileInfo )
 
   62  , mShowCameraViewCenter( other.mShowCameraViewCenter )
 
   63  , mShowCameraRotationCenter( other.mShowCameraRotationCenter )
 
   64  , mShowLightSources( other.mShowLightSources )
 
   65  , mShowLabels( other.mShowLabels )
 
   66  , mStopUpdates( other.mStopUpdates )
 
   67  , mShowDebugPanel( other.mShowDebugPanel )
 
   68  , mFieldOfView( other.mFieldOfView )
 
   69  , mProjectionType( other.mProjectionType )
 
   70  , mCameraNavigationMode( other.mCameraNavigationMode )
 
   71  , mCameraMovementSpeed( other.mCameraMovementSpeed )
 
   72  , 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  , mAmbientOcclusionSettings( other.mAmbientOcclusionSettings )
 
   82  , mEyeDomeLightingEnabled( other.mEyeDomeLightingEnabled )
 
   83  , mEyeDomeLightingStrength( other.mEyeDomeLightingStrength )
 
   84  , mEyeDomeLightingDistance( other.mEyeDomeLightingDistance )
 
   85  , mViewSyncMode( other.mViewSyncMode )
 
   86  , mVisualizeViewFrustum( other.mVisualizeViewFrustum )
 
   87  , mDebugShadowMapEnabled( other.mDebugShadowMapEnabled )
 
   88  , mDebugShadowMapCorner( other.mDebugShadowMapCorner )
 
   89  , mDebugShadowMapSize( other.mDebugShadowMapSize )
 
   90  , mDebugDepthMapEnabled( other.mDebugDepthMapEnabled )
 
   91  , mDebugDepthMapCorner( other.mDebugDepthMapCorner )
 
   92  , mDebugDepthMapSize( other.mDebugDepthMapSize )
 
   93  , mTerrainRenderingEnabled( other.mTerrainRenderingEnabled )
 
   94  , mRendererUsage( other.mRendererUsage )
 
   95  , m3dAxisSettings( other.m3dAxisSettings )
 
   96  , mIsDebugOverlayEnabled( other.mIsDebugOverlayEnabled )
 
   97  , mExtent( other.mExtent )
 
   98  , mShowExtentIn2DView( other.mShowExtentIn2DView )
 
  102  for ( 
QgsLightSource *source : std::as_const( other.mLightSources ) )
 
  105      mLightSources << source->clone();
 
  111  connectChangedSignalsToSettingsChanged();
 
 
  116  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()
 
  131  QDomElement elemExtent = elem.firstChildElement( QStringLiteral( 
"extent" ) );
 
  132  if ( !elemExtent.isNull() )
 
  135      elemExtent.attribute( QStringLiteral( 
"xMin" ) ).toDouble(),
 
  136      elemExtent.attribute( QStringLiteral( 
"yMin" ) ).toDouble(),
 
  137      elemExtent.attribute( QStringLiteral( 
"xMax" ) ).toDouble(),
 
  138      elemExtent.attribute( QStringLiteral( 
"yMax" ) ).toDouble()
 
  141    mShowExtentIn2DView = elemExtent.attribute( QStringLiteral( 
"showIn2dView" ), QStringLiteral( 
"0" ) ).toInt();
 
  148  QDomElement elemCamera = elem.firstChildElement( QStringLiteral( 
"camera" ) );
 
  149  if ( !elemCamera.isNull() )
 
  151    mFieldOfView = elemCamera.attribute( QStringLiteral( 
"field-of-view" ), QStringLiteral( 
"45" ) ).toFloat();
 
  152    mProjectionType = 
static_cast<Qt3DRender::QCameraLens::ProjectionType
>( elemCamera.attribute( QStringLiteral( 
"projection-type" ), QStringLiteral( 
"1" ) ).toInt() );
 
  153    QString 
cameraNavigationMode = elemCamera.attribute( QStringLiteral( 
"camera-navigation-mode" ), QStringLiteral( 
"basic-navigation" ) );
 
  160    mCameraMovementSpeed = elemCamera.attribute( QStringLiteral( 
"camera-movement-speed" ), QStringLiteral( 
"5.0" ) ).toDouble();
 
  163  QDomElement elemColor = elem.firstChildElement( QStringLiteral( 
"color" ) );
 
  164  if ( !elemColor.isNull() )
 
  170  QDomElement elemCrs = elem.firstChildElement( QStringLiteral( 
"crs" ) );
 
  173  QDomElement elemTerrain = elem.firstChildElement( QStringLiteral( 
"terrain" ) );
 
  174  mTerrainRenderingEnabled = elemTerrain.attribute( QStringLiteral( 
"terrain-rendering-enabled" ), QStringLiteral( 
"1" ) ).toInt();
 
  175  mTerrainShadingEnabled = elemTerrain.attribute( QStringLiteral( 
"shading-enabled" ), QStringLiteral( 
"0" ) ).toInt();
 
  177  QDomElement elemTerrainShadingMaterial = elemTerrain.firstChildElement( QStringLiteral( 
"shading-material" ) );
 
  178  if ( !elemTerrainShadingMaterial.isNull() )
 
  179    mTerrainShadingMaterial.
readXml( elemTerrainShadingMaterial, context );
 
  180  mTerrainMapTheme = elemTerrain.attribute( QStringLiteral( 
"map-theme" ) );
 
  181  mShowLabels = elemTerrain.attribute( QStringLiteral( 
"show-labels" ), QStringLiteral( 
"0" ) ).toInt();
 
  183  qDeleteAll( mLightSources );
 
  184  mLightSources.clear();
 
  185  const QDomElement lightsElem = elem.firstChildElement( QStringLiteral( 
"lights" ) );
 
  186  if ( !lightsElem.isNull() )
 
  188    const QDomNodeList lightNodes = lightsElem.childNodes();
 
  189    for ( 
int i = 0; i < lightNodes.size(); ++i )
 
  191      const QDomElement lightElement = lightNodes.at( i ).toElement();
 
  193        mLightSources << light;
 
  199    QDomElement elemPointLights = elem.firstChildElement( QStringLiteral( 
"point-lights" ) );
 
  200    if ( !elemPointLights.isNull() )
 
  202      QDomElement elemPointLight = elemPointLights.firstChildElement( QStringLiteral( 
"point-light" ) );
 
  203      while ( !elemPointLight.isNull() )
 
  205        auto pointLight = std::make_unique<QgsPointLightSettings>();
 
  206        pointLight->readXml( elemPointLight, context );
 
  207        mLightSources << pointLight.release();
 
  208        elemPointLight = elemPointLight.nextSiblingElement( QStringLiteral( 
"point-light" ) );
 
  214      auto defaultLight = std::make_unique<QgsPointLightSettings>();
 
  215      defaultLight->setPosition( 
QgsVector3D( 0, 1000, 0 ) );
 
  216      mLightSources << defaultLight.release();
 
  219    QDomElement elemDirectionalLights = elem.firstChildElement( QStringLiteral( 
"directional-lights" ) );
 
  220    if ( !elemDirectionalLights.isNull() )
 
  222      QDomElement elemDirectionalLight = elemDirectionalLights.firstChildElement( QStringLiteral( 
"directional-light" ) );
 
  223      while ( !elemDirectionalLight.isNull() )
 
  225        auto directionalLight = std::make_unique<QgsDirectionalLightSettings>();
 
  226        directionalLight->readXml( elemDirectionalLight, context );
 
  227        mLightSources << directionalLight.release();
 
  228        elemDirectionalLight = elemDirectionalLight.nextSiblingElement( QStringLiteral( 
"directional-light" ) );
 
  233  QDomElement elemMapLayers = elemTerrain.firstChildElement( QStringLiteral( 
"layers" ) );
 
  234  QDomElement elemMapLayer = elemMapLayers.firstChildElement( QStringLiteral( 
"layer" ) );
 
  235  QList<QgsMapLayerRef> mapLayers;
 
  236  while ( !elemMapLayer.isNull() )
 
  238    mapLayers << 
QgsMapLayerRef( elemMapLayer.attribute( QStringLiteral( 
"id" ) ) );
 
  239    elemMapLayer = elemMapLayer.nextSiblingElement( QStringLiteral( 
"layer" ) );
 
  243  QDomElement elemTerrainGenerator = elemTerrain.firstChildElement( QStringLiteral( 
"generator" ) );
 
  244  const QString terrainGenType = elemTerrainGenerator.attribute( QStringLiteral( 
"type" ) );
 
  252  QDomElement elemSkybox = elem.firstChildElement( QStringLiteral( 
"skybox" ) );
 
  253  mIsSkyboxEnabled = elemSkybox.attribute( QStringLiteral( 
"skybox-enabled" ) ).toInt();
 
  254  mSkyboxSettings.
readXml( elemSkybox, context );
 
  256  QDomElement elemShadows = elem.firstChildElement( QStringLiteral( 
"shadow-rendering" ) );
 
  257  mShadowSettings.
readXml( elemShadows, context );
 
  259  QDomElement elemAmbientOcclusion = elem.firstChildElement( QStringLiteral( 
"screen-space-ambient-occlusion" ) );
 
  260  mAmbientOcclusionSettings.
readXml( elemAmbientOcclusion, context );
 
  262  QDomElement elemEyeDomeLighting = elem.firstChildElement( QStringLiteral( 
"eye-dome-lighting" ) );
 
  263  mEyeDomeLightingEnabled = elemEyeDomeLighting.attribute( 
"enabled", QStringLiteral( 
"0" ) ).toInt();
 
  264  mEyeDomeLightingStrength = elemEyeDomeLighting.attribute( 
"eye-dome-lighting-strength", QStringLiteral( 
"1000.0" ) ).toDouble();
 
  265  mEyeDomeLightingDistance = elemEyeDomeLighting.attribute( 
"eye-dome-lighting-distance", QStringLiteral( 
"1" ) ).toInt();
 
  267  QDomElement elemNavigationSync = elem.firstChildElement( QStringLiteral( 
"navigation-sync" ) );
 
  268  mViewSyncMode = ( 
Qgis::ViewSyncModeFlags )( elemNavigationSync.attribute( QStringLiteral( 
"view-sync-mode" ), QStringLiteral( 
"0" ) ).toInt() );
 
  269  mVisualizeViewFrustum = elemNavigationSync.attribute( QStringLiteral( 
"view-frustum-visualization-enabled" ), QStringLiteral( 
"0" ) ).toInt();
 
  271  QDomElement elemDebugSettings = elem.firstChildElement( QStringLiteral( 
"debug-settings" ) );
 
  272  mDebugShadowMapEnabled = elemDebugSettings.attribute( QStringLiteral( 
"shadowmap-enabled" ), QStringLiteral( 
"0" ) ).toInt();
 
  273  mDebugShadowMapCorner = 
static_cast<Qt::Corner
>( elemDebugSettings.attribute( QStringLiteral( 
"shadowmap-corner" ), 
"0" ).toInt() );
 
  274  mDebugShadowMapSize = elemDebugSettings.attribute( QStringLiteral( 
"shadowmap-size" ), QStringLiteral( 
"0.2" ) ).toDouble();
 
  276  mDebugDepthMapEnabled = elemDebugSettings.attribute( QStringLiteral( 
"depthmap-enabled" ), QStringLiteral( 
"0" ) ).toInt();
 
  277  mDebugDepthMapCorner = 
static_cast<Qt::Corner
>( elemDebugSettings.attribute( QStringLiteral( 
"depthmap-corner" ), QStringLiteral( 
"1" ) ).toInt() );
 
  278  mDebugDepthMapSize = elemDebugSettings.attribute( QStringLiteral( 
"depthmap-size" ), QStringLiteral( 
"0.2" ) ).toDouble();
 
  280  QDomElement elemDebug = elem.firstChildElement( QStringLiteral( 
"debug" ) );
 
  281  mShowTerrainBoundingBoxes = elemDebug.attribute( QStringLiteral( 
"bounding-boxes" ), QStringLiteral( 
"0" ) ).toInt();
 
  282  mShowTerrainTileInfo = elemDebug.attribute( QStringLiteral( 
"terrain-tile-info" ), QStringLiteral( 
"0" ) ).toInt();
 
  283  mShowCameraViewCenter = elemDebug.attribute( QStringLiteral( 
"camera-view-center" ), QStringLiteral( 
"0" ) ).toInt();
 
  284  mShowCameraRotationCenter = elemDebug.attribute( QStringLiteral( 
"camera-rotation-center" ), QStringLiteral( 
"0" ) ).toInt();
 
  285  mShowLightSources = elemDebug.attribute( QStringLiteral( 
"show-light-sources" ), QStringLiteral( 
"0" ) ).toInt();
 
  286  mIsFpsCounterEnabled = elemDebug.attribute( QStringLiteral( 
"show-fps-counter" ), QStringLiteral( 
"0" ) ).toInt();
 
  287  mStopUpdates = elemDebug.attribute( QStringLiteral( 
"stop-updates" ), QStringLiteral( 
"0" ) ).toInt();
 
  288  mShowDebugPanel = elemDebug.attribute( QStringLiteral( 
"debug-panel" ), QStringLiteral( 
"0" ) ).toInt();
 
  290  QDomElement elemTemporalRange = elem.firstChildElement( QStringLiteral( 
"temporal-range" ) );
 
  291  QDateTime start = QDateTime::fromString( elemTemporalRange.attribute( QStringLiteral( 
"start" ) ), Qt::ISODate );
 
  292  QDateTime end = QDateTime::fromString( elemTemporalRange.attribute( QStringLiteral( 
"end" ) ), Qt::ISODate );
 
  295  QDomElement elem3dAxis = elem.firstChildElement( QStringLiteral( 
"axis3d" ) );
 
  296  m3dAxisSettings.
readXml( elem3dAxis, context );
 
 
  303  QDomElement elem = doc.createElement( QStringLiteral( 
"qgis3d" ) );
 
  305  QDomElement elemOrigin = doc.createElement( QStringLiteral( 
"origin" ) );
 
  306  elemOrigin.setAttribute( QStringLiteral( 
"x" ), QString::number( mOrigin.
x() ) );
 
  307  elemOrigin.setAttribute( QStringLiteral( 
"y" ), QString::number( mOrigin.
y() ) );
 
  308  elemOrigin.setAttribute( QStringLiteral( 
"z" ), QString::number( mOrigin.
z() ) );
 
  309  elem.appendChild( elemOrigin );
 
  311  QDomElement elemExtent = doc.createElement( QStringLiteral( 
"extent" ) );
 
  312  elemExtent.setAttribute( QStringLiteral( 
"xMin" ), mExtent.
xMinimum() );
 
  313  elemExtent.setAttribute( QStringLiteral( 
"yMin" ), mExtent.
yMinimum() );
 
  314  elemExtent.setAttribute( QStringLiteral( 
"xMax" ), mExtent.
xMaximum() );
 
  315  elemExtent.setAttribute( QStringLiteral( 
"yMax" ), mExtent.
yMaximum() );
 
  316  elemExtent.setAttribute( QStringLiteral( 
"showIn2dView" ), mShowExtentIn2DView );
 
  317  elem.appendChild( elemExtent );
 
  319  QDomElement elemCamera = doc.createElement( QStringLiteral( 
"camera" ) );
 
  320  elemCamera.setAttribute( QStringLiteral( 
"field-of-view" ), mFieldOfView );
 
  321  elemCamera.setAttribute( QStringLiteral( 
"projection-type" ), 
static_cast<int>( mProjectionType ) );
 
  322  switch ( mCameraNavigationMode )
 
  325      elemCamera.setAttribute( QStringLiteral( 
"camera-navigation-mode" ), QStringLiteral( 
"terrain-based-navigation" ) );
 
  328      elemCamera.setAttribute( QStringLiteral( 
"camera-navigation-mode" ), QStringLiteral( 
"walk-navigation" ) );
 
  331      elemCamera.setAttribute( QStringLiteral( 
"camera-navigation-mode" ), QStringLiteral( 
"globe-terrain-based-navigation" ) );
 
  334  elemCamera.setAttribute( QStringLiteral( 
"camera-movement-speed" ), mCameraMovementSpeed );
 
  335  elem.appendChild( elemCamera );
 
  337  QDomElement elemColor = doc.createElement( QStringLiteral( 
"color" ) );
 
  340  elem.appendChild( elemColor );
 
  342  QDomElement elemCrs = doc.createElement( QStringLiteral( 
"crs" ) );
 
  344  elem.appendChild( elemCrs );
 
  346  QDomElement elemTerrain = doc.createElement( QStringLiteral( 
"terrain" ) );
 
  347  elemTerrain.setAttribute( QStringLiteral( 
"terrain-rendering-enabled" ), mTerrainRenderingEnabled ? 1 : 0 );
 
  348  elemTerrain.setAttribute( QStringLiteral( 
"shading-enabled" ), mTerrainShadingEnabled ? 1 : 0 );
 
  350  QDomElement elemTerrainShadingMaterial = doc.createElement( QStringLiteral( 
"shading-material" ) );
 
  351  mTerrainShadingMaterial.
writeXml( elemTerrainShadingMaterial, context );
 
  352  elemTerrain.appendChild( elemTerrainShadingMaterial );
 
  353  elemTerrain.setAttribute( QStringLiteral( 
"map-theme" ), mTerrainMapTheme );
 
  354  elemTerrain.setAttribute( QStringLiteral( 
"show-labels" ), mShowLabels ? 1 : 0 );
 
  357    QDomElement elemLights = doc.createElement( QStringLiteral( 
"lights" ) );
 
  360      const QDomElement elemLight = light->writeXml( doc, context );
 
  361      elemLights.appendChild( elemLight );
 
  363    elem.appendChild( elemLights );
 
  366  QDomElement elemMapLayers = doc.createElement( QStringLiteral( 
"layers" ) );
 
  369    QDomElement elemMapLayer = doc.createElement( QStringLiteral( 
"layer" ) );
 
  370    elemMapLayer.setAttribute( QStringLiteral( 
"id" ), layerRef.layerId );
 
  371    elemMapLayers.appendChild( elemMapLayer );
 
  373  elemTerrain.appendChild( elemMapLayers );
 
  375  QDomElement elemTerrainGenerator = doc.createElement( QStringLiteral( 
"generator" ) );
 
  376  elemTerrainGenerator.setAttribute( QStringLiteral( 
"type" ), mTerrainSettings->type() );
 
  377  mTerrainSettings->writeXml( elemTerrain, context );
 
  378  elemTerrain.appendChild( elemTerrainGenerator );
 
  379  elem.appendChild( elemTerrain );
 
  381  QDomElement elemSkybox = doc.createElement( QStringLiteral( 
"skybox" ) );
 
  382  elemSkybox.setAttribute( QStringLiteral( 
"skybox-enabled" ), mIsSkyboxEnabled );
 
  383  mSkyboxSettings.
writeXml( elemSkybox, context );
 
  384  elem.appendChild( elemSkybox );
 
  386  QDomElement elemShadows = doc.createElement( QStringLiteral( 
"shadow-rendering" ) );
 
  387  mShadowSettings.
writeXml( elemShadows, context );
 
  388  elem.appendChild( elemShadows );
 
  390  QDomElement elemAmbientOcclusion = doc.createElement( QStringLiteral( 
"screen-space-ambient-occlusion" ) );
 
  391  mAmbientOcclusionSettings.
writeXml( elemAmbientOcclusion, context );
 
  392  elem.appendChild( elemAmbientOcclusion );
 
  394  QDomElement elemDebug = doc.createElement( QStringLiteral( 
"debug" ) );
 
  395  elemDebug.setAttribute( QStringLiteral( 
"bounding-boxes" ), mShowTerrainBoundingBoxes ? 1 : 0 );
 
  396  elemDebug.setAttribute( QStringLiteral( 
"terrain-tile-info" ), mShowTerrainTileInfo ? 1 : 0 );
 
  397  elemDebug.setAttribute( QStringLiteral( 
"camera-view-center" ), mShowCameraViewCenter ? 1 : 0 );
 
  398  elemDebug.setAttribute( QStringLiteral( 
"camera-rotation-center" ), mShowCameraRotationCenter ? 1 : 0 );
 
  399  elemDebug.setAttribute( QStringLiteral( 
"show-light-sources" ), mShowLightSources ? 1 : 0 );
 
  400  elemDebug.setAttribute( QStringLiteral( 
"show-fps-counter" ), mIsFpsCounterEnabled ? 1 : 0 );
 
  401  elemDebug.setAttribute( QStringLiteral( 
"stop-updates" ), mStopUpdates ? 1 : 0 );
 
  402  elemDebug.setAttribute( QStringLiteral( 
"debug-panel" ), mShowDebugPanel ? 1 : 0 );
 
  403  elem.appendChild( elemDebug );
 
  405  QDomElement elemEyeDomeLighting = doc.createElement( QStringLiteral( 
"eye-dome-lighting" ) );
 
  406  elemEyeDomeLighting.setAttribute( QStringLiteral( 
"enabled" ), mEyeDomeLightingEnabled ? 1 : 0 );
 
  407  elemEyeDomeLighting.setAttribute( QStringLiteral( 
"eye-dome-lighting-strength" ), mEyeDomeLightingStrength );
 
  408  elemEyeDomeLighting.setAttribute( QStringLiteral( 
"eye-dome-lighting-distance" ), mEyeDomeLightingDistance );
 
  409  elem.appendChild( elemEyeDomeLighting );
 
  411  QDomElement elemNavigationSync = doc.createElement( QStringLiteral( 
"navigation-sync" ) );
 
  412  elemNavigationSync.setAttribute( QStringLiteral( 
"view-sync-mode" ), ( int ) mViewSyncMode );
 
  413  elemNavigationSync.setAttribute( QStringLiteral( 
"view-frustum-visualization-enabled" ), mVisualizeViewFrustum ? 1 : 0 );
 
  414  elem.appendChild( elemNavigationSync );
 
  416  QDomElement elemDebugSettings = doc.createElement( QStringLiteral( 
"debug-settings" ) );
 
  417  elemDebugSettings.setAttribute( QStringLiteral( 
"shadowmap-enabled" ), mDebugShadowMapEnabled );
 
  418  elemDebugSettings.setAttribute( QStringLiteral( 
"shadowmap-corner" ), mDebugShadowMapCorner );
 
  419  elemDebugSettings.setAttribute( QStringLiteral( 
"shadowmap-size" ), mDebugShadowMapSize );
 
  420  elemDebugSettings.setAttribute( QStringLiteral( 
"depthmap-enabled" ), mDebugDepthMapEnabled );
 
  421  elemDebugSettings.setAttribute( QStringLiteral( 
"depthmap-corner" ), mDebugDepthMapCorner );
 
  422  elemDebugSettings.setAttribute( QStringLiteral( 
"depthmap-size" ), mDebugDepthMapSize );
 
  423  elem.appendChild( elemDebugSettings );
 
  425  QDomElement elemTemporalRange = doc.createElement( QStringLiteral( 
"temporal-range" ) );
 
  426  elemTemporalRange.setAttribute( QStringLiteral( 
"start" ), 
temporalRange().
begin().toString( Qt::ISODate ) );
 
  427  elemTemporalRange.setAttribute( QStringLiteral( 
"end" ), 
temporalRange().
end().toString( Qt::ISODate ) );
 
  429  QDomElement elem3dAxis = doc.createElement( QStringLiteral( 
"axis3d" ) );
 
  430  m3dAxisSettings.
writeXml( elem3dAxis, context );
 
  431  elem.appendChild( elem3dAxis );
 
 
  440  for ( 
int i = 0; i < mLayers.count(); ++i )
 
  446  if ( mTerrainSettings )
 
  448    mTerrainSettings->resolveReferences( &project );
 
 
  465    QgsDebugError( QStringLiteral( 
"extent() should not be used with globe!" ) );
 
 
  480    QgsDebugError( QStringLiteral( 
"setExtent() should not be used with globe!" ) );
 
  486  if ( mTerrainGenerator )
 
  489    mTerrainGenerator->setExtent( terrainExtent );
 
 
  561  return mTransformContext;
 
 
  568  mTransformContext = context;
 
 
  575  return mPathResolver;
 
 
  582  mPathResolver = resolver;
 
 
  596  mMapThemes = mapThemes;
 
 
  603  if ( color == mBackgroundColor )
 
  606  mBackgroundColor = color;
 
 
  614  return mBackgroundColor;
 
 
  621  if ( color == mSelectionColor )
 
  624  mSelectionColor = color;
 
 
  632  return mSelectionColor;
 
 
  639  if ( zScale == mTerrainSettings->verticalScale() )
 
  642  mTerrainSettings->setVerticalScale( zScale );
 
 
  653  return mTerrainSettings->verticalScale();
 
 
  660  const QList<QgsMapLayer *> raw = _qgis_listRefToRaw( mLayers );
 
  665  mLayers = _qgis_listRawToRef( 
layers );
 
 
  673  QList<QgsMapLayer *> lst;
 
  674  lst.reserve( mLayers.count() );
 
  677    if ( layerRef.layer )
 
  678      lst.append( layerRef.layer );
 
 
  700  return mTerrainSettings.get();
 
 
  707  bool hasChanged = 
false;
 
  708  if ( settings == mTerrainSettings.get() )
 
  716    hasChanged = !settings->
equals( mTerrainSettings.get() ) || !mTerrainGenerator;
 
  717    mTerrainSettings.reset( settings );
 
 
  745  if ( mTerrainSettings->mapTileResolution() == res )
 
  748  mTerrainSettings->setMapTileResolution( res );
 
 
  759  return mTerrainSettings->mapTileResolution();
 
 
  766  if ( mTerrainSettings->maximumScreenError() == error )
 
  769  mTerrainSettings->setMaximumScreenError( error );
 
 
  780  return mTerrainSettings->maximumScreenError();
 
 
  787  if ( mTerrainSettings->maximumGroundError() == error )
 
  790  mTerrainSettings->setMaximumGroundError( error );
 
 
  802  if ( mTerrainSettings->elevationOffset() == offset )
 
  804  mTerrainSettings->setElevationOffset( offset );
 
 
  815  return mTerrainSettings->elevationOffset();
 
 
  822  return mTerrainSettings->maximumGroundError();
 
 
  829  if ( mTerrainGenerator )
 
  839  mTerrainGenerator.reset( gen );
 
 
  849  return mTerrainGenerator.get();
 
 
  856  if ( mTerrainShadingEnabled == enabled )
 
  859  mTerrainShadingEnabled = enabled;
 
 
  867  return mTerrainShadingEnabled;
 
 
  874  if ( mTerrainShadingMaterial == material )
 
  877  mTerrainShadingMaterial = material;
 
 
  885  return mTerrainShadingMaterial;
 
 
  892  if ( mTerrainMapTheme == theme )
 
  895  mTerrainMapTheme = theme;
 
 
  903  return mTerrainMapTheme;
 
 
  910  if ( mShowTerrainBoundingBoxes == enabled )
 
  913  mShowTerrainBoundingBoxes = enabled;
 
 
  921  return mShowTerrainBoundingBoxes;
 
 
  929  if ( mShowTerrainTileInfo == enabled )
 
  932  mShowTerrainTileInfo = enabled;
 
 
  940  return mShowTerrainTileInfo;
 
 
  947  if ( mShowCameraViewCenter == enabled )
 
  950  mShowCameraViewCenter = enabled;
 
 
  958  return mShowCameraViewCenter;
 
 
  965  if ( mShowCameraRotationCenter == enabled )
 
  968  mShowCameraRotationCenter = enabled;
 
 
  976  return mShowCameraRotationCenter;
 
 
  983  if ( mShowLightSources == enabled )
 
  986  mShowLightSources = enabled;
 
 
  994  return mShowLightSources;
 
 
 1001  if ( mShowLabels == enabled )
 
 1004  mShowLabels = enabled;
 
 
 1019  if ( mStopUpdates == enabled )
 
 1022  mStopUpdates = enabled;
 
 
 1030  return mStopUpdates;
 
 
 1037  if ( mEyeDomeLightingEnabled == enabled )
 
 1039  mEyeDomeLightingEnabled = enabled;
 
 
 1047  return mEyeDomeLightingEnabled;
 
 
 1054  if ( mEyeDomeLightingStrength == strength )
 
 1056  mEyeDomeLightingStrength = strength;
 
 
 1064  return mEyeDomeLightingStrength;
 
 
 1071  if ( mEyeDomeLightingDistance == distance )
 
 1073  mEyeDomeLightingDistance = distance;
 
 
 1081  return mEyeDomeLightingDistance;
 
 
 1088  return mLightSources;
 
 
 1096  if ( mLightSources.count() == lights.count() )
 
 1099    for ( 
int i = 0; i < mLightSources.count(); ++i )
 
 1101      if ( mLightSources[i]->type() == lights[i]->type() )
 
 1103        switch ( mLightSources[i]->type() )
 
 1120      qDeleteAll( lights );
 
 1125  qDeleteAll( mLightSources );
 
 1126  mLightSources = lights;
 
 
 1137  return mFieldOfView;
 
 
 1155  return mProjectionType;
 
 
 1173  return mCameraNavigationMode;
 
 
 1180  if ( mCameraNavigationMode == navigationMode )
 
 1183  mCameraNavigationMode = navigationMode;
 
 
 1191  return mCameraMovementSpeed;
 
 
 1198  if ( mCameraMovementSpeed == movementSpeed )
 
 1201  mCameraMovementSpeed = movementSpeed;
 
 
 1223  return mSkyboxSettings;
 
 
 1230  return mShadowSettings;
 
 
 1237  return mAmbientOcclusionSettings;
 
 
 1268  return mIsSkyboxEnabled;
 
 
 1275  mIsSkyboxEnabled = enabled;
 
 
 1282  return mIsFpsCounterEnabled;
 
 
 1289  if ( mShowDebugPanel == enabled )
 
 1292  mShowDebugPanel = enabled;
 
 
 1300  return mShowDebugPanel;
 
 
 1307  mDebugShadowMapEnabled = enabled;
 
 1308  mDebugShadowMapCorner = corner;
 
 1309  mDebugShadowMapSize = size;
 
 
 1317  return mDebugShadowMapEnabled;
 
 
 1324  return mDebugShadowMapCorner;
 
 
 1331  return mDebugShadowMapSize;
 
 
 1338  mDebugDepthMapEnabled = enabled;
 
 1339  mDebugDepthMapCorner = corner;
 
 1340  mDebugDepthMapSize = size;
 
 
 1348  return mDebugDepthMapEnabled;
 
 
 1355  return mDebugDepthMapCorner;
 
 
 1362  return mDebugDepthMapSize;
 
 
 1369  if ( fpsCounterEnabled == mIsFpsCounterEnabled )
 
 1371  mIsFpsCounterEnabled = fpsCounterEnabled;
 
 
 1379  return mTerrainRenderingEnabled;
 
 
 1396  return mRendererUsage;
 
 
 1410  return mViewSyncMode;
 
 
 1417  mViewSyncMode = mode;
 
 
 1424  return mVisualizeViewFrustum;
 
 
 1431  if ( mVisualizeViewFrustum != enabled )
 
 1433    mVisualizeViewFrustum = enabled;
 
 
 1442  return m3dAxisSettings;
 
 
 1449  if ( debugOverlayEnabled == mIsDebugOverlayEnabled )
 
 1452  mIsDebugOverlayEnabled = debugOverlayEnabled;
 
 
 1460  return mShowExtentIn2DView;
 
 
 1463void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
 
 1505  if ( axisSettings == m3dAxisSettings )
 
 1517    m3dAxisSettings = axisSettings;
 
 
 1526  return mIsDebugOverlayEnabled;
 
 
 1533  if ( show == mShowExtentIn2DView )
 
 1536  mShowExtentIn2DView = show;
 
 
@ 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 readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
 
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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)
 
void setSkyboxSettings(const QgsSkyboxSettings &skyboxSettings)
Sets the current configuration of the skybox.
 
void skyboxSettingsChanged()
Emitted when skybox settings are changed.
 
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 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.
 
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.
 
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.
 
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.
 
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.
 
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 terrain settings classes.
 
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads settings from a DOM element.
 
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.
 
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
 
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
 
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.
 
bool readXml(const QDomNode &node)
Restores state from the given DOM node.
 
bool writeXml(QDomNode &node, QDomDocument &doc) const
Stores state to the given Dom node in the given document.
 
Qgis::CrsType type() const
Returns the type of the CRS.
 
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...
 
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
 
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
 
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.
 
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
 
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
 
Contains the configuration of a skybox entity.
 
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
 
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
 
Base class for objects with an associated (optional) temporal range.
 
const QgsDateTimeRange & temporalRange() const
Returns the datetime range for the object.
 
void setTemporalRange(const QgsDateTimeRange &range)
Sets the temporal range for the object.
 
T begin() const
Returns the beginning of the range.
 
T end() const
Returns the upper bound of the range.
 
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...
 
double y() const
Returns Y coordinate.
 
double z() const
Returns Z coordinate.
 
double x() const
Returns X coordinate.
 
#define Q_NOWARN_DEPRECATED_POP
 
#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
 
const QgsCoordinateReferenceSystem & crs
 
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
 
QString layerId
Original layer ID.