11#include "MantidIndexing/IndexInfo.h"
14HistogramData::Histogram
stripData(HistogramData::Histogram histogram) {
15 histogram.setSharedY(
nullptr);
16 histogram.setSharedE(
nullptr);
20template <> std::unique_ptr<EventWorkspace>
createHelper() {
return {
nullptr}; }
22template <> std::unique_ptr<API::HistoWorkspace>
createHelper() {
return std::make_unique<Workspace2D>(); }
24template <> std::unique_ptr<API::MatrixWorkspace>
createHelper() {
return {
nullptr}; }
27 throw std::runtime_error(
"Attempt to create instance of abstract type MatrixWorkspace");
30 throw std::runtime_error(
"Attempt to create instance of abstract type HistoWorkspace");
33template <
class UseIndexInfo>
35 const bool differentSize) {
50 const bool differentSize) {
54 static_cast<void>(differentSize);
72 bool differentSize = (parent.
x(0).size() != ws.
x(0).size()) || (parent.
y(0).size() != ws.
y(0).size());
73 doInitializeFromParent<UseIndexInfo>(parent, ws, differentSize);
81 workspace.setDistribution(histArg.yMode() == HistogramData::Histogram::YMode::Frequencies);
IPeaksWorkspace_sptr workspace
Base MatrixWorkspace Abstract Class.
HistogramData::HistogramX & mutableX(const size_t index) &
const HistogramData::HistogramX & x(const size_t index) const
const Indexing::IndexInfo & indexInfo() const
Returns a const reference to the IndexInfo object of the workspace.
const HistogramData::HistogramY & y(const size_t index) const
void setIndexInfo(const Indexing::IndexInfo &indexInfo)
Sets the IndexInfo object of the workspace.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Factory methods for creating MatrixWorkspaces.
void doInitializeFromParent(const API::MatrixWorkspace &parent, API::MatrixWorkspace &workspace, const bool differentSize)
template void MANTID_DATAOBJECTS_DLL initializeFromParent< std::false_type >(const API::MatrixWorkspace &, API::MatrixWorkspace &)
void doInitializeFromParent< std::true_type >(const API::MatrixWorkspace &parent, API::MatrixWorkspace &child, const bool differentSize)
Same as WorkspaceFactory::initializeFromParent, with modifications for changed IndexInfo.
MANTID_DATAOBJECTS_DLL HistogramData::Histogram stripData(HistogramData::Histogram histogram)
void initializeFromParent(const API::MatrixWorkspace &parent, API::MatrixWorkspace &workspace)
Initialize a MatrixWorkspace from its parent including instrument, unit, number of spectra and Run.
std::unique_ptr< T > createHelper()
std::unique_ptr< T > createConcreteHelper()
template void MANTID_DATAOBJECTS_DLL initializeFromParent< std::true_type >(const API::MatrixWorkspace &, API::MatrixWorkspace &)
void fixDistributionFlag(API::MatrixWorkspace &, const HistArg &)