Skip to content

Commit

Permalink
Re #766. Exposing shared_ptr<Quat> and vector<Quat> in python.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed May 19, 2015
1 parent 8b00f93 commit fb06545
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -2,8 +2,9 @@
#include "MantidKernel/V3D.h"
#include <boost/python/class.hpp>
#include <boost/python/operators.hpp>
#include <boost/python/return_value_policy.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/register_ptr_to_python.hpp>
#include <boost/python/return_value_policy.hpp>

using Mantid::Kernel::Quat;
using Mantid::Kernel::V3D;
Expand All @@ -22,6 +23,8 @@ using boost::python::return_value_policy;
void export_Quat()
// clang-format on
{
boost::python::register_ptr_to_python<boost::shared_ptr<Quat> >();

//Quat class
class_< Quat >("Quat", "Quaternions are the 3D generalization of complex numbers. "
"Quaternions are used for roations in 3D spaces and often implemented for "
Expand Down
@@ -1,6 +1,7 @@
#include "MantidPythonInterface/kernel/StlExportDefinitions.h"

#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/Quat.h"

using Mantid::PythonInterface::std_vector_exporter;
using Mantid::PythonInterface::std_set_exporter;
Expand All @@ -18,6 +19,7 @@ void exportStlContainers()
std_vector_exporter<bool>::wrap("std_vector_bool");
std_vector_exporter<std::string>::wrap("std_vector_str");
std_vector_exporter<Mantid::Kernel::DateAndTime>::wrap("std_vector_dateandtime");
std_vector_exporter<Mantid::Kernel::Quat>::wrap("std_vector_quat");
//std::set
std_set_exporter<int>::wrap("std_set_int");
std_set_exporter<std::string>::wrap("std_set_str");
Expand Down

0 comments on commit fb06545

Please sign in to comment.