BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorItems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/FormFactorItems.cpp
6 //! @brief Implements FormFactorItems classes
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Base/Const/Units.h"
19 
20 /* ------------------------------------------------ */
21 
22 const QString AnisoPyramidItem::P_LENGTH("Length");
23 const QString AnisoPyramidItem::P_WIDTH("Width");
24 const QString AnisoPyramidItem::P_HEIGHT("Height");
25 const QString AnisoPyramidItem::P_ALPHA("Alpha");
26 
28 {
29  setToolTip("A truncated pyramid with a rectangular base");
30  addProperty(P_LENGTH, 20.0)->setToolTip("Length of the rectangular base in nanometers");
31  addProperty(P_WIDTH, 16.0)->setToolTip("Width of the rectangular base in nanometers");
32  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of pyramid in nanometers");
33  addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet");
34 }
35 
36 std::unique_ptr<IFormFactor> AnisoPyramidItem::createFormFactor() const
37 {
38  return std::make_unique<FormFactorAnisoPyramid>(
39  getItemValue(P_LENGTH).toDouble(), getItemValue(P_WIDTH).toDouble(),
40  getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ALPHA).toDouble() * Units::deg);
41 }
42 
43 /* ------------------------------------------------ */
44 
45 const QString BarGaussItem::P_LENGTH("Length");
46 const QString BarGaussItem::P_WIDTH("Width");
47 const QString BarGaussItem::P_HEIGHT("Height");
48 
50 {
51  setToolTip("Rectangular cuboid");
52  addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers");
53  addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers");
54  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers");
55 }
56 
57 std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const
58 {
59  return std::make_unique<FormFactorBarGauss>(getItemValue(P_LENGTH).toDouble(),
60  getItemValue(P_WIDTH).toDouble(),
61  getItemValue(P_HEIGHT).toDouble());
62 }
63 
64 /* ------------------------------------------------ */
65 
66 const QString BarLorentzItem::P_LENGTH("Length");
67 const QString BarLorentzItem::P_WIDTH("Width");
68 const QString BarLorentzItem::P_HEIGHT("Height");
69 
71 {
72  setToolTip("Rectangular cuboid");
73  addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers");
74  addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers");
75  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers");
76 }
77 
78 std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const
79 {
80  return std::make_unique<FormFactorBarLorentz>(getItemValue(P_LENGTH).toDouble(),
81  getItemValue(P_WIDTH).toDouble(),
82  getItemValue(P_HEIGHT).toDouble());
83 }
84 
85 /* ------------------------------------------------ */
86 
87 const QString BoxItem::P_LENGTH("Length");
88 const QString BoxItem::P_WIDTH("Width");
89 const QString BoxItem::P_HEIGHT("Height");
90 
92 {
93  setToolTip("Rectangular cuboid");
94  addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers");
95  addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers");
96  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers");
97 }
98 
99 std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const
100 {
101  return std::make_unique<FormFactorBox>(getItemValue(P_LENGTH).toDouble(),
102  getItemValue(P_WIDTH).toDouble(),
103  getItemValue(P_HEIGHT).toDouble());
104 }
105 
106 /* ------------------------------------------------ */
107 
108 const QString ConeItem::P_RADIUS("Radius");
109 const QString ConeItem::P_HEIGHT("Height");
110 const QString ConeItem::P_ALPHA("Alpha");
111 
113 {
114  setToolTip("Truncated cone with circular base");
115  addProperty(P_RADIUS, 10.0)->setToolTip("Radius of the base in nanometers");
116  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the cone in nanometers");
117  addProperty(P_ALPHA, 60.0)
118  ->setToolTip("Angle between the base and the side surface in degrees");
119 }
120 
121 std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const
122 {
123  return std::make_unique<FormFactorCone>(getItemValue(P_RADIUS).toDouble(),
124  getItemValue(P_HEIGHT).toDouble(),
125  getItemValue(P_ALPHA).toDouble() * Units::deg);
126 }
127 
128 /* ------------------------------------------------ */
129 
130 const QString Cone6Item::P_BASEEDGE("BaseEdge");
131 const QString Cone6Item::P_HEIGHT("Height");
132 const QString Cone6Item::P_ALPHA("Alpha");
133 
135 {
136  setToolTip("A truncated pyramid, based on a regular hexagon");
137  addProperty(P_BASEEDGE, 10.0)->setToolTip("Edge of the regular hexagonal base in nanometers");
138  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of a truncated pyramid in nanometers");
139  addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet");
140 }
141 
142 std::unique_ptr<IFormFactor> Cone6Item::createFormFactor() const
143 {
144  return std::make_unique<FormFactorCone6>(getItemValue(P_BASEEDGE).toDouble(),
145  getItemValue(P_HEIGHT).toDouble(),
146  getItemValue(P_ALPHA).toDouble() * Units::deg);
147 }
148 
149 /* ------------------------------------------------ */
150 
151 const QString CuboctahedronItem::P_LENGTH("Length");
152 const QString CuboctahedronItem::P_HEIGHT("Height");
153 const QString CuboctahedronItem::P_HEIGHT_RATIO("HeightRatio");
154 const QString CuboctahedronItem::P_ALPHA("Alpha");
155 
157 {
158  setToolTip("Compound of two truncated pyramids with a common square base \n"
159  "and opposite orientations");
160  addProperty(P_LENGTH, 20.0)->setToolTip("Side length of the common square base in nanometers");
161  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the lower pyramid in nanometers");
164  .setToolTip("Ratio of heights of top to bottom pyramids");
165  addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facets");
166 }
167 
168 std::unique_ptr<IFormFactor> CuboctahedronItem::createFormFactor() const
169 {
170  return std::make_unique<FormFactorCuboctahedron>(
171  getItemValue(P_LENGTH).toDouble(), getItemValue(P_HEIGHT).toDouble(),
172  getItemValue(P_HEIGHT_RATIO).toDouble(), getItemValue(P_ALPHA).toDouble() * Units::deg);
173 }
174 
175 /* ------------------------------------------------ */
176 
177 const QString CylinderItem::P_RADIUS("Radius");
178 const QString CylinderItem::P_HEIGHT("Height");
179 
181 {
182  setToolTip("Cylinder with a circular base");
183  addProperty(P_RADIUS, 8.0)->setToolTip("Radius of the circular base in nanometers");
184  addProperty(P_HEIGHT, 16.0)->setToolTip("Height of the cylinder in nanometers");
185 }
186 
187 std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const
188 {
189  return std::make_unique<FormFactorCylinder>(getItemValue(P_RADIUS).toDouble(),
190  getItemValue(P_HEIGHT).toDouble());
191 }
192 
193 /* ------------------------------------------------ */
194 
195 const QString DodecahedronItem::P_EDGE("Edge");
196 
198 {
199  setToolTip("Dodecahedron");
200  addProperty(P_EDGE, 10.0)->setToolTip("Length of the edge in nanometers");
201 }
202 
203 std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const
204 {
205  return std::make_unique<FormFactorDodecahedron>(getItemValue(P_EDGE).toDouble());
206 }
207 
208 /* ------------------------------------------------ */
209 
210 const QString DotItem::P_RADIUS("Radius");
211 
213 {
214  setToolTip("A dot, with constant formfactor F(q)=4pi/3 R^3");
215  addProperty(P_RADIUS, 8.0)->setToolTip("Radius of reference sphere in nanometers");
216 }
217 
218 std::unique_ptr<IFormFactor> DotItem::createFormFactor() const
219 {
220  return std::make_unique<FormFactorDot>(getItemValue(P_RADIUS).toDouble());
221 }
222 
223 /* ------------------------------------------------ */
224 
225 const QString EllipsoidalCylinderItem::P_RADIUS_X("RadiusX");
226 const QString EllipsoidalCylinderItem::P_RADIUS_Y("RadiusY");
227 const QString EllipsoidalCylinderItem::P_HEIGHT("Height");
228 
230 {
231  setToolTip("Cylinder with an ellipse cross section");
232  addProperty(P_RADIUS_X, 8.0)
233  ->setToolTip("Radius of the ellipse base in the x-direction, in nanometers");
234  addProperty(P_RADIUS_Y, 13.0)
235  ->setToolTip("Radius of the ellipse base in the y-direction, in nanometers");
236  addProperty(P_HEIGHT, 16.0)->setToolTip("Height of the ellipsoidal cylinder in nanometers");
237 }
238 
239 std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const
240 {
241  return std::make_unique<FormFactorEllipsoidalCylinder>(getItemValue(P_RADIUS_X).toDouble(),
242  getItemValue(P_RADIUS_Y).toDouble(),
243  getItemValue(P_HEIGHT).toDouble());
244 }
245 
246 /* ------------------------------------------------ */
247 
248 const QString FullSphereItem::P_RADIUS("Radius");
249 
251 {
252  setToolTip("Full sphere");
253  addProperty(P_RADIUS, 8.0)->setToolTip("Radius of the sphere in nanometers");
254 }
255 
256 std::unique_ptr<IFormFactor> FullSphereItem::createFormFactor() const
257 {
258  return std::make_unique<FormFactorFullSphere>(getItemValue(P_RADIUS).toDouble());
259 }
260 
261 /* ------------------------------------------------ */
262 
263 const QString FullSpheroidItem::P_RADIUS("Radius");
264 const QString FullSpheroidItem::P_HEIGHT("Height");
265 
267 {
268  setToolTip("Full spheroid, generated by rotating an ellipse around the vertical axis");
269  addProperty(P_RADIUS, 10.0)->setToolTip("Radius of the circular cross section in nanometers");
270  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the full spheroid in nanometers");
271 }
272 
273 std::unique_ptr<IFormFactor> FullSpheroidItem::createFormFactor() const
274 {
275  return std::make_unique<FormFactorFullSpheroid>(getItemValue(P_RADIUS).toDouble(),
276  getItemValue(P_HEIGHT).toDouble());
277 }
278 
279 /* ------------------------------------------------ */
280 
281 const QString HemiEllipsoidItem::P_RADIUS_X("RadiusX");
282 const QString HemiEllipsoidItem::P_RADIUS_Y("RadiusY");
283 const QString HemiEllipsoidItem::P_HEIGHT("Height");
284 
286 {
287  setToolTip("An horizontally oriented ellipsoid, truncated at the central plane");
288  addProperty(P_RADIUS_X, 10.0)
289  ->setToolTip("Radius of the ellipse base in the x-direction, in nanometers");
290  addProperty(P_RADIUS_Y, 6.0)
291  ->setToolTip("Radius of the ellipse base in the y-direction, in nanometers");
292  addProperty(P_HEIGHT, 8.0)->setToolTip("Height of the hemi ellipsoid in nanometers");
293 }
294 
295 std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const
296 {
297  return std::make_unique<FormFactorHemiEllipsoid>(getItemValue(P_RADIUS_X).toDouble(),
298  getItemValue(P_RADIUS_Y).toDouble(),
299  getItemValue(P_HEIGHT).toDouble());
300 }
301 
302 /* ------------------------------------------------ */
303 
304 const QString IcosahedronItem::P_EDGE("Edge");
305 
307 {
308  setToolTip("Icosahedron");
309  addProperty(P_EDGE, 10.0)->setToolTip("Length of the edge in nanometers");
310 }
311 
312 std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const
313 {
314  return std::make_unique<FormFactorIcosahedron>(getItemValue(P_EDGE).toDouble());
315 }
316 
317 /* ------------------------------------------------ */
318 
319 const QString Prism3Item::P_BASEEDGE("BaseEdge");
320 const QString Prism3Item::P_HEIGHT("Height");
321 
323 {
324  setToolTip("Prism with an equilaterial triangle base");
325  addProperty(P_BASEEDGE, 10.0)->setToolTip("Length of the base edge in nanometers");
326  addProperty(P_HEIGHT, 13.0)->setToolTip("Height in nanometers");
327 }
328 
329 std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const
330 {
331  return std::make_unique<FormFactorPrism3>(getItemValue(P_BASEEDGE).toDouble(),
332  getItemValue(P_HEIGHT).toDouble());
333 }
334 
335 /* ------------------------------------------------ */
336 
337 const QString Prism6Item::P_BASEEDGE("BaseEdge");
338 const QString Prism6Item::P_HEIGHT("Height");
339 
341 {
342  setToolTip("Prism with a regular hexagonal base");
343  addProperty(P_BASEEDGE, 5.0)->setToolTip("Length of the hexagonal base in nanometers");
344  addProperty(P_HEIGHT, 11.0)->setToolTip("Height in nanometers");
345 }
346 
347 std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const
348 {
349  return std::make_unique<FormFactorPrism6>(getItemValue(P_BASEEDGE).toDouble(),
350  getItemValue(P_HEIGHT).toDouble());
351 }
352 
353 /* ------------------------------------------------ */
354 
355 const QString PyramidItem::P_BASEEDGE("BaseEdge");
356 const QString PyramidItem::P_HEIGHT("Height");
357 const QString PyramidItem::P_ALPHA("Alpha");
358 
360 {
361  setToolTip("Truncated pyramid with a square base");
362  addProperty(P_BASEEDGE, 18.0)->setToolTip("Length of the square base in nanometers");
363  addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the pyramid in nanometers");
364  addProperty(P_ALPHA, 60.0)
365  ->setToolTip("Dihedral angle between the base and a side face in degrees");
366 }
367 
368 std::unique_ptr<IFormFactor> PyramidItem::createFormFactor() const
369 {
370  return std::make_unique<FormFactorPyramid>(getItemValue(P_BASEEDGE).toDouble(),
371  getItemValue(P_HEIGHT).toDouble(),
372  getItemValue(P_ALPHA).toDouble() * Units::deg);
373 }
374 
375 /* ------------------------------------------------ */
376 
377 const QString CosineRippleBoxItem::P_LENGTH("Length");
378 const QString CosineRippleBoxItem::P_WIDTH("Width");
379 const QString CosineRippleBoxItem::P_HEIGHT("Height");
380 
382 {
383  setToolTip("Particle with a cosine profile and a rectangular base");
384  addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers");
385  addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers");
386  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
387 }
388 
389 std::unique_ptr<IFormFactor> CosineRippleBoxItem::createFormFactor() const
390 {
391  return std::make_unique<FormFactorCosineRippleBox>(getItemValue(P_LENGTH).toDouble(),
392  getItemValue(P_WIDTH).toDouble(),
393  getItemValue(P_HEIGHT).toDouble());
394 }
395 
396 /* ------------------------------------------------ */
397 
398 const QString CosineRippleGaussItem::P_LENGTH("Length");
399 const QString CosineRippleGaussItem::P_WIDTH("Width");
400 const QString CosineRippleGaussItem::P_HEIGHT("Height");
401 
403 {
404  setToolTip("Particle with a cosine profile and a rectangular base");
405  addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers");
406  addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers");
407  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
408 }
409 
410 std::unique_ptr<IFormFactor> CosineRippleGaussItem::createFormFactor() const
411 {
412  return std::make_unique<FormFactorCosineRippleGauss>(getItemValue(P_LENGTH).toDouble(),
413  getItemValue(P_WIDTH).toDouble(),
414  getItemValue(P_HEIGHT).toDouble());
415 }
416 
417 /* ------------------------------------------------ */
418 
419 const QString CosineRippleLorentzItem::P_LENGTH("Length");
420 const QString CosineRippleLorentzItem::P_WIDTH("Width");
421 const QString CosineRippleLorentzItem::P_HEIGHT("Height");
422 
424 {
425  setToolTip("Particle with a cosine profile and a rectangular base");
426  addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers");
427  addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers");
428  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
429 }
430 
431 std::unique_ptr<IFormFactor> CosineRippleLorentzItem::createFormFactor() const
432 {
433  return std::make_unique<FormFactorCosineRippleLorentz>(getItemValue(P_LENGTH).toDouble(),
434  getItemValue(P_WIDTH).toDouble(),
435  getItemValue(P_HEIGHT).toDouble());
436 }
437 
438 /* ------------------------------------------------ */
439 
440 const QString SawtoothRippleBoxItem::P_LENGTH("Length");
441 const QString SawtoothRippleBoxItem::P_WIDTH("Width");
442 const QString SawtoothRippleBoxItem::P_HEIGHT("Height");
443 const QString SawtoothRippleBoxItem::P_ASYMMETRY("AsymmetryLength");
444 
446 {
447  setToolTip("Particle with an asymmetric triangle profile and a rectangular base");
448  addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers");
449  addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers");
450  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
452  ->setToolTip("Asymmetry length of the triangular profile in nanometers");
453 }
454 
455 std::unique_ptr<IFormFactor> SawtoothRippleBoxItem::createFormFactor() const
456 {
457  return std::make_unique<FormFactorSawtoothRippleBox>(
458  getItemValue(P_LENGTH).toDouble(), getItemValue(P_WIDTH).toDouble(),
459  getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ASYMMETRY).toDouble());
460 }
461 
462 /* ------------------------------------------------ */
463 
464 const QString SawtoothRippleGaussItem::P_LENGTH("Length");
465 const QString SawtoothRippleGaussItem::P_WIDTH("Width");
466 const QString SawtoothRippleGaussItem::P_HEIGHT("Height");
467 const QString SawtoothRippleGaussItem::P_ASYMMETRY("AsymmetryLength");
468 
470 {
471  setToolTip("Particle with an asymmetric triangle profile and a rectangular base");
472  addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers");
473  addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers");
474  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
476  ->setToolTip("Asymmetry length of the triangular profile in nanometers");
477 }
478 
479 std::unique_ptr<IFormFactor> SawtoothRippleGaussItem::createFormFactor() const
480 {
481  return std::make_unique<FormFactorSawtoothRippleGauss>(
482  getItemValue(P_LENGTH).toDouble(), getItemValue(P_WIDTH).toDouble(),
483  getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ASYMMETRY).toDouble());
484 }
485 
486 /* ------------------------------------------------ */
487 
488 const QString SawtoothRippleLorentzItem::P_LENGTH("Length");
489 const QString SawtoothRippleLorentzItem::P_WIDTH("Width");
490 const QString SawtoothRippleLorentzItem::P_HEIGHT("Height");
491 const QString SawtoothRippleLorentzItem::P_ASYMMETRY("AsymmetryLength");
492 
494 {
495  setToolTip("Particle with an asymmetric triangle profile and a rectangular base");
496  addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers");
497  addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers");
498  addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers");
500  ->setToolTip("Asymmetry length of the triangular profile in nanometers");
501 }
502 
503 std::unique_ptr<IFormFactor> SawtoothRippleLorentzItem::createFormFactor() const
504 {
505  return std::make_unique<FormFactorSawtoothRippleLorentz>(
506  getItemValue(P_LENGTH).toDouble(), getItemValue(P_WIDTH).toDouble(),
507  getItemValue(P_HEIGHT).toDouble(), getItemValue(P_ASYMMETRY).toDouble());
508 }
509 
510 /* ------------------------------------------------ */
511 
512 const QString TetrahedronItem::P_BASEEDGE("BaseEdge");
513 const QString TetrahedronItem::P_HEIGHT("Height");
514 const QString TetrahedronItem::P_ALPHA("Alpha");
515 
517 {
518  setToolTip("A truncated tethrahedron");
519  addProperty(P_BASEEDGE, 15.0)
520  ->setToolTip("Length of one edge of the equilateral triangular base in nanometers");
521  addProperty(P_HEIGHT, 6.0)->setToolTip("Height of the tetrahedron in nanometers");
522  addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet");
523 }
524 
525 std::unique_ptr<IFormFactor> TetrahedronItem::createFormFactor() const
526 {
527  return std::make_unique<FormFactorTetrahedron>(getItemValue(P_BASEEDGE).toDouble(),
528  getItemValue(P_HEIGHT).toDouble(),
529  getItemValue(P_ALPHA).toDouble() * Units::deg);
530 }
531 
532 /* ------------------------------------------------ */
533 
534 const QString TruncatedCubeItem::P_LENGTH("Length");
535 const QString TruncatedCubeItem::P_REMOVED_LENGTH("RemovedLength");
536 
538 {
539  setToolTip("A cube whose eight vertices have been removed");
540  addProperty(P_LENGTH, 15.0)->setToolTip("Length of the full cube's edge in nanometers");
542  ->setToolTip("Removed length from each edge of the cube in nanometers");
543 }
544 
545 std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const
546 {
547  return std::make_unique<FormFactorTruncatedCube>(getItemValue(P_LENGTH).toDouble(),
548  getItemValue(P_REMOVED_LENGTH).toDouble());
549 }
550 
551 /* ------------------------------------------------ */
552 
553 const QString TruncatedSphereItem::P_RADIUS("Radius");
554 const QString TruncatedSphereItem::P_HEIGHT("Height");
555 const QString TruncatedSphereItem::P_REMOVED_TOP("DeltaHeight");
556 
558 {
559  setToolTip("Spherical dome");
560  addProperty(P_RADIUS, 5.0)->setToolTip("Radius of the truncated sphere in nanometers");
561  addProperty(P_HEIGHT, 7.0)->setToolTip("Height of the truncated sphere in nanometers");
562  addProperty(P_REMOVED_TOP, 0.0)->setToolTip("Height of the removed top cap in nanometers");
563 }
564 
565 std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const
566 {
567  return std::make_unique<FormFactorTruncatedSphere>(getItemValue(P_RADIUS).toDouble(),
568  getItemValue(P_HEIGHT).toDouble(),
569  getItemValue(P_REMOVED_TOP).toDouble());
570 }
571 
572 /* ------------------------------------------------ */
573 
574 const QString TruncatedSpheroidItem::P_RADIUS("Radius");
575 const QString TruncatedSpheroidItem::P_HEIGHT("Height");
576 const QString TruncatedSpheroidItem::P_HFC("HeightFlattening");
577 const QString TruncatedSpheroidItem::P_REMOVED_TOP("DeltaHeight");
578 
580 {
581  setToolTip("Spheroidal dome");
582  addProperty(P_RADIUS, 7.5)->setToolTip("Radius of the truncated spheroid in nanometers");
583  addProperty(P_HEIGHT, 9.0)->setToolTip("Height of the truncated spheroid in nanometers");
584  addProperty(P_HFC, 1.2)
585  ->setToolTip("Ratio of the height of the corresponding full spheroid to its diameter");
586  addProperty(P_REMOVED_TOP, 0.0)->setToolTip("Height of the removed top cap in nanometers");
587 }
588 
589 std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const
590 {
591  return std::make_unique<FormFactorTruncatedSpheroid>(
592  getItemValue(P_RADIUS).toDouble(), getItemValue(P_HEIGHT).toDouble(),
593  getItemValue(P_HFC).toDouble(), getItemValue(P_REMOVED_TOP).toDouble());
594 }
Defines FormFactorItems classes.
Includes all particle-shape form-factor definitions.
Includes all soft-particle form-factor definitions.
Defines some unit conversion factors and other constants in namespace Units.
static const QString P_ALPHA
static const QString P_WIDTH
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_HEIGHT
static const QString P_LENGTH
static const QString P_HEIGHT
static const QString P_WIDTH
std::unique_ptr< IFormFactor > createFormFactor() const
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_WIDTH
static const QString P_HEIGHT
static const QString P_LENGTH
static const QString P_HEIGHT
static const QString P_WIDTH
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_HEIGHT
static const QString P_BASEEDGE
static const QString P_ALPHA
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_ALPHA
static const QString P_HEIGHT
static const QString P_RADIUS
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_WIDTH
static const QString P_HEIGHT
static const QString P_LENGTH
std::unique_ptr< IFormFactor > createFormFactor() const
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_WIDTH
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_WIDTH
static const QString P_HEIGHT
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_HEIGHT_RATIO
static const QString P_ALPHA
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_RADIUS
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_EDGE
static const QString P_RADIUS
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_RADIUS_X
static const QString P_HEIGHT
static const QString P_RADIUS_Y
std::unique_ptr< IFormFactor > createFormFactor() const
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_RADIUS
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_RADIUS
static const QString P_RADIUS_Y
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_RADIUS_X
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_EDGE
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_HEIGHT
static const QString P_BASEEDGE
static const QString P_HEIGHT
static const QString P_BASEEDGE
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_HEIGHT
static const QString P_ALPHA
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_BASEEDGE
static RealLimits lowerLimited(double bound_value)
Creates an object bounded from the left.
Definition: RealLimits.cpp:105
static const QString P_HEIGHT
static const QString P_WIDTH
static const QString P_ASYMMETRY
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_LENGTH
static const QString P_WIDTH
static const QString P_ASYMMETRY
static const QString P_LENGTH
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_HEIGHT
static const QString P_LENGTH
static const QString P_WIDTH
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_ASYMMETRY
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
SessionItem & setToolTip(const QString &tooltip)
SessionItem & setLimits(const RealLimits &value)
static const QString P_ALPHA
static const QString P_BASEEDGE
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_REMOVED_LENGTH
static const QString P_LENGTH
std::unique_ptr< IFormFactor > createFormFactor() const
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_REMOVED_TOP
static const QString P_RADIUS
static const QString P_HEIGHT
static const QString P_HEIGHT
std::unique_ptr< IFormFactor > createFormFactor() const
static const QString P_HFC
static const QString P_RADIUS
static const QString P_REMOVED_TOP
static constexpr double deg
Definition: Units.h:46