QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
core
qgsmaprenderercustompainterjob.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaprenderercustompainterjob.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 QGSMAPRENDERERCUSTOMPAINTERJOB_H
17
#define QGSMAPRENDERERCUSTOMPAINTERJOB_H
18
19
#include "
qgsmaprendererjob.h
"
20
21
#include <QEventLoop>
22
32
class
CORE_EXPORT
QgsMapRendererCustomPainterJob
:
public
QgsMapRendererJob
33
{
34
Q_OBJECT
35
public
:
36
QgsMapRendererCustomPainterJob
(
const
QgsMapSettings
& settings,
QPainter
* painter );
37
~
QgsMapRendererCustomPainterJob
();
38
39
virtual
void
start
()
override
;
40
virtual
void
cancel
()
override
;
41
virtual
void
cancelWithoutBlocking
()
override
;
42
virtual
void
waitForFinished
()
override
;
43
virtual
bool
isActive
()
const override
;
44
virtual
QgsLabelingResults
*
takeLabelingResults
()
override
;
45
47
const
LayerRenderJobs
&
jobs
()
const
{
return
mLayerJobs; }
48
61
void
waitForFinishedWithEventLoop(
const
QEventLoop::ProcessEventsFlags
& flags = QEventLoop::AllEvents );
62
72
void
renderSynchronously();
73
74
protected
slots:
75
void
futureFinished();
76
77
protected
:
78
static
void
staticRender(
QgsMapRendererCustomPainterJob
*
self
);
// function to be used within the thread
79
80
// these methods are called within worker thread
81
void
doRender();
82
83
private
:
84
QPainter
* mPainter;
85
QFuture<void>
mFuture;
86
QFutureWatcher<void>
mFutureWatcher;
87
QgsRenderContext
mLabelingRenderContext;
88
QgsPalLabeling
* mLabelingEngine;
89
QgsLabelingEngineV2
* mLabelingEngineV2;
90
91
bool
mActive;
92
LayerRenderJobs
mLayerJobs;
93
bool
mRenderSynchronously;
94
};
95
96
97
#endif // QGSMAPRENDERERCUSTOMPAINTERJOB_H
QgsMapRendererCustomPainterJob::jobs
const LayerRenderJobs & jobs() const
Definition:
qgsmaprenderercustompainterjob.h:47
QgsMapRendererCustomPainterJob
Job implementation that renders everything sequentially using a custom painter.
Definition:
qgsmaprenderercustompainterjob.h:32
QgsMapRendererJob
Abstract base class for map rendering implementations.
Definition:
qgsmaprendererjob.h:82
QgsPalLabeling
Definition:
qgspallabeling.h:875
QgsLabelingEngineV2
The QgsLabelingEngineV2 class provides map labeling functionality.
Definition:
qgslabelingenginev2.h:162
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map.
Definition:
qgsmapsettings.h:54
QPainter
QgsMapRendererJob::waitForFinished
virtual void waitForFinished()=0
Block until the job has finished.
QList
qgsmaprendererjob.h
QgsMapRendererJob::start
virtual void start()=0
Start the rendering job and immediately return.
QEventLoop::ProcessEventsFlags
typedef ProcessEventsFlags
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:45
QFutureWatcher< void >
QgsMapRendererJob::cancel
virtual void cancel()=0
Stop the rendering job - does not return until the job has terminated.
QgsMapRendererJob::cancelWithoutBlocking
virtual void cancelWithoutBlocking()=0
Triggers cancellation of the rendering job without blocking.
QgsLabelingResults
Class that stores computed placement from labeling engine.
Definition:
qgspallabeling.h:849
QgsMapRendererJob::takeLabelingResults
virtual QgsLabelingResults * takeLabelingResults()=0
Get pointer to internal labeling engine (in order to get access to the results)
QFuture< void >
QgsMapRendererJob::isActive
virtual bool isActive() const =0
Tell whether the rendering job is currently running in background.
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13