QGIS API Documentation 3.41.0-Master (af5edcb665c)
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
32{
33 mEnabled = rhs.mEnabled;
34 mIntensity = rhs.mIntensity;
35 mRadius = rhs.mRadius;
36 mThreshold = rhs.mThreshold;
37 return *this;
38}
39
40void 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
50void 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}
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.