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 
16 #include "qgs3dmapexportsettings.h"
17 #include "qgssettings.h"
18 
Qgs3DMapExportSettings()19 Qgs3DMapExportSettings::Qgs3DMapExportSettings()
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 
~Qgs3DMapExportSettings()32 Qgs3DMapExportSettings::~Qgs3DMapExportSettings()
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 }
44