13#include "MantidPythonInterface/geometry/ComponentInfoPythonIterator.h"
15#include <boost/python/class.hpp>
16#include <boost/python/copy_const_reference.hpp>
17#include <boost/python/reference_existing_object.hpp>
18#include <boost/python/return_value_policy.hpp>
23using Mantid::PythonInterface::ComponentInfoPythonIterator;
30 return ComponentInfoPythonIterator(componentInfo);
45 class_<ComponentInfo, boost::noncopyable>(
"ComponentInfo", no_init)
54 "Checks if the component is a detector.")
57 (arg(
"self"), arg(
"index")),
58 "Returns a list of detectors in the subtree for the component "
59 "identified by 'index'.")
62 (arg(
"self"), arg(
"index")),
63 "Returns a list of components in the subtree for the component "
64 "identified by 'index'.")
66 .def(
"position",
position, (arg(
"self"), arg(
"index")),
67 "Returns the absolute position of the component identified by "
70 .def(
"rotation",
rotation, (arg(
"self"), arg(
"index")),
71 "Returns the absolute rotation of the component identified by "
75 "Returns the absolute relative position of the component identified "
79 "Returns the absolute relative rotation of the component identified "
82 .def(
"setPosition",
setPosition, (arg(
"self"), arg(
"index"), arg(
"newPosition")),
83 "Set the absolute position of the component identified by 'index'.")
85 .def(
"setRotation",
setRotation, (arg(
"self"), arg(
"index"), arg(
"newRotation")),
86 "Set the absolute rotation of the component identified by 'index'.")
91 "Returns True is both beamlines either lack a Source or "
92 "have a Source at the same position.")
97 "Returns True is both beamlines either lack a Sample or "
98 "have a Sample at the same position.")
109 "Returns True only if the component identified by 'index' has a "
113 "Returns the parent component of the component identified by "
118 "Returns a list of child components for the component identified by "
121 .def(
"name", &
ComponentInfo::name, (arg(
"self"), arg(
"index")), return_value_policy<copy_const_reference>(),
122 "Returns the name of the component identified by 'index'.")
127 "Returns the scale factor for the component identified by 'index'.")
130 "Set the scale factor of the component identifed by 'index'.")
133 "Returns True if the component identified by 'index' has a valid "
137 return_value_policy<reference_existing_object>(),
138 "Returns the shape of the component identified by 'index'.")
141 "Returns the index of any component matching name. Raises "
142 "ValueError if name not found")
145 "Returns True if the name is a unique single occurance. Zero occurances yields False.")
147 .def(
"root", &
ComponentInfo::root, arg(
"self"),
"Returns the index of the root component");
SpectrumInfoPythonIterator make_pyiterator(SpectrumInfo &spectrumInfo)
void export_ComponentInfo()
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
void(ComponentInfo::* setPosition)(const size_t, const Mantid::Kernel::V3D &)
void(ComponentInfo::* setRotation)(const size_t, const Mantid::Kernel::Quat &)
Mantid::Kernel::V3D(ComponentInfo::* position)(const size_t) const
ComponentInfo : Provides a component centric view on to the instrument.
bool hasParent(const size_t componentIndex) const
size_t indexOfAny(const std::string &name) const
void setRotation(size_t componentIndex, const Kernel::Quat &newRotation)
bool hasEquivalentSource(const ComponentInfo &other) const
size_t parent(const size_t componentIndex) const
Kernel::Quat rotation(const size_t componentIndex) const
Kernel::V3D position(const size_t componentIndex) const
const std::vector< size_t > & children(size_t componentIndex) const
std::vector< size_t > componentsInSubtree(size_t componentIndex) const
bool hasValidShape(const size_t componentIndex) const
Kernel::V3D sourcePosition() const
bool hasEquivalentSample(const ComponentInfo &other) const
void setScaleFactor(const size_t componentIndex, const Kernel::V3D &scaleFactor)
std::vector< size_t > detectorsInSubtree(size_t componentIndex) const
bool isDetector(const size_t componentIndex) const
bool uniqueName(const std::string &name) const
Kernel::V3D relativePosition(const size_t componentIndex) const
const std::string & name(const size_t componentIndex) const
Kernel::Quat relativeRotation(const size_t componentIndex) const
void setPosition(size_t componentIndex, const Kernel::V3D &newPosition)
Kernel::V3D samplePosition() const
const Geometry::IObject & shape(const size_t componentIndex) const
Kernel::V3D scaleFactor(const size_t componentIndex) const
Implements a return value policy that returns a numpy array from a rerence to a std::vector.