QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
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
18#include "qgssettings.h"
19
20#include <QString>
21
22using namespace Qt::StringLiterals;
23
25{
26 const QgsSettings settings;
27 mSceneName = settings.value( u"UI/last3DSceneExportName"_s, u"Scene"_s ).toString();
28 mSceneFolderPath = settings.value( u"UI/last3DSceneExportDir"_s, QDir::homePath() ).toString();
29 mTerrainResolution = settings.value( u"UI/last3DSceneExportTerrainResolution"_s, 128 ).toInt();
30 mTerrainTextureResolution = settings.value( u"UI/last3DSceneExportTerrainTextureResolution"_s, 512 ).toInt();
31 mScale = settings.value( u"UI/last3DSceneExportModelScale"_s, 1.0f ).toFloat();
32 mSmoothEdges = settings.value( u"UI/last3DSceneExportSmoothEdges"_s, false ).toBool();
33 mExportNormals = settings.value( u"UI/last3DSceneExportExportNormals"_s, true ).toBool();
34 mExportTextures = settings.value( u"UI/last3DSceneExportExportTextures"_s, true ).toBool();
35}
36
38{
39 QgsSettings settings;
40 settings.setValue( u"UI/last3DSceneExportName"_s, mSceneName );
41 settings.setValue( u"UI/last3DSceneExportDir"_s, mSceneFolderPath );
42 settings.setValue( u"UI/last3DSceneExportTerrainResolution"_s, mTerrainResolution );
43 settings.setValue( u"UI/last3DSceneExportTerrainTextureResolution"_s, mTerrainTextureResolution );
44 settings.setValue( u"UI/last3DSceneExportModelScale"_s, mScale );
45 settings.setValue( u"UI/last3DSceneExportSmoothEdges"_s, mSmoothEdges );
46 settings.setValue( u"UI/last3DSceneExportExportNormals"_s, mExportNormals );
47 settings.setValue( u"UI/last3DSceneExportExportTextures"_s, mExportTextures );
48}
~Qgs3DMapExportSettings()
destructor (save the export settings before deallocation)
Stores settings for use within QGIS.
Definition qgssettings.h:68
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.