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

Description

Definition at line 23 of file FormFactorItemCatalog.h.

Classes

struct  UiInfo
 

Public Types

using CatalogedType = FormFactorItem
 
enum class  Type : uint8_t {
  BarGauss = 1 , BarLorentz = 2 , Bipyramid4 = 3 , Box = 4 ,
  CantellatedCube = 5 , Cone = 6 , CosineRippleBox = 7 , CosineRippleGauss = 8 ,
  CosineRippleLorentz = 9 , Cylinder = 10 , Dodecahedron = 11 , EllipsoidalCylinder = 12 ,
  Sphere = 13 , Spheroid = 14 , HemiEllipsoid = 15 , HorizontalCylinder = 16 ,
  Icosahedron = 17 , PlatonicOctahedron = 18 , PlatonicTetrahedron = 19 , Prism3 = 20 ,
  Prism6 = 21 , Pyramid2 = 22 , Pyramid3 = 23 , Pyramid4 = 24 ,
  Pyramid6 = 25 , SawtoothRippleBox = 26 , SawtoothRippleGauss = 27 , SawtoothRippleLorentz = 28 ,
  TruncatedCube = 29 , TruncatedSphere = 30 , TruncatedSpheroid = 31
}
 

Static Public Member Functions

static FormFactorItemcreate (Type type)
 Creates the item of the given type. More...
 
static QVector< TypehardParticleTypes ()
 
static QString menuEntry (const FormFactorItem *item)
 
static QVector< TyperippleTypes ()
 
