BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemWithMaterial.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Sample/ItemWithMaterial.h
6 //! @brief Defines abstract item with a material property
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_SAMPLE_ITEMWITHMATERIAL_H
16 #define BORNAGAIN_GUI_MODEL_SAMPLE_ITEMWITHMATERIAL_H
17 
18 #include <QString>
19 #include <functional>
20 
21 class Material;
22 class MaterialItem;
23 class MaterialItems;
24 class QColor;
25 
27 public:
28  //! Overhand the material list where the current material has to be searched for.
29  explicit ItemWithMaterial(const MaterialItems* materials);
30 
31  //! Set the material this item shall use.
32  //! Stores the identifier, not the pointer!
34 
35  //! Set the material this item shall use.
36  //! Stores the given identifier, not a pointer to the material!
37  void setMaterial(const QString& materialIdentifier);
38 
39  //! Set "no material defined"
40  void setMaterialUndefined();
41 
42  QColor materialColor() const;
43  QString materialName() const;
44  QString materialIdentifier() const;
45 
46  //! Returns the material item this item links to.
47  MaterialItem* materialItem() const;
48 
49 protected:
52 };
53 
54 #endif // BORNAGAIN_GUI_MODEL_SAMPLE_ITEMWITHMATERIAL_H
QString materialIdentifier() const
QString m_materialIdentifier
void setMaterial(const MaterialItem *materialItem)
Set the material this item shall use. Stores the identifier, not the pointer!
const MaterialItems * m_materialItems
QString materialName() const
ItemWithMaterial(const MaterialItems *materials)
Overhand the material list where the current material has to be searched for.
void setMaterialUndefined()
Set "no material defined".
QColor materialColor() const
MaterialItem * materialItem() const
Returns the material item this item links to.