Loading...
Searching...
No Matches
integrationscoperect.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 "integrationscope.h"
namespace pappso
{
// This class represents the case where the user draws a rectangle in a colormap
// plot widget, with the aim of integrating data in two-dimension manner (over a
// range in the X axis and a range in the Y axis). The rectangle is not a
// rhomboid, it has squared angles.
/* Like this:
+---------------------------+ -
| | |
| | |
| | m_height
| | |
| | |
P---------------------------+ -
|--------- m_width ---------|
With P the m_point.
*/
class PMSPP_LIB_DECL IntegrationScopeRect : public IntegrationScope
{
public:
IntegrationScopeRect();
IntegrationScopeRect(const QPointF &point, double width, double height);
IntegrationScopeRect(const QPointF &point, double width, Enums::DataKind data_kind_x, double height, Enums::DataKind data_kind_y);
IntegrationScopeRect(const IntegrationScopeRect &other);
virtual ~IntegrationScopeRect();
using IntegrationScope::operator=;
virtual IntegrationScopeRect &operator=(const IntegrationScopeRect &other);
virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override;
virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override;
virtual void setHeight(double height);
virtual IntegrationScopeFeatures getHeight(double &height) 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;
virtual void setDataKindY(Enums::DataKind data_kind) override;
virtual bool getDataKindY(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;
using IntegrationScope::update;
virtual void update(const QPointF &point, double width, double height);
virtual bool contains(const QPointF &point) const override;
virtual QString toString() const override;
virtual void reset() override;
protected:
double m_height;
Enums::DataKind m_dataKindY = Enums::DataKind::unset;
};
typedef std::shared_ptr<IntegrationScopeRect> IntegrationScopeRectSPtr;
typedef std::shared_ptr<const IntegrationScopeRect> IntegrationScopeRectCstSPtr;
} // namespace pappso
pappso::IntegrationScopeRect::getBottomMostPoint
virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override
Definition integrationscoperect.cpp:86
pappso::IntegrationScopeRect::update
virtual void update(const QPointF &point, double width, double height)
Definition integrationscoperect.cpp:206
pappso::IntegrationScopeRect::operator=
virtual IntegrationScopeRect & operator=(const IntegrationScopeRect &other)
Definition integrationscoperect.cpp:63
pappso::IntegrationScopeRect::m_dataKindY
Enums::DataKind m_dataKindY
Definition integrationscoperect.h:90
pappso::IntegrationScopeRect::m_height
double m_height
Definition integrationscoperect.h:89
pappso::IntegrationScopeRect::isRectangle
virtual bool isRectangle() const override
Definition integrationscoperect.cpp:165
pappso::IntegrationScopeRect::IntegrationScopeRect
IntegrationScopeRect()
Definition integrationscoperect.cpp:20
pappso::IntegrationScopeRect::getHeight
virtual IntegrationScopeFeatures getHeight(double &height) const override
Definition integrationscoperect.cpp:99
pappso::IntegrationScopeRect::toString
virtual QString toString() const override
Definition integrationscoperect.cpp:221
pappso::IntegrationScopeRect::transpose
virtual bool transpose() override
Definition integrationscoperect.cpp:177
pappso::IntegrationScopeRect::setDataKindY
virtual void setDataKindY(Enums::DataKind data_kind) override
Definition integrationscoperect.cpp:133
pappso::IntegrationScopeRect::setDataKindX
virtual void setDataKindX(Enums::DataKind data_kind) override
Definition integrationscoperect.cpp:127
pappso::IntegrationScopeRect::getDataKindX
virtual bool getDataKindX(Enums::DataKind &data_kind) override
Definition integrationscoperect.cpp:139
pappso::IntegrationScopeRect::is2D
bool is2D() const override
Definition integrationscoperect.cpp:159
pappso::IntegrationScopeRect::range
virtual bool range(Enums::Axis axis, double &start, double &end) const override
Definition integrationscoperect.cpp:106
pappso::IntegrationScopeRect::getTopMostPoint
virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override
Definition integrationscoperect.cpp:79
pappso::IntegrationScopeRect::getDataKindY
virtual bool getDataKindY(Enums::DataKind &data_kind) override
Definition integrationscoperect.cpp:146
pappso::IntegrationScopeRect::setHeight
virtual void setHeight(double height)
Definition integrationscoperect.cpp:93
pappso::IntegrationScopeRect::contains
virtual bool contains(const QPointF &point) const override
Definition integrationscoperect.cpp:214
pappso::IntegrationScopeRect::isRhomboid
virtual bool isRhomboid() const override
Definition integrationscoperect.cpp:171
pappso::IntegrationScopeRect::is1D
bool is1D() const override
Definition integrationscoperect.cpp:153
pappso::IntegrationScopeRect::reset
virtual void reset() override
Definition integrationscoperect.cpp:239
pappso::IntegrationScope::point
QPointF point
Definition integrationscope.h:39
pappso::IntegrationScope::update
virtual void update(const QPointF &point, double width)
Definition integrationscope.cpp:186
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
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
integrationscope.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::IntegrationScopeRectSPtr
std::shared_ptr< IntegrationScopeRect > IntegrationScopeRectSPtr
Definition integrationscoperect.h:93
pappso::IntegrationScopeFeatures
IntegrationScopeFeatures
Definition integrationscopebase.h:47
pappso::IntegrationScopeRectCstSPtr
std::shared_ptr< const IntegrationScopeRect > IntegrationScopeRectCstSPtr
Definition integrationscoperect.h:94
types.h