QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
qgsshadowsettings.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsshadowsettings.h
3
--------------------------------------
4
Date : September 2020
5
Copyright : (C) 2020 by Belgacem Nedjima
6
Email : gb uderscore nedjima at esi dot dz
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 QGSSHADOWSETTINGS_H
17
#define QGSSHADOWSETTINGS_H
18
19
#include "
qgis.h
"
20
#include "qgis_3d.h"
21
22
#include <QMap>
23
#include <QString>
24
25
#define SIP_NO_FILE
26
27
class
QgsReadWriteContext
;
28
class
QDomElement;
29
30
36
class
_3D_EXPORT
QgsShadowSettings
37
{
38
public
:
39
QgsShadowSettings
() =
default
;
40
QgsShadowSettings
(
const
QgsShadowSettings
&other );
41
QgsShadowSettings
&
operator=
(
QgsShadowSettings
const
&rhs );
42
44
void
readXml
(
const
QDomElement &element,
const
QgsReadWriteContext
&context );
46
void
writeXml
( QDomElement &element,
const
QgsReadWriteContext
&context )
const
;
47
49
bool
renderShadows
()
const
{
return
mRenderShadows; }
50
57
QString
lightSource
()
const
{
return
mLightSourceId; }
58
65
double
maximumShadowRenderingDistance
()
const
{
return
mMaximumShadowRenderingDistance; }
66
72
double
shadowBias
()
const
{
return
mShadowBias; }
73
80
Qgis::ShadowQuality
shadowQuality
()
const
{
return
mShadowQuality; }
81
83
void
setRenderShadows
(
bool
enabled ) { mRenderShadows = enabled; }
84
91
void
setLightSource
(
const
QString &
id
) { mLightSourceId = id; }
92
99
void
setMaximumShadowRenderingDistance
(
double
distance ) { mMaximumShadowRenderingDistance = distance; }
100
107
void
setShadowBias
(
double
shadowBias
) { mShadowBias =
shadowBias
; }
108
115
void
setShadowQuality
(
Qgis::ShadowQuality
quality ) { mShadowQuality = quality; }
116
122
static
int
qualityToMapResolution(
Qgis::ShadowQuality
quality );
123
131
bool
showCascadeSplits()
const
;
132
140
void
setShowCascadeSplits(
bool
show );
141
142
private
:
143
bool
mRenderShadows =
false
;
144
QString mLightSourceId;
145
double
mMaximumShadowRenderingDistance = 1500.0;
146
double
mShadowBias = 0.00001;
147
Qgis::ShadowQuality
mShadowQuality =
Qgis::ShadowQuality::High
;
148
bool
mShowCascadeSplits =
false
;
149
};
150
151
#endif
// QGSSKYBOXSETTINGS_H
Qgis::ShadowQuality
ShadowQuality
Shadow texture quality.
Definition
qgis.h:4524
Qgis::ShadowQuality::High
@ High
High quality.
Definition
qgis.h:4527
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsShadowSettings::setMaximumShadowRenderingDistance
void setMaximumShadowRenderingDistance(double distance)
Sets the maximum shadow rendering distance accounted for when rendering shadows Objects further away ...
Definition
qgsshadowsettings.h:99
QgsShadowSettings::renderShadows
bool renderShadows() const
Returns whether shadow rendering is enabled.
Definition
qgsshadowsettings.h:49
QgsShadowSettings::setLightSource
void setLightSource(const QString &id)
Sets the id of the light source casting shadows.
Definition
qgsshadowsettings.h:91
QgsShadowSettings::operator=
QgsShadowSettings & operator=(QgsShadowSettings const &rhs)
Definition
qgsshadowsettings.cpp:35
QgsShadowSettings::QgsShadowSettings
QgsShadowSettings()=default
QgsShadowSettings::maximumShadowRenderingDistance
double maximumShadowRenderingDistance() const
Returns the maximum shadow rendering distance accounted for when rendering shadows Objects further aw...
Definition
qgsshadowsettings.h:65
QgsShadowSettings::lightSource
QString lightSource() const
Returns the ID of the light source casting shadows.
Definition
qgsshadowsettings.h:57
QgsShadowSettings::setShadowQuality
void setShadowQuality(Qgis::ShadowQuality quality)
Sets the quality of the shadow map texture.
Definition
qgsshadowsettings.h:115
QgsShadowSettings::setRenderShadows
void setRenderShadows(bool enabled)
Sets whether shadow rendering is enabled.
Definition
qgsshadowsettings.h:83
QgsShadowSettings::writeXml
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
Definition
qgsshadowsettings.cpp:58
QgsShadowSettings::shadowBias
double shadowBias() const
Returns the shadow bias used to correct the numerical imprecision of shadows (for the depth test) Thi...
Definition
qgsshadowsettings.h:72
QgsShadowSettings::shadowQuality
Qgis::ShadowQuality shadowQuality() const
Returns the quality of the shadow map texture used to generate the shadows.
Definition
qgsshadowsettings.h:80
QgsShadowSettings::readXml
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
Definition
qgsshadowsettings.cpp:49
QgsShadowSettings::setShadowBias
void setShadowBias(double shadowBias)
Sets the shadow bias value Tweak this to reduce artifacts like self shadowing A reasonable range of v...
Definition
qgsshadowsettings.h:107
qgis.h
Generated on
for QGIS API Documentation by
1.17.0