20#define DECLARE_PARAMETER(classname, classtype) \
22 Mantid::Kernel::RegistrationHelper register_par_##classname( \
23 ((Mantid::Geometry::ParameterFactory::subscribe<Mantid::Geometry::ParameterType<classtype>>(#classname)), 0)); \
33 std::ostringstream str;
34 if constexpr (std::is_same_v<Type, double> || std::is_same_v<Type, Kernel::V3D>) {
35 str << std::setprecision(std::numeric_limits<double>::digits10);
67 size_t pos = m_description.find(
'.');
68 if (pos == std::string::npos) {
69 return std::string(m_description);
72 return m_description.substr(0, pos + 1);
74 return std::string(
"");
87 const std::string &visible) {
88 std::shared_ptr<Parameter> p;
89 FactoryMap::const_iterator it =
s_map.find(className);
90 if (it !=
s_map.end())
91 p = it->second->createInstance();
93 throw std::runtime_error(
"ParameterFactory:" + className +
" is not registered.\n");
95 p->m_type = className;
96 p->m_visible = visible ==
"true" ? true :
false;
const std::string & m_value
#define DECLARE_PARAMETER(classname, classtype)
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
Store information about a fitting parameter such as its value if it is constrained or tied.
The ParameterFactory class creates parameters for the instrument ParameterMap.
static std::shared_ptr< Parameter > create(const std::string &className, const std::string &name, const std::string &visible="true")
Creates an instance of a parameter.
static FactoryMap s_map
The map holding the registered class names and their instantiators.
Templated class for parameters of type Type.
std::string asString() const override
Returns the value of the property as a string.
Base class for parameters of an instrument.