QGIS API Documentation  master-6227475
QgsRasterHistogramWidget Class Reference

Histogram widget. More...

#include <qgsrasterhistogramwidget.h>

+ Collaboration diagram for QgsRasterHistogramWidget:

List of all members.

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
QgsRasterLayermRasterLayer
 Pointer to the raster layer that this property dilog changes the behaviour of.
QString mRendererName
 Name of the renderer widget (see QgsRasterRendererRegistry).
QgsRasterRendererWidgetmRendererWidget
 Pointer to the renderer widget, to get/set min/max.

Detailed Description

Histogram widget.

Author:
Etienne Tourigny

Definition at line 37 of file qgsrasterhistogramwidget.h.


Member Enumeration Documentation

Enumerator:
ShowAll 
ShowSelected 
ShowRGB 

Definition at line 93 of file qgsrasterhistogramwidget.h.


Constructor & Destructor Documentation


Member Function Documentation

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).

Note:
not available in python bindings

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().

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().

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().

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().

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().

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.

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().

Apply a histoActionTriggered() event.

Definition at line 625 of file qgsrasterhistogramwidget.cpp.


Member Data Documentation

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines