Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SpectrumWidget Class Referenceabstract

Base class for spectrum widgets. More...

#include <OpenMS/VISUAL/SpectrumWidget.h>

Inheritance diagram for SpectrumWidget:
QWidget EnhancedTabBarWidgetInterface Spectrum1DWidget Spectrum2DWidget Spectrum3DWidget

Public Types

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

Public Slots

void showStatistics ()
 Shows statistics about the data (count, min, max, avg of intensity, charge, quality and meta data) More...
 
void showIntensityDistribution ()
 Shows the intensity distribution of the current layer. More...
 
void showMetaDistribution (const String &name)
 Shows the meta data distribution of value name of the current layer. More...
 
void updateAxes ()
 Updates the axes by setting the right labels and calling recalculateAxes_();. More...
 
void updateHScrollbar (float min, float disp_min, float disp_max, float max)
 Updates the horizontal scrollbar. More...
 
void updateVScrollbar (float min, float disp_min, float disp_max, float max)
 Updates the vertical scrollbar. More...
 
virtual void showGoToDialog ()=0
 Shows a goto dialog. More...
 
void changeLegendVisibility ()
 Toggles the axis legend visibility. More...
 

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. More...
 
void sendCursorStatus (double mz=-1.0, double rt=-1.0)
 Emitted when the cursor position changes (for displaying e.g. in status bar) More...
 
void aboutToBeDestroyed (int window_id)
 Message about the destruction of this widget. More...
 
void openPreferences ()
 Shows the main preferences dialog. More...
 
void dropReceived (const QMimeData *data, QWidget *source, int id)
 Signal that is emitted, when a drag-and-drop action ends on this widget. More...
 

Public Member Functions

 SpectrumWidget (const Param &preferences, QWidget *parent=0)
 Default constructor. More...
 
virtual ~SpectrumWidget ()
 Destructor. More...
 
SpectrumCanvascanvas ()
 Returns a pointer to canvas object. More...
 
SpectrumCanvascanvas () const
 
virtual AxisWidgetxAxis ()
 Returns a pointer to the x-axis axis widget. More...
 
virtual AxisWidgetyAxis ()
 Returns a pointer to the y-axis axis widget. More...
 
Int getActionMode () const
 Get the mouse action mode. More...
 
virtual bool isLegendShown () const
 Returns if the axis labels are shown. More...
 
virtual void showLegend (bool show)
 Shows/hides axis labels. More...
 
void setIntensityMode (SpectrumCanvas::IntensityModes mode)
 Sets the intensity mode of the SpectrumCanvas. More...
 
virtual void hideAxes ()
 Hides x-axis and y-axis. More...
 
virtual void saveAsImage ()
 Saves the widget's content as image file. More...
 
virtual Int getWindowId ()
 getter for the EnhancedTabBar window id as defined in the interface More...
 
virtual void setWindowId (Int window_id)
 setter for the EnhancedTabBar window id as defined in the interface More...
 
- Public Member Functions inherited from EnhancedTabBarWidgetInterface
virtual ~EnhancedTabBarWidgetInterface ()
 Destructor. More...
 

Protected Member Functions

void setCanvas_ (SpectrumCanvas *canvas, UInt row=0, UInt col=2)
 Adds the canvas, axes and scrollbars to the layout. More...
 
virtual void intensityModeChange_ ()
 Switch between different intensity modes. More...
 
virtual Math::Histogram createIntensityDistribution_ () const =0
 creates the intensity distribution of the current layer More...
 
virtual Math::Histogram createMetaDistribution_ (const String &name) const =0
 creates the meta data distribution of value name of the current layer More...
 
virtual void recalculateAxes_ ()=0
 recalculates the Axis ticks More...
 
void correctAreaToObeyMinMaxRanges_ (SpectrumCanvas::AreaType &area)
 correct given area X/Y-values if the values under-/overflow the min-/max values of the data More...
 
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. More...
 
QGridLayout * grid_
 Main layout. More...
 
AxisWidgety_axis_
 Vertical axis. More...
 
AxisWidgetx_axis_
 Horizontal axis. More...
 
QScrollBar * x_scrollbar_
 Horizontal scrollbar. More...
 
QScrollBar * y_scrollbar_
 Vertical scrollbar. More...
 
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

◆ ExperimentType

Main data type (experiment)

◆ FeatureMapType

Main data type (features)

◆ SpectrumType

Spectrum type.

Constructor & Destructor Documentation

◆ SpectrumWidget()

SpectrumWidget ( const Param preferences,
QWidget parent = 0 
)

Default constructor.

◆ ~SpectrumWidget()

virtual ~SpectrumWidget ( )
virtual

Destructor.

Member Function Documentation

◆ aboutToBeDestroyed

void aboutToBeDestroyed ( int  window_id)
signal

Message about the destruction of this widget.

◆ canvas() [1/2]

SpectrumCanvas* canvas ( )
inline

◆ canvas() [2/2]

SpectrumCanvas* canvas ( ) const
inline

◆ changeLegendVisibility

void changeLegendVisibility ( )
slot

