QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsambientocclusionsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsambientocclusionsettings.h
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#ifndef QGSAMBIENTOCCLUSIONSETTINGS_H
17#define QGSAMBIENTOCCLUSIONSETTINGS_H
18
19#include <QString>
20#include <QMap>
21
22#include "qgis_3d.h"
23
25class QDomElement;
26
27#define SIP_NO_FILE
28
36{
37 public:
38
42
44 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
46 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
47
49 void setEnabled( bool enabled ) { mEnabled = enabled; }
50
52 bool isEnabled() const { return mEnabled; }
53
55 void setIntensity( float factor ) { mIntensity = factor; }
56
58 float intensity() const { return mIntensity; }
59
61 void setRadius( float radius ) { mRadius = radius; }
62
64 float radius() const { return mRadius; }
65
67 void setThreshold( float threshold ) { mThreshold = threshold; }
68
70 float threshold() const { return mThreshold; }
71
72 private:
73 bool mEnabled = false;
74 float mIntensity = 0.5f;
75 float mRadius = 25.0f;
76 float mThreshold = 0.5f;
77};
78
79#endif // QGSAMBIENTOCCLUSIONSETTINGS_H
class containing the configuration of ambient occlusion rendering 3
float radius() const
Returns the radius parameter of the ambient occlusion effect.
void setRadius(float radius)
Sets the radius parameter of the ambient occlusion effect.
bool isEnabled() const
Returns whether ambient occlusion effect is enabled.
float intensity() const
Returns the shading factor of the ambient occlusion effect.
void setEnabled(bool enabled)
Sets whether ambient occlusion effect is enabled.
void setIntensity(float factor)
Sets the shading factor of the ambient occlusion effect.
void setThreshold(float threshold)
Sets at what amount of occlusion the effect will kick in.
float threshold() const
Returns at what amount of occlusion the effect will kick in.
The class is used as a container of context for various read/write operations on other objects.