OpenMS
Plot1DWidget.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, 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 // STL
15 #include <vector>
16 
17 // OpenMS
20 
21 class QAction;
22 class QSpacerItem;
23 
24 namespace OpenMS
25 {
26  class Plot1DCanvas;
27 
39  class OPENMS_GUI_DLLAPI Plot1DWidget :
40  public PlotWidget
41  {
42  Q_OBJECT
43 
44 public:
46  Plot1DWidget(const Param& preferences, const DIM gravity_axis = DIM::Y, QWidget* parent = nullptr);
48  ~Plot1DWidget() override;
49 
50  // docu in base class
51  Plot1DCanvas* canvas() const override
52  {
53  return static_cast<Plot1DCanvas*>(canvas_);
54  }
55 
56  // Docu in base class
57  void setMapper(const DimMapper<2>& mapper) override
58  {
59  canvas_->setMapper(mapper);
60  }
61 
62  // Docu in base class
63  void hideAxes() override;
64 
65  // Docu in base class
66  void showLegend(bool show) override;
67 
69  void toggleMirrorView(bool mirror);
70 
72  void performAlignment(Size layer_index_1, Size layer_index_2, const Param & param);
73 
76 
77  // Docu in base class
78  void saveAsImage() override;
79 
80  // Docu in base class
81  virtual void renderForImage(QPainter& painter);
82 
83 signals:
86 
89 
92 
94  void showCurrentPeaksAsDIA(const Precursor& pc, const MSExperiment& exp);
95 
96 public slots:
97  // Docu in base class
98  void showGoToDialog() override;
99 
100 protected:
101  // Docu in base class
102  void recalculateAxes_() override;
103 
106 
108  QSpacerItem * spacer_;
109 
110  };
111 } // namespace OpenMS
112 
Widget that represents an axis of a graph.
Definition: AxisWidget.h:39
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Management and storage of parameters / INI files.
Definition: Param.h:44
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:295
Widget for visualization of several spectra.
Definition: Plot1DWidget.h:41
void recalculateAxes_() override
recalculates the Axis ticks
AxisWidget * flipped_y_axis_
The second y-axis for the mirror view.
Definition: Plot1DWidget.h:105
QSpacerItem * spacer_
Spacer between the two y-axes in mirror mode (needed when visualizing an alignment)
Definition: Plot1DWidget.h:108
Plot1DWidget(const Param &preferences, const DIM gravity_axis=DIM::Y, QWidget *parent=nullptr)
Default constructor.
void showCurrentPeaksAs2D()
Requests to display the whole spectrum in 2D view.
void showCurrentPeaksAsIonMobility(const MSSpectrum &spec)
Requests to display the whole spectrum in ion mobility view.
void setMapper(const DimMapper< 2 > &mapper) override
Set a new mapper for the canvas and axis. Internally, all dependent components are updated (e....
Definition: Plot1DWidget.h:57
void toggleMirrorView(bool mirror)
Switches to mirror view, displays another y-axis for the second spectrum.
~Plot1DWidget() override
Destructor.
void performAlignment(Size layer_index_1, Size layer_index_2, const Param &param)
Performs an alignment of the layers with layer_index_1 and layer_index_2.
void saveAsImage() override
Saves the widget's content as image file.
void showCurrentPeaksAsDIA(const Precursor &pc, const MSExperiment &exp)
Requests to display a full DIA window.
void showCurrentPeaksAs3D()
Requests to display the whole spectrum in 3D view.
void showGoToDialog() override
virtual void renderForImage(QPainter &painter)
void hideAxes() override
Hides x-axis and y-axis.
Plot1DCanvas * canvas() const override
Returns a pointer to canvas object.
Definition: Plot1DWidget.h:51
void showLegend(bool show) override
Shows/hides axis labels.
void resetAlignment()
Resets the alignment.
Base class for spectrum widgets.
Definition: PlotWidget.h:57
Precursor meta information.
Definition: Precursor.h:35
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
DIM
Definition: DimMapper.h:601