OpenMS
2.6.0
|
Base class for spectrum widgets. More...
#include <OpenMS/VISUAL/SpectrumWidget.h>
Static Public Attributes | |
static const char | RT_AXIS_TITLE [] |
static const char | MZ_AXIS_TITLE [] |
static const char | INTENSITY_AXIS_TITLE [] |
static const char | IM_MS_AXIS_TITLE [] |
static const char | IM_ONEKZERO_AXIS_TITLE [] |
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... | |
SpectrumWidget (const Param &preferences, QWidget *parent=nullptr) | |
Default constructor. More... | |
~SpectrumWidget () override | |
Destructor. More... | |
SpectrumCanvas * | canvas () |
Returns a pointer to canvas object. More... | |
SpectrumCanvas * | canvas () const |
virtual AxisWidget * | xAxis () |
Returns a pointer to the x-axis axis widget. More... | |
virtual AxisWidget * | yAxis () |
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... | |
Int | getWindowId () override |
getter for the EnhancedTabBar window id as defined in the interface More... | |
void | setWindowId (Int window_id) override |
setter for the EnhancedTabBar window id as defined in the interface More... | |
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... | |
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... | |
reimplemented Qt events | |
SpectrumCanvas * | canvas_ |
Pointer to the canvas widget. More... | |
QGridLayout * | grid_ |
Main layout. More... | |
AxisWidget * | y_axis_ |
Vertical axis. More... | |
AxisWidget * | x_axis_ |
Horizontal axis. More... | |
QScrollBar * | x_scrollbar_ |
Horizontal scrollbar. More... | |
QScrollBar * | y_scrollbar_ |
Vertical scrollbar. More... | |
Int | window_id_ |
void | closeEvent (QCloseEvent *e) override |
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... | |
void | dragEnterEvent (QDragEnterEvent *event) override |
void | dragMoveEvent (QDragMoveEvent *event) override |
void | dropEvent (QDropEvent *event) override |
Additional Inherited Members | |
Public Member Functions inherited from EnhancedTabBarWidgetInterface | |
virtual | ~EnhancedTabBarWidgetInterface () |
Destructor. More... | |
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, 3D view etc.), there must exist a corresponding class derived from this class.
In TOPPView, each SpectrumWidget holds an enclosed SpectrumCanvas with which it is paired (e.g. a Spectrum1DWidget holds a Spectrum1DCanvas) which can retrieved with the canvas() function. While the SpectrumCanvas does the actual drawing, the SpectrumWidget holds information about the axes (axis widgets), scrolling (scrollbars) etc. The SpectrumWidget uses a grid layout (QGridLayout) with a default 3x3 grid where the upper right corner of the grid is the canvas and the spaces left and below the canvas are for the axes widget and scrollbars.
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.
Main data type (experiment)
Main data type (features)
Spectrum type.
SpectrumWidget | ( | const Param & | preferences, |
QWidget * | parent = nullptr |
||
) |
Default constructor.
|
override |
Destructor.
|
signal |
Message about the destruction of this widget.
Referenced by TOPPViewBase::showSpectrumWidgetInWindow().
|
inline |
Returns a pointer to canvas object.
The canvas object is set with the setCanvas_() method. This is usually done in the constructor.
Referenced by TOPPViewBase::addData(), TOPPViewBase::enhancedWorkspaceWindowChanged(), TOPPViewBase::fileChanged_(), TOPPViewBase::getActiveCanvas(), TOPPViewBase::getFilenamesOfOpenFiles_(), TOPPViewBase::layerZoomChanged(), TOPPViewBase::resetZoom(), TOPPViewBase::showSpectrumWidgetInWindow(), and TOPPViewBase::updateToolBar().
|
inline |
|
slot |
Toggles the axis legend visibility.
|
overrideprotected |
|
protected |
correct given area X/Y-values if the values under-/overflow the min-/max values of the data
|
protectedpure virtual |
creates the intensity distribution of the current layer
Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.
|
protectedpure virtual |
creates the meta data distribution of value name
of the current layer
Implemented in Spectrum1DWidget, Spectrum2DWidget, and Spectrum3DWidget.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
Signal that is emitted, when a drag-and-drop action ends on this widget.
Referenced by TOPPViewBase::showSpectrumWidgetInWindow().
Int getActionMode | ( | ) | const |
Get the mouse action mode.
|
overridevirtual |
getter for the EnhancedTabBar window id as defined in the interface
Implements EnhancedTabBarWidgetInterface.
Referenced by TOPPViewBase::runTOPPTool_(), and TOPPViewBase::showSpectrumWidgetInWindow().
|
virtual |
Hides x-axis and y-axis.
Reimplemented in Spectrum1DWidget.
|
protectedvirtual |
Switch between different intensity modes.
|
virtual |
Returns if the axis labels are shown.
Reimplemented in Spectrum3DWidget.
|
signal |
Shows the main preferences dialog.
|
protectedpure virtual |
recalculates the Axis ticks
Implemented in Spectrum1DWidget, and Spectrum3DWidget.
|
virtual |
Saves the widget's content as image file.
Reimplemented in Spectrum1DWidget.
Emitted when the cursor position changes (for displaying e.g. in status bar)
Referenced by TOPPViewBase::showSpectrumWidgetInWindow().
|
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.
Referenced by TOPPViewBase::showSpectrumWidgetInWindow().
|
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().
|
overridevirtual |
setter for the EnhancedTabBar window id as defined in the interface
Implements EnhancedTabBarWidgetInterface.
Referenced by TOPPViewBase::showSpectrumWidgetInWindow().
|
pure virtualslot |
Shows a goto dialog.
Referenced by TOPPViewBase::showGoToDialog().
|
slot |
Shows the intensity distribution of the current layer.
|
virtual |
Shows/hides axis labels.
Reimplemented in Spectrum1DWidget, and Spectrum3DWidget.
Referenced by TOPPViewBase::toggleAxisLegends().
|
slot |
Shows the meta data distribution of value name
of the current layer.
|
slot |
Shows statistics about the data (count, min, max, avg of intensity, charge, quality and meta data)
Referenced by TOPPViewBase::layerStatistics().
|
slot |
Updates the axes by setting the right labels and calling recalculateAxes_();.
Updates the horizontal scrollbar.
min | The overall minimum of the range |
disp_min | The displayed minimum |
disp_max | The displayed maximum |
max | The overall maximum of the range |
Updates the vertical scrollbar.
min | The overall minimum of the range |
disp_min | The displayed minimum |
disp_max | The displayed maximum |
max | The overall maximum of the range |
|
inlinevirtual |
Returns a pointer to the x-axis axis widget.
Referenced by TOPPViewBase::showCurrentPeaksAsIonMobility().
|
inlinevirtual |
Returns a pointer to the y-axis axis widget.
|
protected |
Pointer to the canvas widget.
|
protected |
Main layout.
|
static |
Referenced by TOPPViewBase::showCurrentPeaksAsIonMobility().
|
static |
Referenced by TOPPViewBase::showCurrentPeaksAsIonMobility().
|
static |
|
static |
|
static |
|
protected |
|
protected |
Horizontal axis.
|
protected |
Horizontal scrollbar.
|
protected |
Vertical axis.
|
protected |
Vertical scrollbar.