OpenMS  2.7.0
List of all members
PlotCanvas Class Referenceabstract

Base class for visualization canvas classes. More...

#include <OpenMS/VISUAL/PlotCanvas.h>

Inheritance diagram for PlotCanvas:
[legend]
Collaboration diagram for PlotCanvas:
[legend]

Protected Member Functions

reimplemented QT events
void resizeEvent (QResizeEvent *e) override
 
void wheelEvent (QWheelEvent *e) override
 
void keyPressEvent (QKeyEvent *e) override
 
void keyReleaseEvent (QKeyEvent *e) override
 
void focusOutEvent (QFocusEvent *e) override
 
void leaveEvent (QEvent *e) override
 
void enterEvent (QEvent *e) override
 
virtual void intensityModeChange_ ()
 This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes. More...
 
virtual void changeVisibleArea_ (const AreaType &new_area, bool repaint=true, bool add_to_stack=false)
 Sets the visible area. More...
 
virtual void recalculateSnapFactor_ ()
 Recalculates the intensity scaling factor for 'snap to maximum intensity mode'. More...
 
Zoom stack methods
virtual void zoom_ (int x, int y, bool zoom_in)
 Zooms such that screen point x, y would still point to the same data point. More...
 
void zoomBack_ ()
 Go backward in zoom history. More...
 
virtual void zoomForward_ ()
 Go forward in zoom history. More...
 
void zoomAdd_ (const AreaType &area)
 Add a visible area to the zoom stack. More...
 
void zoomClear_ ()
 Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately. More...
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Type definitions

enum  ActionModes { AM_TRANSLATE , AM_ZOOM , AM_MEASURE }
 Mouse action modes. More...
 
enum  IntensityModes { IM_NONE , IM_PERCENTAGE , IM_SNAP , IM_LOG }
 Display modes of intensity. More...
 
typedef LayerData::ExperimentType ExperimentType
 Main data type (experiment) More...
 
typedef LayerData::ExperimentSharedPtrType ExperimentSharedPtrType
 Main managed data type (experiment) More...
 
typedef LayerData::ConstExperimentSharedPtrType ConstExperimentSharedPtrType
 
typedef LayerData::ODExperimentSharedPtrType ODExperimentSharedPtrType
 
typedef LayerData::OSWDataSharedPtrType OSWDataSharedPtrType
 
typedef LayerData::FeatureMapType FeatureMapType
 Main data type (features) More...
 
typedef LayerData::FeatureMapSharedPtrType FeatureMapSharedPtrType
 Main managed data type (features) More...
 
typedef LayerData::ConsensusMapType ConsensusMapType
 Main data type (consensus features) More...
 
typedef LayerData::ConsensusMapSharedPtrType ConsensusMapSharedPtrType
 Main managed data type (consensus features) More...
 
typedef ExperimentType::SpectrumType SpectrumType
 Spectrum type. More...
 
typedef SpectrumType::ConstIterator SpectrumConstIteratorType
 Spectrum iterator type (iterates over peaks) More...
 
typedef SpectrumType::PeakType PeakType
 Peak type. More...
 
typedef FeatureMapType::FeatureType FeatureType
 Feature type. More...
 
typedef DPosition< 2 > PointType
 Type of the Points. More...
 
typedef DRange< 2 > AreaType
 Types of Ranges/Areas. More...
 
 PlotCanvas (const Param &preferences, QWidget *parent=nullptr)
 Default constructor. More...
 
 ~PlotCanvas () override
 Destructor. More...
 
void setPlotWidget (PlotWidget *widget)
 Sets the spectrum widget. More...
 
PlotWidgetgetPlotWidget () const
 Returns the spectrum widget. More...
 
Int getActionMode () const
 Returns the action mode. More...
 
IntensityModes getIntensityMode () const
 Returns the intensity mode. More...
 
void setIntensityMode (IntensityModes mod)
 Sets the intensity mode. More...
 
bool gridLinesShown () const
 Returns if the grid is currently shown. More...
 
const LayerDatagetLayer (Size index) const
 returns the layer data with index index More...
 
LayerDatagetLayer (Size index)
 returns the layer data with index index More...
 
const LayerDatagetCurrentLayer () const
 returns the layer data of the active layer More...
 
LayerDatagetCurrentLayer ()
 returns the layer data of the active layer More...
 
Size getCurrentLayerIndex () const
 returns the index of the active layer More...
 
bool getLayerFlag (LayerData::Flags f) const
 returns a layer flag of the current layer More...
 
void setLayerFlag (LayerData::Flags f, bool value)
 sets a layer flag of the current layer More...
 
bool getLayerFlag (Size layer, LayerData::Flags f) const
 returns a layer flag of the layer layer More...
 
void setLayerFlag (Size layer, LayerData::Flags f, bool value)
 sets a layer flag of the layer layer More...
 
