BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemWithParticles Class Referenceabstract

Description

Definition at line 27 of file ItemWithParticles.h.

Inheritance diagram for ItemWithParticles:
[legend]
Collaboration diagram for ItemWithParticles:
[legend]

Public Member Functions

virtual ~ItemWithParticles ()=default
 
DoubleDescriptor abundance () const
 
virtual QVector< ItemWithParticles * > containedItemsWithParticles () const =0
 Return full hierarchical contained items with particles. More...
 
std::unique_ptr< IRotation > createRotation () const
 nullptr only if "no rotation". Can contain identity! More...
 
R3 position () const
 
VectorDescriptor positionVector () const
 
SelectionDescriptor< RotationItem * > rotation ()
 Returns selection descriptor for rotation methods. More...
 
virtual void serialize (Streamer &s)=0
 
void setAbundance (double abundance)
 
void setPosition (const R3 &position)
 
void setRotation (RotationItem *p)
 nullptr is allowed and sets to "no rotation" More...
 

Protected Member Functions

 ItemWithParticles (const QString &abundanceTooltip, const QString &positionTooltip)
 

Protected Attributes

DoubleProperty m_abundance
 
VectorProperty m_position
 
SelectionProperty< RotationItem * > m_rotation
 

Constructor & Destructor Documentation

◆ ~ItemWithParticles()

virtual ItemWithParticles::~ItemWithParticles ( )
virtualdefault

◆ ItemWithParticles()

ItemWithParticles::ItemWithParticles ( const QString &  abundanceTooltip,
const QString &  positionTooltip 
)
protected

Definition at line 23 of file ItemWithParticles.cpp.

25 {
26  m_abundance.init("Abundance", abundanceTooltip, 1.0, Unit::unitless, 3,
27  RealLimits::limited(0.0, 1.0), "abundance");
28  m_position.init("Position Offset", positionTooltip, Unit::nanometer, "pos");
29  m_rotation.init<RotationItemCatalog>("Rotation", "", "rotation");
30 }
@ unitless
@ nanometer
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
VectorProperty m_position
SelectionProperty< RotationItem * > m_rotation
DoubleProperty m_abundance
void init(const QString &label, const QString &tooltip, const QString &persistentTag, ArgsForCreation... argsForCreation)
Initialize by means of a catalog class and optional creation arguments.
void init(const QString &label, const QString &tooltip, const variant< QString, Unit > &unit, const QString &persistentTag)

References SelectionProperty< T >::init(), VectorProperty::init(), DoubleProperty::init(), m_abundance, m_position, m_rotation, nanometer, and unitless.

Here is the call graph for this function:

Member Function Documentation

◆ abundance()

◆ containedItemsWithParticles()

virtual QVector<ItemWithParticles*> ItemWithParticles::containedItemsWithParticles ( ) const
pure virtual

Return full hierarchical contained items with particles.

For example ParticleCompositionItem contains other items, ParticleItem doesn't.

Implemented in ParticleItem, ParticleCoreShellItem, ParticleCompositionItem, and MesoCrystalItem.

Referenced by MesoCrystalItem::containedItemsWithParticles().

◆ createRotation()

std::unique_ptr< IRotation > ItemWithParticles::createRotation ( ) const

nullptr only if "no rotation". Can contain identity!

Definition at line 67 of file ItemWithParticles.cpp.

68 {
69  if (!m_rotation.get())
70  return {};
71  const auto matrix = m_rotation->rotation();
72  return std::unique_ptr<IRotation>(IRotation::createRotation(matrix));
73 }
RotMatrix rotation() const
T get() const
Direct access to the stored pointer.

References SelectionProperty< T >::get(), m_rotation, and RotationItem::rotation().

Referenced by MesoCrystalItem::createMesoCrystal(), ParticleItem::createParticle(), ParticleCompositionItem::createParticleComposition(), and ParticleCoreShellItem::createParticleCoreShell().

Here is the call graph for this function:

◆ position()

◆ positionVector()

◆ rotation()

SelectionDescriptor< RotationItem * > ItemWithParticles::rotation ( )

◆ serialize()

virtual void ItemWithParticles::serialize ( Streamer s)
pure virtual

◆ setAbundance()

void ItemWithParticles::setAbundance ( double  abundance)

Definition at line 37 of file ItemWithParticles.cpp.

38 {
40 }
void set(double d)
Set the contained value.
DoubleDescriptor abundance() const

References abundance(), m_abundance, and DoubleProperty::set().

Here is the call graph for this function:

◆ setPosition()

void ItemWithParticles::setPosition ( const R3 &  position)

Definition at line 47 of file ItemWithParticles.cpp.

48 {
50 }
void set(const R3 &d)

References m_position, position(), and VectorProperty::set().

Here is the call graph for this function:

◆ setRotation()

void ItemWithParticles::setRotation ( RotationItem p)

nullptr is allowed and sets to "no rotation"

Definition at line 62 of file ItemWithParticles.cpp.

63 {
64  m_rotation.set(p);
65 }
void set(T t, bool callInitializer=false)
Directly set the new item.

References m_rotation, and SelectionProperty< T >::set().

Here is the call graph for this function:

Member Data Documentation

◆ m_abundance

◆ m_position

◆ m_rotation


The documentation for this class was generated from the following files: