QGIS API Documentation
3.41.0-Master (af5edcb665c)
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
QgsAmbientOcclusionSettings
&
QgsAmbientOcclusionSettings::operator=
(
QgsAmbientOcclusionSettings
const
&rhs )
32
{
33
mEnabled = rhs.mEnabled;
34
mIntensity = rhs.mIntensity;
35
mRadius = rhs.mRadius;
36
mThreshold = rhs.mThreshold;
37
return
*
this
;
38
}
39
40
void
QgsAmbientOcclusionSettings::readXml
(
const
QDomElement &element,
const
QgsReadWriteContext
&context )
41
{
42
mEnabled = element.attribute( QStringLiteral(
"enabled"
), QStringLiteral(
"0"
) ).toInt();
43
mIntensity = element.attribute( QStringLiteral(
"intensity"
), QStringLiteral(
"0.5"
) ).toFloat();
44
mRadius = element.attribute( QStringLiteral(
"radius"
), QStringLiteral(
"25"
) ).toFloat();
45
mThreshold = element.attribute( QStringLiteral(
"threshold"
), QStringLiteral(
"0.5"
) ).toFloat();
46
47
Q_UNUSED( context );
48
}
49
50
void
QgsAmbientOcclusionSettings::writeXml
( QDomElement &element,
const
QgsReadWriteContext
&context )
const
51
{
52
element.setAttribute( QStringLiteral(
"enabled"
), mEnabled );
53
element.setAttribute( QStringLiteral(
"intensity"
), mIntensity );
54
element.setAttribute( QStringLiteral(
"radius"
), mRadius );
55
element.setAttribute( QStringLiteral(
"threshold"
), mThreshold );
56
57
Q_UNUSED( context );
58
}
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:50
QgsAmbientOcclusionSettings::operator=
QgsAmbientOcclusionSettings & operator=(QgsAmbientOcclusionSettings const &rhs)
Definition
qgsambientocclusionsettings.cpp:31
QgsAmbientOcclusionSettings::QgsAmbientOcclusionSettings
QgsAmbientOcclusionSettings()=default
QgsAmbientOcclusionSettings::readXml
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
Definition
qgsambientocclusionsettings.cpp:40
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 Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8