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/Workspace.h"
14
15namespace Mantid::API {
16
26IDomainCreator::IDomainCreator(Kernel::IPropertyManager *manager, std::vector<std::string> workspacePropertyNames,
27 DomainType domainType)
28 : m_manager(manager), m_workspacePropertyNames(std::move(workspacePropertyNames)), m_domainType(domainType),
29 m_outputCompositeMembers(false), m_convolutionCompositeMembers(false), m_ignoreInvalidData(false) {}
30
44}
45
51void IDomainCreator::declareProperty(Kernel::Property *prop, const std::string &doc) {
52 if (!m_manager) {
53 throw std::runtime_error("IDomainCreator: property manager isn't defined.");
54 }
55 m_manager->declareProperty(std::unique_ptr<Kernel::Property>(prop), doc);
56}
57
63 if (!function) {
64 throw std::runtime_error("IDomainCreator: cannot initialize empty function.");
65 }
66 if (!m_manager) {
67 throw std::runtime_error("IDomainCreator: property manager isn't defined.");
68 }
69 if (m_manager->existsProperty("InputWorkspace")) {
71 if (!workspace) {
72 throw std::runtime_error("IDomainCreator: cannot initialize function: workspace undefined.");
73 }
74 function->setWorkspace(workspace);
75 }
76}
77
78} // namespace Mantid::API
double value
The value of the point.
Definition: FitMW.cpp:51
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
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:94
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
STL namespace.