BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
FormFactorComponents Class Reference

Description

Predefined form factors for functional tests.

Definition at line 29 of file FormFactorComponents.h.

Inheritance diagram for FormFactorComponents:
[legend]
Collaboration diagram for FormFactorComponents:
[legend]

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
 

Constructor & Destructor Documentation

◆ FormFactorComponents()

FormFactorComponents::FormFactorComponents ( )

Definition at line 19 of file FormFactorComponents.cpp.

21 {
22  add("Pyramid2", new Pyramid2(10.0, 20.0, 5.0, Units::deg2rad(54.73)));
23 
24  add("Box", new Box(10.0, 20.0, 5.0));
25 
26  add("CantellatedCube", new CantellatedCube(15.0, 6.0));
27 
28  add("Cone", new Cone(5.0, 6.0, Units::deg2rad(54.73)));
29 
30  add("Pyramid6", new Pyramid6(2. / sqrt(3.) * 5.0, 5.0, Units::deg2rad(54.73)));
31 
32  add("Bipyramid4", new Bipyramid4(10.0, 5.0, 1.0, Units::deg2rad(54.73)));
33 
34  add("Cylinder", new Cylinder(5.0, 10.0));
35 
36  add("HorizontalCylinder", new HorizontalCylinder(5.0, 10.0));
37 
38  add("Dodecahedron", new Dodecahedron(5.0));
39 
40  add("EllipsoidalCylinder", new EllipsoidalCylinder(5.0, 10.0, 15.0));
41 
42  add("Sphere", new Sphere(5.0));
43 
44  add("Spheroid", new Spheroid(5.0, 10.0));
45 
46  add("HemiEllipsoid", new HemiEllipsoid(5.0, 10.0, 15.0));
47 
48  add("Icosahedron", new Icosahedron(10.0));
49 
50  add("PlatonicOctahedron", new PlatonicOctahedron(10.0));
51 
52  add("PlatonicTetrahedron", new PlatonicTetrahedron(10.0));
53 
54  add("Prism3", new Prism3(10.0, 5.0));
55 
56  add("Prism6", new Prism6(2. / sqrt(3.) * 5.0, 5.0));
57 
58  add("Pyramid4", new Pyramid4(10.0, 5.0, Units::deg2rad(54.73)));
59 
60  add("CosineRippleBox", new CosineRippleBox(100.0, 20.0, 4.0));
61 
62  add("SawtoothRippleBox", new SawtoothRippleBox(100.0, 20.0, 4.0, 0.0));
63 
64  add("Pyramid3", new Pyramid3(10.0, 4.0, Units::deg2rad(54.73)));
65 
66  add("TruncatedCube", new TruncatedCube(15.0, 6.0));
67 
68  add("TruncatedSphere", new TruncatedSphere(5.0, 7.0, 0));
69 
70  add("TruncatedSpheroid", new TruncatedSpheroid(5.0, 7.0, 1.0, 0));
71 }
A truncated bifrustum with quadratic base.
Definition: Bipyramid4.h:23
A rectangular prism (parallelepiped).
Definition: Box.h:23
A cube, with truncation of all edges and corners, as in Croset (2017) Fig 7.
A conical frustum (cone truncated parallel to the base) with circular base.
Definition: Cone.h:23
The form factor for a cosine ripple, with box profile in elongation direction.
Definition: CosineRipple.h:22
A circular cylinder.
Definition: Cylinder.h:23
A regular dodecahedron.
Definition: Dodecahedron.h:23
A cylinder with elliptical base.
An hemi ellipsoid, obtained by truncating a full ellipsoid in the middle plane spanned by two princip...
Definition: HemiEllipsoid.h:24
A circular cylinder.
void add(const std::string &key, IFormFactor *item)
Definition: IRegistry.h:53
A regular icosahedron.
Definition: Icosahedron.h:23
A truncated bifrustum with quadratic base.
A frustum with equilateral trigonal base.
A prism based on an equilateral triangle.
Definition: Prism3.h:23
A prism based on a regular hexagonal.
Definition: Prism6.h:23
A frustum (truncated pyramid) with rectangular base.
Definition: Pyramid2.h:23
A frustum with equilateral trigonal base.
Definition: Pyramid3.h:23
A frustum with a quadratic base.
Definition: Pyramid4.h:23
A frustum (truncated pyramid) with regular hexagonal base.
Definition: Pyramid6.h:23
The form factor for a cosine ripple, with box profile in elongation direction.
A full sphere.
Definition: Sphere.h:23
A full spheroid (an ellipsoid with two equal axes, hence with circular cross section)
Definition: Spheroid.h:23
A cube, with tetrahedral truncation of all corners.
Definition: TruncatedCube.h:23
A truncated Sphere.
A truncated spheroid. An ellipsoid with two equal axis, truncated by a plane perpendicular to the thi...
double deg2rad(double angle)
Definition: Units.h:58

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

Here is the call graph for this function:

Member Function Documentation

◆ add()

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

Definition at line 53 of file IRegistry.h.

54  {
55  ASSERT(m_data.find(key) == m_data.end());
56  m_data[key] = std::unique_ptr<ValueType>(item);
57  }
#define ASSERT(condition)
Definition: Assert.h:45
std::map< std::string, std::unique_ptr< IFormFactor > > m_data
Definition: IRegistry.h:60

◆ getItem()

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

Definition at line 35 of file IRegistry.h.

36  {
37  auto it = m_data.find(key);
38  ASSERT(it != m_data.end());
39  return it->second.get();
40  }

◆ keys()

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

Definition at line 42 of file IRegistry.h.

43  {
44  std::vector<std::string> result;
45  for (const auto& it : m_data)
46  result.push_back(it.first);
47  return result;
48  }

◆ size()

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

Definition at line 50 of file IRegistry.h.

50 { return m_data.size(); }

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: