libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
baseplotcontext.h
Go to the documentation of this file.
1
// Copyright 2021 Filippo Rusconi
2
// GPL3+
3
4
#pragma once
5
6
/////////////////////// StdLib includes
7
8
9
/////////////////////// Qt includes
10
#include <QPointF>
11
#include <QString>
12
13
/////////////////////// Local includes
14
#include "
../../core/types.h
"
15
#include "
pappsomspp/export-import-config.h
"
16
#include "
pappsomspp/core/processing/combiners/integrationscopebase.h
"
17
#include "
pappsomspp/core/processing/combiners/selectionpolygon.h
"
18
19
20
////////////////////// Other includes
21
#include "qcustomplot.h"
22
23
namespace
pappso
24
{
25
26
Q_NAMESPACE
27
28
enum class
DragDirections
29
{
30
NOT_SET
= 0x0000,
31
LEFT_TO_RIGHT
= 1 << 0,
32
RIGHT_TO_LEFT
= 1 << 1,
33
TOP_TO_BOTTOM
= 1 << 2,
34
BOTTOM_TO_TOP
= 1 << 3
35
};
36
Q_ENUM_NS(
DragDirections
)
37
38
extern
std::map<Qt::MouseButton, QString>
qtMouseButtonMap
;
39
extern
std::map<Qt::MouseButtons, QString>
qtMouseButtonsMap
;
40
41
extern
std::map<Qt::KeyboardModifier, QString>
qtKeyboardModifierMap
;
42
43
44
class
PMSPP_LIB_DECL
BasePlotContext
45
{
46
public
:
47
explicit
BasePlotContext
();
48
49
virtual
~BasePlotContext
();
50
51
BasePlotContext
*
clone
();
52
void
initialize
(
const
BasePlotContext
&other);
53
54
BasePlotContext
(
const
BasePlotContext
&other);
55
BasePlotContext
&
operator=
(
const
BasePlotContext
&other);
56
57
Enums::DataKind
m_dataKind
=
Enums::DataKind::unset
;
58
59
bool
m_isMouseDragging
=
false
;
60
bool
m_wasMouseDragging
=
false
;
61
62
bool
m_isKeyBoardDragging
=
false
;
63
bool
m_isLeftPseudoButtonKeyPressed
=
false
;
64
bool
m_isRightPseudoButtonKeyPressed
=
false
;
65
bool
m_wasKeyBoardDragging
=
false
;
66
67
QPointF
m_startDragPoint
;
68
QPointF
m_currentDragPoint
;
69
QPointF
m_lastCursorHoveredPoint
;
70
DragDirections
m_dragDirections
=
DragDirections::NOT_SET
;
71
72
IntegrationScopeBase
*
mpa_integrationScope
=
nullptr
;
73
SelectionPolygon
m_selectionPolygon
;
74
double
m_integrationScopeRhombWidth
= 0;
75
double
m_integrationScopeRhombHeight
= 0;
76
77
// The effective range of the axes.
78
QCPRange
m_xRange
;
79
QCPRange
m_yRange
;
80
81
// Tell if the mouse move was started onto either axis, because that will
82
// condition if some calculations needs to be performed or not (for example,
83
// if the mouse cursor motion was started on an axis, there is no point to
84
// perform deconvolutions).
85
bool
m_wasClickOnXAxis
=
false
;
86
bool
m_wasClickOnYAxis
=
false
;
87
88
bool
m_isMeasuringDistance
=
false
;
89
90
// The user-selected region over the plot.
91
// Note that we cannot use QCPRange structures because these are normalized by
92
// QCustomPlot in such a manner that lower is actually < upper. But we need
93
// for a number of our calculations (specifically for the deconvolutions) to
94
// actually have the lower value be start drag point.x even if the drag
95
// direction was from right to left.
96
double
m_xRegionRangeStart
= std::numeric_limits<double>::min();
97
double
m_xRegionRangeStop
= std::numeric_limits<double>::min();
98
99
double
m_yRegionRangeStart
= std::numeric_limits<double>::min();
100
double
m_yRegionRangeStop
= std::numeric_limits<double>::min();
101
102
double
m_xDelta
= 0;
103
double
m_yDelta
= 0;
104
105
int
m_pressedKeyCode
;
106
QSet<int>
m_pressedKeyCodes
;
107
QString
m_pressedKeyText
;
108
int
m_releasedKeyCode
;
109
QSet<int>
m_releasedKeyCodes
;
110
QString
m_releasedKeyText
;
111
112
Qt::KeyboardModifiers
m_keyboardModifiers
;
113
114
Qt::MouseButtons
m_lastPressedMouseButton
;
115
Qt::MouseButtons
m_lastReleasedMouseButton
;
116
117
Qt::MouseButtons
m_pressedMouseButtons
;
118
119
Qt::MouseButtons
m_mouseButtonsAtMousePress
;
120
Qt::MouseButtons
m_mouseButtonsAtMouseRelease
;
121
122
void
updateIntegrationScope
();
123
void
updateIntegrationScopeRect
();
124
void
updateIntegrationScopeRhomb
();
125
void
updateIntegrationScopeRhombHorizontal
();
126
void
updateIntegrationScopeRhombVertical
();
127
128
DragDirections
recordDragDirections
();
129
130
QString
toString
()
const
;
131
QString
dragDirectionsToString
()
const
;
132
};
133
134
135
}
// namespace pappso
pappso::BasePlotContext::m_xRegionRangeStart
double m_xRegionRangeStart
Definition
baseplotcontext.h:96
pappso::BasePlotContext::m_startDragPoint
QPointF m_startDragPoint
Definition
baseplotcontext.h:67
pappso::BasePlotContext::m_xDelta
double m_xDelta
Definition
baseplotcontext.h:102
pappso::BasePlotContext::m_mouseButtonsAtMousePress
Qt::MouseButtons m_mouseButtonsAtMousePress
Definition
baseplotcontext.h:119
pappso::BasePlotContext::m_selectionPolygon
SelectionPolygon m_selectionPolygon
Definition
baseplotcontext.h:73
pappso::BasePlotContext::dragDirectionsToString
QString dragDirectionsToString() const
Definition
baseplotcontext.cpp:973
pappso::BasePlotContext::m_yRegionRangeStop
double m_yRegionRangeStop
Definition
baseplotcontext.h:100
pappso::BasePlotContext::recordDragDirections
DragDirections recordDragDirections()
Definition
baseplotcontext.cpp:827
pappso::BasePlotContext::m_dataKind
Enums::DataKind m_dataKind
Definition
baseplotcontext.h:57
pappso::BasePlotContext::m_wasClickOnXAxis
bool m_wasClickOnXAxis
Definition
baseplotcontext.h:85
pappso::BasePlotContext::m_keyboardModifiers
Qt::KeyboardModifiers m_keyboardModifiers
Definition
baseplotcontext.h:112
pappso::BasePlotContext::m_pressedKeyCode
int m_pressedKeyCode
Definition
baseplotcontext.h:105
pappso::BasePlotContext::m_xRegionRangeStop
double m_xRegionRangeStop
Definition
baseplotcontext.h:97
pappso::BasePlotContext::updateIntegrationScope
void updateIntegrationScope()
Definition
baseplotcontext.cpp:206
pappso::BasePlotContext::m_lastPressedMouseButton
Qt::MouseButtons m_lastPressedMouseButton
Definition
baseplotcontext.h:114
pappso::BasePlotContext::m_releasedKeyCodes
QSet< int > m_releasedKeyCodes
Definition
baseplotcontext.h:109
pappso::BasePlotContext::updateIntegrationScopeRhombVertical
void updateIntegrationScopeRhombVertical()
Definition
baseplotcontext.cpp:508
pappso::BasePlotContext::m_isMouseDragging
bool m_isMouseDragging
Definition
baseplotcontext.h:59
pappso::BasePlotContext::m_xRange
QCPRange m_xRange
Definition
baseplotcontext.h:78
pappso::BasePlotContext::updateIntegrationScopeRhombHorizontal
void updateIntegrationScopeRhombHorizontal()
Definition
baseplotcontext.cpp:348
pappso::BasePlotContext::m_isMeasuringDistance
bool m_isMeasuringDistance
Definition
baseplotcontext.h:88
pappso::BasePlotContext::m_dragDirections
DragDirections m_dragDirections
Definition
baseplotcontext.h:70
pappso::BasePlotContext::m_integrationScopeRhombHeight
double m_integrationScopeRhombHeight
Definition
baseplotcontext.h:75
pappso::BasePlotContext::m_lastCursorHoveredPoint
QPointF m_lastCursorHoveredPoint
Definition
baseplotcontext.h:69
pappso::BasePlotContext::m_currentDragPoint
QPointF m_currentDragPoint
Definition
baseplotcontext.h:68
pappso::BasePlotContext::initialize
void initialize(const BasePlotContext &other)
Definition
baseplotcontext.cpp:132
pappso::BasePlotContext::m_releasedKeyText
QString m_releasedKeyText
Definition
baseplotcontext.h:110
pappso::BasePlotContext::m_yDelta
double m_yDelta
Definition
baseplotcontext.h:103
pappso::BasePlotContext::m_pressedKeyCodes
QSet< int > m_pressedKeyCodes
Definition
baseplotcontext.h:106
pappso::BasePlotContext::updateIntegrationScopeRect
void updateIntegrationScopeRect()
Definition
baseplotcontext.cpp:236
pappso::BasePlotContext::mpa_integrationScope
IntegrationScopeBase * mpa_integrationScope
Definition
baseplotcontext.h:72
pappso::BasePlotContext::m_yRegionRangeStart
double m_yRegionRangeStart
Definition
baseplotcontext.h:99
pappso::BasePlotContext::updateIntegrationScopeRhomb
void updateIntegrationScopeRhomb()
Definition
baseplotcontext.cpp:672
pappso::BasePlotContext::m_isRightPseudoButtonKeyPressed
bool m_isRightPseudoButtonKeyPressed
Definition
baseplotcontext.h:64
pappso::BasePlotContext::m_pressedMouseButtons
Qt::MouseButtons m_pressedMouseButtons
Definition
baseplotcontext.h:117
pappso::BasePlotContext::m_yRange
QCPRange m_yRange
Definition
baseplotcontext.h:79
pappso::BasePlotContext::m_mouseButtonsAtMouseRelease
Qt::MouseButtons m_mouseButtonsAtMouseRelease
Definition
baseplotcontext.h:120
pappso::BasePlotContext::m_releasedKeyCode
int m_releasedKeyCode
Definition
baseplotcontext.h:108
pappso::BasePlotContext::m_isLeftPseudoButtonKeyPressed
bool m_isLeftPseudoButtonKeyPressed
Definition
baseplotcontext.h:63
pappso::BasePlotContext::operator=
BasePlotContext & operator=(const BasePlotContext &other)
Definition
baseplotcontext.cpp:756
pappso::BasePlotContext::BasePlotContext
BasePlotContext()
Definition
baseplotcontext.cpp:38
pappso::BasePlotContext::m_integrationScopeRhombWidth
double m_integrationScopeRhombWidth
Definition
baseplotcontext.h:74
pappso::BasePlotContext::m_lastReleasedMouseButton
Qt::MouseButtons m_lastReleasedMouseButton
Definition
baseplotcontext.h:115
pappso::BasePlotContext::toString
QString toString() const
Definition
baseplotcontext.cpp:849
pappso::BasePlotContext::m_wasKeyBoardDragging
bool m_wasKeyBoardDragging
Definition
baseplotcontext.h:65
pappso::BasePlotContext::m_wasMouseDragging
bool m_wasMouseDragging
Definition
baseplotcontext.h:60
pappso::BasePlotContext::clone
BasePlotContext * clone()
Definition
baseplotcontext.cpp:126
pappso::BasePlotContext::m_pressedKeyText
QString m_pressedKeyText
Definition
baseplotcontext.h:107
pappso::BasePlotContext::m_wasClickOnYAxis
bool m_wasClickOnYAxis
Definition
baseplotcontext.h:86
pappso::BasePlotContext::m_isKeyBoardDragging
bool m_isKeyBoardDragging
Definition
baseplotcontext.h:62
pappso::IntegrationScopeBase
Definition
integrationscopebase.h:61
pappso::SelectionPolygon
Definition
selectionpolygon.h:44
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
integrationscopebase.h
pappso::Enums::DataKind
DataKind
Definition
types.h:238
pappso::Enums::DataKind::unset
@ unset
not set
Definition
types.h:239
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::qtMouseButtonMap
std::map< Qt::MouseButton, QString > qtMouseButtonMap
Definition
baseplotcontext.cpp:12
pappso::DataDimension::NOT_SET
@ NOT_SET
Definition
selectionpolygon.h:36
pappso::DragDirections
DragDirections
Definition
baseplotcontext.h:29
pappso::DragDirections::RIGHT_TO_LEFT
@ RIGHT_TO_LEFT
Definition
baseplotcontext.h:32
pappso::DragDirections::NOT_SET
@ NOT_SET
Definition
baseplotcontext.h:30
pappso::DragDirections::LEFT_TO_RIGHT
@ LEFT_TO_RIGHT
Definition
baseplotcontext.h:31
pappso::DragDirections::BOTTOM_TO_TOP
@ BOTTOM_TO_TOP
Definition
baseplotcontext.h:34
pappso::DragDirections::TOP_TO_BOTTOM
@ TOP_TO_BOTTOM
Definition
baseplotcontext.h:33
pappso::qtMouseButtonsMap
std::map< Qt::MouseButtons, QString > qtMouseButtonsMap
Definition
baseplotcontext.cpp:18
pappso::qtKeyboardModifierMap
std::map< Qt::KeyboardModifier, QString > qtKeyboardModifierMap
Definition
baseplotcontext.cpp:29
selectionpolygon.h
types.h
pappsomspp
gui
plotwidget
baseplotcontext.h
Generated on
for libpappsomspp by
1.17.0