21 #include "Sample/Particle/Particle.h"
22 #include "Sample/Particle/ParticleCoreShell.h"
23 #include "Sample/Scattering/Rotations.h"
27 const QString abundance_tooltip =
"Proportion of this type of particles normalized to the \n"
28 "total number of particles in the layout";
30 const QString position_tooltip =
"Relative position of the particle's reference point \n"
31 "in the coordinate system of the parent (nm)";
37 , m_materials(materials)
52 std::unique_ptr<Particle> P_core{};
53 std::unique_ptr<Particle> P_shell{};
55 P_core =
m_core->createParticle();
57 P_shell =
m_shell->createParticle();
58 if (!P_core || !P_shell)
59 throw Error(
"ParticleCoreShellItem::createParticleCoreShell -> Error. Either "
60 "core or shell particle is undefined.");
61 auto P_coreshell = std::make_unique<ParticleCoreShell>(*P_shell, *P_core);
63 P_coreshell->setParticlePosition(
position());
65 P_coreshell->setRotation(*r);
109 QVector<ItemWithParticles*> result;
Defines class DoubleDescriptor.
Defines class MaterialItems.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines namespace GUI::Util::Variant.
VectorProperty m_position
std::unique_ptr< IRotation > createRotation() const
nullptr only if "no rotation". Can contain identity!
DoubleDescriptor abundance() const
DoubleProperty m_abundance
MaterialItem * defaultMaterial() const
ParticleItem * shell() const
ParticleItem * core() const
std::unique_ptr< ParticleItem > m_core
std::unique_ptr< ParticleItem > m_shell
ParticleCoreShellItem(const MaterialItems *materials)
void serialize(Streamer &s) override
ParticleItem * createShell(const MaterialItems *materials)
const MaterialItems * m_materials
QVector< ItemWithParticles * > containedItemsWithParticles() const override
Return full hierarchical contained items with particles.
std::unique_ptr< ParticleCoreShell > createParticleCoreShell() const
ParticleItem * createCore(const MaterialItems *materials)
QVector< ItemWithParticles * > containedItemsWithParticles() const override
Return full hierarchical contained items with particles.
Supports serialization to or deserialization from QXmlStream.
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
void rwProperty(Streamer &s, DoubleProperty &d)
void rwOptional(Streamer &s, const QString &tag, std::unique_ptr< ItemClass > &up, ArgsForConstructor... argsForConstructor)
Serializes an optional item of known type. Passes optional arguments to the constructor.