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