libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
massspectraceplotcontext.cpp
Go to the documentation of this file.
1// Copyright 2021 Filippo Rusconi
2// GPLv3+
3
4/////////////////////// StdLib includes
5
6
7/////////////////////// Qt includes
8#include <QString>
9
10
11/////////////////////// Local includes
13
14namespace pappso
15{
16
17
21
22
24 const MassSpecTracePlotContext &other)
25 : BasePlotContext(other),
26 m_lastZ(other.m_lastZ),
27 m_lastMz(other.m_lastMz),
28 m_lastTicIntensity(other.m_lastTicIntensity),
29 m_lastMr(other.m_lastMr),
30 m_lastResolvingPower(other.m_lastResolvingPower)
31{
32 // qDebug() << "Constructing MassSpecTracePlotContext by copy.";
33}
34
35
39
42{
43 if(this == &other)
44 return *this;
45
46 // First the BasePlotContext members
47
48 m_dataKind = other.m_dataKind;
49
52
57
61
64
65 // The effective range of the axes.
66 m_xRange = other.m_xRange;
67 m_yRange = other.m_yRange;
68
69 // Tell if the mouse move was started onto either axis, because that will
70 // condition if some calculations needs to be performed or not (for example,
71 // if the mouse cursor motion was started on an axis, there is no point to
72 // perform deconvolutions).
75
77
78 // The user-selected region over the plot.
79 // Note that we cannot use QCPRange structures because these are normalized by
80 // QCustomPlot in such a manner that lower is actually < upper. But we need
81 // for a number of our calculations (specifically for the deconvolutions) to
82 // actually have the lower value be start drag point.x even if the drag
83 // direction was from right to left.
86
89
90 m_xDelta = other.m_xDelta;
91 m_yDelta = other.m_yDelta;
92
95
97
100
102
105
106 return *this;
107}
108
109
112{
113 if(this == &other)
114 return *this;
115
116 // First the BasePlotContext members
117
118 m_dataKind = other.m_dataKind;
119
122
127
131
134
135 // The effective range of the axes.
136 m_xRange = other.m_xRange;
137 m_yRange = other.m_yRange;
138
139 // Tell if the mouse move was started onto either axis, because that will
140 // condition if some calculations needs to be performed or not (for example,
141 // if the mouse cursor motion was started on an axis, there is no point to
142 // perform deconvolutions).
145
147
148 // The user-selected region over the plot.
149 // Note that we cannot use QCPRange structures because these are normalized by
150 // QCustomPlot in such a manner that lower is actually < upper. But we need
151 // for a number of our calculations (specifically for the deconvolutions) to
152 // actually have the lower value be start drag point.x even if the drag
153 // direction was from right to left.
156
159
160 m_xDelta = other.m_xDelta;
161 m_yDelta = other.m_yDelta;
162
165
167
170
172
175
176 // Second the mass spec trace plot-specific members
177
178 m_lastZ = other.m_lastZ;
179 m_lastMz = other.m_lastMz;
181 m_lastMr = other.m_lastMr;
183
184 return *this;
185}
186
187
188QString
190{
191 QString text("Base context:\n");
192
194
195 text += "\n";
196
197 text += "Mass spectrum trace plot context\n";
198
199 text += QString("last z: %1").arg(m_lastZ);
200 text += QString("last m/z: %1").arg(m_lastMz, 0, 'f', 6);
201 text += QString("last TIC intensity: %1").arg(m_lastTicIntensity, 0, 'g', 0);
202 text += QString("last Mr: %1").arg(m_lastMr, 0, 'f', 6);
203 text +=
204 QString("last resolving power: %1").arg(m_lastResolvingPower, 0, 'g', 0);
205
206 text += "\n";
207
208 return text;
209}
210
211
212} // namespace pappso
Qt::MouseButtons m_mouseButtonsAtMousePress
SelectionPolygon m_selectionPolygon
Qt::KeyboardModifiers m_keyboardModifiers
Qt::MouseButtons m_lastPressedMouseButton
Qt::MouseButtons m_pressedMouseButtons
Qt::MouseButtons m_mouseButtonsAtMouseRelease
Qt::MouseButtons m_lastReleasedMouseButton
MassSpecTracePlotContext & operator=(const BasePlotContext &other)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39