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

Description

Definition at line 23 of file InterferenceItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = InterferenceItem
 
enum class  Type : uint8_t {
  None = 0 , RadialParaCrystalRadial = 1 , ParaCrystal2D = 2 , Lattice1D = 3 ,
  Lattice2D = 4 , FiniteLattice2D = 5 , HardDisk = 6
}
 

Static Public Member Functions

static InterferenceItemcreate (Type type)
 Creates the item of the given type. More...
 
static Type type (const InterferenceItem *item)
 Returns the enum type of the given item. More...
 
static QVector< Typetypes ()
 Available types of interference items. More...
 
static UiInfo uiInfo (Type t)
 UiInfo on the given type. More...
 

Member Typedef Documentation

◆ CatalogedType

Member Enumeration Documentation

◆ Type

enum InterferenceItemCatalog::Type : uint8_t
strong
Enumerator
None 
RadialParaCrystalRadial 
ParaCrystal2D 
Lattice1D 
Lattice2D 
FiniteLattice2D 
HardDisk 

Definition at line 28 of file InterferenceItemCatalog.h.

28  : uint8_t {
29  None = 0,
30  RadialParaCrystalRadial = 1,
31  ParaCrystal2D = 2,
32  Lattice1D = 3,
33  Lattice2D = 4,
34  FiniteLattice2D = 5,
35  HardDisk = 6
36  };

Member Function Documentation

◆ create()

InterferenceItem * InterferenceItemCatalog::create ( Type  type)
static

Creates the item of the given type.

If type is "None", a nullptr is returned.

Definition at line 18 of file InterferenceItemCatalog.cpp.

19 {
20  switch (type) {
21  case Type::None:
22  return nullptr;
26  return new Interference2DParaCrystalItem();
27  case Type::Lattice1D:
28  return new Interference1DLatticeItem();
29  case Type::Lattice2D:
30  return new Interference2DLatticeItem();
33  case Type::HardDisk:
34  return new InterferenceHardDiskItem();
35  default:
36  ASSERT(false);
37  }
38 }
static Type type(const InterferenceItem *item)
Returns the enum type of the given item.

References FiniteLattice2D, HardDisk, Lattice1D, Lattice2D, None, ParaCrystal2D, RadialParaCrystalRadial, and type().

Here is the call graph for this function:

◆ type()

InterferenceItemCatalog::Type InterferenceItemCatalog::type ( const InterferenceItem item)
static

Returns the enum type of the given item.

Definition at line 75 of file InterferenceItemCatalog.cpp.

76 {
77  if (!item)
78  return Type::None;
79 
80  if (dynamic_cast<const InterferenceRadialParaCrystalItem*>(item))
82  if (dynamic_cast<const Interference2DParaCrystalItem*>(item))
83  return Type::ParaCrystal2D;
84  if (dynamic_cast<const Interference1DLatticeItem*>(item))
85  return Type::Lattice1D;
86  if (dynamic_cast<const Interference2DLatticeItem*>(item))
87  return Type::Lattice2D;
88  if (dynamic_cast<const InterferenceFinite2DLatticeItem*>(item))
89  return Type::FiniteLattice2D;
90  if (dynamic_cast<const InterferenceHardDiskItem*>(item))
91  return Type::HardDisk;
92 
93  ASSERT(false);
94 }

References FiniteLattice2D, HardDisk, Lattice1D, Lattice2D, None, ParaCrystal2D, and RadialParaCrystalRadial.

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

◆ types()

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

Available types of interference 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 InterferenceItemCatalog.cpp.

References FiniteLattice2D, HardDisk, Lattice1D, Lattice2D, None, ParaCrystal2D, and RadialParaCrystalRadial.

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 47 of file InterferenceItemCatalog.cpp.

48 {
49  switch (type) {
50  case Type::None:
51  return {"None", "", ""};
53  return {"Radial paracrystal", "Interference function of radial paracrystal",
54  ":/SampleDesignerToolbox/images/ParaCrystal1D.png"};
56  return {"2D paracrystal", "Interference function of two-dimensional paracrystal",
57  ":/SampleDesignerToolbox/images/ParaCrystal2D.png"};
58  case Type::Lattice1D:
59  return {"1D lattice", "Interference function of 1D lattice",
60  ":/SampleDesignerToolbox/images/Lattice1D.png"};
61  case Type::Lattice2D:
62  return {"2D lattice", "Interference function of 2D lattice",
63  ":/SampleDesignerToolbox/images/Lattice2D.png"};
65  return {"Finite 2D lattice", "Interference function of finite 2D lattice",
66  ":/SampleDesignerToolbox/images/Lattice2DFinite.png"};
67  case Type::HardDisk:
68  return {"Hard disk Percus-Yevick", "Interference function for hard disk Percus-Yevick",
69  ":/SampleDesignerToolbox/images/Lattice2D.png"};
70  default:
71  ASSERT(false);
72  }
73 }

References FiniteLattice2D, HardDisk, Lattice1D, Lattice2D, None, ParaCrystal2D, RadialParaCrystalRadial, and type().

Referenced by ParameterTreeBuilder::addInterference().

Here is the call graph for this function:

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