diff --git a/Device/Detector/OffspecDetector.cpp b/Device/Detector/OffspecDetector.cpp index 4ec7b9c6e882c35be1c64a01bcfd60816e10f46f..055d4399b565d680a962b81dff12007fcebf47f5 100644 --- a/Device/Detector/OffspecDetector.cpp +++ b/Device/Detector/OffspecDetector.cpp @@ -17,8 +17,6 @@ #include "Base/Axis/FixedBinAxis.h" #include "Base/Pixel/SphericalPixel.h" #include "Base/Util/Assert.h" -#include "Device/Beam/Beam.h" -#include "Device/Coord/CoordSystem2D.h" OffspecDetector::OffspecDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) @@ -95,12 +93,6 @@ size_t OffspecDetector::indexOfSpecular(double alpha, double phi) const return totalSize(); } -const ICoordSystem* OffspecDetector::offspecCoords(IAxis* beamAxis) const -{ - std::vector<const IAxis*> axes2({beamAxis, m_axes[1]->clone()}); - return new OffspecCoords(axes2); -} - size_t OffspecDetector::getGlobalIndex(size_t x, size_t y) const { return x * axis(1).size() + y; diff --git a/Device/Detector/OffspecDetector.h b/Device/Detector/OffspecDetector.h index 8b9422bba6602daa26a90840c458463708741beb..9d5ac9a582ad38012151830fed8c722fe8819013 100644 --- a/Device/Detector/OffspecDetector.h +++ b/Device/Detector/OffspecDetector.h @@ -20,10 +20,7 @@ #include "Device/Pol/PolFilter.h" #include "Param/Node/INode.h" -class Beam; -class CoordSystem2D; class IAxis; -class ICoordSystem; class IDetectorResolution; class IPixel; @@ -71,8 +68,6 @@ public: //! Returns default axes units Coords defaultCoords() const { return Coords::RADIANS; } - const ICoordSystem* offspecCoords(IAxis* beamAxis) const; - //! Creates an IPixel for the given Datafield object and index IPixel* createPixel(size_t index) const; diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp index b615cd96ee49d6502fa2aab8654c34ca1ceaa2c2..fd59550c4576b6fb822918c76a5055442f61478b 100644 --- a/GUI/Model/Device/InstrumentItems.cpp +++ b/GUI/Model/Device/InstrumentItems.cpp @@ -548,7 +548,7 @@ const ICoordSystem* OffspecInstrumentItem::createCoordSystem() const m_alphaAxis.max() * Units::deg); auto d = detectorItem()->createOffspecDetector(); - return d->offspecCoords(alphaAxis); + return new OffspecCoords(std::vector<const IAxis*>{alphaAxis, d->axis(1).clone()}); } ISimulation* OffspecInstrumentItem::createSimulation(const MultiLayer& sample) const diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 3584b7089b12744744ac8082706aee96012d281c..8482dfe9f1c57ba9bf1137de6f09c2c069ab07a2 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2986,10 +2986,6 @@ class OffspecDetector(libBornAgainParam.INode): r"""defaultCoords(OffspecDetector self) -> Coords""" return _libBornAgainDevice.OffspecDetector_defaultCoords(self) - def offspecCoords(self, beamAxis): - r"""offspecCoords(OffspecDetector self, IAxis beamAxis) -> ICoordSystem const *""" - return _libBornAgainDevice.OffspecDetector_offspecCoords(self, beamAxis) - def createPixel(self, index): r"""createPixel(OffspecDetector self, size_t index) -> IPixel *""" return _libBornAgainDevice.OffspecDetector_createPixel(self, index) diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index 65e6116a5fbef20a446904265ce168a1e118f085..3b2a7cca45dc7c123ef86c73a701432ee42f1451 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -35950,36 +35950,6 @@ fail: } -SWIGINTERN PyObject *_wrap_OffspecDetector_offspecCoords(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - OffspecDetector *arg1 = (OffspecDetector *) 0 ; - IAxis *arg2 = (IAxis *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - ICoordSystem *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "OffspecDetector_offspecCoords", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OffspecDetector, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OffspecDetector_offspecCoords" "', argument " "1"" of type '" "OffspecDetector const *""'"); - } - arg1 = reinterpret_cast< OffspecDetector * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_IAxis, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OffspecDetector_offspecCoords" "', argument " "2"" of type '" "IAxis *""'"); - } - arg2 = reinterpret_cast< IAxis * >(argp2); - result = (ICoordSystem *)((OffspecDetector const *)arg1)->offspecCoords(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ICoordSystem, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_OffspecDetector_createPixel(PyObject *self, PyObject *args) { PyObject *resultobj = 0; OffspecDetector *arg1 = (OffspecDetector *) 0 ; @@ -38903,7 +38873,6 @@ static PyMethodDef SwigMethods[] = { { "OffspecDetector_axisBinIndex", _wrap_OffspecDetector_axisBinIndex, METH_VARARGS, "OffspecDetector_axisBinIndex(OffspecDetector self, size_t index, size_t selected_axis) -> size_t"}, { "OffspecDetector_totalSize", _wrap_OffspecDetector_totalSize, METH_O, "OffspecDetector_totalSize(OffspecDetector self) -> size_t"}, { "OffspecDetector_defaultCoords", _wrap_OffspecDetector_defaultCoords, METH_O, "OffspecDetector_defaultCoords(OffspecDetector self) -> Coords"}, - { "OffspecDetector_offspecCoords", _wrap_OffspecDetector_offspecCoords, METH_VARARGS, "OffspecDetector_offspecCoords(OffspecDetector self, IAxis beamAxis) -> ICoordSystem const *"}, { "OffspecDetector_createPixel", _wrap_OffspecDetector_createPixel, METH_VARARGS, "OffspecDetector_createPixel(OffspecDetector self, size_t index) -> IPixel *"}, { "OffspecDetector_indexOfSpecular", _wrap_OffspecDetector_indexOfSpecular, METH_VARARGS, "OffspecDetector_indexOfSpecular(OffspecDetector self, double alpha, double phi) -> size_t"}, { "OffspecDetector_analyzer", _wrap_OffspecDetector_analyzer, METH_O, "OffspecDetector_analyzer(OffspecDetector self) -> PolFilter const &"},