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

Description

Definition at line 23 of file RotationItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = RotationItem
 
enum class  Type : uint8_t {
  None = 0 , X = 1 , Y = 2 , Z = 3 ,
  Euler = 4
}
 

Static Public Member Functions

static RotationItemcreate (Type type)
 Creates the item of the given type. More...
 
static Type type (const RotationItem *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 RotationItemCatalog::Type : uint8_t
strong
Enumerator
None 
Euler 

Definition at line 28 of file RotationItemCatalog.h.

28  : uint8_t {
29  None = 0,
30  X = 1,
31  Y = 2,
32  Z = 3,
33  Euler = 4,
34  };

Member Function Documentation

◆ create()

RotationItem * RotationItemCatalog::create ( Type  type)
static

Creates the item of the given type.

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

Definition at line 19 of file RotationItemCatalog.cpp.

20 {
21  switch (type) {
22  case Type::None:
23  return nullptr;
24  case Type::X:
25  return new XRotationItem();
26  case Type::Y:
27  return new YRotationItem();
28  case Type::Z:
29  return new ZRotationItem();
30  case Type::Euler:
31  return new EulerRotationItem();
32  }
33  ASSERT(false);
34 }
static Type type(const RotationItem *item)
Returns the enum type of the given item.

References Euler, None, type(), X, Y, and Z.

Here is the call graph for this function:

◆ type()

RotationItemCatalog::Type RotationItemCatalog::type ( const RotationItem item)
static

Returns the enum type of the given item.

Definition at line 59 of file RotationItemCatalog.cpp.

60 {
61  if (!item)
62  return Type::None;
63 
64  if (dynamic_cast<const XRotationItem*>(item))
65  return Type::X;
66  if (dynamic_cast<const YRotationItem*>(item))
67  return Type::Y;
68  if (dynamic_cast<const ZRotationItem*>(item))
69  return Type::Z;
70  if (dynamic_cast<const EulerRotationItem*>(item))
71  return Type::Euler;
72 
73  ASSERT(false);
74 }

References Euler, None, X, Y, and Z.

Referenced by create(), and uiInfo().

◆ types()

QVector< RotationItemCatalog::Type > RotationItemCatalog::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 36 of file RotationItemCatalog.cpp.

37 {
39 }

References Euler, None, X, Y, and Z.

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 41 of file RotationItemCatalog.cpp.

42 {
43  switch (type) {
44  case Type::None:
45  return {"None", "", ""};
46  case Type::X:
47  return {"X axis Rotation", "Particle rotation around x-axis", ""};
48  case Type::Y:
49  return {"Y axis Rotation", "Particle rotation around y-axis", ""};
50  case Type::Z:
51  return {"Z axis Rotation", "Particle rotation around z-axis", ""};
52  case Type::Euler:
53  return {"Euler Rotation",
54  "Sequence of three rotations following Euler angles; notation z-x'-z'", ""};
55  }
56  ASSERT(false);
57 }

References Euler, None, type(), X, Y, and Z.

Here is the call graph for this function:

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