Class: QgsTiledSceneRenderer

Abstract base class for 2d tiled scene renderers.

Added in version 3.34.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: clone(), renderLine(), renderTriangle(), save(), type()

Class Hierarchy

Inheritance diagram of qgis.core.QgsTiledSceneRenderer

Subclasses

QgsTiledSceneTextureRenderer

Renders tiled scene layers using textures.

QgsTiledSceneWireframeRenderer

Renders tiled scene layers using the raw primitive wireframes.

class qgis.core.QgsTiledSceneRenderer[source]

Bases: object

abstract clone(self) QgsTiledSceneRenderer | None[source]

Create a deep copy of this renderer. Should be implemented by all subclasses and generate a proper subclass.

Return type:

Optional[QgsTiledSceneRenderer]

copyCommonProperties(self, destination: QgsTiledSceneRenderer | None)[source]

Copies common tiled scene renderer properties (such as screen error) to the destination renderer.

Parameters:

destination (Optional[QgsTiledSceneRenderer])

virtual createLegendNodes(self, nodeLayer: QgsLayerTreeLayer | None) List[QgsLayerTreeModelLegendNode]

Creates a set of legend nodes representing the renderer.

Parameters:

nodeLayer (Optional[QgsLayerTreeLayer])

Return type:

List[QgsLayerTreeModelLegendNode]

virtual flags(self) Qgis.TiledSceneRendererFlags[source]

Returns flags which control how the renderer behaves.

Return type:

Qgis.TiledSceneRendererFlags

isTileBorderRenderingEnabled(self) bool[source]

Returns whether to render also borders of tiles.

see setTileBorderRenderingEnabled()

Return type:

bool

virtual legendRuleKeys(self) List[str][source]

Returns a list of all rule keys for legend nodes created by the renderer.

Return type:

List[str]

static load(element: QDomElement, context: QgsReadWriteContext) QgsTiledSceneRenderer | None[source]

Creates a renderer from an XML element.

Caller takes ownership of the returned renderer.

See also

save()

Parameters:
Return type:

Optional[QgsTiledSceneRenderer]

maximumScreenError(self) float[source]

Returns the maximum screen error allowed when rendering the tiled scene.

Larger values result in a faster render with less detailed features rendered.

Units are retrieved via maximumScreenErrorUnit().

Return type:

float

maximumScreenErrorUnit(self) Qgis.RenderUnit[source]

Returns the unit for the maximum screen error allowed when rendering the tiled scene.

Return type:

Qgis.RenderUnit

abstract renderLine(self, context: QgsTiledSceneRenderContext, line: QPolygonF)[source]

Renders a line.

Parameters:
abstract renderTriangle(self, context: QgsTiledSceneRenderContext, triangle: QPolygonF)[source]

Renders a triangle.

Parameters:
restoreCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]

Restores common renderer properties (such as screen error) from the specified DOM element.

Parameters:
abstract save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Saves the renderer configuration to an XML element.

See also

load()

Parameters:
Return type:

QDomElement

saveCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]

Saves common renderer properties (such as point size and screen error) to the specified DOM element.

Parameters:
setMaximumScreenError(self, error: float)[source]

Sets the maximum screen error allowed when rendering the tiled scene.

Larger values result in a faster render with less detailed features rendered.

Units are set via setMaximumScreenErrorUnit().

Parameters:

error (float)

setMaximumScreenErrorUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the maximum screen error allowed when rendering the tiled scene.

Parameters:

unit (Qgis.RenderUnit)

setTileBorderRenderingEnabled(self, enabled: bool)[source]

Sets whether to render the borders of tiles.

Parameters:

enabled (bool)

virtual startRender(self, context: QgsTiledSceneRenderContext)[source]

Must be called when a new render cycle is started. A call to startRender() must always be followed by a corresponding call to stopRender() after all features have been rendered.

See also

stopRender()

Warning

This method is not thread safe. Before calling startRender() in a non-main thread, the renderer should instead be cloned and startRender()/stopRender() called on the clone.

Parameters:

context (QgsTiledSceneRenderContext)

virtual stopRender(self, context: QgsTiledSceneRenderContext)[source]

Must be called when a render cycle has finished, to allow the renderer to clean up.

Calls to stopRender() must always be preceded by a call to startRender().

Warning

This method is not thread safe. Before calling startRender() in a non-main thread, the renderer should instead be cloned and startRender()/stopRender() called on the clone.

See also

startRender()

Parameters:

context (QgsTiledSceneRenderContext)

abstract type(self) str[source]

Returns the identifier of the renderer type.

Return type:

str