Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
kernel
src
Exports
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
11
using
Mantid::Kernel::Unit
;
12
using
Mantid::Kernel::UnitLabel
;
13
using namespace
Mantid::Kernel::Units
;
14
using namespace
boost::python
;
15
16
namespace
{
24
void
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
31
void
export_Label
() {
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
}
Unit.h
export_Label
void export_Label()
Definition
Units.cpp:31
Mantid::Kernel::UnitLabel
A base-class for the a class that is able to return unit labels in different representations.
Definition
UnitLabel.h:20
Mantid::Kernel::Unit
The base units (abstract) class.
Definition
Unit.h:41
Mantid::Kernel::Units::Label
Label unit.
Definition
Unit.h:228
Mantid::Kernel::Units::Label::setLabel
void setLabel(const std::string &cpt, const UnitLabel &lbl=UnitLabel(""))
Set a caption and a label.
Definition
Unit.cpp:265
Mantid::Kernel::Units
The namespace for concrete units classes.
Definition
IQTransform.h:18
boost::python
Definition
NDArray.h:50
Generated by
1.9.8