BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularDataItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Data/SpecularDataItem.h
6 //! @brief Defines class SpecularDataItem
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_DATA_SPECULARDATAITEM_H
16 #define BORNAGAIN_GUI_MODEL_DATA_SPECULARDATAITEM_H
17 
19 
20 class AmplitudeAxisItem;
21 class BasicAxisItem;
22 
23 class BA_CORE_API_ SpecularDataItem : public DataItem {
24 private:
25  static constexpr auto P_TITLE{"Title"};
26  static constexpr auto P_XAXIS{"x-axis"};
27  static constexpr auto P_YAXIS{"y-axis"};
28 
29 public:
30  static constexpr auto M_TYPE{"SpecularData"};
31 
33 
34  void setDatafield(Datafield* data) override;
35 
36  //! Number of bins in data
37  int getNbins() const;
38 
39  //! Returns lower and upper zoom ranges of x-axis
40  double getLowerX() const;
41  double getUpperX() const;
42 
43  //! Returns min and max range of x-axis as given by IntensityData
44  double xMin() const;
45  double xMax() const;
46 
47  //! Returns lower and upper zoom ranges of y-axis
48  double getLowerY() const;
49  double getUpperY() const;
50 
51  //! Returns min and max range of y-axis as given by IntensityData
52  double yMin() const;
53  double yMax() const;
54 
55  bool isLog() const;
56  QString getXaxisTitle() const;
57  QString getYaxisTitle() const;
58 
59  QPair<double, double> dataRange() const;
60 
61  const BasicAxisItem* xAxisItem() const;
62  BasicAxisItem* xAxisItem();
63  const AmplitudeAxisItem* yAxisItem() const;
64  AmplitudeAxisItem* yAxisItem();
65 
66  void resetView();
67 
68  void setXaxisTitle(const QString& title) override;
69  void setYaxisTitle(const QString& title) override;
70  void setAxesRangeToData() override;
71  void updateCoords(const InstrumentItem* instrument) override;
72  std::vector<int> shape() const override;
73 
74  //! Returns data to the state defined by user (imported)
75  //! data.
76  void reset(ImportDataInfo data) override;
77 
78  static bool isXaxisPropertyName(const QString& name);
79  static bool isYaxisPropertyName(const QString& name);
80 
81 public slots:
82  void setLowerX(double value);
83  void setUpperX(double value);
84  void setLowerY(double value);
85  void setUpperY(double value);
86  void setLog(bool log_flag);
87 
88 private:
89  void updateAxesZoomLevel();
90 };
91 
92 #endif // BORNAGAIN_GUI_MODEL_DATA_SPECULARDATAITEM_H
Declares class DataItem.
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
Definition: DataItem.h:34
virtual void setAxesRangeToData()=0
virtual void setDatafield(Datafield *data)=0
The given pointer becomes owned by this class!!
Definition: DataItem.cpp:20
virtual void setXaxisTitle(const QString &title)=0
virtual std::vector< int > shape() const =0
virtual void updateCoords(const InstrumentItem *instrument)=0
virtual void setYaxisTitle(const QString &title)=0
virtual void reset(ImportDataInfo data)=0
Resets data to the state defined by user (imported) data.
Carries information about loaded data.
Abstract base class for instrument-specific item classes.
QString const & name(EShape k)
Definition: particles.cpp:20