BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MultiLayerItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Sample/MultiLayerItem.h
6 //! @brief Defines class MultiLayerItem
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_SAMPLE_MULTILAYERITEM_H
16 #define BORNAGAIN_GUI_MODEL_SAMPLE_MULTILAYERITEM_H
17 
21 #include <QString>
22 #include <QUuid>
23 #include <QVector>
24 
25 class LayerItem;
26 class ItemWithMaterial;
27 class QXmlStreamReader;
28 class QXmlStreamWriter;
29 class Streamer;
30 
32 public:
34 
35  void initFrom(const MultiLayerItem* other);
36 
37  QVector<ItemWithMaterial*> itemsWithMaterial() const;
38 
39  void addStandardMaterials();
40 
41  QString sampleName() const;
42  void setSampleName(const QString& name);
43 
44  QString description() const;
45  void setDescription(const QString& description);
46 
48 
49  R3 externalField() const;
50  void setExternalField(const R3& externalField);
52 
53  QVector<LayerItem*> layers() const;
54 
55  //! Creates and inserts a layer at given index.
56  //!
57  //! No properties etc. have been initialized, this has to be done by the caller
58  //! If index = -1, create a layer at the end of the list.
59  LayerItem* addLayer(int index = -1);
60 
61  void removeLayer(LayerItem* item);
62  void moveLayer(LayerItem* item, LayerItem* beforeThisLayer);
63 
64  void writeContentTo(QXmlStreamWriter* writer) const;
65  void readContentFrom(QXmlStreamReader* reader);
66  void serialize(Streamer& s);
67 
69  const MaterialItems& materialItems() const;
70 
71 private:
72  QString m_name;
73  QString m_description;
76  QVector<LayerItem*> m_layers;
78 };
79 
80 #endif // BORNAGAIN_GUI_MODEL_SAMPLE_MULTILAYERITEM_H
Defines class DoubleProperty.
Defines class MaterialItems.
@ other
The unit has no enum value defined in here (e.g. when defined as an explicit string)
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.
QString sampleName() const
void setDescription(const QString &description)
LayerItem * addLayer(int index=-1)
Creates and inserts a layer at given index.
MaterialItems & materialItems()
void setSampleName(const QString &name)
QVector< LayerItem * > m_layers
void initFrom(const MultiLayerItem *other)
void addStandardMaterials()
void removeLayer(LayerItem *item)
MaterialItems m_materials
void writeContentTo(QXmlStreamWriter *writer) const
DoubleProperty m_crossCorrelationLength
QVector< LayerItem * > layers() const
R3 externalField() const
QVector< ItemWithMaterial * > itemsWithMaterial() const
void serialize(Streamer &s)
QString m_description
QString description() const
void readContentFrom(QXmlStreamReader *reader)
DoubleDescriptor crossCorrLength() const
VectorProperty m_externalField
void moveLayer(LayerItem *item, LayerItem *beforeThisLayer)
void setExternalField(const R3 &externalField)
VectorDescriptor externalFieldVector() const
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.
QString const & name(EShape k)
Definition: particles.cpp:20