-
Notifications
You must be signed in to change notification settings - Fork 122
/
SetSample.h
72 lines (66 loc) · 3.73 KB
/
SetSample.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/Algorithm.h"
#include "MantidDataHandling/DllConfig.h"
#include "MantidDataHandling/ReadMaterial.h"
#include "MantidKernel/PropertyManager_fwd.h"
namespace Mantid {
namespace Geometry {
class ReferenceFrame;
class SampleEnvironment;
} // namespace Geometry
namespace API {
class ExperimentInfo;
} // namespace API
namespace DataHandling {
/**
High-level interface for setting sample metadata on a workspace.
*/
class MANTID_DATAHANDLING_DLL SetSample final : public API::Algorithm {
public:
const std::string name() const override final;
int version() const override final;
const std::vector<std::string> seeAlso() const override {
return {"SetSampleMaterial", "CreateSampleShape", "CopySample", "SetBeam"};
}
const std::string category() const override final;
const std::string summary() const override final;
private:
std::map<std::string, std::string> validateInputs() override final;
void init() override final;
void exec() override final;
const Geometry::SampleEnvironment *setSampleEnvironmentFromFile(API::ExperimentInfo &experiment,
const Kernel::PropertyManager_const_sptr &args);
const Geometry::SampleEnvironment *
setSampleEnvironmentFromXML(API::ExperimentInfo &experiment,
const Kernel::PropertyManager_const_sptr &canGeometryArgs,
const Kernel::PropertyManager_const_sptr &canMaterialArgs);
void setSampleShape(API::ExperimentInfo &experiment, const Kernel::PropertyManager_const_sptr &args,
const Geometry::SampleEnvironment *sampleEnv);
std::string tryCreateXMLFromArgsOnly(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame);
std::string createFlatPlateXML(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame,
const std::string &id = "sample-shape") const;
std::string createFlatPlateHolderXML(const Kernel::PropertyManager &args,
const Geometry::ReferenceFrame &refFrame) const;
std::string createHollowCylinderHolderXML(const Kernel::PropertyManager &args,
const Geometry::ReferenceFrame &refFrame) const;
std::string createCylinderLikeXML(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame,
bool hollow, const std::string &id = "sample-shape") const;
std::string createSphereXML(const Kernel::PropertyManager &args) const;
void validateGeometry(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &args,
const std::string &flavour);
void validateMaterial(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &inputArgs,
const std::string &flavour);
void assertNonNegative(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &args,
const std::string &flavour, const std::vector<const std::string *> &keys);
void setMaterial(ReadMaterial::MaterialParameters &materialParams, const Kernel::PropertyManager &materialArgs);
Kernel::PropertyManager materialSettingsEnsureLegacyCompatibility(const Kernel::PropertyManager &materialArgs);
bool isDictionaryPopulated(const Kernel::PropertyManager_const_sptr &dict) const;
};
} // namespace DataHandling
} // namespace Mantid