BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialmodel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/model/materialmodel.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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_MODEL_MATERIALMODEL_H
16 #define BORNAGAIN_GUI2_MODEL_MATERIALMODEL_H
17 
18 #include "darefl_export.h"
20 #include "mvvm/model/tagrow.h"
21 #include <vector>
22 
23 namespace ModelView {
24 class ExternalProperty;
25 }
26 
27 namespace gui2 {
28 
29 class MaterialBaseItem;
30 class MaterialContainerItem;
31 class SLDMaterialItem;
32 
33 //! Model to hold MaterialItems.
34 
35 class DAREFLCORE_EXPORT MaterialModel : public ModelView::SessionModel {
36 public:
37  MaterialModel(std::shared_ptr<ModelView::ItemPool> pool = {});
38 
39  std::vector<ModelView::ExternalProperty>
40  material_data(std::string container_id = std::string()) const;
41 
42  ModelView::ExternalProperty material_property(const std::string& id);
43 
44  MaterialBaseItem* cloneMaterial(const MaterialBaseItem* item);
45 
46  SLDMaterialItem* addDefaultMaterial(const ModelView::TagRow& tagrow = {});
47 
48 private:
49  void init_model();
50  MaterialContainerItem* materialContainer();
51 };
52 
53 } // namespace gui2
54 
55 #endif // BORNAGAIN_GUI2_MODEL_MATERIALMODEL_H
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
Property to carry text, color and identifier.
Main class to hold hierarchy of SessionItem objects.
Definition: sessionmodel.h:37
Aggregate to hold (tag, row) information for SessionModel.
Definition: tagrow.h:25
Base class with all materials with name and color defined.
Definition: materialitems.h:40
Container to hold MaterialItems.
Definition: materialitems.h:32
Model to hold MaterialItems.
Definition: materialmodel.h:35
Represents material based on scattering length density.
Definition: materialitems.h:57
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?