From f5853d6b57d244537a293f73c3d13c4fbb2d1384 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 8 Mar 2023 16:26:09 +0100
Subject: [PATCH] DpSim: rm old c'tor

---
 Sim/Simulation/DepthprobeSimulation.cpp |  6 ---
 Sim/Simulation/DepthprobeSimulation.h   |  1 -
 auto/Wrap/libBornAgainSim.py            |  9 ++--
 auto/Wrap/libBornAgainSim_wrap.cpp      | 72 ++-----------------------
 4 files changed, 7 insertions(+), 81 deletions(-)

diff --git a/Sim/Simulation/DepthprobeSimulation.cpp b/Sim/Simulation/DepthprobeSimulation.cpp
index e73f099370e..3c028ae5320 100644
--- a/Sim/Simulation/DepthprobeSimulation.cpp
+++ b/Sim/Simulation/DepthprobeSimulation.cpp
@@ -29,12 +29,6 @@
 #include "Sim/Computation/DepthprobeComputation.h"
 #include "Sim/Scan/AlphaScan.h"
 
-DepthprobeSimulation::DepthprobeSimulation(const MultiLayer& sample)
-    : ISimulation(sample)
-    , m_beam(Beam::horizontalBeam().clone())
-{
-}
-
 DepthprobeSimulation::DepthprobeSimulation(const IBeamScan& scan, const MultiLayer& sample)
     : ISimulation(sample)
     , m_scan(scan.clone())
