29 #include "Sample/Aggregate/IInterference.h"
30 #include "Sample/Aggregate/ParticleLayout.h"
31 #include "Sample/Interface/LayerRoughness.h"
32 #include "Sample/Multilayer/Layer.h"
33 #include "Sample/Multilayer/MultiLayer.h"
34 #include "Sample/Particle/IParticle.h"
35 #include "Sample/Particle/MesoCrystal.h"
36 #include "Sample/Particle/Particle.h"
37 #include "Sample/Particle/ParticleCoreShell.h"
41 std::unique_ptr<MultiLayer> createMultiLayer(
const MultiLayerItem& item)
43 auto sample = std::make_unique<MultiLayer>();
45 if (cross_corr_length > 0)
46 sample->setCrossCorrLength(cross_corr_length);
48 sample->setExternalField(external_field);
56 isFirstOrLastLayer ? 0.0 : item.
thickness());
57 layer->setNumberOfSlices(item.
numSlices());
63 auto layout = std::make_unique<ParticleLayout>();
65 double layout_weight = item.
weight();
66 layout->setTotalParticleSurfaceDensity(total_density);
67 layout->setWeight(layout_weight);
73 std::unique_ptr<IParticle> particle;
74 if (
const auto* particle_item =
dynamic_cast<const ParticleItem*
>(&item))
75 particle = particle_item->createParticle();
76 else if (
const auto* particle_coreshell_item =
78 particle = particle_coreshell_item->createParticleCoreShell();
79 else if (
const auto* particle_composition_item =
81 particle = particle_composition_item->createParticleComposition();
82 else if (
const auto* mesocrystal_item =
dynamic_cast<const MesoCrystalItem*
>(&item))
83 particle = mesocrystal_item->createMesoCrystal();
90 auto layout = createParticleLayout(item);
91 for (
auto particleItem : item.
particles()) {
92 if (
auto particle = createIParticle(*particleItem)) {
93 layout->addParticle(*particle);
100 if (
auto interference = interferenceItem->createInterference())
101 layout->setInterference(*interference);
105 std::unique_ptr<Layer> buildLayer(
const LayerItem& item)
109 if (
auto layout = buildParticleLayout(*layoutItem))
110 layer->addLayout(*layout);
119 return std::make_unique<LayerRoughness>(roughness->
sigma(), roughness->
hurst(),
127 auto sample = createMultiLayer(sampleItem);
128 for (
auto* layerItem : sampleItem.
layers()) {
129 auto layer = buildLayer(*layerItem);
131 const auto roughnessItem = layerItem->roughness().currentItem();
132 auto roughness = itemToLayerRoughness(roughnessItem);
133 if (roughness && !layerItem->isTopLayer())
134 sample->addLayerWithTopRoughness(*layer, *roughness);
136 sample->addLayer(*layer);
Defines class DoubleDescriptor.
Defines InterferenceItems's classes.
Defines classes LayerRoughnessItems.
Defines class MaterialItem.
Defines class MesoCrystalItem.
Defines class MultiLayerItem.
Defines class ParticleCompositionItem.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines class ParticleLayoutItem.
Defines namespace GUI::Transform::ToCore.
Defines class UIntDescriptor.
MaterialItem * materialItem() const
Returns the material item this item links to.
DoubleDescriptor lateralCorrelationLength() const
DoubleDescriptor sigma() const
DoubleDescriptor hurst() const
UIntDescriptor numSlices() const
bool isBottomLayer() const
QVector< ParticleLayoutItem * > layouts() const
DoubleDescriptor thickness() const
std::unique_ptr< Material > createMaterial() const
QVector< LayerItem * > layers() const
DoubleDescriptor crossCorrLength() const
DoubleDescriptor weight() const
DoubleDescriptor totalDensity() const
The real density.
QVector< ItemWithParticles * > particles() const
The particles this layout contains.
SelectionDescriptor< InterferenceItem * > interference() const