QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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 Qgis::RasterRendererFlags flags() const override;
44
46 static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;
47
48 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
49
50 QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
51
52 QList<int> usesBands() const override;
53 QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
54 int inputBand() const override;
55 bool setInputBand( int band ) override;
56
58 double contourInterval() const { return mContourInterval; }
60 void setContourInterval( double interval ) { mContourInterval = interval; }
61
63 QgsLineSymbol *contourSymbol() const { return mContourSymbol.get(); }
65 void setContourSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
66
68 double contourIndexInterval() const { return mContourIndexInterval; }
70 void setContourIndexInterval( double interval ) { mContourIndexInterval = interval; }
71
73 QgsLineSymbol *contourIndexSymbol() const { return mContourIndexSymbol.get(); }
75 void setContourIndexSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
76
83 double downscale() const { return mDownscale; }
84
89 void setDownscale( double scale ) { mDownscale = scale; }
90
91 private:
92
93#ifdef SIP_RUN
96#endif
97
98 std::unique_ptr<QgsLineSymbol> mContourSymbol; // should not be null
99 std::unique_ptr<QgsLineSymbol> mContourIndexSymbol; // may be null
100 double mDownscale = 8.;
101 double mContourInterval = 100.;
102 double mContourIndexInterval = 0.;
103 int mInputBand = 1;
104};
105
106
107#endif // QGSRASTERCONTOURRENDERER_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
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.
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.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76