QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | List of all members
QgsRasterHistogramWidget Class Reference

Histogram widget. More...

#include <qgsrasterhistogramwidget.h>

Collaboration diagram for QgsRasterHistogramWidget:
Collaboration graph
[legend]

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

QgsRasterLayermRasterLayer
 Pointer to the raster layer that this property dilog changes the behaviour of.
QgsRasterRendererWidgetmRendererWidget
 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

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

QgsRasterHistogramWidget::QgsRasterHistogramWidget ( QgsRasterLayer lyr,
QWidget *  parent = 0 
)
QgsRasterHistogramWidget::~QgsRasterHistogramWidget ( )

Definition at line 204 of file qgsrasterhistogramwidget.cpp.

Member Function Documentation

void QgsRasterHistogramWidget::applyHistoMax ( )
privateslot
void QgsRasterHistogramWidget::applyHistoMin ( )
privateslot
bool QgsRasterHistogramWidget::computeHistogram ( bool  forceComputeFlag)
void QgsRasterHistogramWidget::histoAction ( const QString  actionName,
bool  actionFlag = true 
)
void QgsRasterHistogramWidget::histoActionTriggered ( QAction *  action)
privateslot

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

void QgsRasterHistogramWidget::histoPickerSelectedQwt5 ( const QwtDoublePoint &  pos)
privateslot

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

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

void QgsRasterHistogramWidget::on_btnHistoMax_toggled ( )
privateslot

Definition at line 901 of file qgsrasterhistogramwidget.cpp.

References mHistoPicker, mHistoZoomer, and updateHistoMarkers().

void QgsRasterHistogramWidget::on_btnHistoMin_toggled ( )
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().

void QgsRasterHistogramWidget::on_cboHistoBand_currentIndexChanged ( int  index)
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().

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
QPair< QString, QString > QgsRasterHistogramWidget::rendererMinMax ( int  theBandNo)
private
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 ( )
privateslot

Member Data Documentation

QVector<QColor> QgsRasterHistogramWidget::mHistoColors
private
QwtPlotMarker* QgsRasterHistogramWidget::mHistoMarkerMax
private
QwtPlotMarker* QgsRasterHistogramWidget::mHistoMarkerMin
private
double QgsRasterHistogramWidget::mHistoMax
private
double QgsRasterHistogramWidget::mHistoMin
private
QwtPlotPicker* QgsRasterHistogramWidget::mHistoPicker
private
HistoShowBands QgsRasterHistogramWidget::mHistoShowBands
private
bool QgsRasterHistogramWidget::mHistoShowMarkers
private
bool QgsRasterHistogramWidget::mHistoUpdateStyleToMinMax
private
QwtPlotZoomer* QgsRasterHistogramWidget::mHistoZoomer
private
bool QgsRasterHistogramWidget::mHistoZoomToMinMax
private
QgsRasterLayer* QgsRasterHistogramWidget::mRasterLayer
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().

QString QgsRasterHistogramWidget::mRendererName
private
QgsRasterRendererWidget* QgsRasterHistogramWidget::mRendererWidget
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().


The documentation for this class was generated from the following files: