BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
toymodel.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/tests/libtestmachinery/toymodel.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 
15 #include "toymodel.h"
17 #include "toyitems.h"
18 
19 namespace {
20 std::unique_ptr<ModelView::ItemCatalogue> CreateItemCatalogue()
21 {
22  auto result = std::make_unique<ModelView::ItemCatalogue>();
23  result->registerItem<ToyItems::MultiLayerItem>();
24  result->registerItem<ToyItems::LayerItem>();
25  result->registerItem<ToyItems::ParticleItem>();
26  result->registerItem<ToyItems::LatticeItem>();
27  result->registerItem<ToyItems::SphereItem>();
28  result->registerItem<ToyItems::CylinderItem>();
29  result->registerItem<ToyItems::AnysoPyramidItem>();
30  result->registerItem<ToyItems::ShapeGroupItem>();
31  return result;
32 }
33 } // namespace
34 
36 {
37  setItemCatalogue(CreateItemCatalogue());
38 }
39 
40 ToyItems::SampleModel::SampleModel(std::shared_ptr<ModelView::ItemPool> pool)
41  : SessionModel("ToyModel", pool)
42 {
43  setItemCatalogue(CreateItemCatalogue());
44 }
void setItemCatalogue(std::unique_ptr< ItemCatalogue > catalogue)
Sets brand new catalog of user-defined items.
Represents an anysotropical pyramid.
Definition: toyitems.h:107
Represents a cylindrical shape.
Definition: toyitems.h:88
Represents a lattice.
Definition: toyitems.h:72
Represents a layer, with thickness and color, and possibly populated with particles.
Definition: toyitems.h:52
Represents multilayer with collection of layers.
Definition: toyitems.h:44
Represents a particle, with a position, and a selection of possible shapes.
Definition: toyitems.h:62
Represents a group item holding a collection of shapes.
Definition: toyitems.h:119
Represents a shpere.
Definition: toyitems.h:98
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?