QGIS API Documentation 3.41.0-Master (25ec5511245)
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 <QDomDocument>
19
20#include "qgsreadwritecontext.h"
21
22
24 : mEnabled( other.mEnabled )
25 , mIntensity( other.mIntensity )
26 , mRadius( other.mRadius )
27 , mThreshold( other.mThreshold )
28{
29
30}
31
33{
34 mEnabled = rhs.mEnabled;
35 mIntensity = rhs.mIntensity;
36 mRadius = rhs.mRadius;
37 mThreshold = rhs.mThreshold;
38 return *this;
39}
40
41void 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
51void 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}
class containing the configuration of ambient occlusion rendering 3
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.
The class is used as a container of context for various read/write operations on other objects.