QGIS API Documentation 3.39.0-Master (9ea1ddbe645)
|
This class provides map rendering functionality for vector tile layers. More...
#include <qgsvectortilelayerrenderer.h>
Public Member Functions | |
QgsVectorTileLayerRenderer (QgsVectorTileLayer *layer, QgsRenderContext &context) | |
Creates the renderer. Always called from main thread, should copy whatever necessary from the layer. | |
~QgsVectorTileLayerRenderer () override | |
virtual QgsFeedback * | feedback () const override |
Access to feedback object of the layer renderer (may be nullptr ) | |
bool | forceRasterRender () const override |
Returns true if the renderer must be rendered to a raster paint device (e.g. | |
virtual bool | render () override |
Do the rendering (based on data stored in the class). | |
![]() | |
QgsMapLayerRenderer (const QString &layerID, QgsRenderContext *context=nullptr) | |
Constructor for QgsMapLayerRenderer, with the associated layerID and render context. | |
virtual | ~QgsMapLayerRenderer () |
QStringList | errors () const |
Returns list of errors (problems) that happened during the rendering. | |
virtual Qgis::MapLayerRendererFlags | flags () const |
Returns flags which control how the map layer rendering behaves. | |
bool | isReadyToCompose () const |
Returns whether the renderer has already drawn (at least partially) some data. | |
QString | layerId () const |
Gets access to the ID of the layer rendered by this class. | |
QgsRenderContext * | renderContext () |
Returns the render context associated with the renderer. | |
const QgsRenderContext * | renderContext () const |
Returns the render context associated with the renderer. | |
virtual void | setLayerRenderingTimeHint (int time) |
Sets approximate render time (in ms) for the layer to render. | |
QList< QgsRenderedItemDetails * > | takeRenderedItemDetails () |
Takes the list of rendered item details from the renderer. | |
Additional Inherited Members | |
![]() | |
void | appendRenderedItemDetails (QgsRenderedItemDetails *details) |
Appends the details of a rendered item to the renderer. | |
![]() | |
QStringList | mErrors |
QString | mLayerID |
bool | mReadyToCompose = true |
The flag must be set to false in renderer's constructor if wants to use the smarter map redraws functionality https://github.com/qgis/QGIS-Enhancement-Proposals/issues/181. | |
![]() | |
static constexpr int | MAX_TIME_TO_USE_CACHED_PREVIEW_IMAGE = 3000 |
Maximum time (in ms) to allow display of a previously cached preview image while rendering layers, before switching to a progressive rendering display. | |
This class provides map rendering functionality for vector tile layers.
In render() function (assumed to be run in a worker thread) it will:
Definition at line 43 of file qgsvectortilelayerrenderer.h.
QgsVectorTileLayerRenderer::QgsVectorTileLayerRenderer | ( | QgsVectorTileLayer * | layer, |
QgsRenderContext & | context | ||
) |
Creates the renderer. Always called from main thread, should copy whatever necessary from the layer.
Definition at line 36 of file qgsvectortilelayerrenderer.cpp.
|
overridedefault |
|
inlineoverridevirtual |
Access to feedback object of the layer renderer (may be nullptr
)
Reimplemented from QgsMapLayerRenderer.
Definition at line 51 of file qgsvectortilelayerrenderer.h.
|
overridevirtual |
Returns true
if the renderer must be rendered to a raster paint device (e.g.
QImage).
Some layer settings require layers to be effectively "flattened" while rendering maps, which is achieved by first rendering the layer onto a raster paint device and then compositing the resultant image onto the final map render.
E.g. if a layer contains features with transparency or alternative blending modes, and the effects of these opacity or blending modes should be restricted to only affect other features within the SAME layer, then a flattened raster based render is required.
Subclasses should return true
whenever their corresponding layer settings require the layer to always be rendered using a raster paint device.
Reimplemented from QgsMapLayerRenderer.
Definition at line 238 of file qgsvectortilelayerrenderer.cpp.
|
overridevirtual |
Do the rendering (based on data stored in the class).
Returns true
if the layer was completely rendered successfully (i.e. the render was not canceled early).
Implements QgsMapLayerRenderer.
Definition at line 73 of file qgsvectortilelayerrenderer.cpp.