QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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
23 : mEnabled( other.mEnabled )
24 , mIntensity( other.mIntensity )
25 , mRadius( other.mRadius )
26 , mThreshold( other.mThreshold )
27{
28}
29
31{
32 if ( &rhs == this )
33 return *this;
34
35 mEnabled = rhs.mEnabled;
36 mIntensity = rhs.mIntensity;
37 mRadius = rhs.mRadius;
38 mThreshold = rhs.mThreshold;
39 return *this;
40}
41
42void QgsAmbientOcclusionSettings::readXml( const QDomElement &element, const QgsReadWriteContext &context )
43{
44 mEnabled = element.attribute( QStringLiteral( "enabled" ), QStringLiteral( "0" ) ).toInt();
45 mIntensity = element.attribute( QStringLiteral( "intensity" ), QStringLiteral( "0.5" ) ).toFloat();
46 mRadius = element.attribute( QStringLiteral( "radius" ), QStringLiteral( "25" ) ).toFloat();
47 mThreshold = element.attribute( QStringLiteral( "threshold" ), QStringLiteral( "0.5" ) ).toFloat();
48
49 Q_UNUSED( context );
50}
51
52void QgsAmbientOcclusionSettings::writeXml( QDomElement &element, const QgsReadWriteContext &context ) const
53{
54 element.setAttribute( QStringLiteral( "enabled" ), mEnabled );
55 element.setAttribute( QStringLiteral( "intensity" ), mIntensity );
56 element.setAttribute( QStringLiteral( "radius" ), mRadius );
57 element.setAttribute( QStringLiteral( "threshold" ), mThreshold );
58
59 Q_UNUSED( context );
60}
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.