11#include <boost/python/class.hpp>
12#include <boost/python/copy_const_reference.hpp>
13#include <boost/python/register_ptr_to_python.hpp>
14#include <boost/python/return_value_policy.hpp>
43 PyErr_Warn(PyExc_DeprecationWarning,
"'IComponent.getPos' is deprecated in Mantid 7.0, "
44 "use 'ComponentInfo.position' instead. "
45 "For more information, see the instrument access layers concept page: "
46 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
50std::string getNameDeprecated(
const IComponent &self) {
51 PyErr_Warn(PyExc_DeprecationWarning,
"'IComponent.getName' is deprecated in Mantid 7.0, "
52 "use 'ComponentInfo.name' instead. "
53 "For more information, see the instrument access layers concept page: "
54 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
58std::string getFullNameDeprecated(
const IComponent &self) {
59 PyErr_Warn(PyExc_DeprecationWarning,
"'IComponent.getFullName' is deprecated in Mantid 7.0, "
60 "use 'ComponentInfo.name' instead. "
61 "For more information, see the instrument access layers concept page: "
62 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
66std::string typeDeprecated(
const IComponent &self) {
67 PyErr_Warn(PyExc_DeprecationWarning,
"'IComponent.type' is deprecated in Mantid 7.0, "
68 "use 'ComponentInfo.componentType' instead. "
69 "For more information, see the instrument access layers concept page: "
70 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
75 PyErr_Warn(PyExc_DeprecationWarning,
"'IComponent.getRelativeRot' is deprecated in Mantid 7.0, "
76 "use 'ComponentInfo.relativeRotation' instead. "
77 "For more information, see the instrument access layers concept page: "
78 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
84 register_ptr_to_python<std::shared_ptr<IComponent>>();
85 register_ptr_to_python<std::shared_ptr<const IComponent>>();
87 class_<IComponent, boost::noncopyable>(
"IComponent", no_init)
88 .def(
"getPos", &getPosDeprecated, arg(
"self"),
89 "Returns the absolute position of the component (deprecated, use ComponentInfo.position)")
90 .def(
"getDistance", &getDistance, (arg(
"self"), arg(
"other")),
91 "Returns the distance, in metres, "
92 "between this and the given component")
93 .def(
"getName", &getNameDeprecated, arg(
"self"),
94 "Returns the name of the component (deprecated, use ComponentInfo.name)")
95 .def(
"getFullName", &getFullNameDeprecated, arg(
"self"),
96 "Returns full path name of component (deprecated, use ComponentInfo.name)")
97 .def(
"type", &typeDeprecated, arg(
"self"),
98 "Returns the type of the component represented as a string "
99 "(deprecated, use ComponentInfo.componentType)")
100 .def(
"getRelativeRot", &getRelativeRotDeprecated, arg(
"self"),
101 "Returns the relative rotation as a Quat (deprecated, use ComponentInfo.relativeRotation)");
#define GET_POINTER_SPECIALIZATION(TYPE)
base class for Geometric IComponent
virtual Kernel::V3D getPos() const =0
Get the position of the IComponent. Tree structure is traverse through the.
virtual std::string type() const
Returns a string representation of the IComponent type.
virtual double getDistance(const IComponent &) const =0
Get the distance to another IComponent.
virtual Kernel::Quat getRelativeRot() const =0
Get the relative Orientation.
virtual std::string getFullName() const =0
Get the IComponent full path name.
virtual std::string getName() const =0
Get the IComponent name.