14#include <boost/python/class.hpp>
15#include <boost/python/register_ptr_to_python.hpp>
29 PyErr_Warn(PyExc_DeprecationWarning,
"'IDetector.getID' is deprecated in Mantid 7.0, "
30 "use 'DetectorInfo.detectorIDs' instead. "
31 "For more information, see the instrument access layers concept page: "
32 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
36double solidAngleDeprecated(
const IDetector &self,
const V3D &observer) {
37 PyErr_Warn(PyExc_DeprecationWarning,
"'IDetector.solidAngle' is deprecated in Mantid 7.0, "
38 "use 'ComponentInfo.solidAngle' instead. "
39 "For more information, see the instrument access layers concept page: "
40 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
48double getTwoThetaDeprecated(
const IDetector &self,
const V3D &observer,
const V3D &axis) {
49 PyErr_Warn(PyExc_DeprecationWarning,
"'IDetector.getTwoTheta' is deprecated in Mantid 7.0, "
50 "use 'DetectorInfo.twoTheta' instead. "
51 "For more information, see the instrument access layers concept page: "
52 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
56double getPhiDeprecated(
const IDetector &self) {
57 PyErr_Warn(PyExc_DeprecationWarning,
"'IDetector.getPhi' is deprecated in Mantid 7.0, "
58 "use 'DetectorInfo.azimuthal' instead. "
59 "For more information, see the instrument access layers concept page: "
60 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
66 register_ptr_to_python<std::shared_ptr<IDetector>>();
67 register_ptr_to_python<std::shared_ptr<const IDetector>>();
69 class_<IDetector, bases<IObjComponent>, boost::noncopyable>(
"IDetector", no_init)
70 .def(
"getID", &getIDDeprecated, arg(
"self"),
"Returns the detector ID (deprecated, use DetectorInfo.detectorIDs)")
71 .def(
"solidAngle", &solidAngleDeprecated, (arg(
"self"), arg(
"observer")),
72 "Return the solid angle in steradians between this "
73 "detector and an observer (deprecated, use ComponentInfo.solidAngle)")
74 .def(
"getTwoTheta", &getTwoThetaDeprecated, (arg(
"self"), arg(
"observer"), arg(
"axis")),
75 "Calculate the angle between this detector, another component and "
76 "an axis (deprecated, use DetectorInfo.twoTheta)")
77 .def(
"getPhi", &getPhiDeprecated, arg(
"self"),
78 "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.