QGIS API Documentation 3.39.0-Master (93ce9bf5c90)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsTiledSceneRenderer Class Referenceabstract

Abstract base class for 2d tiled scene renderers. More...

#include <qgstiledscenerenderer.h>

Inheritance diagram for QgsTiledSceneRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsTiledSceneRenderer ()=default
 
 QgsTiledSceneRenderer (const QgsTiledSceneRenderer &other)=delete
 QgsTiledSceneRenderer cannot be copied – use clone() instead.
 
virtual ~QgsTiledSceneRenderer ()=default
 
virtual QgsTiledSceneRendererclone () const =0
 Create a deep copy of this renderer.
 
virtual QList< QgsLayerTreeModelLegendNode * > createLegendNodes (QgsLayerTreeLayer *nodeLayer)
 Creates a set of legend nodes representing the renderer.
 
virtual Qgis::TiledSceneRendererFlags flags () const
 Returns flags which control how the renderer behaves.
 
bool isTileBorderRenderingEnabled () const
 Returns whether to render also borders of tiles.
 
virtual QStringList legendRuleKeys () const
 Returns a list of all rule keys for legend nodes created by the renderer.
 
double maximumScreenError () const
 Returns the maximum screen error allowed when rendering the tiled scene.
 
Qgis::RenderUnit maximumScreenErrorUnit () const
 Returns the unit for the maximum screen error allowed when rendering the tiled scene.
 
QgsTiledSceneRendereroperator= (const QgsTiledSceneRenderer &other)=delete
 QgsTiledSceneRenderer cannot be copied – use clone() instead.
 
virtual void renderLine (QgsTiledSceneRenderContext &context, const QPolygonF &line)=0
 Renders a line.
 
virtual void renderTriangle (QgsTiledSceneRenderContext &context, const QPolygonF &triangle)=0
 Renders a triangle.
 
virtual QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const =0
 Saves the renderer configuration to an XML element.
 
void setMaximumScreenError (double error)
 Sets the maximum screen error allowed when rendering the tiled scene.
 
void setMaximumScreenErrorUnit (Qgis::RenderUnit unit)
 Sets the unit for the maximum screen error allowed when rendering the tiled scene.
 
void setTileBorderRenderingEnabled (bool enabled)
 Sets whether to render the borders of tiles.
 
virtual void startRender (QgsTiledSceneRenderContext &context)
 Must be called when a new render cycle is started.
 
virtual void stopRender (QgsTiledSceneRenderContext &context)
 Must be called when a render cycle has finished, to allow the renderer to clean up.
 
virtual QString type () const =0
 Returns the identifier of the renderer type.
 

Static Public Member Functions

static QgsTiledSceneRendererload (QDomElement &element, const QgsReadWriteContext &context)
 Creates a renderer from an XML element.
 

Protected Member Functions

void copyCommonProperties (QgsTiledSceneRenderer *destination) const
 Copies common tiled scene renderer properties (such as screen error) to the destination renderer.
 
void restoreCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Restores common renderer properties (such as screen error) from the specified DOM element.
 
void saveCommonProperties (QDomElement &element, const QgsReadWriteContext &context) const
 Saves common renderer properties (such as point size and screen error) to the specified DOM element.
 

Detailed Description

Abstract base class for 2d tiled scene renderers.

Since
QGIS 3.34

Definition at line 119 of file qgstiledscenerenderer.h.

Constructor & Destructor Documentation

◆ QgsTiledSceneRenderer() [1/2]

QgsTiledSceneRenderer::QgsTiledSceneRenderer ( )
default

◆ ~QgsTiledSceneRenderer()

virtual QgsTiledSceneRenderer::~QgsTiledSceneRenderer ( )
virtualdefault

◆ QgsTiledSceneRenderer() [2/2]

QgsTiledSceneRenderer::QgsTiledSceneRenderer ( const QgsTiledSceneRenderer other)
delete

QgsTiledSceneRenderer cannot be copied – use clone() instead.

Member Function Documentation

◆ clone()

virtual QgsTiledSceneRenderer * QgsTiledSceneRenderer::clone ( ) const
pure virtual

Create a deep copy of this renderer.

Should be implemented by all subclasses and generate a proper subclass.

Implemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

◆ copyCommonProperties()

void QgsTiledSceneRenderer::copyCommonProperties ( QgsTiledSceneRenderer destination) const
protected

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

Definition at line 142 of file qgstiledscenerenderer.cpp.

◆ createLegendNodes()

QList< QgsLayerTreeModelLegendNode * > QgsTiledSceneRenderer::createLegendNodes ( QgsLayerTreeLayer nodeLayer)
virtual

