Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes

SpectrumWidget Class Reference

Base class for spectrum widgets. More...

#include <OpenMS/VISUAL/SpectrumWidget.h>

Inheritance diagram for SpectrumWidget:
QWidget EnhancedTabBarWidgetInterface Spectrum1DWidget Spectrum2DWidget Spectrum3DWidget

List of all members.

Public Types

Type definitions

typedef LayerData::ExperimentType ExperimentType
 Main data type (experiment).
typedef LayerData::FeatureMapType FeatureMapType
 Main data type (features).
typedef
ExperimentType::SpectrumType 
SpectrumType
 Spectrum type.

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 current layer.
void showMetaDistribution (const String &name)
 Shows the meta data distribution of vlaue name of the current layer.
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 sendStatusMessage (std::string, OpenMS::UInt)
 Emits a status message that should be displayed for time ms. If time is 0 the message should be displayed until the next message is emitted.
void sendCursorStatus (double mz=-1.0, double rt=-1.0)
 Emitted when the cursor position changes (for displaying e.g. in status bar).
void aboutToBeDestroyed (int window_id)
 Message about the destruction of this widget.
void openPreferences ()
 Shows the main preferences dialog.
void dropReceived (const QMimeData *data, QWidget *source, int id)
 Signal that is emitted, when a drag-and-drop action ends on this widget.

Public Member Functions

 SpectrumWidget (const Param &preferences, QWidget *parent=0)
 Default constructor.
virtual ~SpectrumWidget ()
 Destructor.
SpectrumCanvascanvas ()
 Returns a pointer to canvas object.
SpectrumCanvascanvas () const
virtual AxisWidgetxAxis ()
 Returns a pointer to the x-axis axis widget.
virtual AxisWidgetyAxis ()
 Returns a pointer to the y-axis axis widget.
Int getActionMode () const
 Get the mouse action mode.
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.
virtual void hideAxes ()
 Hides x-axis and y-axis.
virtual void saveAsImage ()
 Saves the widget's content as image file.
virtual Int getWindowId ()
 getter for the EnhancedTabBar window id as defined in the interface
virtual void setWindowId (Int window_id)
 setter for the EnhancedTabBar window id as defined in the interface

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 createIntensityDistribution_ () const =0
 creates the intensity distribution of the current layer
virtual Math::Histogram createMetaDistribution_ (const String &name) const =0
 creates the meta data distribution of value name of the current layer
virtual void recalculateAxes_ ()=0
 recalculates the Axis ticks
reimplemented Qt events

void closeEvent (QCloseEvent *e)
void dragEnterEvent (QDragEnterEvent *event)
void dragMoveEvent (QDragMoveEvent *event)
void dropEvent (QDropEvent *event)

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.
Int window_id_

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.

Todo:
Add support to store the displayed data as SVG image (HiWi)

Member Typedef Documentation

Main data type (experiment).

Main data type (features).


Constructor & Destructor Documentation

SpectrumWidget ( const Param preferences,
QWidget parent = 0 
)

Default constructor.

virtual ~SpectrumWidget (  )  [virtual]

Destructor.


Member Function Documentation

void aboutToBeDestroyed ( int  window_id  )  [signal]

Message about the destruction of this widget.

SpectrumCanvas* canvas (  )  const [inline]
void changeLegendVisibility (  )  [slot]

Toggles the axis legend visibility.

void closeEvent ( QCloseEvent *  e  )  [protected]
virtual Math::Histogram createIntensityDistribution_ (  )  const [protected, pure virtual]

creates the intensity distribution of the current layer

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

virtual Math::Histogram createMetaDistribution_ ( const String name  )  const [protected, pure virtual]

creates the meta data distribution of value name of the current layer

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

void dragEnterEvent ( QDragEnterEvent *  event  )  [protected]
void dragMoveEvent ( QDragMoveEvent *  event  )  [protected]
void dropEvent ( QDropEvent *  event  )  [protected]
void dropReceived ( const QMimeData *  data,
QWidget source,
int  id 
) [signal]

Signal that is emitted, when a drag-and-drop action ends on this widget.

Int getActionMode (  )  const

Get the mouse action mode.

virtual Int getWindowId (  )  [virtual]

getter for the EnhancedTabBar window id as defined in the interface

Implements EnhancedTabBarWidgetInterface.

Referenced by TOPPViewBase::runTOPPTool_(), and TOPPViewBase::showSpectrumWidgetInWindow().

virtual void hideAxes (  )  [virtual]

Hides x-axis and y-axis.

Reimplemented in Spectrum1DWidget.

virtual void intensityModeChange_ (  )  [protected, virtual]

Switch between different intensitiy modes.

virtual bool isLegendShown (  )  const [virtual]

Returns if the axis labels are shown.

Reimplemented in Spectrum3DWidget.

void openPreferences (  )  [signal]

Shows the main preferences dialog.

virtual void recalculateAxes_ (  )  [protected, pure virtual]

recalculates the Axis ticks

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

virtual void saveAsImage (  )  [virtual]

Saves the widget's content as image file.

Reimplemented in Spectrum1DWidget.

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

Emitted when the cursor position changes (for displaying e.g. in status bar).

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

Emits a status message that should be displayed for time ms. If time is 0 the message should be displayed until the next message is emitted.

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.

void setIntensityMode ( SpectrumCanvas::IntensityModes  mode  ) 

Sets the intensity mode of the SpectrumCanvas.

Referenced by TOPPViewBase::setIntensityMode(), and IDEvaluationBase::setIntensityMode().

virtual void setWindowId ( Int  window_id  )  [virtual]

setter for the EnhancedTabBar window id as defined in the interface

Implements EnhancedTabBarWidgetInterface.

Referenced by TOPPViewBase::showSpectrumWidgetInWindow().

virtual void showGoToDialog (  )  [pure virtual, slot]

Shows a goto dialog.

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

Referenced by TOPPViewBase::showGoToDialog().

void showIntensityDistribution (  )  [slot]

Shows the intensity distribution of the current layer.

virtual void showLegend ( bool  show  )  [virtual]

Shows/hides axis labels.

Reimplemented in Spectrum1DWidget, and Spectrum3DWidget.

Referenced by TOPPViewBase::toggleAxisLegends().

void showMetaDistribution ( const String name  )  [slot]

Shows the meta data distribution of vlaue name of the current layer.

void showStatistics (  )  [slot]

Shows statistics about the data (count, min, max, avg of intensity, charge, quality and meta data).

Referenced by TOPPViewBase::layerStatistics().

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 AxisWidget* xAxis (  )  [inline, virtual]

Returns a pointer to the x-axis axis widget.

Referenced by IDEvaluationBase::IDEvaluationBase().

virtual AxisWidget* yAxis (  )  [inline, virtual]

Returns a pointer to the y-axis axis widget.

Referenced by IDEvaluationBase::setIntensityMode().


Member Data Documentation

SpectrumCanvas* canvas_ [protected]

Pointer to the canvas widget.

QGridLayout* grid_ [protected]

Main layout.

Int window_id_ [protected]
AxisWidget* x_axis_ [protected]

Horizontal axis.

QScrollBar* x_scrollbar_ [protected]

Horizontal scrollbar.

AxisWidget* y_axis_ [protected]

Vertical axis.

QScrollBar* y_scrollbar_ [protected]

Vertical scrollbar.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:58 using doxygen 1.7.1