QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgs3dmapexportsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgs3dmapexportsettings.h
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 #ifndef QGS3DMAPEXPORTSETTINGS_H
17 #define QGS3DMAPEXPORTSETTINGS_H
18 
19 #include "qgis_3d.h"
20 
21 #include <QString>
22 #include <QObject>
23 #include <QDir>
24 
31 class _3D_EXPORT Qgs3DMapExportSettings
32 {
33  public:
36 
39 
41  QString sceneName() const { return mSceneName; }
43  QString sceneFolderPath() const { return mSceneFolderPath; }
45  int terrrainResolution() const { return mTerrainResolution; }
47  bool smoothEdges() const { return mSmoothEdges; }
49  bool exportNormals() const { return mExportNormals; }
51  bool exportTextures() const { return mExportTextures; }
53  int terrainTextureResolution() const { return mTerrainTextureResolution; }
55  float scale() const { return mScale; }
56 
58  void setSceneName( const QString &sceneName ) { mSceneName = sceneName; }
60  void setSceneFolderPath( const QString &sceneFolderPath ) { mSceneFolderPath = sceneFolderPath; }
62  void setTerrainResolution( int resolution ) { mTerrainResolution = resolution; }
64  void setSmoothEdges( bool smoothEdges ) { mSmoothEdges = smoothEdges; }
66  void setExportNormals( bool exportNormals ) { mExportNormals = exportNormals; }
68  void setExportTextures( bool exportTextures ) { mExportTextures = exportTextures; }
70  void setTerrainTextureResolution( int resolution ) { mTerrainTextureResolution = resolution; }
72  void setScale( float scale ) { mScale = scale; }
73 
74  private:
75  QString mSceneName = QString( "Scene" );
76  QString mSceneFolderPath = QDir::homePath();
77  int mTerrainResolution = 128;
78  bool mSmoothEdges = false;
79  bool mExportNormals = true;
80  bool mExportTextures = false;
81  int mTerrainTextureResolution = 512;
82  float mScale = 1.0f;
83 };
84 
85 #endif // QGS3DMAPEXPORTSETTINGS_H
Qgs3DMapExportSettings::setSmoothEdges
void setSmoothEdges(bool smoothEdges)
Sets whether triangles edges will look smooth.
Definition: qgs3dmapexportsettings.h:64
Qgs3DMapExportSettings::setExportTextures
void setExportTextures(bool exportTextures)
Sets whether textures will be exported.
Definition: qgs3dmapexportsettings.h:68
Qgs3DMapExportSettings::setTerrainTextureResolution
void setTerrainTextureResolution(int resolution)
Sets the terrain texture resolution.
Definition: qgs3dmapexportsettings.h:70
Qgs3DMapExportSettings::exportTextures
bool exportTextures() const
Returns whether textures will be exported.
Definition: qgs3dmapexportsettings.h:51
Qgs3DMapExportSettings::setTerrainResolution
void setTerrainResolution(int resolution)
Sets the terrain resolution.
Definition: qgs3dmapexportsettings.h:62
Qgs3DMapExportSettings
The Qgs3DMapExportSettings class Manages the various settings the user can choose from when exporting...
Definition: qgs3dmapexportsettings.h:32
Qgs3DMapExportSettings::smoothEdges
bool smoothEdges() const
Returns whether triangles edges will look smooth.
Definition: qgs3dmapexportsettings.h:47
Qgs3DMapExportSettings::sceneFolderPath
QString sceneFolderPath() const
Returns the scene folder path.
Definition: qgs3dmapexportsettings.h:43
Qgs3DMapExportSettings::setSceneName
void setSceneName(const QString &sceneName)
Sets the scene name.
Definition: qgs3dmapexportsettings.h:58
Qgs3DMapExportSettings::setScale
void setScale(float scale)
Sets the scale of exported model.
Definition: qgs3dmapexportsettings.h:72
Qgs3DMapExportSettings::scale
float scale() const
Returns the scale of the exported model.
Definition: qgs3dmapexportsettings.h:55
Qgs3DMapExportSettings::setExportNormals
void setExportNormals(bool exportNormals)
Sets whether normals should be exported.
Definition: qgs3dmapexportsettings.h:66
Qgs3DMapExportSettings::terrainTextureResolution
int terrainTextureResolution() const
Returns the terrain texture resolution.
Definition: qgs3dmapexportsettings.h:53
Qgs3DMapExportSettings::sceneName
QString sceneName() const
Returns the scene name.
Definition: qgs3dmapexportsettings.h:41
Qgs3DMapExportSettings::exportNormals
bool exportNormals() const
Returns whether normals will be exported.
Definition: qgs3dmapexportsettings.h:49
Qgs3DMapExportSettings::terrrainResolution
int terrrainResolution() const
Returns the terrain resolution.
Definition: qgs3dmapexportsettings.h:45
Qgs3DMapExportSettings::setSceneFolderPath
void setSceneFolderPath(const QString &sceneFolderPath)
Sets the scene's .obj file folder path.
Definition: qgs3dmapexportsettings.h:60