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 )
48#if ENABLE_PANORAMIC_SKYBOX
49 this->mPanoramicTexturePath = rhs.mPanoramicTexturePath;
51 this->mCubeMapFacesPaths = rhs.mCubeMapFacesPaths;
52 this->mCubeMapping = rhs.mCubeMapping;
59#if ENABLE_PANORAMIC_SKYBOX
60 mPanoramicTexturePath = pathResolver.
readPath( element.attribute( u
"panoramic-texture-path"_s ) );
62 mCubeMapFacesPaths.clear();
63 mCubeMapFacesPaths[u
"posX"_s] = pathResolver.
readPath( element.attribute( u
"posX-texture-path"_s ) );
64 mCubeMapFacesPaths[u
"posY"_s] = pathResolver.
readPath( element.attribute( u
"posY-texture-path"_s ) );
65 mCubeMapFacesPaths[u
"posZ"_s] = pathResolver.
readPath( element.attribute( u
"posZ-texture-path"_s ) );
66 mCubeMapFacesPaths[u
"negX"_s] = pathResolver.
readPath( element.attribute( u
"negX-texture-path"_s ) );
67 mCubeMapFacesPaths[u
"negY"_s] = pathResolver.
readPath( element.attribute( u
"negY-texture-path"_s ) );
68 mCubeMapFacesPaths[u
"negZ"_s] = pathResolver.
readPath( element.attribute( u
"negZ-texture-path"_s ) );
75#if ENABLE_PANORAMIC_SKYBOX
76 element.setAttribute( u
"panoramic-texture-path"_s, pathResolver.
writePath( mPanoramicTexturePath ) );
78 element.setAttribute( u
"posX-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posX"_s] ) );
79 element.setAttribute( u
"posY-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posY"_s] ) );
80 element.setAttribute( u
"posZ-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"posZ"_s] ) );
81 element.setAttribute( u
"negX-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negX"_s] ) );
82 element.setAttribute( u
"negY-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negY"_s] ) );
83 element.setAttribute( u
"negZ-texture-path"_s, pathResolver.
writePath( mCubeMapFacesPaths[u
"negZ"_s] ) );
94 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.