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 
45 class PMSPP_LIB_DECL MzRange
46 {
47  private:
48  pappso_double m_mz;
49  pappso_double m_delta;
50 
51  public:
52  MzRange(pappso_double mz, PrecisionPtr precision);
53 
54  MzRange(pappso_double mz, pappso_double delta);
55 
56  MzRange(pappso_double mz,
57  PrecisionPtr precision_lower,
58  PrecisionPtr precision_upper);
59 
60  MzRange(const MzRange &other);
61 
62  virtual ~MzRange();
63 
64  MzRange &operator=(const MzRange &other);
65 
66  pappso_double getMz() const;
67 
68  bool contains(pappso_double) const;
69  QString toString() const;
70 
72  lower() const
73  {
74  return (m_mz - m_delta);
75  };
76 
78  upper() const
79  {
80  return (m_mz + m_delta);
81  };
82 };
83 
84 } // namespace pappso
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
types.h
This header contains all the type re-definitions and all the global variables definitions used in the...
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso
Definition: aa.cpp:38
pappso::PrecisionPtr
const typedef PrecisionBase * PrecisionPtr
Definition: precision.h:143
precision.h
exportinmportconfig.h