QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsmaprendererparalleljob.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaprendererparalleljob.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 QGSMAPRENDERERPARALLELJOB_H
17 #define QGSMAPRENDERERPARALLELJOB_H
18 
19 #include "qgsmaprendererjob.h"
20 
29 {
30  Q_OBJECT
31  public:
32  QgsMapRendererParallelJob( const QgsMapSettings& settings );
34 
35  virtual void start() override;
36  virtual void cancel() override;
37  virtual void waitForFinished() override;
38  virtual bool isActive() const override;
39 
40  virtual QgsLabelingResults* takeLabelingResults() override;
41 
42  // from QgsMapRendererJobWithPreview
43  virtual QImage renderedImage() override;
44 
45  protected slots:
47  void renderLayersFinished();
49  void renderingFinished();
50 
51  protected:
52 
53  static void renderLayerStatic( LayerRenderJob& job );
54  static void renderLabelsStatic( QgsMapRendererParallelJob* self );
55 
56  protected:
57 
58  QImage mFinalImage;
59 
60  enum { Idle, RenderingLayers, RenderingLabels } mStatus;
61 
62  QFuture<void> mFuture;
63  QFutureWatcher<void> mFutureWatcher;
64 
66 
69  QFuture<void> mLabelingFuture;
70  QFutureWatcher<void> mLabelingFutureWatcher;
71 };
72 
73 
74 #endif // QGSMAPRENDERERPARALLELJOB_H