libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
integrationscope.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"
19
20namespace pappso
21{
22
23// This class represents the case where the user draws a line in a trace plot
24// widget, with the aim of integrating data in single-dimension manner (over a
25// range in the X axis). Having no height, this IntegrationScope is like a line.
26
27/* Like this:
28
29P---------------------------+
30
31|--------- m_width ---------|
32
33With P the m_point.
34
35 */
36
38{
39 public:
41 IntegrationScope(const QPointF &point, double width);
42 IntegrationScope(const QPointF &point, double width, DataKind data_kind);
44
45 virtual ~IntegrationScope();
46
47 virtual IntegrationScope &operator=(const IntegrationScope &other);
48
49 virtual void setPoint(const QPointF &point);
50 virtual bool getPoint(QPointF &point) const override;
51
52 virtual IntegrationScopeFeatures getLeftMostPoint(QPointF &point) const override;
53 virtual IntegrationScopeFeatures getRightMostPoint(QPointF &point) const override;
54
55 virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override;
56 virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override;
57
58 virtual void setWidth(double width);
59 virtual IntegrationScopeFeatures getWidth(double &width) const override;
60
61 virtual bool range(Axis axis, double &start, double &end) const override;
62
63 virtual void setDataKindX(DataKind data_kind) override;
64 virtual bool getDataKindX(DataKind &data_kind) override;
65
66 bool is1D() const override;
67 bool is2D() const override;
68
69 virtual bool isRectangle() const override;
70 virtual bool isRhomboid() const override;
71
72 virtual bool transpose() override;
73
74 virtual void update(const QPointF &point, double width);
75
76 virtual bool contains(const QPointF &point) const override;
77
78 virtual QString toString() const override;
79
80 virtual void reset() override;
81
82 protected:
83 QPointF m_point;
84 double m_width;
85 DataKind m_dataKindX = DataKind::unset;
86};
87
88typedef std::shared_ptr<IntegrationScope> IntegrationScopeSPtr;
89typedef std::shared_ptr<const IntegrationScope> IntegrationScopeCstSPtr;
90
91} // 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< IntegrationScope > IntegrationScopeSPtr
DataKind
Definition types.h:215
std::shared_ptr< const IntegrationScope > IntegrationScopeCstSPtr