-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDatasetsAction.h
More file actions
94 lines (70 loc) · 3.43 KB
/
DatasetsAction.h
File metadata and controls
94 lines (70 loc) · 3.43 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
#pragma once
#include <actions/GroupAction.h>
#include <actions/DatasetPickerAction.h>
using namespace mv::gui;
class ScatterplotPlugin;
class DatasetsAction : public GroupAction
{
Q_OBJECT
public:
/**
* Construct with \p parent and \p title
* @param parent Pointer to parent object
* @param title Title of the action
*/
Q_INVOKABLE DatasetsAction(QObject* parent, const QString& title);
mv::Dataset<mv::DatasetImpl> getColorDataset() { return _colorDataset; }
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 variantMap 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;
protected: // Dataset picker action setup
/**
* Set up the dataset picker actions with the datasets from the scatter plot plugin
* @param scatterplotPlugin Pointer to scatter plot plugin whose datasets are used to populate the dataset picker actions
*/
void setupDatasetPickerActions(ScatterplotPlugin* scatterplotPlugin);
/**
* Set up the position dataset picker action with the position datasets from the scatter plot plugin
* @param scatterplotPlugin Pointer to scatter plot plugin whose position datasets are used to populate the dataset picker action
*/
void setupPositionDatasetPickerAction(ScatterplotPlugin* scatterplotPlugin);
/**
* Set up the color dataset picker action with the color datasets from the scatter plot plugin
* @param scatterplotPlugin Pointer to scatter plot plugin whose color datasets are used to populate the dataset picker action
*/
void setupColorDatasetPickerAction(ScatterplotPlugin* scatterplotPlugin);
/** Update the filters of the dataset picker actions based on the current datasets in the scatter plot plugin */
void invalidateDatasetPickerActionFilters();
public: // Action getters
DatasetPickerAction& getPositionDatasetPickerAction() { return _positionDatasetPickerAction; }
DatasetPickerAction& getColorDatasetPickerAction() { return _colorDatasetPickerAction; }
private:
ScatterplotPlugin* _scatterplotPlugin; /** Pointer to scatter plot plugin */
DatasetPickerAction _positionDatasetPickerAction; /** Dataset picker action for position dataset */
DatasetPickerAction _colorDatasetPickerAction; /** Dataset picker action for color dataset */
mv::Dataset<mv::DatasetImpl> _colorDataset; /** Smart pointer to dataset used for coloring (if any) */
friend class mv::AbstractActionsManager;
friend class ScatterplotPlugin;
};
Q_DECLARE_METATYPE(DatasetsAction)
inline const auto datasetsActionMetaTypeId = qRegisterMetaType<DatasetsAction*>("DatasetsAction");