void setLabel (LayerData::LabelType label)
 
const AreaTypegetVisibleArea () const
 Returns the currently visible area. More...
 
virtual void setFilters (const DataFilters &filters)
 Sets the filters applied to the data before drawing (for the current layer) More...
 
bool isMzToXAxis ()
 Returns the mapping of m/z to axes. More...
 
void mzToXAxis (bool mz_to_x_axis)
 Sets the mapping of m/z to axes. More...
 

Translation methods, which are called when cursor buttons are pressed

QImage buffer_
 Buffer that stores the actual peak information. More...
 
ActionModes action_mode_
 Stores the current action mode (Pick, Zoom, Translate) More...
 
IntensityModes intensity_mode_
 Stores the used intensity mode function. More...
 
LayerStack layers_
 Layer data. More...
 
bool mz_to_x_axis_
 Stores the mapping of m/z. More...
 
AreaType visible_area_
 Stores the currently visible area. More...
 
DRange< 3 > overall_data_range_
 Stores the data range (m/z, RT and intensity) of all layers. More...
 
bool show_grid_
 Stores whether or not to show a grid. More...
 
std::vector< AreaTypezoom_stack_
 The zoom stack. More...
 
std::vector< AreaType >::iterator zoom_pos_
 The current position in the zoom stack. More...
 
bool update_buffer_
 Whether to recalculate the data in the buffer when repainting. More...
 
PlotWidgetspectrum_widget_
 Back-pointer to the enclosing spectrum widget. More...
 
QPoint last_mouse_pos_
 start position of mouse actions More...
 
double percentage_factor_
 Intensity scaling factor for relative scale with multiple layers. More...
 
std::vector< double > snap_factors_
 Intensity scaling factor for 'snap to maximum intensity mode'. More...
 
QRubberBand rubber_band_
 Rubber band for selected area. More...
 
QMenu * context_add_
 External context menu extension. More...
 
bool show_timing_
 Flag that determines if timing data is printed to the command line. More...
 
PeakIndex selected_peak_
 selected peak More...
 
PeakIndex measurement_start_
 start peak of measuring mode More...
 
virtual void translateLeft_ (Qt::KeyboardModifiers m)
 Translation bound to the 'Left' key. More...
 
virtual void translateRight_ (Qt::KeyboardModifiers m)
 Translation bound to the 'Right' key. More...
 
virtual void translateForward_ ()
 Translation bound to the 'Up' key. More...
 
virtual void translateBackward_ ()
 Translation bound to the 'Down' key. More...
 
virtual void updateScrollbars_ ()
 Updates the scroll bars. More...
 
PointType widgetToData_ (double x, double y)
 Convert widget to chart coordinates. More...
 
PointType widgetToData_ (const QPoint &pos)
 Calls widgetToData_ with x and y position of pos. More...
 
void dataToWidget_ (double x, double y, QPoint &point)
 Convert chart to widget coordinates. More...
 
virtual void paintGridLines_ (QPainter &painter)
 Helper function to paint grid lines. More...
 
void recalculateRanges_ (UInt mz_dim, UInt rt_dim, UInt it_dim)
 Recalculates the overall_data_range_. More...
 
virtual void update_ (const char *caller_name)
 Updates the displayed data. More...
 
void modificationStatus_ (Size layer_index, bool modified)
 Takes all actions necessary when the modification status of a layer changes (signals etc.) More...
 
void addDataProcessing_ (PeakMap &map, DataProcessing::ProcessingAction action) const
 Data processing setter for peak maps. More...
 

Dataset handling methods

See also
changeVisibility
Size getLayerCount () const
 Returns the number of layers. More...
 
virtual void activateLayer (Size layer_index)=0
 change the active layer (the one that is used for selecting and so on) More...
 
virtual void removeLayer (Size layer_index)=0
 removes the layer with index layer_index More...
 
void removeLayers ()
 removes all layers by calling removeLayer() for all layer indices (from highest to lowest) More...
 
bool addLayer (ExperimentSharedPtrType map, ODExperimentSharedPtrType od_map, const String &filename="")
 Add a peak data layer. More...
 
bool addLayer (FeatureMapSharedPtrType map, const String &filename="")
 Add a feature data layer. More...
 
bool addLayer (ConsensusMapSharedPtrType map, const String &filename="")
 Add a consensus feature data layer. More...
 
bool addLayer (std::vector< PeptideIdentification > &peptides, const String &filename="")
 Add an identification data layer. More...
 
float getCurrentMinIntensity () const
 Returns the minimum intensity of the active layer. More...
 
float getCurrentMaxIntensity () const
 Returns the maximum intensity of the active layer. More...
 
float getMinIntensity (Size index) const
 Returns the minimum intensity of the layer with index index. More...
 
float getMaxIntensity (Size index) const
 Returns the maximum intensity of the layer with index index. More...
 
void setLayerName (Size i, const String &name)
 Sets the name of layer i. More...
 
String getLayerName (Size i)
 Gets the name of layer i. More...
 
void setCurrentLayerParameters (const Param &param)
 Sets the parameters of the current layer. More...
 
const DRange< 3 > & getDataRange ()
 Returns the area which encloses all data points. More...
 
double getSnapFactor ()
 Returns the first intensity scaling factor for 'snap to maximum intensity mode'. More...
 
double getPercentageFactor ()
 Returns the percentage factor. More...
 
virtual void showCurrentLayerPreferences ()=0
 Shows the preferences dialog of the active layer. More...
 
virtual void showMetaData (bool modifiable=false, Int index=-1)
 Shows a dialog with the meta data. More...
 
virtual void saveCurrentLayer (bool visible)=0
 Saves the current layer data. More...
 
void changeVisibility (Size i, bool b)
 change the visibility of a layer More...
 
void changeLayerFilterState (Size i, bool b)
 change if the defined data filters are used More...
 
void showGridLines (bool show)
 Whether or not to show grid lines. More...
 
void resetZoom (bool repaint=true)
 Zooms fully out and resets the zoom stack. More...
 
void setVisibleArea (AreaType area)
 Sets the visible area. More...
 
virtual void horizontalScrollBarChange (int value)
 Notifies the canvas that the horizontal scrollbar has been moved. More...
 
virtual void verticalScrollBarChange (int value)
 Notifies the canvas that the vertical scrollbar has been moved. More...
 
void setAdditionalContextMenu (QMenu *menu)
 Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas. More...
 
void getVisiblePeakData (ExperimentType &map) const
 Fills the handed over map with the visible peaks of the current layer. More...
 
void getVisibleFeatureData (FeatureMapType &map) const
 Fills the handed over map with the visible features of the current layer. More...
 
void getVisibleConsensusData (ConsensusMapType &map) const
 Fills the handed over map with the visible consensus features of the current layer. More...
 
void getVisibleIdentifications (std::vector< PeptideIdentification > &peptides) const
 Fills the handed over peptides with the visible peptide identifications of the current layer. More...
 
virtual void updateLayer (Size i)=0
 Updates layer i when the data in the corresponding file changes. More...
 
void dataToWidgetDistance (double x, double y, QPoint &point)
 converts a distance in axis values to pixel values More...
 
PointType widgetToDataDistance (double x, double y)
 compute distance in widget coordinates (unit axis as shown) when moving x/y px in chart coordinates More...
 
void layerModficationChange (Size layer, bool modified)
 Signal emitted whenever the modification status of a layer changes (editing and storing) More...
 
void layerActivated (QWidget *w)
 Signal emitted whenever a new layer is activated within the current window. More...
 
void layerZoomChanged (QWidget *w)
 Signal emitted whenever the zoom changed. More...
 
void visibleAreaChanged (DRange< 2 > area)
 Change of the visible area. 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 sendStatusMessage (std::string message, OpenMS::UInt time)
 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 recalculateAxes ()
 Forces recalculation of axis ticks in the connected widget. More...
 
void updateVScrollbar (float, float, float, float)
 Triggers the update of the vertical scrollbar. More...
 
void updateHScrollbar (float, float, float, float)
 Triggers the update of the horizontal scrollbar. More...
 
void changeLegendVisibility ()
 Toggle axis legend visibility change. More...
 
void actionModeChange ()
 Emitted when the action mode changes. More...
 
void preferencesChange ()
 Emitted when the layer preferences have changed. More...
 
void updateCursor_ ()
 Updates the cursor according to the current action mode. More...
 
void drawText_ (QPainter &painter, QStringList text)
 Draws several lines of text to the upper right corner of the widget. More...
 
double getIdentificationMZ_ (const Size layer_index, const PeptideIdentification &peptide) const
 Returns the m/z value of an identification depending on the m/z source of the layer (precursor mass/theoretical peptide mass) More...
 
virtual bool finishAdding_ ()=0
 Method that is called when a new layer has been added. More...
 
void popIncompleteLayer_ (const QString &error_message="")
 

Additional Inherited Members

- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &prefix="")
 Writes all parameters to meta values. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

Base class for visualization canvas classes.

This class is the base class for the spectrum data views which are used for 1D, 2D and 3D visualization of data. In TOPPView, each PlotCanvas is paired with an enclosing PlotWidget (see also the getPlotWidget() function that provides a back-reference). To provide additional spectrum views, you can derive from this class and you should also create a subclass from PlotWidget which encloses your class derived from PlotCanvas. A spectrum canvas can display multiple data layers at the same time (see layers_ member variable).

The actual data to be displayed is stored as a vector of LayerData objects which hold the actual data. It also stores information about the commonly used constants such as ActionModes or IntensityModes.

All derived classes should follow these interface conventions:

Member Typedef Documentation

◆ AreaType

typedef DRange<2> AreaType

Types of Ranges/Areas.

◆ ConsensusMapSharedPtrType

Main managed data type (consensus features)

◆ ConsensusMapType

Main data type (consensus features)

◆ ConstExperimentSharedPtrType

◆ ExperimentSharedPtrType

Main managed data type (experiment)

◆ ExperimentType

Main data type (experiment)

◆ FeatureMapSharedPtrType

Main managed data type (features)

◆ FeatureMapType

Main data type (features)

◆ FeatureType

Feature type.

◆ ODExperimentSharedPtrType

◆ OSWDataSharedPtrType

◆ PeakType

Peak type.

◆ PointType

typedef DPosition<2> PointType

Type of the Points.

◆ SpectrumConstIteratorType

Spectrum iterator type (iterates over peaks)

◆ SpectrumType

Spectrum type.

Member Enumeration Documentation

◆ ActionModes

Mouse action modes.

Enumerator
AM_TRANSLATE 

translate

AM_ZOOM 

zoom

AM_MEASURE 

measure

◆ IntensityModes

Display modes of intensity.

Enumerator
IM_NONE 

Normal mode: f(x)=x.

IM_PERCENTAGE 

Shows intensities normalized by layer maximum: f(x)=x/max(x)*100.

IM_SNAP 

Shows the maximum displayed intensity as if it was the overall maximum intensity.

IM_LOG 

Logarithmic mode.

Constructor & Destructor Documentation

◆ PlotCanvas()

PlotCanvas ( const Param preferences,
QWidget parent = nullptr 
)

Default constructor.

◆ ~PlotCanvas()

~PlotCanvas ( )
override

Destructor.

Member Function Documentation

◆ actionModeChange

void actionModeChange ( )
signal

Emitted when the action mode changes.

◆ activateLayer()

virtual void activateLayer ( Size  layer_index)
pure virtual

change the active layer (the one that is used for selecting and so on)

◆ addDataProcessing_()

void addDataProcessing_ ( PeakMap map,
DataProcessing::ProcessingAction  action 
) const
inlineprotected

Data processing setter for peak maps.

References VersionInfo::getVersion(), DateTime::now(), and MSExperiment::size().

◆ addLayer() [1/4]

bool addLayer ( ConsensusMapSharedPtrType  map,
const String filename = "" 
)

Add a consensus feature data layer.

Parameters
mapShared Pointer to input map. It can be performed in constant time and does not double the required memory.
filenameThis absolute filename is used to monitor changes in the file and reload the data
Returns
If a new layer was created

◆ addLayer() [2/4]

bool addLayer ( ExperimentSharedPtrType  map,
ODExperimentSharedPtrType  od_map,
const String filename = "" 
)

Add a peak data layer.

If chromatograms are present, a chromatogram layer is shown. Otherwise a peak layer is shown. Make sure to remove chromatograms from peak data and vice versa.

Parameters
mapShared pointer to input map. It can be performed in constant time and does not double the required memory.
od_mapShared pointer to on disk data which potentially caches some data to save memory (the map can be empty, but do not pass nullptr).
filenameThis absolute filename is used to monitor changes in the file and reload the data
Returns
If a new layer was created

Referenced by TOPPViewBase::addData(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), and TOPPViewBase::showCurrentPeaksAsIonMobility().

◆ addLayer() [3/4]

bool addLayer ( FeatureMapSharedPtrType  map,
const String filename = "" 
)

Add a feature data layer.

Parameters
mapShared Pointer to input map. It can be performed in constant time and does not double the required memory.
filenameThis absolute filename is used to monitor changes in the file and reload the data
Returns
If a new layer was created

◆ addLayer() [4/4]

bool addLayer ( std::vector< PeptideIdentification > &  peptides,
const String filename = "" 
)

Add an identification data layer.

Parameters
peptidesInput list of peptides, which has to be mutable and will be empty after adding. Swapping is used to insert the data. It can be performed in constant time and does not double the required memory.
filenameThis absolute filename is used to monitor changes in the file and reload the data
Returns
If a new layer was created

◆ changeLayerFilterState

void changeLayerFilterState ( Size  i,
bool  b 
)
slot

change if the defined data filters are used

Parameters
ithe index of the layer
btrue if layer is supposed to be visible

Referenced by TOPPViewBase::layerFilterVisibilityChange().

◆ changeLegendVisibility

void changeLegendVisibility ( )
signal

Toggle axis legend visibility change.

◆ changeVisibility

void changeVisibility ( Size  i,
bool  b 
)
slot

change the visibility of a layer

Parameters
ithe index of the layer
btrue if layer is supposed to be visible

◆ changeVisibleArea_()

