16 #ifndef QGSMAPRENDERERJOB_H 17 #define QGSMAPRENDERERJOB_H 19 #include "qgis_core.h" 21 #include <QFutureWatcher> 56 bool imageInitialized =
false;
58 QPainter::CompositionMode blendMode;
77 typedef QList<LayerRenderJob> LayerRenderJobs;
91 QImage *img =
nullptr;
95 bool canUseCache =
false;
97 bool complete =
false;
99 int renderingTime = -1;
101 QList< QPointer< QgsMapLayer > > participatingLayers;
145 virtual void start() = 0;
151 virtual void cancel() = 0;
158 virtual void cancelWithoutBlocking() = 0;
161 virtual void waitForFinished() = 0;
164 virtual bool isActive()
const = 0;
173 virtual bool usedCachedLabels()
const = 0;
200 Error(
const QString &lid,
const QString &msg )
209 typedef QList<QgsMapRendererJob::Error>
Errors;
212 Errors errors()
const;
232 QHash< QgsMapLayer *, int > perLayerRenderingTime()
const SIP_SKIP;
256 void renderingLayersFinished();
269 int mRenderingTime = 0;
277 bool mRecordRenderingTime =
true;
284 bool prepareLabelCache() const SIP_SKIP;
297 LayerRenderJobs prepareJobs( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool deferredPainterSet = false ) SIP_SKIP;
304 LabelRenderJob prepareLabelingJob( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool canUseLabelCache = true ) SIP_SKIP;
307 static QImage composeImage( const
QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob ) SIP_SKIP;
310 void logRenderingTime( const LayerRenderJobs &jobs, const LabelRenderJob &labelJob ) SIP_SKIP;
313 void cleanupJobs( LayerRenderJobs &jobs ) SIP_SKIP;
321 void cleanupLabelJob( LabelRenderJob &job ) SIP_SKIP;
364 virtual QImage renderedImage() = 0;
369 #endif // QGSMAPRENDERERJOB_H A rectangle specified with double values.
Base class for all map layer types.
Abstract base class for map rendering implementations.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
int renderingTime() const
Returns the total time it took to finish the job (in milliseconds).
void setFeatureFilterProvider(const QgsFeatureFilterProvider *f)
Set the feature filter provider used by the QgsRenderContext of each LayerRenderJob.
The QgsMapSettings class contains configuration for rendering of the map.
QHash< QgsWeakMapLayerPointer, int > mPerLayerRenderingTime
Render time (in ms) per layer, by layer ID.
const QgsFeatureFilterProvider * featureFilterProvider() const
Returns the feature filter provider used by the QgsRenderContext of each LayerRenderJob.
Abstract interface for use by classes that filter the features of a layer.
The QgsLabelingEngine class provides map labeling functionality.
Contains information about the context of a rendering operation.
QList< QgsMapRendererJob::Error > Errors
Intermediate base class adding functionality that allows client to query the rendered image...
Base class for utility classes that encapsulate information necessary for rendering of map layers...
Class that stores computed placement from labeling engine.
This class is responsible for keeping cache of rendered images resulting from a map rendering job...
Error(const QString &lid, const QString &msg)