BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
containeritem.cpp
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/model/mvvm/standarditems/containeritem.cpp
6 //! @brief Implements 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 
16 
17 using namespace ModelView;
18 
19 ContainerItem::ContainerItem(const std::string& modelType) : CompoundItem(modelType)
20 {
21  registerTag(ModelView::TagInfo::universalTag(T_ITEMS), /*set_as_default*/ true);
22 }
23 
25 {
26  return childrenCount() == 0;
27 }
28 
29 size_t ContainerItem::size() const
30 {
31  return static_cast<size_t>(childrenCount());
32 }
Complex item holding mixed SessionItem types (single properties and other CompountItems).
Definition: compounditem.h:28
static const std::string T_ITEMS
Definition: containeritem.h:27
ContainerItem(const std::string &modelType=Constants::ContainerItemType)
void registerTag(const TagInfo &tagInfo, bool set_as_default=false)
Registers tag to hold items under given name.
int childrenCount() const
Returns total number of children in all tags.
static TagInfo universalTag(std::string name, std::vector< std::string > modelTypes={})
Constructs universal tag intended for unlimited amount of various items.
Definition: taginfo.cpp:34
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.