diff --git a/Sample/Particle/FormFactorWeighted.cpp b/Sample/Particle/FormFactorWeighted.cpp index eb4d120e436ab8cfbdc8c4136a6ad10fc6802683..0250904e16b8bc4ce5a26098f627746af6c94e81 100644 --- a/Sample/Particle/FormFactorWeighted.cpp +++ b/Sample/Particle/FormFactorWeighted.cpp @@ -25,7 +25,7 @@ FormFactorWeighted* FormFactorWeighted::clone() const { auto* result = new FormFactorWeighted(); for (size_t index = 0; index < m_form_factors.size(); ++index) - result->addFormFactor(*m_form_factors[index], m_weights[index]); + result->addFormFactor(*m_form_factors[index]); return result; } @@ -33,7 +33,7 @@ double FormFactorWeighted::radialExtension() const { double result{0.0}; for (size_t index = 0; index < m_form_factors.size(); ++index) - result += m_weights[index] * m_form_factors[index]->radialExtension(); + result += m_form_factors[index]->radialExtension(); return result; } @@ -56,10 +56,9 @@ double FormFactorWeighted::topZ(const IRotation& rotation) const [&rotation](IFormFactor* ff) { return ff->topZ(rotation); }); } -void FormFactorWeighted::addFormFactor(const IFormFactor& form_factor, double weight) +void FormFactorWeighted::addFormFactor(const IFormFactor& form_factor) { m_form_factors.push_back(form_factor.clone()); - m_weights.push_back(weight); } void FormFactorWeighted::setAmbientMaterial(const Material& material) @@ -72,7 +71,7 @@ complex_t FormFactorWeighted::theFF(const WavevectorInfo& wavevectors) const { complex_t result(0.0, 0.0); for (size_t index = 0; index < m_form_factors.size(); ++index) - result += m_weights[index] * m_form_factors[index]->theFF(wavevectors); + result += m_form_factors[index]->theFF(wavevectors); return result; } @@ -80,6 +79,6 @@ Eigen::Matrix2cd FormFactorWeighted::thePolFF(const WavevectorInfo& wavevectors) { Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero(); for (size_t index = 0; index < m_form_factors.size(); ++index) - result += m_weights[index] * m_form_factors[index]->thePolFF(wavevectors); + result += m_form_factors[index]->thePolFF(wavevectors); return result; } diff --git a/Sample/Particle/FormFactorWeighted.h b/Sample/Particle/FormFactorWeighted.h index 948d9a4ed0652e0ccfe9d48f5b64dab9ead0b31c..920cf4b5c2c9e5d857292d8c49932c4cb9c30e3b 100644 --- a/Sample/Particle/FormFactorWeighted.h +++ b/Sample/Particle/FormFactorWeighted.h @@ -42,7 +42,7 @@ public: double topZ(const IRotation& rotation) const override; - void addFormFactor(const IFormFactor& form_factor, double weight = 1.0); + void addFormFactor(const IFormFactor& form_factor); void setAmbientMaterial(const Material& material) override; @@ -55,7 +55,6 @@ public: protected: std::vector<IFormFactor*> m_form_factors; - std::vector<double> m_weights; }; #endif // BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORWEIGHTED_H diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index 699b473803f4135882424f9d9928c220394d3d19..3337a0ba1a91fded0380d71902f4ef1804b1702f 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -1817,7 +1817,7 @@ Returns the z-coordinate of the lowest point in this shape after a given rotatio Returns the z-coordinate of the lowest point in this shape after a given rotation. "; -%feature("docstring") FormFactorWeighted::addFormFactor "void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor, double weight=1.0) +%feature("docstring") FormFactorWeighted::addFormFactor "void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor) "; %feature("docstring") FormFactorWeighted::setAmbientMaterial "void FormFactorWeighted::setAmbientMaterial(const Material &material) override diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py index be78a11f812c201bf336eaeaa2d7f31123424fe6..4ac3ac14cc7b6d0895bf5cf9eece4b3dc4e7ae35 100644 --- a/auto/Wrap/libBornAgainSample.py +++ b/auto/Wrap/libBornAgainSample.py @@ -4269,13 +4269,13 @@ class FormFactorWeighted(IFormFactor): """ return _libBornAgainSample.FormFactorWeighted_topZ(self, rotation) - def addFormFactor(self, form_factor, weight=1.0): + def addFormFactor(self, form_factor): r""" - addFormFactor(FormFactorWeighted self, IFormFactor form_factor, double weight=1.0) - void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor, double weight=1.0) + addFormFactor(FormFactorWeighted self, IFormFactor form_factor) + void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor) """ - return _libBornAgainSample.FormFactorWeighted_addFormFactor(self, form_factor, weight) + return _libBornAgainSample.FormFactorWeighted_addFormFactor(self, form_factor) def setAmbientMaterial(self, material): r""" diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp index 90cc40c8d22ad4b502198e8a7af7541bd183691d..7a3b559aa5042e342d0d7c06061973d0744c75b1 100644 --- a/auto/Wrap/libBornAgainSample_wrap.cpp +++ b/auto/Wrap/libBornAgainSample_wrap.cpp @@ -43564,46 +43564,7 @@ fail: } -SWIGINTERN PyObject *_wrap_FormFactorWeighted_addFormFactor__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - FormFactorWeighted *arg1 = (FormFactorWeighted *) 0 ; - IFormFactor *arg2 = 0 ; - double arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - double val3 ; - int ecode3 = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FormFactorWeighted, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FormFactorWeighted_addFormFactor" "', argument " "1"" of type '" "FormFactorWeighted *""'"); - } - arg1 = reinterpret_cast< FormFactorWeighted * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IFormFactor, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FormFactorWeighted_addFormFactor" "', argument " "2"" of type '" "IFormFactor const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FormFactorWeighted_addFormFactor" "', argument " "2"" of type '" "IFormFactor const &""'"); - } - arg2 = reinterpret_cast< IFormFactor * >(argp2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "FormFactorWeighted_addFormFactor" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - (arg1)->addFormFactor((IFormFactor const &)*arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FormFactorWeighted_addFormFactor__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_FormFactorWeighted_addFormFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FormFactorWeighted *arg1 = (FormFactorWeighted *) 0 ; IFormFactor *arg2 = 0 ; @@ -43611,8 +43572,9 @@ SWIGINTERN PyObject *_wrap_FormFactorWeighted_addFormFactor__SWIG_1(PyObject *SW int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; + PyObject *swig_obj[2] ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "FormFactorWeighted_addFormFactor", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FormFactorWeighted, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FormFactorWeighted_addFormFactor" "', argument " "1"" of type '" "FormFactorWeighted *""'"); @@ -43634,56 +43596,6 @@ fail: } -SWIGINTERN PyObject *_wrap_FormFactorWeighted_addFormFactor(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "FormFactorWeighted_addFormFactor", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FormFactorWeighted, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_IFormFactor, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_FormFactorWeighted_addFormFactor__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FormFactorWeighted, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_IFormFactor, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_FormFactorWeighted_addFormFactor__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'FormFactorWeighted_addFormFactor'.\n" - " Possible C/C++ prototypes are:\n" - " FormFactorWeighted::addFormFactor(IFormFactor const &,double)\n" - " FormFactorWeighted::addFormFactor(IFormFactor const &)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_FormFactorWeighted_setAmbientMaterial(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FormFactorWeighted *arg1 = (FormFactorWeighted *) 0 ; @@ -72319,8 +72231,8 @@ static PyMethodDef SwigMethods[] = { "\n" ""}, { "FormFactorWeighted_addFormFactor", _wrap_FormFactorWeighted_addFormFactor, METH_VARARGS, "\n" - "FormFactorWeighted_addFormFactor(FormFactorWeighted self, IFormFactor form_factor, double weight=1.0)\n" - "void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor, double weight=1.0)\n" + "FormFactorWeighted_addFormFactor(FormFactorWeighted self, IFormFactor form_factor)\n" + "void FormFactorWeighted::addFormFactor(const IFormFactor &form_factor)\n" "\n" ""}, { "FormFactorWeighted_setAmbientMaterial", _wrap_FormFactorWeighted_setAmbientMaterial, METH_VARARGS, "\n"