QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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
22class QgsLineSymbol;
23
31{
32 public:
36
41
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 QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
53 int inputBand() const override;
54 bool setInputBand( int band ) override;
55
57 double contourInterval() const { return mContourInterval; }
59 void setContourInterval( double interval ) { mContourInterval = interval; }
60
62 QgsLineSymbol *contourSymbol() const { return mContourSymbol.get(); }
64 void setContourSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
65
67 double contourIndexInterval() const { return mContourIndexInterval; }
69 void setContourIndexInterval( double interval ) { mContourIndexInterval = interval; }
70
72 QgsLineSymbol *contourIndexSymbol() const { return mContourIndexSymbol.get(); }
74 void setContourIndexSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
75
82 double downscale() const { return mDownscale; }
83
88 void setDownscale( double scale ) { mDownscale = scale; }
89
90 private:
91
92#ifdef SIP_RUN
95#endif
96
97 std::unique_ptr<QgsLineSymbol> mContourSymbol; // should not be null
98 std::unique_ptr<QgsLineSymbol> mContourIndexSymbol; // may be null
99 double mDownscale = 8.;
100 double mContourInterval = 100.;
101 double mContourIndexInterval = 0.;
102 int mInputBand = 1;
103};
104
105
106#endif // QGSRASTERCONTOURRENDERER_H
Layer tree node points to a map layer.
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:30
Feedback object tailored for raster block reading.
Raster data container.
Raster renderer that generates contours on the fly for a source raster band.
void setDownscale(double scale)
Sets by how much the renderer will scale down the request to the data provider.
QgsLineSymbol * contourIndexSymbol() const
Returns the symbol of index contour lines.
void setContourInterval(double interval)
Sets the interval of contour lines generation.
QgsRasterContourRenderer(const QgsRasterContourRenderer &)=delete
QgsRasterContourRenderer cannot be copied. Use clone() instead.
~QgsRasterContourRenderer() override
double downscale() const
Returns by how much the renderer will scale down the request to the data provider.
void setContourIndexInterval(double interval)
Sets the interval of index contour lines (index contour lines are typical further apart and with a wi...
QgsLineSymbol * contourSymbol() const
Returns the symbol used for contour lines.
const QgsRasterContourRenderer & operator=(const QgsRasterContourRenderer &)=delete
QgsRasterContourRenderer cannot be copied. Use clone() instead.
double contourIndexInterval() const
Returns the interval of index contour lines (index contour lines are typical further apart and with a...
Base class for processing filters like renderers, reprojector, resampler etc.
Raster renderer pipe that applies colors to a raster.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76