BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialitems.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/model/materialitems.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_MATERIALITEMS_H
16 #define BORNAGAIN_GUI2_MODEL_MATERIALITEMS_H
17 
18 //! materialitems.h
19 //! Collection of materials to populate MaterialModel.
20 
21 #include "darefl_export.h"
23 
24 namespace ModelView {
25 class ExternalProperty;
26 }
27 
28 namespace gui2 {
29 
30 //! Container to hold MaterialItems.
31 
32 class DAREFLCORE_EXPORT MaterialContainerItem : public ModelView::CompoundItem {
33 public:
34  static inline const std::string T_MATERIALS = "T_MATERIALS";
36 };
37 
38 //! Base class with all materials with name and color defined.
39 
40 class DAREFLCORE_EXPORT MaterialBaseItem : public ModelView::CompoundItem {
41 public:
42  static inline const std::string P_COLOR = "P_COLOR";
43  static inline const std::string P_NAME = "P_NAME";
44  static inline const std::string P_H_X = "P_H_X";
45  static inline const std::string P_H_Y = "P_H_Y";
46  static inline const std::string P_H_Z = "P_H_Z";
47 
48  ModelView::ExternalProperty external_property() const;
49 
50 protected:
51  MaterialBaseItem(const std::string& model_type);
52  void init_magnetic_field();
53 };
54 
55 //! Represents material based on scattering length density.
56 
57 class DAREFLCORE_EXPORT SLDMaterialItem : public MaterialBaseItem {
58 public:
59  static inline const std::string P_SLD_REAL = "P_SLD_REAL";
60  static inline const std::string P_SLD_IMAG = "P_SLD_IMAG";
61 
63 
64  void set_properties(const std::string& name, const QColor& color, double real, double imag);
65 };
66 
67 } // namespace gui2
68 
69 #endif // BORNAGAIN_GUI2_MODEL_MATERIALITEMS_H
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
Complex item holding mixed SessionItem types (single properties and other CompountItems).
Definition: compounditem.h:28
Property to carry text, color and identifier.
Base class with all materials with name and color defined.
Definition: materialitems.h:40
Container to hold MaterialItems.
Definition: materialitems.h:32
Represents material based on scattering length density.
Definition: materialitems.h:57
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
std::string model_type
Definition: types.h:23
QString const & name(EShape k)
Definition: particles.cpp:21
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20