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¶
Subclasses¶
Renders tiled scene layers using textures. |
|
Renders tiled scene layers using the raw primitive wireframes. |
Abstract Methods
Create a deep copy of this renderer. |
|
Renders a line. |
|
Renders a triangle. |
|
Saves the renderer configuration to an XML element. |
|
Returns the identifier of the renderer type. |
Methods
Copies common tiled scene renderer properties (such as screen error) to the destination renderer. |
|
Returns whether to render also borders of tiles. |
|
Returns the maximum screen error allowed when rendering the tiled scene. |
|
Returns the unit for the maximum screen error allowed when rendering the tiled scene. |
|
Restores common renderer properties (such as screen error) from the specified DOM element. |
|
Saves common renderer properties (such as point size and screen error) to the specified DOM element. |
|
Sets the maximum screen error allowed when rendering the tiled scene. |
|
Sets the unit for the maximum screen error allowed when rendering the tiled scene. |
|
Sets whether to render the borders of tiles. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsTiledSceneRenderer. See the FAQ for more details.
Creates a set of legend nodes representing the renderer. |
|
Returns flags which control how the renderer behaves. |
|
Returns a list of all rule keys for legend nodes created by the renderer. |
|
Must be called when a new render cycle is started. |
|
Must be called when a render cycle has finished, to allow the renderer to clean up. |
Static Methods
Creates a renderer from an XML element. |
- 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:
- virtual flags(self) Qgis.TiledSceneRendererFlags [source]¶
Returns flags which control how the renderer behaves.
- Return type:
- 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
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- 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()
.See also
See also
- Return type:
float
- maximumScreenErrorUnit(self) Qgis.RenderUnit [source]¶
Returns the unit for the maximum screen error allowed when rendering the tiled scene.
See also
See also
- Return type:
- abstract renderLine(self, context: QgsTiledSceneRenderContext, line: QPolygonF)[source]¶
Renders a
line
.- Parameters:
context (QgsTiledSceneRenderContext)
line (QPolygonF)
- abstract renderTriangle(self, context: QgsTiledSceneRenderContext, triangle: QPolygonF)[source]¶
Renders a
triangle
.- Parameters:
context (QgsTiledSceneRenderContext)
triangle (QPolygonF)
- restoreCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Restores common renderer properties (such as screen error) from the specified DOM
element
.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- abstract save(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement [source]¶
Saves the renderer configuration to an XML element.
See also
- Parameters:
doc (QDomDocument)
context (QgsReadWriteContext)
- 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
.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- 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()
.See also
See also
- Parameters:
error (float)
- setMaximumScreenErrorUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the maximum screen error allowed when rendering the tiled scene.See also
See also
- Parameters:
unit (Qgis.RenderUnit)
- setTileBorderRenderingEnabled(self, enabled: bool)[source]¶
Sets whether to render the borders of tiles.
See also
- 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 tostopRender()
after all features have been rendered.See also
Warning
This method is not thread safe. Before calling
startRender()
in a non-main thread, the renderer should instead be cloned andstartRender()
/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 tostartRender()
.Warning
This method is not thread safe. Before calling
startRender()
in a non-main thread, the renderer should instead be cloned andstartRender()
/stopRender()
called on the clone.See also
- Parameters:
context (QgsTiledSceneRenderContext)