-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRenderModeAction.h
More file actions
95 lines (73 loc) · 2.67 KB
/
RenderModeAction.h
File metadata and controls
95 lines (73 loc) · 2.67 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
91
92
93
94
95
#pragma once
#include <actions/OptionAction.h>
#include <actions/ToggleAction.h>
using namespace mv::gui;
class ScatterplotPlugin;
/**
* Render mode action class
*
* Action class for configuring render mode settings
*
* @author Thomas Kroes
*/
class RenderModeAction : public OptionAction
{
Q_OBJECT
enum class RenderMode {
ScatterPlot,
DensityPlot,
ContourPlot,
};
public:
/**
* Construct with \p parent and \p title
* @param parent Pointer to parent object
* @param title Title of the action
*/
Q_INVOKABLE RenderModeAction(QObject* parent, const QString& title);
/**
* Initialize the selection action with \p scatterplotPlugin
* @param scatterplotPlugin Pointer to scatterplot plugin
*/
void initialize(ScatterplotPlugin* scatterplotPlugin);
/**
* Get action context menu
* @return Pointer to menu
*/
QMenu* getContextMenu();
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
ToggleAction& getScatterPlotAction() { return _scatterPlotAction; }
ToggleAction& getDensityPlotAction() { return _densityPlotAction; }
ToggleAction& getContourPlotAction() { return _contourPlotAction; }
private:
ScatterplotPlugin* _scatterplotPlugin; /** Pointer to scatterplot plugin */
ToggleAction _scatterPlotAction; /** Trigger action for activating the scatter plot render mode */
ToggleAction _densityPlotAction; /** Trigger action for activating the density plot render mode */
ToggleAction _contourPlotAction; /** Trigger action for activating the contour plot render mode */
friend class mv::AbstractActionsManager;
};
Q_DECLARE_METATYPE(RenderModeAction)
inline const auto renderModeActionMetaTypeId = qRegisterMetaType<RenderModeAction*>("RenderModeAction");