BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GroupItem.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file GUI/Model/BaseItem/GroupItem.h
6
//! @brief Defines class GroupItem
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************************************
14
15
#ifndef BORNAGAIN_GUI_MODEL_BASEITEM_GROUPITEM_H
16
#define BORNAGAIN_GUI_MODEL_BASEITEM_GROUPITEM_H
17
18
#include "
GUI/Model/BaseItem/GroupItemController.h
"
19
#include "
GUI/Model/BaseItem/SessionItem.h
"
20
#include <memory>
21
22
class
GroupInfo
;
23
class
GroupItemController
;
24
25
class
BA_CORE_API_
GroupItem
:
public
SessionItem
{
26
private
:
27
static
constexpr
auto
T_ITEMS{
"Item tag"
};
28
29
public
:
30
static
constexpr
auto
M_TYPE{
"GroupProperty"
};
31
32
GroupItem
();
33
~GroupItem
()
override
;
34
35
void
setGroupInfo(
const
GroupInfo
& groupInfo);
36
SessionItem
* currentItem()
const
;
37
38
QString currentType()
const
;
39
40
SessionItem
* setCurrentType(
const
QString& modelType);
41
42
SessionItem
* getItemOfType(
const
QString& type)
const
;
43
44
template
<
typename
T>
45
T* itemOfType()
const
;
46
47
QVector<SessionItem*> groupItems()
const
;
48
static
bool
isItemsTagName(
const
QString&
name
);
49
50
private
:
51
void
onValueChange();
52
void
updateComboValue();
53
std::unique_ptr<GroupItemController>
m_controller
;
54
};
55
56
template
<
typename
T>
57
T*
GroupItem::itemOfType
()
const
58
{
59
return
dynamic_cast<
T*
>
(
m_controller
->getItemOfType(T::M_TYPE));
60
}
61
62
#endif
// BORNAGAIN_GUI_MODEL_BASEITEM_GROUPITEM_H
GroupItemController.h
Defines class GroupItemController.
SessionItem.h
Defines class SessionItem.
GroupInfo
Defines info for GroupProperty, i.e. collection of model types, their labels and the name of default ...
Definition:
GroupInfo.h:25
GroupItemController
Provides logic for manipulating items belonging to GroupItem parent.
Definition:
GroupItemController.h:26
GroupItem
Definition:
GroupItem.h:25
GroupItem::~GroupItem
~GroupItem() override
GroupItem::m_controller
std::unique_ptr< GroupItemController > m_controller
Definition:
GroupItem.h:53
GroupItem::itemOfType
T * itemOfType() const
Definition:
GroupItem.h:57
SessionItem
Base class for a GUI data item.
Definition:
SessionItem.h:204
GUI::RealSpace::Particles::name
QString const & name(EShape k)
Definition:
particles.cpp:20
GUI
Model
BaseItem
GroupItem.h
Generated by
1.9.1