22 #include <QtConcurrentMap>
28 , mLabelingEngine( 0 )
85 it->context.setRenderingStopped(
true );
215 job.renderer->render();
221 catch ( std::exception & e )
227 QgsDebugMsg(
"Caught unhandled unknown exception" );
238 QPainter painter( &self->mFinalImage );
242 drawLabeling( self->mSettings, self->mLabelingRenderContext, self->mLabelingEngine, &painter );
248 catch ( std::exception & e )
254 QgsDebugMsg(
"Caught unhandled unknown exception" );
QgsRenderContext mLabelingRenderContext
QString fromAscii(const char *str, int size)
void finished()
emitted when asynchronous rendering is finished (or canceled).
void setRenderingStopped(bool stopped)
void renderingFinished()
all rendering is finished, including labeling
virtual void waitForFinished() override
Block until the job has finished.
void cleanupJobs(LayerRenderJobs &jobs)
QgsLabelingResults * takeResults()
Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to ...
static QImage composeImage(const QgsMapSettings &settings, const LayerRenderJobs &jobs)
void loadEngineSettings()
load/save engine settings to project file
QThreadPool * globalInstance()
~QgsMapRendererParallelJob()
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QgsPalLabeling * mLabelingEngine
virtual void cancel() override
Stop the rendering job - does not return until the job has terminated.
LayerRenderJobs prepareJobs(QPainter *painter, QgsPalLabeling *labelingEngine)
Enable drawing of labels on top of the map.
QFutureWatcher< void > mFutureWatcher
The QgsMapSettings class contains configuration for rendering of the map.
virtual Q_DECL_DEPRECATED void init(QgsMapRenderer *mr) override
called when we're going to start with rendering
QFuture< void > mLabelingFuture
QgsMapRendererParallelJob(const QgsMapSettings &settings)
bool renderingStopped() const
LayerRenderJobs mLayerJobs
Job implementation that renders all layers in parallel.
static void renderLabelsStatic(QgsMapRendererParallelJob *self)
QFuture< T > run(Function function,...)
QFuture< void > map(Sequence &sequence, MapFunction function)
void renderLayersFinished()
layers are rendered, labeling is still pending
void setFuture(const QFuture< T > &future)
bool testFlag(Flag flag) const
Check whether a particular flag is enabled.
enum QgsMapRendererParallelJob::@0 mStatus
Intermediate base class adding functionality that allows client to query the rendered image...
virtual void start() override
Start the rendering job and immediately return.
QFutureWatcher< void > mLabelingFutureWatcher
static void drawLabeling(const QgsMapSettings &settings, QgsRenderContext &renderContext, QgsPalLabeling *labelingEngine, QPainter *painter)
Class that stores computed placement from labeling engine.
static void renderLayerStatic(LayerRenderJob &job)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Defines a qgis exception class.
Structure keeping low-level rendering job information.
virtual bool isActive() const override
Tell whether the rendering job is currently running in background.
virtual QImage renderedImage() override
Get a preview/resulting image.
virtual QgsLabelingResults * takeLabelingResults() override
Get pointer to internal labeling engine (in order to get access to the results)