22 #include "Sample/Particle/MesoCrystal.h"
23 #include "Sample/Particle/Particle.h"
24 #include "Sample/Particle/ParticleCoreShell.h"
25 #include "Sample/Scattering/Rotations.h"
29 const QString abundance_tooltip =
"Proportion of this type of particles normalized to the \n"
30 "total number of particles in the layout";
32 const QString position_tooltip =
"Relative position of the particle's reference point \n"
33 "in the coordinate system of the parent (nm)";
40 , m_materials(materials)
50 Serialize::rwSelected<RotationItemCatalog>(s,
m_rotation);
56 auto P_composition = std::make_unique<ParticleComposition>();
59 if (
auto* particleItem =
dynamic_cast<ParticleItem*
>(p)) {
60 if (
auto P_particle = particleItem->createParticle())
61 P_composition->addParticle(*P_particle);
63 if (
auto P_particle_coreshell = coreShellItem->createParticleCoreShell())
64 P_composition->addParticle(*P_particle_coreshell);
66 if (
auto P_child_composition = compositionItem->createParticleComposition())
67 P_composition->addParticle(*P_child_composition);
69 if (
auto P_meso = mesoCrystalItem->createMesoCrystal())
70 P_composition->addParticle(*P_meso);
74 P_composition->setParticlePosition(
position());
76 P_composition->setRotation(*r);
99 QVector<ItemWithParticles*> result;
101 result << particle << particle->containedItemsWithParticles();
Defines class ItemWithParticlesCatalog.
Defines class MesoCrystalItem.
Defines class ParticleCompositionItem.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines class RotationItemCatalog.
VectorProperty m_position
SelectionProperty< RotationItem * > m_rotation
std::unique_ptr< IRotation > createRotation() const
nullptr only if "no rotation". Can contain identity!
DoubleDescriptor abundance() const
DoubleProperty m_abundance
QVector< ItemWithParticles * > containedItemsWithParticles() const override
Return full hierarchical contained items with particles.
void addParticle(ItemWithParticles *particle)
QVector< ItemWithParticles * > particles() const
const MaterialItems * m_materials
ParticleCompositionItem(const MaterialItems *materials)
void serialize(Streamer &s) override
void removeParticle(ItemWithParticles *particle)
QVector< ItemWithParticles * > m_particles
std::unique_ptr< ParticleComposition > createParticleComposition() const
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)