Mantid
Loading...
Searching...
No Matches
IObjComponent.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 +
9#include <boost/python/class.hpp>
10#include <boost/python/register_ptr_to_python.hpp>
11
14using namespace boost::python;
15
17
18namespace {
26std::shared_ptr<Mantid::Geometry::IObject> getShape(const IObjComponent &self) {
27 PyErr_Warn(PyExc_DeprecationWarning, "'IObjComponent.shape' is deprecated in Mantid 7.0, "
28 "use 'ComponentInfo.shape' instead. "
29 "For more information, see the instrument access layers concept page: "
30 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
31 return std::const_pointer_cast<Mantid::Geometry::IObject>(self.shape());
32}
33} // namespace
34
36 register_ptr_to_python<std::shared_ptr<IObjComponent>>();
37
38 class_<IObjComponent, boost::python::bases<IComponent>, boost::noncopyable>("IObjComponent", no_init)
39 .def("shape", &getShape, arg("self"),
40 "Get the object that represents "
41 "the physical shape of this "
42 "component (deprecated, use ComponentInfo.shape)");
43}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition GetPointer.h:17
void export_IObjComponent()
base class for Geometric IComponent
Definition IComponent.h:53
Object Component class, this class brings together the physical attributes of the component to the po...
virtual const std::shared_ptr< const IObject > shape() const =0
Returns the shape of the Object.