diff --git a/Sim/Simulation/DepthprobeSimulation.h b/Sim/Simulation/DepthprobeSimulation.h
index 535f4b9f900..226a0c65419 100644
--- a/Sim/Simulation/DepthprobeSimulation.h
+++ b/Sim/Simulation/DepthprobeSimulation.h
@@ -33,7 +33,6 @@ class IFootprintFactor;
 class DepthprobeSimulation : public ISimulation {
 public:
     DepthprobeSimulation(const IBeamScan& scan, const MultiLayer& sample);
-    DepthprobeSimulation(const MultiLayer& sample);
     ~DepthprobeSimulation() override;
 
     std::string className() const final { return "DepthprobeSimulation"; }
diff --git a/auto/Wrap/libBornAgainSim.py b/auto/Wrap/libBornAgainSim.py
index 3e815151391..e6febd834a2 100644
--- a/auto/Wrap/libBornAgainSim.py
+++ b/auto/Wrap/libBornAgainSim.py
@@ -2726,12 +2726,9 @@ class DepthprobeSimulation(ISimulation):
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
     __repr__ = _swig_repr
 
-    def __init__(self, *args):
-        r"""
-        __init__(DepthprobeSimulation self, IBeamScan scan, MultiLayer const & sample) -> DepthprobeSimulation
-        __init__(DepthprobeSimulation self, MultiLayer const & sample) -> DepthprobeSimulation
-        """
-        _libBornAgainSim.DepthprobeSimulation_swiginit(self, _libBornAgainSim.new_DepthprobeSimulation(*args))
+    def __init__(self, scan, sample):
+        r"""__init__(DepthprobeSimulation self, IBeamScan scan, MultiLayer const & sample) -> DepthprobeSimulation"""
+        _libBornAgainSim.DepthprobeSimulation_swiginit(self, _libBornAgainSim.new_DepthprobeSimulation(scan, sample))
     __swig_destroy__ = _libBornAgainSim.delete_DepthprobeSimulation
 
     def className(self):
diff --git a/auto/Wrap/libBornAgainSim_wrap.cpp b/auto/Wrap/libBornAgainSim_wrap.cpp
index 4792e4453cc..6dfa68dcd56 100644
--- a/auto/Wrap/libBornAgainSim_wrap.cpp
+++ b/auto/Wrap/libBornAgainSim_wrap.cpp
@@ -33393,7 +33393,7 @@ SWIGINTERN PyObject *ScatteringSimulation_swiginit(PyObject *SWIGUNUSEDPARM(self
   return SWIG_Python_InitShadowInstance(args);
 }
 
-SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
+SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   IBeamScan *arg1 = 0 ;
   MultiLayer *arg2 = 0 ;
@@ -33401,9 +33401,10 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_0(PyObject *self, Py_s
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  PyObject *swig_obj[2] ;
   DepthprobeSimulation *result = 0 ;
   
-  if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args, "new_DepthprobeSimulation", 2, 2, swig_obj)) SWIG_fail;
   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_IBeamScan,  0  | 0);
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DepthprobeSimulation" "', argument " "1"" of type '" "IBeamScan const &""'"); 
@@ -33428,68 +33429,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
-  PyObject *resultobj = 0;
-  MultiLayer *arg1 = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  DepthprobeSimulation *result = 0 ;
-  
-  if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MultiLayer,  0  | 0);
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DepthprobeSimulation" "', argument " "1"" of type '" "MultiLayer const &""'"); 
-  }
-  if (!argp1) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "1"" of type '" "MultiLayer const &""'"); 
-  }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
-  result = (DepthprobeSimulation *)new DepthprobeSimulation((MultiLayer const &)*arg1);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DepthprobeSimulation, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation(PyObject *self, PyObject *args) {
-  Py_ssize_t argc;
-  PyObject *argv[3] = {
-    0
-  };
-  
-  if (!(argc = SWIG_Python_UnpackTuple(args, "new_DepthprobeSimulation", 0, 2, argv))) SWIG_fail;
-  --argc;
-  if (argc == 1) {
-    int _v = 0;
-    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_new_DepthprobeSimulation__SWIG_1(self, argc, argv);
-    }
-  }
-  if (argc == 2) {
-    int _v = 0;
-    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_IBeamScan, 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) {
-        return _wrap_new_DepthprobeSimulation__SWIG_0(self, argc, argv);
-      }
-    }
-  }
-  
-fail:
-  SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_DepthprobeSimulation'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    DepthprobeSimulation::DepthprobeSimulation(IBeamScan const &,MultiLayer const &)\n"
-    "    DepthprobeSimulation::DepthprobeSimulation(MultiLayer const &)\n");
-  return 0;
-}
-
-
 SWIGINTERN PyObject *_wrap_delete_DepthprobeSimulation(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   DepthprobeSimulation *arg1 = (DepthprobeSimulation *) 0 ;
@@ -36496,10 +36435,7 @@ static PyMethodDef SwigMethods[] = {
 	 { "ScatteringSimulation_detector", _wrap_ScatteringSimulation_detector, METH_O, "ScatteringSimulation_detector(ScatteringSimulation self) -> IDetector &"},
 	 { "ScatteringSimulation_swigregister", ScatteringSimulation_swigregister, METH_O, NULL},
 	 { "ScatteringSimulation_swiginit", ScatteringSimulation_swiginit, METH_VARARGS, NULL},
-	 { "new_DepthprobeSimulation", _wrap_new_DepthprobeSimulation, METH_VARARGS, "\n"
-		"DepthprobeSimulation(IBeamScan scan, MultiLayer const & sample)\n"
-		"new_DepthprobeSimulation(MultiLayer const & sample) -> DepthprobeSimulation\n"
-		""},
+	 { "new_DepthprobeSimulation", _wrap_new_DepthprobeSimulation, METH_VARARGS, "new_DepthprobeSimulation(IBeamScan scan, MultiLayer const & sample) -> DepthprobeSimulation"},
 	 { "delete_DepthprobeSimulation", _wrap_delete_DepthprobeSimulation, METH_O, "delete_DepthprobeSimulation(DepthprobeSimulation self)"},
 	 { "DepthprobeSimulation_className", _wrap_DepthprobeSimulation_className, METH_O, "DepthprobeSimulation_className(DepthprobeSimulation self) -> std::string"},
 	 { "DepthprobeSimulation_setBeamParameters", _wrap_DepthprobeSimulation_setBeamParameters, METH_VARARGS, "DepthprobeSimulation_setBeamParameters(DepthprobeSimulation self, double _lambda, int nbins, double alpha_i_min, double alpha_i_max, IFootprintFactor const * beam_shape=None)"},
-- 
GitLab