QGIS API Documentation  3.23.0-Master (4fd2f04bd0)
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 
38 class GUI_EXPORT QgsRasterRendererWidget: public QWidget
39 {
40  Q_OBJECT
41 
42  public:
43 
44  //TODO QGIS 4.0 - remove extent parameter, replace with map canvas parameter
46  : mRasterLayer( layer )
47  , mExtent( extent )
48  {}
49 
56 
62  void setRasterLayer( QgsRasterLayer *layer ) { mRasterLayer = layer; }
63 
69  const QgsRasterLayer *rasterLayer() const { return mRasterLayer; }
70 
78  virtual void setMapCanvas( QgsMapCanvas *canvas );
79 
85  QgsMapCanvas *mapCanvas();
86 
87  virtual QString min( int index = 0 ) { Q_UNUSED( index ) return QString(); }
88  virtual QString max( int index = 0 ) { Q_UNUSED( index ) return QString(); }
89  virtual void setMin( const QString &value, int index = 0 ) { Q_UNUSED( index ) Q_UNUSED( value ); }
90  virtual void setMax( const QString &value, int index = 0 ) { Q_UNUSED( index ) Q_UNUSED( value ); }
91  virtual QString stdDev() { return QString(); }
92  virtual void setStdDev( const QString &value ) { Q_UNUSED( value ) }
93  virtual int selectedBand( int index = 0 ) { Q_UNUSED( index ) return -1; }
94 
96  virtual void doComputations() { }
97 
99  virtual QgsRasterMinMaxWidget *minMaxWidget() { return nullptr; }
100 
101  signals:
102 
108 
109  protected:
110  QgsRasterLayer *mRasterLayer = nullptr;
111 
114 
116  QgsMapCanvas *mCanvas = nullptr;
117 };
118 
119 #endif // QGSRASTERRENDERERWIDGET_H
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Represents a raster layer.
Abstract base class for widgets which configure a QgsRasterRenderer.
virtual int selectedBand(int index=0)
virtual void setMax(const QString &value, int index=0)
virtual QString max(int index=0)
virtual void setStdDev(const QString &value)
virtual void setMin(const QString &value, int index=0)
virtual QString min(int index=0)
QgsRectangle mExtent
Current extent.
void setRasterLayer(QgsRasterLayer *layer)
Sets the raster layer associated with the widget.
virtual QgsRasterRenderer * renderer()=0
Creates a new renderer, using the properties defined in the widget.
virtual void doComputations()
Load programmatically with current values.
virtual QgsRasterMinMaxWidget * minMaxWidget()
Returns min/max widget when it exists.
QgsRasterRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent)
const QgsRasterLayer * rasterLayer() const
Returns the raster layer associated with the widget.
void widgetChanged()
Emitted when something on the widget has changed.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
#define SIP_FACTORY
Definition: qgis_sip.h:76