Skip to content
Snippets Groups Projects
Commit 161029e6 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Wuttke, Joachim
Browse files

pass to core only shown masks

parent b1978c50
No related branches found
No related tags found
No related merge requests found
...@@ -103,16 +103,17 @@ void DetectorItem::addMasksToCore(IDetector* detector) const ...@@ -103,16 +103,17 @@ void DetectorItem::addMasksToCore(IDetector* detector) const
{ {
const double scale = axesToCoreUnitsFactor(); const double scale = axesToCoreUnitsFactor();
const QVector<MaskItem*> maskItems = m_maskContainerItem.maskItems(); const QVector<MaskItem*> maskItems = m_maskContainerItem.maskItems();
for (auto maskIter = maskItems.rbegin(); maskIter != maskItems.rend(); maskIter++) { for (auto maskIter = maskItems.rbegin(); maskIter != maskItems.rend(); maskIter++)
if (auto* roiItem = dynamic_cast<RegionOfInterestItem*>(*maskIter)) { if ((*maskIter)->isVisible()) {
const double xlow = scale * roiItem->xLow(); if (auto* roiItem = dynamic_cast<RegionOfInterestItem*>(*maskIter)) {
const double ylow = scale * roiItem->yLow(); const double xlow = scale * roiItem->xLow();
const double xup = scale * roiItem->xUp(); const double ylow = scale * roiItem->yLow();
const double yup = scale * roiItem->yUp(); const double xup = scale * roiItem->xUp();
detector->setRegionOfInterest(xlow, ylow, xup, yup); const double yup = scale * roiItem->yUp();
} else { detector->setRegionOfInterest(xlow, ylow, xup, yup);
std::unique_ptr<IShape2D> shape((*maskIter)->createShape(scale)); } else {
detector->addMask(*shape, (*maskIter)->maskValue()); std::unique_ptr<IShape2D> shape((*maskIter)->createShape(scale));
detector->addMask(*shape, (*maskIter)->maskValue());
}
} }
}
} }
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