libpappsomspp
Library for mass spectrometry
mzrange.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/mass_range.h
3  * \date 4/3/2015
4  * \author Olivier Langella
5  * \brief object to handle a mass range (an mz value + or - some delta)
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  * Contributors:
27  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28  *implementation
29  ******************************************************************************/
30 
31 #pragma once
32 
33 
34 #include "types.h"
35 #include "precision.h"
36 
37 #include "exportinmportconfig.h"
38 
39 #include <QString>
40 #include <map>
41 
42 namespace pappso
43 {
44 
46 {
47 
48  public:
50 
52 
54  PrecisionPtr precision_lower,
55  PrecisionPtr precision_upper);
56 
57  MzRange(const MzRange &other);
58 
59  virtual ~MzRange();
60 
61  MzRange &operator=(const MzRange &other);
62  MzRange &operator+=(const MzRange &other);
63  MzRange &operator*=(double number);
64 
65  pappso_double getMz() const;
66 
67  bool contains(pappso_double) const;
68  QString toString() const;
69 
71  lower() const
72  {
73  return (m_mz - m_delta);
74  };
75 
77  upper() const
78  {
79  return (m_mz + m_delta);
80  };
81 
82 
83  private:
86 };
87 
88 } // namespace pappso
pappso_double lower() const
Definition: mzrange.h:71
pappso_double upper() const
Definition: mzrange.h:77
pappso_double m_delta
Definition: mzrange.h:85
pappso_double m_mz
Definition: mzrange.h:80
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
double pappso_double
A type definition for doubles.
Definition: types.h:49
This header contains all the type re-definitions and all the global variables definitions used in the...