Mantid
Loading...
Searching...
No Matches
DeltaEMode.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 +
9
10#include <boost/python/class.hpp>
11#include <boost/python/enum.hpp>
12#include <boost/python/return_value_policy.hpp>
13
16using namespace boost::python;
17
19 enum_<Mantid::Kernel::DeltaEMode::Type>("DeltaEModeType")
20 .value("Elastic", DeltaEMode::Elastic)
21 .value("Direct", DeltaEMode::Direct)
22 .value("Indirect", DeltaEMode::Indirect)
23 .export_values();
24
25 class_<DeltaEMode, boost::noncopyable>("DeltaEMode", no_init)
26 .def("asString", &DeltaEMode::asString, arg("self"), "Returns the given type translated to a string")
27 .def("fromString", &DeltaEMode::fromString, arg("modeStr"),
28 "Returns the enumerated type translated from a string")
29 .def("availableTypes", &DeltaEMode::availableTypes, return_value_policy<Policies::VectorToNumpy>(),
30 "Returns a list of known delta E Modes as strings")
31 .staticmethod("availableTypes");
32}
void export_DeltaEMode()
Definition: DeltaEMode.cpp:18
Defines the possible energy transfer modes:
Definition: DeltaEMode.h:23
static std::string asString(const Type mode)
Return a string representation of the given mode.
Definition: DeltaEMode.cpp:52
static const std::vector< std::string > availableTypes()
Returns the string list of available modes.
Definition: DeltaEMode.cpp:35
static Type fromString(const std::string &modeStr)
Returns the emode from the given string.
Definition: DeltaEMode.cpp:69