Loading...
Searching...
No Matches
integrationscope.h
Go to the documentation of this file.
// Copyright 2021 Filippo Rusconi
// GPLv3+
#pragma once
/////////////////////// StdLib includes
#include <vector>
#include <limits>
/////////////////////// Qt includes
#include <QString>
#include <QPointF>
/////////////////////// Local includes
#include "pappsomspp/export-import-config.h"
#include "../../types.h"
#include "integrationscopebase.h"
namespace pappso
{
// This class represents the case where the user draws a line in a trace plot
// widget, with the aim of integrating data in single-dimension manner (over a
// range in the X axis). Having no height, this IntegrationScope is like a line.
/* Like this:
P---------------------------+
|--------- m_width ---------|
With P the m_point.
*/
class PMSPP_LIB_DECL IntegrationScope : public IntegrationScopeBase
{
Q_PROPERTY(QPointF point READ getPoint() WRITE setPoint() NOTIFY pointChanged() FINAL)
Q_PROPERTY(double width READ getWidth() WRITE setWidth() NOTIFY widthChanged() FINAL)
public:
IntegrationScope(QObject *parent_p = nullptr);
IntegrationScope(const QPointF &point, double width, QObject *parent_p = nullptr);
IntegrationScope(const QPointF &point,
double width,
Enums::DataKind data_kind,
QObject *parent_p = nullptr);
IntegrationScope(const IntegrationScope &other, QObject *parent_p = nullptr);
virtual ~IntegrationScope();
virtual IntegrationScope &operator=(const IntegrationScope &other);
virtual void setPoint(const QPointF &point);
virtual bool getPoint(QPointF &point) const override;
virtual IntegrationScopeFeatures getLeftMostPoint(QPointF &point) const override;
virtual IntegrationScopeFeatures getRightMostPoint(QPointF &point) const override;
virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override;
virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override;
virtual void setWidth(double width);
virtual IntegrationScopeFeatures getWidth(double &width) const override;
virtual bool range(Enums::Axis axis, double &start, double &end) const override;
virtual void setDataKindX(Enums::DataKind data_kind) override;
virtual bool getDataKindX(Enums::DataKind &data_kind) override;
bool is1D() const override;
bool is2D() const override;
virtual bool isRectangle() const override;
virtual bool isRhomboid() const override;
virtual bool transpose() override;
virtual void update(const QPointF &point, double width);
virtual bool contains(const QPointF &point) const override;
virtual QString toString() const override;
virtual void reset() override;
signals:
void pointChanged();
void widthChanged();
protected:
QPointF m_point;
double m_width;
Enums::DataKind m_dataKindX = Enums::DataKind::unset;
};
typedef std::shared_ptr<IntegrationScope> IntegrationScopeSPtr;
typedef std::shared_ptr<const IntegrationScope> IntegrationScopeCstSPtr;
} // namespace pappso
pappso::IntegrationScopeBase::IntegrationScopeBase
IntegrationScopeBase(QObject *parent_p=nullptr)
Definition integrationscopebase.cpp:21
pappso::IntegrationScope::range
virtual bool range(Enums::Axis axis, double &start, double &end) const override
Definition integrationscope.cpp:129
pappso::IntegrationScope::setDataKindX
virtual void setDataKindX(Enums::DataKind data_kind) override
Definition integrationscope.cpp:143
pappso::IntegrationScope::m_dataKindX
Enums::DataKind m_dataKindX
Definition integrationscope.h:94
pappso::IntegrationScope::getPoint
virtual bool getPoint(QPointF &point) const override
Definition integrationscope.cpp:81
pappso::IntegrationScope::point
QPointF point
Definition integrationscope.h:39
pappso::IntegrationScope::getDataKindX
virtual bool getDataKindX(Enums::DataKind &data_kind) override
Definition integrationscope.cpp:149
pappso::IntegrationScope::getRightMostPoint
virtual IntegrationScopeFeatures getRightMostPoint(QPointF &point) const override
Definition integrationscope.cpp:95
pappso::IntegrationScope::getTopMostPoint
virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override
Definition integrationscope.cpp:102
pappso::IntegrationScope::widthChanged
void widthChanged()
pappso::IntegrationScope::contains
virtual bool contains(const QPointF &point) const override
Definition integrationscope.cpp:193
pappso::IntegrationScope::m_width
double m_width
Definition integrationscope.h:93
pappso::IntegrationScope::toString
virtual QString toString() const override
Definition integrationscope.cpp:199
pappso::IntegrationScope::is1D
bool is1D() const override
Definition integrationscope.cpp:156
pappso::IntegrationScope::getBottomMostPoint
virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override
Definition integrationscope.cpp:109
pappso::IntegrationScope::isRhomboid
virtual bool isRhomboid() const override
Definition integrationscope.cpp:174
pappso::IntegrationScope::is2D
bool is2D() const override
Definition integrationscope.cpp:162
pappso::IntegrationScope::setWidth
virtual void setWidth(double width)
Definition integrationscope.cpp:116
pappso::IntegrationScope::update
virtual void update(const QPointF &point, double width)
Definition integrationscope.cpp:186
pappso::IntegrationScope::getWidth
virtual IntegrationScopeFeatures getWidth(double &width) const override
Definition integrationscope.cpp:122
pappso::IntegrationScope::transpose
virtual bool transpose() override
Definition integrationscope.cpp:180
pappso::IntegrationScope::m_point
QPointF m_point
Definition integrationscope.h:92
pappso::IntegrationScope::operator=
virtual IntegrationScope & operator=(const IntegrationScope &other)
Definition integrationscope.cpp:62
pappso::IntegrationScope::setPoint
virtual void setPoint(const QPointF &point)
Definition integrationscope.cpp:75
pappso::IntegrationScope::IntegrationScope
WRITE setPoint() NOTIFY pointChanged() FINAL) Q_PROPERTY(double width READ getWidth() WRITE setWidth() NOTIFY widthChanged() FINAL) public IntegrationScope(const QPointF &point, double width, QObject *parent_p=nullptr)
Definition integrationscope.cpp:27
pappso::IntegrationScope::getLeftMostPoint
virtual IntegrationScopeFeatures getLeftMostPoint(QPointF &point) const override
Definition integrationscope.cpp:88
pappso::IntegrationScope::isRectangle
virtual bool isRectangle() const override
Definition integrationscope.cpp:168
pappso::IntegrationScope::pointChanged
void pointChanged()
pappso::IntegrationScope::reset
virtual void reset() override
Definition integrationscope.cpp:205
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
integrationscopebase.h
pappso::Enums::DataKind
DataKind
Definition types.h:249
pappso::Enums::DataKind::unset
@ unset
not set
Definition types.h:250
pappso::Enums::Axis
Axis
Definition types.h:258
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::IntegrationScopeFeatures
IntegrationScopeFeatures
Definition integrationscopebase.h:47
pappso::IntegrationScopeSPtr
std::shared_ptr< IntegrationScope > IntegrationScopeSPtr
Definition integrationscope.h:97
pappso::IntegrationScopeCstSPtr
std::shared_ptr< const IntegrationScope > IntegrationScopeCstSPtr
Definition integrationscope.h:98
types.h