BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
Lattice2DItemCatalog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/CatSample/Lattice2DItemCatalog.h
6 //! @brief Defines class Lattice2DItemCatalog
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_LATTICE2DITEMCATALOG_H
16 #define BORNAGAIN_GUI_MODEL_CATSAMPLE_LATTICE2DITEMCATALOG_H
17 
18 #include <QString>
19 #include <QVector>
20 
21 class Lattice2DItem;
22 
24 public:
26 
27  // Do not change the numbering! It is serialized!
28  enum class Type : uint8_t { Basic = 1, Square = 2, Hexagonal };
29 
30  struct UiInfo {
31  QString menuEntry;
32  QString description;
33  QString iconPath;
34  };
35 
36  //! Creates the item of the given type.
37  static CatalogedType* create(Type type);
38 
39  //! List of available types, sorted as expected in the UI.
40  static QVector<Type> types();
41 
42  //! UiInfo on the given type.
43  static UiInfo uiInfo(Type t);
44 
45  //! Returns the enum type of the given item.
46  static Type type(const CatalogedType* item);
47 };
48 
49 #endif // BORNAGAIN_GUI_MODEL_CATSAMPLE_LATTICE2DITEMCATALOG_H
static QVector< Type > types()
List of available types, sorted as expected in the UI.
static UiInfo uiInfo(Type t)
UiInfo on the given type.
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.