Loading...
Searching...
No Matches
datapoint.h
Go to the documentation of this file.
#pragma once
#include <vector>
#include <limits>
#include <memory>
#include <QDataStream>
#include <QMetaType>
#include "pappsomspp/export-import-config.h"
#include "pappsomspp/core/types.h"
namespace pappso
{
struct DataPoint;
typedef std::shared_ptr<const DataPoint> DataPointCstSPtr;
struct PMSPP_LIB_DECL DataPoint
{
public:
pappso_double x = -1;
pappso_double y = 0;
DataPoint() = default;
DataPoint(pappso_double x, pappso_double y);
DataPoint(std::pair<pappso_double, pappso_double> pair);
DataPoint(const QString &text);
DataPoint(const DataPoint &other);
// For debugging purposes.
//~DataPoint();
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;
};
PMSPP_LIB_DECL QDataStream &operator<<(QDataStream &out, const DataPoint &dataPoint);
PMSPP_LIB_DECL QDataStream &operator>>(QDataStream &out, DataPoint &dataPoint);
} // namespace pappso
Q_DECLARE_METATYPE(pappso::DataPoint);
extern int dataPointMetaTypeId;
Q_DECLARE_METATYPE(pappso::DataPointCstSPtr);
extern int dataPointCstSPtrMetaTypeId;
dataPointCstSPtrMetaTypeId
int dataPointCstSPtrMetaTypeId
Definition datapoint.cpp:27
dataPointMetaTypeId
int dataPointMetaTypeId
Definition datapoint.cpp:24
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(pappso::DataPoint)
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::operator<<
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
Definition massspectrum.cpp:339
pappso::operator>>
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
Definition massspectrum.cpp:353
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::DataPointCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition datapoint.h:18
pappso::DataPoint
Definition datapoint.h:22
pappso::DataPoint::incrementY
void incrementY(pappso_double value)
Definition datapoint.cpp:183
pappso::DataPoint::DataPoint
DataPoint()=default
pappso::DataPoint::x
pappso_double x
Definition datapoint.h:24
pappso::DataPoint::isValid
bool isValid() const
Definition datapoint.cpp:128
pappso::DataPoint::toString
QString toString() const
Definition datapoint.cpp:135
pappso::DataPoint::initialize
void initialize(pappso_double x, pappso_double y)
Definition datapoint.cpp:72
pappso::DataPoint::operator==
bool operator==(const DataPoint &other) const
Definition datapoint.cpp:189
pappso::DataPoint::incrementX
void incrementX(pappso_double value)
Definition datapoint.cpp:176
pappso::DataPoint::operator=
DataPoint & operator=(const DataPoint &other)
Definition datapoint.cpp:196
pappso::DataPoint::reset
void reset()
Definition datapoint.cpp:120
pappso::DataPoint::y
pappso_double y
Definition datapoint.h:25
pappso::DataPoint::makeDataPointCstSPtr
DataPointCstSPtr makeDataPointCstSPtr() const
Definition datapoint.cpp:65
types.h