QGIS API Documentation
3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
src
core
qgsmaplayerrenderer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaplayerrenderer.h
3
--------------------------------------
4
Date : December 2013
5
Copyright : (C) 2013 by Martin Dobias
6
Email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSMAPLAYERRENDERER_H
17
#define QGSMAPLAYERRENDERER_H
18
19
#include <QStringList>
20
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
#include "
qgis.h
"
24
25
class
QgsFeedback
;
26
class
QgsRenderContext
;
27
class
QgsRenderedItemDetails
;
28
52
class
CORE_EXPORT
QgsMapLayerRenderer
53
{
54
public
:
55
59
QgsMapLayerRenderer
(
const
QString &layerID,
QgsRenderContext
*context =
nullptr
)
60
: mLayerID( layerID )
61
, mContext( context )
62
{}
63
64
virtual
~QgsMapLayerRenderer
();
65
72
virtual
bool
render
() = 0;
73
90
virtual
bool
forceRasterRender()
const
;
91
97
virtual
Qgis::MapLayerRendererFlags flags()
const
;
98
103
virtual
QgsFeedback
*feedback()
const
;
104
106
QStringList
errors
()
const
{
return
mErrors; }
107
109
QString
layerId
()
const
{
return
mLayerID; }
110
116
QgsRenderContext
*
renderContext
() {
return
mContext; }
117
124
const
QgsRenderContext
*
renderContext
() const
SIP_SKIP
{
return
mContext; }
125
132
bool
isReadyToCompose
()
const
{
return
mReadyToCompose; }
133
144
virtual
void
setLayerRenderingTimeHint
(
int
time )
SIP_SKIP
{ Q_UNUSED( time ) }
145
154
QList< QgsRenderedItemDetails * > takeRenderedItemDetails()
SIP_TRANSFERBACK
;
155
156
protected:
157
QStringList mErrors;
158
QString mLayerID;
159
160
// TODO QGIS 4.0 - make false as default
161
176
bool
mReadyToCompose = true;
177
186
static constexpr
int
MAX_TIME_TO_USE_CACHED_PREVIEW_IMAGE = 3000
SIP_SKIP
;
187
198
void
appendRenderedItemDetails(
QgsRenderedItemDetails
*details
SIP_TRANSFER
);
199
200
private:
201
202
// TODO QGIS 4.0 - make reference instead of pointer!
203
209
QgsRenderContext
*mContext =
nullptr
;
210
211
QList<
QgsRenderedItemDetails
*> mRenderedItemDetails;
212
};
213
214
#endif
// QGSMAPLAYERRENDERER_H
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:45
QgsMapLayerRenderer
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Definition
qgsmaplayerrenderer.h:53
QgsMapLayerRenderer::renderContext
const QgsRenderContext * renderContext() const
Returns the render context associated with the renderer.
Definition
qgsmaplayerrenderer.h:124
QgsMapLayerRenderer::render
virtual bool render()=0
Do the rendering (based on data stored in the class).
QgsMapLayerRenderer::isReadyToCompose
bool isReadyToCompose() const
Returns whether the renderer has already drawn (at least partially) some data.
Definition
qgsmaplayerrenderer.h:132
QgsMapLayerRenderer::layerId
QString layerId() const
Gets access to the ID of the layer rendered by this class.
Definition
qgsmaplayerrenderer.h:109
QgsMapLayerRenderer::~QgsMapLayerRenderer
virtual ~QgsMapLayerRenderer()
QgsMapLayerRenderer::renderContext
QgsRenderContext * renderContext()
Returns the render context associated with the renderer.
Definition
qgsmaplayerrenderer.h:116
QgsMapLayerRenderer::errors
QStringList errors() const
Returns list of errors (problems) that happened during the rendering.
Definition
qgsmaplayerrenderer.h:106
QgsMapLayerRenderer::QgsMapLayerRenderer
QgsMapLayerRenderer(const QString &layerID, QgsRenderContext *context=nullptr)
Constructor for QgsMapLayerRenderer, with the associated layerID and render context.
Definition
qgsmaplayerrenderer.h:59
QgsMapLayerRenderer::setLayerRenderingTimeHint
virtual void setLayerRenderingTimeHint(int time)
Sets approximate render time (in ms) for the layer to render.
Definition
qgsmaplayerrenderer.h:144
QgsRenderContext
Contains information about the context of a rendering operation.
Definition
qgsrendercontext.h:61
QgsRenderedItemDetails
Base class for detailed information about a rendered item.
Definition
qgsrendereditemdetails.h:37
qgis.h
qgis_sip.h
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:126
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:36
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:48
Generated on Mon Oct 30 2023 18:42:25 for QGIS API Documentation by
1.9.8