Mantid
Loading...
Searching...
No Matches
IComponent.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include "MantidKernel/Quat.h"
10
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>
15
17using namespace boost::python;
18
20
21namespace {
33double getDistance(const IComponent &self, const IComponent &other) { return self.getDistance(other); }
34} // namespace
35
37 register_ptr_to_python<std::shared_ptr<IComponent>>();
38 register_ptr_to_python<std::shared_ptr<const IComponent>>();
39
40 class_<IComponent, boost::noncopyable>("IComponent", no_init)
41 .def("getPos", &IComponent::getPos, arg("self"), "Returns the absolute position of the component")
42 .def("getDistance", &getDistance, (arg("self"), arg("other")),
43 "Returns the distance, in metres, "
44 "between this and the given component")
45 .def("getName", &IComponent::getName, arg("self"), "Returns the name of the component")
46 .def("getFullName", &IComponent::getFullName, arg("self"), "Returns full path name of component")
47 .def("type", &IComponent::type, arg("self"), "Returns the type of the component represented as a string")
48 .def("getRelativeRot", &IComponent::getRelativeRot, arg("self"), "Returns the relative rotation as a Quat");
49}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
void export_IComponent()
Definition: IComponent.cpp:36
base class for Geometric IComponent
Definition: IComponent.h:51
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.
Definition: IComponent.h:54
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.