BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorComponents Class Reference
Inheritance diagram for FormFactorComponents:
Collaboration diagram for FormFactorComponents:

Public Member Functions

 FormFactorComponents ()
 
const IFormFactorgetItem (const std::string &key) const
 
std::vector< std::string > keys () const
 
size_t size () const
 

Protected Member Functions

void add (const std::string &key, IFormFactor *item)
 

Private Attributes

std::map< std::string, std::unique_ptr< IFormFactor > > m_data
 

Detailed Description

Predefined form factors for functional tests.

Definition at line 33 of file SampleComponents.h.

Constructor & Destructor Documentation

◆ FormFactorComponents()

FormFactorComponents::FormFactorComponents ( )

Definition at line 31 of file SampleComponents.cpp.

33 {
34  add("AnisoPyramid", new FormFactorAnisoPyramid(10.0, 20.0, 5.0, Units::deg2rad(54.73)));
35 
36  add("Box", new FormFactorBox(10.0, 20.0, 5.0));
37 
38  // TODO: activate this when supported by GUI
39  // add("CantellatedCube", new FormFactorCantellatedCube(15.0, 6.0));
40 
41  add("Cone", new FormFactorCone(5.0, 6.0, Units::deg2rad(54.73)));
42 
43  add("Cone6", new FormFactorCone6(2. / sqrt(3.) * 5.0, 5.0, Units::deg2rad(54.73)));
44 
45  add("Cuboctahedron", new FormFactorCuboctahedron(10.0, 5.0, 1.0, Units::deg2rad(54.73)));
46 
47  add("Cylinder", new FormFactorCylinder(5.0, 10.0));
48 
49  add("Dodecahedron", new FormFactorDodecahedron(5.0));
50 
51  add("Dot", new FormFactorDot(5.0));
52 
53  add("EllipsoidalCylinder", new FormFactorEllipsoidalCylinder(5.0, 10.0, 15.0));
54 
55  add("FullSphere", new FormFactorFullSphere(5.0));
56 
57  add("FullSpheroid", new FormFactorFullSpheroid(5.0, 10.0));
58 
59  add("HemiEllipsoid", new FormFactorHemiEllipsoid(5.0, 10.0, 15.0));
60 
61  add("Icosahedron", new FormFactorIcosahedron(10.0));
62 
63  add("Prism3", new FormFactorPrism3(10.0, 5.0));
64 
65  add("Prism6", new FormFactorPrism6(2. / sqrt(3.) * 5.0, 5.0));
66 
67  add("Pyramid", new FormFactorPyramid(10.0, 5.0, Units::deg2rad(54.73)));
68 
69  add("CosineRippleBox", new FormFactorCosineRippleBox(100.0, 20.0, 4.0));
70 
71  add("SawtoothRippleBox", new FormFactorSawtoothRippleBox(100.0, 20.0, 4.0, 0.0));
72 
73  add("Tetrahedron", new FormFactorTetrahedron(10.0, 4.0, Units::deg2rad(54.73)));
74 
75  add("TruncatedCube", new FormFactorTruncatedCube(15.0, 6.0));
76 
77  add("TruncatedSphere", new FormFactorTruncatedSphere(5.0, 7.0, 0));
78 
79  add("TruncatedSpheroid", new FormFactorTruncatedSpheroid(5.0, 7.0, 1.0, 0));
80 }
A frustum (truncated pyramid) with rectangular base.
A rectangular prism (parallelepiped).
Definition: FormFactorBox.h:24
A frustum (truncated pyramid) with regular hexagonal base.
A conical frustum (cone truncated parallel to the base) with circular base.
The form factor for a cosine ripple, with box profile in elongation direction.
A truncated bifrustum with quadratic base.
A circular cylinder.
A regular dodecahedron.
A dot, with scattering power as a sphere of radius rscat, but with F(q)=const.
Definition: FormFactorDot.h:24
A cylinder with elliptical base.
A full spheroid (an ellipsoid with two equal axes, hence with circular cross section)
An hemi ellipsoid, obtained by truncating a full ellipsoid in the middle plane spanned by two princip...
A regular icosahedron.
A prism based on an equilateral triangle.
A prism based on a regular hexagonal.
A frustum with a quadratic base.
The form factor for a cosine ripple, with box profile in elongation direction.
A frustum with equilateral trigonal base.
A cube, with tetrahedral truncation of all corners.
void add(const std::string &key, IFormFactor *item)
Definition: IRegistry.h:51
double deg2rad(double angle)
Definition: Units.h:47

References IRegistry< IFormFactor >::add(), and Units::deg2rad().

Here is the call graph for this function:

Member Function Documentation

◆ getItem()

const IFormFactor * IRegistry< IFormFactor >::getItem ( const std::string &  key) const
inlineinherited

Definition at line 31 of file IRegistry.h.

32  {
33  auto it = m_data.find(key);
34  if (it == m_data.end())
36  "IRegistry::createItem() -> Error. Not existing item key '" + key + "'");
37  return it->second.get();
38  }
std::map< std::string, std::unique_ptr< IFormFactor > > m_data
Definition: IRegistry.h:60

◆ keys()

std::vector<std::string> IRegistry< IFormFactor >::keys ( ) const
inlineinherited

Definition at line 40 of file IRegistry.h.

41  {
42  std::vector<std::string> result;
43  for (auto it = m_data.begin(); it != m_data.end(); ++it)
44  result.push_back(it->first);
45  return result;
46  }

◆ size()

size_t IRegistry< IFormFactor >::size ( ) const
inlineinherited

Definition at line 48 of file IRegistry.h.

48 { return m_data.size(); }

◆ add()

void IRegistry< IFormFactor >::add ( const std::string &  key,
IFormFactor item 
)
inlineprotectedinherited

Definition at line 51 of file IRegistry.h.

52  {
53  if (m_data.find(key) != m_data.end())
55  "IRegistry::createItem() -> Error. Already existing item with key '" + key + "'");
56  m_data[key] = std::unique_ptr<ValueType>(item);
57  }

Member Data Documentation

◆ m_data

std::map<std::string, std::unique_ptr<IFormFactor > > IRegistry< IFormFactor >::m_data
privateinherited

Definition at line 60 of file IRegistry.h.


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