Creates a set of legend nodes representing the renderer.

Definition at line 132 of file qgstiledscenerenderer.cpp.

◆ flags()

Qgis::TiledSceneRendererFlags QgsTiledSceneRenderer::flags ( ) const
virtual

Returns flags which control how the renderer behaves.

Reimplemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

Definition at line 70 of file qgstiledscenerenderer.cpp.

◆ isTileBorderRenderingEnabled()

bool QgsTiledSceneRenderer::isTileBorderRenderingEnabled ( ) const
inline

Returns whether to render also borders of tiles.

see setTileBorderRenderingEnabled()

Definition at line 231 of file qgstiledscenerenderer.h.

◆ legendRuleKeys()

QStringList QgsTiledSceneRenderer::legendRuleKeys ( ) const
virtual

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

Definition at line 137 of file qgstiledscenerenderer.cpp.

◆ load()

QgsTiledSceneRenderer * QgsTiledSceneRenderer::load ( QDomElement &  element,
const QgsReadWriteContext context 
)
static

Creates a renderer from an XML element.

Caller takes ownership of the returned renderer.

See also
save()

Definition at line 75 of file qgstiledscenerenderer.cpp.

◆ maximumScreenError()

double QgsTiledSceneRenderer::maximumScreenError ( ) const

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
setMaximumScreenError()
maximumScreenErrorUnit()

Definition at line 112 of file qgstiledscenerenderer.cpp.

◆ maximumScreenErrorUnit()

Qgis::RenderUnit QgsTiledSceneRenderer::maximumScreenErrorUnit ( ) const

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

See also
maximumScreenError()
setMaximumScreenErrorUnit()

Definition at line 122 of file qgstiledscenerenderer.cpp.

◆ operator=()

QgsTiledSceneRenderer & QgsTiledSceneRenderer::operator= ( const QgsTiledSceneRenderer other)
delete

QgsTiledSceneRenderer cannot be copied – use clone() instead.

◆ renderLine()

virtual void QgsTiledSceneRenderer::renderLine ( QgsTiledSceneRenderContext context,
const QPolygonF &  line 
)
pure virtual

Renders a line.

Implemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

◆ renderTriangle()

virtual void QgsTiledSceneRenderer::renderTriangle ( QgsTiledSceneRenderContext context,
const QPolygonF &  triangle 
)
pure virtual

Renders a triangle.

Implemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

◆ restoreCommonProperties()

void QgsTiledSceneRenderer::restoreCommonProperties ( const QDomElement &  element,
const QgsReadWriteContext context 
)
protected

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

See also
saveCommonProperties()

Definition at line 149 of file qgstiledscenerenderer.cpp.

◆ save()

virtual QDomElement QgsTiledSceneRenderer::save ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const
pure virtual

Saves the renderer configuration to an XML element.

See also
load()

Implemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

◆ saveCommonProperties()

void QgsTiledSceneRenderer::saveCommonProperties ( QDomElement &  element,
const QgsReadWriteContext context 
) const
protected

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

See also
restoreCommonProperties()

Definition at line 156 of file qgstiledscenerenderer.cpp.

◆ setMaximumScreenError()

void QgsTiledSceneRenderer::setMaximumScreenError ( double  error)

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
maximumScreenError()
setMaximumScreenErrorUnit()

Definition at line 117 of file qgstiledscenerenderer.cpp.

◆ setMaximumScreenErrorUnit()

void QgsTiledSceneRenderer::setMaximumScreenErrorUnit ( Qgis::RenderUnit  unit)

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

See also
setMaximumScreenError()
maximumScreenErrorUnit()

Definition at line 127 of file qgstiledscenerenderer.cpp.

◆ setTileBorderRenderingEnabled()

void QgsTiledSceneRenderer::setTileBorderRenderingEnabled ( bool  enabled)
inline

Sets whether to render the borders of tiles.

See also
isTileBorderRenderingEnabled()

Definition at line 224 of file qgstiledscenerenderer.h.

◆ startRender()

void QgsTiledSceneRenderer::startRender ( QgsTiledSceneRenderContext context)
virtual

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.

Reimplemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

Definition at line 91 of file qgstiledscenerenderer.cpp.

◆ stopRender()

void QgsTiledSceneRenderer::stopRender ( QgsTiledSceneRenderContext context)
virtual

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()

Reimplemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.

Definition at line 105 of file qgstiledscenerenderer.cpp.

◆ type()

virtual QString QgsTiledSceneRenderer::type ( ) const
pure virtual

Returns the identifier of the renderer type.

Implemented in QgsTiledSceneTextureRenderer, and QgsTiledSceneWireframeRenderer.


The documentation for this class was generated from the following files: