OpenMS
PlotCanvas.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 //OpenMS
15 #include <OpenMS/CONCEPT/Types.h>
22 
23 //QT
24 #include <QtWidgets>
25 #include <QRubberBand>
26 
27 class QWheelEvent;
28 class QKeyEvent;
29 class QMouseEvent;
30 class QFocusEvent;
31 class QMenu;
32 
33 //STL
34 #include <stack>
35 #include <vector>
36 
37 namespace OpenMS
38 {
39  class PlotWidget;
40  class LayerDataChrom;
41  class LayerDataPeak;
42  class LayerDataFeature;
43  class LayerDataConsensus;
44 
45  using LayerDataBaseUPtr = std::unique_ptr<LayerDataBase>;
46  using LayerDataChromUPtr = std::unique_ptr<LayerDataChrom>;
47  using LayerDataPeakUPtr = std::unique_ptr<LayerDataPeak>;
48  using LayerDataFeatureUPtr = std::unique_ptr<LayerDataFeature>;
49  using LayerDataConsensusUPtr = std::unique_ptr<LayerDataConsensus>;
50 
56  class LayerStack
57  {
58  public:
61  void addLayer(LayerDataBaseUPtr new_layer);
62 
63  const LayerDataBase& getLayer(const Size index) const;
64 
65  LayerDataBase& getLayer(const Size index);
66 
68 
70 
72  void setCurrentLayer(Size index);
73 
75 
76  bool empty() const;
77 
79 
80  void removeLayer(Size layer_index);
81 
83 
84  protected:
85  std::vector<LayerDataBaseUPtr> layers_;
86  private:
88  };
89 
119  class OPENMS_GUI_DLLAPI PlotCanvas : public QWidget, public DefaultParamHandler
120  {
121  Q_OBJECT
122 
123  public:
126 
141 
150 
155 
158 
162 
164 
166 
169  {
172  AM_MEASURE
173  };
174 
177  {
181  IM_LOG
182  };
183 
185 
187  PlotCanvas(const Param& preferences, QWidget* parent = nullptr);
188 
190  ~PlotCanvas() override;
191 
199  inline void setPlotWidget(PlotWidget* widget)
200  {
201  spectrum_widget_ = widget;
202  }
203 
210  inline PlotWidget* getPlotWidget() const
211  {
212  return spectrum_widget_;
213  }
214 
221  inline Int getActionMode() const
222  {
223  return action_mode_;
224  }
225 
234  {
235  return intensity_mode_;
236  }
237 
248  {
249  intensity_mode_ = mod;
250  intensityModeChange_();
251  }
252 
258  inline bool gridLinesShown() const
259  {
260  return show_grid_;
261  }
262 
264  const LayerDataBase& getLayer(Size index) const
265  {
266  return layers_.getLayer(index);
267  }
270  {
271  return layers_.getLayer(index);
272  }
273 
276  {
277  return layers_.getCurrentLayer();
278  }
281  {
282  return layers_.getCurrentLayer();
283  }
284 
286  inline Size getCurrentLayerIndex() const
287  {
288  return layers_.getCurrentLayerIndex();
289  }
290 
293  {
294  return getLayerFlag(layers_.getCurrentLayerIndex(), f);
295  }
296 
298  void setLayerFlag(LayerDataBase::Flags f, bool value)
299  {
300  setLayerFlag(layers_.getCurrentLayerIndex(), f, value);
301  }
302 
305  {
306  return layers_.getLayer(layer).flags.test(f);
307  }
308 
310  void setLayerFlag(Size layer, LayerDataBase::Flags f, bool value)
311  {
312  // abort if there are no layers
313  if (layers_.empty())
314  return;
315 
316  layers_.getLayer(layer).flags.set(f, value);
317  update_buffer_ = true;
318  update();
319  }
320 
322  {
323  // abort if there are no layers
324  if (layers_.empty())
325  return;
326  layers_.getCurrentLayer().label = label;
327  update_buffer_ = true;
328  update();
329  }
330 
337  {
338  return visible_area_;
339  }
340 
343  bool isVisible(const PointOnAxis& p) const
344  {
345  return visible_area_.getAreaXY().encloses(p);
346  }
347 
351  {
352  int X_pixel_count = buffer_.width();
353  int Y_pixel_count = buffer_.height();
354  PixelArea area(&unit_mapper_);
355  area.setArea(AreaXYType(0, 0, X_pixel_count, Y_pixel_count));
356  return area;
357  }
358 
362  virtual void setFilters(const DataFilters& filters);
363 
371  inline Size getLayerCount() const
372  {
373  return layers_.getLayerCount();
374  }
375 
377  virtual void activateLayer(Size layer_index) = 0;
379  virtual void removeLayer(Size layer_index) = 0;
380 
383  {
384  for (Size i = getLayerCount(); i > 0; --i)
385  {
386  removeLayer(i - 1);
387  }
388  visible_area_.clear(); // reset visible area
389  }
390 
392  bool addLayer(std::unique_ptr<LayerData1DBase> layer);
393 
407  const String& filename = "",
408  const String& caption = "",
409  const bool use_noise_cutoff = false);
410 
421  bool addChromLayer(const ExperimentSharedPtrType& map, ODExperimentSharedPtrType od_map, const String& filename = "", const String& caption = "");
422 
423 
433  bool addLayer(FeatureMapSharedPtrType map, const String& filename = "", const String& caption = "");
434 
444  bool addLayer(ConsensusMapSharedPtrType map, const String& filename = "", const String& caption = "");
446 
458  bool addLayer(std::vector<PeptideIdentification>& peptides, const String& filename = "", const String& caption = "");
459 
461  inline float getCurrentMinIntensity() const
462  {
463  return layers_.getCurrentLayer().getMinIntensity();
464  }
465 
467  inline float getCurrentMaxIntensity() const
468  {
469  return layers_.getCurrentLayer().getMaxIntensity();
470  }
471 
473  inline float getMinIntensity(Size index) const
474  {
475  return getLayer(index).getMinIntensity();
476  }
477 
479  inline float getMaxIntensity(Size index) const
480  {
481  return getLayer(index).getMaxIntensity();
482  }
483 
485  void setLayerName(Size i, const String& name);
486 
489 
491  inline void setCurrentLayerParameters(const Param& param)
492  {
493  getCurrentLayer().param = param;
494  emit preferencesChange();
495  }
496 
502  virtual const RangeType& getDataRange() const;
503 
509  double getSnapFactor();
510 
512  double getPercentageFactor() const;
513 
515  virtual void showCurrentLayerPreferences() = 0;
516 
523  virtual void showMetaData(bool modifiable = false, Int index = -1);
524 
525  public slots:
526 
533  void changeVisibility(Size i, bool b);
534 
541  void changeLayerFilterState(Size i, bool b);
542 
549  void showGridLines(bool show);
550 
558  virtual void resetZoom(bool repaint = true);
559 
567  void setVisibleArea(const VisibleArea& area);
568 
576  void setVisibleArea(const RangeAllType& area);
577 
585  void setVisibleArea(const AreaXYType& area);
586 
592  void setVisibleAreaX(double min, double max);
593 
599  void setVisibleAreaY(double min, double max);
600 
606  void saveCurrentLayer(bool visible);
607 
613  virtual void horizontalScrollBarChange(int value);
614 
620  virtual void verticalScrollBarChange(int value);
621 
623  void setAdditionalContextMenu(QMenu * menu);
624 
626  virtual void updateLayer(Size i) = 0;
627 
628 
634  {
635  return AreaXYType({0, 0}, {(float)width(), (float)height()});
636  }
637 
642  const DimMapper<2>& getMapper() const;
643 
648  void setMapper(const DimMapper<2>& mapper);
649 
650  signals:
652  void layerModficationChange(Size layer, bool modified);
653 
656 
659 
666  void visibleAreaChanged(const VisibleArea& area);
667 
669  void sendCursorStatus(const String& x_value, const String& y_value);
670 
672  void sendStatusMessage(std::string message, OpenMS::UInt time);
673 
676 
678  void updateVScrollbar(float f_min, float disp_min, float disp_max, float f_max);
679 
681  void updateHScrollbar(float f_min, float disp_min, float disp_max, float f_max);
682 
685 
688 
691 
692 protected slots:
693 
696 
697 protected:
698 
700  void drawText_(QPainter & painter, const QStringList& text);
701 
703  double getIdentificationMZ_(const Size layer_index,
704  const PeptideIdentification & peptide) const;
705 
707  virtual bool finishAdding_() = 0;
708 
711  void popIncompleteLayer_(const QString& error_message = "");
712 
714 
715  void resizeEvent(QResizeEvent * e) override;
716  void wheelEvent(QWheelEvent * e) override;
717  void keyPressEvent(QKeyEvent * e) override;
718  void keyReleaseEvent(QKeyEvent * e) override;
719  void focusOutEvent(QFocusEvent * e) override;
720  void leaveEvent(QEvent * e) override;
721  void enterEvent(QEnterEvent * e) override;
723 
725  virtual void intensityModeChange_();
726 
729 
740  virtual void changeVisibleArea_(VisibleArea new_area, bool repaint = true, bool add_to_stack = false);
741 
747  virtual void recalculateSnapFactor_();
748 
750 
751  virtual void zoom_(int x, int y, bool zoom_in);
754  void zoomBack_();
756  virtual void zoomForward_();
758  void zoomAdd_(const VisibleArea& area);
760  void zoomClear_();
762 
764 
765  virtual void translateLeft_(Qt::KeyboardModifiers m);
768  virtual void translateRight_(Qt::KeyboardModifiers m);
770  virtual void translateForward_();
772  virtual void translateBackward_();
774 
780  virtual void updateScrollbars_();
781 
791  inline PointXYType widgetToData_(double x, double y)
792  {
793  const auto& xy = visible_area_.getAreaXY();
794  return PointXYType(
795  xy.minX() + x / width() * xy.width(),
796  xy.minY() + (height() - y) / height() * xy.height()
797  );
798  }
799 
801  inline PointXYType widgetToData_(const QPoint& pos)
802  {
803  return widgetToData_(pos.x(), pos.y());
804  }
805 
807  virtual void paintGridLines_(QPainter & painter);
808 
810  QImage buffer_;
811 
814 
816  ActionModes action_mode_ = AM_TRANSLATE;
817 
819  IntensityModes intensity_mode_ = IM_NONE;
820 
823 
831 
837  virtual void recalculateRanges_();
838 
843 
845  bool show_grid_ = true;
846 
848  std::vector<VisibleArea> zoom_stack_;
850  std::vector<VisibleArea>::iterator zoom_pos_ = zoom_stack_.end();
851 
861  virtual void update_(const char* caller_name);
862 
864  void modificationStatus_(Size layer_index, bool modified);
865 
867  bool update_buffer_ = false;
868 
870  PlotWidget* spectrum_widget_ = nullptr;
871 
874 
881  double percentage_factor_ = 1.0;
882 
890  std::vector<double> snap_factors_;
891 
893  QRubberBand rubber_band_;
894 
896  QMenu* context_add_ = nullptr;
897 
899  bool show_timing_ = false;
900 
905 
908  {
909  std::set<DataProcessing::ProcessingAction> actions;
910  actions.insert(action);
911 
912  DataProcessingPtr p = boost::shared_ptr<DataProcessing>(new DataProcessing);
913  //actions
914  p->setProcessingActions(actions);
915  //software
916  p->getSoftware().setName("PlotCanvas");
917  //version
918  p->getSoftware().setVersion(VersionInfo::getVersion());
919  //time
920  p->setCompletionTime(DateTime::now());
921 
922  for (Size i = 0; i < map.size(); ++i)
923  {
924  map[i].getDataProcessing().push_back(p);
925  }
926  }
927 
928  };
929 }
Definition: DimMapper.h:802
const Area & setArea(const RangeAllType &data)
Set the area using unit data (RT, m/z, ...)
Definition: DimMapper.h:848
A container for consensus elements.
Definition: ConsensusMap.h:66
DataFilter array providing some convenience functions.
Definition: DataFilters.h:27
Description of the applied preprocessing steps.
Definition: DataProcessing.h:27
ProcessingAction
Definition: DataProcessing.h:33
static DateTime now()
Returns the current date and time.
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Allows dynamical switching (at runtime) between a dimension (RT, m/z, int, IM, etc) and X,...
Definition: DimMapper.h:619
A container for features.
Definition: FeatureMap.h:80
Class that stores the data for one layer.
Definition: LayerDataBase.h:169
Definition: PlotCanvas.h:57
Size getLayerCount() const
Size getCurrentLayerIndex() const
Size current_layer_
Definition: PlotCanvas.h:87
LayerDataBase & getCurrentLayer()
bool empty() const
LayerDataBase & getLayer(const Size index)
void removeLayer(Size layer_index)
const LayerDataBase & getLayer(const Size index) const
void setCurrentLayer(Size index)
throws Exception::IndexOverflow unless index is smaller than getLayerCount()
void addLayer(LayerDataBaseUPtr new_layer)
const LayerDataBase & getCurrentLayer() const
std::vector< LayerDataBaseUPtr > layers_
Definition: PlotCanvas.h:85
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Size size() const noexcept
The number of spectra.
Definition: MSExperiment.h:121
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:110
Management and storage of parameters / INI files.
Definition: Param.h:44
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:28
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
Base class for visualization canvas classes.
Definition: PlotCanvas.h:120
void setVisibleAreaX(double min, double max)
Set only the visible area for the x axis; other axes are untouched.
virtual void translateBackward_()
Translation bound to the 'Down' key.
float getMaxIntensity(Size index) const
Returns the maximum intensity of the layer with index index.
Definition: PlotCanvas.h:479
float getMinIntensity(Size index) const
Returns the minimum intensity of the layer with index index.
Definition: PlotCanvas.h:473
float getCurrentMinIntensity() const
Returns the minimum intensity of the active layer.
Definition: PlotCanvas.h:461
void addDataProcessing_(PeakMap &map, DataProcessing::ProcessingAction action) const
Data processing setter for peak maps.
Definition: PlotCanvas.h:907
void layerActivated(QWidget *w)
Signal emitted whenever a new layer is activated within the current window.
void setLayerName(Size i, const String &name)
Sets the name of layer i.
~PlotCanvas() override
Destructor.
bool addLayer(std::vector< PeptideIdentification > &peptides, const String &filename="", const String &caption="")
Add an identification data layer.
std::vector< VisibleArea > zoom_stack_
The zoom stack.
Definition: PlotCanvas.h:848
LayerStack layers_
Layer data.
Definition: PlotCanvas.h:822
virtual void recalculateRanges_()
Recalculates the overall_data_range_.
std::vector< double > snap_factors_
Intensity scaling factor for 'snap to maximum intensity mode'.
Definition: PlotCanvas.h:890
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/t...
PlotCanvas(const Param &preferences, QWidget *parent=nullptr)
Default constructor.
LayerDataBase::ConstExperimentSharedPtrType ConstExperimentSharedPtrType
Definition: PlotCanvas.h:131
String getLayerName(Size i)
Gets the name of layer i.
virtual void horizontalScrollBarChange(int value)
Notifies the canvas that the horizontal scrollbar has been moved.
SpectrumType::PeakType PeakType
Peak type.
Definition: PlotCanvas.h:147
QImage buffer_
Buffer that stores the actual peak information.
Definition: PlotCanvas.h:810
void setMapper(const DimMapper< 2 > &mapper)
Set a new mapper for the canvas.
DimMapper< 2 > unit_mapper_
Mapper for X and Y axis.
Definition: PlotCanvas.h:813
PeakIndex selected_peak_
selected peak
Definition: PlotCanvas.h:902
double getPercentageFactor() const
Returns the percentage factor.
void setIntensityMode(IntensityModes mod)
Sets the intensity mode.
Definition: PlotCanvas.h:247
RangeType overall_data_range_
Stores the data range (m/z, RT and intensity) of all layers.
Definition: PlotCanvas.h:842
void recalculateAxes()
Forces recalculation of axis ticks in the connected widget.
LayerDataBase::ConsensusMapSharedPtrType ConsensusMapSharedPtrType
Main managed data type (consensus features)
Definition: PlotCanvas.h:140
Size getLayerCount() const
Returns the number of layers.
Definition: PlotCanvas.h:371
virtual void updateLayer(Size i)=0
Updates layer i when the data in the corresponding file changes.
bool gridLinesShown() const
Returns if the grid is currently shown.
Definition: PlotCanvas.h:258
void setVisibleArea(const VisibleArea &area)
Sets the visible area.
SpectrumType::ConstIterator SpectrumConstIteratorType
Spectrum iterator type (iterates over peaks)
Definition: PlotCanvas.h:145
LayerDataBase::FeatureMapSharedPtrType FeatureMapSharedPtrType
Main managed data type (features)
Definition: PlotCanvas.h:136
virtual void updateScrollbars_()
Updates the scroll bars.
Size getCurrentLayerIndex() const
returns the index of the active layer
Definition: PlotCanvas.h:286
void setLabel(LayerDataBase::LabelType label)
Definition: PlotCanvas.h:321
Int getActionMode() const
Returns the action mode.
Definition: PlotCanvas.h:221
void setVisibleAreaY(double min, double max)
Set only the visible area for the y axis; other axes are untouched.
const DimMapper< 2 > & getMapper() const
Get Mapper to translate between values for axis (X/Y) and units (m/z, RT, intensity,...
virtual void activateLayer(Size layer_index)=0
change the active layer (the one that is used for selecting and so on)
const LayerDataBase & getLayer(Size index) const
returns the layer data with index index
Definition: PlotCanvas.h:264
void updateCursor_()
Updates the cursor according to the current action mode.
void sendCursorStatus(const String &x_value, const String &y_value)
Emitted when the cursor position changes (for displaying e.g. in status bar)
virtual void removeLayer(Size layer_index)=0
removes the layer with index layer_index
virtual void verticalScrollBarChange(int value)
Notifies the canvas that the vertical scrollbar has been moved.
void actionModeChange()
Emitted when the action mode changes.
LayerDataBase & getLayer(Size index)
returns the layer data with index index
Definition: PlotCanvas.h:269
void leaveEvent(QEvent *e) override
void zoomClear_()
Clears the zoom stack and invalidates the current zoom position. After calling this,...
void keyReleaseEvent(QKeyEvent *e) override
void drawText_(QPainter &painter, const QStringList &text)
Draws several lines of text to the upper right corner of the widget.
ExperimentType::SpectrumType SpectrumType
Spectrum type.
Definition: PlotCanvas.h:143
virtual void showMetaData(bool modifiable=false, Int index=-1)
Shows a dialog with the meta data.
virtual void paintGridLines_(QPainter &painter)
Helper function to paint grid lines.
LayerDataBase & getCurrentLayer()
returns the layer data of the active layer
Definition: PlotCanvas.h:280
PointXYType widgetToData_(double x, double y)
Convert widget (pixel) to chart (unit) coordinates.
Definition: PlotCanvas.h:791
void keyPressEvent(QKeyEvent *e) override
void setLayerFlag(LayerDataBase::Flags f, bool value)
sets a layer flag of the current layer
Definition: PlotCanvas.h:298
virtual void zoomForward_()
Go forward in zoom history.
void setAdditionalContextMenu(QMenu *menu)
Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas.
Area< 2 >::AreaXYType AreaXYType
The range of data shown on the X and Y axis (unit depends on runtime config)
Definition: PlotCanvas.h:152
void changeVisibility(Size i, bool b)
change the visibility of a layer
bool getLayerFlag(Size layer, LayerDataBase::Flags f) const
returns a layer flag of the layer layer
Definition: PlotCanvas.h:304
PixelArea getPixelRange() const
Definition: PlotCanvas.h:350
PointXYType widgetToData_(const QPoint &pos)
Calls widgetToData_ with x and y position of pos.
Definition: PlotCanvas.h:801
void wheelEvent(QWheelEvent *e) override
void focusOutEvent(QFocusEvent *e) override
const VisibleArea & getVisibleArea() const
Returns the currently visible area. This is the authority which determines the X and Y axis' scale.
Definition: PlotCanvas.h:336
void visibleAreaChanged(const VisibleArea &area)
Change of the visible area.
void modificationStatus_(Size layer_index, bool modified)
Takes all actions necessary when the modification status of a layer changes (signals etc....
bool addLayer(FeatureMapSharedPtrType map, const String &filename="", const String &caption="")
Add a feature data layer.
virtual void translateForward_()
Translation bound to the 'Up' key.
void zoomBack_()
Go backward in zoom history.
IntensityModes
Display modes of intensity.
Definition: PlotCanvas.h:177
@ IM_NONE
Normal mode: f(x)=x; y-axis shows the maximum of all layers, no scaling.
Definition: PlotCanvas.h:178
@ IM_SNAP
Shows the maximum displayed intensity (across all layers) as if it was the overall maximum intensity.
Definition: PlotCanvas.h:180
@ IM_PERCENTAGE
Shows intensities normalized by each layer's maximum: f(x)=x/max(x)*100.
Definition: PlotCanvas.h:179
LayerDataBase::FeatureMapType FeatureMapType
Main data type (features)
Definition: PlotCanvas.h:134
float getCurrentMaxIntensity() const
Returns the maximum intensity of the active layer.
Definition: PlotCanvas.h:467
void saveCurrentLayer(bool visible)
Saves the current layer data.
AreaXYType canvasPixelArea() const
Get the Area in pixel coordinates of the current canvas for X and Y axis.
Definition: PlotCanvas.h:633
virtual void setFilters(const DataFilters &filters)
Sets the filters applied to the data before drawing (for the current layer)
const LayerDataBase & getCurrentLayer() const
returns the layer data of the active layer
Definition: PlotCanvas.h:275
void changeLayerFilterState(Size i, bool b)
change if the defined data filters are used
void layerModficationChange(Size layer, bool modified)
Signal emitted whenever the modification status of a layer changes (editing and storing)
virtual void translateRight_(Qt::KeyboardModifiers m)
Translation bound to the 'Right' key.
void setCurrentLayerParameters(const Param &param)
Sets the parameters of the current layer.
Definition: PlotCanvas.h:491
void updateHScrollbar(float f_min, float disp_min, float disp_max, float f_max)
Triggers the update of the horizontal scrollbar.
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 displ...
virtual void resetZoom(bool repaint=true)
Zooms fully out and resets the zoom stack.
void setVisibleArea(const AreaXYType &area)
Sets the visible area.
bool addLayer(std::unique_ptr< LayerData1DBase > layer)
Add an already constructed layer (e.g. for projections)
QPoint last_mouse_pos_
start position of mouse actions
Definition: PlotCanvas.h:873
double getSnapFactor()
Returns the first intensity scaling factor for 'snap to maximum intensity mode' (for the currently vi...
virtual bool finishAdding_()=0
Method that is called when a new layer has been added.
ActionModes
Mouse action modes.
Definition: PlotCanvas.h:169
@ AM_ZOOM
zoom
Definition: PlotCanvas.h:171
@ AM_TRANSLATE
translate
Definition: PlotCanvas.h:170
bool addPeakLayer(const ExperimentSharedPtrType &map, ODExperimentSharedPtrType od_map, const String &filename="", const String &caption="", const bool use_noise_cutoff=false)
Add a peak data layer.
virtual void intensityModeChange_()
This method is called whenever the intensity mode changes. Reimplement if you need to react on such c...
virtual void changeVisibleArea_(VisibleArea new_area, bool repaint=true, bool add_to_stack=false)
Sets the visible area.
bool isVisible(const PointOnAxis &p) const
Definition: PlotCanvas.h:343
void popIncompleteLayer_(const QString &error_message="")
void preferencesChange()
Emitted when the layer preferences have changed.
PeakIndex measurement_start_
start peak of measuring mode
Definition: PlotCanvas.h:904
IntensityModes getIntensityMode() const
Returns the intensity mode.
Definition: PlotCanvas.h:233
bool getLayerFlag(LayerDataBase::Flags f) const
returns a layer flag of the current layer
Definition: PlotCanvas.h:292
void updateVScrollbar(float f_min, float disp_min, float disp_max, float f_max)
Triggers the update of the vertical scrollbar.
bool addLayer(ConsensusMapSharedPtrType map, const String &filename="", const String &caption="")
Add a consensus feature data layer.
void zoomAdd_(const VisibleArea &area)
Add a visible area to the zoom stack.
virtual void showCurrentLayerPreferences()=0
Shows the preferences dialog of the active layer.
void resizeEvent(QResizeEvent *e) override
QRubberBand rubber_band_
Rubber band for selected area.
Definition: PlotCanvas.h:893
LayerDataBase::ConsensusMapType ConsensusMapType
Main data type (consensus features)
Definition: PlotCanvas.h:138
DimMapper< 2 >::Point PointOnAxis
Definition: PlotCanvas.h:165
LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: PlotCanvas.h:130
bool addChromLayer(const ExperimentSharedPtrType &map, ODExperimentSharedPtrType od_map, const String &filename="", const String &caption="")
Add a chrom data layer.
void changeLegendVisibility()
Toggle axis legend visibility change.
void showGridLines(bool show)
Whether or not to show grid lines.
void layerZoomChanged(QWidget *w)
Signal emitted whenever the zoom changed.
virtual void recalculateSnapFactor_()
Recalculates the intensity scaling factor for 'snap to maximum intensity mode'.
void removeLayers()
removes all layers by calling removeLayer() for all layer indices (from highest to lowest)
Definition: PlotCanvas.h:382
LayerDataBase::ODExperimentSharedPtrType ODExperimentSharedPtrType
Definition: PlotCanvas.h:132
virtual const RangeType & getDataRange() const
Returns the area which encloses all data points of all layers.
void enterEvent(QEnterEvent *e) override
PlotWidget * getPlotWidget() const
Returns the spectrum widget.
Definition: PlotCanvas.h:210
void dimensionsChanged_()
Call this whenever the DimMapper receives new dimensions; will update the axes and scrollbars.
VisibleArea visible_area_
Stores the currently visible area in data units (e.g. seconds, m/z, intensity etc) and axis (X,...
Definition: PlotCanvas.h:830
virtual void update_(const char *caller_name)
Updates the displayed data.
void setLayerFlag(Size layer, LayerDataBase::Flags f, bool value)
sets a layer flag of the layer layer
Definition: PlotCanvas.h:310
void setVisibleArea(const RangeAllType &area)
Sets the visible area.
void setPlotWidget(PlotWidget *widget)
Sets the spectrum widget.
Definition: PlotCanvas.h:199
LayerDataBase::ExperimentType ExperimentType
Main data type (experiment)
Definition: PlotCanvas.h:128
Base class for spectrum widgets.
Definition: PlotWidget.h:57
A more convenient string class.
Definition: String.h:34
static String getVersion()
Return the version number of OpenMS.
int Int
Signed integer type.
Definition: Types.h:72
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::unique_ptr< LayerDataChrom > LayerDataChromUPtr
Definition: PlotCanvas.h:46
std::unique_ptr< LayerDataConsensus > LayerDataConsensusUPtr
Definition: PlotCanvas.h:49
std::unique_ptr< LayerDataBase > LayerDataBaseUPtr
Definition: PlotCanvas.h:45
RangeManager< RangeRT, RangeMZ, RangeIntensity, RangeMobility > RangeAllType
Range which contains all known dimensions.
Definition: RangeManager.h:896
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: DataProcessing.h:111
DPosition< 2U > PointXYType
Type of the Points in a 'flat' canvas (1D and 2D)
Definition: CommonDefs.h:33
std::unique_ptr< LayerDataFeature > LayerDataFeatureUPtr
Definition: PlotCanvas.h:48
std::unique_ptr< LayerDataPeak > LayerDataPeakUPtr
Definition: PlotCanvas.h:47
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerDataBase.h:126
boost::shared_ptr< OnDiscMSExperiment > ODExperimentSharedPtrType
SharedPtr on On-Disc MSExperiment.
Definition: LayerDataBase.h:131
LabelType
Label used in visualization.
Definition: LayerDataBase.h:98
boost::shared_ptr< FeatureMap > FeatureMapSharedPtrType
SharedPtr on feature map.
Definition: LayerDataBase.h:114
boost::shared_ptr< const ExperimentType > ConstExperimentSharedPtrType
Definition: LayerDataBase.h:128
boost::shared_ptr< ConsensusMap > ConsensusMapSharedPtrType
SharedPtr on consensus features.
Definition: LayerDataBase.h:120
Flags
Flags that determine which information is shown.
Definition: LayerDataBase.h:84
Index of a peak or feature.
Definition: PeakIndex.h:25