-
Notifications
You must be signed in to change notification settings - Fork 124
/
NotMD.cpp
50 lines (40 loc) · 1.87 KB
/
NotMD.cpp
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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidMDAlgorithms/NotMD.h"
#include "MantidKernel/System.h"
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid {
namespace MDAlgorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(NotMD)
//----------------------------------------------------------------------------------------------
/// Algorithm's name for identification. @see Algorithm::name
const std::string NotMD::name() const { return "NotMD"; }
/// Algorithm's version for identification. @see Algorithm::version
int NotMD::version() const { return 1; }
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
/// Check the inputs and throw if the algorithm cannot be run
void NotMD::checkInputs() {
if (!m_in_histo)
throw std::runtime_error(this->name() +
" can only be run on a MDHistoWorkspace.");
}
//----------------------------------------------------------------------------------------------
/// Run the algorithm on a MDEventWorkspace
void NotMD::execEvent(Mantid::API::IMDEventWorkspace_sptr /*out*/) {
throw std::runtime_error(this->name() +
" can only be run on a MDHistoWorkspace.");
}
//----------------------------------------------------------------------------------------------
/// NotMD::Run the algorithm with a MDHistoWorkspace
void NotMD::execHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out) {
out->operatorNot();
}
} // namespace MDAlgorithms
} // namespace Mantid