QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
raster
qgsrasterhistogramwidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrasterrendererwidget.h
3
---------------------------
4
begin : July 2012
5
copyright : (C) 2012 by Etienne Tourigny
6
email : etourigny dot dev at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSRASTERHISTOGRAMWIDGET_H
18
#define QGSRASTERHISTOGRAMWIDGET_H
19
20
#include "ui_qgsrasterhistogramwidgetbase.h"
21
22
#include "
qgis.h
"
23
#include "qgis_gui.h"
24
#include "
qgis_sip.h
"
25
#include "
qgsmaplayerconfigwidget.h
"
26
27
class
QgsRasterLayer
;
28
class
QgsRasterRendererWidget
;
29
class
QwtPlotPicker;
30
class
QwtPlotMarker;
31
class
QwtPlotZoomer;
32
33
// fix for qwt5/qwt6 QwtDoublePoint vs. QPointF
34
typedef
QPointF
QwtDoublePoint
SIP_SKIP
;
35
40
class
GUI_EXPORT
QgsRasterHistogramWidget
:
public
QgsMapLayerConfigWidget
,
private
Ui::QgsRasterHistogramWidgetBase
41
{
42
Q_OBJECT
43
44
public
:
48
QgsRasterHistogramWidget
(
QgsRasterLayer
*
layer
, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
49
51
bool
histoSaveAsImage
(
const
QString &filename,
int
width = 600,
int
height = 600,
int
quality = -1 );
52
54
void
setRendererWidget
(
const
QString &name,
QgsRasterRendererWidget
*rendererWidget =
nullptr
);
55
57
void
setActive
(
bool
activeFlag );
58
60
bool
computeHistogram
(
bool
forceComputeFlag );
61
63
void
histoAction
(
const
QString &actionName,
bool
actionFlag =
true
);
64
66
void
setSelectedBand
(
int
index );
67
68
public
slots:
70
void
refreshHistogram
();
71
72
void
apply
()
override
;
73
74
private
slots:
76
void
mSaveAsImageButton_clicked();
78
void
cboHistoBand_currentIndexChanged(
int
);
80
void
applyHistoMin();
81
void
applyHistoMax();
83
void
btnHistoMin_toggled();
84
void
btnHistoMax_toggled();
86
void
histoPickerSelected( QPointF );
87
92
void
histoPickerSelectedQwt5(
QwtDoublePoint
)
SIP_SKIP
;
94
void
histoActionTriggered( QAction * );
96
void
updateHistoMarkers();
98
void
btnHistoCompute_clicked();
99
100
private
:
101
enum
HistoShowBands
102
{
103
ShowAll = 0,
104
ShowSelected = 1,
105
ShowRGB = 2
106
};
107
109
QgsRasterLayer
*mRasterLayer =
nullptr
;
111
QgsRasterRendererWidget
*mRendererWidget =
nullptr
;
113
QString mRendererName;
114
115
QwtPlotPicker *mHistoPicker =
nullptr
;
116
QwtPlotZoomer *mHistoZoomer =
nullptr
;
117
QwtPlotMarker *mHistoMarkerMin =
nullptr
;
118
QwtPlotMarker *mHistoMarkerMax =
nullptr
;
119
double
mHistoMin;
120
double
mHistoMax;
121
QVector<QColor> mHistoColors;
122
bool
mHistoShowMarkers;
123
bool
mHistoZoomToMinMax;
124
bool
mHistoUpdateStyleToMinMax;
125
bool
mHistoDrawLines;
126
/* bool mHistoLoadApplyAll; */
127
HistoShowBands mHistoShowBands;
129
QList<int> histoSelectedBands();
131
QList<int> rendererSelectedBands();
132
QPair<QString, QString> rendererMinMax(
int
bandNo );
133
};
134
#endif
QgsMapLayerConfigWidget::QgsMapLayerConfigWidget
QgsMapLayerConfigWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
A panel widget that can be shown in the map style dock.
Definition
qgsmaplayerconfigwidget.cpp:40
QgsMapLayerConfigWidget::apply
virtual void apply()=0
Called when changes to the layer need to be made.
QgsMapLayerConfigWidget::layer
QgsMapLayer * layer()
Returns the layer the widget is associated with.
Definition
qgsmaplayerconfigwidget.cpp:46
QgsRasterHistogramWidget::setRendererWidget
void setRendererWidget(const QString &name, QgsRasterRendererWidget *rendererWidget=nullptr)
Sets the renderer widget (or just its name if there is no widget).
Definition
qgsrasterhistogramwidget.cpp:258
QgsRasterHistogramWidget::setSelectedBand
void setSelectedBand(int index)
Apply a histoActionTriggered() event.
Definition
qgsrasterhistogramwidget.cpp:710
QgsRasterHistogramWidget::QgsRasterHistogramWidget
QgsRasterHistogramWidget(QgsRasterLayer *layer, QWidget *parent=nullptr)
Constructor for QgsRasterHistogramWidget, for the specified raster layer.
Definition
qgsrasterhistogramwidget.cpp:63
QgsRasterHistogramWidget::refreshHistogram
void refreshHistogram()
slot executed when user wishes to refresh raster histogramwidget
Definition
qgsrasterhistogramwidget.cpp:376
QgsRasterHistogramWidget::histoAction
void histoAction(const QString &actionName, bool actionFlag=true)
Apply a histoActionTriggered() event.
Definition
qgsrasterhistogramwidget.cpp:747
QgsRasterHistogramWidget::setActive
void setActive(bool activeFlag)
Activate the histogram widget.
Definition
qgsrasterhistogramwidget.cpp:266
QgsRasterHistogramWidget::computeHistogram
bool computeHistogram(bool forceComputeFlag)
Compute the histogram on demand.
Definition
qgsrasterhistogramwidget.cpp:333
QgsRasterHistogramWidget::histoSaveAsImage
bool histoSaveAsImage(const QString &filename, int width=600, int height=600, int quality=-1)
Save the histogram as an image to disk.
Definition
qgsrasterhistogramwidget.cpp:678
QgsRasterLayer
Represents a raster layer.
Definition
qgsrasterlayer.h:82
QgsRasterRendererWidget
Abstract base class for widgets which configure a QgsRasterRenderer.
Definition
qgsrasterrendererwidget.h:40
qgis.h
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
QwtDoublePoint
QPointF QwtDoublePoint
Definition
qgscurveeditorwidget.h:40
qgsmaplayerconfigwidget.h
Generated on
for QGIS API Documentation by
1.17.0