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

Description

Definition at line 23 of file DistributionItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = DistributionItem
 
enum class  Type : uint8_t {
  None = 0 , Gate = 1 , Lorentz = 2 , Gaussian = 3 ,
  LogNormal = 4 , Cosine = 5 , Trapezoid = 6
}
 

Static Public Member Functions

static DistributionItemcreate (Type type)
 Creates the item of the given type. More...
 
static QVector< TypesymmetricTypes ()
 Types of symmetric distributions. More...
 
static Type type (const DistributionItem *item)
 Returns the enum type of the given item. More...
 
static QVector< Typetypes ()
 Available types of items. More...
 
static UiInfo uiInfo (Type t)
 UiInfo on the given type. More...
 

Member Typedef Documentation

◆ CatalogedType

Member Enumeration Documentation

◆ Type

enum DistributionItemCatalog::Type : uint8_t
strong
Enumerator
None 
Gate 
Lorentz 
Gaussian 
LogNormal 
Cosine 
Trapezoid 

Definition at line 28 of file DistributionItemCatalog.h.

28  : uint8_t {
29  None = 0,
30  Gate = 1,
31  Lorentz = 2,
32  Gaussian = 3,
33  LogNormal = 4,
34  Cosine = 5,
35  Trapezoid = 6
36  };

Member Function Documentation

◆ create()

DistributionItem * DistributionItemCatalog::create ( Type  type)
static

Creates the item of the given type.

Definition at line 19 of file DistributionItemCatalog.cpp.

References Cosine, Gate, Gaussian, LogNormal, Lorentz, None, Trapezoid, and type().

Here is the call graph for this function:

◆ symmetricTypes()

QVector< DistributionItemCatalog::Type > DistributionItemCatalog::symmetricTypes ( )
static

Types of symmetric distributions.

Contains also type "None". This list is sorted as expected in the UI (e.g. in combo box)

Definition at line 46 of file DistributionItemCatalog.cpp.

47 {
49 }

References Cosine, Gaussian, Lorentz, and None.

Referenced by BeamWavelengthItem::BeamWavelengthItem(), and SpecularBeamInclinationItem::SpecularBeamInclinationItem().

◆ type()

DistributionItemCatalog::Type DistributionItemCatalog::type ( const DistributionItem item)
static

Returns the enum type of the given item.

Definition at line 72 of file DistributionItemCatalog.cpp.

73 {
74  if (dynamic_cast<const DistributionNoneItem*>(item))
75  return Type::None;
76  if (dynamic_cast<const DistributionGateItem*>(item))
77  return Type::Gate;
78  if (dynamic_cast<const DistributionLorentzItem*>(item))
79  return Type::Lorentz;
80  if (dynamic_cast<const DistributionGaussianItem*>(item))
81  return Type::Gaussian;
82  if (dynamic_cast<const DistributionLogNormalItem*>(item))
83  return Type::LogNormal;
84  if (dynamic_cast<const DistributionCosineItem*>(item))
85  return Type::Cosine;
86  if (dynamic_cast<const DistributionTrapezoidItem*>(item))
87  return Type::Trapezoid;
88 
89  ASSERT(false);
90 }

References Cosine, Gate, Gaussian, LogNormal, Lorentz, None, and Trapezoid.

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

◆ types()

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

Available types of items.

Contains also type "None". This list is sorted as expected in the UI (e.g. in combo box)

Definition at line 40 of file DistributionItemCatalog.cpp.

References Cosine, Gate, Gaussian, LogNormal, Lorentz, None, and Trapezoid.

Referenced by BeamAzimuthalAngleItem::BeamAzimuthalAngleItem(), BeamInclinationAngleItem::BeamInclinationAngleItem(), and BeamWavelengthItem::BeamWavelengthItem().

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 51 of file DistributionItemCatalog.cpp.

52 {
53  switch (type) {
54  case Type::None:
55  return {"None", "", ""};
56  case Type::Gate:
57  return {"Gate", "", ""};
58  case Type::Lorentz:
59  return {"Lorentz", "", ""};
60  case Type::Gaussian:
61  return {"Gaussian", "", ""};
62  case Type::LogNormal:
63  return {"Log Normal", "", ""};
64  case Type::Cosine:
65  return {"Cosine", "", ""};
66  case Type::Trapezoid:
67  return {"Trapezoid", "", ""};
68  }
69  ASSERT(false);
70 }

References Cosine, Gate, Gaussian, LogNormal, Lorentz, None, Trapezoid, and type().

Referenced by ParameterTreeBuilder::addBeamDistribution().

Here is the call graph for this function:

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