BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DataProperties.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/DataProperties.h
6 //! @brief Defines class DataProperties and its descendants
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_COREGUI_MODELS_DATAPROPERTIES_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_DATAPROPERTIES_H
17 
19 
20 class DataItem;
21 
22 //! Implements a link to DataItem. If path name
23 //! of a DataItem changes, the link becomes invalid.
24 //! Also serves as a base for Data1DProperties
25 class BA_CORE_API_ DataProperties : public SessionItem {
26 public:
27  static const QString P_DATALINK;
28 
29  void setDataItem(DataItem* item);
30  DataItem* dataItem();
31 
32 protected:
33  DataProperties(const QString& model_type);
34 };
35 
36 //! Holds data required for 1D DataItem representation
37 class BA_CORE_API_ Data1DProperties : public DataProperties {
38 public:
39  static const QString P_COLOR;
40 
42 
43  //! Creates and returns a color object from color name in Data1DPresentationProperties
44  QColor color();
45 
46  //! Returns set up color ComboProperty.
47  void setColorProperty(const QString& color_name);
48 
49  //! Returns the name of the color, which follows the color of passes property
50  //! container. If the container is nullptr or has the last-in-queue color,
51  //! returns default color.
52  static const QString& nextColorName(Data1DProperties* properties);
53 };
54 
55 #endif // BORNAGAIN_GUI_COREGUI_MODELS_DATAPROPERTIES_H
Defines class SessionItem.
Holds data required for 1D DataItem representation.
static const QString P_COLOR
Provides common functionality for IntensityDataItem and SpecularDataItem.
Definition: DataItem.h:29
Implements a link to DataItem.
static const QString P_DATALINK
std::string model_type
Definition: types.h:23