64 const V3D &pos,
const Quat &rot,
const double detWScale,
const double detHtScale,
68 for (
const auto &bankName : bankNames) {
70 std::shared_ptr<const Geometry::RectangularDetector> bank =
71 std::dynamic_pointer_cast<const RectangularDetector>(bank1);
73 Quat relRot = bank->getRelativeRot();
75 Quat newRot = parentRot * rot * relRot;
77 const auto bankComponentIndex = componentInfo.
indexOf(bank->getComponentID());
78 componentInfo.
setRotation(bankComponentIndex, newRot);
81 bank->getParent()->getRotation().rotate(rotatedPos);
83 componentInfo.
setPosition(bankComponentIndex, rotatedPos + bank->getPos());
85 std::vector<double> oldScalex =
pmap->getDouble(bank->getName(), std::string(
"scalex"));
86 std::vector<double> oldScaley =
pmap->getDouble(bank->getName(), std::string(
"scaley"));
89 if (!oldScalex.empty())
90 scalex = oldScalex[0] * detWScale;
94 if (!oldScaley.empty())
95 scaley = oldScaley[0] * detHtScale;
99 pmap->addDouble(bank.get(), std::string(
"scalex"),
scalex);
100 pmap->addDouble(bank.get(), std::string(
"scaley"),
scaley);
102 if (detWScale != 1.0 || detHtScale != 1.0)
MANTID_API_DLL void applyRectangularDetectorScaleToComponentInfo(Geometry::ComponentInfo &componentInfo, Geometry::IComponent *componentId, const double scaleX, const double scaleY)
Helpers for resizing RectangularDetectors.
MANTID_CRYSTAL_DLL void adjustBankPositionsAndSizes(const std::vector< std::string > &bankNames, const Geometry::Instrument &newInstrument, const Kernel::V3D &pos, const Kernel::Quat &rot, const double detWScale, const double detHtScale, Geometry::ComponentInfo &componentInfo)
Updates ComponentInfo for newInstrument to reflect the changes in the associated panel information.