QGIS API Documentation
2.0.1-Dufour
|
Histogram widget. More...
#include <qgsrasterhistogramwidget.h>
Public Slots | |
void | refreshHistogram () |
slot executed when user wishes to refresh raster histogramwidget | |
void | on_mSaveAsImageButton_clicked () |
This slot lets you save the histogram as an image to disk. |
Public Member Functions | |
QgsRasterHistogramWidget (QgsRasterLayer *lyr, QWidget *parent=0) | |
~QgsRasterHistogramWidget () | |
bool | histoSaveAsImage (const QString &theFilename, int width=600, int height=600, int quality=-1) |
Save the histogram as an image to disk. | |
void | setRendererWidget (const QString &name, QgsRasterRendererWidget *rendererWidget=NULL) |
Set the renderer widget (or just its name if there is no widget) | |
void | setActive (bool theActiveFlag) |
Activate the histogram widget. | |
bool | computeHistogram (bool forceComputeFlag) |
Compute the histogram on demand. | |
void | histoAction (const QString actionName, bool actionFlag=true) |
Apply a histoActionTriggered() event. | |
void | setSelectedBand (int index) |
Apply a histoActionTriggered() event. |
Private Types | |
enum | HistoShowBands { ShowAll = 0, ShowSelected = 1, ShowRGB = 2 } |
Private Slots | |
void | on_cboHistoBand_currentIndexChanged (int) |
Used when the histogram band selector changes, or when tab is loaded. | |
void | applyHistoMin () |
Applies the selected min/max values to the renderer widget. | |
void | applyHistoMax () |
void | on_btnHistoMin_toggled () |
Button to activate picking of the min/max value on the graph. | |
void | on_btnHistoMax_toggled () |
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 | histoActionTriggered (QAction *) |
Various actions that are stored in btnHistoActions. | |
void | updateHistoMarkers () |
Draw the min/max markers on the histogram plot. | |
void | on_btnHistoCompute_clicked () |
Button to compute the histogram, appears when no cached histogram is available. |
Private Member Functions | |
QList< int > | histoSelectedBands () |
Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction. | |
QList< int > | rendererSelectedBands () |
Returns a list of selected bands in the renderer widget. | |
QPair< QString, QString > | rendererMinMax (int theBandNo) |
Private Attributes | |
QgsRasterLayer * | mRasterLayer |
Pointer to the raster layer that this property dilog changes the behaviour of. | |
QgsRasterRendererWidget * | mRendererWidget |
Pointer to the renderer widget, to get/set min/max. | |
QString | mRendererName |
Name of the renderer widget (see QgsRasterRendererRegistry). | |
QwtPlotPicker * | mHistoPicker |
QwtPlotZoomer * | mHistoZoomer |
QwtPlotMarker * | mHistoMarkerMin |
QwtPlotMarker * | mHistoMarkerMax |
double | mHistoMin |
double | mHistoMax |
QVector< QColor > | mHistoColors |
bool | mHistoShowMarkers |
bool | mHistoZoomToMinMax |
bool | mHistoUpdateStyleToMinMax |
HistoShowBands | mHistoShowBands |
Histogram widget.
Definition at line 37 of file qgsrasterhistogramwidget.h.
|
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.
QgsRasterHistogramWidget::~QgsRasterHistogramWidget | ( | ) |
Definition at line 204 of file qgsrasterhistogramwidget.cpp.
|
privateslot |
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().
|
privateslot |
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().
|
privateslot |
Various actions that are stored in btnHistoActions.
Definition at line 655 of file qgsrasterhistogramwidget.cpp.
References histoAction().
Referenced by QgsRasterHistogramWidget().
|
privateslot |
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().
|
privateslot |
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().
|
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().
|
privateslot |
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().
|
privateslot |
Definition at line 901 of file qgsrasterhistogramwidget.cpp.
References mHistoPicker, mHistoZoomer, and updateHistoMarkers().
|
privateslot |
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().
|
privateslot |
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().
|
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.
|
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().
|
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().
|
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.
|
privateslot |
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().
|
private |
Definition at line 113 of file qgsrasterhistogramwidget.h.
Referenced by on_cboHistoBand_currentIndexChanged(), refreshHistogram(), and updateHistoMarkers().
|
private |
Definition at line 110 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), and updateHistoMarkers().
|
private |
Definition at line 109 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), and updateHistoMarkers().
|
private |
Definition at line 112 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), and updateHistoMarkers().
|
private |
Definition at line 111 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), and updateHistoMarkers().
|
private |
Definition at line 107 of file qgsrasterhistogramwidget.h.
Referenced by on_btnHistoMax_toggled(), on_btnHistoMin_toggled(), on_cboHistoBand_currentIndexChanged(), QgsRasterHistogramWidget(), and refreshHistogram().
|
private |
Definition at line 118 of file qgsrasterhistogramwidget.h.
Referenced by histoAction(), histoSelectedBands(), on_cboHistoBand_currentIndexChanged(), QgsRasterHistogramWidget(), and refreshHistogram().
|
private |
Definition at line 114 of file qgsrasterhistogramwidget.h.
Referenced by histoAction(), QgsRasterHistogramWidget(), and updateHistoMarkers().
|
private |
Definition at line 116 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), and QgsRasterHistogramWidget().
|
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().
|
private |
Definition at line 115 of file qgsrasterhistogramwidget.h.
Referenced by applyHistoMax(), applyHistoMin(), histoAction(), and QgsRasterHistogramWidget().
|
private |
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().
|
private |
Name of the renderer widget (see QgsRasterRendererRegistry).
Definition at line 105 of file qgsrasterhistogramwidget.h.
Referenced by QgsRasterHistogramWidget(), refreshHistogram(), rendererMinMax(), rendererSelectedBands(), and setRendererWidget().
|
private |
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().