libpappsomspp
Library for mass spectrometry
xicwidget.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/widget/xicwidget/xicwidget.h
3  * \date 12/1/2018
4  * \author Olivier Langella
5  * \brief plot a XIC
6  */
7 
8 
9 /*******************************************************************************
10  * Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
11  *
12  * This file is part of the PAPPSOms++ library.
13  *
14  * PAPPSOms++ is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * PAPPSOms++ is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26  *
27  * Contributors:
28  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
29  *implementation
30  ******************************************************************************/
31 
32 #pragma once
33 
34 #include <QWidget>
35 #include "../../xic/xic.h"
36 #include "../../processing/detection/tracepeak.h"
37 #include "../graphicdevicewidget.h"
38 
39 
40 namespace pappso
41 {
42 class QCPXic;
43 
44 typedef std::vector<std::pair<XicCstSPtr, TracePeakCstSPtr>> XicXicPeakPairList;
45 
46 class PMSPP_LIB_DECL XicWidget : public GraphicDeviceWidget
47 {
48  Q_OBJECT
49  public:
50  XicWidget(QWidget *parent = 0);
51  ~XicWidget();
52 
53 
54  void addXicSp(XicCstSPtr &xic_sp);
55  void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt);
56  void
57  addXicPeakList(const Xic *xic_p,
58  const std::vector<pappso::TracePeakCstSPtr> &xic_peak_list);
59  void setName(const Xic *xic_p, const QString &name);
60  const QString &getName(const Xic *xic_p) const;
61  void clear();
62  void plot();
63  void rescale();
64  void toQPaintDevice(QPaintDevice *device, const QSize &size) override;
65  void setRetentionTimeInSeconds();
66  void setRetentionTimeInMinutes();
67  void drawXicPeakBorders(pappso::TracePeakCstSPtr xic_peak);
68  void clearXicPeakBorders();
69 
70  signals:
71  /** @brief announce the current retention time (under mouse) in seconds
72  */
73  void rtChanged(double rt) const;
74  void xicPeakListChanged(pappso::XicXicPeakPairList xic_peak_list) const;
75  /** @brief announce mouse position on click (rt in seconds, intensity)
76  */
77  void clicked(double rt, double intensity) const;
78 
79  protected:
80  friend class QCPXic;
81  void rtChangeEvent(pappso::pappso_double rt) const;
82  void xicClickEvent(pappso::pappso_double rt,
83  pappso::pappso_double intensity) const;
84  void replotAll();
85  XicCstSPtr getXicCstSPtr(const Xic *xic_p) const;
86 
87  protected:
88  bool _rt_in_seconds = true;
89 
90  private:
91  std::map<const Xic *, QString> _map_xic_name;
92  std::map<const Xic *, pappso::pappso_double> _map_xic_msms_event;
93  std::vector<XicCstSPtr> _xic_sp_list;
94  XicXicPeakPairList _xic_peak_sp_list;
95  QCPXic *_qcp_xic;
96 };
97 } // namespace pappso
pappso::TracePeakCstSPtr
std::shared_ptr< const TracePeak > TracePeakCstSPtr
Definition: tracepeak.h:55
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::Xic
Definition: xic.h:64
pappso::XicXicPeakPairList
std::vector< std::pair< XicCstSPtr, TracePeakCstSPtr > > XicXicPeakPairList
Definition: xicwidget.h:63
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso
Definition: aa.cpp:38
pappso::QCPXic
Definition: qcpxic.h:61
GraphicDeviceWidget
Definition: graphicdevicewidget.h:36
pappso::XicCstSPtr
std::shared_ptr< const Xic > XicCstSPtr
Definition: xic.h:58