BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaterialItemUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaterialEditor/MaterialItemUtils.h
6 //! @brief Defines class MaterialItemUtils
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_COREGUI_VIEWS_MATERIALEDITOR_MATERIALITEMUTILS_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_MATERIALITEMUTILS_H
17 
20 #include <QColor>
21 #include <QString>
22 #include <memory>
23 
24 class Material;
26 
27 namespace MaterialItemUtils {
28 
29 QColor suggestMaterialColor(const QString& name);
31 
32 std::unique_ptr<Material> createDomainMaterial(const ExternalProperty& material_property);
33 std::unique_ptr<Material> createDomainMaterial(const ExternalProperty& material_property,
34  const MaterialItemContainer& container);
35 MaterialItem* findMaterial(const ExternalProperty& material_property);
36 
37 QString materialTag(const SessionItem& item);
38 QStringList materialRelatedModelTypes();
39 
40 //! Constructs material property corresponding to given material.
41 ExternalProperty materialProperty(const SessionItem& materialItem);
42 
43 //! Constructs color property from given color.
44 ExternalProperty colorProperty(const QColor& color);
45 
46 //! Calls material selector dialog.
48 
49 //! Calls color selector dialog.
51 
52 //! Gather material property items from a given item
53 QVector<SessionItem*> materialPropertyItems(SessionItem* item);
54 } // namespace MaterialItemUtils
55 
56 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_MATERIALITEMUTILS_H
Defines class ExternalProperty.
Defines class MaterialItem.
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
A wrapper for underlying material implementation.
Definition: Material.h:29
ExternalProperty selectMaterialProperty(const ExternalProperty &previous=ExternalProperty())
Calls material selector dialog.
QString materialTag(const SessionItem &item)
Returns material tag for given item. Returns empty string, if item doesn't have materials.
MaterialItem * findMaterial(const ExternalProperty &material_property)
QColor suggestMaterialColor(const QString &name)
std::unique_ptr< Material > createDomainMaterial(const ExternalProperty &material_property)
QVector< SessionItem * > materialPropertyItems(SessionItem *item)
Gather material property items from a given item.
QStringList materialRelatedModelTypes()
Returns list of model types which contains registered MaterialProperty.
ExternalProperty colorProperty(const QColor &color)
Constructs color property from given color.
ExternalProperty materialProperty(const SessionItem &materialItem)
Constructs material property corresponding to given material.
ExternalProperty defaultMaterialProperty()
ExternalProperty selectColorProperty(const ExternalProperty &previous=ExternalProperty())
Calls color selector dialog.
QString const & name(EShape k)
Definition: particles.cpp:21