QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsrastercontourrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrastercontourrenderer.h
3  --------------------------------------
4  Date : March 2020
5  Copyright : (C) 2020 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 QGSRASTERCONTOURRENDERER_H
17 #define QGSRASTERCONTOURRENDERER_H
18 
19 
20 #include "qgsrasterrenderer.h"
21 
22 class QgsLineSymbol;
23 
30 class CORE_EXPORT QgsRasterContourRenderer : public QgsRasterRenderer
31 {
32  public:
35  ~QgsRasterContourRenderer() override;
36 
41 
42  QgsRasterContourRenderer *clone() const override SIP_FACTORY;
43 
45  static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;
46 
47  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
48 
49  QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
50 
51  QList<int> usesBands() const override;
52 
53  //
54 
56  int inputBand() const { return mInputBand; }
58  void setInputBand( int band ) { mInputBand = band; }
59 
61  double contourInterval() const { return mContourInterval; }
63  void setContourInterval( double interval ) { mContourInterval = interval; }
64 
66  QgsLineSymbol *contourSymbol() const { return mContourSymbol.get(); }
68  void setContourSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
69 
71  double contourIndexInterval() const { return mContourIndexInterval; }
73  void setContourIndexInterval( double interval ) { mContourIndexInterval = interval; }
74 
76  QgsLineSymbol *contourIndexSymbol() const { return mContourIndexSymbol.get(); }
78  void setContourIndexSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
79 
86  double downscale() const { return mDownscale; }
87 
92  void setDownscale( double scale ) { mDownscale = scale; }
93 
94  private:
95 
96 #ifdef SIP_RUN
99 #endif
100 
101  std::unique_ptr<QgsLineSymbol> mContourSymbol; // should not be null
102  std::unique_ptr<QgsLineSymbol> mContourIndexSymbol; // may be null
103  double mDownscale = 8.;
104  double mContourInterval = 100.;
105  double mContourIndexInterval = 0.;
106  int mInputBand = 1;
107 };
108 
109 
110 #endif // QGSRASTERCONTOURRENDERER_H
QgsRasterRenderer::block
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override=0
Read block of data using given extent and size.
QgsRasterContourRenderer::setInputBand
void setInputBand(int band)
Sets the number of the input raster band.
Definition: qgsrastercontourrenderer.h:58
QgsRasterContourRenderer::setDownscale
void setDownscale(double scale)
Sets by how much the renderer will scale down the request to the data provider.
Definition: qgsrastercontourrenderer.h:92
QgsRasterInterface::writeXml
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Definition: qgsrasterinterface.h:461
QgsRasterContourRenderer::contourSymbol
QgsLineSymbol * contourSymbol() const
Returns the symbol used for contour lines.
Definition: qgsrastercontourrenderer.h:66
QgsRasterContourRenderer::contourInterval
double contourInterval() const
Returns the interval of contour lines generation.
Definition: qgsrastercontourrenderer.h:61
qgsrasterrenderer.h
QgsRasterContourRenderer::setContourIndexInterval
void setContourIndexInterval(double interval)
Sets the interval of index contour lines (index contour lines are typical further apart and with a wi...
Definition: qgsrastercontourrenderer.h:73
QgsRasterRenderer::usesBands
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
Definition: qgsrasterrenderer.h:132
QgsRasterContourRenderer::inputBand
int inputBand() const
Returns the number of the input raster band.
Definition: qgsrastercontourrenderer.h:56
QgsRectangle
Definition: qgsrectangle.h:41
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRasterContourRenderer::contourIndexSymbol
QgsLineSymbol * contourIndexSymbol() const
Returns the symbol of index contour lines.
Definition: qgsrastercontourrenderer.h:76
QgsRasterContourRenderer::setContourInterval
void setContourInterval(double interval)
Sets the interval of contour lines generation.
Definition: qgsrastercontourrenderer.h:63
QgsRasterRenderer
Definition: qgsrasterrenderer.h:38
QgsRasterContourRenderer
Definition: qgsrastercontourrenderer.h:30
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
Definition: qgssymbol.h:1117
QgsRasterRenderer::clone
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
QgsRasterContourRenderer::downscale
double downscale() const
Returns by how much the renderer will scale down the request to the data provider.
Definition: qgsrastercontourrenderer.h:86
QgsRasterInterface
Definition: qgsrasterinterface.h:116
QgsRasterBlockFeedback
Definition: qgsrasterinterface.h:40
QgsRasterRenderer::operator=
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterContourRenderer::contourIndexInterval
double contourIndexInterval() const
Returns the interval of index contour lines (index contour lines are typical further apart and with a...
Definition: qgsrastercontourrenderer.h:71
QgsRasterBlock
Definition: qgsrasterblock.h:36