Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
geometry
src
Exports
ComponentInfoItem.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 "
MantidGeometry/Instrument/ComponentInfoItem.h
"
8
#include "
MantidGeometry/Instrument/ComponentInfo.h
"
9
#include "
MantidKernel/Quat.h
"
10
#include "
MantidKernel/V3D.h
"
11
#include "
MantidPythonInterface/core/Converters/WrapWithNDArray.h
"
12
#include "
MantidPythonInterface/core/Policies/VectorToNumpy.h
"
13
#include <boost/python/class.hpp>
14
#include <boost/python/make_function.hpp>
15
#include <boost/python/module.hpp>
16
17
using
Mantid::Geometry::ComponentInfo
;
18
using
Mantid::Geometry::ComponentInfoItem
;
19
using
Mantid::Kernel::V3D
;
20
using namespace
boost::python
;
21
using namespace
Mantid::PythonInterface::Converters
;
22
using namespace
Mantid::PythonInterface::Policies
;
23
24
// Export DetectorInfoItem
25
void
export_ComponentInfoItem
() {
26
27
// Export to Python
28
class_<ComponentInfoItem<ComponentInfo>>(
"ComponentInfoItem"
, no_init)
29
.add_property(
"isDetector"
, &
ComponentInfoItem<ComponentInfo>::isDetector
)
30
.add_property(
"componentsInSubtree"
, make_function(&
ComponentInfoItem<ComponentInfo>::componentsInSubtree
,
31
return_value_policy<VectorToNumpy>()))
32
.add_property(
"detectorsInSubtree"
, make_function(&
ComponentInfoItem<ComponentInfo>::detectorsInSubtree
,
33
return_value_policy<VectorToNumpy>()))
34
.add_property(
"position"
, &
ComponentInfoItem<ComponentInfo>::position
)
35
.add_property(
"rotation"
, &
ComponentInfoItem<ComponentInfo>::rotation
)
36
.add_property(
"parent"
, &
ComponentInfoItem<ComponentInfo>::parent
)
37
.add_property(
"hasParent"
, &
ComponentInfoItem<ComponentInfo>::hasParent
)
38
.add_property(
"scaleFactor"
, &
ComponentInfoItem<ComponentInfo>::scaleFactor
)
39
.add_property(
"name"
, &
ComponentInfoItem<ComponentInfo>::name
)
40
.add_property(
"children"
, make_function(&
ComponentInfoItem<ComponentInfo>::children
,
41
return_value_policy<
VectorRefToNumpy<WrapReadOnly>
>()))
42
.add_property(
"index"
, &
ComponentInfoItem<ComponentInfo>::index
);
43
}
export_ComponentInfoItem
void export_ComponentInfoItem()
Definition:
ComponentInfoItem.cpp:25
ComponentInfoItem.h
ComponentInfo.h
Quat.h
V3D.h
VectorToNumpy.h
WrapWithNDArray.h
Mantid::Geometry::ComponentInfoItem
ComponentInfoItem Return type for ComponentInfoIterators.
Definition:
ComponentInfoItem.h:20
Mantid::Geometry::ComponentInfo
ComponentInfo : Provides a component centric view on to the instrument.
Definition:
ComponentInfo.h:40
Mantid::Kernel::V3D
Class for 3D vectors.
Definition:
V3D.h:34
Mantid::PythonInterface::Converters
Definition:
CArrayToNDArray.h:14
Mantid::PythonInterface::Policies
Definition:
AsType.h:20
boost::python
Definition:
NDArray.h:50
Mantid::PythonInterface::Policies::VectorRefToNumpy
Implements a return value policy that returns a numpy array from a rerence to a std::vector.
Definition:
VectorToNumpy.h:63
Generated on Tue Jan 3 2023 11:57:59 for Mantid by
1.9.5