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>
54std::string getNameDeprecated(
const IComponent &self) {
66std::string getFullNameDeprecated(
const IComponent &self) {
78std::string typeDeprecated(
const IComponent &self) {
91 if (PyErr_Warn(PyExc_DeprecationWarning,
92 "'IComponent.getRelativeRot' is deprecated in Mantid 7.0, "
93 "use 'ComponentInfo.relativeRotation' instead. "
94 "For more information, see the instrument access layers concept page: "
95 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html") < 0)
96 throw boost::python::error_already_set();
102 register_ptr_to_python<std::shared_ptr<IComponent>>();
103 register_ptr_to_python<std::shared_ptr<const IComponent>>();
105 class_<IComponent, boost::noncopyable>(
"IComponent", no_init)
106 .def(
"getPos", &getPosDeprecated, arg(
"self"),
107 "Returns the absolute position of the component (deprecated, use ComponentInfo.position)")
108 .def(
"getDistance", &getDistance, (arg(
"self"), arg(
"other")),
109 "Returns the distance, in metres, "
110 "between this and the given component")
111 .def(
"getName", &getNameDeprecated, arg(
"self"),
112 "Returns the name of the component (deprecated, use ComponentInfo.name)")
113 .def(
"getFullName", &getFullNameDeprecated, arg(
"self"),
114 "Returns full path name of component (deprecated, use ComponentInfo.name)")
115 .def(
"type", &typeDeprecated, arg(
"self"),
116 "Returns the type of the component represented as a string "
117 "(deprecated, use ComponentInfo.componentType)")
118 .def(
"getRelativeRot", &getRelativeRotDeprecated, arg(
"self"),
119 "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.