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

Description

Definition at line 23 of file FootprintItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = FootprintItem
 
enum class  Type : uint8_t { None = 0 , Gaussian = 1 , Square = 2 }
 

Static Public Member Functions

static FootprintItemcreate (Type type)
 Creates the item of the given type. More...
 
static Type type (const FootprintItem *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 FootprintItemCatalog::Type : uint8_t
strong
Enumerator
None 
Gaussian 
Square 

Definition at line 28 of file FootprintItemCatalog.h.

28 : uint8_t { None = 0, Gaussian = 1, Square = 2 };

Member Function Documentation

◆ create()

FootprintItem * FootprintItemCatalog::create ( Type  type)
static

Creates the item of the given type.

Definition at line 19 of file FootprintItemCatalog.cpp.

20 {
21  switch (type) {
22  case Type::None:
23  return new FootprintNoneItem();
24  case Type::Gaussian:
25  return new FootprintGaussianItem();
26  case Type::Square:
27  return new FootprintSquareItem();
28  }
29  ASSERT(false);
30 }
static Type type(const FootprintItem *item)
Returns the enum type of the given item.

References Gaussian, None, Square, and type().

Here is the call graph for this function:

◆ type()

FootprintItemCatalog::Type FootprintItemCatalog::type ( const FootprintItem item)
static

Returns the enum type of the given item.

Definition at line 50 of file FootprintItemCatalog.cpp.

51 {
52  if (dynamic_cast<const FootprintNoneItem*>(item))
53  return Type::None;
54  if (dynamic_cast<const FootprintGaussianItem*>(item))
55  return Type::Gaussian;
56  if (dynamic_cast<const FootprintSquareItem*>(item))
57  return Type::Square;
58 
59  ASSERT(false);
60 }

References Gaussian, None, and Square.

Referenced by create(), and uiInfo().

◆ types()

QVector< FootprintItemCatalog::Type > FootprintItemCatalog::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 32 of file FootprintItemCatalog.cpp.

33 {
35 }

References Gaussian, None, and Square.

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 37 of file FootprintItemCatalog.cpp.

38 {
39  switch (type) {
40  case Type::None:
41  return {"None", ""};
42  case Type::Gaussian:
43  return {"Gaussian footprint", ""};
44  case Type::Square:
45  return {"Square footprint", ""};
46  }
47  ASSERT(false);
48 }

References Gaussian, None, Square, and type().

Here is the call graph for this function:

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