Skip to content
Snippets Groups Projects

Core: minor cleanup in Instrument context

Merged Wuttke, Joachim requested to merge ry0 into develop
1 file
+ 8
8
Compare changes
  • Side-by-side
  • Inline
@@ -505,13 +505,13 @@ void GUI::Transform::FromDomain::setSpecularBeamItem(SpecularBeamItem* beam_item
void GUI::Transform::FromDomain::setDetector(Instrument2DItem* instrument_item,
const ISimulation2D& simulation)
{
const IDetector* p_detector = simulation.instrument().getDetector();
setDetectorGeometry(instrument_item, *p_detector);
const IDetector& detector = simulation.detector();
setDetectorGeometry(instrument_item, detector);
auto detector_item = instrument_item->detectorItem();
setDetectorResolution(detector_item, *p_detector);
setDetectorProperties(detector_item, *p_detector);
setDetectorResolution(detector_item, detector);
setDetectorProperties(detector_item, detector);
setDetectorMasks(detector_item, simulation);
}
@@ -651,16 +651,16 @@ void GUI::Transform::FromDomain::setRectangularDetector(RectangularDetectorItem*
void GUI::Transform::FromDomain::setDetectorMasks(DetectorItem* detector_item,
const ISimulation& simulation)
{
const IDetector* detector = simulation.instrument().getDetector();
if ((detector->detectorMask() && detector->detectorMask()->hasMasks())
|| detector->hasExplicitRegionOfInterest()) {
const IDetector& detector = simulation.detector();
if ((detector.detectorMask() && detector.detectorMask()->hasMasks())
|| detector.hasExplicitRegionOfInterest()) {
detector_item->createMaskContainer();
double scale(1.0);
if (detector_item->modelType() == SphericalDetectorItem::M_TYPE)
scale = 1. / Units::deg;
setMaskContainer(detector_item->maskContainerItem(), *detector, scale);
setMaskContainer(detector_item->maskContainerItem(), detector, scale);
}
}
Loading