BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
standardchildrenstrategies.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDCHILDRENSTRATEGIES_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDCHILDRENSTRATEGIES_H
17 
18 //! @file mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h
19 //! @brief Collection of strategies to find children, actual of fictional, of given SessionItem.
20 //! Used for ViewModel generation when underlying SessionModel changes its layout.
21 
23 
24 namespace ModelView {
25 
26 class SessionItem;
27 
28 //! Strategy to find children of given item: gives all actual children back.
29 
30 class MVVM_VIEWMODEL_EXPORT AllChildrenStrategy : public ChildrenStrategyInterface {
31 public:
32  std::vector<SessionItem*> children(const SessionItem* item) const override;
33 };
34 
35 //! Strategy to find children of given item: only top level items will be given, all
36 //! property items will be filtered out.
37 
38 class MVVM_VIEWMODEL_EXPORT TopItemsStrategy : public ChildrenStrategyInterface {
39 public:
40  std::vector<SessionItem*> children(const SessionItem* item) const override;
41 };
42 
43 //! Strategy to find children of given item: only property item will be given, all top level items
44 //! will be filtered out, all inactive children of GroupItem will be filtered out. See example
45 //! in code.
46 
47 class MVVM_VIEWMODEL_EXPORT PropertyItemsStrategy : public ChildrenStrategyInterface {
48 public:
49  std::vector<SessionItem*> children(const SessionItem* item) const override;
50 };
51 
52 //! Strategy to find children of given item: flat alignment.
53 //! Acts as PropertyItemStrategy, with the difference that active subproperties of
54 //! GroupItem are moved to the same parent, as GroupItem itself. See example in code.
55 
56 class MVVM_VIEWMODEL_EXPORT PropertyItemsFlatStrategy : public ChildrenStrategyInterface {
57 public:
58  std::vector<SessionItem*> children(const SessionItem* item) const override;
59 };
60 
61 } // namespace ModelView
62 
63 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDCHILDRENSTRATEGIES_H
Defines class CLASS?
Strategy to find children of given item: gives all actual children back.
Base class for strategies to find children, actual of fictional, of given item.
Strategy to find children of given item: flat alignment.
Strategy to find children of given item: only property item will be given, all top level items will b...
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Strategy to find children of given item: only top level items will be given, all property items will ...
materialitems.h Collection of materials to populate MaterialModel.