diff --git a/Resample/Processed/Slicer.cpp b/Resample/Processed/Slicer.cpp index c345f726b5e3a3ac0adcaa0ad6fab17bd339482a..583e3ad4bc531100e1db07dccf02af15c4594019 100644 --- a/Resample/Processed/Slicer.cpp +++ b/Resample/Processed/Slicer.cpp @@ -78,8 +78,14 @@ bool shapeOutsideLimits(const IBornFF& formfactor, ZLimits limits, const IRotati return ztop <= limits.zBottom() || zbottom >= limits.zTop(); } -ReParticle* sliceFormFactor(const IBornFF* ff, ZLimits limits, const IRotation* rot, R3 translation) +ReParticle* createParticleSlice(const IBornFF* ff, ZLimits limits, const IRotation* rot, + R3 translation) { + if (shapeIsContainedInLimits(*ff, limits, rot, translation)) + return ReParticle::createTransformedFormFactor(*ff, rot, translation); + if (shapeOutsideLimits(*ff, limits, rot, translation)) + return nullptr; + std::unique_ptr<IBornFF> slicedff; if (const auto* f = dynamic_cast<const FormFactorAnisoPyramid*>(ff)) { @@ -216,20 +222,8 @@ ReParticle* sliceFormFactor(const IBornFF* ff, ZLimits limits, const IRotation* return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); } else - throw std::runtime_error("Slicing not implemented for " + ff->shapeName()); -} - -ReParticle* createParticleSlice(const IBornFF* ff, ZLimits limits, const IRotation* rot, - R3 translation) -{ - if (shapeIsContainedInLimits(*ff, limits, rot, translation)) - return ReParticle::createTransformedFormFactor(*ff, rot, translation); - if (shapeOutsideLimits(*ff, limits, rot, translation)) - return nullptr; - if (ff->canSliceAnalytically(rot)) - return sliceFormFactor(ff, limits, rot, translation); - throw std::runtime_error("Slicing of " + ff->className() - + " not supported for the given rotation!"); + throw std::runtime_error("Slicing of " + ff->className() + + " not supported for the given rotation!"); } IReParticle* processBasis(const IParticle* basis)