12#include <QRegularExpressionMatch>
19#include "../pappsoexception.h"
20#include "../exception/exceptionoutofrange.h"
21#include "../exception/exceptionnotpossible.h"
25 qRegisterMetaType<pappso::DataPoint>(
"pappso::DataPoint");
29 qRegisterMetaType<pappso::DataPointCstSPtr>(
"pappso::DataPointCstSPtr");
51 :
x(pair.first),
y(pair.second)
60 "Failed to initialize the DataPoint object using the provided string.");
75 return std::make_shared<const DataPoint>(*
this);
99 QRegularExpressionMatch regExpMatch;
103 if(!regExpMatch.hasMatch())
108 double key = regExpMatch.captured(1).toDouble(&ok);
115 double val = regExpMatch.captured(3).toDouble(&ok);
145 return QString(
"%1 %2").arg(
x, 0,
'f', 15).arg(
y, 0,
'f', 15);
152 return QString(
"%1 %2").arg(
x, 0,
'f', decimals).arg(
y, 0,
'f', decimals);
173 QString(
"error in QDataStream unserialize operator>> of massSpectrum "
174 "dataPoint:\nread datastream failed status=%1")
200 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