22#include <QDomDocument>
25using namespace Qt::StringLiterals;
34#if ENABLE_PANORAMIC_SKYBOX
35 : mPanoramicTexturePath( other.mPanoramicTexturePath )
36 , mCubeMapping( other.mCubeMapping )
38 : mCubeMapping( other.mCubeMapping )
40 , mCubeMapFacesPaths( other.mCubeMapFacesPaths )
41 , mEnableEnvironmentalLighting( other.mEnableEnvironmentalLighting )
42 , mEnvironmentalLightStrength( other.mEnvironmentalLightStrength )
50#if ENABLE_PANORAMIC_SKYBOX
51 this->mPanoramicTexturePath = rhs.mPanoramicTexturePath;
53 mCubeMapFacesPaths = rhs.mCubeMapFacesPaths;
54 mCubeMapping = rhs.mCubeMapping;
55 mEnableEnvironmentalLighting = rhs.mEnableEnvironmentalLighting;
56 mEnvironmentalLightStrength = rhs.mEnvironmentalLightStrength;
63#if ENABLE_PANORAMIC_SKYBOX
64 mPanoramicTexturePath = pathResolver.
readPath( element.attribute( u
"panoramic-texture-path"_s ) );
66 mCubeMapFacesPaths.clear();
67 mCubeMapFacesPaths[u
"posX"_s] = pathResolver.
readPath( element.attribute( u
"posX-texture-path"_s ) );
68 mCubeMapFacesPaths[u
"posY"_s] = pathResolver.
readPath( element.attribute( u
"posY-texture-path"_s ) );
69 mCubeMapFacesPaths[u
"posZ"_s] = pathResolver.
readPath( element.attribute( u
"posZ-texture-path"_s ) );
70 mCubeMapFacesPaths[u
"negX"_s] = pathResolver.
readPath( element.attribute( u
"negX-texture-path"_s ) );
71 mCubeMapFacesPaths[u
"negY"_s] = pathResolver.
readPath( element.attribute( u
"negY-texture-path"_s ) );
72 mCubeMapFacesPaths[u
"negZ"_s] = pathResolver.
readPath( element.attribute( u
"negZ-texture-path"_s ) );
75 mEnableEnvironmentalLighting = element.attribute( u
"environmental-lighting"_s, u
"1"_s ).toInt();
76 mEnvironmentalLightStrength = element.attribute( u
"environment-light-strength"_s, u
"1"_s ).toDouble();
82#if ENABLE_PANORAMIC_SKYBOX
83 element.setAttribute( u
"panoramic-texture-path"_s, pathResolver.
writePath( mPanoramicTexturePath ) );
85 element.setAttribute( u
"posX-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posX"_s] ) );
86 element.setAttribute( u
"posY-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posY"_s] ) );
87 element.setAttribute( u
"posZ-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posZ"_s] ) );
88 element.setAttribute( u
"negX-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negX"_s] ) );
89 element.setAttribute( u
"negY-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negY"_s] ) );
90 element.setAttribute( u
"negZ-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negZ"_s] ) );
92 element.setAttribute( u
"environmental-lighting"_s, mEnableEnvironmentalLighting ? u
"1"_s : u
"0"_s );
93 element.setAttribute( u
"environment-light-strength"_s, mEnvironmentalLightStrength );
103 mCubeMapping = mapping;
SkyboxCubeMapping
Skybox texture cube mapping for distinct texture skyboxes.
@ NativeZUp
Textures exported for Z-up (+X Right, +Y Forward, +Z Up).
Resolves relative paths into absolute paths and vice versa.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
A container for the context for various read/write operations on objects.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
void setCubeMapping(Qgis::SkyboxCubeMapping mapping)
Sets the cube face mapping scheme.
QgsSkyboxSettings()=default
void readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
QgsSkyboxSettings * clone() const override
Returns a deep copy of this background settings object.
QgsSkyboxSettings & operator=(QgsSkyboxSettings const &rhs)
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
Qgis::SkyboxCubeMapping cubeMapping() const
Returns the cube face mapping scheme.
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.