18using namespace Kernel;
26 return "Clears all the parameters associated with a workspace's instrument.";
40 "Workspace whose instrument parameters are to be cleared.");
47 auto &detectorInfo = ws->mutableDetectorInfo();
48 if (detectorInfo.isScanning()) {
51 throw std::runtime_error(
"ClearInstrumentParameters cannot be used on a workspace with a detector scan.");
54 auto &componentInfo = ws->mutableComponentInfo();
55 componentInfo.clearParameters();
56 detectorInfo.clearMaskFlags();
61 const auto &baseComponentInfo = ws->baseComponentInfo();
63 for (
size_t index = componentInfo.size();
index-- > 0;) {
64 componentInfo.setRotation(
index, baseComponentInfo.rotation(
index));
65 componentInfo.setPosition(
index, baseComponentInfo.position(
index));
66 componentInfo.setScaleFactor(
index, baseComponentInfo.scaleFactor(
index));
#define DECLARE_ALGORITHM(classname)
std::map< DeltaEMode::Type, std::string > index
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A property class for workspaces.
const std::string name() const override
Algorithm's name for identification.
const std::string summary() const override
Summary of the algorithm's purpose.
void init() override
Initialize the algorithm's properties.
const std::string category() const override
Algorithm's category for identification.
void exec() override
Execute the algorithm.
int version() const override
Algorithm's version for identification.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
@ InOut
Both an input & output workspace.