QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsmaprendererstagedrenderjob.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaprendererstagedrenderjob.h
3  --------------------------------------
4  Date : August 2019
5  Copyright : (C) 2019 by Nyall Dawson
6  Email : nyall dot dawson 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 QGSMAPRENDERERSTAGEDRENDERJOB_H
17 #define QGSMAPRENDERERSTAGEDRENDERJOB_H
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
22 
23 #define SIP_NO_FILE
24 
33 {
34  Q_OBJECT
35  public:
36 
40  enum Flag
41  {
42  RenderLabelsByMapLayer = 0x01,
43  };
44  Q_DECLARE_FLAGS( Flags, Flag )
45 
46 
50  {
54  };
55 
62  QgsMapRendererStagedRenderJob( const QgsMapSettings &settings, Flags flags = Flags() );
64 
65  void cancel() override;
66  void cancelWithoutBlocking() override;
67  void waitForFinished() override;
68  bool isActive() const override;
69  bool usedCachedLabels() const override;
71 
77  bool renderCurrentPart( QPainter *painter );
78 
85  bool nextPart();
86 
90  bool isFinished() const;
91 
95  QString currentLayerId() const;
96 
102  double currentLayerOpacity() const;
103 
109  QPainter::CompositionMode currentLayerCompositionMode() const;
110 
114  RenderStage currentStage() const;
115 
116  private:
117 
118  void startPrivate() override;
119 
120  std::unique_ptr< QgsLabelingEngine > mLabelingEngineV2;
121 
122  std::vector< LayerRenderJob > mLayerJobs;
123  LabelRenderJob mLabelJob;
124  std::vector< LayerRenderJob >::iterator mJobIt;
125 
126  bool mNextIsLabel = false;
127  bool mExportedLabels = false;
128  Flags mFlags = Flags();
129  bool mPreparedStagedLabelJob = false;
130  QStringList mLabelingLayers;
131  QStringList::iterator mLabelLayerIt;
132 };
133 
134 #endif // QGSMAPRENDERERSTAGEDRENDERJOB_H
QgsMapRendererStagedRenderJob::Symbology
@ Symbology
Rendering layer symbology.
Definition: qgsmaprendererstagedrenderjob.h:51
QgsMapRendererJob::usedCachedLabels
virtual bool usedCachedLabels() const =0
Returns true if the render job was able to use a cached labeling solution.
QgsMapRendererJob::isActive
virtual bool isActive() const =0
Tell whether the rendering job is currently running in background.
QgsMapRendererAbstractCustomPainterJob
Abstract base class for map renderer jobs which use custom painters.
Definition: qgsmaprenderercustompainterjob.h:31
QgsMapRendererStagedRenderJob::Finished
@ Finished
Rendering is finished.
Definition: qgsmaprendererstagedrenderjob.h:53
QgsLabelingResults
Class that stores computed placement from labeling engine.
Definition: qgslabelingresults.h:32
qgsmaprenderercustompainterjob.h
QgsMapRendererStagedRenderJob::RenderStage
RenderStage
Represents the stages of a rendering job.
Definition: qgsmaprendererstagedrenderjob.h:49
geos::unique_ptr
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
QgsMapRendererJob::waitForFinished
virtual void waitForFinished()=0
Block until the job has finished.
QgsMapRendererStagedRenderJob::Labels
@ Labels
Rendering labels.
Definition: qgsmaprendererstagedrenderjob.h:52
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLabelingEngine
The QgsLabelingEngine class provides map labeling functionality. The input for the engine is a list o...
Definition: qgslabelingengine.h:343
QgsMapRendererStagedRenderJob::Flag
Flag
Flags which control the staged render job behavior.
Definition: qgsmaprendererstagedrenderjob.h:40
QgsMapRendererJob::cancelWithoutBlocking
virtual void cancelWithoutBlocking()=0
Triggers cancellation of the rendering job without blocking.
QgsMapRendererStagedRenderJob
Render job implementation that renders maps in stages, allowing different stages (e....
Definition: qgsmaprendererstagedrenderjob.h:32
QgsMapRendererJob::takeLabelingResults
virtual QgsLabelingResults * takeLabelingResults()=0
Gets pointer to internal labeling engine (in order to get access to the results).
QgsMapRendererJob::cancel
virtual void cancel()=0
Stop the rendering job - does not return until the job has terminated.
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88