BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ProfileItemCatalogs.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/CatSample/ProfileItemCatalogs.h
6 //! @brief Defines ProfileItemCatalog classes
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_CATSAMPLE_PROFILEITEMCATALOGS_H
16 #define BORNAGAIN_GUI_MODEL_CATSAMPLE_PROFILEITEMCATALOGS_H
17 
18 #include <QString>
19 #include <QVector>
20 
21 class Profile1DItem;
22 class Profile2DItem;
23 
25 public:
27 
28  // Do not change the numbering! It is serialized!
29  enum class Type : uint8_t {
30  Cauchy = 1,
31  Gauss = 2,
32  Gate = 3,
33  Triangle = 4,
34  Cosine = 5,
35  Voigt = 6
36  };
37 
38  struct UiInfo {
39  QString menuEntry;
40  QString description;
41  QString iconPath;
42  };
43 
44  //! Creates the item of the given type.
45  static CatalogedType* create(Type type);
46 
47  //! List of available types, sorted as expected in the UI.
48  static QVector<Type> types();
49 
50  //! UiInfo on the given type.
51  static UiInfo uiInfo(Type t);
52 
53  //! Returns the enum type of the given item.
54  static Type type(const CatalogedType* item);
55 };
56 
58 public:
60 
61  // Do not change the numbering! It is serialized!
62  enum class Type : uint8_t { Cauchy = 1, Gauss = 2, Gate = 3, Cone = 4, Voigt = 5 };
63 
64  struct UiInfo {
65  QString menuEntry;
66  QString description;
67  QString iconPath;
68  };
69 
70  //! Creates the item of the given type.
71  static CatalogedType* create(Type type);
72 
73  //! List of available types, sorted as expected in the UI.
74  static QVector<Type> types();
75 
76  //! UiInfo on the given type.
77  static UiInfo uiInfo(Type t);
78 
79  //! Returns the enum type of the given item.
80  static Type type(const CatalogedType* item);
81 };
82 
83 
84 #endif // BORNAGAIN_GUI_MODEL_CATSAMPLE_PROFILEITEMCATALOGS_H
static UiInfo uiInfo(Type t)
UiInfo on the given type.
static CatalogedType * create(Type type)
Creates the item of the given type.
static QVector< Type > types()
List of available types, sorted as expected in the UI.
static Type type(const CatalogedType *item)
Returns the enum type of the given item.
static Type type(const CatalogedType *item)
Returns the enum type of the given item.
static CatalogedType * create(Type type)
Creates the item of the given type.
static UiInfo uiInfo(Type t)
UiInfo on the given type.
static QVector< Type > types()
List of available types, sorted as expected in the UI.