libpappsomspp
Library for mass spectrometry
pappso::MassSpecTracePlotContext Class Reference

#include <massspectraceplotcontext.h>

Inheritance diagram for pappso::MassSpecTracePlotContext:
pappso::BasePlotContext

Public Member Functions

 MassSpecTracePlotContext ()
 
 MassSpecTracePlotContext (const MassSpecTracePlotContext &other)
 
virtual ~MassSpecTracePlotContext ()
 
MassSpecTracePlotContextoperator= (const BasePlotContext &other)
 
MassSpecTracePlotContextoperator= (const MassSpecTracePlotContext &other)
 
QString toString () const
 
- Public Member Functions inherited from pappso::BasePlotContext
 BasePlotContext ()
 
 BasePlotContext (const BasePlotContext &other)
 
virtual ~BasePlotContext ()
 
BasePlotContextoperator= (const BasePlotContext &other)
 
DragDirections recordDragDirections ()
 
QString toString () const
 

Public Attributes

int m_lastZ = -1
 
double m_lastMz = std::numeric_limits<double>::min()
 
double m_lastTicIntensity = std::numeric_limits<double>::min()
 
double m_lastMr = std::numeric_limits<double>::min()
 
double m_lastResolvingPower = std::numeric_limits<double>::min()
 
- Public Attributes inherited from pappso::BasePlotContext
DataKind m_dataKind = DataKind::unset
 
bool m_isMouseDragging = false
 
bool m_wasMouseDragging = false
 
bool m_isKeyBoardDragging = false
 
bool m_isLeftPseudoButtonKeyPressed = false
 
bool m_isRightPseudoButtonKeyPressed = false
 
bool m_wassKeyBoardDragging = false
 
QPointF m_startDragPoint
 
QPointF m_currentDragPoint
 
QPointF m_lastCursorHoveredPoint
 
DragDirections m_dragDirections = DragDirections::NOT_SET
 
SelectionPolygon m_selectionPolygon
 
double m_selectRectangleWidth = 0
 
QCPRange m_xRange
 
QCPRange m_yRange
 
bool m_wasClickOnXAxis = false
 
bool m_wasClickOnYAxis = false
 
bool m_isMeasuringDistance = false
 
double m_xRegionRangeStart = std::numeric_limits<double>::min()
 
double m_xRegionRangeEnd = std::numeric_limits<double>::min()
 
double m_yRegionRangeStart = std::numeric_limits<double>::min()
 
double m_yRegionRangeEnd = std::numeric_limits<double>::min()
 
double m_xDelta = 0
 
double m_yDelta = 0
 
int m_pressedKeyCode
 
int m_releasedKeyCode
 
Qt::KeyboardModifiers m_keyboardModifiers
 
Qt::MouseButtons m_lastPressedMouseButton
 
Qt::MouseButtons m_lastReleasedMouseButton
 
Qt::MouseButtons m_pressedMouseButtons
 
Qt::MouseButtons m_mouseButtonsAtMousePress
 
Qt::MouseButtons m_mouseButtonsAtMouseRelease
 

Detailed Description

Definition at line 21 of file massspectraceplotcontext.h.

Constructor & Destructor Documentation

◆ MassSpecTracePlotContext() [1/2]

pappso::MassSpecTracePlotContext::MassSpecTracePlotContext ( )

Definition at line 18 of file massspectraceplotcontext.cpp.

19 {
20 }

◆ MassSpecTracePlotContext() [2/2]

pappso::MassSpecTracePlotContext::MassSpecTracePlotContext ( const MassSpecTracePlotContext other)

Definition at line 23 of file massspectraceplotcontext.cpp.

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 }

◆ ~MassSpecTracePlotContext()

pappso::MassSpecTracePlotContext::~MassSpecTracePlotContext ( )
virtual

Definition at line 36 of file massspectraceplotcontext.cpp.

37 {
38 }

Member Function Documentation

◆ operator=() [1/2]

MassSpecTracePlotContext & pappso::MassSpecTracePlotContext::operator= ( const BasePlotContext other)

Definition at line 41 of file massspectraceplotcontext.cpp.

