QGIS API Documentation
3.14.0-Pi (9f7028fd23)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
n
o
p
q
r
s
t
u
w
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
gui
raster
qgsrastercontourrendererwidget.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrastercontourrendererwidget.cpp
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
#include "
qgsrastercontourrendererwidget.h
"
17
18
#include "
qgsrastercontourrenderer.h
"
19
#include "
qgsrasterlayer.h
"
20
21
22
QgsRasterContourRendererWidget::QgsRasterContourRendererWidget
(
QgsRasterLayer
*layer,
const
QgsRectangle
&extent )
23
:
QgsRasterRendererWidget
( layer, extent )
24
{
25
setupUi(
this
);
26
27
mContourSymbolButton->setSymbolType(
QgsSymbol::Line
);
28
mIndexContourSymbolButton->setSymbolType(
QgsSymbol::Line
);
29
30
mInputBandComboBox->setLayer(
mRasterLayer
);
31
32
if
( !
mRasterLayer
)
33
{
34
return
;
35
}
36
QgsRasterDataProvider
*provider =
mRasterLayer
->
dataProvider
();
37
if
( !provider )
38
{
39
return
;
40
}
41
42
const
QgsRasterContourRenderer
*rcr =
dynamic_cast<
const
QgsRasterContourRenderer
*
>
(
mRasterLayer
->
renderer
() );
43
if
( rcr )
44
{
45
mInputBandComboBox->setBand( rcr->
inputBand
() );
46
mContourIntervalSpinBox->setValue( rcr->
contourInterval
() );
47
mIndexContourIntervalSpinBox->setValue( rcr->
contourIndexInterval
() );
48
mDownscaleSpinBox->setValue( rcr->
downscale
() );
49
if
( rcr->
contourSymbol
() )
50
mContourSymbolButton->setSymbol( rcr->
contourSymbol
()->
clone
() );
51
if
( rcr->
contourIndexSymbol
() )
52
mIndexContourSymbolButton->setSymbol( rcr->
contourIndexSymbol
()->
clone
() );
53
}
54
55
connect( mInputBandComboBox, &
QgsRasterBandComboBox::bandChanged
,
this
, &
QgsRasterRendererWidget::widgetChanged
);
56
connect( mContourIntervalSpinBox,
static_cast <
void
( QDoubleSpinBox::* )(
double
)
>
( &QDoubleSpinBox::valueChanged ),
this
, &
QgsRasterRendererWidget::widgetChanged
);
57
connect( mIndexContourIntervalSpinBox,
static_cast <
void
( QDoubleSpinBox::* )(
double
)
>
( &QDoubleSpinBox::valueChanged ),
this
, &
QgsRasterRendererWidget::widgetChanged
);
58
connect( mDownscaleSpinBox,
static_cast <
void
( QDoubleSpinBox::* )(
double
)
>
( &QDoubleSpinBox::valueChanged ),
this
, &
QgsRasterRendererWidget::widgetChanged
);
59
connect( mContourSymbolButton, &
QgsSymbolButton::changed
,
this
, &
QgsRasterRendererWidget::widgetChanged
);
60
connect( mIndexContourSymbolButton, &
QgsSymbolButton::changed
,
this
, &
QgsRasterRendererWidget::widgetChanged
);
61
}
62
63
QgsRasterRenderer
*
QgsRasterContourRendererWidget::renderer
()
64
{
65
if
( !mRasterLayer )
66
{
67
return
nullptr
;
68
}
69
QgsRasterDataProvider
*provider = mRasterLayer->dataProvider();
70
if
( !provider )
71
{
72
return
nullptr
;
73
}
74
75
QgsRasterContourRenderer
*renderer =
new
QgsRasterContourRenderer
( provider );
76
renderer->
setInputBand
( mInputBandComboBox->currentBand() );
77
renderer->
setContourInterval
( mContourIntervalSpinBox->value() );
78
renderer->
setContourIndexInterval
( mIndexContourIntervalSpinBox->value() );
79
renderer->
setDownscale
( mDownscaleSpinBox->value() );
80
renderer->
setContourSymbol
( mContourSymbolButton->clonedSymbol<
QgsLineSymbol
>() );
81
renderer->
setContourIndexSymbol
( mIndexContourSymbolButton->clonedSymbol<
QgsLineSymbol
>() );
82
return
renderer;
83
}
QgsRasterBandComboBox::bandChanged
void bandChanged(int band)
Emitted when the currently selected band changes.
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
QgsSymbolButton::changed
void changed()
Emitted when the symbol's settings are changed.
qgsrasterlayer.h
QgsRasterRendererWidget::mRasterLayer
QgsRasterLayer * mRasterLayer
Definition:
qgsrasterrendererwidget.h:92
QgsLineSymbol::clone
QgsLineSymbol * clone() const override
Returns a deep copy of this symbol.
Definition:
qgssymbol.cpp:2139
QgsRasterContourRenderer::contourSymbol
QgsLineSymbol * contourSymbol() const
Returns the symbol used for contour lines.
Definition:
qgsrastercontourrenderer.h:66
QgsRasterContourRenderer::setContourSymbol
void setContourSymbol(QgsLineSymbol *symbol)
Sets the symbol used for contour lines. Takes ownership of the passed symbol.
Definition:
qgsrastercontourrenderer.cpp:218
QgsRasterContourRenderer::contourInterval
double contourInterval() const
Returns the interval of contour lines generation.
Definition:
qgsrastercontourrenderer.h:61
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
QgsRasterContourRenderer::inputBand
int inputBand() const
Returns the number of the input raster band.
Definition:
qgsrastercontourrenderer.h:56
QgsRectangle
Definition:
qgsrectangle.h:41
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
QgsRasterContourRendererWidget::renderer
QgsRasterRenderer * renderer() override
Definition:
qgsrastercontourrendererwidget.cpp:63
QgsRasterRenderer
Definition:
qgsrasterrenderer.h:38
QgsRasterContourRenderer
Definition:
qgsrastercontourrenderer.h:30
QgsRasterContourRenderer::setContourIndexSymbol
void setContourIndexSymbol(QgsLineSymbol *symbol)
Sets the symbol of index contour lines.
Definition:
qgsrastercontourrenderer.cpp:223
QgsLineSymbol
Definition:
qgssymbol.h:1117
QgsRasterLayer
Definition:
qgsrasterlayer.h:72
qgsrastercontourrendererwidget.h
QgsRasterContourRenderer::downscale
double downscale() const
Returns by how much the renderer will scale down the request to the data provider.
Definition:
qgsrastercontourrenderer.h:86
qgsrastercontourrenderer.h
QgsSymbol::Line
@ Line
Line symbol.
Definition:
qgssymbol.h:88
QgsRasterLayer::renderer
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
Definition:
qgsrasterlayer.h:247
QgsRasterRendererWidget
Definition:
qgsrasterrendererwidget.h:36
QgsRasterRendererWidget::widgetChanged
void widgetChanged()
Emitted when something on the widget has changed.
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
QgsRasterDataProvider
Definition:
qgsrasterdataprovider.h:88
QgsRasterContourRendererWidget::QgsRasterContourRendererWidget
QgsRasterContourRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent=QgsRectangle())
Constructs the widget.
Definition:
qgsrastercontourrendererwidget.cpp:22
QgsRasterLayer::dataProvider
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
Definition:
qgsrasterlayer.cpp:233
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17