BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
InterferenceItemCatalog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/CatSample/InterferenceItemCatalog.h
6 //! @brief Defines class InterferenceItemCatalog
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_INTERFERENCEITEMCATALOG_H
16 #define BORNAGAIN_GUI_MODEL_CATSAMPLE_INTERFERENCEITEMCATALOG_H
17 
18 #include <QString>
19 #include <QVector>
20 
21 class InterferenceItem;
22 
24 public:
26 
27  // Do not change the numbering! It is serialized!
28  enum class Type : uint8_t {
29  None = 0,
31  ParaCrystal2D = 2,
32  Lattice1D = 3,
33  Lattice2D = 4,
34  FiniteLattice2D = 5,
35  HardDisk = 6
36  };
37 
38  struct UiInfo {
39  QString menuEntry;
40  QString description;
41  QString iconPath;
42  };
43 
44 
45  //! Creates the item of the given type.
46  //!
47  //! If type is "None", a nullptr is returned.
49 
50  //! Available types of interference items.
51  //!
52  //! Contains also type "None".
53  //! This list is sorted as expected in the UI (e.g. in combo box)
54  static QVector<Type> types();
55 
56  //! UiInfo on the given type.
57  static UiInfo uiInfo(Type t);
58 
59  //! Returns the enum type of the given item.
60  static Type type(const InterferenceItem* item);
61 };
62 
63 #endif // BORNAGAIN_GUI_MODEL_CATSAMPLE_INTERFERENCEITEMCATALOG_H
static InterferenceItem * create(Type type)
Creates the item of the given type.
static Type type(const InterferenceItem *item)
Returns the enum type of the given item.
static UiInfo uiInfo(Type t)
UiInfo on the given type.
static QVector< Type > types()
Available types of interference items.