Toggles the axis legend visibility.

◆ closeEvent()

void closeEvent ( QCloseEvent *  e)
protected

◆ correctAreaToObeyMinMaxRanges_()

void correctAreaToObeyMinMaxRanges_ ( SpectrumCanvas::AreaType area)
protected

correct given area X/Y-values if the values under-/overflow the min-/max values of the data

◆ createIntensityDistribution_()

virtual Math::Histogram createIntensityDistribution_ ( ) const
protectedpure virtual

creates the intensity distribution of the current layer

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

◆ createMetaDistribution_()

virtual Math::Histogram createMetaDistribution_ ( const String name) const
protectedpure virtual

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

Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.

◆ dragEnterEvent()

void dragEnterEvent ( QDragEnterEvent *  event)
protected

◆ dragMoveEvent()

void dragMoveEvent ( QDragMoveEvent *  event)
protected

◆ dropEvent()

void dropEvent ( QDropEvent *  event)
protected

◆ dropReceived

void dropReceived ( const QMimeData *  data,
QWidget source,
int  id 
)
signal

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

◆ getActionMode()

Int getActionMode ( ) const

Get the mouse action mode.

◆ getWindowId()

virtual Int getWindowId ( )
virtual

getter for the EnhancedTabBar window id as defined in the interface

Implements EnhancedTabBarWidgetInterface.

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

◆ hideAxes()

virtual void hideAxes ( )
virtual

Hides x-axis and y-axis.

Reimplemented in Spectrum1DWidget.

◆ intensityModeChange_()

virtual void intensityModeChange_ ( )
protectedvirtual

Switch between different intensity modes.

◆ isLegendShown()

virtual bool isLegendShown ( ) const
virtual

Returns if the axis labels are shown.

Reimplemented in Spectrum3DWidget.

◆ openPreferences

void openPreferences ( )
signal

Shows the main preferences dialog.

◆ recalculateAxes_()

virtual void recalculateAxes_ ( )
protectedpure virtual

recalculates the Axis ticks

Implemented in Spectrum1DWidget, and Spectrum3DWidget.

◆ saveAsImage()

virtual void saveAsImage ( )
virtual

Saves the widget's content as image file.

Reimplemented in Spectrum1DWidget.

◆ sendCursorStatus

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

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

◆ sendStatusMessage

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.

◆ setCanvas_()

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.

◆ setIntensityMode()

void setIntensityMode ( SpectrumCanvas::IntensityModes  mode)

Sets the intensity mode of the SpectrumCanvas.

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

◆ setWindowId()

virtual void setWindowId ( Int  window_id)
virtual

setter for the EnhancedTabBar window id as defined in the interface

Implements EnhancedTabBarWidgetInterface.

Referenced by TOPPViewBase::showSpectrumWidgetInWindow().

◆ showGoToDialog

virtual void showGoToDialog ( )
pure virtualslot

Shows a goto dialog.

Referenced by TOPPViewBase::showGoToDialog().

◆ showIntensityDistribution

void showIntensityDistribution ( )
slot

Shows the intensity distribution of the current layer.

◆ showLegend()

virtual void showLegend ( bool  show)
virtual

Shows/hides axis labels.

Reimplemented in Spectrum1DWidget, and Spectrum3DWidget.

Referenced by TOPPViewBase::toggleAxisLegends().

◆ showMetaDistribution

void showMetaDistribution ( const String name)
slot

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

◆ showStatistics

void showStatistics ( )
slot

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

Referenced by TOPPViewBase::layerStatistics().

◆ updateAxes

void updateAxes ( )
slot

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

◆ updateHScrollbar

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

Updates the horizontal scrollbar.

Parameters
minThe overall minimum of the range
disp_minThe displayed minimum
disp_maxThe displayed maximum
maxThe overall maximum of the range

◆ updateVScrollbar

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

Updates the vertical scrollbar.

Parameters
minThe overall minimum of the range
disp_minThe displayed minimum
disp_maxThe displayed maximum
maxThe overall maximum of the range

◆ xAxis()

virtual AxisWidget* xAxis ( )
inlinevirtual

Returns a pointer to the x-axis axis widget.

Referenced by IDEvaluationBase::IDEvaluationBase().

◆ yAxis()

virtual AxisWidget* yAxis ( )
inlinevirtual

Returns a pointer to the y-axis axis widget.

Referenced by IDEvaluationBase::setIntensityMode().

Member Data Documentation

◆ canvas_

SpectrumCanvas* canvas_
protected

Pointer to the canvas widget.

◆ grid_

QGridLayout* grid_
protected

Main layout.

◆ window_id_

Int window_id_
protected

◆ x_axis_

AxisWidget* x_axis_
protected

Horizontal axis.

◆ x_scrollbar_

QScrollBar* x_scrollbar_
protected

Horizontal scrollbar.

◆ y_axis_

AxisWidget* y_axis_
protected

Vertical axis.

◆ y_scrollbar_

QScrollBar* y_scrollbar_
protected

Vertical scrollbar.


OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:13 using doxygen 1.8.13