QGIS API Documentation
3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
src
3d
qgsambientocclusionsettings.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsambientocclusionsettings.cpp
3
--------------------------------------
4
Date : June 2022
5
Copyright : (C) 2022 by Belgacem Nedjima
6
Email : belgacem dot nedjima at gmail dot com
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
#include "
qgsambientocclusionsettings.h
"
17
18
#include <QDomDocument>
19
20
#include "
qgsreadwritecontext.h
"
21
22
23
QgsAmbientOcclusionSettings::QgsAmbientOcclusionSettings
(
const
QgsAmbientOcclusionSettings
&other )
24
: mEnabled( other.mEnabled )
25
, mIntensity( other.mIntensity )
26
, mRadius( other.mRadius )
27
, mThreshold( other.mThreshold )
28
{
29
30
}
31
32
QgsAmbientOcclusionSettings
&
QgsAmbientOcclusionSettings::operator=
(
QgsAmbientOcclusionSettings
const
&rhs )
33
{
34
mEnabled = rhs.mEnabled;
35
mIntensity = rhs.mIntensity;
36
mRadius = rhs.mRadius;
37
mThreshold = rhs.mThreshold;
38
return
*
this
;
39
}
40
41
void
QgsAmbientOcclusionSettings::readXml
(
const
QDomElement &element,
const
QgsReadWriteContext
&context )
42
{
43
mEnabled = element.attribute( QStringLiteral(
"enabled"
), QStringLiteral(
"0"
) ).toInt();
44
mIntensity = element.attribute( QStringLiteral(
"intensity"
), QStringLiteral(
"0.5"
) ).toFloat();
45
mRadius = element.attribute( QStringLiteral(
"radius"
), QStringLiteral(
"25"
) ).toFloat();
46
mThreshold = element.attribute( QStringLiteral(
"threshold"
), QStringLiteral(
"0.5"
) ).toFloat();
47
48
Q_UNUSED( context );
49
}
50
51
void
QgsAmbientOcclusionSettings::writeXml
( QDomElement &element,
const
QgsReadWriteContext
&context )
const
52
{
53
element.setAttribute( QStringLiteral(
"enabled"
), mEnabled );
54
element.setAttribute( QStringLiteral(
"intensity"
), mIntensity );
55
element.setAttribute( QStringLiteral(
"radius"
), mRadius );
56
element.setAttribute( QStringLiteral(
"threshold"
), mThreshold );
57
58
Q_UNUSED( context );
59
}
QgsAmbientOcclusionSettings
class containing the configuration of ambient occlusion rendering 3
Definition
qgsambientocclusionsettings.h:36
QgsAmbientOcclusionSettings::writeXml
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
Definition
qgsambientocclusionsettings.cpp:51
QgsAmbientOcclusionSettings::operator=
QgsAmbientOcclusionSettings & operator=(QgsAmbientOcclusionSettings const &rhs)
Definition
qgsambientocclusionsettings.cpp:32
QgsAmbientOcclusionSettings::QgsAmbientOcclusionSettings
QgsAmbientOcclusionSettings()=default
QgsAmbientOcclusionSettings::readXml
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
Definition
qgsambientocclusionsettings.cpp:41
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition
qgsreadwritecontext.h:34
qgsambientocclusionsettings.h
qgsreadwritecontext.h
Generated on Tue Nov 19 2024 18:20:01 for QGIS API Documentation by
1.9.8