BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemWithParticles.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Sample/ItemWithParticles.h
6 //! @brief Defines abstract item with a material property
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_ITEMWITHPARTICLES_H
16 #define BORNAGAIN_GUI_MODEL_SAMPLE_ITEMWITHPARTICLES_H
17 
22 #include <memory>
23 
24 class IRotation;
25 class Streamer;
26 
28 public:
29  virtual ~ItemWithParticles() = default;
31  void setAbundance(double abundance);
32 
33  R3 position() const;
34  void setPosition(const R3& position);
36 
37  //! Returns selection descriptor for rotation methods.
39 
40  //! nullptr is allowed and sets to "no rotation"
41  void setRotation(RotationItem* p);
42 
43  //! nullptr only if "no rotation". Can contain identity!
44  std::unique_ptr<IRotation> createRotation() const;
45 
46  //! Return full hierarchical contained items with particles.
47  //!
48  //! For example ParticleCompositionItem contains other items, ParticleItem doesn't.
49  virtual QVector<ItemWithParticles*> containedItemsWithParticles() const = 0;
50 
51  virtual void serialize(Streamer& s) = 0;
52 
53 protected:
54  ItemWithParticles(const QString& abundanceTooltip, const QString& positionTooltip);
55 
59 };
60 
61 #endif // BORNAGAIN_GUI_MODEL_SAMPLE_ITEMWITHPARTICLES_H
Defines class DoubleProperty.
Defines class RotationItems.
Defines class SelectionProperty.
Defines class VectorProperty.
Describes properties of a double value which are necessary to allow GUI representation,...
Class for representing a double value, its attributes and its accessors.
ItemWithParticles(const QString &abundanceTooltip, const QString &positionTooltip)
virtual void serialize(Streamer &s)=0
void setPosition(const R3 &position)
VectorProperty m_position
SelectionProperty< RotationItem * > m_rotation
std::unique_ptr< IRotation > createRotation() const
nullptr only if "no rotation". Can contain identity!
DoubleDescriptor abundance() const
void setAbundance(double abundance)
DoubleProperty m_abundance
SelectionDescriptor< RotationItem * > rotation()
Returns selection descriptor for rotation methods.
VectorDescriptor positionVector() const
virtual QVector< ItemWithParticles * > containedItemsWithParticles() const =0
Return full hierarchical contained items with particles.
void setRotation(RotationItem *p)
nullptr is allowed and sets to "no rotation"
virtual ~ItemWithParticles()=default
Describes a selection (various possibilities and the current one).
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36
Describes properties of a 3D vector, consisting of three double values.
Holds a 3D vector of type R3 as well as additional info like label, tooltip.