Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

SpectrumWidget Class Reference
[Spectrum visualizaion widgets]

#include <OpenMS/VISUAL/SpectrumWidget.h>

Inheritance diagram for SpectrumWidget:

QWidget Spectrum1DWidget Spectrum2DWidget Spectrum3DWidget

List of all members.


Detailed Description

Base class for spectrum widgets.

This class is the base class for the different MDI window types in the TOPPView application. For each type of spectrum view (such as 1D view, 2D view etc.), there must exist a corresponding class derived from this class.

To integrate a new spectrum view (i.e. classes derived from SpectrumWidget and SpectrumCanvas) into the TOPPView application, a class must be derived from this class which holds an instance of the SpectrumCanvas class as a child widget.

This Widget also provides axis widgets and scrollbars.

Public Slots

void showStatistics ()
 Shows statistics about the data (count,min,max,avg of Intensity, Charge, Quality and meta data).
void showIntensityDistribution ()
 Shows the intensity distribution of the data.
void updateAxes ()
 Updates the axes by setting the right labels and calling recalculateAxes_();.
void updateHScrollbar (float min, float disp_min, float disp_max, float max)
 Updates the horizontal scrollbar.
void updateVScrollbar (float min, float disp_min, float disp_max, float max)
 Updates the vertical scrollbar.
virtual void showGoToDialog ()=0
 Shows a goto dialog.
void changeLegendVisibility ()
 Toggles the axis legend visibility.

Signals

void modesChanged (QWidget *)
 Signals that draw mode or display mode changed (e.g. used to update the tool bar).
void sendStatusMessage (std::string, OpenMS::UInt)
 Displays a status message. See TOPPViewBase::showStatusMessage .
void sendCursorStatus (double mz=-1.0, double intens=-1.0, double rt=-1.0)
 Displays peak information in the status bar (m/z, RT, intensity).
void aboutToBeDestroyed (int window_id)
 Message about the destruction of this widget.
void openPreferences ()
 Shows the main preferences dialog.

Public Member Functions

 SpectrumWidget (const Param &preferences, QWidget *parent=0)
 Default constructor.
 ~SpectrumWidget ()
 Destructor.
SpectrumCanvascanvas ()
 Returns a pointer to canvas object.
AxisWidgetxAxis ()
 Returns a pointer to the x-axis axis widget.
AxisWidgetyAxis ()
 Returns a pointer to the y-axis axis widget.
Int getActionMode () const
 Get the mouse action mode.
void setActionMode (SpectrumCanvas::ActionModes mode)
 SpectrumWidgetActionModes.
virtual bool isLegendShown () const
 Returns if the axis labels are shown.
virtual void showLegend (bool show)
 Shows/hides axis labels.
void setIntensityMode (SpectrumCanvas::IntensityModes mode)
 Sets the intensity mode of the SpectrumCanvas.
void hideAxes ()
 Hides x-axis and y-axis.

Public Attributes

Int window_id
 Widget id used as identifier.

Protected Member Functions

void setCanvas_ (SpectrumCanvas *canvas, UInt row=0, UInt col=2)
 Adds the canvas, axes and scrollbars to the layout.
virtual void intensityModeChange_ ()
 Switch between different intensitiy modes.
virtual Math::Histogram< UInt,
float > 
createIntensityDistribution_ ()=0
 creates the intensity distribution of the widget
virtual void recalculateAxes_ ()=0
 recalculates the Axis ticks

Protected Attributes

SpectrumCanvascanvas_
 Pointer to the canvas widget.
QGridLayout * grid_
 Main layout.
AxisWidgety_axis_
 Vertical axis.
AxisWidgetx_axis_
 Horizontal axis.
QScrollBar * x_scrollbar_
 Horizontal scrollbar.
QScrollBar * y_scrollbar_
 Vertical scrollbar.


Constructor & Destructor Documentation

SpectrumWidget ( const Param preferences,
QWidget parent = 0 
)

Default constructor.

~SpectrumWidget (  ) 

Destructor.


Member Function Documentation

SpectrumCanvas* canvas (  )  [inline]

Returns a pointer to canvas object.

The canvas object is set with the setCanvas_() method. This is usually done in the constructor.

Reimplemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

AxisWidget* xAxis (  )  [inline]

Returns a pointer to the x-axis axis widget.

AxisWidget* yAxis (  )  [inline]

Returns a pointer to the y-axis axis widget.

Int getActionMode (  )  const

Get the mouse action mode.

void setActionMode ( SpectrumCanvas::ActionModes  mode  ) 

SpectrumWidgetActionModes.

virtual bool isLegendShown (  )  const [virtual]

Returns if the axis labels are shown.

Reimplemented in Spectrum3DWidget.

virtual void showLegend ( bool  show  )  [virtual]

Shows/hides axis labels.

Reimplemented in Spectrum3DWidget.

void setIntensityMode ( SpectrumCanvas::IntensityModes  mode  ) 

Sets the intensity mode of the SpectrumCanvas.

void hideAxes (  ) 

Hides x-axis and y-axis.

void modesChanged ( QWidget  )  [signal]

Signals that draw mode or display mode changed (e.g. used to update the tool bar).

void sendStatusMessage ( std::string  ,
OpenMS::UInt   
) [signal]

Displays a status message. See TOPPViewBase::showStatusMessage .

void sendCursorStatus ( double  mz = -1.0,
double  intens = -1.0,
double  rt = -1.0 
) [signal]

Displays peak information in the status bar (m/z, RT, intensity).

void aboutToBeDestroyed ( int  window_id  )  [signal]

Message about the destruction of this widget.

void openPreferences (  )  [signal]

Shows the main preferences dialog.

void showStatistics (  )  [slot]

Shows statistics about the data (count,min,max,avg of Intensity, Charge, Quality and meta data).

void showIntensityDistribution (  )  [slot]

Shows the intensity distribution of the data.

void updateAxes (  )  [slot]

Updates the axes by setting the right labels and calling recalculateAxes_();.

void updateHScrollbar ( float  min,
float  disp_min,
float  disp_max,
float  max 
) [slot]

Updates the horizontal scrollbar.

Parameters:
min The overall minimum of the range
disp_min The displayed minimum
disp_max The displayed maximum
max The overall maximum of the range

void updateVScrollbar ( float  min,
float  disp_min,
float  disp_max,
float  max 
) [slot]

Updates the vertical scrollbar.

Parameters:
min The overall minimum of the range
disp_min The displayed minimum
disp_max The displayed maximum
max The overall maximum of the range

virtual void showGoToDialog (  )  [pure virtual, slot]

Shows a goto dialog.

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

void changeLegendVisibility (  )  [slot]

Toggles the axis legend visibility.

void setCanvas_ ( SpectrumCanvas canvas,
UInt  row = 0,
UInt  col = 2 
) [protected]

Adds the canvas, axes and scrollbars to the layout.

row and col define the position of the canvas. Axes and scrollbars are added to the left and bottom of the canvas.

virtual void intensityModeChange_ (  )  [protected, virtual]

Switch between different intensitiy modes.

virtual Math::Histogram<UInt,float> createIntensityDistribution_ (  )  [protected, pure virtual]

creates the intensity distribution of the widget

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

virtual void recalculateAxes_ (  )  [protected, pure virtual]

recalculates the Axis ticks

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.


Member Data Documentation

Int window_id

Widget id used as identifier.

SpectrumCanvas* canvas_ [protected]

Pointer to the canvas widget.

QGridLayout* grid_ [protected]

Main layout.

AxisWidget* y_axis_ [protected]

Vertical axis.

AxisWidget* x_axis_ [protected]

Horizontal axis.

QScrollBar* x_scrollbar_ [protected]

Horizontal scrollbar.

QScrollBar* y_scrollbar_ [protected]

Vertical scrollbar.


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:48 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1