virtual void changeVisibleArea_ ( const AreaType new_area,
bool  repaint = true,
bool  add_to_stack = false 
)
protectedvirtual

Sets the visible area.

Changes the visible area, adjusts the zoom stack and notifies interested clients about the change. If parts of the area are outside of the data area, the new area will be adjusted.

Parameters
new_areaThe new visible area.
repaintIf true, a complete repaint is forced.
add_to_stackIf true the new area is to add to the zoom_stack_.

Reimplemented in Plot1DCanvas.

◆ dataToWidget_()

void dataToWidget_ ( double  x,
double  y,
QPoint &  point 
)
inlineprotected

Convert chart to widget coordinates.

Translates chart coordinates to widget coordinates.

Parameters
xthe chart coordinate x
ythe chart coordinate y
pointreturned widget coordinates

References PlotCanvas::IM_LOG.

◆ dataToWidgetDistance

void dataToWidgetDistance ( double  x,
double  y,
QPoint &  point 
)
inlineslot

converts a distance in axis values to pixel values

◆ drawText_()

void drawText_ ( QPainter &  painter,
QStringList  text 
)
protected

Draws several lines of text to the upper right corner of the widget.

◆ enterEvent()

void enterEvent ( QEvent *  e)
overrideprotected

◆ finishAdding_()

virtual bool finishAdding_ ( )
protectedpure virtual

Method that is called when a new layer has been added.

Implemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.

◆ focusOutEvent()

void focusOutEvent ( QFocusEvent *  e)
overrideprotected

◆ getActionMode()

Int getActionMode ( ) const
inline

Returns the action mode.

Returns the current action mode of type ActionModes

Returns
the current action mode

◆ getCurrentLayer() [1/2]

LayerData& getCurrentLayer ( )
inline

returns the layer data of the active layer

◆ getCurrentLayer() [2/2]

const LayerData& getCurrentLayer ( ) const
inline

◆ getCurrentLayerIndex()

Size getCurrentLayerIndex ( ) const
inline

◆ getCurrentMaxIntensity()

float getCurrentMaxIntensity ( ) const
inline

Returns the maximum intensity of the active layer.

◆ getCurrentMinIntensity()

float getCurrentMinIntensity ( ) const
inline

Returns the minimum intensity of the active layer.

◆ getDataRange()

const DRange<3>& getDataRange ( )

Returns the area which encloses all data points.

See also
overall_data_range_

◆ getIdentificationMZ_()

double getIdentificationMZ_ ( const Size  layer_index,
const PeptideIdentification peptide 
) const
protected

Returns the m/z value of an identification depending on the m/z source of the layer (precursor mass/theoretical peptide mass)

◆ getIntensityMode()

IntensityModes getIntensityMode ( ) const
inline

Returns the intensity mode.

Returns the current intensity mode of type IntensityModes

Returns
the current intensity mode

Referenced by TOPPViewBase::updateToolBar().

◆ getLayer() [1/2]

LayerData& getLayer ( Size  index)
inline

returns the layer data with index index

◆ getLayer() [2/2]

const LayerData& getLayer ( Size  index) const
inline

returns the layer data with index index

Referenced by TOPPViewBase::addData(), TOPPViewBase::fileChanged_(), and TOPPViewBase::showCurrentPeaksAs3D().

◆ getLayerCount()

Size getLayerCount ( ) const
inline

◆ getLayerFlag() [1/2]

bool getLayerFlag ( LayerData::Flags  f) const
inline

returns a layer flag of the current layer

Referenced by TOPPViewBase::changeUnassigned(), and TOPPViewBase::updateToolBar().

◆ getLayerFlag() [2/2]

bool getLayerFlag ( Size  layer,
LayerData::Flags  f 
) const
inline

returns a layer flag of the layer layer

◆ getLayerName()

String getLayerName ( Size  i)

Gets the name of layer i.

◆ getMaxIntensity()

float getMaxIntensity ( Size  index) const
inline

Returns the maximum intensity of the layer with index index.

◆ getMinIntensity()

float getMinIntensity ( Size  index) const
inline

Returns the minimum intensity of the layer with index index.

◆ getPercentageFactor()

double getPercentageFactor ( )

Returns the percentage factor.

◆ getPlotWidget()

PlotWidget* getPlotWidget ( ) const
inline

Returns the spectrum widget.

Returns the enclosing spectrum widget

Returns
the spectrum widget

◆ getSnapFactor()

double getSnapFactor ( )

Returns the first intensity scaling factor for 'snap to maximum intensity mode'.

See also
snap_factors_

◆ getVisibleArea()

const AreaType& getVisibleArea ( ) const
inline

Returns the currently visible area.

See also
visible_area_

Referenced by TOPPViewBase::layerZoomChanged().

◆ getVisibleConsensusData

