BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskUnitsConverter.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaskWidgets/MaskUnitsConverter.h
6 //! @brief Defines class MaskUnitsConverter
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_VIEWS_MASKWIDGETS_MASKUNITSCONVERTER_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_MASKUNITSCONVERTER_H
17 
18 class IntensityDataItem;
19 class SessionItem;
20 class IAxis;
21 template <class T> class OutputData;
22 class QString;
23 
24 //! The MaskUnitsConverter converts coordinates of all masks from one units to anoter.
25 //! I.e. masks in 'mm' into masks in 'deg'. This is done in two steps.
26 //! On first step masks are converted from native coordinates (as given by axes of OutputData)
27 //! into bin-fraction coordinates.
28 //! On second step masks are converted from bin-fraction coordinates into current axes of
29 //! OutputData.
30 
32 public:
34 
36 
37  void convertToNbins(IntensityDataItem* intensityData);
38  void convertFromNbins(IntensityDataItem* intensityData);
39 
40 private:
41  void convertIntensityDataItem(IntensityDataItem* intensityData);
42  void convertMask(SessionItem* maskItem);
43 
44  void convertCoordinate(SessionItem* maskItem, const QString& xname, const QString& yname);
45 
46  double convert(double value, int axis_index);
47 
50 };
51 
52 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_MASKUNITSCONVERTER_H
Interface for one-dimensional axes.
Definition: IAxis.h:25
The MaskUnitsConverter converts coordinates of all masks from one units to anoter.
void convertMask(SessionItem *maskItem)
Converts single mask from/to bin-fraction coordinates.
void convertIntensityDataItem(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem from/to bin-fraction coordinates.
double convert(double value, int axis_index)
Convert value of axis from/to bin-fraction coordinates.
const OutputData< double > * m_data
EConvertionDirection m_direction
void convertToNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem into bin-fraction coordinates.
void convertFromNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem from bin-fraction coordinates to coordinates of axes...
void convertCoordinate(SessionItem *maskItem, const QString &xname, const QString &yname)
Convert (x,y) coordinates registered as property (i.e.
Templated class to store data of type double or CumulativeValue in multi-dimensional space.
Definition: OutputData.h:32