Mantid
Loading...
Searching...
No Matches
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 +
9#include "MantidKernel/Quat.h"
10#include "MantidKernel/V3D.h"
13#include <boost/python/class.hpp>
14#include <boost/python/make_function.hpp>
15#include <boost/python/module.hpp>
16
20using namespace boost::python;
23
24// Export DetectorInfoItem
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}
void export_ComponentInfoItem()
ComponentInfoItem Return type for ComponentInfoIterators.
ComponentInfo : Provides a component centric view on to the instrument.
Definition: ComponentInfo.h:40
Class for 3D vectors.
Definition: V3D.h:34
Implements a return value policy that returns a numpy array from a rerence to a std::vector.
Definition: VectorToNumpy.h:63