Class: QgsAbstract3DSymbol

Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.

3D symbol objects define appearance of GIS data.

Warning

This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.

Note

Prior to QGIS 3.16 this was available through the QGIS 3D library.

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

Inheritance diagram of qgis.core.QgsAbstract3DSymbol

Subclasses

QgsPointCloud3DSymbol

3D symbol that draws point cloud geometries as 3D objects.

QgsLine3DSymbol

3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer with given thickness).

QgsMesh3DSymbol

3D symbol that draws mesh geometry as planar triangles.

QgsPoint3DSymbol

3D symbol that draws point geometries as 3D objects using one of the predefined shapes.

QgsPolygon3DSymbol

3D symbol that draws polygon geometries as planar polygons, optionally extruded (with added walls).

Enums

Property

Data definable properties.

Abstract Methods

clone

Returns a new instance of the symbol with the same settings

readXml

Reads symbol configuration from the given DOM element

type

Returns identifier of symbol type.

writeXml

Writes symbol configuration to the given DOM element

Methods

dataDefinedProperties

Returns a reference to the symbol layer's property collection, used for data defined overrides.

propertyDefinitions

Returns the symbol layer property definitions.

setDataDefinedProperties

Sets the symbol layer's property collection, used for data defined overrides.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsAbstract3DSymbol. See the FAQ for more details.

compatibleGeometryTypes

Returns the list of the vector layer geometry types which are compatible with this symbol.

copyBaseSettings

Copies base class settings from this object to a destination object.

setDefaultPropertiesFromLayer

Sets default properties for the symbol based on a layer's configuration.

class qgis.core.QgsAbstract3DSymbol[source]

Bases: object

class Property(*values)

Bases: IntEnum

Data definable properties.

  • Height: Height (altitude)

    Available as QgsAbstract3DSymbol.PropertyHeight in older QGIS releases.

  • ExtrusionHeight: Extrusion height (zero means no extrusion)

    Available as QgsAbstract3DSymbol.PropertyExtrusionHeight in older QGIS releases.

abstract clone(self) QgsAbstract3DSymbol | None[source]

Returns a new instance of the symbol with the same settings

Return type:

Optional[QgsAbstract3DSymbol]

virtual compatibleGeometryTypes(self) List[Qgis.GeometryType]

Returns the list of the vector layer geometry types which are compatible with this symbol.

Added in version 3.16.

Return type:

List[Qgis.GeometryType]

virtual copyBaseSettings(self, destination: QgsAbstract3DSymbol | None)[source]

Copies base class settings from this object to a destination object.

Parameters:

destination (Optional[QgsAbstract3DSymbol])

dataDefinedProperties(self) QgsPropertyCollection

Returns a reference to the symbol layer’s property collection, used for data defined overrides.

Return type:

QgsPropertyCollection

propertyDefinitions() Dict[int, QgsPropertyDefinition]

Returns the symbol layer property definitions.

Return type:

Dict[int, QgsPropertyDefinition]

abstract readXml(self, elem: QDomElement, context: QgsReadWriteContext)[source]

Reads symbol configuration from the given DOM element

Parameters:
setDataDefinedProperties(self, collection: QgsPropertyCollection)[source]

Sets the symbol layer’s property collection, used for data defined overrides.

Parameters:

collection (QgsPropertyCollection)

virtual setDefaultPropertiesFromLayer(self, layer: QgsVectorLayer | None)[source]

Sets default properties for the symbol based on a layer’s configuration.

Added in version 3.26.

Parameters:

layer (Optional[QgsVectorLayer])

abstract type(self) str[source]

Returns identifier of symbol type. Each 3D symbol implementation should return a different type.

Return type:

str

abstract writeXml(self, elem: QDomElement, context: QgsReadWriteContext)[source]

Writes symbol configuration to the given DOM element

Parameters: