diff --git a/Core/Simulation/GISASSimulation.cpp b/Core/Simulation/GISASSimulation.cpp index 30e82004681854a4da38fa315325193fce904ef2..759bde5e7ff0d370f85cd6f61ca26772e6ad4d59 100644 --- a/Core/Simulation/GISASSimulation.cpp +++ b/Core/Simulation/GISASSimulation.cpp @@ -20,6 +20,10 @@ #include "Sample/Multilayer/MultiLayer.h" #include "Sample/SampleBuilderEngine/ISampleBuilder.h" +GISASSimulation::GISASSimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector) + : ISimulation2D(beam, sample, detector) { +} + GISASSimulation::GISASSimulation() { initialize(); } diff --git a/Core/Simulation/GISASSimulation.h b/Core/Simulation/GISASSimulation.h index 84a667bf327e04461e62e22dcd03dc289ab1b529..171da5eba1a9e7157bfdb0e74b13c45f888615d7 100644 --- a/Core/Simulation/GISASSimulation.h +++ b/Core/Simulation/GISASSimulation.h @@ -26,6 +26,7 @@ class ISampleBuilder; class GISASSimulation : public ISimulation2D { public: + GISASSimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector); GISASSimulation(); ~GISASSimulation() {} diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp index 35c90c2902f0c0bd47bbbdb501e0207d008c5ee0..5b57b7a3fb992554cb07ba8935714a20200e6995 100644 --- a/Core/Simulation/ISimulation.cpp +++ b/Core/Simulation/ISimulation.cpp @@ -111,6 +111,13 @@ void runComputations(std::vector<std::unique_ptr<IComputation>>& computations) { // class ISimulation // ************************************************************************************************ +ISimulation::ISimulation( + const Beam& beam, const MultiLayer& sample, const IDetector& detector) + : m_instrument(beam, detector) { + setSample(sample); + initialize(); +} + ISimulation::ISimulation() { initialize(); } diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h index 55064907c7ff0ba3098e71aa48ed73467dfd8240..f14278900e4d1231f1e14027135091b65aa56704 100644 --- a/Core/Simulation/ISimulation.h +++ b/Core/Simulation/ISimulation.h @@ -36,6 +36,7 @@ class MultiLayer; class ISimulation : public ICloneable, public INode { public: + ISimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector); ISimulation(); virtual ~ISimulation(); diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp index edc6840a1c0bbae33dfbe4e0d3053256faa3ba3c..fb353137e327354f05679206cf34a29f801d9345 100644 --- a/Core/Simulation/ISimulation2D.cpp +++ b/Core/Simulation/ISimulation2D.cpp @@ -19,6 +19,11 @@ #include "Device/Detector/DetectorContext.h" #include "Device/Histo/Histogram2D.h" +ISimulation2D::ISimulation2D( + const Beam& beam, const MultiLayer& sample, const IDetector& detector) + : ISimulation(beam, sample, detector) { +} + ISimulation2D::ISimulation2D() = default; ISimulation2D::~ISimulation2D() = default; diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h index dabfbec1d791833d6d21fc1f57f9f9e28695785a..e97dfa2369d66ebba3e7ad427020e7d36b3e58e6 100644 --- a/Core/Simulation/ISimulation2D.h +++ b/Core/Simulation/ISimulation2D.h @@ -25,6 +25,7 @@ class DetectorContext; class ISimulation2D : public ISimulation { public: + ISimulation2D(const Beam& beam, const MultiLayer& sample, const IDetector& detector); ISimulation2D(); ~ISimulation2D() override; diff --git a/Core/Simulation/OffSpecSimulation.cpp b/Core/Simulation/OffSpecSimulation.cpp index ceba029ef78a13f5f1b915f9a1d09a62bc285518..81ec48b6ea945a09982badea736bedc2f83e4f71 100644 --- a/Core/Simulation/OffSpecSimulation.cpp +++ b/Core/Simulation/OffSpecSimulation.cpp @@ -22,6 +22,11 @@ #include "Sample/Multilayer/MultiLayer.h" #include "Sample/SampleBuilderEngine/ISampleBuilder.h" +OffSpecSimulation::OffSpecSimulation( + const Beam& beam, const MultiLayer& sample, const IDetector& detector) + : ISimulation2D(beam, sample, detector) { +} + OffSpecSimulation::OffSpecSimulation() { initialize(); } diff --git a/Core/Simulation/OffSpecSimulation.h b/Core/Simulation/OffSpecSimulation.h index 4916d2a3c4fa5dbf0131bf0695ea8d83b04c5f46..25e72c996dc2eafd5b07c46e1fe355ec0714243f 100644 --- a/Core/Simulation/OffSpecSimulation.h +++ b/Core/Simulation/OffSpecSimulation.h @@ -25,6 +25,7 @@ class Histogram2D; class OffSpecSimulation : public ISimulation2D { public: + OffSpecSimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector); OffSpecSimulation(); ~OffSpecSimulation() override {} diff --git a/Device/Instrument/Instrument.cpp b/Device/Instrument/Instrument.cpp index 9beaa6328bf7b433353b6881b63ccd835c5be63c..55b997881193a495ff769c31d3d7c06ea42c54aa 100644 --- a/Device/Instrument/Instrument.cpp +++ b/Device/Instrument/Instrument.cpp @@ -17,15 +17,15 @@ #include "Device/Histo/Histogram2D.h" #include "Device/Resolution/IResolutionFunction2D.h" -Instrument::Instrument(const Beam& beam, IDetector* detector) - : m_beam(beam), m_detector(detector) { +Instrument::Instrument(const Beam& beam, const IDetector& detector) + : m_beam(beam), m_detector(detector.clone()) { setName("Instrument"); registerChild(m_detector.get()); registerChild(&m_beam); initDetector(); } -Instrument::Instrument() : Instrument(Beam::horizontalBeam(), new SphericalDetector()) { +Instrument::Instrument() : Instrument(Beam::horizontalBeam(), SphericalDetector()) { } Instrument::Instrument(const Instrument& other) : INode(), m_beam(other.m_beam) { diff --git a/Device/Instrument/Instrument.h b/Device/Instrument/Instrument.h index d240f6d73b65fe17047ef8948c992a944302f0fe..95d17cab13f71072de2719bd4f5f61d5176d72a0 100644 --- a/Device/Instrument/Instrument.h +++ b/Device/Instrument/Instrument.h @@ -27,7 +27,7 @@ class IDetector2D; class Instrument : public INode { public: Instrument(); - Instrument(const Beam& beam, IDetector* detector); + Instrument(const Beam& beam, const IDetector& detector); Instrument(const Instrument& other); Instrument& operator=(const Instrument& other); diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i index 08dfa1d673502c3f1827abd897bc6fcb2f10013b..d0749185511c3e8b5f18dd03f6f77d8cd4255913 100644 --- a/auto/Wrap/doxygenCore.i +++ b/auto/Wrap/doxygenCore.i @@ -742,6 +742,9 @@ Main class to run a Grazing-Incidence Small-Angle Scattering simulation. C++ includes: GISASSimulation.h "; +%feature("docstring") GISASSimulation::GISASSimulation "GISASSimulation::GISASSimulation(const Beam &beam, const MultiLayer &sample, const IDetector &detector) +"; + %feature("docstring") GISASSimulation::GISASSimulation "GISASSimulation::GISASSimulation() "; @@ -894,6 +897,9 @@ Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimu C++ includes: ISimulation.h "; +%feature("docstring") ISimulation::ISimulation "ISimulation::ISimulation(const Beam &beam, const MultiLayer &sample, const IDetector &detector) +"; + %feature("docstring") ISimulation::ISimulation "ISimulation::ISimulation() "; @@ -1027,6 +1033,9 @@ Abstract base class of OffSpecularSimulation and GISASSimulation. Holds the com C++ includes: ISimulation2D.h "; +%feature("docstring") ISimulation2D::ISimulation2D "ISimulation2D::ISimulation2D(const Beam &beam, const MultiLayer &sample, const IDetector &detector) +"; + %feature("docstring") ISimulation2D::ISimulation2D "ISimulation2D::ISimulation2D() "; @@ -1455,6 +1464,9 @@ Main class to run an off-specular simulation. C++ includes: OffSpecSimulation.h "; +%feature("docstring") OffSpecSimulation::OffSpecSimulation "OffSpecSimulation::OffSpecSimulation(const Beam &beam, const MultiLayer &sample, const IDetector &detector) +"; + %feature("docstring") OffSpecSimulation::OffSpecSimulation "OffSpecSimulation::OffSpecSimulation() "; diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index ebbcba6c2fac53dab052a57b6d2715c86b40164a..4d751daeffaf49b8043aa92fd57989ff7c7316f2 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -1445,7 +1445,7 @@ C++ includes: Instrument.h %feature("docstring") Instrument::Instrument "Instrument::Instrument() "; -%feature("docstring") Instrument::Instrument "Instrument::Instrument(const Beam &beam, IDetector *detector) +%feature("docstring") Instrument::Instrument "Instrument::Instrument(const Beam &beam, const IDetector &detector) "; %feature("docstring") Instrument::Instrument "Instrument::Instrument(const Instrument &other) diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index dd65788bd76f7a732a176b71cc49f51afd41ea5b..f2636b40ee8b12804d84bbc1f946ff217738f66d 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -3928,13 +3928,14 @@ class GISASSimulation(ISimulation2D): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self): + def __init__(self, *args): r""" + __init__(GISASSimulation self, Beam const & beam, MultiLayer const & sample, IDetector const & detector) -> GISASSimulation __init__(GISASSimulation self) -> GISASSimulation GISASSimulation::GISASSimulation() """ - _libBornAgainCore.GISASSimulation_swiginit(self, _libBornAgainCore.new_GISASSimulation()) + _libBornAgainCore.GISASSimulation_swiginit(self, _libBornAgainCore.new_GISASSimulation(*args)) __swig_destroy__ = _libBornAgainCore.delete_GISASSimulation def clone(self): @@ -4209,13 +4210,14 @@ class OffSpecSimulation(ISimulation2D): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self): + def __init__(self, *args): r""" + __init__(OffSpecSimulation self, Beam const & beam, MultiLayer const & sample, IDetector const & detector) -> OffSpecSimulation __init__(OffSpecSimulation self) -> OffSpecSimulation OffSpecSimulation::OffSpecSimulation() """ - _libBornAgainCore.OffSpecSimulation_swiginit(self, _libBornAgainCore.new_OffSpecSimulation()) + _libBornAgainCore.OffSpecSimulation_swiginit(self, _libBornAgainCore.new_OffSpecSimulation(*args)) __swig_destroy__ = _libBornAgainCore.delete_OffSpecSimulation def clone(self): diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index bc76649c261fe030d31f3450dda41d620bcb493f..2ac6c2e76d9156c9890c4370a38b047d02a780f9 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -40631,11 +40631,57 @@ SWIGINTERN PyObject *ISimulation2D_swigregister(PyObject *SWIGUNUSEDPARM(self), return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_new_GISASSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_GISASSimulation__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + Beam *arg1 = 0 ; + MultiLayer *arg2 = 0 ; + IDetector *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + GISASSimulation *result = 0 ; + + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Beam, 0 | 0); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GISASSimulation" "', argument " "1"" of type '" "Beam const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GISASSimulation" "', argument " "1"" of type '" "Beam const &""'"); + } + arg1 = reinterpret_cast< Beam * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GISASSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GISASSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); + } + arg2 = reinterpret_cast< MultiLayer * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_IDetector, 0 | 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GISASSimulation" "', argument " "3"" of type '" "IDetector const &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GISASSimulation" "', argument " "3"" of type '" "IDetector const &""'"); + } + arg3 = reinterpret_cast< IDetector * >(argp3); + result = (GISASSimulation *)new GISASSimulation((Beam const &)*arg1,(MultiLayer const &)*arg2,(IDetector const &)*arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GISASSimulation, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_GISASSimulation__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; GISASSimulation *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "new_GISASSimulation", 0, 0, 0)) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; result = (GISASSimulation *)new GISASSimulation(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GISASSimulation, SWIG_POINTER_NEW | 0 ); return resultobj; @@ -40644,6 +40690,43 @@ fail: } +SWIGINTERN PyObject *_wrap_new_GISASSimulation(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_GISASSimulation", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_new_GISASSimulation__SWIG_1(self, argc, argv); + } + if (argc == 3) { + int _v; + int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_Beam, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_IDetector, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_GISASSimulation__SWIG_0(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_GISASSimulation'.\n" + " Possible C/C++ prototypes are:\n" + " GISASSimulation::GISASSimulation(Beam const &,MultiLayer const &,IDetector const &)\n" + " GISASSimulation::GISASSimulation()\n"); + return 0; +} + + SWIGINTERN PyObject *_wrap_delete_GISASSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; GISASSimulation *arg1 = (GISASSimulation *) 0 ; @@ -41522,11 +41605,57 @@ SWIGINTERN PyObject *SpecularSimulation_swiginit(PyObject *SWIGUNUSEDPARM(self), return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_OffSpecSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_OffSpecSimulation__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + Beam *arg1 = 0 ; + MultiLayer *arg2 = 0 ; + IDetector *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + OffSpecSimulation *result = 0 ; + + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Beam, 0 | 0); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_OffSpecSimulation" "', argument " "1"" of type '" "Beam const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffSpecSimulation" "', argument " "1"" of type '" "Beam const &""'"); + } + arg1 = reinterpret_cast< Beam * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_OffSpecSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffSpecSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); + } + arg2 = reinterpret_cast< MultiLayer * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_IDetector, 0 | 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_OffSpecSimulation" "', argument " "3"" of type '" "IDetector const &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffSpecSimulation" "', argument " "3"" of type '" "IDetector const &""'"); + } + arg3 = reinterpret_cast< IDetector * >(argp3); + result = (OffSpecSimulation *)new OffSpecSimulation((Beam const &)*arg1,(MultiLayer const &)*arg2,(IDetector const &)*arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OffSpecSimulation, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_OffSpecSimulation__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; OffSpecSimulation *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "new_OffSpecSimulation", 0, 0, 0)) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; result = (OffSpecSimulation *)new OffSpecSimulation(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OffSpecSimulation, SWIG_POINTER_NEW | 0 ); return resultobj; @@ -41535,6 +41664,43 @@ fail: } +SWIGINTERN PyObject *_wrap_new_OffSpecSimulation(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_OffSpecSimulation", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_new_OffSpecSimulation__SWIG_1(self, argc, argv); + } + if (argc == 3) { + int _v; + int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_Beam, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_IDetector, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_OffSpecSimulation__SWIG_0(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_OffSpecSimulation'.\n" + " Possible C/C++ prototypes are:\n" + " OffSpecSimulation::OffSpecSimulation(Beam const &,MultiLayer const &,IDetector const &)\n" + " OffSpecSimulation::OffSpecSimulation()\n"); + return 0; +} + + SWIGINTERN PyObject *_wrap_delete_OffSpecSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OffSpecSimulation *arg1 = (OffSpecSimulation *) 0 ; @@ -43856,7 +44022,8 @@ static PyMethodDef SwigMethods[] = { "\n" ""}, { "ISimulation2D_swigregister", ISimulation2D_swigregister, METH_O, NULL}, - { "new_GISASSimulation", _wrap_new_GISASSimulation, METH_NOARGS, "\n" + { "new_GISASSimulation", _wrap_new_GISASSimulation, METH_VARARGS, "\n" + "GISASSimulation(Beam const & beam, MultiLayer const & sample, IDetector const & detector)\n" "new_GISASSimulation() -> GISASSimulation\n" "GISASSimulation::GISASSimulation()\n" "\n" @@ -44034,7 +44201,8 @@ static PyMethodDef SwigMethods[] = { ""}, { "SpecularSimulation_swigregister", SpecularSimulation_swigregister, METH_O, NULL}, { "SpecularSimulation_swiginit", SpecularSimulation_swiginit, METH_VARARGS, NULL}, - { "new_OffSpecSimulation", _wrap_new_OffSpecSimulation, METH_NOARGS, "\n" + { "new_OffSpecSimulation", _wrap_new_OffSpecSimulation, METH_VARARGS, "\n" + "OffSpecSimulation(Beam const & beam, MultiLayer const & sample, IDetector const & detector)\n" "new_OffSpecSimulation() -> OffSpecSimulation\n" "OffSpecSimulation::OffSpecSimulation()\n" "\n" diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index a97d331ed908aa6b3b83529fcaac7339a0862203..837b5285c500c80236ec1d253610166a916d97f1 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -35152,7 +35152,7 @@ fail: SWIGINTERN PyObject *_wrap_new_Instrument__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; Beam *arg1 = 0 ; - IDetector *arg2 = (IDetector *) 0 ; + IDetector *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -35168,12 +35168,15 @@ SWIGINTERN PyObject *_wrap_new_Instrument__SWIG_1(PyObject *SWIGUNUSEDPARM(self) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Instrument" "', argument " "1"" of type '" "Beam const &""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_IDetector, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IDetector, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Instrument" "', argument " "2"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Instrument" "', argument " "2"" of type '" "IDetector const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Instrument" "', argument " "2"" of type '" "IDetector const &""'"); } arg2 = reinterpret_cast< IDetector * >(argp2); - result = (Instrument *)new Instrument((Beam const &)*arg1,arg2); + result = (Instrument *)new Instrument((Beam const &)*arg1,(IDetector const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Instrument, SWIG_POINTER_NEW | 0 ); return resultobj; fail: @@ -35229,8 +35232,7 @@ SWIGINTERN PyObject *_wrap_new_Instrument(PyObject *self, PyObject *args) { int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_Beam, SWIG_POINTER_NO_NULL | 0); _v = SWIG_CheckState(res); if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_IDetector, 0); + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_IDetector, SWIG_POINTER_NO_NULL | 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_new_Instrument__SWIG_1(self, argc, argv); @@ -35242,7 +35244,7 @@ fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Instrument'.\n" " Possible C/C++ prototypes are:\n" " Instrument::Instrument()\n" - " Instrument::Instrument(Beam const &,IDetector *)\n" + " Instrument::Instrument(Beam const &,IDetector const &)\n" " Instrument::Instrument(Instrument const &)\n"); return 0; }