Class: QgsLightSource¶
Base class for light sources in 3d scenes.
Added in version 3.26.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: clone()
, readXml()
, type()
, writeXml()
Class Hierarchy¶
Subclasses¶
Definition of a directional light in a 3D map scene. |
|
Definition of a point light in a 3D map scene. |
Abstract Methods
Returns a copy of the light source. |
|
Reads configuration from a DOM element previously written using |
|
Returns the light source type. |
|
Writes the light source's configuration to a new DOM element and returns it. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsLightSource. See the FAQ for more details.
After reading from XML, resolve references to any layers that have been read as layer IDs. |
Static Methods
Creates a new light source from an XML element. |
- class qgis._3d.QgsLightSource[source]¶
Bases:
object
- abstract clone(self) QgsLightSource | None [source]¶
Returns a copy of the light source.
- Return type:
Optional[QgsLightSource]
- static createFromXml(element: QDomElement, context: QgsReadWriteContext) QgsLightSource | None [source]¶
Creates a new light source from an XML element.
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
Optional[QgsLightSource]
- abstract readXml(self, elem: QDomElement, context: QgsReadWriteContext = QgsReadWriteContext())[source]¶
Reads configuration from a DOM element previously written using
writeXml()
.See also
- Parameters:
elem (QDomElement)
context (
QgsReadWriteContext
= QgsReadWriteContext())
- virtual resolveReferences(self, project: QgsProject)[source]¶
After reading from XML, resolve references to any layers that have been read as layer IDs.
- Parameters:
project (QgsProject)
- abstract type(self) Qgis.LightSourceType [source]¶
Returns the light source type.
- Return type:
- abstract writeXml(self, doc: QDomDocument, context: QgsReadWriteContext = QgsReadWriteContext()) QDomElement [source]¶
Writes the light source’s configuration to a new DOM element and returns it.
See also
- Parameters:
doc (QDomDocument)
context (
QgsReadWriteContext
= QgsReadWriteContext())
- Return type:
QDomElement