OpenMS  3.0.0
Plot2DWidget.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg$
32 // $Authors: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
40 // OpenMS
43 
44 class QGroupBox;
45 class QLabel;
46 class QCheckBox;
47 
48 namespace OpenMS
49 {
50  class Plot1DWidget;
51 
63  class OPENMS_GUI_DLLAPI Plot2DWidget :
64  public PlotWidget
65  {
66  Q_OBJECT
67 public:
70 
72  Plot2DWidget(const Param & preferences, QWidget * parent = nullptr);
74  ~Plot2DWidget() override;
75 
77  inline Plot2DCanvas * canvas()
78  {
79  return static_cast<Plot2DCanvas *>(canvas_);
80  }
81 
83  const Plot1DWidget * getHorizontalProjection() const;
85  const Plot1DWidget * getVerticalProjection() const;
86 
88  bool projectionsVisible() const;
89 
90 
91 public slots:
92  // Docu in base class
93  void recalculateAxes_() override;
95  void toggleProjections();
97  void updateProjections();
98  // Docu in base class
99  void showGoToDialog() override;
100 
101 signals:
107  void visibleAreaChanged(DRange<2> area);
109  void showSpectrumAsNew1D(int index);
110  void showChromatogramsAsNew1D(std::vector<int, std::allocator<int> > indices);
112  void showCurrentPeaksAs3D();
113 
114 protected:
120  QGroupBox * projection_box_;
124  QLabel * projection_sum_;
126  QLabel * projection_max_;
128  QCheckBox * projections_auto_;
131 
132 private slots:
134  void horizontalProjection(ExperimentSharedPtrType exp);
136  void verticalProjection(ExperimentSharedPtrType exp);
138  void projectionInfo(int peaks, double intensity, double max);
140  void autoUpdateProjections();
141  };
142 }
143 
OpenMS::Plot2DWidget::projection_sum_
QLabel * projection_sum_
Intensity sum of the projection.
Definition: Plot2DWidget.h:124
PlotWidget.h
OpenMS::PlotWidget
Base class for spectrum widgets.
Definition: PlotWidget.h:80
OpenMS::Plot2DWidget::projection_vert_
Plot1DWidget * projection_vert_
Vertical projection widget.
Definition: Plot2DWidget.h:116
OpenMS::Plot2DWidget
Widget for 2D-visualization of peak map and feature map data.
Definition: Plot2DWidget.h:63
OpenMS::DRange< 2 >
OpenMS::Plot2DWidget::projection_max_
QLabel * projection_max_
Intensity maximum of the projection.
Definition: Plot2DWidget.h:126
OpenMS::Plot2DWidget::projection_peaks_
QLabel * projection_peaks_
Number of peaks of the projection.
Definition: Plot2DWidget.h:122
QWidget
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::Plot2DWidget::ExperimentSharedPtrType
LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: Plot2DWidget.h:69
OpenMS::Plot2DWidget::projection_box_
QGroupBox * projection_box_
Group box that shows information about the projections.
Definition: Plot2DWidget.h:120
OpenMS::LayerDataBase::ExperimentSharedPtrType
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerDataBase.h:161
OpenMS::Plot2DWidget::projection_horz_
Plot1DWidget * projection_horz_
Horizontal projection widget.
Definition: Plot2DWidget.h:118
OpenMS::Plot2DCanvas
Canvas for 2D-visualization of peak map, feature map and consensus map data.
Definition: Plot2DCanvas.h:70
OpenMS::Plot1DWidget
Widget for visualization of several spectra.
Definition: Plot1DWidget.h:65
OpenMS::Plot2DWidget::projections_auto_
QCheckBox * projections_auto_
Checkbox that indicates that projections should be automatically updated (with a slight delay)
Definition: Plot2DWidget.h:128
OpenMS::Plot2DWidget::canvas
Plot2DCanvas * canvas()
This method is overwritten to make the class specific members accessible.
Definition: Plot2DWidget.h:77
Plot2DCanvas.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::Plot2DWidget::projections_timer_
QTimer * projections_timer_
Timer that triggers auto-update of projections.
Definition: Plot2DWidget.h:130