|
QGIS API Documentation
master-6227475
|
Histogram widget. More...
#include <qgsrasterhistogramwidget.h>
Collaboration diagram for QgsRasterHistogramWidget:Public Slots | |
| void | on_mSaveAsImageButton_clicked () |
| This slot lets you save the histogram as an image to disk. | |
| void | refreshHistogram () |
| slot executed when user wishes to refresh raster histogramwidget | |
Public Member Functions | |
| QgsRasterHistogramWidget (QgsRasterLayer *lyr, QWidget *parent=0) | |
| ~QgsRasterHistogramWidget () | |
| bool | computeHistogram (bool forceComputeFlag) |
| Compute the histogram on demand. | |
| void | histoAction (const QString actionName, bool actionFlag=true) |
| Apply a histoActionTriggered() event. | |
| bool | histoSaveAsImage (const QString &theFilename, int width=600, int height=600, int quality=-1) |
| Save the histogram as an image to disk. | |
| void | setActive (bool theActiveFlag) |
| Activate the histogram widget. | |
| void | setRendererWidget (const QString &name, QgsRasterRendererWidget *rendererWidget=NULL) |
| Set the renderer widget (or just its name if there is no widget) | |
| void | setSelectedBand (int index) |
| Apply a histoActionTriggered() event. | |
Private Types | |
| enum | HistoShowBands { ShowAll = 0, ShowSelected = 1, ShowRGB = 2 } |
Private Slots | |
| void | applyHistoMax () |
| void | applyHistoMin () |
| Applies the selected min/max values to the renderer widget. | |
| void | histoActionTriggered (QAction *) |
| Various actions that are stored in btnHistoActions. | |
| void | histoPickerSelected (const QPointF &) |
| Called when a selection has been made using the plot picker. | |
| void | histoPickerSelectedQwt5 (const QwtDoublePoint &) |
| Called when a selection has been made using the plot picker (for qwt5 only). | |
| void | on_btnHistoCompute_clicked () |
| Button to compute the histogram, appears when no cached histogram is available. | |
| void | on_btnHistoMax_toggled () |
| void | on_btnHistoMin_toggled () |
| Button to activate picking of the min/max value on the graph. | |
| void | on_cboHistoBand_currentIndexChanged (int) |
| Used when the histogram band selector changes, or when tab is loaded. | |
| void | updateHistoMarkers () |
| Draw the min/max markers on the histogram plot. | |
Private Member Functions | |
| QList< int > | histoSelectedBands () |
| Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction. | |
| QPair< QString, QString > | rendererMinMax (int theBandNo) |
| QList< int > | rendererSelectedBands () |
| Returns a list of selected bands in the renderer widget. | |
Private Attributes | |
| QVector< QColor > | mHistoColors |
| QwtPlotMarker * | mHistoMarkerMax |
| QwtPlotMarker * | mHistoMarkerMin |
| double | mHistoMax |
| double | mHistoMin |
| QwtPlotPicker * | mHistoPicker |
| HistoShowBands | mHistoShowBands |
| bool | mHistoShowMarkers |
| bool | mHistoUpdateStyleToMinMax |
| QwtPlotZoomer * | mHistoZoomer |
| bool | mHistoZoomToMinMax |
| QgsRasterLayer * | mRasterLayer |
| Pointer to the raster layer that this property dilog changes the behaviour of. | |
| QString | mRendererName |
| Name of the renderer widget (see QgsRasterRendererRegistry). | |
| QgsRasterRendererWidget * | mRendererWidget |
| Pointer to the renderer widget, to get/set min/max. | |
Histogram widget.
Definition at line 37 of file qgsrasterhistogramwidget.h.
enum QgsRasterHistogramWidget::HistoShowBands [private] |
Definition at line 93 of file qgsrasterhistogramwidget.h.
| QgsRasterHistogramWidget::QgsRasterHistogramWidget | ( | QgsRasterLayer * | lyr, |
| QWidget * | parent = 0 |
||
| ) |
Definition at line 48 of file qgsrasterhistogramwidget.cpp.
References applyHistoMax(), applyHistoMin(), QgsRasterLayer::bandCount(), QgsRasterLayer::bandName(), QgsApplication::getThemeIcon(), histoActionTriggered(), mHistoMarkerMax, mHistoMarkerMin, mHistoMax, mHistoMin, mHistoPicker, mHistoShowBands, mHistoShowMarkers, mHistoUpdateStyleToMinMax, mHistoZoomer, mHistoZoomToMinMax, mRasterLayer, mRendererName, mRendererWidget, ShowAll, ShowRGB, ShowSelected, and tr.
Definition at line 204 of file qgsrasterhistogramwidget.cpp.
| void QgsRasterHistogramWidget::applyHistoMax | ( | ) | [private, slot] |
Definition at line 855 of file qgsrasterhistogramwidget.cpp.
References MathUtils::max(), mHistoUpdateStyleToMinMax, mHistoZoomer, mHistoZoomToMinMax, mRendererWidget, rendererSelectedBands(), QgsRasterRendererWidget::selectedBand(), QgsRasterRendererWidget::setMax(), and updateHistoMarkers().
Referenced by histoAction(), histoPickerSelected(), on_cboHistoBand_currentIndexChanged(), and QgsRasterHistogramWidget().
| void QgsRasterHistogramWidget::applyHistoMin | ( | ) | [private, slot] |
Applies the selected min/max values to the renderer widget.
Definition at line 826 of file qgsrasterhistogramwidget.cpp.
References mHistoUpdateStyleToMinMax, mHistoZoomer, mHistoZoomToMinMax, MathUtils::min(), mRendererWidget, rendererSelectedBands(), QgsRasterRendererWidget::selectedBand(), QgsRasterRendererWidget::setMin(), and updateHistoMarkers().
Referenced by histoAction(), histoPickerSelected(), on_cboHistoBand_currentIndexChanged(), and QgsRasterHistogramWidget().
| bool QgsRasterHistogramWidget::computeHistogram | ( | bool | forceComputeFlag | ) |
Compute the histogram on demand.
Definition at line 242 of file qgsrasterhistogramwidget.cpp.
References QgsRasterLayer::bandCount(), QgsRasterLayer::dataProvider(), QgsRasterInterface::hasHistogram(), QgsRasterInterface::histogram(), mRasterLayer, QgsDebugMsg, and RASTER_HISTOGRAM_BINS.
Referenced by on_btnHistoCompute_clicked(), and refreshHistogram().
| void QgsRasterHistogramWidget::histoAction | ( | const QString | actionName, |
| bool | actionFlag = true |
||
| ) |
Apply a histoActionTriggered() event.
Definition at line 662 of file qgsrasterhistogramwidget.cpp.
References QgsRasterRendererWidget::Actual, applyHistoMax(), applyHistoMin(), QgsRasterLayer::bandCount(), QgsRasterRendererWidget::CurrentExtent, QgsRasterLayer::dataProvider(), QgsRasterDataProvider::dataType(), QgsRasterRendererWidget::Estimate, QgsContrastEnhancement::maximumValuePossible(), mHistoShowBands, mHistoShowMarkers, mHistoUpdateStyleToMinMax, mHistoZoomToMinMax, QgsContrastEnhancement::minimumValuePossible(), mRasterLayer, mRendererWidget, on_btnHistoCompute_clicked(), QgsDebugMsg, refreshHistogram(), ShowAll, ShowRGB, ShowSelected, and updateHistoMarkers().
Referenced by histoActionTriggered().
| void QgsRasterHistogramWidget::histoActionTriggered | ( | QAction * | action | ) | [private, slot] |
Various actions that are stored in btnHistoActions.
Definition at line 655 of file qgsrasterhistogramwidget.cpp.
References histoAction().
Referenced by QgsRasterHistogramWidget().
| void QgsRasterHistogramWidget::histoPickerSelected | ( | const QPointF & | pos | ) | [private, slot] |
Called when a selection has been made using the plot picker.
Definition at line 953 of file qgsrasterhistogramwidget.cpp.
References applyHistoMax(), applyHistoMin(), and findClosestTickVal().
Referenced by histoPickerSelectedQwt5(), and refreshHistogram().
| void QgsRasterHistogramWidget::histoPickerSelectedQwt5 | ( | const QwtDoublePoint & | pos | ) | [private, slot] |
Called when a selection has been made using the plot picker (for qwt5 only).
Definition at line 980 of file qgsrasterhistogramwidget.cpp.
References histoPickerSelected().
Referenced by refreshHistogram().
| bool QgsRasterHistogramWidget::histoSaveAsImage | ( | const QString & | theFilename, |
| int | width = 600, |
||
| int | height = 600, |
||
| int | quality = -1 |
||
| ) |
Save the histogram as an image to disk.
Definition at line 573 of file qgsrasterhistogramwidget.cpp.
References QgsDebugMsg, and refreshHistogram().
Referenced by on_mSaveAsImageButton_clicked().
| QList< int > QgsRasterHistogramWidget::histoSelectedBands | ( | ) | [private] |
Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction.
Definition at line 1030 of file qgsrasterhistogramwidget.cpp.
References mHistoShowBands, rendererSelectedBands(), ShowAll, ShowRGB, and ShowSelected.
Referenced by refreshHistogram(), and updateHistoMarkers().
| void QgsRasterHistogramWidget::on_btnHistoCompute_clicked | ( | ) | [private, slot] |
Button to compute the histogram, appears when no cached histogram is available.
Definition at line 232 of file qgsrasterhistogramwidget.cpp.
References computeHistogram(), and refreshHistogram().
Referenced by histoAction().
| void QgsRasterHistogramWidget::on_btnHistoMax_toggled | ( | ) | [private, slot] |
Definition at line 901 of file qgsrasterhistogramwidget.cpp.
References mHistoPicker, mHistoZoomer, and updateHistoMarkers().
| void QgsRasterHistogramWidget::on_btnHistoMin_toggled | ( | ) | [private, slot] |
Button to activate picking of the min/max value on the graph.
Definition at line 883 of file qgsrasterhistogramwidget.cpp.
References mHistoPicker, mHistoZoomer, and updateHistoMarkers().
| void QgsRasterHistogramWidget::on_cboHistoBand_currentIndexChanged | ( | int | index | ) | [private, slot] |
Used when the histogram band selector changes, or when tab is loaded.
Definition at line 630 of file qgsrasterhistogramwidget.cpp.
References applyHistoMax(), applyHistoMin(), mHistoColors, mHistoPicker, mHistoShowBands, mHistoZoomer, refreshHistogram(), rendererMinMax(), and ShowSelected.
Referenced by setActive(), and setRendererWidget().
| void QgsRasterHistogramWidget::on_mSaveAsImageButton_clicked | ( | ) | [slot] |
This slot lets you save the histogram as an image to disk.
Definition at line 558 of file qgsrasterhistogramwidget.cpp.
References QgisGui::getSaveAsImageName(), histoSaveAsImage(), and tr.
| void QgsRasterHistogramWidget::refreshHistogram | ( | ) | [slot] |
slot executed when user wishes to refresh raster histogramwidget
Definition at line 289 of file qgsrasterhistogramwidget.cpp.
References QgsRasterLayer::bandCount(), QGis::Byte, computeHistogram(), QgsRasterLayer::dataProvider(), QgsApplication::getThemePixmap(), QgsRasterInterface::histogram(), QgsRasterHistogram::histogramVector, histoPickerSelected(), histoPickerSelectedQwt5(), histoSelectedBands(), QgsRasterHistogram::maximum, mHistoColors, mHistoMarkerMax, mHistoMarkerMin, mHistoMax, mHistoMin, mHistoPicker, mHistoShowBands, mHistoZoomer, QgsRasterHistogram::minimum, mRasterLayer, mRendererName, QgsDebugMsg, RASTER_HISTOGRAM_BINS, rendererSelectedBands(), ShowAll, QgsRasterDataProvider::srcDataType(), tr, and updateHistoMarkers().
Referenced by histoAction(), histoSaveAsImage(), on_btnHistoCompute_clicked(), on_cboHistoBand_currentIndexChanged(), setActive(), and setRendererWidget().
| QPair< QString, QString > QgsRasterHistogramWidget::rendererMinMax | ( | int | theBandNo | ) | [private] |
Definition at line 1074 of file qgsrasterhistogramwidget.cpp.
References QgsRasterRendererWidget::max(), mHistoMax, mHistoMin, QgsRasterRendererWidget::min(), mRendererName, mRendererWidget, QgsDebugMsg, and QgsRasterRendererWidget::selectedBand().
Referenced by on_cboHistoBand_currentIndexChanged().
| QList< int > QgsRasterHistogramWidget::rendererSelectedBands | ( | ) | [private] |
Returns a list of selected bands in the renderer widget.
Definition at line 1049 of file qgsrasterhistogramwidget.cpp.
References mRendererName, mRendererWidget, and QgsRasterRendererWidget::selectedBand().
Referenced by applyHistoMax(), applyHistoMin(), histoSelectedBands(), and refreshHistogram().
| void QgsRasterHistogramWidget::setActive | ( | bool | theActiveFlag | ) |
Activate the histogram widget.
Definition at line 216 of file qgsrasterhistogramwidget.cpp.
References on_cboHistoBand_currentIndexChanged(), and refreshHistogram().
| void QgsRasterHistogramWidget::setRendererWidget | ( | const QString & | name, |
| QgsRasterRendererWidget * | rendererWidget = NULL |
||
| ) |
Set the renderer widget (or just its name if there is no widget)
Definition at line 208 of file qgsrasterhistogramwidget.cpp.
References mRendererName, mRendererWidget, on_cboHistoBand_currentIndexChanged(), and refreshHistogram().
| void QgsRasterHistogramWidget::setSelectedBand | ( | int | index | ) |
Apply a histoActionTriggered() event.
Definition at line 625 of file qgsrasterhistogramwidget.cpp.
| void QgsRasterHistogramWidget::updateHistoMarkers | ( | ) | [private, slot] |
Draw the min/max markers on the histogram plot.
Definition at line 985 of file qgsrasterhistogramwidget.cpp.
References histoSelectedBands(), mHistoColors, mHistoMarkerMax, mHistoMarkerMin, mHistoMax, mHistoMin, and mHistoShowMarkers.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), on_btnHistoMax_toggled(), on_btnHistoMin_toggled(), and refreshHistogram().
QVector<QColor> QgsRasterHistogramWidget::mHistoColors [private] |
Definition at line 113 of file qgsrasterhistogramwidget.h.
Referenced by on_cboHistoBand_currentIndexChanged(), refreshHistogram(), and updateHistoMarkers().
QwtPlotMarker* QgsRasterHistogramWidget::mHistoMarkerMax [private] |
Definition at line 110 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), and updateHistoMarkers().
QwtPlotMarker* QgsRasterHistogramWidget::mHistoMarkerMin [private] |
Definition at line 109 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), and updateHistoMarkers().
double QgsRasterHistogramWidget::mHistoMax [private] |
Definition at line 112 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), and updateHistoMarkers().
double QgsRasterHistogramWidget::mHistoMin [private] |
Definition at line 111 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), and updateHistoMarkers().
QwtPlotPicker* QgsRasterHistogramWidget::mHistoPicker [private] |
Definition at line 107 of file qgsrasterhistogramwidget.h.
Referenced by on_btnHistoMax_toggled(), on_btnHistoMin_toggled(), on_cboHistoBand_currentIndexChanged(), QgsRasterHistogramWidget(), and refreshHistogram().
Definition at line 118 of file qgsrasterhistogramwidget.h.
Referenced by histoAction(), histoSelectedBands(), on_cboHistoBand_currentIndexChanged(), QgsRasterHistogramWidget(), and refreshHistogram().
bool QgsRasterHistogramWidget::mHistoShowMarkers [private] |
Definition at line 114 of file qgsrasterhistogramwidget.h.
Referenced by histoAction(), QgsRasterHistogramWidget(), and updateHistoMarkers().
bool QgsRasterHistogramWidget::mHistoUpdateStyleToMinMax [private] |
Definition at line 116 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), and QgsRasterHistogramWidget().
QwtPlotZoomer* QgsRasterHistogramWidget::mHistoZoomer [private] |
Definition at line 108 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), on_btnHistoMax_toggled(), on_btnHistoMin_toggled(), on_cboHistoBand_currentIndexChanged(), QgsRasterHistogramWidget(), and refreshHistogram().
bool QgsRasterHistogramWidget::mHistoZoomToMinMax [private] |
Definition at line 115 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), and QgsRasterHistogramWidget().
Pointer to the raster layer that this property dilog changes the behaviour of.
Definition at line 101 of file qgsrasterhistogramwidget.h.
Referenced by computeHistogram(), histoAction(), QgsRasterHistogramWidget(), and refreshHistogram().
QString QgsRasterHistogramWidget::mRendererName [private] |
Name of the renderer widget (see QgsRasterRendererRegistry).
Definition at line 105 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), rendererSelectedBands(), and setRendererWidget().
Pointer to the renderer widget, to get/set min/max.
Definition at line 103 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), QgsRasterHistogramWidget(), rendererMinMax(), rendererSelectedBands(), and setRendererWidget().