QGIS API Documentation  2.99.0-Master (0a63d1f)
qgsrasterrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterrendererwidget.h
3  ---------------------------
4  begin : February 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSRASTERRENDERERWIDGET_H
19 #define QGSRASTERRENDERERWIDGET_H
20 
21 #include "qgsrectangle.h"
22 
23 #include <QWidget>
24 #include "qgis_gui.h"
25 
26 class QgsRasterLayer;
27 class QgsRasterRenderer;
28 class QgsMapCanvas;
30 
34 class GUI_EXPORT QgsRasterRendererWidget: public QWidget
35 {
36  Q_OBJECT
37 
38  public:
39 
40  //TODO QGIS 3.0 - remove extent parameter, replace with map canvas parameter
42  : mRasterLayer( layer )
43  , mExtent( extent )
44  , mCanvas( nullptr )
45  {}
46 
47  virtual QgsRasterRenderer* renderer() = 0;
48 
49  void setRasterLayer( QgsRasterLayer* layer ) { mRasterLayer = layer; }
50  const QgsRasterLayer* rasterLayer() const { return mRasterLayer; }
51 
58  virtual void setMapCanvas( QgsMapCanvas* canvas );
59 
65  QgsMapCanvas* mapCanvas();
66 
67  virtual QString min( int index = 0 ) { Q_UNUSED( index ); return QString(); }
68  virtual QString max( int index = 0 ) { Q_UNUSED( index ); return QString(); }
69  virtual void setMin( const QString& value, int index = 0 ) { Q_UNUSED( index ); Q_UNUSED( value ); }
70  virtual void setMax( const QString& value, int index = 0 ) { Q_UNUSED( index ); Q_UNUSED( value ); }
71  virtual QString stdDev() { return QString(); }
72  virtual void setStdDev( const QString& value ) { Q_UNUSED( value ); }
73  virtual int selectedBand( int index = 0 ) { Q_UNUSED( index ); return -1; }
74 
76  virtual void doComputations() { }
77 
79  virtual QgsRasterMinMaxWidget* minMaxWidget() { return nullptr; }
80 
81  signals:
82 
87  void widgetChanged();
88 
89  protected:
92  QString displayBandName( int band ) const;
93 
96 
99 };
100 
101 #endif // QGSRASTERRENDERERWIDGET_H
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:36
virtual QgsRasterMinMaxWidget * minMaxWidget()
Return min/max widget when it exists.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRasterRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent)
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
virtual void setMax(const QString &value, int index=0)
virtual QString min(int index=0)
virtual int selectedBand(int index=0)
QgsRectangle mExtent
Current extent.
void setRasterLayer(QgsRasterLayer *layer)
virtual void doComputations()
Load programmatically with current values.
virtual void setStdDev(const QString &value)
const QgsRasterLayer * rasterLayer() const
virtual QString max(int index=0)
virtual void setMin(const QString &value, int index=0)
QgsMapCanvas * mCanvas
Associated map canvas.
Raster renderer pipe that applies colors to a raster.