16 #include "Base/Const/Units.h"
28 #include "Param/Node/NodeUtils.h"
29 #include "Sample/Aggregate/Interferences.h"
30 #include "Sample/Aggregate/ParticleLayout.h"
31 #include "Sample/HardParticle/HardParticles.h"
32 #include "Sample/Interface/LayerInterface.h"
33 #include "Sample/Interface/LayerRoughness.h"
34 #include "Sample/Multilayer/Layer.h"
35 #include "Sample/Multilayer/MultiLayer.h"
36 #include "Sample/Particle/Crystal.h"
37 #include "Sample/Particle/MesoCrystal.h"
38 #include "Sample/Particle/Particle.h"
39 #include "Sample/Particle/ParticleCoreShell.h"
40 #include "Sample/Scattering/Rotations.h"
42 using NodeUtils::ChildNodesOfType;
43 using NodeUtils::OnlyChildOfType;
49 if (
const auto* pdf =
dynamic_cast<const Profile1DCauchy*
>(ipdf)) {
51 pdfItem->omega().set(pdf->omega());
53 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DGauss*
>(ipdf)) {
55 pdfItem->omega().set(pdf->omega());
57 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DGate*
>(ipdf)) {
59 pdfItem->omega().set(pdf->omega());
61 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DTriangle*
>(ipdf)) {
63 pdfItem->omega().set(pdf->omega());
65 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DCosine*
>(ipdf)) {
67 pdfItem->omega().set(pdf->omega());
69 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DVoigt*
>(ipdf)) {
71 pdfItem->omega().set(pdf->omega());
72 pdfItem->eta().set(pdf->eta());
75 throw Error(
"GUI::Transform::FromCore::setPDF1D: -> Error");
81 struct SetterPDF1Type {
91 struct SetterPDF2Type {
100 template <
template <
class T>
class setType>
103 if (
const auto* pdf_cauchy =
dynamic_cast<const Profile2DCauchy*
>(pdf)) {
105 pdfItem->
setOmegaX(pdf_cauchy->omegaX());
106 pdfItem->
setOmegaY(pdf_cauchy->omegaY());
107 pdfItem->
setGamma(Units::rad2deg(pdf_cauchy->gamma()));
108 }
else if (
const auto* pdf_gauss =
dynamic_cast<const Profile2DGauss*
>(pdf)) {
112 pdfItem->
setGamma(Units::rad2deg(pdf_gauss->gamma()));
113 }
else if (
const auto* pdf_gate =
dynamic_cast<const Profile2DGate*
>(pdf)) {
117 pdfItem->
setGamma(Units::rad2deg(pdf_gate->gamma()));
118 }
else if (
const auto* pdf_cone =
dynamic_cast<const Profile2DCone*
>(pdf)) {
122 pdfItem->
setGamma(Units::rad2deg(pdf_cone->gamma()));
123 }
else if (
const auto* pdf_voigt =
dynamic_cast<const Profile2DVoigt*
>(pdf)) {
127 pdfItem->
setGamma(Units::rad2deg(pdf_voigt->gamma()));
128 pdfItem->
setEta(pdf_voigt->eta());
130 throw Error(
"GUI::Transform::FromCore::setPDF2D: -> Error");
135 if (
const auto* pdf =
dynamic_cast<const Profile1DCauchy*
>(ipdf)) {
137 pdfItem->omega().set(pdf->omega());
139 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DGauss*
>(ipdf)) {
141 pdfItem->omega().set(pdf->omega());
143 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DTriangle*
>(ipdf)) {
145 pdfItem->omega().set(pdf->omega());
147 }
else if (
const auto* pdf =
dynamic_cast<const Profile1DVoigt*
>(ipdf)) {
149 pdfItem->omega().set(pdf->omega());
150 pdfItem->
eta().
set(pdf->eta());
153 throw Error(
"GUI::Transform::FromCore::setDecayFunction1D: -> Error");
158 if (
const auto* pdf_cauchy =
dynamic_cast<const Profile2DCauchy*
>(pdf)) {
160 pdfItem->
setOmegaX(pdf_cauchy->omegaX());
161 pdfItem->
setOmegaY(pdf_cauchy->omegaY());
162 pdfItem->
setGamma(Units::rad2deg(pdf_cauchy->gamma()));
164 }
else if (
const auto* pdf_gauss =
dynamic_cast<const Profile2DGauss*
>(pdf)) {
168 pdfItem->
setGamma(Units::rad2deg(pdf_gauss->gamma()));
170 }
else if (
const auto* pdf_voigt =
dynamic_cast<const Profile2DVoigt*
>(pdf)) {
174 pdfItem->
setGamma(Units::rad2deg(pdf_voigt->gamma()));
175 pdfItem->
setEta(pdf_voigt->eta());
178 throw Error(
"GUI::Transform::FromCore::setDecayFunction2D: -> Error");
184 if (lattice.className() ==
"SquareLattice2D") {
186 squareLatticeItem->setLatticeLength(lattice.length1());
187 latticeItem = squareLatticeItem;
188 }
else if (lattice.className() ==
"HexagonalLattice2D") {
190 hexLatticeItem->setLatticeLength(lattice.length1());
191 latticeItem = hexLatticeItem;
194 basicLatticeItem->setLatticeLength1(lattice.length1());
195 basicLatticeItem->setLatticeLength2(lattice.length2());
196 basicLatticeItem->setLatticeAngle(Units::rad2deg(lattice.latticeAngle()));
197 latticeItem = basicLatticeItem;
199 latticeItem->setLatticeRotationAngle(Units::rad2deg(lattice.rotationAngle()));
205 double pos_var = iff.positionVariance();
209 template <
typename T>
210 T* addFormFactorItem(std::variant<ParticleItem*, MesoCrystalItem*> parent)
212 if (std::holds_alternative<ParticleItem*>(parent))
213 return std::get<ParticleItem*>(parent)->setFormFactorType<T>();
215 return std::get<MesoCrystalItem*>(parent)->setOuterShapeType<T>();
223 const auto* pdf = OnlyChildOfType<IProfile1D>(sample);
224 setDecayFunction1D(item, pdf);
225 setPositionVariance(item, sample);
230 set2DLatticeParameters(item, sample.lattice());
234 const auto* p_pdf = OnlyChildOfType<IProfile2D>(sample);
235 setDecayFunction2D(item, p_pdf);
236 setPositionVariance(item, sample);
240 const Interference2DParaCrystal& sample)
242 set2DLatticeParameters(item, sample.lattice());
249 auto pdfs = ChildNodesOfType<IProfile2D>(sample);
252 setPDF2D<SetterPDF1Type>(item, pdfs[0]);
253 if (pdfs.size() >= 2)
254 setPDF2D<SetterPDF2Type>(item, pdfs[1]);
256 setPositionVariance(item, sample);
260 const InterferenceFinite2DLattice& sample)
262 set2DLatticeParameters(item, sample.lattice());
267 setPositionVariance(item, sample);
274 setPositionVariance(item, sample);
278 const InterferenceRadialParaCrystal& sample)
285 const auto* ipdf = OnlyChildOfType<IProfile1D>(sample);
286 setPDF1D(item, ipdf);
287 setPositionVariance(item, sample);
291 bool isValidRoughness(
const LayerRoughness* roughness)
295 if (roughness->sigma() == 0 && roughness->hurst() == 0.0
296 && roughness->lateralCorrLength() == 0.0)
308 void setLayerItem(
LayerItem* layerItem,
const Layer* layer,
const LayerInterface* top_interface)
315 const LayerRoughness* roughness = top_interface->roughness();
316 if (isValidRoughness(roughness)) {
318 setRoughnessItem(layerItem->
roughness().currentItem(), *roughness);
327 else if (
const auto* r =
dynamic_cast<const RotationX*
>(rotation)) {
329 rotationItem->angle().set(Units::rad2deg(r->angle()));
331 }
else if (
const auto* r =
dynamic_cast<const RotationY*
>(rotation)) {
333 rotationItem->angle().set(Units::rad2deg(r->angle()));
335 }
else if (
const auto* r =
dynamic_cast<const RotationZ*
>(rotation)) {
337 rotationItem->angle().set(Units::rad2deg(r->angle()));
339 }
else if (
const auto* r =
dynamic_cast<const RotationEuler*
>(rotation)) {
341 rotationItem->alpha().set(Units::rad2deg(r->alpha()));
342 rotationItem->beta().set(Units::rad2deg(r->beta()));
343 rotationItem->gamma().set(Units::rad2deg(r->gamma()));
348 void setInterference(
ParticleLayoutItem* layoutItem,
const IInterference* interference)
352 else if (
const auto* itf =
dynamic_cast<const Interference1DLattice*
>(interference)) {
354 set1DLatticeItem(itfItem, *itf);
356 }
else if (
const auto* itf =
dynamic_cast<const Interference2DLattice*
>(interference)) {
358 set2DLatticeItem(itfItem, *itf);
360 }
else if (
const auto* itf =
dynamic_cast<const Interference2DParaCrystal*
>(interference)) {
362 set2DParaCrystalItem(itfItem, *itf);
364 }
else if (
const auto* itf =
dynamic_cast<const InterferenceFinite2DLattice*
>(interference)) {
366 setFinite2DLatticeItem(itfItem, *itf);
368 }
else if (
const auto* itf =
dynamic_cast<const InterferenceHardDisk*
>(interference)) {
370 setHardDiskItem(itfItem, *itf);
372 }
else if (
const auto* itf =
dynamic_cast<const InterferenceRadialParaCrystal*
>(interference)) {
374 setRadialParaCrystalItem(itfItem, *itf);
380 void setFormFactor(std::variant<ParticleItem*, MesoCrystalItem*> parent,
381 const IFormFactor* iFormFactor)
383 if (
const auto* formfactor =
dynamic_cast<const Pyramid2*
>(iFormFactor)) {
384 auto* formfactorItem = addFormFactorItem<Pyramid2Item>(parent);
385 formfactorItem->setLength(formfactor->length());
386 formfactorItem->setWidth(formfactor->width());
387 formfactorItem->setHeight(formfactor->height());
388 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
389 }
else if (
const auto* formfactor =
dynamic_cast<const BarGauss*
>(iFormFactor)) {
390 auto* formfactorItem = addFormFactorItem<BarGaussItem>(parent);
391 formfactorItem->setLength(formfactor->length());
392 formfactorItem->setWidth(formfactor->width());
393 formfactorItem->setHeight(formfactor->height());
394 }
else if (
const auto* formfactor =
dynamic_cast<const BarLorentz*
>(iFormFactor)) {
395 auto* formfactorItem = addFormFactorItem<BarLorentzItem>(parent);
396 formfactorItem->setLength(formfactor->length());
397 formfactorItem->setWidth(formfactor->width());
398 formfactorItem->setHeight(formfactor->height());
399 }
else if (
const auto* formfactor =
dynamic_cast<const Box*
>(iFormFactor)) {
400 auto* formfactorItem = addFormFactorItem<BoxItem>(parent);
401 formfactorItem->setLength(formfactor->length());
402 formfactorItem->setWidth(formfactor->width());
403 formfactorItem->setHeight(formfactor->height());
404 }
else if (
const auto* formfactor =
dynamic_cast<const Cone*
>(iFormFactor)) {
405 auto* formfactorItem = addFormFactorItem<ConeItem>(parent);
406 formfactorItem->setRadius(formfactor->radius());
407 formfactorItem->setHeight(formfactor->height());
408 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
409 }
else if (
const auto* formfactor =
dynamic_cast<const Pyramid6*
>(iFormFactor)) {
410 auto* formfactorItem = addFormFactorItem<Pyramid6Item>(parent);
411 formfactorItem->setBaseEdge(formfactor->baseEdge());
412 formfactorItem->setHeight(formfactor->height());
413 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
414 }
else if (
const auto* formfactor =
dynamic_cast<const Bipyramid4*
>(iFormFactor)) {
415 auto* formfactorItem = addFormFactorItem<Bipyramid4Item>(parent);
416 formfactorItem->setLength(formfactor->length());
417 formfactorItem->setHeight(formfactor->height());
418 formfactorItem->setHeightRatio(formfactor->heightRatio());
419 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
420 }
else if (
const auto* formfactor =
dynamic_cast<const Cylinder*
>(iFormFactor)) {
421 auto* formfactorItem = addFormFactorItem<CylinderItem>(parent);
422 formfactorItem->setRadius(formfactor->radius());
423 formfactorItem->setHeight(formfactor->height());
424 }
else if (
const auto* formfactor =
dynamic_cast<const Dodecahedron*
>(iFormFactor)) {
425 auto* formfactorItem = addFormFactorItem<DodecahedronItem>(parent);
426 formfactorItem->setEdge(formfactor->edge());
427 }
else if (
const auto* formfactor =
dynamic_cast<const EllipsoidalCylinder*
>(iFormFactor)) {
428 auto* formfactorItem = addFormFactorItem<EllipsoidalCylinderItem>(parent);
429 formfactorItem->setRadiusX(formfactor->radiusX());
430 formfactorItem->setRadiusY(formfactor->radiusY());
431 formfactorItem->setHeight(formfactor->height());
432 }
else if (
const auto* formfactor =
dynamic_cast<const Sphere*
>(iFormFactor)) {
433 auto* formfactorItem = addFormFactorItem<SphereItem>(parent);
434 formfactorItem->setRadius(formfactor->radius());
435 }
else if (
const auto* formfactor =
dynamic_cast<const Spheroid*
>(iFormFactor)) {
436 auto* formfactorItem = addFormFactorItem<SpheroidItem>(parent);
437 formfactorItem->setRadius(formfactor->radius());
438 formfactorItem->setHeight(formfactor->height());
439 }
else if (
const auto* formfactor =
dynamic_cast<const Icosahedron*
>(iFormFactor)) {
440 auto* formfactorItem = addFormFactorItem<IcosahedronItem>(parent);
441 formfactorItem->setEdge(formfactor->edge());
442 }
else if (
const auto* formfactor =
dynamic_cast<const HemiEllipsoid*
>(iFormFactor)) {
443 auto* formfactorItem = addFormFactorItem<HemiEllipsoidItem>(parent);
444 formfactorItem->setRadiusX(formfactor->radiusX());
445 formfactorItem->setRadiusY(formfactor->radiusY());
446 formfactorItem->setHeight(formfactor->height());
447 }
else if (
const auto* formfactor =
dynamic_cast<const Prism3*
>(iFormFactor)) {
448 auto* formfactorItem = addFormFactorItem<Prism3Item>(parent);
449 formfactorItem->setBaseEdge(formfactor->baseEdge());
450 formfactorItem->setHeight(formfactor->height());
451 }
else if (
const auto* formfactor =
dynamic_cast<const Prism6*
>(iFormFactor)) {
452 auto* formfactorItem = addFormFactorItem<Prism6Item>(parent);
453 formfactorItem->setBaseEdge(formfactor->baseEdge());
454 formfactorItem->setHeight(formfactor->height());
455 }
else if (
const auto* formfactor =
dynamic_cast<const Pyramid4*
>(iFormFactor)) {
456 auto* formfactorItem = addFormFactorItem<Pyramid4Item>(parent);
457 formfactorItem->setBaseEdge(formfactor->baseEdge());
458 formfactorItem->setHeight(formfactor->height());
459 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
460 }
else if (
const auto* formfactor =
dynamic_cast<const CosineRippleBox*
>(iFormFactor)) {
461 auto* formfactorItem = addFormFactorItem<CosineRippleBoxItem>(parent);
462 formfactorItem->setLength(formfactor->length());
463 formfactorItem->setWidth(formfactor->width());
464 formfactorItem->setHeight(formfactor->height());
465 }
else if (
const auto* formfactor =
dynamic_cast<const CosineRippleGauss*
>(iFormFactor)) {
466 auto* formfactorItem = addFormFactorItem<CosineRippleGaussItem>(parent);
467 formfactorItem->setLength(formfactor->length());
468 formfactorItem->setWidth(formfactor->width());
469 formfactorItem->setHeight(formfactor->height());
470 }
else if (
const auto* formfactor =
dynamic_cast<const CosineRippleLorentz*
>(iFormFactor)) {
471 auto* formfactorItem = addFormFactorItem<CosineRippleLorentzItem>(parent);
472 formfactorItem->setLength(formfactor->length());
473 formfactorItem->setWidth(formfactor->width());
474 formfactorItem->setHeight(formfactor->height());
475 }
else if (
const auto* formfactor =
dynamic_cast<const SawtoothRippleBox*
>(iFormFactor)) {
476 auto* formfactorItem = addFormFactorItem<SawtoothRippleBoxItem>(parent);
477 formfactorItem->setLength(formfactor->length());
478 formfactorItem->setWidth(formfactor->width());
479 formfactorItem->setHeight(formfactor->height());
480 formfactorItem->setAsymmetry(formfactor->asymmetry());
481 }
else if (
const auto* formfactor =
dynamic_cast<const SawtoothRippleGauss*
>(iFormFactor)) {
482 auto* formfactorItem = addFormFactorItem<SawtoothRippleGaussItem>(parent);
483 formfactorItem->setLength(formfactor->length());
484 formfactorItem->setWidth(formfactor->width());
485 formfactorItem->setHeight(formfactor->height());
486 formfactorItem->setAsymmetry(formfactor->asymmetry());
488 auto* formfactorItem = addFormFactorItem<SawtoothRippleLorentzItem>(parent);
489 formfactorItem->setLength(formfactor->length());
490 formfactorItem->setWidth(formfactor->width());
491 formfactorItem->setHeight(formfactor->height());
492 formfactorItem->setAsymmetry(formfactor->asymmetry());
493 }
else if (
const auto* formfactor =
dynamic_cast<const Pyramid3*
>(iFormFactor)) {
494 auto* formfactorItem = addFormFactorItem<Pyramid3Item>(parent);
495 formfactorItem->setBaseEdge(formfactor->baseEdge());
496 formfactorItem->setHeight(formfactor->height());
497 formfactorItem->setAlpha(Units::rad2deg(formfactor->alpha()));
498 }
else if (
const auto* formfactor =
dynamic_cast<const TruncatedCube*
>(iFormFactor)) {
499 auto* formfactorItem = addFormFactorItem<TruncatedCubeItem>(parent);
500 formfactorItem->setLength(formfactor->length());
501 formfactorItem->setRemovedLength(formfactor->removedLength());
502 }
else if (
const auto* formfactor =
dynamic_cast<const TruncatedSphere*
>(iFormFactor)) {
503 auto* formfactorItem = addFormFactorItem<TruncatedSphereItem>(parent);
504 formfactorItem->setRadius(formfactor->radius());
505 formfactorItem->setHeight(formfactor->height());
506 formfactorItem->setRemovedTop(formfactor->removedTop());
507 }
else if (
const auto* formfactor =
dynamic_cast<const TruncatedSpheroid*
>(iFormFactor)) {
508 auto* formfactorItem = addFormFactorItem<TruncatedSpheroidItem>(parent);
509 formfactorItem->setRadius(formfactor->radius());
510 formfactorItem->setHeight(formfactor->height());
511 formfactorItem->setHeightFlattening(formfactor->heightFlattening());
512 formfactorItem->setRemovedTop(formfactor->removedTop());
513 }
else if (
const auto* formfactor =
dynamic_cast<const CantellatedCube*
>(iFormFactor)) {
514 auto* formfactorItem = addFormFactorItem<CantellatedCubeItem>(parent);
515 formfactorItem->setLength(formfactor->length());
516 formfactorItem->setRemovedLength(formfactor->removedLength());
517 }
else if (
const auto* formfactor =
dynamic_cast<const HorizontalCylinder*
>(iFormFactor)) {
518 auto* formfactorItem = addFormFactorItem<HorizontalCylinderItem>(parent);
519 formfactorItem->setRadius(formfactor->radius());
520 formfactorItem->setLength(formfactor->length());
521 formfactorItem->setSliceBottom(formfactor->slice_bottom());
522 formfactorItem->setSliceTop(formfactor->slice_top());
523 }
else if (
const auto* formfactor =
dynamic_cast<const PlatonicOctahedron*
>(iFormFactor)) {
524 auto* formfactorItem = addFormFactorItem<PlatonicOctahedronItem>(parent);
525 formfactorItem->setEdge(formfactor->edge());
526 }
else if (
const auto* formfactor =
dynamic_cast<const PlatonicTetrahedron*
>(iFormFactor)) {
527 auto* formfactorItem = addFormFactorItem<PlatonicTetrahedronItem>(parent);
528 formfactorItem->setEdge(formfactor->edge());
535 const Material* material = node->material();
537 QString materialName = QString::fromStdString(material->materialName());
543 complex_t material_data = material->materialData();
544 if (material->typeID() == MATERIAL_TYPES::RefractiveMaterial) {
546 material_data.imag());
547 }
else if (material->typeID() == MATERIAL_TYPES::MaterialBySLD) {
549 matItems.
addSLDMaterial(materialName, material_data.real(), material_data.imag());
561 particleItem->
setPosition(particle->particlePosition());
562 particleItem->
setMaterial(findMaterialItem(matItems, particle));
563 setRotation(particleItem, particle->rotation());
564 setFormFactor(particleItem, particle->formfactor_at_bottom());
567 void copyParticle(
const IParticle* iparticle,
MaterialItems& matItems,
570 if (
const auto* particle =
dynamic_cast<const Particle*
>(iparticle)) {
572 copyParticleItem(particle_item, matItems, particle);
573 addToParent(particle_item);
574 }
else if (
const auto* coreshell =
dynamic_cast<const ParticleCoreShell*
>(iparticle)) {
575 if (!coreshell->coreParticle())
576 throw std::runtime_error(
"core/shell particle has no core particle.");
577 if (!coreshell->shellParticle())
578 throw std::runtime_error(
"core/shell particle has no shell particle.");
581 coreShellItem->setAbundance(coreshell->abundance());
582 coreShellItem->setPosition(coreshell->particlePosition());
583 setRotation(coreShellItem, coreshell->rotation());
585 if (
const Particle* p = coreshell->coreParticle()) {
586 coreShellItem->createCore(&matItems);
587 copyParticleItem(coreShellItem->core(), matItems, p);
589 if (
const Particle* p = coreshell->shellParticle()) {
590 coreShellItem->createShell(&matItems);
591 copyParticleItem(coreShellItem->shell(), matItems, p);
594 addToParent(coreShellItem);
595 }
else if (
const auto* meso =
dynamic_cast<const MesoCrystal*
>(iparticle)) {
596 if (!meso->particleStructure().basis())
597 throw std::runtime_error(
"Meso crystal has no basis.");
600 mesoItem->setAbundance(meso->abundance());
601 mesoItem->setPosition(meso->particlePosition());
602 setFormFactor(mesoItem, meso->outerShape());
603 setRotation(mesoItem, meso->rotation());
605 const Lattice3D* lattice = meso->particleStructure().lattice();
606 mesoItem->setRawDataVectorA(lattice->basisVectorA());
607 mesoItem->setRawDataVectorB(lattice->basisVectorB());
608 mesoItem->setRawDataVectorC(lattice->basisVectorC());
609 addToParent(mesoItem);
611 copyParticle(meso->particleStructure().basis(), matItems,
614 }
else if (
const auto* particleComposition =
615 dynamic_cast<const ParticleComposition*
>(iparticle)) {
618 particleCompositionItem->setAbundance(particleComposition->abundance());
619 particleCompositionItem->setPosition(particleComposition->particlePosition());
620 setRotation(particleCompositionItem, particleComposition->rotation());
621 addToParent(particleCompositionItem);
623 for (
const auto* p : particleComposition->particles())
624 copyParticle(p, matItems,
637 result->setSampleName(nodeName.isEmpty() ? QString::fromStdString(sample.sampleName())
639 result->crossCorrLength().set(sample.crossCorrLength());
640 result->setExternalField(sample.externalField());
645 for (
size_t layerIndex = 0; layerIndex < sample.numberOfLayers(); layerIndex++) {
646 const auto* layer = sample.layer(layerIndex);
648 const LayerInterface* top_interface =
649 layerIndex == 0 ? nullptr : sample.layerInterface(layerIndex - 1);
651 auto* layerItem = result->addLayer();
652 layerItem->
setMaterial(findMaterialItem(matItems, layer));
656 setLayerItem(layerItem, layer, top_interface);
659 for (
const auto* layout : layer->layouts()) {
660 auto* layoutItem = layerItem->
addLayout();
661 layoutItem->
ownDensity().
set(layout->totalParticleSurfaceDensity());
662 layoutItem->
weight().
set(layout->weight());
663 setInterference(layoutItem, layout->interferenceFunction());
666 for (
const IParticle* particle : layout->particles())
667 copyParticle(particle, matItems,
Defines class DoubleDescriptor.
Defines class GUISampleBuilder.
Defines class MaterialItem.
Defines class MaterialItems.
Defines class MesoCrystalItem.
Defines class MultiLayerItem.
Defines class ParticleCompositionItem.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines class ParticleLayoutItem.
function< void(double)> set
function to set the value
DoubleDescriptor length() const
void setDecayFunction(Profile1DItem *p)
DoubleDescriptor rotationAngle() const
void setLatticeType(Lattice2DItem *p)
void setXiIntegration(bool xiIntegration)
void setDecayFunctionType(Profile2DItem *p)
void setDomainSize1(double size)
void setPDF2Type(Profile2DItem *p)
void setDampingLength(double dampingLength)
void setPDF1Type(Profile2DItem *p)
void setDomainSize2(double size)
void setDomainSize1(unsigned int domain_size1)
void setDomainSize2(unsigned int domain_size2)
DoubleDescriptor density() const
DoubleDescriptor radius() const
DoubleDescriptor positionVariance() const
DoubleDescriptor dampingLength() const
void setPDFType(Profile1DItem *p)
DoubleDescriptor kappa() const
DoubleDescriptor domainSize() const
DoubleDescriptor peakDistance() const
void setMaterial(const MaterialItem *materialItem)
Set the material this item shall use. Stores the identifier, not the pointer!
void setPosition(const R3 &position)
void setAbundance(double abundance)
void setRotation(RotationItem *p)
nullptr is allowed and sets to "no rotation"
DoubleDescriptor lateralCorrelationLength() const
DoubleDescriptor sigma() const
DoubleDescriptor hurst() const
void setIsTopLayer(bool b)
UIntDescriptor numSlices() const
ParticleLayoutItem * addLayout()
void setIsBottomLayer(bool b)
DoubleDescriptor thickness() const
SelectionDescriptor< LayerBasicRoughnessItem * > roughness()
void setMagnetization(const R3 &magnetization)
MaterialItem * addRefractiveMaterial(const QString &name, double delta, double beta)
MaterialItem * addSLDMaterial(const QString &name, double sld, double abs_term)
const QVector< MaterialItem * > & materialItems() const
MaterialItem * materialFromName(const QString &name) const
DoubleDescriptor ownDensity() const
The density value which belonging only to the layout.
void addParticle(ItemWithParticles *particle)
DoubleDescriptor weight() const
void setInterference(InterferenceItem *interference)
void removeInterference()
void setOmegaX(double omega_x)
void setOmegaY(double omega_y)
void setGamma(double gamma)
DoubleDescriptor eta() const
function< void(uint)> set
function to set the value