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

Description

Definition at line 57 of file ProfileItemCatalogs.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = Profile2DItem
 
enum class  Type : uint8_t {
  Cauchy = 1 , Gauss = 2 , Gate = 3 , Cone = 4 ,
  Voigt = 5
}
 

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 Profile2DItemCatalog::Type : uint8_t
strong
Enumerator
Cauchy 
Gauss 
Gate 
Cone 
Voigt 

Definition at line 62 of file ProfileItemCatalogs.h.

62 : uint8_t { Cauchy = 1, Gauss = 2, Gate = 3, Cone = 4, Voigt = 5 };

Member Function Documentation

◆ create()

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

Creates the item of the given type.

Definition at line 85 of file ProfileItemCatalogs.cpp.

86 {
87  switch (type) {
88  case Type::Cauchy:
89  return new Profile2DCauchyItem();
90  case Type::Gauss:
91  return new Profile2DGaussItem();
92  case Type::Gate:
93  return new Profile2DGateItem();
94  case Type::Cone:
95  return new Profile2DConeItem();
96  case Type::Voigt:
97  return new Profile2DVoigtItem();
98  default:
99  ASSERT(false);
100  }
101 }
static Type type(const CatalogedType *item)
Returns the enum type of the given item.

References Cauchy, Cone, Gate, Gauss, type(), and Voigt.

Here is the call graph for this function:

◆ type()

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

Returns the enum type of the given item.

Definition at line 126 of file ProfileItemCatalogs.cpp.

127 {
128  ASSERT(item);
129 
130  if (dynamic_cast<const Profile2DCauchyItem*>(item))
131  return Type::Cauchy;
132  if (dynamic_cast<const Profile2DGaussItem*>(item))
133  return Type::Gauss;
134  if (dynamic_cast<const Profile2DGateItem*>(item))
135  return Type::Gate;
136  if (dynamic_cast<const Profile2DConeItem*>(item))
137  return Type::Cone;
138  if (dynamic_cast<const Profile2DVoigtItem*>(item))
139  return Type::Voigt;
140 
141  ASSERT(false);
142 }

References Cauchy, Cone, Gate, Gauss, and Voigt.

Referenced by ParameterTreeBuilder::addInterference(), create(), and uiInfo().

◆ types()

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

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

Definition at line 103 of file ProfileItemCatalogs.cpp.

104 {
106 }

References Cauchy, Cone, Gate, Gauss, and Voigt.

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 108 of file ProfileItemCatalogs.cpp.

109 {
110  switch (type) {
111  case Type::Cauchy:
112  return {"Cauchy 2D", "Two-dimensional Cauchy probability distribution", ""};
113  case Type::Gauss:
114  return {"Gauss 2D", "Two-dimensional Gauss probability distribution", ""};
115  case Type::Gate:
116  return {"Gate 2D", "Two-dimensional Gate probability distribution", ""};
117  case Type::Cone:
118  return {"Cone 2D", "Two-dimensional Cone probability distribution", ""};
119  case Type::Voigt:
120  return {"Voigt 2D", "Two-dimensional pseudo-Voigt probability distribution", ""};
121  default:
122  ASSERT(false);
123  }
124 }

References Cauchy, Cone, Gate, Gauss, type(), and Voigt.

Here is the call graph for this function:

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