QGIS API Documentation 3.27.0-Master (f261cc1f8b)
qgslightsource.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslightsource.h
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 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSLIGHTSOURCE_H
19#define QGSLIGHTSOURCE_H
20
21#include "qgis_3d.h"
22#include "qgis.h"
23#include "qgis_sip.h"
24#include "qgsreadwritecontext.h"
25
26#include <QList>
27
29class QgsProject;
30class QDomElement;
31class QDomDocument;
32
33#ifndef SIP_RUN
34namespace Qt3DCore
35{
36 class QEntity;
37}
38#endif
39
47{
48
49 public:
50
51 virtual ~QgsLightSource();
52
56 virtual Qgis::LightSourceType type() const = 0;
57
61 virtual QgsLightSource *clone() const = 0 SIP_FACTORY;
62
66 virtual Qt3DCore::QEntity *createEntity( const Qgs3DMapSettings &map, Qt3DCore::QEntity *parent ) const = 0 SIP_SKIP;
67
73 virtual QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context = QgsReadWriteContext() ) const = 0;
74
80 virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context = QgsReadWriteContext() ) = 0;
81
85 virtual void resolveReferences( const QgsProject &project );
86
90 static QgsLightSource *createFromXml( const QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
91};
92
93
94#endif // QGSLIGHTSOURCE_H
LightSourceType
Light source types for 3D scenes.
Definition: qgis.h:1890
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())=0
Reads configuration from a DOM element previously written using writeXml().
virtual Qgis::LightSourceType type() const =0
Returns the light source type.
virtual Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map, Qt3DCore::QEntity *parent) const =0
Creates an entity representing the light source.
virtual QgsLightSource * clone() const =0
Returns a copy of the light source.
virtual QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const =0
Writes the light source's configuration to a new DOM element and returns it.
virtual ~QgsLightSource()
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:104
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_ABSTRACT
Definition: qgis_sip.h:208
#define SIP_FACTORY
Definition: qgis_sip.h:76