Skip to content
Snippets Groups Projects
Commit 2eb5487b authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

format

parent 8dbd599a
Branches
Tags
1 merge request!2420mask item owned by detector instead of data
...@@ -39,18 +39,18 @@ Datafield* createMaskedField(const Data2DItem* data) ...@@ -39,18 +39,18 @@ Datafield* createMaskedField(const Data2DItem* data)
MaskStack detectorMask; MaskStack detectorMask;
if (const InstrumentItem* ii = gDoc->instruments()->currentItem()) if (const InstrumentItem* ii = gDoc->instruments()->currentItem())
if (const MasksSet* s = ii->masks()) if (const MasksSet* s = ii->masks())
// no longer reverse??? // no longer reverse???
for (const MaskItem* t : *s) { for (const MaskItem* t : *s) {
if (t->isVisible()) { if (t->isVisible()) {
if (auto* roiItem = dynamic_cast<const RegionOfInterestItem*>(t)) if (auto* roiItem = dynamic_cast<const RegionOfInterestItem*>(t))
roi = roiItem->createShape(); roi = roiItem->createShape();
else { else {
std::unique_ptr<IShape2D> shape(t->createShape()); std::unique_ptr<IShape2D> shape(t->createShape());
detectorMask.pushMask(*shape, t->maskValue(), false); detectorMask.pushMask(*shape, t->maskValue(), false);
} }
} }
} }
// ROI mask has to be the last one, it can not be "unmasked" by other shapes // ROI mask has to be the last one, it can not be "unmasked" by other shapes
if (roi) if (roi)
...@@ -161,9 +161,9 @@ void MaskEditorCanvas::onPresentationChange(bool pixelized) ...@@ -161,9 +161,9 @@ void MaskEditorCanvas::onPresentationChange(bool pixelized)
} }
if (const InstrumentItem* ii = gDoc->instruments()->currentItem()) if (const InstrumentItem* ii = gDoc->instruments()->currentItem())
if (const MasksSet* s = ii->masks()) if (const MasksSet* s = ii->masks())
for (MaskItem* t : *s) for (MaskItem* t : *s)
t->setIsVisible(!pixelized && t->wasVisible()); t->setIsVisible(!pixelized && t->wasVisible());
} }
//! Saves plot into project directory. //! Saves plot into project directory.
...@@ -198,11 +198,11 @@ void MaskEditorCanvas::onResetViewRequest() ...@@ -198,11 +198,11 @@ void MaskEditorCanvas::onResetViewRequest()
void MaskEditorCanvas::setZoomToROI() void MaskEditorCanvas::setZoomToROI()
{ {
if (const InstrumentItem* ii = gDoc->instruments()->currentItem()) if (const InstrumentItem* ii = gDoc->instruments()->currentItem())
if (const MasksSet* s = ii->masks()) if (const MasksSet* s = ii->masks())
if (auto* roiItem = s->regionOfInterestItem()) { if (auto* roiItem = s->regionOfInterestItem()) {
m_data_item->setXrange(roiItem->xLow(), roiItem->xUp()); m_data_item->setXrange(roiItem->xLow(), roiItem->xUp());
m_data_item->setYrange(roiItem->yLow(), roiItem->yUp()); m_data_item->setYrange(roiItem->yLow(), roiItem->yUp());
} }
} }
void MaskEditorCanvas::onEnteringColorMap() void MaskEditorCanvas::onEnteringColorMap()
......
...@@ -84,7 +84,7 @@ QSize MasksPanel::minimumSizeHint() const ...@@ -84,7 +84,7 @@ QSize MasksPanel::minimumSizeHint() const
void MasksPanel::updateMasksPanel() void MasksPanel::updateMasksPanel()
{ {
if (InstrumentItem* ii = gDoc->instrumentsRW()->currentItem()) if (InstrumentItem* ii = gDoc->instrumentsRW()->currentItem())
m_qlistmodel = ii->masksRW(); m_qlistmodel = ii->masksRW();
m_qlistview->setModel(m_qlistmodel->model()); m_qlistview->setModel(m_qlistmodel->model());
m_qlistview->setSelectionMode(QAbstractItemView::ExtendedSelection); m_qlistview->setSelectionMode(QAbstractItemView::ExtendedSelection);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment