QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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:
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
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
QgsRasterContourRenderer::operator=
const QgsRasterContourRenderer & operator=(const QgsRasterContourRenderer &)=delete
QgsRasterContourRenderer cannot be copied. Use clone() instead.
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::QgsRasterContourRenderer
QgsRasterContourRenderer(const QgsRasterContourRenderer &)=delete
QgsRasterContourRenderer cannot be copied. Use clone() instead.
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
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRasterContourRenderer::~QgsRasterContourRenderer
~QgsRasterContourRenderer() override
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
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:39
QgsRasterContourRenderer
Raster renderer that generates contours on the fly for a source raster band.
Definition: qgsrastercontourrenderer.h:31
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:1131
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
Base class for processing filters like renderers, reprojector, resampler etc.
Definition: qgsrasterinterface.h:117
QgsRasterBlockFeedback
Feedback object tailored for raster block reading.
Definition: qgsrasterinterface.h:41
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
Raster data container.
Definition: qgsrasterblock.h:37