QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
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"
20
#include "
qgsabstract3dmapbackgroundsettings.h
"
21
#include "
qgsskyboxentity.h
"
22
23
#include <QMap>
24
#include <QString>
25
26
#define SIP_NO_FILE
27
28
class
QgsReadWriteContext
;
29
class
QDomElement;
30
31
// this is broken for z-up coordinate system
32
#define ENABLE_PANORAMIC_SKYBOX 0
33
40
class
_3D_EXPORT
QgsSkyboxSettings
:
public
QgsAbstract3DMapBackgroundSettings
41
{
42
public
:
43
QgsSkyboxSettings
() =
default
;
44
QgsSkyboxSettings
(
const
QgsSkyboxSettings
&other );
45
QgsSkyboxSettings
&
operator=
(
QgsSkyboxSettings
const
&rhs );
46
47
Qgis::Map3DBackgroundType
type
()
const override
{
return
Qgis::Map3DBackgroundType::DistinctTextureSkybox
; }
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
133
Qgis::SkyboxCubeMapping
mCubeMapping =
Qgis::SkyboxCubeMapping::NativeZUp
;
134
QMap<QString, QString> mCubeMapFacesPaths;
135
bool
mEnableEnvironmentalLighting =
true
;
136
double
mEnvironmentalLightStrength = 1.0;
137
};
138
139
#endif
// QGSSKYBOXSETTINGS_H
Qgis::Map3DBackgroundType
Map3DBackgroundType
Background types for 3D map view.
Definition
qgis.h:4551
Qgis::Map3DBackgroundType::DistinctTextureSkybox
@ DistinctTextureSkybox
Skybox with 6 distinct textures for different faces.
Definition
qgis.h:4554
Qgis::SkyboxCubeMapping
SkyboxCubeMapping
Skybox texture cube mapping for distinct texture skyboxes.
Definition
qgis.h:4564
Qgis::SkyboxCubeMapping::NativeZUp
@ NativeZUp
Textures exported for Z-up (+X Right, +Y Forward, +Z Up).
Definition
qgis.h:4565
QgsAbstract3DMapBackgroundSettings
Base class for all background settings classes used in a 3D map view.
Definition
qgsabstract3dmapbackgroundsettings.h:35
QgsAbstract3DMapBackgroundSettings::clone
virtual QgsAbstract3DMapBackgroundSettings * clone() const =0
Returns a deep copy of this background settings object.
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsSkyboxSettings
Contains the configuration of a skybox entity.
Definition
qgsskyboxsettings.h:41
QgsSkyboxSettings::QgsSkyboxSettings
QgsSkyboxSettings()=default
QgsSkyboxSettings::environmentalLightingEnabled
bool environmentalLightingEnabled() const
Returns true if the skybox should generate environmental lighting effects.
Definition
qgsskyboxsettings.h:97
QgsSkyboxSettings::cubeMapFacesPaths
QMap< QString, QString > cubeMapFacesPaths() const
Returns a map containing the path of each texture specified by the user.
Definition
qgsskyboxsettings.h:66
QgsSkyboxSettings::type
Qgis::Map3DBackgroundType type() const override
Returns the unique type for this background settings class.
Definition
qgsskyboxsettings.h:47
QgsSkyboxSettings::environmentalLightStrength
double environmentalLightStrength() const
Returns the environmental light strength, as a factor between 0 and 1.
Definition
qgsskyboxsettings.h:116
QgsSkyboxSettings::setEnvironmentalLightingEnabled
void setEnvironmentalLightingEnabled(bool enabled)
Sets whether the skybox should generate environmental lighting effects.
Definition
qgsskyboxsettings.h:106
QgsSkyboxSettings::operator=
QgsSkyboxSettings & operator=(QgsSkyboxSettings const &rhs)
Definition
qgsskyboxsettings.cpp:45
QgsSkyboxSettings::setCubeMapFace
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...
Definition
qgsskyboxsettings.h:72
QgsSkyboxSettings::setEnvironmentalLightStrength
void setEnvironmentalLightStrength(double strength)
Sets the strength of the environmental light, as a factor between 0 and 1.
Definition
qgsskyboxsettings.h:126
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsabstract3dmapbackgroundsettings.h
qgsskyboxentity.h
Generated on
for QGIS API Documentation by
1.17.0