BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ImportDataInfo.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/utils/ImportDataInfo.h
6 //! @brief Defines ImportDataInfo helper struct
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_UTILS_IMPORTDATAINFO_H
16 #define BORNAGAIN_GUI_COREGUI_UTILS_IMPORTDATAINFO_H
17 
19 #include <QString>
20 #include <memory>
21 
22 template <class T> class OutputData;
23 
24 //! Carries information about loaded data.
25 
27 public:
30  ImportDataInfo(std::unique_ptr<OutputData<double>> data, Axes::Units units);
32  ImportDataInfo(std::unique_ptr<OutputData<double>> data, const QString& units);
34 
35  //! True if the contained data is not nullptr (no info about empty data)
36  operator bool() const;
37 
38  std::unique_ptr<OutputData<double>> intensityData() const&;
39  std::unique_ptr<OutputData<double>> intensityData() &&;
40 
41  //! Returns number of dimensions.
42  size_t dataRank() const;
43 
44  QString unitsLabel() const;
45  QString axisLabel(size_t axis_index) const;
46 
47 private:
48  void checkValidity();
49 
50 private:
51  std::unique_ptr<OutputData<double>> m_data;
53 };
54 
55 #endif // BORNAGAIN_GUI_COREGUI_UTILS_IMPORTDATAINFO_H
Defines interface IUnitConverter and possible axis units.
Wrapper for detector axes units, required for a better representation of detector axes units in pytho...
Carries information about loaded data.
Axes::Units m_units
size_t dataRank() const
Returns number of dimensions.
QString unitsLabel() const
std::unique_ptr< OutputData< double > > m_data
QString axisLabel(size_t axis_index) const
std::unique_ptr< OutputData< double > > intensityData() const &
Templated class to store data of type double or CumulativeValue in multi-dimensional space.
Definition: OutputData.h:32
Constants and functions for physical unit conversions.
Definition: Units.h:30
Definition: filesystem.h:81