Skip to content
Snippets Groups Projects
Commit ca461435 authored by Pete Peterson's avatar Pete Peterson
Browse files

Merge pull request #773 from mantidproject/python_expose_Icomponent_Rot_RelRot_RelPos

Expose to python getRot, getRelRot and getRelPos for instrument components
parents 02190bfc 3e98e070
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ namespace
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getStringParameter,Component::getStringParameter,1,2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getIntParameter,Component::getIntParameter,1,2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterType,Component::getParameterType,1,2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRotation,Component::getRotation,0,0)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRelativePos,Component::getRelativePos,0,0)
}
......@@ -35,6 +37,8 @@ void export_Component()
.def("getRotationParameter", &Component::getRotationParameter, Component_getRotationParameter())
.def("getStringParameter", &Component::getStringParameter, Component_getStringParameter())
.def("getIntParameter", &Component::getIntParameter, Component_getIntParameter())
.def("getRotation", &Component::getRotation, Component_getRotation())
.def("getRelativePos", &Component::getRelativePos, Component_getRelativePos())
// HACK -- python should return parameters regardless of type. this is untill rows below do not work
.def("getParameterType", &Component::getParameterType, Component_getParameterType())
//// this does not work for some obvious or not obvious reasons
......
......@@ -2,6 +2,8 @@
#include <boost/python/class.hpp>
#include <boost/python/register_ptr_to_python.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/return_value_policy.hpp>
using Mantid::Geometry::IComponent;
using namespace boost::python;
......@@ -37,6 +39,7 @@ void export_IComponent()
.def("getName", &IComponent::getName, "Returns the name of the component")
.def("getFullName", &IComponent::getFullName,"Returns full path name of component")
.def("type", &IComponent::type, "Returns the type of the component represented as a string")
.def("getRelativeRot", &IComponent::getRelativeRot,return_value_policy<copy_const_reference>(), "Returns the relative rotation as a Quat")
;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment