26 : m_materials(materials)
29 "Number of particles per area (particle surface density).\n "
30 "Should be defined for disordered and 1d-ordered particle collections.",
33 "Weight of this particle layout.\nShould be used when multiple layouts define "
34 "different domains in the sample.",
49 d.
set = [=](
double d) {
65 if (
const auto* interLatticeItem =
67 Lattice2DItem* latticeItem = interLatticeItem->latticeType().currentItem();
70 return area == 0.0 ? 0.0 : 1.0 / area;
71 }
catch (
const std::exception&) {
106 QVector<ItemWithParticles*> result;
108 result << p << p->containedItemsWithParticles();
138 Serialize::rwSelected<InterferenceItemCatalog>(s,
m_interference);
Defines class InterferenceItemCatalog.
Defines InterferenceItems's classes.
Defines class ItemWithParticlesCatalog.
Defines classes Lattice2DItems.
Defines class MesoCrystalItem.
Defines class ParticleCompositionItem.
Defines class ParticleItem.
Defines class ParticleLayoutItem.
Describes properties of a double value which are necessary to allow GUI representation,...
function< void(double)> set
function to set the value
function< double()> get
function to get the current value
function< QString()> path
Path describing this value. Used e.g. for undo/redo.
Class for representing a double value, its attributes and its accessors.
QString uid() const
Unique id of this double property.
void set(double d)
Set the contained value.
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
double unitCellArea() const
DoubleDescriptor ownDensity() const
The density value which belonging only to the layout.
QVector< ItemWithParticles * > m_particles
SelectionProperty< InterferenceItem * > m_interference
const MaterialItems * m_materials
void addParticle(ItemWithParticles *particle)
DoubleProperty m_ownDensity
void removeParticle(ItemWithParticles *particle)
ParticleLayoutItem(const MaterialItems *materials)
bool totalDensityIsDefinedByInterference() const
Returns whether total density is defined by the currently selected interference.
QVector< ItemWithParticles * > containedItemsWithParticles() const
Return full hierarchical contained items with particles.
DoubleDescriptor weight() const
DoubleDescriptor totalDensity() const
The real density.
double totalDensityValue() const
QVector< ItemWithParticles * > particles() const
The particles this layout contains.
SelectionDescriptor< InterferenceItem * > interference() const
void serialize(Streamer &s)
void setInterference(InterferenceItem *interference)
void removeInterference()
Describes a selection (various possibilities and the current one).
void set(T t, bool callInitializer=false)
Directly set the new item.
T get() const
Direct access to the stored pointer.
void init(const QString &label, const QString &tooltip, const QString &persistentTag, ArgsForCreation... argsForCreation)
Initialize by means of a catalog class and optional creation arguments.
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)