BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The MaskUnitsConverter converts coordinates of all masks from one units to anoter. I.e. masks in 'mm' into masks in 'deg'. This is done in two steps. On first step masks are converted from native coordinates (as given by axes of Datafield) into bin-fraction coordinates. On second step masks are converted from bin-fraction coordinates into current axes of Datafield.
Definition at line 32 of file MaskUnitsConverter.h.
Public Types | |
enum | EConvertionDirection { TO_NBINS , FROM_NBINS , UNDEFINED } |
Public Member Functions | |
MaskUnitsConverter () | |
void | convertFromNbins (IntensityDataItem *intensityData) |
Converts all masks on board of IntensityDataItem from bin-fraction coordinates to coordinates of axes currently defined in Datafield. More... | |
void | convertToNbins (IntensityDataItem *intensityData) |
Converts all masks on board of IntensityDataItem into bin-fraction coordinates. More... | |
Private Types | |
enum class | Axis { X , Y } |
Private Member Functions | |
double | convert (double value, Axis axis) |
Convert value of axis from/to bin-fraction coordinates. More... | |
void | convertCoordinate (SessionItem *maskItem, const QString &xname, const QString &yname) |
Convert (x,y) coordinates registered as property (i.e. under P_XPOS, P_YPOS) from/to bin-fraction coordinates. Result of operation are new values for registered properties. More... | |
void | convertIntensityDataItem (IntensityDataItem *intensityData) |
Converts all masks on board of IntensityDataItem from/to bin-fraction coordinates. More... | |
void | convertMask (MaskItem *maskItem) |
Converts single mask from/to bin-fraction coordinates. More... | |
Private Attributes | |
const Datafield * | m_data |
EConvertionDirection | m_direction |
|
strongprivate |
MaskUnitsConverter::MaskUnitsConverter | ( | ) |
Definition at line 21 of file MaskUnitsConverter.cpp.
|
private |
Convert value of axis from/to bin-fraction coordinates.
Definition at line 122 of file MaskUnitsConverter.cpp.
References FROM_NBINS, m_data, m_direction, and TO_NBINS.
Referenced by convertCoordinate(), and convertMask().
|
private |
Convert (x,y) coordinates registered as property (i.e. under P_XPOS, P_YPOS) from/to bin-fraction coordinates. Result of operation are new values for registered properties.
Definition at line 107 of file MaskUnitsConverter.cpp.
References convert(), SessionItem::getItemValue(), SessionItem::isTag(), SessionItem::setItemValue(), X, and Y.
void MaskUnitsConverter::convertFromNbins | ( | IntensityDataItem * | intensityData | ) |
Converts all masks on board of IntensityDataItem from bin-fraction coordinates to coordinates of axes currently defined in Datafield.
Definition at line 38 of file MaskUnitsConverter.cpp.
References convertIntensityDataItem(), FROM_NBINS, and m_direction.
Referenced by IntensityDataItem::reset(), and IntensityDataItem::updateCoords().
|
private |
Converts all masks on board of IntensityDataItem from/to bin-fraction coordinates.
Definition at line 46 of file MaskUnitsConverter.cpp.
References convertMask(), DataItem::getDatafield(), SessionItem::getItems(), m_data, IntensityDataItem::maskContainerItem(), MaskContainerItem::maskItems(), and IntensityDataItem::projectionContainerItem().
Referenced by convertFromNbins(), and convertToNbins().
|
private |
Converts single mask from/to bin-fraction coordinates.
Definition at line 65 of file MaskUnitsConverter.cpp.
References convert(), m_data, m_direction, TO_NBINS, X, and Y.
Referenced by convertIntensityDataItem().
void MaskUnitsConverter::convertToNbins | ( | IntensityDataItem * | intensityData | ) |
Converts all masks on board of IntensityDataItem into bin-fraction coordinates.
Definition at line 29 of file MaskUnitsConverter.cpp.
References convertIntensityDataItem(), m_direction, and TO_NBINS.
Referenced by IntensityDataItem::reset(), and IntensityDataItem::updateCoords().
|
private |
Definition at line 51 of file MaskUnitsConverter.h.
Referenced by convert(), convertIntensityDataItem(), and convertMask().
|
private |
Definition at line 52 of file MaskUnitsConverter.h.
Referenced by convert(), convertFromNbins(), convertMask(), and convertToNbins().