QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsrasterlayerrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterlayerrenderer.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 QGSRASTERLAYERRENDERER_H
17 #define QGSRASTERLAYERRENDERER_H
18 
19 #define SIP_NO_FILE
20 
21 #include "qgsmaplayerrenderer.h"
22 
23 class QPainter;
24 
25 class QgsMapToPixel;
26 class QgsRasterLayer;
27 class QgsRasterPipe;
28 struct QgsRasterViewPort;
29 class QgsRenderContext;
30 
32 
33 #include "qgsrasterinterface.h"
34 
36 
43 class CORE_EXPORT QgsRasterLayerRendererFeedback : public QgsRasterBlockFeedback
44 {
45  Q_OBJECT
46 
47  public:
49  explicit QgsRasterLayerRendererFeedback( QgsRasterLayerRenderer *r );
50 
52  void onNewData() override;
53  private:
54  QgsRasterLayerRenderer *mR = nullptr;
55  int mMinimalPreviewInterval;
56  QTime mLastPreview;
57 };
58 
60 
68 class CORE_EXPORT QgsRasterLayerRenderer : public QgsMapLayerRenderer
69 {
70  public:
71  QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRenderContext &rendererContext );
72  ~QgsRasterLayerRenderer() override;
73 
74  bool render() override;
75 
76  QgsFeedback *feedback() const override;
77 
78  private:
79 
80  QPainter *mPainter = nullptr;
81  const QgsMapToPixel *mMapToPixel = nullptr;
82  QgsRasterViewPort *mRasterViewPort = nullptr;
83 
84  QgsRasterPipe *mPipe = nullptr;
85  QgsRenderContext &mContext;
86 
88  QgsRasterLayerRendererFeedback *mFeedback = nullptr;
89 
90  friend class QgsRasterLayerRendererFeedback;
91 };
92 
93 
94 #endif // QGSRASTERLAYERRENDERER_H
virtual void onNewData()
May be emitted by raster data provider to indicate that some partial data are available and a new pre...
Base class for processing modules.
Definition: qgsrasterpipe.h:46
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
Implementation of threaded rendering for raster layers.
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Definition: qgsfeedback.h:44
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:36
Contains information about the context of a rendering operation.
virtual bool render()=0
Do the rendering (based on data stored in the class)
Base class for utility classes that encapsulate information necessary for rendering of map layers...
This class provides details of the viewable area that a raster will be rendered into.
Feedback object tailored for raster block reading.
virtual QgsFeedback * feedback() const
Access to feedback object of the layer renderer (may be null)