void getVisibleConsensusData ( ConsensusMapType map) const
slot

Fills the handed over map with the visible consensus features of the current layer.

Takes zoom area and data filters into account.

If the current layer is not a consensus feature layer, map is cleared only.

Referenced by TOPPViewBase::runTOPPTool_().

◆ getVisibleFeatureData

void getVisibleFeatureData ( FeatureMapType map) const
slot

Fills the handed over map with the visible features of the current layer.

Takes zoom area and data filters into account.

If the current layer is not a feature layer, map is cleared only.

Referenced by TOPPViewBase::runTOPPTool_().

◆ getVisibleIdentifications

void getVisibleIdentifications ( std::vector< PeptideIdentification > &  peptides) const
slot

Fills the handed over peptides with the visible peptide identifications of the current layer.

Takes zoom area into account.

If the current layer is not an identification data layer, peptides is cleared only.

◆ getVisiblePeakData

void getVisiblePeakData ( ExperimentType map) const
slot

Fills the handed over map with the visible peaks of the current layer.

Takes zoom area and data filters into account.

If the current layer is not a peak layer, map is cleared only.

Referenced by TOPPViewBase::runTOPPTool_().

◆ gridLinesShown()

bool gridLinesShown ( ) const
inline

Returns if the grid is currently shown.

Returns
true if the grid is visible, false otherwise

◆ horizontalScrollBarChange

virtual void horizontalScrollBarChange ( int  value)
virtualslot

Notifies the canvas that the horizontal scrollbar has been moved.

Reimplement this slot to react on scrollbar events.

◆ intensityModeChange_()

virtual void intensityModeChange_ ( )
protectedvirtual

This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes.

Reimplemented in Plot2DCanvas, and Plot1DCanvas.

◆ isMzToXAxis()

bool isMzToXAxis ( )
inline

Returns the mapping of m/z to axes.

◆ keyPressEvent()

void keyPressEvent ( QKeyEvent *  e)
overrideprotected

◆ keyReleaseEvent()

void keyReleaseEvent ( QKeyEvent *  e)
overrideprotected

◆ layerActivated

void layerActivated ( QWidget w)
signal

Signal emitted whenever a new layer is activated within the current window.

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ layerModficationChange

void layerModficationChange ( Size  layer,
bool  modified 
)
signal

Signal emitted whenever the modification status of a layer changes (editing and storing)

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ layerZoomChanged

void layerZoomChanged ( QWidget w)
signal

Signal emitted whenever the zoom changed.

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ leaveEvent()

void leaveEvent ( QEvent *  e)
overrideprotected

◆ modificationStatus_()

void modificationStatus_ ( Size  layer_index,
bool  modified 
)
protected

Takes all actions necessary when the modification status of a layer changes (signals etc.)

◆ mzToXAxis()

void mzToXAxis ( bool  mz_to_x_axis)

Sets the mapping of m/z to axes.

◆ paintGridLines_()

virtual void paintGridLines_ ( QPainter &  painter)
protectedvirtual

Helper function to paint grid lines.

Reimplemented in Plot1DCanvas.

◆ popIncompleteLayer_()

void popIncompleteLayer_ ( const QString &  error_message = "")
protected

remove already added layer which did not pass final checks in finishAdding_()

Parameters
error_messageOptional error message to show as messagebox

◆ preferencesChange

void preferencesChange ( )
signal

Emitted when the layer preferences have changed.

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ recalculateAxes

void recalculateAxes ( )
signal

Forces recalculation of axis ticks in the connected widget.

◆ recalculateRanges_()

void recalculateRanges_ ( UInt  mz_dim,
UInt  rt_dim,
UInt  it_dim 
)
protected

Recalculates the overall_data_range_.

A small margin is added to each side of the range in order to display all data.

Parameters
mz_dimInt of m/z in overall_data_range_
rt_dimInt of RT in overall_data_range_
it_dimInt of intensity in overall_data_range_

◆ recalculateSnapFactor_()

virtual void recalculateSnapFactor_ ( )
protectedvirtual

Recalculates the intensity scaling factor for 'snap to maximum intensity mode'.

See also
snap_factors_

Reimplemented in Plot2DCanvas, and Plot1DCanvas.

◆ removeLayer()

virtual void removeLayer ( Size  layer_index)
pure virtual

removes the layer with index layer_index

◆ removeLayers()

void removeLayers ( )
inline

removes all layers by calling removeLayer() for all layer indices (from highest to lowest)

◆ resetZoom

void resetZoom ( bool  repaint = true)
slot

Zooms fully out and resets the zoom stack.

Sets the visible area to the initial value, such that all data is shown.

Parameters
repaintIf true a repaint is forced. Otherwise only the new area is set.

Referenced by TOPPViewBase::resetZoom().

◆ resizeEvent()

