QGIS API Documentation
3.28.0-Firenze (ed3ad0430f)
src
3d
lights
qgslightsource.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgslightsource.cpp
3
-----------------
4
begin : April 2022
5
copyright : (C) 2022 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#include "
qgslightsource.h
"
20
#include "
qgspointlightsettings.h
"
21
#include "
qgsdirectionallightsettings.h
"
22
23
QgsLightSource::~QgsLightSource
() =
default
;
24
25
void
QgsLightSource::resolveReferences
(
const
QgsProject
& )
26
{
27
28
}
29
30
QgsLightSource
*
QgsLightSource::createFromXml
(
const
QDomElement &element,
const
QgsReadWriteContext
&context )
31
{
32
std::unique_ptr< QgsLightSource > res;
33
if
( element.nodeName() == QLatin1String(
"point-light"
) )
34
{
35
res = std::make_unique< QgsPointLightSettings >();
36
}
37
else
if
( element.nodeName() == QLatin1String(
"directional-light"
) )
38
{
39
res = std::make_unique< QgsDirectionalLightSettings >();
40
}
41
42
if
( res )
43
res->readXml( element, context );
44
45
return
res.release();
46
}
QgsLightSource
3
Definition:
qgslightsource.h:47
QgsLightSource::resolveReferences
virtual void resolveReferences(const QgsProject &project)
After reading from XML, resolve references to any layers that have been read as layer IDs.
Definition:
qgslightsource.cpp:25
QgsLightSource::~QgsLightSource
virtual ~QgsLightSource()
QgsLightSource::createFromXml
static QgsLightSource * createFromXml(const QDomElement &element, const QgsReadWriteContext &context)
Creates a new light source from an XML element.
Definition:
qgslightsource.cpp:30
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition:
qgsproject.h:104
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition:
qgsreadwritecontext.h:35
qgsdirectionallightsettings.h
qgslightsource.h
qgspointlightsettings.h
Generated on Sat Oct 22 2022 16:10:47 for QGIS API Documentation by
1.9.4