BornAgain  1.19.0
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/coregui/Models/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_COREGUI_MODELS_SPECULARDATAITEM_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_SPECULARDATAITEM_H
17 
19 
20 class AmplitudeAxisItem;
21 class BasicAxisItem;
22 
24 const QString x_axis_default_name = "X [nbins]";
25 const QString y_axis_default_name = "Signal [a.u.]";
26 } // namespace SpecularDataAxesNames
27 
28 class BA_CORE_API_ SpecularDataItem : public DataItem {
29 public:
30  static const QString P_TITLE;
31  static const QString P_XAXIS;
32  static const QString P_YAXIS;
33 
35 
36  void setOutputData(OutputData<double>* data) override;
37 
38  //! Number of bins in data
39  int getNbins() const;
40 
41  //! returns lower and upper zoom ranges of x-axis
42  double getLowerX() const;
43  double getUpperX() const;
44 
45  //! returns min and max range of x-axis as given by IntensityData
46  double getXmin() const;
47  double getXmax() const;
48 
49  //! returns lower and upper zoom ranges of y-axis
50  double getLowerY() const;
51  double getUpperY() const;
52 
53  //! returns min and max range of y-axis as given by IntensityData
54  double getYmin() const;
55  double getYmax() const;
56 
57  bool isLog() const;
58  QString getXaxisTitle() const;
59  QString getYaxisTitle() const;
60 
61  QPair<double, double> dataRange() const;
62 
63  const BasicAxisItem* xAxisItem() const;
64  BasicAxisItem* xAxisItem();
65  const AmplitudeAxisItem* yAxisItem() const;
66  AmplitudeAxisItem* yAxisItem();
67 
68  void resetView();
69 
70  void setXaxisTitle(const QString& title) override;
71  void setYaxisTitle(const QString& title) override;
72  void setAxesRangeToData() override;
73  void updateAxesUnits(const InstrumentItem* instrument) override;
74  std::vector<int> shape() const override;
75 
76  //! Returns data to the state defined by user (imported)
77  //! data.
78  void reset(ImportDataInfo data) override;
79 
80 public slots:
81  void setLowerX(double value);
82  void setUpperX(double value);
83  void setLowerY(double value);
84  void setUpperY(double value);
85  void setLog(bool log_flag);
86 
87 private:
88  void updateAxesZoomLevel();
89 };
90 
91 #endif // BORNAGAIN_GUI_COREGUI_MODELS_SPECULARDATAITEM_H
Declares class DataItem.
Provides common functionality for IntensityDataItem and SpecularDataItem.
Definition: DataItem.h:29
virtual void setAxesRangeToData()=0
virtual void updateAxesUnits(const InstrumentItem *instrument)=0
virtual void setOutputData(OutputData< double > *data)=0
The given pointer becomes owned by this class!!
Definition: DataItem.cpp:24
virtual void setXaxisTitle(const QString &title)=0
virtual std::vector< int > shape() const =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.
static const QString P_YAXIS
static const QString P_TITLE
static const QString P_XAXIS
const QString y_axis_default_name
const QString x_axis_default_name