42 {
43  if(this == &other)
44  return *this;
45 
46  // First the BasePlotContext members
47 
48  m_dataKind = other.m_dataKind;
49 
50  m_isMouseDragging = other.m_isMouseDragging;
51  m_wasMouseDragging = other.m_wasMouseDragging;
52 
53  m_isKeyBoardDragging = other.m_isKeyBoardDragging;
54  m_isLeftPseudoButtonKeyPressed = other.m_isLeftPseudoButtonKeyPressed;
55  m_isRightPseudoButtonKeyPressed = other.m_isRightPseudoButtonKeyPressed;
56  m_wassKeyBoardDragging = other.m_wassKeyBoardDragging;
57 
58  m_startDragPoint = other.m_startDragPoint;
59  m_currentDragPoint = other.m_currentDragPoint;
60  m_lastCursorHoveredPoint = other.m_lastCursorHoveredPoint;
61 
62  m_selectionPolygon = other.m_selectionPolygon;
63  m_selectRectangleWidth = other.m_selectRectangleWidth;
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).
73  m_wasClickOnXAxis = other.m_wasClickOnXAxis;
74  m_wasClickOnYAxis = other.m_wasClickOnYAxis;
75 
76  m_isMeasuringDistance = other.m_isMeasuringDistance;
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.
84  m_xRegionRangeStart = other.m_xRegionRangeStart;
85  m_xRegionRangeEnd = other.m_xRegionRangeEnd;
86 
87  m_yRegionRangeStart = other.m_yRegionRangeStart;
88  m_yRegionRangeEnd = other.m_yRegionRangeEnd;
89 
90  m_xDelta = other.m_xDelta;
91  m_yDelta = other.m_yDelta;
92 
93  m_pressedKeyCode = other.m_pressedKeyCode;
94  m_releasedKeyCode = other.m_releasedKeyCode;
95 
96  m_keyboardModifiers = other.m_keyboardModifiers;
97 
98  m_lastPressedMouseButton = other.m_lastPressedMouseButton;
99  m_lastReleasedMouseButton = other.m_lastReleasedMouseButton;
100 
101  m_pressedMouseButtons = other.m_pressedMouseButtons;
102 
103  m_mouseButtonsAtMousePress = other.m_mouseButtonsAtMousePress;
104  m_mouseButtonsAtMouseRelease = other.m_mouseButtonsAtMouseRelease;
105 
106  return *this;
107 }
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

References pappso::BasePlotContext::m_currentDragPoint, pappso::BasePlotContext::m_dataKind, pappso::BasePlotContext::m_isKeyBoardDragging, pappso::BasePlotContext::m_isLeftPseudoButtonKeyPressed, pappso::BasePlotContext::m_isMeasuringDistance, pappso::BasePlotContext::m_isMouseDragging, pappso::BasePlotContext::m_isRightPseudoButtonKeyPressed, pappso::BasePlotContext::m_keyboardModifiers, pappso::BasePlotContext::m_lastCursorHoveredPoint, pappso::BasePlotContext::m_lastPressedMouseButton, pappso::BasePlotContext::m_lastReleasedMouseButton, pappso::BasePlotContext::m_mouseButtonsAtMousePress, pappso::BasePlotContext::m_mouseButtonsAtMouseRelease, pappso::BasePlotContext::m_pressedKeyCode, pappso::BasePlotContext::m_pressedMouseButtons, pappso::BasePlotContext::m_releasedKeyCode, pappso::BasePlotContext::m_selectionPolygon, pappso::BasePlotContext::m_selectRectangleWidth, pappso::BasePlotContext::m_startDragPoint, pappso::BasePlotContext::m_wasClickOnXAxis, pappso::BasePlotContext::m_wasClickOnYAxis, pappso::BasePlotContext::m_wasMouseDragging, pappso::BasePlotContext::m_wassKeyBoardDragging, pappso::BasePlotContext::m_xDelta, pappso::BasePlotContext::m_xRange, pappso::BasePlotContext::m_xRegionRangeEnd, pappso::BasePlotContext::m_xRegionRangeStart, pappso::BasePlotContext::m_yDelta, pappso::BasePlotContext::m_yRange, pappso::BasePlotContext::m_yRegionRangeEnd, and pappso::BasePlotContext::m_yRegionRangeStart.

◆ operator=() [2/2]

MassSpecTracePlotContext & pappso::MassSpecTracePlotContext::operator= ( const MassSpecTracePlotContext other)

Definition at line 111 of file massspectraceplotcontext.cpp.

