BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ParameterTreeUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Model/ParameterTreeUtils.h
6 //! @brief Defines namespace GUI::Model::ParameterTreeUtils
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_MODEL_PARAMETERTREEUTILS_H
16 #define BORNAGAIN_GUI_MODEL_MODEL_PARAMETERTREEUTILS_H
17 
18 #include <QPair>
19 #include <QString>
20 #include <functional>
21 #include <variant>
22 
23 class JobItem;
24 class ParameterItem;
25 class ParameterLabelItem;
27 class DoubleDescriptor;
28 class VectorDescriptor;
29 class ParticleLayoutItem;
30 class ItemWithParticles;
32 class BeamItem;
34 class DetectorItem;
35 class BackgroundItem;
36 class InstrumentItem;
37 
38 //! The ParameterTreeBuilder contains helper functions to create container
39 //! with ParameterItems. The ParameterItem appears in RealTimeView and provides real
40 //! time tuning of MultiLayerItem and InstrumentItem.
41 
43 public:
44  ParameterTreeBuilder(JobItem* jobItem, bool recreateBackupValues);
45 
46  void build();
47 
48 private:
49  //! add the job's materials
50  void addMaterials();
51 
52  //! add the job's sample
53  void addSample();
54  void addInstrument();
56  const QString& label = QString());
59  const std::variant<VectorDescriptor, DoubleDescriptor>& v);
61  bool allowMagneticFields() const;
62 
63  void addInterference(ParameterLabelItem* layoutLabel, const ParticleLayoutItem* layout);
64 
65  //! Returns the top label which was created for the particle
67  bool enableAbundance, bool enablePosition = true);
69  void addRotation(ParameterLabelItem* parentLabel, ItemWithParticles* p);
70 
71  void addBeamDistribution(ParameterLabelItem* parentLabel,
72  BeamDistributionItem* distributionItem, const QString& label,
73  bool withMean = true);
74 
75  void addDetector(ParameterLabelItem* parentLabel, DetectorItem* detector);
76  void addBackground(ParameterLabelItem* instrumentLabel, BackgroundItem* backgroundItem);
77  void addPolarization(ParameterLabelItem* instrumentLabel, const InstrumentItem* instrument);
78 
79 private:
82 };
83 
84 #endif // BORNAGAIN_GUI_MODEL_MODEL_PARAMETERTREEUTILS_H
The BeamDistributionItem handles wavelength, inclination and azimuthal parameter distribution for Bea...
Describes properties of a double value which are necessary to allow GUI representation,...
Abstract base class for instrument-specific item classes.
The ParameterContainerItem is a top item to hold all ParameterItem, represents an entry point to para...
The ParameterItem class represent a tuning value in a parameter tuning tree.
ParameterTreeItems is a collection of items necessary to form a tuning tree for real time widget.
The ParameterTreeBuilder contains helper functions to create container with ParameterItems....
void addLattice(ParameterLabelItem *parentLabel, const Interference2DAbstractLatticeItem *itf)
ParameterLabelItem * addParticle(ParameterLabelItem *parentLabel, ItemWithParticles *p, bool enableAbundance, bool enablePosition=true)
Returns the top label which was created for the particle.
void addPolarization(ParameterLabelItem *instrumentLabel, const InstrumentItem *instrument)
void addMaterials()
add the job's materials
void addBackground(ParameterLabelItem *instrumentLabel, BackgroundItem *backgroundItem)
void addBeamDistribution(ParameterLabelItem *parentLabel, BeamDistributionItem *distributionItem, const QString &label, bool withMean=true)
void addDetector(ParameterLabelItem *parentLabel, DetectorItem *detector)
ParameterTreeBuilder(JobItem *jobItem, bool recreateBackupValues)
void addParameterItem(ParameterLabelItem *parent, const DoubleDescriptor &d, const QString &label=QString())
void addSample()
add the job's sample
void addRotation(ParameterLabelItem *parentLabel, ItemWithParticles *p)
ParameterContainerItem * parameterContainer()
void addInterference(ParameterLabelItem *layoutLabel, const ParticleLayoutItem *layout)
Describes properties of a 3D vector, consisting of three double values.