Loading...
Searching...
No Matches
pappso::DataPoint Struct Reference

`#include <datapoint.h>`

## Public Member Functions

| DataPoint ()
| DataPoint (const DataPoint &other)
| DataPoint (pappso_double x, pappso_double y)
| DataPoint (std::pair< pappso_double, pappso_double > pair)
| DataPoint (const QString &text)
DataPointCstSPtr | makeDataPointCstSPtr () const
void | initialize (pappso_double x, pappso_double y)
void | initialize (const DataPoint &other)
bool | initialize (const QString &text)
void | reset ()
void | incrementX (pappso_double value)
void | incrementY (pappso_double value)
bool | operator== (const DataPoint &other) const
DataPoint & | operator= (const DataPoint &other)
bool | isValid () const
QString | toString () const
QString | toString (int decimals) const

## Public Attributes

pappso_double | x = -1
pappso_double | y = 0

## Detailed Description

Definition at line 21 of file datapoint.h.

## Constructor & Destructor Documentation

## DataPoint() [1/5]

pappso::DataPoint::DataPoint | ( |  | ) |

Definition at line 35 of file datapoint.cpp.

{
}

## DataPoint() [2/5]

pappso::DataPoint::DataPoint | ( | const DataPoint & | other | ) |

Definition at line 40 of file datapoint.cpp.

: x(other.x), y(other.y)
{
}
pappso::DataPoint::x
pappso_double x
Definition datapoint.h:23
pappso::DataPoint::y
pappso_double y
Definition datapoint.h:24

## DataPoint() [3/5]

pappso::DataPoint::DataPoint | ( | pappso_double | x,
|  | pappso_double | y
| ) |  |

Definition at line 45 of file datapoint.cpp.

: x(x), y(y)
{
}

## DataPoint() [4/5]

pappso::DataPoint::DataPoint | ( | std::pair< pappso_double, pappso_double > | pair | ) |

Definition at line 50 of file datapoint.cpp.

: x(pair.first), y(pair.second)
{
}

## DataPoint() [5/5]

pappso::DataPoint::DataPoint | ( | const QString & | text | ) |

Definition at line 56 of file datapoint.cpp.

{
if(!initialize(text))
throw ExceptionNotPossible(
"Failed to initialize the DataPoint object using the provided string.");
}
pappso::DataPoint::initialize
void initialize(pappso_double x, pappso_double y)
Definition datapoint.cpp:80

References initialize().

## Member Function Documentation

## incrementX()

void pappso::DataPoint::incrementX | ( | pappso_double | value | ) |

Definition at line 185 of file datapoint.cpp.

{
x += value;
}

References x.

## incrementY()

void pappso::DataPoint::incrementY | ( | pappso_double | value | ) |

Definition at line 192 of file datapoint.cpp.

{
y += value;
}

References y.

## initialize() [1/3]

void pappso::DataPoint::initialize | ( | const DataPoint & | other | ) |

Definition at line 88 of file datapoint.cpp.

{
x = other.x;
y = other.y;
}

References x, and y.

## initialize() [2/3]

bool pappso::DataPoint::initialize | ( | const QString & | text | ) |

Definition at line 96 of file datapoint.cpp.

{
QRegularExpressionMatch regExpMatch;
regExpMatch = Utils::xyMassDataFormatRegExp.match(text);
if(!regExpMatch.hasMatch())
return false;
bool ok = false;
double key = regExpMatch.captured(1).toDouble(&ok);
if(!ok)
return false;
// Note that group 2 is the separator group.
double val = regExpMatch.captured(3).toDouble(&ok);
if(!ok)
return false;
x = key;
y = val;
return true;
}
pappso::Utils::xyMassDataFormatRegExp
static QRegularExpression xyMassDataFormatRegExp
Definition utils.h:54

References x, pappso::Utils::xyMassDataFormatRegExp, and y.

## initialize() [3/3]

void pappso::DataPoint::initialize | ( | pappso_double | x,
|  | pappso_double | y
| ) |  |

Definition at line 80 of file datapoint.cpp.

{
this->x = x;
this->y = y;
}

References x, and y.

Referenced by DataPoint().

## isValid()

bool pappso::DataPoint::isValid | ( |  | ) | const

Definition at line 136 of file datapoint.cpp.

{
return (x >= 0);
}

References x.

Referenced by pappso::MassSpectrumMinusCombiner::combine(), and pappso::MassSpectrumPlusCombiner::combine().

## makeDataPointCstSPtr()

DataPointCstSPtr pappso::DataPoint::makeDataPointCstSPtr | ( |  | ) | const

Definition at line 73 of file datapoint.cpp.

{
return std::make_shared<const DataPoint>(*this);
}

Referenced by pappso::MassSpectrumWidget::peakChangeEvent().