void resizeEvent ( QResizeEvent *  e)
overrideprotected

◆ saveCurrentLayer()

virtual void saveCurrentLayer ( bool  visible)
pure virtual

Saves the current layer data.

Parameters
visibleIf true, only the visible data is stored. Otherwise the whole data is stored.

Implemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.

Referenced by TOPPViewBase::saveLayerAll(), and TOPPViewBase::saveLayerVisible().

◆ 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  message,
OpenMS::UInt  time 
)
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.

◆ setAdditionalContextMenu

void setAdditionalContextMenu ( QMenu *  menu)
slot

Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas.

◆ setCurrentLayerParameters()

void setCurrentLayerParameters ( const Param param)
inline

Sets the parameters of the current layer.

Referenced by TOPPViewBase::loadFiles().

◆ setFilters()

virtual void setFilters ( const DataFilters filters)
virtual

Sets the filters applied to the data before drawing (for the current layer)

Referenced by TOPPViewBase::addData(), and TOPPViewBase::TOPPViewBase().

◆ setIntensityMode()

void setIntensityMode ( IntensityModes  mod)
inline

Sets the intensity mode.

Sets the intensity mode

Parameters
modthe new intensity mode
See also
intensityModeChange_()

◆ setLabel()

void setLabel ( LayerData::LabelType  label)
inline

◆ setLayerFlag() [1/2]

void setLayerFlag ( LayerData::Flags  f,
bool  value 
)
inline

sets a layer flag of the current layer

Referenced by TOPPViewBase::changeUnassigned().

◆ setLayerFlag() [2/2]

void setLayerFlag ( Size  layer,
LayerData::Flags  f,
bool  value 
)
inline

sets a layer flag of the layer layer

◆ setLayerName()

void setLayerName ( Size  i,
const String name 
)

◆ setPlotWidget()

void setPlotWidget ( PlotWidget widget)
inline

Sets the spectrum widget.

Sets the enclosing spectrum widget. Call this from your PlotWidget derived class.

Parameters
widgetthe spectrum widget

◆ setVisibleArea

void setVisibleArea ( AreaType  area)
slot

Sets the visible area.

Sets the visible area to a new value. Note that it does not emit visibleAreaChanged()

Parameters
areathe new visible area

Referenced by TOPPViewBase::layerZoomChanged(), and TOPPViewBase::showCurrentPeaksAs3D().

◆ showCurrentLayerPreferences()

virtual void showCurrentLayerPreferences ( )
pure virtual

Shows the preferences dialog of the active layer.

Implemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.

Referenced by TOPPViewBase::showPreferences().

◆ showGridLines

void showGridLines ( bool  show)
slot

Whether or not to show grid lines.

Sets whether grid lines are shown or not.

Parameters
showBoolean variable deciding whether or not to show the grid lines.

Referenced by TOPPViewBase::toggleGridLines().

◆ showMetaData()

virtual void showMetaData ( bool  modifiable = false,
Int  index = -1 
)
virtual

Shows a dialog with the meta data.

Parameters
modifiableindicates if the data can be modified.
indexIf given, the meta data of the corresponding element (spectrum, feature, consensus feature) is shown instead of the layer meta data.

Referenced by TOPPViewBase::editMetadata(), and TOPPViewBase::showSpectrumMetaData().

◆ translateBackward_()

virtual void translateBackward_ ( )
protectedvirtual

Translation bound to the 'Down' key.

Reimplemented in Plot3DCanvas, and Plot2DCanvas.

◆ translateForward_()

virtual void translateForward_ ( )
protectedvirtual

Translation bound to the 'Up' key.

Reimplemented in Plot3DCanvas, and Plot2DCanvas.

◆ translateLeft_()

virtual void translateLeft_ ( Qt::KeyboardModifiers  m)
protectedvirtual

Translation bound to the 'Left' key.

Reimplemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.

◆ translateRight_()

virtual void translateRight_ ( Qt::KeyboardModifiers  m)
protectedvirtual

Translation bound to the 'Right' key.

Reimplemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.

◆ update_()

virtual void update_ ( const char *  caller_name)
protectedvirtual

Updates the displayed data.

The default implementation calls QWidget::update().

This method is reimplemented in the 3D view to update the OpenGL widget.

Parameters
caller_nameName of the calling function (use OPENMS_PRETTY_FUNCTION).

Reimplemented in Plot3DCanvas.

◆ updateCursor_

void updateCursor_ ( )
protectedslot

Updates the cursor according to the current action mode.

◆ updateHScrollbar

void updateHScrollbar ( float  ,
float  ,
float  ,
float   
)
signal

Triggers the update of the horizontal scrollbar.

◆ updateLayer

virtual void updateLayer ( Size  i)
pure virtualslot

Updates layer i when the data in the corresponding file changes.

Referenced by TOPPViewBase::fileChanged_().

