QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 #include "qgis.h"
23 
24 #include <QWidget>
25 #include "qgis_gui.h"
26 
27 class QgsRasterLayer;
28 class QgsRasterRenderer;
29 class QgsMapCanvas;
31 
36 class GUI_EXPORT QgsRasterRendererWidget: public QWidget
37 {
38  Q_OBJECT
39 
40  public:
41 
42  //TODO QGIS 4.0 - remove extent parameter, replace with map canvas parameter
44  : mRasterLayer( layer )
45  , mExtent( extent )
46  {}
47 
48  virtual QgsRasterRenderer *renderer() = 0 SIP_FACTORY;
49 
50  void setRasterLayer( QgsRasterLayer *layer ) { mRasterLayer = layer; }
51  const QgsRasterLayer *rasterLayer() const { return mRasterLayer; }
52 
60  virtual void setMapCanvas( QgsMapCanvas *canvas );
61 
67  QgsMapCanvas *mapCanvas();
68 
69  virtual QString min( int index = 0 ) { Q_UNUSED( index ) return QString(); }
70  virtual QString max( int index = 0 ) { Q_UNUSED( index ) return QString(); }
71  virtual void setMin( const QString &value, int index = 0 ) { Q_UNUSED( index ) Q_UNUSED( value ); }
72  virtual void setMax( const QString &value, int index = 0 ) { Q_UNUSED( index ) Q_UNUSED( value ); }
73  virtual QString stdDev() { return QString(); }
74  virtual void setStdDev( const QString &value ) { Q_UNUSED( value ) }
75  virtual int selectedBand( int index = 0 ) { Q_UNUSED( index ) return -1; }
76 
78  virtual void doComputations() { }
79 
81  virtual QgsRasterMinMaxWidget *minMaxWidget() { return nullptr; }
82 
83  signals:
84 
89  void widgetChanged();
90 
91  protected:
92  QgsRasterLayer *mRasterLayer = nullptr;
93 
96 
98  QgsMapCanvas *mCanvas = nullptr;
99 };
100 
101 #endif // QGSRASTERRENDERERWIDGET_H
QgsRasterRendererWidget::stdDev
virtual QString stdDev()
Definition: qgsrasterrendererwidget.h:73
qgsrectangle.h
QgsRasterRendererWidget::minMaxWidget
virtual QgsRasterMinMaxWidget * minMaxWidget()
Returns min/max widget when it exists.
Definition: qgsrasterrendererwidget.h:81
QgsMapCanvas
Definition: qgsmapcanvas.h:83
qgis.h
QgsRasterRendererWidget::setMax
virtual void setMax(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:72
QgsRectangle
Definition: qgsrectangle.h:41
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRasterRendererWidget::QgsRasterRendererWidget
QgsRasterRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgsrasterrendererwidget.h:43
QgsRasterMinMaxWidget
Definition: qgsrasterminmaxwidget.h:37
QgsRasterRenderer
Definition: qgsrasterrenderer.h:38
QgsRasterRendererWidget::mExtent
QgsRectangle mExtent
Current extent.
Definition: qgsrasterrendererwidget.h:95
QgsRasterRendererWidget::min
virtual QString min(int index=0)
Definition: qgsrasterrendererwidget.h:69
QgsRasterLayer
Definition: qgsrasterlayer.h:72
QgsRasterRendererWidget::selectedBand
virtual int selectedBand(int index=0)
Definition: qgsrasterrendererwidget.h:75
QgsRasterRendererWidget::setRasterLayer
void setRasterLayer(QgsRasterLayer *layer)
Definition: qgsrasterrendererwidget.h:50
QgsRasterRendererWidget::setMin
virtual void setMin(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:71
QgsRasterRendererWidget::doComputations
virtual void doComputations()
Load programmatically with current values.
Definition: qgsrasterrendererwidget.h:78
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:36
QgsRasterRendererWidget::max
virtual QString max(int index=0)
Definition: qgsrasterrendererwidget.h:70
QgsRasterRendererWidget::setStdDev
virtual void setStdDev(const QString &value)
Definition: qgsrasterrendererwidget.h:74
QgsRasterRendererWidget::rasterLayer
const QgsRasterLayer * rasterLayer() const
Definition: qgsrasterrendererwidget.h:51