libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
integrationscoperect.h
Go to the documentation of this file.
1// Copyright 2021 Filippo Rusconi
2// GPLv3+
3
4#pragma once
5
6/////////////////////// StdLib includes
7#include <vector>
8#include <limits>
9
10/////////////////////// Qt includes
11#include <QString>
12#include <QPointF>
13
14
15/////////////////////// Local includes
16#include "../../exportinmportconfig.h"
17#include "../../types.h"
18#include "integrationscope.h"
19
20namespace pappso
21{
22
23// This class represents the case where the user draws a rectangle in a colormap
24// plot widget, with the aim of integrating data in two-dimension manner (over a
25// range in the X axis and a range in the Y axis). The rectangle is not a
26// rhomboid, it has squared angles.
27
28/* Like this:
29
30+---------------------------+ -
31| | |
32| | |
33| | m_height
34| | |
35| | |
36P---------------------------+ -
37
38|--------- m_width ---------|
39
40With P the m_point.
41
42*/
43
45{
46 public:
48 IntegrationScopeRect(const QPointF &point, double width, double height);
49 IntegrationScopeRect(const QPointF &point, double width, DataKind data_kind_x, double height, DataKind data_kind_y);
51
52 virtual ~IntegrationScopeRect();
53
54 using IntegrationScope::operator=;
55 virtual IntegrationScopeRect &operator=(const IntegrationScopeRect &other);
56
57 virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override;
58 virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override;
59
60 virtual void setHeight(double height);
61 virtual IntegrationScopeFeatures getHeight(double &height) const override;
62
63 virtual bool range(Axis axis, double &start, double &end) const override;
64
65 virtual void setDataKindX(DataKind data_kind) override;
66 virtual bool getDataKindX(DataKind &data_kind) override;
67
68 virtual void setDataKindY(DataKind data_kind) override;
69 virtual bool getDataKindY(DataKind &data_kind) override;
70
71 bool is1D() const override;
72 bool is2D() const override;
73
74 virtual bool isRectangle() const override;
75 virtual bool isRhomboid() const override;
76
77 virtual bool transpose() override;
78
79 using IntegrationScope::update;
80 virtual void update(const QPointF &point, double width, double height);
81
82 virtual bool contains(const QPointF &point) const override;
83
84 virtual QString toString() const override;
85
86 virtual void reset() override;
87
88 protected:
89 double m_height;
90 DataKind m_dataKindY = DataKind::unset;
91};
92
93typedef std::shared_ptr<IntegrationScopeRect> IntegrationScopeRectSPtr;
94typedef std::shared_ptr<const IntegrationScopeRect> IntegrationScopeRectCstSPtr;
95
96} // namespace pappso
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< IntegrationScopeRect > IntegrationScopeRectSPtr
DataKind
Definition types.h:213
std::shared_ptr< const IntegrationScopeRect > IntegrationScopeRectCstSPtr