◆ updateScrollbars_()

virtual void updateScrollbars_ ( )
protectedvirtual

Updates the scroll bars.

Updates the scrollbars after a change of the visible area.

Reimplemented in Plot2DCanvas, and Plot1DCanvas.

◆ updateVScrollbar

void updateVScrollbar ( float  ,
float  ,
float  ,
float   
)
signal

Triggers the update of the vertical scrollbar.

◆ verticalScrollBarChange

virtual void verticalScrollBarChange ( int  value)
virtualslot

Notifies the canvas that the vertical scrollbar has been moved.

Reimplement this slot to react on scrollbar events.

◆ visibleAreaChanged

void visibleAreaChanged ( DRange< 2 >  area)
signal

Change of the visible area.

Signal emitted whenever the visible area changes.

Parameters
areaThe new visible area.

◆ wheelEvent()

void wheelEvent ( QWheelEvent *  e)
overrideprotected

◆ widgetToData_() [1/2]

PointType widgetToData_ ( const QPoint &  pos)
inlineprotected

Calls widgetToData_ with x and y position of pos.

◆ widgetToData_() [2/2]

PointType widgetToData_ ( double  x,
double  y 
)
inlineprotected

Convert widget to chart coordinates.

Translates widget coordinates to chart coordinates.

Parameters
xthe widget coordinate x
ythe widget coordinate y
Returns
chart coordinates

◆ widgetToDataDistance

PointType widgetToDataDistance ( double  x,
double  y 
)
inlineslot

compute distance in widget coordinates (unit axis as shown) when moving x/y px in chart coordinates

◆ zoom_()

virtual void zoom_ ( int  x,
int  y,
bool  zoom_in 
)
protectedvirtual

Zooms such that screen point x, y would still point to the same data point.

Reimplemented in Plot1DCanvas.

◆ zoomAdd_()

void zoomAdd_ ( const AreaType area)
protected

Add a visible area to the zoom stack.

◆ zoomBack_()

void zoomBack_ ( )
protected

Go backward in zoom history.

◆ zoomClear_()

void zoomClear_ ( )
protected

Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately.

◆ zoomForward_()

virtual void zoomForward_ ( )
protectedvirtual

Go forward in zoom history.

Reimplemented in Plot1DCanvas.

Member Data Documentation

◆ action_mode_

ActionModes action_mode_
protected

Stores the current action mode (Pick, Zoom, Translate)

◆ buffer_

QImage buffer_
protected

Buffer that stores the actual peak information.

◆ context_add_

QMenu* context_add_
protected

External context menu extension.

◆ intensity_mode_

IntensityModes intensity_mode_
protected

Stores the used intensity mode function.

◆ last_mouse_pos_

QPoint last_mouse_pos_
protected

start position of mouse actions

◆ layers_

LayerStack layers_
protected

Layer data.

◆ measurement_start_

PeakIndex measurement_start_
protected

start peak of measuring mode

◆ mz_to_x_axis_

bool mz_to_x_axis_
protected

Stores the mapping of m/z.

◆ overall_data_range_

DRange<3> overall_data_range_
protected

Stores the data range (m/z, RT and intensity) of all layers.

Dimension 0 is the m/z dimension.
Dimension 1 is the RT dimension (2D and 3D view) or the intensity dimension (1D view).
Dimension 2 is the intensity dimension (2D and 3D view) or the RT dimension (1D view).

◆ percentage_factor_

double percentage_factor_
protected

Intensity scaling factor for relative scale with multiple layers.

In this mode all layers are scaled to the same maximum.

◆ rubber_band_

QRubberBand rubber_band_
protected

Rubber band for selected area.

◆ selected_peak_

PeakIndex selected_peak_
protected

selected peak

◆ show_grid_

bool show_grid_
protected

Stores whether or not to show a grid.

◆ show_timing_

bool show_timing_
protected

Flag that determines if timing data is printed to the command line.

◆ snap_factors_

std::vector<double> snap_factors_
protected

Intensity scaling factor for 'snap to maximum intensity mode'.

In this mode the highest currently visible intensity is treated like the maximum overall intensity.

One entry per layer.

◆ spectrum_widget_

PlotWidget* spectrum_widget_
protected

Back-pointer to the enclosing spectrum widget.

◆ update_buffer_

bool update_buffer_
protected

Whether to recalculate the data in the buffer when repainting.

◆ visible_area_

AreaType visible_area_
protected

Stores the currently visible area.

Dimension 0 is the m/z dimension.
Dimension 1 is the RT dimension (2D and 3D view) or the intensity dimension (1D view).

◆ zoom_pos_

std::vector<AreaType>::iterator zoom_pos_
protected

The current position in the zoom stack.

◆ zoom_stack_

std::vector<AreaType> zoom_stack_
protected

The zoom stack.