Loading...
Searching...
No Matches
massspectraceplotcontext.cpp
Go to the documentation of this file.
// Copyright 2021 Filippo Rusconi
// GPLv3+
/////////////////////// StdLib includes
/////////////////////// Qt includes
#include <QString>
/////////////////////// Local includes
#include "massspectraceplotcontext.h"
namespace pappso
{
MassSpecTracePlotContext::MassSpecTracePlotContext()
{
}
MassSpecTracePlotContext::MassSpecTracePlotContext(
const MassSpecTracePlotContext &other)
: BasePlotContext(other),
m_lastZ(other.m_lastZ),
m_lastMz(other.m_lastMz),
m_lastTicIntensity(other.m_lastTicIntensity),
m_lastMr(other.m_lastMr),
m_lastResolvingPower(other.m_lastResolvingPower)
{
// qDebug() << "Constructing MassSpecTracePlotContext by copy.";
}
MassSpecTracePlotContext::~MassSpecTracePlotContext()
{
}
MassSpecTracePlotContext &
MassSpecTracePlotContext::operator=(const BasePlotContext &other)
{
if(this == &other)
return *this;
// First the BasePlotContext members
m_dataKind = other.m_dataKind;
m_isMouseDragging = other.m_isMouseDragging;
m_wasMouseDragging = other.m_wasMouseDragging;
m_isKeyBoardDragging = other.m_isKeyBoardDragging;
m_isLeftPseudoButtonKeyPressed = other.m_isLeftPseudoButtonKeyPressed;
m_isRightPseudoButtonKeyPressed = other.m_isRightPseudoButtonKeyPressed;
m_wassKeyBoardDragging = other.m_wassKeyBoardDragging;
m_startDragPoint = other.m_startDragPoint;
m_currentDragPoint = other.m_currentDragPoint;
m_lastCursorHoveredPoint = other.m_lastCursorHoveredPoint;
m_selectionPolygon = other.m_selectionPolygon;
m_selectRectangleWidth = other.m_selectRectangleWidth;
// The effective range of the axes.
m_xRange = other.m_xRange;
m_yRange = other.m_yRange;
// Tell if the mouse move was started onto either axis, because that will
// condition if some calculations needs to be performed or not (for example,
// if the mouse cursor motion was started on an axis, there is no point to
// perform deconvolutions).
m_wasClickOnXAxis = other.m_wasClickOnXAxis;
m_wasClickOnYAxis = other.m_wasClickOnYAxis;
m_isMeasuringDistance = other.m_isMeasuringDistance;
// The user-selected region over the plot.
// Note that we cannot use QCPRange structures because these are normalized by
// QCustomPlot in such a manner that lower is actually < upper. But we need
// for a number of our calculations (specifically for the deconvolutions) to
// actually have the lower value be start drag point.x even if the drag
// direction was from right to left.
m_xRegionRangeStart = other.m_xRegionRangeStart;
m_xRegionRangeEnd = other.m_xRegionRangeEnd;
m_yRegionRangeStart = other.m_yRegionRangeStart;
m_yRegionRangeEnd = other.m_yRegionRangeEnd;
m_xDelta = other.m_xDelta;
m_yDelta = other.m_yDelta;
m_pressedKeyCode = other.m_pressedKeyCode;
m_releasedKeyCode = other.m_releasedKeyCode;
m_keyboardModifiers = other.m_keyboardModifiers;
m_lastPressedMouseButton = other.m_lastPressedMouseButton;
m_lastReleasedMouseButton = other.m_lastReleasedMouseButton;
m_pressedMouseButtons = other.m_pressedMouseButtons;
m_mouseButtonsAtMousePress = other.m_mouseButtonsAtMousePress;
m_mouseButtonsAtMouseRelease = other.m_mouseButtonsAtMouseRelease;
return *this;
}
MassSpecTracePlotContext &
MassSpecTracePlotContext::operator=(const MassSpecTracePlotContext &other)
{
if(this == &other)
return *this;
// First the BasePlotContext members
m_dataKind = other.m_dataKind;
m_isMouseDragging = other.m_isMouseDragging;
m_wasMouseDragging = other.m_wasMouseDragging;
m_isKeyBoardDragging = other.m_isKeyBoardDragging;
m_isLeftPseudoButtonKeyPressed = other.m_isLeftPseudoButtonKeyPressed;
m_isRightPseudoButtonKeyPressed = other.m_isRightPseudoButtonKeyPressed;
m_wassKeyBoardDragging = other.m_wassKeyBoardDragging;
m_startDragPoint = other.m_startDragPoint;
m_currentDragPoint = other.m_currentDragPoint;
m_lastCursorHoveredPoint = other.m_lastCursorHoveredPoint;
m_selectionPolygon = other.m_selectionPolygon;
m_selectRectangleWidth = other.m_selectRectangleWidth;
// The effective range of the axes.
m_xRange = other.m_xRange;
m_yRange = other.m_yRange;
// Tell if the mouse move was started onto either axis, because that will
// condition if some calculations needs to be performed or not (for example,
// if the mouse cursor motion was started on an axis, there is no point to
// perform deconvolutions).
m_wasClickOnXAxis = other.m_wasClickOnXAxis;
m_wasClickOnYAxis = other.m_wasClickOnYAxis;
m_isMeasuringDistance = other.m_isMeasuringDistance;
// The user-selected region over the plot.
// Note that we cannot use QCPRange structures because these are normalized by
// QCustomPlot in such a manner that lower is actually < upper. But we need
// for a number of our calculations (specifically for the deconvolutions) to
// actually have the lower value be start drag point.x even if the drag
// direction was from right to left.
m_xRegionRangeStart = other.m_xRegionRangeStart;
m_xRegionRangeEnd = other.m_xRegionRangeEnd;
m_yRegionRangeStart = other.m_yRegionRangeStart;
m_yRegionRangeEnd = other.m_yRegionRangeEnd;
m_xDelta = other.m_xDelta;
m_yDelta = other.m_yDelta;
m_pressedKeyCode = other.m_pressedKeyCode;
m_releasedKeyCode = other.m_releasedKeyCode;
m_keyboardModifiers = other.m_keyboardModifiers;
m_lastPressedMouseButton = other.m_lastPressedMouseButton;
m_lastReleasedMouseButton = other.m_lastReleasedMouseButton;
m_pressedMouseButtons = other.m_pressedMouseButtons;
m_mouseButtonsAtMousePress = other.m_mouseButtonsAtMousePress;
m_mouseButtonsAtMouseRelease = other.m_mouseButtonsAtMouseRelease;
// Second the mass spec trace plot-specific members
m_lastZ = other.m_lastZ;
m_lastMz = other.m_lastMz;
m_lastTicIntensity = other.m_lastTicIntensity;
m_lastMr = other.m_lastMr;
m_lastResolvingPower = other.m_lastResolvingPower;
return *this;
}
QString
MassSpecTracePlotContext::toString() const
{
QString text("Base context:\n");
text += BasePlotContext::toString();
text += "\n";
text += "Mass spectrum trace plot context\n";
text += QString("last z: %1").arg(m_lastZ);
text += QString("last m/z: %1").arg(m_lastMz, 0, 'f', 6);
text += QString("last TIC intensity: %1").arg(m_lastTicIntensity, 0, 'g', 0);
text += QString("last Mr: %1").arg(m_lastMr, 0, 'f', 6);
text +=
QString("last resolving power: %1").arg(m_lastResolvingPower, 0, 'g', 0);
text += "\n";
return text;
}
} // namespace pappso
pappso::BasePlotContext
Definition baseplotcontext.h:36
pappso::BasePlotContext::m_xRegionRangeStart
double m_xRegionRangeStart
Definition baseplotcontext.h:81
pappso::BasePlotContext::m_startDragPoint
QPointF m_startDragPoint
Definition baseplotcontext.h:54
pappso::BasePlotContext::m_xDelta
double m_xDelta
Definition baseplotcontext.h:87
pappso::BasePlotContext::m_mouseButtonsAtMousePress
Qt::MouseButtons m_mouseButtonsAtMousePress
Definition baseplotcontext.h:100
pappso::BasePlotContext::m_selectionPolygon
SelectionPolygon m_selectionPolygon
Definition baseplotcontext.h:59
pappso::BasePlotContext::m_wasClickOnXAxis
bool m_wasClickOnXAxis
Definition baseplotcontext.h:70
pappso::BasePlotContext::m_keyboardModifiers
Qt::KeyboardModifiers m_keyboardModifiers
Definition baseplotcontext.h:93
pappso::BasePlotContext::m_pressedKeyCode
int m_pressedKeyCode
Definition baseplotcontext.h:90
pappso::BasePlotContext::m_lastPressedMouseButton
Qt::MouseButtons m_lastPressedMouseButton
Definition baseplotcontext.h:95
pappso::BasePlotContext::m_isMouseDragging
bool m_isMouseDragging
Definition baseplotcontext.h:46
pappso::BasePlotContext::m_xRange
QCPRange m_xRange
Definition baseplotcontext.h:63
pappso::BasePlotContext::m_isMeasuringDistance
bool m_isMeasuringDistance
Definition baseplotcontext.h:73
pappso::BasePlotContext::m_lastCursorHoveredPoint
QPointF m_lastCursorHoveredPoint
Definition baseplotcontext.h:56
pappso::BasePlotContext::m_currentDragPoint
QPointF m_currentDragPoint
Definition baseplotcontext.h:55
pappso::BasePlotContext::m_yDelta
double m_yDelta
Definition baseplotcontext.h:88
pappso::BasePlotContext::m_yRegionRangeStart
double m_yRegionRangeStart
Definition baseplotcontext.h:84
pappso::BasePlotContext::m_isRightPseudoButtonKeyPressed
bool m_isRightPseudoButtonKeyPressed
Definition baseplotcontext.h:51
pappso::BasePlotContext::m_pressedMouseButtons
Qt::MouseButtons m_pressedMouseButtons
Definition baseplotcontext.h:98
pappso::BasePlotContext::m_yRange
QCPRange m_yRange
Definition baseplotcontext.h:64
pappso::BasePlotContext::m_mouseButtonsAtMouseRelease
Qt::MouseButtons m_mouseButtonsAtMouseRelease
Definition baseplotcontext.h:101
pappso::BasePlotContext::m_releasedKeyCode
int m_releasedKeyCode
Definition baseplotcontext.h:91
pappso::BasePlotContext::m_isLeftPseudoButtonKeyPressed
bool m_isLeftPseudoButtonKeyPressed
Definition baseplotcontext.h:50
pappso::BasePlotContext::m_dataKind
DataKind m_dataKind
Definition baseplotcontext.h:44
pappso::BasePlotContext::m_lastReleasedMouseButton
Qt::MouseButtons m_lastReleasedMouseButton
Definition baseplotcontext.h:96
pappso::BasePlotContext::toString
QString toString() const
Definition baseplotcontext.cpp:175
pappso::BasePlotContext::m_wasMouseDragging
bool m_wasMouseDragging
Definition baseplotcontext.h:47
pappso::BasePlotContext::m_wassKeyBoardDragging
bool m_wassKeyBoardDragging
Definition baseplotcontext.h:52
pappso::BasePlotContext::m_yRegionRangeEnd
double m_yRegionRangeEnd
Definition baseplotcontext.h:85
pappso::BasePlotContext::m_xRegionRangeEnd
double m_xRegionRangeEnd
Definition baseplotcontext.h:82
pappso::BasePlotContext::m_selectRectangleWidth
double m_selectRectangleWidth
Definition baseplotcontext.h:60
pappso::BasePlotContext::m_wasClickOnYAxis
bool m_wasClickOnYAxis
Definition baseplotcontext.h:71
pappso::BasePlotContext::m_isKeyBoardDragging
bool m_isKeyBoardDragging
Definition baseplotcontext.h:49
pappso::MassSpecTracePlotContext
Definition massspectraceplotcontext.h:22
pappso::MassSpecTracePlotContext::MassSpecTracePlotContext
MassSpecTracePlotContext()
Definition massspectraceplotcontext.cpp:18
pappso::MassSpecTracePlotContext::m_lastMz
double m_lastMz
Definition massspectraceplotcontext.h:33
pappso::MassSpecTracePlotContext::m_lastResolvingPower
double m_lastResolvingPower
Definition massspectraceplotcontext.h:36
pappso::MassSpecTracePlotContext::toString
QString toString() const
Definition massspectraceplotcontext.cpp:189
pappso::MassSpecTracePlotContext::m_lastZ
int m_lastZ
Definition massspectraceplotcontext.h:32
pappso::MassSpecTracePlotContext::~MassSpecTracePlotContext
virtual ~MassSpecTracePlotContext()
Definition massspectraceplotcontext.cpp:36
pappso::MassSpecTracePlotContext::operator=
MassSpecTracePlotContext & operator=(const BasePlotContext &other)
Definition massspectraceplotcontext.cpp:41
pappso::MassSpecTracePlotContext::m_lastMr
double m_lastMr
Definition massspectraceplotcontext.h:35
pappso::MassSpecTracePlotContext::m_lastTicIntensity
double m_lastTicIntensity
Definition massspectraceplotcontext.h:34
massspectraceplotcontext.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39