QGIS API Documentation  2.3.0-Master
 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>

Inheritance diagram for QgsRasterHistogramWidget:
Inheritance graph
[legend]
Collaboration diagram for QgsRasterHistogramWidget:
Collaboration graph
[legend]

Public Slots

void refreshHistogram ()
 slot executed when user wishes to refresh raster histogramwidget More...
 
void on_mSaveAsImageButton_clicked ()
 This slot lets you save the histogram as an image to disk. More...
 

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. More...
 
void setRendererWidget (const QString &name, QgsRasterRendererWidget *rendererWidget=NULL)
 Set the renderer widget (or just its name if there is no widget) More...
 
void setActive (bool theActiveFlag)
 Activate the histogram widget. More...
 
bool computeHistogram (bool forceComputeFlag)
 Compute the histogram on demand. More...
 
void histoAction (const QString actionName, bool actionFlag=true)
 Apply a histoActionTriggered() event. More...
 
void setSelectedBand (int index)
 Apply a histoActionTriggered() event. More...
 

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. More...
 
void applyHistoMin ()
 Applies the selected min/max values to the renderer widget. More...
 
void applyHistoMax ()
 
void on_btnHistoMin_toggled ()
 Button to activate picking of the min/max value on the graph. More...
 
void on_btnHistoMax_toggled ()
 
void histoPickerSelected (const QPointF &)
 Called when a selection has been made using the plot picker. More...
 
void histoPickerSelectedQwt5 (const QwtDoublePoint &)
 Called when a selection has been made using the plot picker (for qwt5 only). More...
 
void histoActionTriggered (QAction *)
 Various actions that are stored in btnHistoActions. More...
 
void updateHistoMarkers ()
 Draw the min/max markers on the histogram plot. More...
 
void on_btnHistoCompute_clicked ()
 Button to compute the histogram, appears when no cached histogram is available. More...
 

Private Member Functions

QList< int > histoSelectedBands ()
 Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction. More...
 
QList< int > rendererSelectedBands ()
 Returns a list of selected bands in the renderer widget. More...
 
QPair< QString, QString > rendererMinMax (int theBandNo)
 

Private Attributes

QgsRasterLayermRasterLayer
 Pointer to the raster layer that this property dilog changes the behaviour of. More...
 
QgsRasterRendererWidgetmRendererWidget
 Pointer to the renderer widget, to get/set min/max. More...
 
QString mRendererName
 Name of the renderer widget (see QgsRasterRendererRegistry). More...
 
QwtPlotPicker * mHistoPicker
 
QwtPlotZoomer * mHistoZoomer
 
QwtPlotMarker * mHistoMarkerMin
 
QwtPlotMarker * mHistoMarkerMax
 
double mHistoMin
 
double mHistoMax
 
QVector< QColor > mHistoColors
 
bool mHistoShowMarkers
 
bool mHistoZoomToMinMax
 
bool mHistoUpdateStyleToMinMax
 
bool mHistoDrawLines
 
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 241 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 762 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 1068 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 1095 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 680 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 1145 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 269 of file qgsrasterhistogramwidget.cpp.

References computeHistogram(), and refreshHistogram().

Referenced by histoAction().

void QgsRasterHistogramWidget::on_btnHistoMax_toggled ( )
privateslot

Definition at line 1016 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 998 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 737 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 665 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 1164 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 253 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 245 of file qgsrasterhistogramwidget.cpp.

References mRendererName, mRendererWidget, on_cboHistoBand_currentIndexChanged(), and refreshHistogram().

void QgsRasterHistogramWidget::setSelectedBand ( int  index)

Apply a histoActionTriggered() event.

Definition at line 732 of file qgsrasterhistogramwidget.cpp.

void QgsRasterHistogramWidget::updateHistoMarkers ( )
privateslot

Member Data Documentation

QVector<QColor> QgsRasterHistogramWidget::mHistoColors
private
bool QgsRasterHistogramWidget::mHistoDrawLines
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: