OpenMS  2.7.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-2021.
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 
86 
88  bool projectionsVisible() const;
89 
90 
91 public slots:
92  // Docu in base class
93  void recalculateAxes_() override;
98  // Docu in base class
99  void showGoToDialog() override;
100 
101 signals:
109  void showSpectrumAsNew1D(int index);
110  void showChromatogramsAsNew1D(std::vector<int, std::allocator<int> > indices);
113 
114 protected:
115  // Docu in base class
117  // Docu in base class
118  Math::Histogram<> createMetaDistribution_(const String & name) const override;
119 
125  QGroupBox * projection_box_;
129  QLabel * projection_sum_;
131  QLabel * projection_max_;
133  QCheckBox * projections_auto_;
136 
137 private slots:
143  void projectionInfo(int peaks, double intensity, double max);
146  };
147 }
148 
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerData.h:159
Representation of a histogram.
Definition: Histogram.h:64
Management and storage of parameters / INI files.
Definition: Param.h:70
Widget for visualization of several spectra.
Definition: Plot1DWidget.h:67
Canvas for 2D-visualization of peak map, feature map and consensus map data.
Definition: Plot2DCanvas.h:72
Widget for 2D-visualization of peak map and feature map data.
Definition: Plot2DWidget.h:65
Plot1DWidget * projection_vert_
Vertical projection widget.
Definition: Plot2DWidget.h:121
Plot2DCanvas * canvas()
This method is overwritten to make the class specific members accessible.
Definition: Plot2DWidget.h:77
void autoUpdateProjections()
slot that monitors the visible area changes and triggers the update of projections
void recalculateAxes_() override
Plot2DWidget(const Param &preferences, QWidget *parent=nullptr)
Default constructor.
LayerData::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: Plot2DWidget.h:69
Plot1DWidget * projection_horz_
Horizontal projection widget.
Definition: Plot2DWidget.h:123
void showSpectrumAsNew1D(int index)
Requests to display the spectrum with index index in 1D.
void horizontalProjection(ExperimentSharedPtrType exp)
shows the horizontal projection with the given data and draw mode
bool projectionsVisible() const
Returns if one of the projections is visible (or both are visible)
Math::Histogram createIntensityDistribution_() const override
creates the intensity distribution of the current layer
void toggleProjections()
Shows/hides the projections.
void visibleAreaChanged(DRange< 2 > area)
Signal emitted whenever the visible area changes.
QLabel * projection_sum_
Intensity sum of the projection.
Definition: Plot2DWidget.h:129
~Plot2DWidget() override
Destructor.
void updateProjections()
Updates and shows the projections.
QTimer * projections_timer_
Timer that triggers auto-update of projections.
Definition: Plot2DWidget.h:135
Math::Histogram createMetaDistribution_(const String &name) const override
creates the meta data distribution of value name of the current layer
QCheckBox * projections_auto_
Checkbox that indicates that projections should be automatically updated (with a slight delay)
Definition: Plot2DWidget.h:133
QLabel * projection_max_
Intensity maximum of the projection.
Definition: Plot2DWidget.h:131
void verticalProjection(ExperimentSharedPtrType exp)
shows the vertical projection with the given data and draw mode
const Plot1DWidget * getVerticalProjection() const
const reference to the vertical projection
void showChromatogramsAsNew1D(std::vector< int, std::allocator< int > > indices)
void showCurrentPeaksAs3D()
Requests to display all spectra as 1D.
QGroupBox * projection_box_
Group box that shows information about the projections.
Definition: Plot2DWidget.h:125
void showGoToDialog() override
QLabel * projection_peaks_
Number of peaks of the projection.
Definition: Plot2DWidget.h:127
void projectionInfo(int peaks, double intensity, double max)
shows projections information
const Plot1DWidget * getHorizontalProjection() const
const reference to the horizontal projection
Base class for spectrum widgets.
Definition: PlotWidget.h:83
A more convenient string class.
Definition: String.h:61
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47