BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorItemCatalog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/CatSample/FormFactorItemCatalog.h
6 //! @brief Defines class FormFactorItemCatalog
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_FORMFACTORITEMCATALOG_H
16 #define BORNAGAIN_GUI_MODEL_CATSAMPLE_FORMFACTORITEMCATALOG_H
17 
18 #include <QString>
19 #include <QVector>
20 
21 class FormFactorItem;
22 
24 public:
26 
27  // Do not change the numbering! It is serialized!
28  enum class Type : uint8_t {
29  BarGauss = 1,
30  BarLorentz = 2,
31  Bipyramid4 = 3,
32  Box = 4,
33  CantellatedCube = 5,
34  Cone = 6,
35  CosineRippleBox = 7,
38  Cylinder = 10,
39  Dodecahedron = 11,
41  Sphere = 13,
42  Spheroid = 14,
43  HemiEllipsoid = 15,
44  HorizontalCylinder = 16,
45  Icosahedron = 17,
46  PlatonicOctahedron = 18,
48  Prism3 = 20,
49  Prism6 = 21,
50  Pyramid2 = 22,
51  Pyramid3 = 23,
52  Pyramid4 = 24,
53  Pyramid6 = 25,
54  SawtoothRippleBox = 26,
57  TruncatedCube = 29,
58  TruncatedSphere = 30,
60  };
61 
62  struct UiInfo {
63  QString menuEntry;
64  QString description;
65  QString iconPath;
66  };
67 
68 
69  //! Creates the item of the given type.
70  //!
71  //! If type is "None", a nullptr is returned.
72  static FormFactorItem* create(Type type);
73 
74  //! Available types of interference items.
75  //!
76  //! Contains also type "None".
77  //! This list is sorted as expected in the UI (e.g. in combo box)
78  static QVector<Type> types();
79 
80  static QVector<Type> hardParticleTypes();
81  static QVector<Type> rippleTypes();
82 
83 
84  //! UiInfo on the given type.
85  static UiInfo uiInfo(Type t);
86 
87  //! Returns the enum type of the given item.
88  static Type type(const FormFactorItem* item);
89 
90  static QString menuEntry(const FormFactorItem* item);
91 };
92 
93 #endif // BORNAGAIN_GUI_MODEL_CATSAMPLE_FORMFACTORITEMCATALOG_H
static QVector< Type > types()
Available types of interference items.
static QString menuEntry(const FormFactorItem *item)
static FormFactorItem * create(Type type)
Creates the item of the given type.
static QVector< Type > hardParticleTypes()
static UiInfo uiInfo(Type t)
UiInfo on the given type.
static Type type(const FormFactorItem *item)
Returns the enum type of the given item.
static QVector< Type > rippleTypes()