Skip to content
Snippets Groups Projects
Commit 7ad63543 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

rm mask conv from container

parent 22d3374d
No related branches found
No related tags found
1 merge request!2234Convert mask coords to bins before passing to detector (#823)
...@@ -334,8 +334,7 @@ void JobItem::adjustReaDataToJobInstrument() ...@@ -334,8 +334,7 @@ void JobItem::adjustReaDataToJobInstrument()
// Masks conversion can be done in two steps: first from original coords to bins, // Masks conversion can be done in two steps: first from original coords to bins,
// then from bins to target coords. // then from bins to target coords.
// If 'IDetector::addBinMask' is used by detector, only "orig coords --> bins" is needed. // If 'IDetector::addBinMask' is used by detector, only "orig coords --> bins" is needed.
if (const auto* container = m_realItem->data2DItem()->maskContainerItem()) m_realItem->data2DItem()->convertMasksToNbins();
container->convertToNbins(m_realItem->data2DItem()->c_field()->frame());
importMasksFromDatafileItem(); // Copy masks & ROI from DatafileItem on board of instrument. importMasksFromDatafileItem(); // Copy masks & ROI from DatafileItem on board of instrument.
cropRealData(); // Crop DatafileItem to the region of interest. cropRealData(); // Crop DatafileItem to the region of interest.
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "GUI/Model/Mask/MaskContainerItem.h" #include "GUI/Model/Mask/MaskContainerItem.h"
#include "GUI/Model/Mask/MaskItems.h" #include "GUI/Model/Mask/MaskItems.h"
#include "GUI/Model/Mask/MaskUnitsConverter.h"
#include <QRegularExpression> #include <QRegularExpression>
namespace { namespace {
...@@ -117,20 +116,6 @@ void MaskContainerItem::updateMaskNames() ...@@ -117,20 +116,6 @@ void MaskContainerItem::updateMaskNames()
} }
} }
void MaskContainerItem::convertToNbins(const Frame& frame) const
{
MaskUnitsConverter mask_converter(frame);
for (auto* maskItem : maskItems())
mask_converter.convertToNbins(maskItem);
}
void MaskContainerItem::convertFromNbins(const Frame& frame) const
{
MaskUnitsConverter mask_converter(frame);
for (auto* maskItem : maskItems())
mask_converter.convertFromNbins(maskItem);
}
void MaskContainerItem::writeTo(QXmlStreamWriter* w) const void MaskContainerItem::writeTo(QXmlStreamWriter* w) const
{ {
XML::writeAttribute(w, XML::Attrib::version, uint(1)); XML::writeAttribute(w, XML::Attrib::version, uint(1));
......
...@@ -70,10 +70,6 @@ public: ...@@ -70,10 +70,6 @@ public:
//! Update numbers in mask names //! Update numbers in mask names
void updateMaskNames(); void updateMaskNames();
//! Converts masks coordinates to/from frame coordinates
void convertToNbins(const Frame& frame) const;
void convertFromNbins(const Frame& frame) const;
const QModelIndex rootIndex; const QModelIndex rootIndex;
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment