-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPositionAction.h
More file actions
90 lines (67 loc) · 2.4 KB
/
PositionAction.h
File metadata and controls
90 lines (67 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#include <actions/VerticalGroupAction.h>
#include <PointData/DimensionPickerAction.h>
#include <QHBoxLayout>
#include <QLabel>
using namespace mv::gui;
/**
* Position action class
*
* Action class for picking data dimensions for the point positions
*
* @author Thomas Kroes
*/
class PositionAction : public VerticalGroupAction
{
Q_OBJECT
public:
/**
* Construct with \p parent object and \p title
* @param parent Pointer to parent object
* @param title Title
*/
Q_INVOKABLE PositionAction(QObject* parent, const QString& title);
/**
* Get the context menu for the action
* @param parent Parent widget
* @return Context menu
*/
QMenu* getContextMenu(QWidget* parent = nullptr) override;
/** Get current x-dimension */
std::int32_t getDimensionX() const;
/** Get current y-dimension */
std::int32_t getDimensionY() const;
protected: // Linking
/**
* Connect this action to a public action
* @param publicAction Pointer to public action to connect to
* @param recursive Whether to also connect descendant child actions
*/
void connectToPublicAction(WidgetAction* publicAction, bool recursive) override;
/**
* Disconnect this action from its public action
* @param recursive Whether to also disconnect descendant child actions
*/
void disconnectFromPublicAction(bool recursive) override;
public: // Serialization
/**
* Load widget action from variant map
* @param Variant map representation of the widget action
*/
void fromVariantMap(const QVariantMap& variantMap) override;
/**
* Save widget action to variant map
* @return Variant map representation of the widget action
*/
QVariantMap toVariantMap() const override;
public: // Action getters
DimensionPickerAction& getXDimensionPickerAction() { return _xDimensionPickerAction; }
DimensionPickerAction& getYDimensionPickerAction() { return _yDimensionPickerAction; }
private:
DimensionPickerAction _xDimensionPickerAction; /** X-dimension picker action */
DimensionPickerAction _yDimensionPickerAction; /** Y-dimension picker action */
bool _dontUpdateScatterplot;
friend class mv::AbstractActionsManager;
};
Q_DECLARE_METATYPE(PositionAction)
inline const auto positionActionMetaTypeId = qRegisterMetaType<PositionAction*>("PositionAction");