BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
sldelementmodel.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/sldeditor/sldelementmodel.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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
17 
20 #include "mvvm/utils/reallimits.h"
21 
22 using namespace ModelView;
23 
24 namespace gui2 {
25 
26 namespace {
27 std::unique_ptr<ItemCatalogue> CreateItemCatalogue()
28 {
29  auto result = std::make_unique<ModelView::ItemCatalogue>();
30  result->registerItem<LayerElementItem>();
31  return result;
32 }
33 
34 } // namespace
35 
36 //! Contructor
37 SLDElementModel::SLDElementModel() : SessionModel("ViewItemsModel")
38 {
39  setItemCatalogue(CreateItemCatalogue());
40 }
41 
42 //! Add a layer item to the model and return its pointer
44 {
45  auto layer_element_item = insertItem<LayerElementItem>();
46  return layer_element_item;
47 }
48 
49 } // namespace gui2
Main class to hold hierarchy of SessionItem objects.
Definition: sessionmodel.h:37
void setItemCatalogue(std::unique_ptr< ItemCatalogue > catalogue)
Sets brand new catalog of user-defined items.
The mvvm session item associated to a layer.
LayerElementItem * addLayer()
Add a layer item.
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20
Defines class CLASS?
Defines class CLASS?