14#include <boost/python/class.hpp>
15#include <boost/python/register_ptr_to_python.hpp>
40double solidAngleDeprecated(
const IDetector &self,
const V3D &observer) {
41 if (PyErr_Warn(PyExc_DeprecationWarning,
42 "'IDetector.solidAngle' is deprecated in Mantid 7.0, "
43 "use 'ComponentInfo.solidAngle' instead. "
44 "For more information, see the instrument access layers concept page: "
45 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html") < 0)
46 throw boost::python::error_already_set();
54double getTwoThetaDeprecated(
const IDetector &self,
const V3D &observer,
const V3D &axis) {
55 if (PyErr_Warn(PyExc_DeprecationWarning,
56 "'IDetector.getTwoTheta' is deprecated in Mantid 7.0, "
57 "use 'DetectorInfo.twoTheta' instead. "
58 "For more information, see the instrument access layers concept page: "
59 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html") < 0)
60 throw boost::python::error_already_set();
64double getPhiDeprecated(
const IDetector &self) {
65 if (PyErr_Warn(PyExc_DeprecationWarning,
66 "'IDetector.getPhi' is deprecated in Mantid 7.0, "
67 "use 'DetectorInfo.azimuthal' instead. "
68 "For more information, see the instrument access layers concept page: "
69 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html") < 0)
70 throw boost::python::error_already_set();
76 register_ptr_to_python<std::shared_ptr<IDetector>>();
77 register_ptr_to_python<std::shared_ptr<const IDetector>>();
79 class_<IDetector, bases<IObjComponent>, boost::noncopyable>(
"IDetector", no_init)
80 .def(
"getID", &getIDDeprecated, arg(
"self"),
"Returns the detector ID (deprecated, use DetectorInfo.detectorIDs)")
81 .def(
"solidAngle", &solidAngleDeprecated, (arg(
"self"), arg(
"observer")),
82 "Return the solid angle in steradians between this "
83 "detector and an observer (deprecated, use ComponentInfo.solidAngle)")
84 .def(
"getTwoTheta", &getTwoThetaDeprecated, (arg(
"self"), arg(
"observer"), arg(
"axis")),
85 "Calculate the angle between this detector, another component and "
86 "an axis (deprecated, use DetectorInfo.twoTheta)")
87 .def(
"getPhi", &getPhiDeprecated, arg(
"self"),
88 "Returns the azimuthal angle of this detector (deprecated, use DetectorInfo.azimuthal)");
#define GET_POINTER_SPECIALIZATION(TYPE)
std::map< DeltaEMode::Type, std::string > index
size_t indexOf(const detid_t id) const
Returns the index of the detector with the given detector ID.
Interface class for detector objects.
virtual double getPhi() const =0
Gives the phi of this detector object in radians.
virtual double getTwoTheta(const Kernel::V3D &observer, const Kernel::V3D &axis) const =0
Gives the angle of this detector object with respect to an axis.
virtual detid_t getID() const =0
Get the detector ID.
virtual const ParameterMap & parameterMap() const =0
Helper for legacy access mode. Returns a reference to the ParameterMap.
Object Component class, this class brings together the physical attributes of the component to the po...
const Geometry::DetectorInfo & detectorInfo() const
Only for use by ExperimentInfo. Returns a reference to the DetectorInfo.
int32_t detid_t
Typedef for a detector ID.