BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
Profile1DItemCatalog Class Reference

Description

Definition at line 24 of file ProfileItemCatalogs.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = Profile1DItem
 
enum class  Type : uint8_t {
  Cauchy = 1 , Gauss = 2 , Gate = 3 , Triangle = 4 ,
  Cosine = 5 , Voigt = 6
}
 

Static Public Member Functions

static CatalogedTypecreate (Type type)
 Creates the item of the given type. More...
 
static Type type (const CatalogedType *item)
 Returns the enum type of the given item. More...
 
static QVector< Typetypes ()
 List of available types, sorted as expected in the UI. More...
 
static UiInfo uiInfo (Type t)
 UiInfo on the given type. More...
 

Member Typedef Documentation

◆ CatalogedType

Member Enumeration Documentation

◆ Type

enum Profile1DItemCatalog::Type : uint8_t
strong
Enumerator
Cauchy 
Gauss 
Gate 
Triangle 
Cosine 
Voigt 

Definition at line 29 of file ProfileItemCatalogs.h.

29  : uint8_t {
30  Cauchy = 1,
31  Gauss = 2,
32  Gate = 3,
33  Triangle = 4,
34  Cosine = 5,
35  Voigt = 6
36  };

Member Function Documentation

◆ create()

Profile1DItemCatalog::CatalogedType * Profile1DItemCatalog::create ( Type  type)
static

Creates the item of the given type.

Definition at line 19 of file ProfileItemCatalogs.cpp.

20 {
21  switch (type) {
22  case Type::Cauchy:
23  return new Profile1DCauchyItem();
24  case Type::Gauss:
25  return new Profile1DGaussItem();
26  case Type::Gate:
27  return new Profile1DGateItem();
28  case Type::Triangle:
29  return new Profile1DTriangleItem();
30  case Type::Cosine:
31  return new Profile1DCosineItem();
32  case Type::Voigt:
33  return new Profile1DVoigtItem();
34  default:
35  ASSERT(false);
36  }
37 }
static Type type(const CatalogedType *item)
Returns the enum type of the given item.

References Cauchy, Cosine, Gate, Gauss, Triangle, type(), and Voigt.

Here is the call graph for this function:

◆ type()

Profile1DItemCatalog::Type Profile1DItemCatalog::type ( const CatalogedType item)
static

Returns the enum type of the given item.

Definition at line 64 of file ProfileItemCatalogs.cpp.

65 {
66  ASSERT(item);
67 
68 #define CHECK(type) \
69  if (dynamic_cast<const Profile1D##type##Item*>(item)) \
70  return Type::type
71 
72  CHECK(Cauchy);
73  CHECK(Gauss);
74  CHECK(Gate);
75  CHECK(Triangle);
76  CHECK(Cosine);
77  CHECK(Voigt);
78 #undef CHECK
79 
80  ASSERT(false);
81 }
#define CHECK(type)

References CHECK.

Referenced by create(), and uiInfo().

◆ types()

QVector< Profile1DItemCatalog::Type > Profile1DItemCatalog::types ( )
static

List of available types, sorted as expected in the UI.

Definition at line 39 of file ProfileItemCatalogs.cpp.

References Cauchy, Cosine, Gate, Gauss, Triangle, and Voigt.

◆ uiInfo()

Profile1DItemCatalog::UiInfo Profile1DItemCatalog::uiInfo ( Type  t)
static

UiInfo on the given type.

Definition at line 44 of file ProfileItemCatalogs.cpp.

45 {
46  switch (type) {
47  case Type::Cauchy:
48  return {"Cauchy 1D", "One-dimensional Cauchy probability distribution", ""};
49  case Type::Gauss:
50  return {"Gauss 1D", "One-dimensional Gauss probability distribution", ""};
51  case Type::Gate:
52  return {"Gate 1D", "One-dimensional Gate probability distribution", ""};
53  case Type::Triangle:
54  return {"Triangle 1D", "One-dimensional triangle probability distribution", ""};
55  case Type::Cosine:
56  return {"Cosine 1D", "One-dimensional Cosine probability distribution", ""};
57  case Type::Voigt:
58  return {"Voigt 1D", "One-dimensional pseudo-Voigt probability distribution", ""};
59  default:
60  ASSERT(false);
61  }
62 }

References Cauchy, Cosine, Gate, Gauss, Triangle, type(), and Voigt.

Here is the call graph for this function:

The documentation for this class was generated from the following files: