26 , mLabelingEngine( 0 )
63 QgsDebugMsg( QString(
"QThreadPool max thread count is %1" ).arg( QThreadPool::globalInstance()->maxThreadCount() ) );
83 it->context.setRenderingStopped(
true );
121 QgsDebugMsg( QString(
"waitForFinished (1): %1 ms" ).arg( t.elapsed() / 1000.0 ) );
135 QgsDebugMsg( QString(
"waitForFinished (2): %1 ms" ).arg( t.elapsed() / 1000.0 ) );
209 QgsDebugMsg( QString(
"job %1 start" ).arg(( ulong ) &job, 0, 16 ) );
213 job.renderer->render();
219 catch ( std::exception & e )
221 QgsDebugMsg(
"Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
225 QgsDebugMsg(
"Caught unhandled unknown exception" );
228 int tt = t.elapsed();
229 QgsDebugMsg( QString(
"job %1 end [%2 ms]" ).arg(( ulong ) &job, 0, 16 ).arg( tt ) );
236 QPainter painter( &self->mFinalImage );
240 drawLabeling( self->mSettings, self->mLabelingRenderContext, self->mLabelingEngine, &painter );
246 catch ( std::exception & e )
248 QgsDebugMsg(
"Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
252 QgsDebugMsg(
"Caught unhandled unknown exception" );
QgsRenderContext mLabelingRenderContext
void finished()
emitted when asynchronous rendering is finished (or canceled).
void setRenderingStopped(bool stopped)
void renderingFinished()
all rendering is finished, including labeling
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)
virtual Q_DECL_DEPRECATED void init(QgsMapRenderer *mr)
called when we're going to start with rendering
void loadEngineSettings()
load/save engine settings to project file
~QgsMapRendererParallelJob()
virtual QgsLabelingResults * takeLabelingResults()
Get pointer to internal labeling engine (in order to get access to the results)
QgsPalLabeling * mLabelingEngine
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.
QFuture< void > mLabelingFuture
QgsMapRendererParallelJob(const QgsMapSettings &settings)
virtual QImage renderedImage()
Get a preview/resulting image.
bool renderingStopped() const
virtual void waitForFinished()
Block until the job has finished.
LayerRenderJobs mLayerJobs
Job implementation that renders all layers in parallel.
static void renderLabelsStatic(QgsMapRendererParallelJob *self)
void renderLayersFinished()
layers are rendered, labeling is still pending
virtual bool isActive() const
Tell whether the rendering job is currently running in background.
virtual void cancel()
Stop the rendering job - does not return until the job has terminated.
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...
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)
virtual void start()
Start the rendering job and immediately return.
Defines a qgis exception class.
Structure keeping low-level rendering job information.