QGIS API Documentation 3.29.0-Master (19d7edcfed)
qgs3dmapexportsettings.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgs3dmapexportsettings.cpp
3 --------------------------------------
4 Date : July 2020
5 Copyright : (C) 2020 by Belgacem Nedjima
6 Email : gb underscore nedjima at esi dot dz
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17#include "qgssettings.h"
18
20{
21 const QgsSettings settings;
22 mSceneName = settings.value( QStringLiteral( "UI/last3DSceneExportName" ), QStringLiteral( "Scene" ) ).toString();
23 mSceneFolderPath = settings.value( QStringLiteral( "UI/last3DSceneExportDir" ), QDir::homePath() ).toString();
24 mTerrainResolution = settings.value( QStringLiteral( "UI/last3DSceneExportTerrainResolution" ), 128 ).toInt();
25 mTerrainTextureResolution = settings.value( QStringLiteral( "UI/last3DSceneExportTerrainTextureResolution" ), 512 ).toInt();
26 mScale = settings.value( QStringLiteral( "UI/last3DSceneExportModelScale" ), 1.0f ).toFloat();
27 mSmoothEdges = settings.value( QStringLiteral( "UI/last3DSceneExportSmoothEdges" ), false ).toBool();
28 mExportNormals = settings.value( QStringLiteral( "UI/last3DSceneExportExportNormals" ), true ).toBool();
29 mExportTextures = settings.value( QStringLiteral( "UI/last3DSceneExportExportTextures" ), true ).toBool();
30}
31
33{
34 QgsSettings settings;
35 settings.setValue( QStringLiteral( "UI/last3DSceneExportName" ), mSceneName );
36 settings.setValue( QStringLiteral( "UI/last3DSceneExportDir" ), mSceneFolderPath );
37 settings.setValue( QStringLiteral( "UI/last3DSceneExportTerrainResolution" ), mTerrainResolution );
38 settings.setValue( QStringLiteral( "UI/last3DSceneExportTerrainTextureResolution" ), mTerrainTextureResolution );
39 settings.setValue( QStringLiteral( "UI/last3DSceneExportModelScale" ), mScale );
40 settings.setValue( QStringLiteral( "UI/last3DSceneExportSmoothEdges" ), mSmoothEdges );
41 settings.setValue( QStringLiteral( "UI/last3DSceneExportExportNormals" ), mExportNormals );
42 settings.setValue( QStringLiteral( "UI/last3DSceneExportExportTextures" ), mExportTextures );
43}
~Qgs3DMapExportSettings()
destructor (save the export settings before deallocation)
This class is a composition of two QSettings instances:
Definition: qgssettings.h:63
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.