diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp index 0cc6a25d0e916434acf6b8cfea8a3198227f3abf..56fd2d162390b019c19980f3cff0a77eab72df49 100644 --- a/Core/Simulation/ISimulation.cpp +++ b/Core/Simulation/ISimulation.cpp @@ -253,6 +253,12 @@ void ISimulation::setSampleBuilder(const std::shared_ptr<class ISampleBuilder>& m_sample_provider.setBuilder(sample_builder); } +PolarizerPair ISimulation::polarizerPair() const +{ + return {m_instrument.beam()->getPolarization(), + m_instrument.detector()->detectionProperties().analyzerOperator()}; +} + void ISimulation::setBackground(const IBackground& bg) { m_background.reset(bg.clone()); diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h index fbb1b886d13594f347e77441ec2675f15546a7b6..519d097062afed972e8fe29bc93c1d97526d188c 100644 --- a/Core/Simulation/ISimulation.h +++ b/Core/Simulation/ISimulation.h @@ -28,6 +28,7 @@ class IComputation; class ICoordSystem; class ISampleBuilder; class MultiLayer; +class PolarizerPair; class ProcessedSample; class SimulationOptions; class SimulationResult; @@ -63,6 +64,8 @@ public: void setSampleBuilder(const std::shared_ptr<ISampleBuilder>& sample_builder); + PolarizerPair polarizerPair() const; + void setBackground(const IBackground& bg); const IBackground* background() const { return m_background.get(); } diff --git a/Device/Instrument/Instrument.cpp b/Device/Instrument/Instrument.cpp index a2a606559e15902a0893871a8c0890bc17545935..ea3495005cd4f202a705ffafc2a3df87e0bc20bf 100644 --- a/Device/Instrument/Instrument.cpp +++ b/Device/Instrument/Instrument.cpp @@ -84,11 +84,6 @@ std::vector<const INode*> Instrument::getChildren() const return result; } -PolarizerPair Instrument::polarizerPair() const -{ - return {m_beam->getPolarization(), m_detector->detectionProperties().analyzerOperator()}; -} - void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i) { m_beam->setWavelength(wavelength); diff --git a/Device/Instrument/Instrument.h b/Device/Instrument/Instrument.h index 96a36aa444172f5c3ff75d76f69e236ee17435c8..c5dd09a1196200730dd0e34c7b12250496a1ada1 100644 --- a/Device/Instrument/Instrument.h +++ b/Device/Instrument/Instrument.h @@ -26,7 +26,6 @@ class Beam; class CoordSystem2D; class IDetector; -class PolarizerPair; //! Assembles beam, detector and their relative positions with respect to the sample. @@ -59,8 +58,6 @@ public: //! init detector with beam settings void initDetector(); - PolarizerPair polarizerPair() const; - std::vector<const INode*> getChildren() const override; CoordSystem2D* createScatteringCoords() const; diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i index a34f704bbeb0f2735625181eb192d84b87031c5c..226d9dd08f964a4cbcbf0eb12ed413f53d71e632 100644 --- a/auto/Wrap/doxygenCore.i +++ b/auto/Wrap/doxygenCore.i @@ -936,6 +936,9 @@ The MultiLayer object will not be owned by the ISimulation object. %feature("docstring") ISimulation::setSampleBuilder "void ISimulation::setSampleBuilder(const std::shared_ptr< ISampleBuilder > &sample_builder) "; +%feature("docstring") ISimulation::polarizerPair "PolarizerPair ISimulation::polarizerPair() const +"; + %feature("docstring") ISimulation::setBackground "void ISimulation::setBackground(const IBackground &bg) "; diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index a8b7f14abba68f2d1c9147d4e8841705cbbe0571..24dbfa4968d39022355c06bb209d19aae8fe9911 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -1620,9 +1620,6 @@ Sets the detector (axes can be overwritten later) init detector with beam settings "; -%feature("docstring") Instrument::polarizerPair "PolarizerPair Instrument::polarizerPair() const -"; - %feature("docstring") Instrument::getChildren "std::vector< const INode * > Instrument::getChildren() const override "; diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index 2d56d591bf8d0cefa21e933bd2747b4d92b15c0a..d5efed45890b63daef244c9d3146db45db6e8819 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -3526,6 +3526,14 @@ class ISimulation(libBornAgainParam.INode): """ return _libBornAgainCore.ISimulation_setSampleBuilderCpp(self, sample_builder) + def polarizerPair(self): + r""" + polarizerPair(ISimulation self) -> PolarizerPair + PolarizerPair ISimulation::polarizerPair() const + + """ + return _libBornAgainCore.ISimulation_polarizerPair(self) + def setBackground(self, bg): r""" setBackground(ISimulation self, IBackground bg) diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index 3d36675495ac94848aa9be7d1821e7ecc85ac305..5fe2f85b14a4c50c07f68354d88f3a6c348a0e30 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -3137,74 +3137,75 @@ namespace Swig { #define SWIGTYPE_p_OffSpecularSimulation swig_types[37] #define SWIGTYPE_p_ParameterDistribution swig_types[38] #define SWIGTYPE_p_PoissonNoiseBackground swig_types[39] -#define SWIGTYPE_p_ProgressHandler__Callback_t swig_types[40] -#define SWIGTYPE_p_PyBuilderCallback swig_types[41] -#define SWIGTYPE_p_PyObserverCallback swig_types[42] -#define SWIGTYPE_p_QzScan swig_types[43] -#define SWIGTYPE_p_RealLimits swig_types[44] -#define SWIGTYPE_p_ScanResolution swig_types[45] -#define SWIGTYPE_p_SimulationOptions swig_types[46] -#define SWIGTYPE_p_SimulationResult swig_types[47] -#define SWIGTYPE_p_SpecularSimulation swig_types[48] -#define SWIGTYPE_p_VarianceConstantFunction swig_types[49] -#define SWIGTYPE_p_VarianceSimFunction swig_types[50] -#define SWIGTYPE_p_allocator_type swig_types[51] -#define SWIGTYPE_p_char swig_types[52] -#define SWIGTYPE_p_difference_type swig_types[53] -#define SWIGTYPE_p_first_type swig_types[54] -#define SWIGTYPE_p_int swig_types[55] -#define SWIGTYPE_p_key_type swig_types[56] -#define SWIGTYPE_p_long_long swig_types[57] -#define SWIGTYPE_p_mapped_type swig_types[58] -#define SWIGTYPE_p_mumufit__MinimizerResult swig_types[59] -#define SWIGTYPE_p_mumufit__Parameters swig_types[60] -#define SWIGTYPE_p_p_PyObject swig_types[61] -#define SWIGTYPE_p_second_type swig_types[62] -#define SWIGTYPE_p_short swig_types[63] -#define SWIGTYPE_p_signed_char swig_types[64] -#define SWIGTYPE_p_size_type swig_types[65] -#define SWIGTYPE_p_std__allocatorT_AxisInfo_t swig_types[66] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[67] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[68] -#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[69] -#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[70] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[71] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[72] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[73] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[74] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[75] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[76] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[77] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[78] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[79] -#define SWIGTYPE_p_std__complexT_double_t swig_types[80] -#define SWIGTYPE_p_std__invalid_argument swig_types[81] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[82] -#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[83] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[84] -#define SWIGTYPE_p_std__shared_ptrT_ISampleBuilder_t swig_types[85] -#define SWIGTYPE_p_std__vectorT_AxisInfo_std__allocatorT_AxisInfo_t_t swig_types[86] -#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[87] -#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[88] -#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[89] -#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[90] -#define SWIGTYPE_p_std__vectorT_ParameterDistribution_std__allocatorT_ParameterDistribution_t_t swig_types[91] -#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[92] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[93] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[94] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[95] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[96] -#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[97] -#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[98] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[99] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[100] -#define SWIGTYPE_p_unsigned_char swig_types[101] -#define SWIGTYPE_p_unsigned_int swig_types[102] -#define SWIGTYPE_p_unsigned_long_long swig_types[103] -#define SWIGTYPE_p_unsigned_short swig_types[104] -#define SWIGTYPE_p_value_type swig_types[105] -static swig_type_info *swig_types[107]; -static swig_module_info swig_module = {swig_types, 106, 0, 0, 0, 0}; +#define SWIGTYPE_p_PolarizerPair swig_types[40] +#define SWIGTYPE_p_ProgressHandler__Callback_t swig_types[41] +#define SWIGTYPE_p_PyBuilderCallback swig_types[42] +#define SWIGTYPE_p_PyObserverCallback swig_types[43] +#define SWIGTYPE_p_QzScan swig_types[44] +#define SWIGTYPE_p_RealLimits swig_types[45] +#define SWIGTYPE_p_ScanResolution swig_types[46] +#define SWIGTYPE_p_SimulationOptions swig_types[47] +#define SWIGTYPE_p_SimulationResult swig_types[48] +#define SWIGTYPE_p_SpecularSimulation swig_types[49] +#define SWIGTYPE_p_VarianceConstantFunction swig_types[50] +#define SWIGTYPE_p_VarianceSimFunction swig_types[51] +#define SWIGTYPE_p_allocator_type swig_types[52] +#define SWIGTYPE_p_char swig_types[53] +#define SWIGTYPE_p_difference_type swig_types[54] +#define SWIGTYPE_p_first_type swig_types[55] +#define SWIGTYPE_p_int swig_types[56] +#define SWIGTYPE_p_key_type swig_types[57] +#define SWIGTYPE_p_long_long swig_types[58] +#define SWIGTYPE_p_mapped_type swig_types[59] +#define SWIGTYPE_p_mumufit__MinimizerResult swig_types[60] +#define SWIGTYPE_p_mumufit__Parameters swig_types[61] +#define SWIGTYPE_p_p_PyObject swig_types[62] +#define SWIGTYPE_p_second_type swig_types[63] +#define SWIGTYPE_p_short swig_types[64] +#define SWIGTYPE_p_signed_char swig_types[65] +#define SWIGTYPE_p_size_type swig_types[66] +#define SWIGTYPE_p_std__allocatorT_AxisInfo_t swig_types[67] +#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[68] +#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[69] +#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[70] +#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[71] +#define SWIGTYPE_p_std__allocatorT_double_t swig_types[72] +#define SWIGTYPE_p_std__allocatorT_int_t swig_types[73] +#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[74] +#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[75] +#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[76] +#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[77] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[78] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[79] +#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[80] +#define SWIGTYPE_p_std__complexT_double_t swig_types[81] +#define SWIGTYPE_p_std__invalid_argument swig_types[82] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[83] +#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[84] +#define SWIGTYPE_p_std__pairT_double_double_t swig_types[85] +#define SWIGTYPE_p_std__shared_ptrT_ISampleBuilder_t swig_types[86] +#define SWIGTYPE_p_std__vectorT_AxisInfo_std__allocatorT_AxisInfo_t_t swig_types[87] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[88] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[89] +#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[90] +#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[91] +#define SWIGTYPE_p_std__vectorT_ParameterDistribution_std__allocatorT_ParameterDistribution_t_t swig_types[92] +#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[93] +#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[94] +#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[95] +#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[96] +#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[97] +#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[98] +#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[99] +#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[100] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[101] +#define SWIGTYPE_p_unsigned_char swig_types[102] +#define SWIGTYPE_p_unsigned_int swig_types[103] +#define SWIGTYPE_p_unsigned_long_long swig_types[104] +#define SWIGTYPE_p_unsigned_short swig_types[105] +#define SWIGTYPE_p_value_type swig_types[106] +static swig_type_info *swig_types[108]; +static swig_module_info swig_module = {swig_types, 107, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -39103,6 +39104,29 @@ fail: } +SWIGINTERN PyObject *_wrap_ISimulation_polarizerPair(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ISimulation *arg1 = (ISimulation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + PolarizerPair result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation_polarizerPair" "', argument " "1"" of type '" "ISimulation const *""'"); + } + arg1 = reinterpret_cast< ISimulation * >(argp1); + result = ((ISimulation const *)arg1)->polarizerPair(); + resultobj = SWIG_NewPointerObj((new PolarizerPair(static_cast< const PolarizerPair& >(result))), SWIGTYPE_p_PolarizerPair, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_ISimulation_setBackground(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; ISimulation *arg1 = (ISimulation *) 0 ; @@ -44239,6 +44263,11 @@ static PyMethodDef SwigMethods[] = { "void ISimulation::setSampleBuilder(const std::shared_ptr< ISampleBuilder > &sample_builder)\n" "\n" ""}, + { "ISimulation_polarizerPair", _wrap_ISimulation_polarizerPair, METH_O, "\n" + "ISimulation_polarizerPair(ISimulation self) -> PolarizerPair\n" + "PolarizerPair ISimulation::polarizerPair() const\n" + "\n" + ""}, { "ISimulation_setBackground", _wrap_ISimulation_setBackground, METH_VARARGS, "\n" "ISimulation_setBackground(ISimulation self, IBackground bg)\n" "void ISimulation::setBackground(const IBackground &bg)\n" @@ -45067,6 +45096,7 @@ static swig_type_info _swigt__p_MultiLayer = {"_p_MultiLayer", "MultiLayer *", 0 static swig_type_info _swigt__p_OffSpecularSimulation = {"_p_OffSpecularSimulation", "OffSpecularSimulation *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ParameterDistribution = {"_p_ParameterDistribution", "ParameterDistribution *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PoissonNoiseBackground = {"_p_PoissonNoiseBackground", "PoissonNoiseBackground *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_PolarizerPair = {"_p_PolarizerPair", "PolarizerPair *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ProgressHandler__Callback_t = {"_p_ProgressHandler__Callback_t", "ProgressHandler::Callback_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PyBuilderCallback = {"_p_PyBuilderCallback", "PyBuilderCallback *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PyObserverCallback = {"_p_PyObserverCallback", "PyObserverCallback *", 0, 0, (void*)0, 0}; @@ -45175,6 +45205,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_OffSpecularSimulation, &_swigt__p_ParameterDistribution, &_swigt__p_PoissonNoiseBackground, + &_swigt__p_PolarizerPair, &_swigt__p_ProgressHandler__Callback_t, &_swigt__p_PyBuilderCallback, &_swigt__p_PyObserverCallback, @@ -45283,6 +45314,7 @@ static swig_cast_info _swigc__p_MultiLayer[] = { {&_swigt__p_MultiLayer, 0, 0, static swig_cast_info _swigc__p_OffSpecularSimulation[] = { {&_swigt__p_OffSpecularSimulation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ParameterDistribution[] = { {&_swigt__p_ParameterDistribution, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PoissonNoiseBackground[] = { {&_swigt__p_PoissonNoiseBackground, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_PolarizerPair[] = { {&_swigt__p_PolarizerPair, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ProgressHandler__Callback_t[] = { {&_swigt__p_ProgressHandler__Callback_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PyBuilderCallback[] = { {&_swigt__p_PyBuilderCallback, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PyObserverCallback[] = { {&_swigt__p_PyObserverCallback, 0, 0, 0},{0, 0, 0, 0}}; @@ -45391,6 +45423,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_OffSpecularSimulation, _swigc__p_ParameterDistribution, _swigc__p_PoissonNoiseBackground, + _swigc__p_PolarizerPair, _swigc__p_ProgressHandler__Callback_t, _swigc__p_PyBuilderCallback, _swigc__p_PyObserverCallback,