## operator=()

DataPoint & pappso::DataPoint::operator= | ( | const DataPoint & | other | ) |

Definition at line 205 of file datapoint.cpp.

{
x = other.x;
y = other.y;
return *this;
}

References x, and y.

## operator==()

bool pappso::DataPoint::operator== | ( | const DataPoint & | other | ) | const

Definition at line 198 of file datapoint.cpp.

{
return ((x == other.x) && (y == other.y));
}

References x, and y.

## reset()

void pappso::DataPoint::reset | ( |  | ) |

Definition at line 128 of file datapoint.cpp.

{
x = -1;
y = 0;
}

References x, and y.

## toString() [1/2]

QString pappso::DataPoint::toString | ( |  | ) | const

Definition at line 143 of file datapoint.cpp.

{
return QString("%1 %2").arg(x, 0, 'f', 15).arg(y, 0, 'f', 15);
}

References x, and y.

## toString() [2/2]

QString pappso::DataPoint::toString | ( | int | decimals | ) | const

Definition at line 150 of file datapoint.cpp.

{
return QString("%1 %2").arg(x, 0, 'f', decimals).arg(y, 0, 'f', decimals);
}

References x, and y.

## Member Data Documentation

## x

pappso_double pappso::DataPoint::x = -1

Definition at line 23 of file datapoint.h.

Referenced by pappso::TracePeak::TracePeak(), pappso::FilterChargeDeconvolution::addDataPointToList(), pappso::QCPSpectrum::addMassDelta(), pappso::QCPSpectrum::addPeakIonIsotopeMatch(), pappso::MsRunRetentionTime< T >::align(), pappso::MassSpectrumMinusCombiner::combine(), pappso::MassSpectrumPlusCombiner::combine(), pappso::TracePeak::containsRt(), pappso::Trace::containsX(), pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution2(), pappso::Trace::dataPointCstIteratorWithX(), pappso::Trace::dataPointIteratorWithX(), pappso::QCPXic::drawXicPeakBorders(), pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::MsRunXicExtractorDisk::extractOneXicCoord(), pappso::FilterTandemDeisotope::filter(), pappso::findFirstEqualOrGreaterX(), pappso::findFirstEqualOrGreaterX(), pappso::findFirstGreaterX(), pappso::findFirstGreaterX(), pappso::TimsFrameBase::getIonMobilityTraceByMzIndexRange(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::QCPSpectrum::getNearestPeakBetween(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), pappso::TimsFrameBase::getTraceFromCumulatedScans(), pappso::TimsFrameBase::getTraceFromCumulatedScansBuiltinCentroid(), incrementX(), initialize(), initialize(), initialize(), pappso::MapTrace::insertOrUpdate(), isValid(), pappso::MsRunRetentionTime< T >::linearRegressionMs2toMs1(), pappso::Trace::maxX(), pappso::Trace::minX(), pappso::operator<<(), operator=(), operator==(), pappso::operator>>(), pappso::MassSpectrumWidget::peakChangeEvent(), reset(), pappso::FilterTriangle::sumAndRemove(), toString(), and toString().

## y

pappso_double pappso::DataPoint::y = 0

Definition at line 24 of file datapoint.h.

Referenced by pappso::TracePeak::TracePeak(), pappso::QCPSpectrum::addPeakIonIsotopeMatch(), pappso::QCPXic::addXicP(), pappso::MsRunRetentionTime< T >::align(), pappso::MassSpectrumMinusCombiner::combine(), pappso::MassSpectrumPlusCombiner::combine(), pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution2(), pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::MsRunXicExtractorDisk::extractOneXicCoord(), pappso::FilterTandemDeisotope::filter(), pappso::findDifferentYvalue(), pappso::findDifferentYvalue(), pappso::flooredLocalMaxima(), pappso::TimsFrameBase::getIonMobilityTraceByMzIndexRange(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::QCPSpectrum::getMostIntensePeakBetween(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), pappso::TimsFrameBase::getTraceFromCumulatedScans(), pappso::TimsFrameBase::getTraceFromCumulatedScansBuiltinCentroid(), incrementY(), initialize(), initialize(), initialize(), pappso::MapTrace::insertOrUpdate(), pappso::MsRunRetentionTime< T >::linearRegressionMs2toMs1(), pappso::Trace::maxY(), pappso::Trace::minY(), pappso::operator<<(), operator=(), operator==(), pappso::operator>>(), pappso::MassSpectrumWidget::plot(), reset(), pappso::FilterTriangle::sumAndRemove(), pappso::Trace::sumY(), toString(), and toString().

The documentation for this struct was generated from the following files:

- pappsomspp/trace/datapoint.h
- pappsomspp/trace/datapoint.cpp