Mantid
Loading...
Searching...
No Matches
Units.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#include "MantidKernel/Unit.h"
8
9#include <boost/python/class.hpp>
10
13using namespace Mantid::Kernel::Units;
14using namespace boost::python;
15
16namespace {
24void setLabelFromStdString(Label &self, const std::string &caption, const std::string &label) {
25 self.setLabel(caption, label);
26}
27} // namespace
28
29// We only export the concrete unit classes that
30// have additional functionality over the base class
32 class_<Label, bases<Unit>, boost::noncopyable>("Label", no_init)
33 .def("setLabel", &setLabelFromStdString, (arg("self"), arg("caption"), arg("label")),
34 "Set the caption (e.g.Temperature) & label (K) on the unit")
35
36 .def("setLabel", (void (Label::*)(const std::string &, const UnitLabel &)) & Label::setLabel,
37 (arg("self"), arg("caption"), arg("label")),
38 "Set the caption (e.g.Temperature) "
39 "& label (K) on the unit, See the "
40 "UnitLabel class");
41}
void export_Label()
Definition: Units.cpp:31
A base-class for the a class that is able to return unit labels in different representations.
Definition: UnitLabel.h:20
The base units (abstract) class.
Definition: Unit.h:41
void setLabel(const std::string &cpt, const UnitLabel &lbl=UnitLabel(""))
Set a caption and a label.
Definition: Unit.cpp:264
The namespace for concrete units classes.
Definition: IQTransform.h:18