Mantid
Loading...
Searching...
No Matches
IDomainCreator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//----------------------------------------------------------------------
8// Includes
9//----------------------------------------------------------------------
10#include <utility>
11
13#include "MantidAPI/IFunction.h"
14#include "MantidAPI/Workspace.h"
15
16namespace Mantid::API {
17
27IDomainCreator::IDomainCreator(Kernel::IPropertyManager *manager, std::vector<std::string> workspacePropertyNames,
28 DomainType domainType)
29 : m_manager(manager), m_workspacePropertyNames(std::move(workspacePropertyNames)), m_domainType(domainType),
30 m_outputCompositeMembers(false), m_convolutionCompositeMembers(false), m_ignoreInvalidData(false) {}
31
46
52void IDomainCreator::declareProperty(Kernel::Property *prop, const std::string &doc) {
53 if (!m_manager) {
54 throw std::runtime_error("IDomainCreator: property manager isn't defined.");
55 }
56 m_manager->declareProperty(std::unique_ptr<Kernel::Property>(prop), doc);
57}
58
64 if (!function) {
65 throw std::runtime_error("IDomainCreator: cannot initialize empty function.");
66 }
67 if (!m_manager) {
68 throw std::runtime_error("IDomainCreator: property manager isn't defined.");
69 }
70 if (m_manager->existsProperty("InputWorkspace")) {
72 if (!workspace) {
73 throw std::runtime_error("IDomainCreator: cannot initialize function: workspace undefined.");
74 }
75 function->setWorkspace(workspace);
76 }
77}
78
79} // namespace Mantid::API
double value
The value of the point.
Definition FitMW.cpp:51
IPeaksWorkspace_sptr workspace
DomainType
Type of domain to create.
bool m_convolutionCompositeMembers
Perform convolution of output composite components.
virtual void initFunction(API::IFunction_sptr function)
Initialize the function.
bool m_outputCompositeMembers
Output separate composite function values.
Kernel::IPropertyManager * m_manager
Pointer to a property manager.
void declareProperty(Kernel::Property *prop, const std::string &doc)
Declare a property to the algorithm.
IDomainCreator(Kernel::IPropertyManager *manager, std::vector< std::string > workspacePropertyNames, DomainType domainType=Simple)
Constrcutor.
void separateCompositeMembersInOutput(const bool value, const bool conv=false)
Toggle output of either just composite or composite + members.
Interface to PropertyManager.
virtual bool existsProperty(const std::string &name) const =0
Checks whether the named property is already in the list of managed property.
virtual void declareProperty(std::unique_ptr< Property > p, const std::string &doc="")=0
Function to declare properties (i.e. store them)
virtual TypedValue getProperty(const std::string &name) const =0
Get the value of a property.
Base class for properties.
Definition Property.h:95
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition IFunction.h:749
STL namespace.