libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
datapoint.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <limits>
5#include <memory>
6
7#include <QDataStream>
8
9#include <QMetaType>
10
13
14
15namespace pappso
16{
17struct DataPoint;
18typedef std::shared_ptr<const DataPoint> DataPointCstSPtr;
19
20
22{
23 public:
26
27 DataPoint() = default;
29 DataPoint(std::pair<pappso_double, pappso_double> pair);
30 DataPoint(const QString &text);
31 DataPoint(const DataPoint &other);
32
33 // For debugging purposes.
34 //~DataPoint();
35
37
39 void initialize(const DataPoint &other);
40 bool initialize(const QString &text);
41
42 void reset();
43
44 void incrementX(pappso_double value);
45 void incrementY(pappso_double value);
46
47 bool operator==(const DataPoint &other) const;
48
49 DataPoint &operator=(const DataPoint &other);
50
51 bool isValid() const;
52
53 QString toString() const;
54 QString toString(int decimals) const;
55};
56
57PMSPP_LIB_DECL QDataStream &operator<<(QDataStream &out, const DataPoint &dataPoint);
58PMSPP_LIB_DECL QDataStream &operator>>(QDataStream &out, DataPoint &dataPoint);
59} // namespace pappso
60
62extern int dataPointMetaTypeId;
63
int dataPointCstSPtrMetaTypeId
Definition datapoint.cpp:28
int dataPointMetaTypeId
Definition datapoint.cpp:24
Q_DECLARE_METATYPE(pappso::DataPoint)
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
double pappso_double
A type definition for doubles.
Definition types.h:61
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition datapoint.h:18
void incrementY(pappso_double value)
DataPoint()=default
pappso_double x
Definition datapoint.h:24
bool isValid() const
QString toString() const
void initialize(pappso_double x, pappso_double y)
Definition datapoint.cpp:75
bool operator==(const DataPoint &other) const
void incrementX(pappso_double value)
DataPoint & operator=(const DataPoint &other)
pappso_double y
Definition datapoint.h:25
DataPointCstSPtr makeDataPointCstSPtr() const
Definition datapoint.cpp:68