BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleCompositionItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Sample/ParticleCompositionItem.h
6 //! @brief Defines class ParticleCompositionItem
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_SAMPLE_PARTICLECOMPOSITIONITEM_H
16 #define BORNAGAIN_GUI_MODEL_SAMPLE_PARTICLECOMPOSITIONITEM_H
17 
19 #include "Sample/Particle/ParticleComposition.h"
20 #include <memory>
21 
22 class MaterialItems;
23 
25 public:
26  ParticleCompositionItem(const MaterialItems* materials);
27  void serialize(Streamer& s) override;
28 
29  std::unique_ptr<ParticleComposition> createParticleComposition() const;
30 
31  QVector<ItemWithParticles*> particles() const;
32  void addParticle(ItemWithParticles* particle);
33  void removeParticle(ItemWithParticles* particle);
34 
35  QVector<ItemWithParticles*> containedItemsWithParticles() const override;
36 
37 private:
38  QVector<ItemWithParticles*> m_particles;
40 };
41 
42 #endif // BORNAGAIN_GUI_MODEL_SAMPLE_PARTICLECOMPOSITIONITEM_H
Defines abstract item with a material property.
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.
Definition: Streamer.h:36