QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
25 class QgsRasterLayer;
26 class QgsRasterRenderer;
27 class QgsMapCanvas;
28 
32 class GUI_EXPORT QgsRasterRendererWidget: public QWidget
33 {
34  Q_OBJECT
35 
36  public:
37 
38  //TODO QGIS 3.0 - remove extent parameter, replace with map canvas parameter
40  : mRasterLayer( layer )
41  , mExtent( extent )
42  , mCanvas( nullptr )
43  {}
44 
46 
48  {
52  CumulativeCut // 2 - 98% cumulative cut
53  };
54 
55  virtual QgsRasterRenderer* renderer() = 0;
56 
57  void setRasterLayer( QgsRasterLayer* layer ) { mRasterLayer = layer; }
58  const QgsRasterLayer* rasterLayer() const { return mRasterLayer; }
59 
66  virtual void setMapCanvas( QgsMapCanvas* canvas );
67 
73  QgsMapCanvas* mapCanvas();
74 
75  virtual QString min( int index = 0 ) { Q_UNUSED( index ); return QString(); }
76  virtual QString max( int index = 0 ) { Q_UNUSED( index ); return QString(); }
77  virtual void setMin( const QString& value, int index = 0 ) { Q_UNUSED( index ); Q_UNUSED( value ); }
78  virtual void setMax( const QString& value, int index = 0 ) { Q_UNUSED( index ); Q_UNUSED( value ); }
79  virtual QString stdDev() { return QString(); }
80  virtual void setStdDev( const QString& value ) { Q_UNUSED( value ); }
81  virtual int selectedBand( int index = 0 ) { Q_UNUSED( index ); return -1; }
82 
83  signals:
84 
89  void widgetChanged();
90 
91  protected:
94  QString displayBandName( int band ) const;
95 
98 
101 };
102 
103 #endif // QGSRASTERRENDERERWIDGET_H
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
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:109
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 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.