11 #include <QDataStream>
12 #include <QRegularExpressionMatch>
19 #include "../pappsoexception.h"
20 #include "../exception/exceptionoutofrange.h"
24 qRegisterMetaType<pappso::DataPoint>(
"pappso::DataPoint");
28 qRegisterMetaType<pappso::DataPointCstSPtr>(
"pappso::DataPointCstSPtr");
50 :
x(pair.first),
y(pair.second)
72 return std::make_shared<const DataPoint>(*
this);
95 QRegularExpressionMatch regExpMatch;
99 if(!regExpMatch.hasMatch())
104 double key = regExpMatch.captured(1).toDouble(&ok);
111 double val = regExpMatch.captured(3).toDouble(&ok);
141 return QString(
"(%1,%2)").arg(
x, 0,
'f', 15).arg(
y, 0,
'f', 15);
148 return QString(
"(%1,%2)").arg(
x, 0,
'f', decimals).arg(
y, 0,
'f', decimals);
169 QString(
"error in QDataStream unserialize operator>> of massSpectrum "
170 "dataPoint:\nread datastream failed status=%1")
196 return ((
x == other.
x) && (
y == other.
y));
static QRegularExpression xyMassDataFormatRegExp
int dataPointCstSPtrMetaTypeId
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
double pappso_double
A type definition for doubles.
std::shared_ptr< const DataPoint > DataPointCstSPtr
void incrementY(pappso_double value)
void initialize(pappso_double x, pappso_double y)
bool operator==(const DataPoint &other) const
void incrementX(pappso_double value)
DataPoint & operator=(const DataPoint &other)
DataPointCstSPtr makeDataPointCstSPtr() const