51 std::unique_ptr<Particle> P_core(
m_core->clone());
52 P_core->rotate(*P_rotation);
54 auto sliced_core = P_core->createSlicedParticle(limits);
57 std::unique_ptr<Particle> P_shell(
m_shell->clone());
58 P_shell->rotate(*P_rotation);
60 auto sliced_shell = P_shell->createSlicedParticle(limits);
61 if (!sliced_shell.m_slicedff)
66 if (!sliced_core.m_slicedff) {
67 result.
m_slicedff.reset(sliced_shell.m_slicedff.release());
68 result.
m_regions.push_back(sliced_shell.m_regions.back());
73 if (sliced_shell.m_regions.size() != 1)
75 auto shell_material = sliced_shell.
m_regions[0].m_material;
76 sliced_core.m_slicedff->setAmbientMaterial(shell_material);
79 sliced_shell.m_regions.back().m_volume -= sliced_core.m_regions.back().m_volume;
81 sliced_shell.m_slicedff.release()));
82 result.
m_regions.push_back(sliced_core.m_regions.back());
83 result.
m_regions.push_back(sliced_shell.m_regions.back());
96 m_core->translate(relative_core_position);
98 m_core->registerAbundance(
false);
105 m_shell->registerAbundance(
false);
106 m_shell->registerPosition(
false);
Defines ParticleCoreShell.
Defines IRotation classes.
Defines class SlicedParticle.
void setAbundance(double abundance)
Sets particle abundance.
void registerChild(INode *node)
void setName(const std::string &name)
std::vector< const INode * > getChildren() const override
Returns a vector of children.
void setPosition(kvector_t position)
Sets relative position of the particle's reference point in the coordinate system of parent.
std::unique_ptr< IRotation > m_rotation
void setRotation(const IRotation &rotation)
Sets transformation.
void registerParticleProperties()
Registers abundance and position.
The identity rotation, which leaves everything in place.
A particle with a core/shell geometry.
std::unique_ptr< Particle > m_shell
std::unique_ptr< Particle > m_core
std::vector< const INode * > getChildren() const final
Returns a vector of children.
void addAndRegisterShell(const Particle &shell)
SlicedParticle createSlicedParticle(ZLimits limits) const final
Creates a sliced form factor for this particle.
void addAndRegisterCore(const Particle &core, kvector_t relative_core_position)
ParticleCoreShell * clone() const final
Returns a clone of this ISampleNode object.
A particle with a form factor and refractive index.
Particle * clone() const final
Returns a clone of this ISampleNode object.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Struct that contains information on a sliced particle.
std::vector< HomogeneousRegion > m_regions
std::unique_ptr< IFormFactor > m_slicedff