QGIS API Documentation 4.1.0-Master (ca2ac17535b)
Loading...
Searching...
No Matches
qgsskyboxsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsskyboxsettings.h
3 --------------------------------------
4 Date : August 2020
5 Copyright : (C) 2020 by Belgacem Nedjima
6 Email : gb uderscore 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 QGSSKYBOXSETTINGS_H
17#define QGSSKYBOXSETTINGS_H
18
19#include "qgis_3d.h"
21#include "qgsskyboxentity.h"
22
23#include <QMap>
24#include <QString>
25
26#define SIP_NO_FILE
27
29class QDomElement;
30
31// this is broken for z-up coordinate system
32#define ENABLE_PANORAMIC_SKYBOX 0
33
41{
42 public:
43 QgsSkyboxSettings() = default;
46
48 QgsSkyboxSettings *clone() const override SIP_FACTORY;
49
51 void readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
53 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const override;
54
55#if ENABLE_PANORAMIC_SKYBOX
57 QString panoramicTexturePath() const { return mPanoramicTexturePath; }
59 void setPanoramicTexturePath( const QString &texturePath ) { mPanoramicTexturePath = texturePath; }
60#endif
61
66 QMap<QString, QString> cubeMapFacesPaths() const { return mCubeMapFacesPaths; }
67
72 void setCubeMapFace( const QString &face, const QString &path ) { mCubeMapFacesPaths[face] = path; }
73
80 Qgis::SkyboxCubeMapping cubeMapping() const;
81
88 void setCubeMapping( Qgis::SkyboxCubeMapping mapping );
89
97 bool environmentalLightingEnabled() const { return mEnableEnvironmentalLighting; }
98
106 void setEnvironmentalLightingEnabled( bool enabled ) { mEnableEnvironmentalLighting = enabled; }
107
116 double environmentalLightStrength() const { return mEnvironmentalLightStrength; }
117
126 void setEnvironmentalLightStrength( double strength ) { mEnvironmentalLightStrength = strength; }
127
128 private:
129#if ENABLE_PANORAMIC_SKYBOX
130 QString mPanoramicTexturePath;
131#endif
132
134 QMap<QString, QString> mCubeMapFacesPaths;
135 bool mEnableEnvironmentalLighting = true;
136 double mEnvironmentalLightStrength = 1.0;
137};
138
139#endif // QGSSKYBOXSETTINGS_H
Map3DBackgroundType
Background types for 3D map view.
Definition qgis.h:4416
@ DistinctTextureSkybox
Skybox with 6 distinct textures for different faces.
Definition qgis.h:4419
SkyboxCubeMapping
Skybox texture cube mapping for distinct texture skyboxes.
Definition qgis.h:4429
@ NativeZUp
Textures exported for Z-up (+X Right, +Y Forward, +Z Up).
Definition qgis.h:4430
Base class for all background settings classes used in a 3D map view.
virtual QgsAbstract3DMapBackgroundSettings * clone() const =0
Returns a deep copy of this background settings object.
A container for the context for various read/write operations on objects.
Contains the configuration of a skybox entity.
QgsSkyboxSettings()=default
bool environmentalLightingEnabled() const
Returns true if the skybox should generate environmental lighting effects.
QMap< QString, QString > cubeMapFacesPaths() const
Returns a map containing the path of each texture specified by the user.
Qgis::Map3DBackgroundType type() const override
Returns the unique type for this background settings class.
double environmentalLightStrength() const
Returns the environmental light strength, as a factor between 0 and 1.
void setEnvironmentalLightingEnabled(bool enabled)
Sets whether the skybox should generate environmental lighting effects.
QgsSkyboxSettings & operator=(QgsSkyboxSettings const &rhs)
void setCubeMapFace(const QString &face, const QString &path)
Sets a face of one of the skybox 6 textures The face parameter needs to be one of the followings: "po...
void setEnvironmentalLightStrength(double strength)
Sets the strength of the environmental light, as a factor between 0 and 1.
#define SIP_FACTORY
Definition qgis_sip.h:83