static Type type (const FormFactorItem *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 FormFactorItemCatalog::Type : uint8_t
strong
Enumerator
BarGauss 
BarLorentz 
Bipyramid4 
Box 
CantellatedCube 
Cone 
CosineRippleBox 
CosineRippleGauss 
CosineRippleLorentz 
Cylinder 
Dodecahedron 
EllipsoidalCylinder 
Sphere 
Spheroid 
HemiEllipsoid 
HorizontalCylinder 
Icosahedron 
PlatonicOctahedron 
PlatonicTetrahedron 
Prism3 
Prism6 
Pyramid2 
Pyramid3 
Pyramid4 
Pyramid6 
SawtoothRippleBox 
SawtoothRippleGauss 
SawtoothRippleLorentz 
TruncatedCube 
TruncatedSphere 
TruncatedSpheroid 

Definition at line 28 of file FormFactorItemCatalog.h.

28  : uint8_t {
29  BarGauss = 1,
30  BarLorentz = 2,
31  Bipyramid4 = 3,
32  Box = 4,
33  CantellatedCube = 5,
34  Cone = 6,
35  CosineRippleBox = 7,
38  Cylinder = 10,
39  Dodecahedron = 11,
41  Sphere = 13,
42  Spheroid = 14,
43  HemiEllipsoid = 15,
44  HorizontalCylinder = 16,
45  Icosahedron = 17,
46  PlatonicOctahedron = 18,
48  Prism3 = 20,
49  Prism6 = 21,
50  Pyramid2 = 22,
51  Pyramid3 = 23,
52  Pyramid4 = 24,
53  Pyramid6 = 25,
54  SawtoothRippleBox = 26,
57  TruncatedCube = 29,
58  TruncatedSphere = 30,
60  };

Member Function Documentation

◆ create()

FormFactorItem * FormFactorItemCatalog::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 FormFactorItemCatalog.cpp.

20 {
21 #define CREATE(t) \
22  case Type::t: \
23  return new t##Item()
24 
25  switch (type) {
26  CREATE(BarGauss);
27  CREATE(BarLorentz);
28  CREATE(Bipyramid4);
29  CREATE(Box);
30  CREATE(CantellatedCube);
31  CREATE(Cone);
32  CREATE(CosineRippleBox);
33  CREATE(CosineRippleGauss);
34  CREATE(CosineRippleLorentz);
35  CREATE(Cylinder);
36  CREATE(Dodecahedron);
37  CREATE(EllipsoidalCylinder);
38  CREATE(Sphere);
39  CREATE(Spheroid);
40  CREATE(HemiEllipsoid);
41  CREATE(HorizontalCylinder);
42  CREATE(Icosahedron);
43  CREATE(PlatonicOctahedron);
44  CREATE(PlatonicTetrahedron);
45  CREATE(Prism3);
46  CREATE(Prism6);
47  CREATE(Pyramid2);
48  CREATE(Pyramid3);
49  CREATE(Pyramid4);
50  CREATE(Pyramid6);
51  CREATE(SawtoothRippleBox);
52  CREATE(SawtoothRippleGauss);
53  CREATE(SawtoothRippleLorentz);
54  CREATE(TruncatedCube);
55  CREATE(TruncatedSphere);
56  CREATE(TruncatedSpheroid);
57  default:
58  ASSERT(false);
59  }
60 
61 #undef CREATE
62 }
#define CREATE(t)
static Type type(const FormFactorItem *item)
Returns the enum type of the given item.

References CREATE, and type().

Referenced by SampleEditorController::createAndInitParticle(), SampleEditorController::setCoreFormFactor(), and SampleEditorController::setShellFormFactor().

Here is the call graph for this function:

◆ hardParticleTypes()

QVector< FormFactorItemCatalog::Type > FormFactorItemCatalog::hardParticleTypes ( )
static

Definition at line 99 of file FormFactorItemCatalog.cpp.

100 {
101  return {Type::Bipyramid4,
102  Type::Box,
104  Type::Cone,
108  Type::Sphere,
115  Type::Prism3,
116  Type::Prism6,
124 }

References Bipyramid4, Box, CantellatedCube, Cone, Cylinder, Dodecahedron, EllipsoidalCylinder, HemiEllipsoid, HorizontalCylinder, Icosahedron, PlatonicOctahedron, PlatonicTetrahedron, Prism3, Prism6, Pyramid2, Pyramid3, Pyramid4, Pyramid6, Sphere, Spheroid, TruncatedCube, TruncatedSphere, and TruncatedSpheroid.

Referenced by LayerEditorUtils::createAddParticleButton().

◆ menuEntry()

QString FormFactorItemCatalog::menuEntry ( const FormFactorItem item)
static

Definition at line 316 of file FormFactorItemCatalog.cpp.

317 {
318  return uiInfo(type(item)).menuEntry;
319 }
static UiInfo uiInfo(Type t)
UiInfo on the given type.

References FormFactorItemCatalog::UiInfo::menuEntry, type(), and uiInfo().

Referenced by ParticleForm::ParticleForm(), ParticleCoreShellForm::createCoreWidgets(), and ParticleCoreShellForm::createShellWidgets().

Here is the call graph for this function:

◆ rippleTypes()

◆ type()

FormFactorItemCatalog::Type FormFactorItemCatalog::type ( const FormFactorItem item)
static

Returns the enum type of the given item.

Definition at line 273 of file FormFactorItemCatalog.cpp.

274 {
275  ASSERT(item);
276 
277 #define CHECK(type) \
278  if (dynamic_cast<const type##Item*>(item)) \
279  return Type::type
280 
281  CHECK(BarGauss);
282  CHECK(BarLorentz);
283  CHECK(Bipyramid4);
284  CHECK(Box);
285  CHECK(CantellatedCube);
286  CHECK(Cone);
287  CHECK(CosineRippleBox);
288  CHECK(CosineRippleGauss);
289  CHECK(CosineRippleLorentz);
290  CHECK(Cylinder);
291  CHECK(Dodecahedron);
292  CHECK(EllipsoidalCylinder);
293  CHECK(Sphere);
294  CHECK(Spheroid);
295  CHECK(HemiEllipsoid);
296  CHECK(HorizontalCylinder);
297  CHECK(Icosahedron);
298  CHECK(PlatonicOctahedron);
299  CHECK(PlatonicTetrahedron);
300  CHECK(Prism3);
301  CHECK(Prism6);
302  CHECK(Pyramid2);
303  CHECK(Pyramid3);
304  CHECK(Pyramid4);
305  CHECK(Pyramid6);
306  CHECK(SawtoothRippleBox);
307  CHECK(SawtoothRippleGauss);
308  CHECK(SawtoothRippleLorentz);
309  CHECK(TruncatedCube);
310  CHECK(TruncatedSphere);
311  CHECK(TruncatedSpheroid);
312 #undef CHECK
313  ASSERT(false);
314 }
#define CHECK(type)

References CHECK.

Referenced by create(), MesoCrystalForm::createBasisCombo(), menuEntry(), and uiInfo().

◆ types()

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

◆ uiInfo()

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

UiInfo on the given type.

Definition at line 134 of file FormFactorItemCatalog.cpp.

135 {
136  switch (type) {
137  case Type::Pyramid2:
138  return {"Anisotropic pyramid", "Truncated pyramid with a rectangular base",
139  ":/SampleDesignerToolbox/images/ff_Pyramid2_64x64.png"};
140 
141  case Type::BarGauss:
142  return {"BarGauss", "Rectangular cuboid",
143  ":/SampleDesignerToolbox/images/ff_Box_64x64.png"};
144 
145  case Type::BarLorentz:
146  return {"BarLorentz", "Rectangular cuboid",
147  ":/SampleDesignerToolbox/images/ff_Box_64x64.png"};
148 
149  case Type::Box:
150  return {"Box", "Rectangular cuboid", ":/SampleDesignerToolbox/images/ff_Box_64x64.png"};
151 
152  case Type::Cone:
153  return {"Cone", "Truncated cone with circular base",
154  ":/SampleDesignerToolbox/images/ff_Cone_64x64.png"};
155 
156  case Type::Pyramid6:
157  return {"Pyramid6", "A truncated pyramid, based on a regular hexagon",
158  ":/SampleDesignerToolbox/images/ff_Pyramid6_64x64.png"};
159 
160  case Type::Bipyramid4:
161  return {"Bipyramid4",
162  "Compound of two truncated pyramids with a common square base "
163  "and opposite orientations",
164  ":/SampleDesignerToolbox/images/ff_Bipyramid4_64x64.png"};
165 
166  case Type::Dodecahedron:
167  return {"Dodecahedron", "Dodecahedron",
168  ":/SampleDesignerToolbox/images/ff_Dodecahedron_64x64.png"};
169 
170  case Type::Cylinder:
171  return {"Cylinder", "Cylinder with a circular base",
172  ":/SampleDesignerToolbox/images/ff_Cylinder_64x64.png"};
173 
175  return {"Ellipsoidal cylinder", "Cylinder with an ellipse cross section",
176  ":/SampleDesignerToolbox/images/ff_EllipsoidalCylinder_64x64.png"};
177 
178  case Type::Sphere:
179  return {"Full sphere", "Full sphere",
180  ":/SampleDesignerToolbox/images/ff_Sphere_64x64.png"};
181 
182  case Type::Spheroid:
183  return {"Full spheroid",
184  "Full spheroid, generated by rotating an ellipse around the vertical axis",
185  ":/SampleDesignerToolbox/images/ff_Spheroid_64x64.png"};
186 
187  case Type::HemiEllipsoid:
188  return {"Hemi ellipsoid",
189  "A horizontally oriented ellipsoid, truncated at the central plane",
190  ":/SampleDesignerToolbox/images/ff_HemiEllipsoid_64x64.png"};
191 
192  case Type::Icosahedron:
193  return {"Icosahedron", "Icosahedron",
194  ":/SampleDesignerToolbox/images/ff_Icosahedron_64x64.png"};
195 
196  case Type::Prism3:
197  return {"Prism3", "Prism with an equilateral triangle base",
198  ":/SampleDesignerToolbox/images/ff_Prism3_64x64.png"};
199 
200  case Type::Prism6:
201  return {"Prism6", "Prism with a regular hexagonal base",
202  ":/SampleDesignerToolbox/images/ff_Prism6_64x64.png"};
203 
204  case Type::Pyramid4:
205  return {"Pyramid4", "Truncated pyramid with a square base",
206  ":/SampleDesignerToolbox/images/ff_Pyramid4_64x64.png"};
207 
209  return {"CosineRippleBox", "Particle with a cosine profile and a rectangular base",
210  ":/SampleDesignerToolbox/images/ff_CosineRipple_64x64.png"};
211 
213  return {"CosineRippleGauss", "Particle with a cosine profile and a rectangular base",
214  ":/SampleDesignerToolbox/images/ff_CosineRipple_64x64.png"};
215 
217  return {"CosineRippleLorentz", "Particle with a cosine profile and a rectangular base",
218  ":/SampleDesignerToolbox/images/ff_CosineRipple_64x64.png"};
219 
221  return {"SawtoothRippleBox",
222  "Particle with an asymmetric triangle profile and a rectangular base",
223  ":/SampleDesignerToolbox/images/ff_SawtoothRipple_64x64.png"};
224 
226  return {"SawtoothRippleGauss",
227  "Particle with an asymmetric triangle profile and a rectangular base",
228  ":/SampleDesignerToolbox/images/ff_SawtoothRipple_64x64.png"};
229 
231  return {"SawtoothRippleLorentz",
232  "Particle with an asymmetric triangle profile and a rectangular base",
233  ":/SampleDesignerToolbox/images/ff_SawtoothRipple_64x64.png"};
234 
235  case Type::Pyramid3:
236  return {"Pyramid3",
237  "Truncated polyhedron with equilateral triangle base and cropped side faces",
238  ":/SampleDesignerToolbox/images/ff_Pyramid3_64x64.png"};
239 
240  case Type::TruncatedCube:
241  return {"Truncated cube", "A cube whose eight vertices have been removed",
242  ":/SampleDesignerToolbox/images/ff_TruncatedCube_64x64.png"};
243 
245  return {"Truncated sphere", "Spherical dome",
246  ":/SampleDesignerToolbox/images/ff_TruncatedSphere_64x64.png"};
247 
249  return {"Truncated spheroid", "Spheroidal dome",
250  ":/SampleDesignerToolbox/images/ff_TruncatedSpheroid_64x64.png"};
251 
253  return {"Cantellated cube", "A cube with truncated edges and vertices",
254  ":/SampleDesignerToolbox/images/ff_CantellatedCube_64x64.png"};
255 
257  return {"Horizontal cylinder", "Cylinder with a circular base, lying in x direction",
258  ":/SampleDesignerToolbox/images/ff_HorizontalCylinder_64x64.png"};
259 
261  return {"Platonic octahedron", "Regular octahedron",
262  ":/SampleDesignerToolbox/images/ff_PlatonicOctahedron_64x64.png"};
263 
265  return {"Platonic tetrahedron", "Regular tetrahedron",
266  ":/SampleDesignerToolbox/images/ff_PlatonicTetrahedron_64x64.png"};
267 
268  default:
269  ASSERT(false);
270  }
271 }

References BarGauss, BarLorentz, Bipyramid4, Box, CantellatedCube, Cone, CosineRippleBox, CosineRippleGauss, CosineRippleLorentz, Cylinder, Dodecahedron, EllipsoidalCylinder, HemiEllipsoid, HorizontalCylinder, Icosahedron, PlatonicOctahedron, PlatonicTetrahedron, Prism3, Prism6, Pyramid2, Pyramid3, Pyramid4, Pyramid6, SawtoothRippleBox, SawtoothRippleGauss, SawtoothRippleLorentz, Sphere, Spheroid, TruncatedCube, TruncatedSphere, TruncatedSpheroid, and type().

Referenced by LayerEditorUtils::createAddParticleButton(), MesoCrystalForm::createBasisCombo(), and menuEntry().

Here is the call graph for this function:

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