QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
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
17
18#include "qgsreadwritecontext.h"
19
20#include <QDomDocument>
21#include <QString>
22
23using namespace Qt::StringLiterals;
24
26 : mEnabled( other.mEnabled )
27 , mIntensity( other.mIntensity )
28 , mRadius( other.mRadius )
29 , mThreshold( other.mThreshold )
30{}
31
33{
34 if ( &rhs == this )
35 return *this;
36
37 mEnabled = rhs.mEnabled;
38 mIntensity = rhs.mIntensity;
39 mRadius = rhs.mRadius;
40 mThreshold = rhs.mThreshold;
41 return *this;
42}
43
44void QgsAmbientOcclusionSettings::readXml( const QDomElement &element, const QgsReadWriteContext &context )
45{
46 mEnabled = element.attribute( u"enabled"_s, u"0"_s ).toInt();
47 mIntensity = element.attribute( u"intensity"_s, u"0.5"_s ).toFloat();
48 mRadius = element.attribute( u"radius"_s, u"25"_s ).toFloat();
49 mThreshold = element.attribute( u"threshold"_s, u"0.5"_s ).toFloat();
50
51 Q_UNUSED( context );
52}
53
54void QgsAmbientOcclusionSettings::writeXml( QDomElement &element, const QgsReadWriteContext &context ) const
55{
56 element.setAttribute( u"enabled"_s, mEnabled );
57 element.setAttribute( u"intensity"_s, mIntensity );
58 element.setAttribute( u"radius"_s, mRadius );
59 element.setAttribute( u"threshold"_s, mThreshold );
60
61 Q_UNUSED( context );
62}
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
QgsAmbientOcclusionSettings & operator=(QgsAmbientOcclusionSettings const &rhs)
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
A container for the context for various read/write operations on objects.