112 {
113  if(this == &other)
114  return *this;
115 
116  // First the BasePlotContext members
117 
118  m_dataKind = other.m_dataKind;
119 
120  m_isMouseDragging = other.m_isMouseDragging;
121  m_wasMouseDragging = other.m_wasMouseDragging;
122 
123  m_isKeyBoardDragging = other.m_isKeyBoardDragging;
124  m_isLeftPseudoButtonKeyPressed = other.m_isLeftPseudoButtonKeyPressed;
125  m_isRightPseudoButtonKeyPressed = other.m_isRightPseudoButtonKeyPressed;
126  m_wassKeyBoardDragging = other.m_wassKeyBoardDragging;
127 
128  m_startDragPoint = other.m_startDragPoint;
129  m_currentDragPoint = other.m_currentDragPoint;
130  m_lastCursorHoveredPoint = other.m_lastCursorHoveredPoint;
131 
132  m_selectionPolygon = other.m_selectionPolygon;
133  m_selectRectangleWidth = other.m_selectRectangleWidth;
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).
143  m_wasClickOnXAxis = other.m_wasClickOnXAxis;
144  m_wasClickOnYAxis = other.m_wasClickOnYAxis;
145 
146  m_isMeasuringDistance = other.m_isMeasuringDistance;
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.
154  m_xRegionRangeStart = other.m_xRegionRangeStart;
155  m_xRegionRangeEnd = other.m_xRegionRangeEnd;
156 
157  m_yRegionRangeStart = other.m_yRegionRangeStart;
158  m_yRegionRangeEnd = other.m_yRegionRangeEnd;
159 
160  m_xDelta = other.m_xDelta;
161  m_yDelta = other.m_yDelta;
162 
163  m_pressedKeyCode = other.m_pressedKeyCode;
164  m_releasedKeyCode = other.m_releasedKeyCode;
165 
166  m_keyboardModifiers = other.m_keyboardModifiers;
167 
168  m_lastPressedMouseButton = other.m_lastPressedMouseButton;
169  m_lastReleasedMouseButton = other.m_lastReleasedMouseButton;
170 
171  m_pressedMouseButtons = other.m_pressedMouseButtons;
172 
173  m_mouseButtonsAtMousePress = other.m_mouseButtonsAtMousePress;
174  m_mouseButtonsAtMouseRelease = other.m_mouseButtonsAtMouseRelease;
175 
176  // Second the mass spec trace plot-specific members
177 
178  m_lastZ = other.m_lastZ;
179  m_lastMz = other.m_lastMz;
180  m_lastTicIntensity = other.m_lastTicIntensity;
181  m_lastMr = other.m_lastMr;
182  m_lastResolvingPower = other.m_lastResolvingPower;
183 
184  return *this;
185 }

References pappso::BasePlotContext::m_currentDragPoint, pappso::BasePlotContext::m_dataKind, pappso::BasePlotContext::m_isKeyBoardDragging, pappso::BasePlotContext::m_isLeftPseudoButtonKeyPressed, pappso::BasePlotContext::m_isMeasuringDistance, pappso::BasePlotContext::m_isMouseDragging, pappso::BasePlotContext::m_isRightPseudoButtonKeyPressed, pappso::BasePlotContext::m_keyboardModifiers, pappso::BasePlotContext::m_lastCursorHoveredPoint, m_lastMr, m_lastMz, pappso::BasePlotContext::m_lastPressedMouseButton, pappso::BasePlotContext::m_lastReleasedMouseButton, m_lastResolvingPower, m_lastTicIntensity, m_lastZ, pappso::BasePlotContext::m_mouseButtonsAtMousePress, pappso::BasePlotContext::m_mouseButtonsAtMouseRelease, pappso::BasePlotContext::m_pressedKeyCode, pappso::BasePlotContext::m_pressedMouseButtons, pappso::BasePlotContext::m_releasedKeyCode, pappso::BasePlotContext::m_selectionPolygon, pappso::BasePlotContext::m_selectRectangleWidth, pappso::BasePlotContext::m_startDragPoint, pappso::BasePlotContext::m_wasClickOnXAxis, pappso::BasePlotContext::m_wasClickOnYAxis, pappso::BasePlotContext::m_wasMouseDragging, pappso::BasePlotContext::m_wassKeyBoardDragging, pappso::BasePlotContext::m_xDelta, pappso::BasePlotContext::m_xRange, pappso::BasePlotContext::m_xRegionRangeEnd, pappso::BasePlotContext::m_xRegionRangeStart, pappso::BasePlotContext::m_yDelta, pappso::BasePlotContext::m_yRange, pappso::BasePlotContext::m_yRegionRangeEnd, and pappso::BasePlotContext::m_yRegionRangeStart.

◆ toString()

QString pappso::MassSpecTracePlotContext::toString ( ) const

Definition at line 189 of file massspectraceplotcontext.cpp.

190 {
191  QString text("Base context:\n");
192 
193  text += BasePlotContext::toString();
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 }

References m_lastMr, m_lastMz, m_lastResolvingPower, m_lastTicIntensity, m_lastZ, and pappso::BasePlotContext::toString().

Member Data Documentation

◆ m_lastMr

double pappso::MassSpecTracePlotContext::m_lastMr = std::numeric_limits<double>::min()

◆ m_lastMz

double pappso::MassSpecTracePlotContext::m_lastMz = std::numeric_limits<double>::min()

◆ m_lastResolvingPower

double pappso::MassSpecTracePlotContext::m_lastResolvingPower = std::numeric_limits<double>::min()

◆ m_lastTicIntensity

double pappso::MassSpecTracePlotContext::m_lastTicIntensity = std::numeric_limits<double>::min()

◆ m_lastZ


The documentation for this class was generated from the following files: