BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitParameterContainerItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Job/FitParameterContainerItem.h
6 //! @brief Defines class FitParameterContainerItem
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_JOB_FITPARAMETERCONTAINERITEM_H
16 #define BORNAGAIN_GUI_MODEL_JOB_FITPARAMETERCONTAINERITEM_H
17 
19 
20 namespace mumufit {
21 
22 class Parameters;
23 }
24 class FitParameterItem;
25 class ParameterItem;
26 
27 //! The FitParameterContainerItem class is a collection of all defined fit parameters in JobItem.
28 
30 private:
31  static constexpr auto T_FIT_PARAMETERS{"Data tag"};
32 
33 public:
34  static constexpr auto M_TYPE{"FitParameterContainer"};
35 
37 
38  //! Creates fit parameter from given ParameterItem, sets starting value to the value
39  //! of ParameterItem, copies link.
40  void createFitParameter(ParameterItem* parameterItem);
41 
42  //! Adds given parameterItem to the existing fit parameter with display name fitParName.
43  //! If parameterItem is already linked with another fitParameter, it will be relinked
44  void addToFitParameter(ParameterItem* parameterItem, const QString& fitParName);
45 
46  //! get the fit parameter item whose link matches the given link.
47  //!
48  //! The link is a ParameterItem's path
49  FitParameterItem* fitParameterItem(const QString& link) const;
50 
51  //! get the fit parameter item which links the given parameterItem.
52  FitParameterItem* fitParameterItem(const ParameterItem* parameterItem) const;
53 
54  QVector<FitParameterItem*> fitParameterItems() const;
55 
56  //! Returns list of fit parameter display names
57  QStringList fitParameterNames() const;
58 
59  void removeLink(const ParameterItem* parameterItem);
60 
61 
62  bool isEmpty();
63  void setValuesInParameterContainer(const QVector<double>& values,
64  class ParameterContainerItem* parameterContainer);
65  mumufit::Parameters createParameters() const;
66 };
67 
68 #endif // BORNAGAIN_GUI_MODEL_JOB_FITPARAMETERCONTAINERITEM_H
Defines class SessionItem.
The FitParameterContainerItem class is a collection of all defined fit parameters in JobItem.
static constexpr auto T_FIT_PARAMETERS
QStringList fitParameterNames() const
Returns list of fit parameter display names.
FitParameterItem * fitParameterItem(const QString &link) const
get the fit parameter item whose link matches the given link.
mumufit::Parameters createParameters() const
void removeLink(const ParameterItem *parameterItem)
void createFitParameter(ParameterItem *parameterItem)
Creates fit parameter from given ParameterItem, sets starting value to the value of ParameterItem,...
void setValuesInParameterContainer(const QVector< double > &values, class ParameterContainerItem *parameterContainer)
Propagate values to the corresponding parameter tree items of parameterContainer.
QVector< FitParameterItem * > fitParameterItems() const
void addToFitParameter(ParameterItem *parameterItem, const QString &fitParName)
Adds given parameterItem to the existing fit parameter with display name fitParName....
FitParameterItems is a collection of items to define fit parameters in GUI.
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.
Base class for a GUI data item.
Definition: SessionItem.h:204