VAPOR3
3.9.4
apps
vaporgui
ParamsMenuItems.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <vector>
4
#include <cassert>
5
#include <QAction>
6
7
namespace
VAPoR
{
8
class
ParamsBase;
9
}
10
11
// ******************************
12
// ParamsMenuItem
13
// ******************************
14
17
18
class
ParamsMenuItem
:
public
QAction {
19
Q_OBJECT
20
21
public
:
22
ParamsMenuItem
(QObject *parent,
const
std::string &tag,
const
std::string &label =
""
);
23
virtual
void
Update
(
VAPoR::ParamsBase
*p) = 0;
24
25
protected
:
26
VAPoR::ParamsBase
*
_params
=
nullptr
;
27
std::string
_tag
;
28
std::string
_label
;
29
};
30
31
// ******************************
32
// ParamsCheckboxMenuItem
33
// ******************************
34
35
class
ParamsCheckboxMenuItem
:
public
ParamsMenuItem
{
36
Q_OBJECT
37
38
public
:
39
ParamsCheckboxMenuItem
(QObject *parent,
const
std::string &tag,
const
std::string &label =
""
);
40
void
Update
(
VAPoR::ParamsBase
*p);
41
42
private
slots:
43
void
wasToggled(
bool
b);
44
};
45
46
// ******************************
47
// ParamsDropdownMenuItem
48
// ******************************
49
50
class
ParamsDropdownMenuItem
:
public
ParamsMenuItem
{
51
Q_OBJECT
52
53
std::vector<int> _itemValues;
54
std::vector<QAction *> _items;
55
56
public
:
57
ParamsDropdownMenuItem
(QObject *parent,
const
std::string &tag,
const
std::vector<std::string> &items,
const
std::vector<int> &itemValues = {},
const
std::string &label =
""
);
58
void
Update
(
VAPoR::ParamsBase
*p);
59
60
private
:
61
void
_selectIndex(
int
index);
62
int
_getValueForIndex(
int
index)
const
;
63
int
_getIndexForValue(
int
value)
const
;
64
65
private
slots:
66
void
itemSelected();
67
};
ParamsCheckboxMenuItem
Definition:
ParamsMenuItems.h:35
ParamsCheckboxMenuItem::Update
void Update(VAPoR::ParamsBase *p)
ParamsCheckboxMenuItem::ParamsCheckboxMenuItem
ParamsCheckboxMenuItem(QObject *parent, const std::string &tag, const std::string &label="")
ParamsDropdownMenuItem
Definition:
ParamsMenuItems.h:50
ParamsDropdownMenuItem::ParamsDropdownMenuItem
ParamsDropdownMenuItem(QObject *parent, const std::string &tag, const std::vector< std::string > &items, const std::vector< int > &itemValues={}, const std::string &label="")
ParamsDropdownMenuItem::Update
void Update(VAPoR::ParamsBase *p)
ParamsMenuItem
Definition:
ParamsMenuItems.h:18
ParamsMenuItem::ParamsMenuItem
ParamsMenuItem(QObject *parent, const std::string &tag, const std::string &label="")
ParamsMenuItem::_tag
std::string _tag
Definition:
ParamsMenuItems.h:27
ParamsMenuItem::_params
VAPoR::ParamsBase * _params
Definition:
ParamsMenuItems.h:26
ParamsMenuItem::Update
virtual void Update(VAPoR::ParamsBase *p)=0
ParamsMenuItem::_label
std::string _label
Definition:
ParamsMenuItems.h:28
VAPoR::ParamsBase
Nodes with state in Xml tree representation.
Definition:
ParamsBase.h:50
VAPoR
Definition:
AnnotationParams.h:33
Generated by
1.9.6