diff --git a/GeoModelCore/GeoModelKernel/src/GeoShapeShift.cxx b/GeoModelCore/GeoModelKernel/src/GeoShapeShift.cxx index ac97113ae2c747b52977ddc123c1fcc23c7068a6..c1b96725e177ca640c3bedbe577ca90cc8db85d1 100755 --- a/GeoModelCore/GeoModelKernel/src/GeoShapeShift.cxx +++ b/GeoModelCore/GeoModelKernel/src/GeoShapeShift.cxx @@ -11,7 +11,15 @@ const std::string GeoShapeShift::s_classType = "Shift"; const ShapeType GeoShapeShift::s_classTypeID = 0x03; GeoShapeShift::GeoShapeShift (const GeoShape* A, const GeoTrf::Transform3D &X): - m_op{A}, m_shift{X} {} + m_op{A}, m_shift{X} { + /// Check whether the given shape also a shape shift. If so then we can simply + /// take the operand of the sub shift and summarize the transformations of the two into one + if (getOp()->typeID() == typeID()) { + const GeoShapeShift* subShift{static_cast<const GeoShapeShift*>(getOp())}; + m_shift = subShift->getX() * getX(); + m_op.reset(subShift->getOp()); + } +} void GeoShapeShift::extent (double& xmin, double& ymin, double& zmin,