diff --git a/Base/Axis/Bin.cpp b/Base/Axis/Bin.cpp index a407344afedf45f632dfb0b2cdec2c8c517a1e83..a34d837d819da00c5ed93ebee23cfc49574c1c5e 100644 --- a/Base/Axis/Bin.cpp +++ b/Base/Axis/Bin.cpp @@ -13,6 +13,7 @@ // ************************************************************************************************ #include "Base/Axis/Bin.h" +#include "Base/Vector/Direction.h" bool BinContains(const Bin1D& bin, double value) { if (bin.binSize() == 0.0) diff --git a/Base/Pixel/SimulationElement.cpp b/Base/Pixel/SimulationElement.cpp index abdd70be1570df2a77b486f01082892cd04fc77e..bb22be4468b205b59fc8c213427508449a5b4831 100644 --- a/Base/Pixel/SimulationElement.cpp +++ b/Base/Pixel/SimulationElement.cpp @@ -14,6 +14,7 @@ #include "Base/Pixel/SimulationElement.h" #include "Base/Pixel/IPixel.h" +#include "Base/Vector/Direction.h" SimulationElement::SimulationElement(double wavelength, double alpha_i, double phi_i, std::unique_ptr<IPixel> pixel, diff --git a/Base/Pixel/SimulationElement.h b/Base/Pixel/SimulationElement.h index 102b7553a51e3fb212fa3faa72a57b002e1f2af8..7b52531e32ebd837514343cf357232f18b2e3f1d 100644 --- a/Base/Pixel/SimulationElement.h +++ b/Base/Pixel/SimulationElement.h @@ -46,14 +46,14 @@ public: //! Returns assigned PolarizationHandler const PolarizationHandler& polarizationHandler() const { return m_polarization; } - double getWavelength() const { return m_wavelength; } + double wavelength() const { return m_wavelength; } double getAlphaI() const { return m_alpha_i; } double getPhiI() const { return m_phi_i; } double getAlphaMean() const { return getAlpha(0.5, 0.5); } double getPhiMean() const { return getPhi(0.5, 0.5); } void setIntensity(double intensity) { m_intensity = intensity; } void addIntensity(double intensity) { m_intensity += intensity; } - double getIntensity() const { return m_intensity; } + double intensity() const { return m_intensity; } kvector_t getKi() const; kvector_t getMeanKf() const; kvector_t meanQ() const; diff --git a/Base/Utils/IFactory.h b/Base/Utils/IFactory.h index 9e2c142ace042df904959deea2e5546b6ee971f1..c33f0572fb38c8bc249f4826a0462f8dfef862b0 100644 --- a/Base/Utils/IFactory.h +++ b/Base/Utils/IFactory.h @@ -12,10 +12,6 @@ // // ************************************************************************************************ -#ifdef SWIG -#error no need to expose this header to Swig -#endif - #ifndef BORNAGAIN_BASE_UTILS_IFACTORY_H #define BORNAGAIN_BASE_UTILS_IFACTORY_H diff --git a/Base/Vector/BasicVector3D.cpp b/Base/Vector/BasicVector3D.cpp index de3d6f14525d3325c16199d319e5c49759767b3b..92f5b7e3d325e48b3fbb4ec61ffcb978ef653c73 100644 --- a/Base/Vector/BasicVector3D.cpp +++ b/Base/Vector/BasicVector3D.cpp @@ -13,21 +13,10 @@ // ************************************************************************************************ #include "Base/Vector/BasicVector3D.h" -#include "Base/Math/Constants.h" #include <stdexcept> typedef std::complex<double> complex_t; -// ----------------------------------------------------------------------------- -// Quasi constructor -// ----------------------------------------------------------------------------- - -BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) { - double k = M_TWOPI / _lambda; - return BasicVector3D<double>(k * std::cos(_alpha) * std::cos(_phi), - -k * std::cos(_alpha) * std::sin(_phi), k * std::sin(_alpha)); -} - // ----------------------------------------------------------------------------- // Functions of this (with no further argument) // ----------------------------------------------------------------------------- diff --git a/Base/Vector/BasicVector3D.h b/Base/Vector/BasicVector3D.h index eac697c326adb3aa85db79150a609095c080003e..6893c3f053ed4c4953551de2aec33f05ba180ec2 100644 --- a/Base/Vector/BasicVector3D.h +++ b/Base/Vector/BasicVector3D.h @@ -272,14 +272,6 @@ template <class T> inline bool operator!=(const BasicVector3D<T>& a, const Basic return (a.x() != b.x() || a.y() != b.y() || a.z() != b.z()); } -// ----------------------------------------------------------------------------- -// Quasi constructor -// ----------------------------------------------------------------------------- - -//! Creates a vector<double> as a wavevector with given wavelength and angles. -//! Specifically needed for grazing-incidence scattering. -BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi); - // ============================================================================= // ?? for API generation ?? // ============================================================================= diff --git a/Base/Vector/Direction.cpp b/Base/Vector/Direction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2f8a4a01c87300a49a723689ce1cbb5a4ace9011 --- /dev/null +++ b/Base/Vector/Direction.cpp @@ -0,0 +1,26 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Base/Vector/Direction.cpp +//! @brief Implements class Direction. +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************************************ + +#include "Base/Vector/Direction.h" +#include "Base/Math/Constants.h" +#include <cmath> + +kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) { + return M_TWOPI / _lambda * Direction(_alpha, _phi).vector(); +} + +kvector_t Direction::vector() const { + return {std::cos(m_alpha) * std::cos(m_phi), -std::cos(m_alpha) * std::sin(m_phi), + std::sin(m_alpha)}; +} diff --git a/Base/Vector/Direction.h b/Base/Vector/Direction.h new file mode 100644 index 0000000000000000000000000000000000000000..5aa0b4e6aa1bcf74e57015fe0634bf1f1a02db62 --- /dev/null +++ b/Base/Vector/Direction.h @@ -0,0 +1,41 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Base/Vector/Direction.h +//! @brief Defines class Direction. +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************************************ + +#ifndef BORNAGAIN_BASE_VECTOR_DIRECTION_H +#define BORNAGAIN_BASE_VECTOR_DIRECTION_H + +#include "Base/Vector/Vectors3D.h" + +kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi); + +class Direction { +public: + Direction(double alpha, double phi) : m_alpha(alpha), m_phi(phi) {} + Direction() : Direction(0, 0) {} // needed by Swig + + void setAlpha(double alpha) { m_alpha = alpha; } + void setPhi(double phi) { m_phi = phi; } + + double alpha() const { return m_alpha; } + double phi() const { return m_phi; } + + //! Returns Cartesian 3D vector + kvector_t vector() const; + +private: + double m_alpha; + double m_phi; +}; + +#endif // BORNAGAIN_BASE_VECTOR_DIRECTION_H diff --git a/Core/Computation/ComputationStatus.h b/Core/Computation/ComputationStatus.h index 33ad3c01c0dd93b542dea6ae962179f140d705d6..b8722c5ec697d1ec0547f00787be6089ba3a8cd6 100644 --- a/Core/Computation/ComputationStatus.h +++ b/Core/Computation/ComputationStatus.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H #define BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H diff --git a/Core/Computation/DWBAComputation.h b/Core/Computation/DWBAComputation.h index cf375c40b77d19afde3e59faaefb0c88af0f9b4c..d4219a5b5f1aacf4a862688c24ef02100d69d44d 100644 --- a/Core/Computation/DWBAComputation.h +++ b/Core/Computation/DWBAComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_DWBACOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_DWBACOMPUTATION_H diff --git a/Core/Computation/DWBASingleComputation.h b/Core/Computation/DWBASingleComputation.h index d04f6ce342258fa88594bad6f6bd30544765ad38..9afed99c0b0c8f7c2480142357fae91aa4a2f7d0 100644 --- a/Core/Computation/DWBASingleComputation.h +++ b/Core/Computation/DWBASingleComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H diff --git a/Core/Computation/DepthProbeComputation.h b/Core/Computation/DepthProbeComputation.h index b5c01a541358e4589e550282c5e1618ac86c6d9b..f1b7a0d9bd6956c167107435faf7a0685cdfca74 100644 --- a/Core/Computation/DepthProbeComputation.h +++ b/Core/Computation/DepthProbeComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_DEPTHPROBECOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_DEPTHPROBECOMPUTATION_H diff --git a/Core/Computation/GISASSpecularComputation.h b/Core/Computation/GISASSpecularComputation.h index 646d7273ce458fcc7eeed142d193da7162396a8e..6ad78fcc13af44a9dc2a5f35d0623c330d01d441 100644 --- a/Core/Computation/GISASSpecularComputation.h +++ b/Core/Computation/GISASSpecularComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_GISASSPECULARCOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_GISASSPECULARCOMPUTATION_H diff --git a/Core/Computation/IComputation.h b/Core/Computation/IComputation.h index 61dd1bbb84e97982fc66ebca3f1e661a87ac9edf..64e500e348359a9b45721a30f7d638dd013834e3 100644 --- a/Core/Computation/IComputation.h +++ b/Core/Computation/IComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_ICOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_ICOMPUTATION_H diff --git a/Core/Computation/ParticleLayoutComputation.h b/Core/Computation/ParticleLayoutComputation.h index ded7cb42e86910cffff89470d04683f4b847761f..ece5291210950a55e3f567b99d8320c3cfe52aa2 100644 --- a/Core/Computation/ParticleLayoutComputation.h +++ b/Core/Computation/ParticleLayoutComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H diff --git a/Core/Computation/RoughMultiLayerComputation.cpp b/Core/Computation/RoughMultiLayerComputation.cpp index c37dc9c8491dc397d888c90deb3dea4d9ef2c478..b0642be36dc52be7a2ef737183e95cc8339ab8ef 100644 --- a/Core/Computation/RoughMultiLayerComputation.cpp +++ b/Core/Computation/RoughMultiLayerComputation.cpp @@ -45,7 +45,7 @@ void RoughMultiLayerComputation::compute(SimulationElement& elem) const { return; auto n_slices = m_sample->numberOfSlices(); kvector_t q = elem.meanQ(); - double wavelength = elem.getWavelength(); + double wavelength = elem.wavelength(); double autocorr(0.0); complex_t crosscorr(0.0, 0.0); diff --git a/Core/Computation/RoughMultiLayerComputation.h b/Core/Computation/RoughMultiLayerComputation.h index 5d6b809696f5ad759bc1677acdcc325fe437313d..0cf04d5d59896f1aa7529397814374e0c83026b0 100644 --- a/Core/Computation/RoughMultiLayerComputation.h +++ b/Core/Computation/RoughMultiLayerComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_ROUGHMULTILAYERCOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_ROUGHMULTILAYERCOMPUTATION_H diff --git a/Core/Computation/SpecularComputation.h b/Core/Computation/SpecularComputation.h index 43a5c051d49ca349cbcf16c118c30c2d1bbe86b7..b28e414ed935e9fd0de8a9f1ee42449d9dbdfcf9 100644 --- a/Core/Computation/SpecularComputation.h +++ b/Core/Computation/SpecularComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_COMPUTATION_SPECULARCOMPUTATION_H #define BORNAGAIN_CORE_COMPUTATION_SPECULARCOMPUTATION_H diff --git a/Core/Element/DepthProbeElement.cpp b/Core/Element/DepthProbeElement.cpp index 96d7a4f2fcc7a37b640425d269702e2e0b79bafd..d442a4bd034f377031afc2a276b0a33bead6134d 100644 --- a/Core/Element/DepthProbeElement.cpp +++ b/Core/Element/DepthProbeElement.cpp @@ -14,6 +14,7 @@ #include "Core/Element/DepthProbeElement.h" #include "Base/Axis/IAxis.h" +#include "Base/Vector/Direction.h" const double phi_i_0 = 0.0; diff --git a/Core/Element/DepthProbeElement.h b/Core/Element/DepthProbeElement.h index d7062e911e917ccea7d64e7686ab7a818566d3ed..04b23e9ad588973ca214c8188305df47f886d5dd 100644 --- a/Core/Element/DepthProbeElement.h +++ b/Core/Element/DepthProbeElement.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_ELEMENT_DEPTHPROBEELEMENT_H #define BORNAGAIN_CORE_ELEMENT_DEPTHPROBEELEMENT_H @@ -31,7 +35,7 @@ public: DepthProbeElement& operator=(const DepthProbeElement& other); - double getWavelength() const { return m_wavelength; } + double wavelength() const { return m_wavelength; } double getAlphaI() const { return m_alpha_i; } kvector_t getKi() const; diff --git a/Core/Element/SpecularSimulationElement.h b/Core/Element/SpecularSimulationElement.h index 46ee9c9c80429a256d162cceb98f149413c157be..f2172237d011f600035b6d349b397368d6ddb661 100644 --- a/Core/Element/SpecularSimulationElement.h +++ b/Core/Element/SpecularSimulationElement.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_ELEMENT_SPECULARSIMULATIONELEMENT_H #define BORNAGAIN_CORE_ELEMENT_SPECULARSIMULATIONELEMENT_H @@ -43,7 +47,7 @@ public: //! Returns assigned PolarizationHandler. const PolarizationHandler& polarizationHandler() const { return m_polarization; } - double getIntensity() const { return m_intensity; } + double intensity() const { return m_intensity; } void setIntensity(double intensity) { m_intensity = intensity; } //! Returns calculation flag (if it's false, zero intensity is assigned to the element) diff --git a/Core/Export/ComponentKeyHandler.h b/Core/Export/ComponentKeyHandler.h index adcac2cb99c22bf28abd9df73045bf0e9f0c3d25..d13f5b186a12040e642cd9a0798a4bef94101485 100644 --- a/Core/Export/ComponentKeyHandler.h +++ b/Core/Export/ComponentKeyHandler.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_COMPONENTKEYHANDLER_H #define BORNAGAIN_CORE_EXPORT_COMPONENTKEYHANDLER_H diff --git a/Core/Export/MaterialKeyHandler.h b/Core/Export/MaterialKeyHandler.h index cfc83193f04c18931ed0ae26b10ccfedcfcf252f..c0356ca249175044f53c7659a3845b9849b55389 100644 --- a/Core/Export/MaterialKeyHandler.h +++ b/Core/Export/MaterialKeyHandler.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_MATERIALKEYHANDLER_H #define BORNAGAIN_CORE_EXPORT_MATERIALKEYHANDLER_H diff --git a/Core/Export/NodeProgeny.h b/Core/Export/NodeProgeny.h index 7e44d3191ee066fa5772418b3afed4dcbc8fbc78..74ea17191494aee96060e7a8e9200014bdd040ac 100644 --- a/Core/Export/NodeProgeny.h +++ b/Core/Export/NodeProgeny.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_NODEPROGENY_H #define BORNAGAIN_CORE_EXPORT_NODEPROGENY_H diff --git a/Core/Export/PyFmt.cpp b/Core/Export/PyFmt.cpp index c1d80bfb1775d9fa3450ee2a8d28bb6203606cf4..fb24b391dbb2acdf4233e59bcf5b9582bf8f3e27 100644 --- a/Core/Export/PyFmt.cpp +++ b/Core/Export/PyFmt.cpp @@ -21,11 +21,9 @@ namespace pyfmt { std::string scriptPreamble() { - const std::string result = "import numpy\n" - "import bornagain as ba\n" - "from bornagain import deg, nm, nm2, kvector_t\n\n\n"; - - return result; + return "import numpy, sys\n" + "import bornagain as ba\n" + "from bornagain import angstrom, deg, micrometer, nm, nm2, kvector_t\n\n\n"; } std::string printBool(double value) { diff --git a/Core/Export/PyFmt.h b/Core/Export/PyFmt.h index f1e4132b7890912e0d5ea5f779ffc63db7346e72..bc199db5f8af7f501aadf60335af9454e152ddc9 100644 --- a/Core/Export/PyFmt.h +++ b/Core/Export/PyFmt.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_PYFMT_H #define BORNAGAIN_CORE_EXPORT_PYFMT_H diff --git a/Core/Export/PyFmt2.h b/Core/Export/PyFmt2.h index 557d2775b2a39299a3968dac204bfdf08fde60df..9770bef40afafcb41d08bb62d2fd7f3657aab39e 100644 --- a/Core/Export/PyFmt2.h +++ b/Core/Export/PyFmt2.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_PYFMT2_H #define BORNAGAIN_CORE_EXPORT_PYFMT2_H diff --git a/Core/Export/PyFmtLimits.h b/Core/Export/PyFmtLimits.h index f39779d7c78e448bda35f9a907be0e1636e24428..9bb5dfd9d0f7cbe8166508e9fbda0d85ca06bce8 100644 --- a/Core/Export/PyFmtLimits.h +++ b/Core/Export/PyFmtLimits.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_PYFMTLIMITS_H #define BORNAGAIN_CORE_EXPORT_PYFMTLIMITS_H diff --git a/Core/Export/SampleToPython.h b/Core/Export/SampleToPython.h index db4b2a4ce1ee9d1daeec71f15e68e55eb050d713..18074fdb2185a50d0a2da436c2f8bfff6ef17a53 100644 --- a/Core/Export/SampleToPython.h +++ b/Core/Export/SampleToPython.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H #define BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp index d8956fc7b5b64e46fee6585314e13274f7b21f9c..9257436cac5a5d5f7acad4059f418bb5fe2a28bd 100644 --- a/Core/Export/SimulationToPython.cpp +++ b/Core/Export/SimulationToPython.cpp @@ -56,14 +56,6 @@ bool isDefaultDirection(const kvector_t direction) { && algo::almostEqual(direction.z(), 0.0); } -const std::string defineSimulate = "def run_simulation():\n" - " sample = get_sample()\n" - " simulation = get_simulation()\n" - " simulation.setSample(sample)\n" - " simulation.runSimulation()\n" - " return simulation.result()\n" - "\n\n"; - std::string defineFootprintFactor(const IFootprintFactor& foot) { std::ostringstream result; result << indent() << "footprint = ba." << foot.name(); @@ -135,7 +127,7 @@ std::string defineDetector(const ISimulation* simulation) { result << std::setprecision(12); if (const auto* const det = dynamic_cast<const SphericalDetector*>(detector)) { - result << indent() << "simulation.setDetectorParameters("; + result << indent() << "detector = ba.SphericalDetector("; for (size_t index = 0; index < det->dimension(); ++index) { if (index != 0) result << ", "; @@ -182,12 +174,10 @@ std::string defineDetector(const ISimulation* simulation) { << pyfmt::printDouble(det->getDirectBeamV0()) << ")\n"; } else throw std::runtime_error("defineDetector() -> Error. Unknown alignment."); - - result << indent() << "simulation.setDetector(detector)\n"; } else throw std::runtime_error("defineDetector() -> Error. Unknown detector"); if (detector->regionOfInterest()) { - result << indent() << "simulation.setRegionOfInterest(" + result << indent() << "detector.setRegionOfInterest(" << printFunc(detector)(detector->regionOfInterest()->getXlow()) << ", " << printFunc(detector)(detector->regionOfInterest()->getYlow()) << ", " << printFunc(detector)(detector->regionOfInterest()->getXup()) << ", " @@ -249,14 +239,14 @@ std::string defineBeamPolarization(const Beam& beam) { << pyfmt::printDouble(bloch_vector.x()) << ", " << pyfmt::printDouble(bloch_vector.y()) << ", " << pyfmt::printDouble(bloch_vector.z()) << ")\n"; - result << indent() << "simulation.setBeamPolarization(" << beam_polarization << ")\n"; + result << indent() << "beam.setPolarization(" << beam_polarization << ")\n"; } return result.str(); } std::string defineBeamIntensity(const Beam& beam) { std::ostringstream result; - double beam_intensity = beam.getIntensity(); + double beam_intensity = beam.intensity(); if (beam_intensity > 0.0) result << indent() << "simulation.setBeamIntensity(" << pyfmt::printScientificDouble(beam_intensity) << ")\n"; @@ -267,12 +257,12 @@ std::string defineGISASBeam(const GISASSimulation& simulation) { std::ostringstream result; const Beam& beam = simulation.instrument().beam(); - result << indent() << "simulation.setBeamParameters(" << pyfmt::printNm(beam.getWavelength()) - << ", " << pyfmt::printDegrees(beam.getAlpha()) << ", " - << pyfmt::printDegrees(beam.getPhi()) << ")\n"; + result << indent() << "beam = ba.Beam(" << pyfmt::printDouble(beam.intensity()) << ", " + << pyfmt::printNm(beam.wavelength()) << ", ba.Direction(" + << pyfmt::printDegrees(beam.direction().alpha()) << ", " + << pyfmt::printDegrees(beam.direction().phi()) << "))\n"; result << defineBeamPolarization(beam); - result << defineBeamIntensity(beam); return result.str(); } @@ -284,9 +274,9 @@ std::string defineOffSpecBeam(const OffSpecSimulation& simulation) { const std::string axidef = indent() + "alpha_i_axis = "; result << axidef << pyfmt2::printAxis(simulation.beamAxis(), "rad") << "\n"; - result << indent() << "simulation.setBeamParameters(" << pyfmt::printNm(beam.getWavelength()) + result << indent() << "simulation.setBeamParameters(" << pyfmt::printNm(beam.wavelength()) << ", " - << "alpha_i_axis, " << pyfmt::printDegrees(beam.getPhi()) << ")\n"; + << "alpha_i_axis, " << pyfmt::printDegrees(beam.direction().phi()) << ")\n"; result << defineBeamPolarization(beam); result << defineBeamIntensity(beam); @@ -386,11 +376,11 @@ std::string defineBackground(const ISimulation* simulation) { std::string defineGISASSimulation(const GISASSimulation* simulation) { std::ostringstream result; - result << indent() << "simulation = ba.GISASSimulation()\n"; + result << defineGISASBeam(*simulation); result << defineDetector(simulation); + result << indent() << "simulation = ba.GISASSimulation(beam, get_sample(), detector)\n"; result << defineDetectorResolutionFunction(simulation); result << defineDetectorPolarizationAnalysis(simulation); - result << defineGISASBeam(*simulation); result << defineParameterDistributions(simulation); result << defineMasks(simulation); result << defineSimulationOptions(simulation); @@ -409,6 +399,7 @@ std::string defineOffSpecSimulation(const OffSpecSimulation* simulation) { result << defineMasks(simulation); result << defineSimulationOptions(simulation); result << defineBackground(simulation); + result << " simulation.setSample(get_sample())\n"; return result.str(); } @@ -420,13 +411,13 @@ std::string defineSpecularSimulation(const SpecularSimulation* simulation) { result << defineParameterDistributions(simulation); result << defineSimulationOptions(simulation); result << defineBackground(simulation); + result << " simulation.setSample(get_sample())\n"; return result.str(); } -std::string defineGetSimulation(const ISimulation* simulation) { +std::string defineSimulate(const ISimulation* simulation) { std::ostringstream result; result << "def get_simulation():\n"; - if (auto gisas = dynamic_cast<const GISASSimulation*>(simulation)) result << defineGISASSimulation(gisas); else if (auto offspec = dynamic_cast<const OffSpecSimulation*>(simulation)) @@ -434,17 +425,20 @@ std::string defineGetSimulation(const ISimulation* simulation) { else if (auto spec = dynamic_cast<const SpecularSimulation*>(simulation)) result << defineSpecularSimulation(spec); else - throw std::runtime_error("defineGetSimulation() -> Error. " - "Wrong simulation type"); + ASSERT(0); + result << " return simulation\n\n\n"; + + result << "def run_simulation():\n" + " simulation = get_simulation()\n" + " simulation.runSimulation()\n" + " return simulation.result()\n\n\n"; - result << indent() << "return simulation\n\n\n"; return result.str(); } const std::string defineMain = "if __name__ == '__main__':\n" " result = run_simulation()\n" - " import sys\n" " if len(sys.argv)>=2:\n" " ba.IntensityDataIOFactory.writeSimulationResult(result, sys.argv[1])\n" " else:\n" @@ -452,11 +446,13 @@ const std::string defineMain = } // namespace -//! Returns a Python script that sets up a simulation and runs it if invoked as main program. +// ************************************************************************************************ +// class SimulationToPython +// ************************************************************************************************ std::string SimulationToPython::generateSimulationCode(const ISimulation& simulation) { if (simulation.sample() == nullptr) throw std::runtime_error("Cannot export: Simulation has no sample"); return pyfmt::scriptPreamble() + SampleToPython().generateSampleCode(*simulation.sample()) - + defineGetSimulation(&simulation) + defineSimulate + defineMain; + + defineSimulate(&simulation) + defineMain; } diff --git a/Core/Export/SimulationToPython.h b/Core/Export/SimulationToPython.h index 13b4abacf5d10f5fdbd8bca2bc7523ab693014ca..655f4c3cee7301bb115669e496b55fabf27f30f5 100644 --- a/Core/Export/SimulationToPython.h +++ b/Core/Export/SimulationToPython.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_EXPORT_SIMULATIONTOPYTHON_H #define BORNAGAIN_CORE_EXPORT_SIMULATIONTOPYTHON_H @@ -23,6 +27,7 @@ class ISimulation; class SimulationToPython { public: + //! Returns a Python script that sets up a simulation and runs it if invoked as main program. std::string generateSimulationCode(const ISimulation& simulation); }; diff --git a/Core/Fitting/FitObserver.h b/Core/Fitting/FitObserver.h index 6485796fd8f471557293360fced14269d08b8058..8a913270791d58f8e8fcf091a71e83d019bc55f1 100644 --- a/Core/Fitting/FitObserver.h +++ b/Core/Fitting/FitObserver.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_FITOBSERVER_H #define BORNAGAIN_CORE_FITTING_FITOBSERVER_H diff --git a/Core/Fitting/FitPrintService.h b/Core/Fitting/FitPrintService.h index 4e8bde5f2dfef7a738fdd2f59979dd31a72374fa..f4a55916b99caaef0d690a6f81ddbd2e33b75352 100644 --- a/Core/Fitting/FitPrintService.h +++ b/Core/Fitting/FitPrintService.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_FITPRINTSERVICE_H #define BORNAGAIN_CORE_FITTING_FITPRINTSERVICE_H diff --git a/Core/Fitting/FitStatus.h b/Core/Fitting/FitStatus.h index 3d72fdb2fd78ce6fdf50d7083f474dfb108ac84e..ce5cbe66705e1fa57865cadc7a5a078ceb0240a3 100644 --- a/Core/Fitting/FitStatus.h +++ b/Core/Fitting/FitStatus.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_FITSTATUS_H #define BORNAGAIN_CORE_FITTING_FITSTATUS_H diff --git a/Core/Fitting/FitTypes.h b/Core/Fitting/FitTypes.h index f9cdab0806d79dd0f00f14114463d43bc1007364..4b2baa06ca7a284188e6e31237a8340eb6041b15 100644 --- a/Core/Fitting/FitTypes.h +++ b/Core/Fitting/FitTypes.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_FITTYPES_H #define BORNAGAIN_CORE_FITTING_FITTYPES_H diff --git a/Core/Fitting/ObjectiveMetric.h b/Core/Fitting/ObjectiveMetric.h index 8990aafa4008cb2be5ffcdf8f8d1283256bc3c05..f514d1ddd01ad87deb2e2dd1b910d590a8cc5598 100644 --- a/Core/Fitting/ObjectiveMetric.h +++ b/Core/Fitting/ObjectiveMetric.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_OBJECTIVEMETRIC_H #define BORNAGAIN_CORE_FITTING_OBJECTIVEMETRIC_H diff --git a/Core/Fitting/ObjectiveMetricUtils.h b/Core/Fitting/ObjectiveMetricUtils.h index 22f3bb6434aade8a00d2c8329213094d7e4b9e4b..25d73db4144882d77bf6b77fdb020f27414e51b2 100644 --- a/Core/Fitting/ObjectiveMetricUtils.h +++ b/Core/Fitting/ObjectiveMetricUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_OBJECTIVEMETRICUTILS_H #define BORNAGAIN_CORE_FITTING_OBJECTIVEMETRICUTILS_H diff --git a/Core/Fitting/SimDataPair.h b/Core/Fitting/SimDataPair.h index e40a7f1f88509b8bb7b88464359f975d4309f1a0..3da9ac94e500a2becb21f56f39b1197a230f8806 100644 --- a/Core/Fitting/SimDataPair.h +++ b/Core/Fitting/SimDataPair.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_FITTING_SIMDATAPAIR_H #define BORNAGAIN_CORE_FITTING_SIMDATAPAIR_H diff --git a/Core/Legacy/MatrixRTCoefficients_v1.h b/Core/Legacy/MatrixRTCoefficients_v1.h index b983370cc21c5a9af1b90af76132cf3de7db5f6e..761c79e7da5e5fef98c4b7f7a990ea64b8e90437 100644 --- a/Core/Legacy/MatrixRTCoefficients_v1.h +++ b/Core/Legacy/MatrixRTCoefficients_v1.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_LEGACY_MATRIXRTCOEFFICIENTS_V1_H #define BORNAGAIN_CORE_LEGACY_MATRIXRTCOEFFICIENTS_V1_H diff --git a/Core/Legacy/MatrixRTCoefficients_v2.h b/Core/Legacy/MatrixRTCoefficients_v2.h index 2146ea36eace9cd1286c4a082df35c47f4321412..5d12d998bf6c215bc60324c81faac20dfac87515 100644 --- a/Core/Legacy/MatrixRTCoefficients_v2.h +++ b/Core/Legacy/MatrixRTCoefficients_v2.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_LEGACY_MATRIXRTCOEFFICIENTS_V2_H #define BORNAGAIN_CORE_LEGACY_MATRIXRTCOEFFICIENTS_V2_H diff --git a/Core/Legacy/SpecularMagneticStrategy_v1.h b/Core/Legacy/SpecularMagneticStrategy_v1.h index c88b30067e2443bf7b042c3791017e3a5672f0a2..eab0fb2b920f4851a1724d5ad98c7ea0dcb3228f 100644 --- a/Core/Legacy/SpecularMagneticStrategy_v1.h +++ b/Core/Legacy/SpecularMagneticStrategy_v1.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_LEGACY_SPECULARMAGNETICSTRATEGY_V1_H #define BORNAGAIN_CORE_LEGACY_SPECULARMAGNETICSTRATEGY_V1_H diff --git a/Core/Legacy/SpecularMagneticStrategy_v2.h b/Core/Legacy/SpecularMagneticStrategy_v2.h index 11453b465f07e70f64ea69e8d41b88b4c1910768..003e60cac849eecd4f04f72995962443b7136822 100644 --- a/Core/Legacy/SpecularMagneticStrategy_v2.h +++ b/Core/Legacy/SpecularMagneticStrategy_v2.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_LEGACY_SPECULARMAGNETICSTRATEGY_V2_H #define BORNAGAIN_CORE_LEGACY_SPECULARMAGNETICSTRATEGY_V2_H diff --git a/Core/Scan/AngularSpecScan.cpp b/Core/Scan/AngularSpecScan.cpp index 2cc9cac4423f102c7e9481164108505a0e818502..976beaac016e419b4ce3659665903c5bb12e273f 100644 --- a/Core/Scan/AngularSpecScan.cpp +++ b/Core/Scan/AngularSpecScan.cpp @@ -224,7 +224,7 @@ std::vector<double> AngularSpecScan::createIntensities( for (size_t k = 0, size_incs = inc_weights[i].size(); k < size_incs; ++k) { const double inc_weight = inc_weights[i][k]; for (size_t j = 0, size_wls = wl_weights[i].size(); j < size_wls; ++j) { - current += sim_elements[elem_pos].getIntensity() * inc_weight * wl_weights[i][j]; + current += sim_elements[elem_pos].intensity() * inc_weight * wl_weights[i][j]; ++elem_pos; } } diff --git a/Core/Scan/QSpecScan.cpp b/Core/Scan/QSpecScan.cpp index 8e464ec1333b9191859f95d361239a095188b4f1..ffb4c3487c77aa8924f27dd072ed37bcfe37ede2 100644 --- a/Core/Scan/QSpecScan.cpp +++ b/Core/Scan/QSpecScan.cpp @@ -79,7 +79,7 @@ QSpecScan::createIntensities(const std::vector<SpecularSimulationElement>& sim_e for (size_t i = 0; i < axis_size; ++i) { double& current = result[i]; for (size_t j = 0, size = samples[i].size(); j < size; ++j) { - current += sim_elements[elem_pos].getIntensity() * samples[i][j].weight; + current += sim_elements[elem_pos].intensity() * samples[i][j].weight; ++elem_pos; } } diff --git a/Core/Scan/UnitConverter1D.cpp b/Core/Scan/UnitConverter1D.cpp index 0e78b827dfc19eed0e25cb65cc006df3310938f3..a649a527fd5c7bf6587eafefef31bac8deecb3bc 100644 --- a/Core/Scan/UnitConverter1D.cpp +++ b/Core/Scan/UnitConverter1D.cpp @@ -96,7 +96,7 @@ UnitConverter1D::createConvertedData(const OutputData<double>& data, Axes::Units UnitConverterConvSpec::UnitConverterConvSpec(const Beam& beam, const IAxis& axis, Axes::Units axis_units) - : m_wavelength(beam.getWavelength()) { + : m_wavelength(beam.wavelength()) { m_axis = createTranslatedAxis(axis, getTraslatorFrom(axis_units), axisName(0, axis_units)); if (m_axis->lowerBound() < 0 || m_axis->upperBound() > M_PI_2) throw std::runtime_error("Error in UnitConverter1D: input axis range is out of bounds"); diff --git a/Core/Scan/UnitConverter1D.h b/Core/Scan/UnitConverter1D.h index 710c0f713536e24f0ca3c9c0efca8d29dae97003..deac928ceb6b43c990e817c9ff146b12322683fb 100644 --- a/Core/Scan/UnitConverter1D.h +++ b/Core/Scan/UnitConverter1D.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_SCAN_UNITCONVERTER1D_H #define BORNAGAIN_CORE_SCAN_UNITCONVERTER1D_H diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp index dd87ac5cbf0239cb1cc1307d4b748988004e417d..2ad80fa688a6a57d2508860aea23409f13a02dee 100644 --- a/Core/Simulation/DepthProbeSimulation.cpp +++ b/Core/Simulation/DepthProbeSimulation.cpp @@ -144,8 +144,8 @@ void DepthProbeSimulation::initSimulationElementVector() { std::vector<DepthProbeElement> DepthProbeSimulation::generateSimulationElements(const Beam& beam) { std::vector<DepthProbeElement> result; - const double wavelength = beam.getWavelength(); - const double angle_shift = beam.getAlpha(); + const double wavelength = beam.wavelength(); + const double angle_shift = beam.direction().alpha(); const size_t axis_size = getAlphaAxis()->size(); result.reserve(axis_size); @@ -209,7 +209,7 @@ void DepthProbeSimulation::initialize() { } void DepthProbeSimulation::normalize(size_t start_ind, size_t n_elements) { - const double beam_intensity = getBeamIntensity(); + const double beam_intensity = beam().intensity(); for (size_t i = start_ind, stop_point = start_ind + n_elements; i < stop_point; ++i) { auto& element = m_sim_elements[i]; const double alpha_i = -element.getAlphaI(); diff --git a/Core/Simulation/GISASSimulation.cpp b/Core/Simulation/GISASSimulation.cpp index c4f54d5ed3c03ac0a006dc19b38835382b611d2a..64bc9f87534738cf3602e9a640ba9a8cd5b58b0e 100644 --- a/Core/Simulation/GISASSimulation.cpp +++ b/Core/Simulation/GISASSimulation.cpp @@ -20,12 +20,16 @@ #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(); } void GISASSimulation::prepareSimulation() { - if (instrument().getDetectorDimension() != 2) + if (detector().dimension() != 2) throw std::runtime_error("GISASSimulation::prepareSimulation() " "-> Error. The detector was not properly configured."); instrument().initDetector(); 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 79098215e08551fb2847d73e2e476006b766e4f8..8ae36f605dfa460e8b4cac55ed942eb0d48dac27 100644 --- a/Core/Simulation/ISimulation.cpp +++ b/Core/Simulation/ISimulation.cpp @@ -111,6 +111,12 @@ 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(); } @@ -147,26 +153,22 @@ void ISimulation::setTerminalProgressMonitor() { } void ISimulation::setDetectorResolutionFunction(const IResolutionFunction2D& resolution_function) { - instrument().setDetectorResolutionFunction(resolution_function); + detector().setResolutionFunction(resolution_function); } //! Sets the polarization analyzer characteristics of the detector void ISimulation::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) { - instrument().setAnalyzerProperties(direction, efficiency, total_transmission); + detector().setAnalyzerProperties(direction, efficiency, total_transmission); } void ISimulation::setBeamIntensity(double intensity) { - instrument().setBeamIntensity(intensity); -} - -double ISimulation::getBeamIntensity() const { - return instrument().getBeamIntensity(); + beam().setIntensity(intensity); } //! Sets the beam polarization according to the given Bloch vector void ISimulation::setBeamPolarization(const kvector_t bloch_vector) { - instrument().setBeamPolarization(bloch_vector); + beam().setPolarization(bloch_vector); } void ISimulation::prepareSimulation() { diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h index cbda0e5beaf5e81f51920d37f1425b1e566d8d5c..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(); @@ -54,8 +55,13 @@ public: const Instrument& instrument() const { return m_instrument; } Instrument& instrument() { return m_instrument; } + Beam& beam() { return m_instrument.beam(); } + const Beam& beam() const { return m_instrument.beam(); } + + IDetector& detector() { return m_instrument.detector(); } + const IDetector& detector() const { return m_instrument.detector(); } + void setBeamIntensity(double intensity); - double getBeamIntensity() const; void setBeamPolarization(const kvector_t bloch_vector); diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp index 13d1cb0d8788ac9fdb1a835f23dd165e500d7f9d..164acd9e00d9f99bbc0963e2d46ace390497b42b 100644 --- a/Core/Simulation/ISimulation2D.cpp +++ b/Core/Simulation/ISimulation2D.cpp @@ -19,6 +19,9 @@ #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; @@ -28,10 +31,6 @@ void ISimulation2D::prepareSimulation() { m_detector_context = instrument().detector2D().createContext(); } -void ISimulation2D::removeMasks() { - instrument().detector2D().removeMasks(); -} - void ISimulation2D::addMask(const IShape2D& shape, bool mask_value) { instrument().detector2D().addMask(shape, mask_value); } @@ -73,9 +72,9 @@ std::unique_ptr<IComputation> ISimulation2D::generateSingleThreadedComputation(s } std::vector<SimulationElement> ISimulation2D::generateSimulationElements(const Beam& beam) { - const double wavelength = beam.getWavelength(); - const double alpha_i = -beam.getAlpha(); // Defined to be always positive in Beam - const double phi_i = beam.getPhi(); + const double wavelength = beam.wavelength(); + const double alpha_i = -beam.direction().alpha(); // Defined to be always positive in Beam + const double phi_i = beam.direction().phi(); const Eigen::Matrix2cd beam_polarization = beam.getPolarization(); const IDetector2D& detector = instrument().detector2D(); @@ -97,7 +96,7 @@ std::vector<SimulationElement> ISimulation2D::generateSimulationElements(const B } void ISimulation2D::normalize(size_t start_ind, size_t n_elements) { - const double beam_intensity = getBeamIntensity(); + const double beam_intensity = beam().intensity(); for (size_t i = start_ind, stop_point = start_ind + n_elements; i < stop_point; ++i) { SimulationElement& element = m_sim_elements[i]; double sin_alpha_i = std::abs(std::sin(element.getAlphaI())); @@ -106,7 +105,7 @@ void ISimulation2D::normalize(size_t start_ind, size_t n_elements) { continue; } const double solid_angle = element.solidAngle(); - element.setIntensity(element.getIntensity() * beam_intensity * solid_angle / sin_alpha_i); + element.setIntensity(element.intensity() * beam_intensity * solid_angle / sin_alpha_i); } } @@ -115,7 +114,7 @@ void ISimulation2D::addBackgroundIntensity(size_t start_ind, size_t n_elements) return; for (size_t i = start_ind, stop_point = start_ind + n_elements; i < stop_point; ++i) { SimulationElement& element = m_sim_elements[i]; - element.setIntensity(background()->addBackground(element.getIntensity())); + element.setIntensity(background()->addBackground(element.intensity())); } } @@ -124,7 +123,7 @@ void ISimulation2D::addDataToCache(double weight) { throw std::runtime_error("Error in ISimulation2D::addDataToCache(double): cache size" " not the same as element size"); for (unsigned i = 0; i < m_sim_elements.size(); i++) - m_cache[i] += m_sim_elements[i].getIntensity() * weight; + m_cache[i] += m_sim_elements[i].intensity() * weight; } void ISimulation2D::moveDataFromCache() { @@ -140,7 +139,7 @@ std::vector<double> ISimulation2D::rawResults() const { std::vector<double> result; result.resize(m_sim_elements.size()); for (unsigned i = 0; i < m_sim_elements.size(); ++i) - result[i] = m_sim_elements[i].getIntensity(); + result[i] = m_sim_elements[i].intensity(); return result; } diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h index a410a786f6c35856d4a66610a00d6b7f6def487d..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; @@ -46,9 +47,6 @@ public: //! Sets the detector (axes can be overwritten later) void setDetector(const IDetector2D& detector); - //! removes all masks from the detector - void removeMasks(); - //! Adds mask of given shape to the stack of detector masks. The mask value 'true' means //! that the channel will be excluded from the simulation. The mask which is added last //! has priority. diff --git a/Core/Simulation/MPISimulation.h b/Core/Simulation/MPISimulation.h index 7beb7fd189d0a92445ff4291ec351b280d0ca8d4..67e644e47e92a5ac639b9f998e9cdd945d4bf828 100644 --- a/Core/Simulation/MPISimulation.h +++ b/Core/Simulation/MPISimulation.h @@ -13,6 +13,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_SIMULATION_MPISIMULATION_H #define BORNAGAIN_CORE_SIMULATION_MPISIMULATION_H diff --git a/Core/Simulation/OffSpecSimulation.cpp b/Core/Simulation/OffSpecSimulation.cpp index a13b6e6b609d32c69e4f3d7b3fac6c27a749b23c..176b059ba0e8c78b43fd8a5f2a5df06c0af9d060 100644 --- a/Core/Simulation/OffSpecSimulation.cpp +++ b/Core/Simulation/OffSpecSimulation.cpp @@ -22,6 +22,10 @@ #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(); } @@ -68,7 +72,7 @@ std::unique_ptr<IUnitConverter> OffSpecSimulation::createUnitConverter() const { size_t OffSpecSimulation::intensityMapSize() const { checkInitialization(); - return m_alpha_i_axis->size() * instrument().getDetectorAxis(1).size(); + return m_alpha_i_axis->size() * detector().axis(1).size(); } OffSpecSimulation::OffSpecSimulation(const OffSpecSimulation& other) : ISimulation2D(other) { @@ -81,14 +85,8 @@ OffSpecSimulation::OffSpecSimulation(const OffSpecSimulation& other) : ISimulati void OffSpecSimulation::initSimulationElementVector() { m_sim_elements.clear(); Beam beam = instrument().beam(); - const double wavelength = beam.getWavelength(); - const double phi_i = beam.getPhi(); - for (size_t i = 0; i < m_alpha_i_axis->size(); ++i) { - // Incoming angle by convention defined as positive: - double alpha_i = m_alpha_i_axis->bin(i).center(); - double total_alpha = alpha_i; - beam.setCentralK(wavelength, total_alpha, phi_i); + beam.setInclination(m_alpha_i_axis->bin(i).center()); std::vector<SimulationElement> sim_elements_i = generateSimulationElements(beam); for (auto ele : sim_elements_i) m_sim_elements.emplace_back(ele); @@ -113,7 +111,7 @@ void OffSpecSimulation::validateParametrization(const ParameterDistribution& par void OffSpecSimulation::transferResultsToIntensityMap() { checkInitialization(); - const IAxis& phi_axis = instrument().getDetectorAxis(0); + const IAxis& phi_axis = detector().axis(0); size_t phi_f_size = phi_axis.size(); if (phi_f_size * m_intensity_map.getAllocatedSize() != m_sim_elements.size()) throw std::runtime_error( @@ -127,22 +125,22 @@ void OffSpecSimulation::updateIntensityMap() { m_intensity_map.clear(); if (m_alpha_i_axis) m_intensity_map.addAxis(*m_alpha_i_axis); - size_t detector_dimension = instrument().getDetectorDimension(); + size_t detector_dimension = detector().dimension(); if (detector_dimension == 2) - m_intensity_map.addAxis(instrument().getDetectorAxis(1)); + m_intensity_map.addAxis(detector().axis(1)); m_intensity_map.setAllTo(0.); } void OffSpecSimulation::transferDetectorImage(size_t index) { OutputData<double> detector_image; - size_t detector_dimension = instrument().getDetectorDimension(); + size_t detector_dimension = detector().dimension(); for (size_t dim = 0; dim < detector_dimension; ++dim) - detector_image.addAxis(instrument().getDetectorAxis(dim)); + detector_image.addAxis(detector().axis(dim)); size_t detector_size = detector_image.getAllocatedSize(); for (size_t i = 0; i < detector_size; ++i) - detector_image[i] = m_sim_elements[index * detector_size + i].getIntensity(); - instrument().applyDetectorResolution(&detector_image); - size_t y_axis_size = instrument().getDetectorAxis(1).size(); + detector_image[i] = m_sim_elements[index * detector_size + i].intensity(); + detector().applyDetectorResolution(&detector_image); + size_t y_axis_size = detector().axis(1).size(); for (size_t i = 0; i < detector_size; ++i) m_intensity_map[index * y_axis_size + i % y_axis_size] += detector_image[i]; } @@ -151,7 +149,7 @@ void OffSpecSimulation::checkInitialization() const { if (!m_alpha_i_axis || m_alpha_i_axis->size() < 1) throw std::runtime_error("OffSpecSimulation::checkInitialization() " "Incoming alpha range not configured."); - if (instrument().getDetectorDimension() != 2) + if (detector().dimension() != 2) throw std::runtime_error( "OffSpecSimulation::checkInitialization: detector is not two-dimensional"); } 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/Core/Simulation/SimulationFactory.h b/Core/Simulation/SimulationFactory.h index a8da0f9e651c12efee2ea66f93da7f5c4f4e7b05..9c31fb459f2f1a020a35da04d87e709b422029a5 100644 --- a/Core/Simulation/SimulationFactory.h +++ b/Core/Simulation/SimulationFactory.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_SIMULATION_SIMULATIONFACTORY_H #define BORNAGAIN_CORE_SIMULATION_SIMULATIONFACTORY_H diff --git a/Core/Simulation/SpecularSimulation.cpp b/Core/Simulation/SpecularSimulation.cpp index bd600e194c56aa30aa6cf9503590668d6706ff85..02af3b78ceb9a2bed4001628a0db6494226fd939 100644 --- a/Core/Simulation/SpecularSimulation.cpp +++ b/Core/Simulation/SpecularSimulation.cpp @@ -30,8 +30,8 @@ namespace { // TODO: remove when pointwise resolution is implemented std::unique_ptr<AngularSpecScan> mangledScan(const AngularSpecScan& scan, const Beam& beam) { - const double wl = beam.getWavelength(); - const double angle_shift = beam.getAlpha(); + const double wl = beam.wavelength(); + const double angle_shift = beam.direction().alpha(); std::vector<double> angles = scan.coordinateAxis()->binCenters(); for (auto& val : angles) val += angle_shift; @@ -76,7 +76,7 @@ SpecularSimulation* SpecularSimulation::clone() const { } void SpecularSimulation::prepareSimulation() { - if (instrument().getDetectorDimension() != 1) // detector must have only one axis + if (detector().dimension() != 1) // detector must have only one axis throw std::runtime_error("Error in SpecularSimulation::prepareSimulation: the detector was " "not properly configured."); instrument().initDetector(); @@ -181,7 +181,7 @@ void SpecularSimulation::initialize() { } void SpecularSimulation::normalize(size_t start_ind, size_t n_elements) { - const double beam_intensity = getBeamIntensity(); + const double beam_intensity = beam().intensity(); std::vector<double> footprints; // TODO: use just m_scan when pointwise resolution is implemented @@ -192,7 +192,7 @@ void SpecularSimulation::normalize(size_t start_ind, size_t n_elements) { for (size_t i = start_ind, k = 0; i < start_ind + n_elements; ++i, ++k) { auto& element = m_sim_elements[i]; - element.setIntensity(element.getIntensity() * beam_intensity * footprints[k]); + element.setIntensity(element.intensity() * beam_intensity * footprints[k]); } } @@ -201,14 +201,14 @@ void SpecularSimulation::addBackgroundIntensity(size_t start_ind, size_t n_eleme return; for (size_t i = start_ind, stop_point = start_ind + n_elements; i < stop_point; ++i) { auto& element = m_sim_elements[i]; - element.setIntensity(background()->addBackground(element.getIntensity())); + element.setIntensity(background()->addBackground(element.intensity())); } } void SpecularSimulation::addDataToCache(double weight) { checkCache(); for (size_t i = 0, size = m_sim_elements.size(); i < size; ++i) - m_cache[i] += m_sim_elements[i].getIntensity() * weight; + m_cache[i] += m_sim_elements[i].intensity() * weight; } void SpecularSimulation::moveDataFromCache() { @@ -223,7 +223,7 @@ std::vector<double> SpecularSimulation::rawResults() const { std::vector<double> result; result.resize(m_sim_elements.size()); for (unsigned i = 0; i < m_sim_elements.size(); ++i) - result[i] = m_sim_elements[i].getIntensity(); + result[i] = m_sim_elements[i].intensity(); return result; } diff --git a/Core/Simulation/StandardSimulations.h b/Core/Simulation/StandardSimulations.h index 3b753909a284a484badfab48071d9f65a1d82f5a..630c81778ff62862ab3673332f39421fead0c30a 100644 --- a/Core/Simulation/StandardSimulations.h +++ b/Core/Simulation/StandardSimulations.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_SIMULATION_STANDARDSIMULATIONS_H #define BORNAGAIN_CORE_SIMULATION_STANDARDSIMULATIONS_H diff --git a/Core/Simulation/UnitConverterUtils.h b/Core/Simulation/UnitConverterUtils.h index c781aa0102fbd35fd0af0f6ecb852f34a5c1fe39..bf57ad4ee8dc8b14f33981dc1b2c392f5ba13c73 100644 --- a/Core/Simulation/UnitConverterUtils.h +++ b/Core/Simulation/UnitConverterUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H #define BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H diff --git a/Core/Term/DepthProbeComputationTerm.h b/Core/Term/DepthProbeComputationTerm.h index dc4c2d14660e314589c858ee84d4e7af2caef5a7..ff548e1cc721993b51cb5315d5383876dd2cdf1c 100644 --- a/Core/Term/DepthProbeComputationTerm.h +++ b/Core/Term/DepthProbeComputationTerm.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_TERM_DEPTHPROBECOMPUTATIONTERM_H #define BORNAGAIN_CORE_TERM_DEPTHPROBECOMPUTATIONTERM_H diff --git a/Core/Term/SpecularComputationTerm.h b/Core/Term/SpecularComputationTerm.h index e835a040946881f570fcb6c0f67a2e2798f61bb6..092be278b91263c4b7f56d778b49dab8900ebf6a 100644 --- a/Core/Term/SpecularComputationTerm.h +++ b/Core/Term/SpecularComputationTerm.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_CORE_TERM_SPECULARCOMPUTATIONTERM_H #define BORNAGAIN_CORE_TERM_SPECULARCOMPUTATIONTERM_H diff --git a/Device/Beam/Beam.cpp b/Device/Beam/Beam.cpp index 5e7386fb4d571006da8cae1595ccea1f424a77c3..95016fab4c8710b9d196f8a8aecf334d7af841cc 100644 --- a/Device/Beam/Beam.cpp +++ b/Device/Beam/Beam.cpp @@ -22,22 +22,25 @@ // Allow for 90 degrees by adding a relatively small constant to pi/2 static constexpr double INCLINATION_LIMIT = M_PI_2 + 1e-10; -Beam::Beam(double wavelength, double alpha, double phi, double intensity) - : m_wavelength(wavelength), m_alpha(alpha), m_phi(phi), m_intensity(intensity) { +Beam::Beam(double intensity, double wavelength, const Direction& direction) + : m_intensity(intensity) + , m_wavelength(wavelength) + // , m_direction(direction) + , m_alpha(direction.alpha()) + , m_phi(direction.phi()) { setName("Beam"); + registerParameter("Intensity", &m_intensity).setNonnegative(); registerParameter("Wavelength", &m_wavelength).setUnit("nm").setNonnegative(); registerParameter("InclinationAngle", &m_alpha).setUnit("rad").setLimited(0, INCLINATION_LIMIT); registerParameter("AzimuthalAngle", &m_phi).setUnit("rad").setLimited(-M_PI_2, M_PI_2); - registerParameter("Intensity", &m_intensity).setNonnegative(); registerVector("BlochVector", &m_bloch_vector, ""); } Beam Beam::horizontalBeam() { - return Beam(1.0, 0.0, 0.0, 1.0); + return Beam(1.0, 1.0, {0, 0}); } -Beam::Beam(const Beam& other) - : Beam(other.m_wavelength, other.m_alpha, other.m_phi, other.m_intensity) { +Beam::Beam(const Beam& other) : Beam(other.m_intensity, other.m_wavelength, other.direction()) { m_bloch_vector = other.m_bloch_vector; setName(other.getName()); if (other.m_shape_factor) { @@ -47,10 +50,11 @@ Beam::Beam(const Beam& other) } Beam& Beam::operator=(const Beam& other) { + m_intensity = other.m_intensity; m_wavelength = other.m_wavelength; + // m_direction = other.m_direction; m_alpha = other.m_alpha; m_phi = other.m_phi; - m_intensity = other.m_intensity; m_bloch_vector = other.m_bloch_vector; setName(other.getName()); if (other.m_shape_factor) { @@ -64,19 +68,27 @@ Beam& Beam::operator=(const Beam& other) { Beam::~Beam() = default; kvector_t Beam::getCentralK() const { - return vecOfLambdaAlphaPhi(m_wavelength, -m_alpha, m_phi); + return M_TWOPI / m_wavelength * Direction(-direction().alpha(), direction().phi()).vector(); } -void Beam::setCentralK(double wavelength, double alpha_i, double phi_i) { +void Beam::setWavelength(double wavelength) { if (wavelength <= 0.0) throw std::runtime_error( "Beam::setCentralK() -> Error. Wavelength can't be negative or zero."); - if (alpha_i < 0.0) + m_wavelength = wavelength; +} + +void Beam::setDirection(const Direction& direction) { + if (direction.alpha() < 0.0) throw std::runtime_error( "Beam::setCentralK() -> Error. Inclination angle alpha_i can't be negative."); - m_wavelength = wavelength; - m_alpha = alpha_i; - m_phi = phi_i; + // m_direction = direction; + m_alpha = direction.alpha(); + m_phi = direction.phi(); +} + +void Beam::setInclination(const double alpha) { + m_alpha = alpha; } const IFootprintFactor* Beam::footprintFactor() const { diff --git a/Device/Beam/Beam.h b/Device/Beam/Beam.h index bf1dbd2d311a19d854ff297583bf14408d6e8d67..c07bdb1a75985c9bf16496511f08c655d40a0718 100644 --- a/Device/Beam/Beam.h +++ b/Device/Beam/Beam.h @@ -15,6 +15,7 @@ #ifndef BORNAGAIN_DEVICE_BEAM_BEAM_H #define BORNAGAIN_DEVICE_BEAM_BEAM_H +#include "Base/Vector/Direction.h" #include "Base/Vector/EigenCore.h" #include "Param/Node/INode.h" @@ -25,7 +26,7 @@ class IFootprintFactor; class Beam : public INode { public: - Beam(double wavelength, double alpha, double phi, double intensity); + Beam(double intensity, double wavelength, const Direction& direction); Beam(const Beam& other); Beam& operator=(const Beam& other); @@ -34,49 +35,44 @@ public: static Beam horizontalBeam(); - //! Returns the wavevector - kvector_t getCentralK() const; - - //! Sets the wavevector in terms of wavelength and incoming angles - void setCentralK(double wavelength, double alpha_i, double phi_i); + void accept(INodeVisitor* visitor) const override { visitor->visit(this); } + std::vector<const INode*> getChildren() const override; //! Returns the beam intensity in neutrons/sec - double getIntensity() const { return m_intensity; } - - //! Sets the beam intensity in neutrons/sec - void setIntensity(double intensity) { m_intensity = intensity; } + double intensity() const { return m_intensity; } + double wavelength() const { return m_wavelength; } + // Direction& direction() { return m_direction; } + Direction direction() const { return {m_alpha, m_phi}; } // TODO -> const .. & + //! Returns the wavevector + kvector_t getCentralK() const; + kvector_t getBlochVector() const; //! Returns footprint factor. const IFootprintFactor* footprintFactor() const; +#ifndef SWIG + //! Returns the polarization density matrix (in spin basis along z-axis) + Eigen::Matrix2cd getPolarization() const; +#endif + void setWavelength(double wavelength); + void setDirection(const Direction& direction); + void setInclination(const double alpha); + //! Sets the beam intensity in neutrons/sec + void setIntensity(double intensity) { m_intensity = intensity; } //! Sets footprint factor to the beam. void setFootprintFactor(const IFootprintFactor& shape_factor); - //! Sets beam to sample width ratio in footprint factor. void setWidthRatio(double width_ratio); - //! Sets the polarization density matrix according to the given Bloch vector void setPolarization(const kvector_t bloch_vector); - kvector_t getBlochVector() const; - -#ifndef SWIG - //! Returns the polarization density matrix (in spin basis along z-axis) - Eigen::Matrix2cd getPolarization() const; -#endif - - double getWavelength() const { return m_wavelength; } - double getAlpha() const { return m_alpha; } - double getPhi() const { return m_phi; } - - void accept(INodeVisitor* visitor) const override { visitor->visit(this); } - std::vector<const INode*> getChildren() const override; - private: + Beam(); // needed by Swig + double m_intensity; //!< beam intensity (neutrons/sec) double m_wavelength; + // Direction m_direction; TODO double m_alpha; double m_phi; - double m_intensity; //!< beam intensity (neutrons/sec) std::unique_ptr<IFootprintFactor> m_shape_factor; //!< footprint correction handler kvector_t m_bloch_vector; //!< Bloch vector encoding the beam's polarization }; diff --git a/Device/Data/CumulativeValue.h b/Device/Data/CumulativeValue.h index a000a77db23a285698053db9a0a24693e44fe41b..c669e56267ed1b43f01cc7bc250af535d3fd17cd 100644 --- a/Device/Data/CumulativeValue.h +++ b/Device/Data/CumulativeValue.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DATA_CUMULATIVEVALUE_H #define BORNAGAIN_DEVICE_DATA_CUMULATIVEVALUE_H diff --git a/Device/Data/LLData.h b/Device/Data/LLData.h index 5f097da00f1624b0c90c1fa07ee91761cff86500..a3b84ea5f14b18e0f42e093d5e5e3c007db1c171 100644 --- a/Device/Data/LLData.h +++ b/Device/Data/LLData.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DATA_LLDATA_H #define BORNAGAIN_DEVICE_DATA_LLDATA_H diff --git a/Device/Data/OutputDataIterator.h b/Device/Data/OutputDataIterator.h index 0ff84b877a5eac4ace6c0906c3270b2068cca4a5..c65ccc362495e874833dde46460439d7d0a7a94b 100644 --- a/Device/Data/OutputDataIterator.h +++ b/Device/Data/OutputDataIterator.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DATA_OUTPUTDATAITERATOR_H #define BORNAGAIN_DEVICE_DATA_OUTPUTDATAITERATOR_H diff --git a/Device/Detector/DetectionProperties.h b/Device/Detector/DetectionProperties.h index 9b0a1729958ce356282004e2ebe1dcadb47218a2..eedd05c70560088d00dea29371b23e0c22e72145 100644 --- a/Device/Detector/DetectionProperties.h +++ b/Device/Detector/DetectionProperties.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_DETECTIONPROPERTIES_H #define BORNAGAIN_DEVICE_DETECTOR_DETECTIONPROPERTIES_H diff --git a/Device/Detector/DetectorContext.h b/Device/Detector/DetectorContext.h index d4129120baa356852ff73be6b6f13c82bfd13238..deecf6d296452e59f09777df7d273d181c33c61c 100644 --- a/Device/Detector/DetectorContext.h +++ b/Device/Detector/DetectorContext.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_DETECTORCONTEXT_H #define BORNAGAIN_DEVICE_DETECTOR_DETECTORCONTEXT_H diff --git a/Device/Detector/DetectorMask.cpp b/Device/Detector/DetectorMask.cpp index 61a56b618b6298f55c06351ab2e5881001bb5337..2735302d507c729046282a65949a26f53c39f336 100644 --- a/Device/Detector/DetectorMask.cpp +++ b/Device/Detector/DetectorMask.cpp @@ -82,12 +82,6 @@ Histogram2D* DetectorMask::createHistogram() const { return dynamic_cast<Histogram2D*>(IHistogram::createHistogram(data)); } -void DetectorMask::removeMasks() { - m_shapes.clear(); - m_mask_of_shape.clear(); - m_mask_data.clear(); -} - size_t DetectorMask::numberOfMasks() const { return m_shapes.size(); } diff --git a/Device/Detector/DetectorMask.h b/Device/Detector/DetectorMask.h index 58743f70213792964f8c8289bd6338ed3f99e406..cf2b69468ae733931f0207e0b64db645087e1a47 100644 --- a/Device/Detector/DetectorMask.h +++ b/Device/Detector/DetectorMask.h @@ -48,9 +48,6 @@ public: Histogram2D* createHistogram() const; - //! remove all masks and return object to initial state - void removeMasks(); - //! returns true if has masks bool hasMasks() const { return !m_shapes.empty(); } diff --git a/Device/Detector/IDetector.cpp b/Device/Detector/IDetector.cpp index 853ca6f5586aa1fc0266d6f8ad3aab676f6a9959..6bda7c4572a9f9266072f47dc2090752950e0c71 100644 --- a/Device/Detector/IDetector.cpp +++ b/Device/Detector/IDetector.cpp @@ -122,10 +122,6 @@ void IDetector::applyDetectorResolution(OutputData<double>* p_intensity_map) con } } -void IDetector::removeDetectorResolution() { - m_detector_resolution.reset(); -} - const IDetectorResolution* IDetector::detectorResolution() const { return m_detector_resolution.get(); } @@ -165,7 +161,7 @@ void IDetector::setDataToDetectorMap(OutputData<double>& detectorMap, if (elements.empty()) return; iterate([&](const_iterator it) { - detectorMap[it.roiIndex()] = elements[it.elementIndex()].getIntensity(); + detectorMap[it.roiIndex()] = elements[it.elementIndex()].intensity(); }); } diff --git a/Device/Detector/IDetector.h b/Device/Detector/IDetector.h index 3a103fa995e2b03da6c89af59e744d9e5fcad531..995c6c22b70a383dc2a9c735e9405fc86a86de0c 100644 --- a/Device/Detector/IDetector.h +++ b/Device/Detector/IDetector.h @@ -46,48 +46,37 @@ public: void addAxis(const IAxis& axis); - const IAxis& axis(size_t index) const; - - //! Returns actual dimensionality of the detector (number of defined axes) - size_t dimension() const; - - //! Calculate axis index for given global index - size_t axisBinIndex(size_t index, size_t selected_axis) const; - - //! Returns total number of pixels - size_t totalSize() const; - - //! Returns detector masks container - virtual const DetectorMask* detectorMask() const = 0; - //! Sets the polarization analyzer characteristics of the detector void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission); - //! Sets the detector resolution void setDetectorResolution(const IDetectorResolution& p_detector_resolution); void setResolutionFunction(const IResolutionFunction2D& resFunc); - //! Applies the detector resolution to the given intensity maps - void applyDetectorResolution(OutputData<double>* p_intensity_map) const; + //! Resets region of interest making whole detector plane available for the simulation. + virtual void resetRegionOfInterest() = 0; + //! Returns detector masks container + virtual const DetectorMask* detectorMask() const = 0; + + std::vector<const INode*> getChildren() const override; - //! Removes detector resolution function. - void removeDetectorResolution(); + void iterate(std::function<void(const_iterator)> func, bool visit_masks = false) const; + const IAxis& axis(size_t index) const; + //! Returns actual dimensionality of the detector (number of defined axes) + size_t dimension() const; + //! Calculate axis index for given global index + size_t axisBinIndex(size_t index, size_t selected_axis) const; + //! Returns total number of pixels + size_t totalSize() const; + //! Applies the detector resolution to the given intensity maps + void applyDetectorResolution(OutputData<double>* p_intensity_map) const; //! Returns a pointer to detector resolution object const IDetectorResolution* detectorResolution() const; - #ifndef SWIG //! Returns empty detector map in given axes units. std::unique_ptr<OutputData<double>> createDetectorMap() const; #endif // SWIG - - //! Returns region of interest if exists. - virtual const RegionOfInterest* regionOfInterest() const = 0; - - //! Resets region of interest making whole detector plane available for the simulation. - virtual void resetRegionOfInterest() = 0; - //! Returns detection properties const DetectionProperties& detectionProperties() const { return m_detection_properties; } @@ -102,9 +91,8 @@ public: //! Returns number of simulation elements. size_t numberOfSimulationElements() const; - std::vector<const INode*> getChildren() const override; - - void iterate(std::function<void(const_iterator)> func, bool visit_masks = false) const; + //! Returns region of interest if exists. + virtual const RegionOfInterest* regionOfInterest() const = 0; protected: IDetector(const IDetector& other); diff --git a/Device/Detector/IDetector2D.cpp b/Device/Detector/IDetector2D.cpp index d56939358b591bb483d0a4d15db68da997405455..5da7895fbfcde7ce7e674fb59d88a9e97e995817 100644 --- a/Device/Detector/IDetector2D.cpp +++ b/Device/Detector/IDetector2D.cpp @@ -64,10 +64,6 @@ std::unique_ptr<DetectorContext> IDetector2D::createContext() const { return std::make_unique<DetectorContext>(this); } -void IDetector2D::removeMasks() { - m_detector_mask.removeMasks(); -} - void IDetector2D::addMask(const IShape2D& shape, bool mask_value) { m_detector_mask.addMask(shape, mask_value); m_detector_mask.initMaskData(*this); @@ -76,7 +72,6 @@ void IDetector2D::addMask(const IShape2D& shape, bool mask_value) { void IDetector2D::maskAll() { if (dimension() != 2) return; - m_detector_mask.removeMasks(); addMask(InfinitePlane(), true); } diff --git a/Device/Detector/IDetector2D.h b/Device/Detector/IDetector2D.h index 8bdfc087c625f5a9a02ffea6eada5324597a2e6f..b6863a731de988b359a02191972560cbfdf14ea2 100644 --- a/Device/Detector/IDetector2D.h +++ b/Device/Detector/IDetector2D.h @@ -39,9 +39,6 @@ public: void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max); - //! Removes all masks from the detector - void removeMasks(); - const DetectorMask* detectorMask() const override; //! Adds mask of given shape to the stack of detector masks. The mask value 'true' means diff --git a/Device/Detector/RectangularDetector.cpp b/Device/Detector/RectangularDetector.cpp index c78fe81e531a89efc8d80929f4cf07625e962658..16f32aa9922de730fd0a2813fd55a46fa19418c7 100644 --- a/Device/Detector/RectangularDetector.cpp +++ b/Device/Detector/RectangularDetector.cpp @@ -55,7 +55,7 @@ RectangularDetector* RectangularDetector::clone() const { } void RectangularDetector::init(const Beam& beam) { - double alpha_i = beam.getAlpha(); + double alpha_i = beam.direction().alpha(); kvector_t central_k = beam.getCentralK(); initNormalVector(central_k); initUandV(alpha_i); @@ -197,9 +197,9 @@ std::string RectangularDetector::axisName(size_t index) const { size_t RectangularDetector::indexOfSpecular(const Beam& beam) const { if (dimension() != 2) return totalSize(); - const double alpha = beam.getAlpha(); - const double phi = beam.getPhi(); - const kvector_t k_spec = vecOfLambdaAlphaPhi(beam.getWavelength(), alpha, phi); + const double alpha = beam.direction().alpha(); + const double phi = beam.direction().phi(); + const kvector_t k_spec = vecOfLambdaAlphaPhi(beam.wavelength(), alpha, phi); const kvector_t normal_unit = m_normal_to_detector.unit(); const double kd = k_spec.dot(normal_unit); if (kd <= 0.0) diff --git a/Device/Detector/RectangularPixel.h b/Device/Detector/RectangularPixel.h index 7b87cb051aee0fb7c4905081508d122cbc103a03..a61a082cdea65ba811bf487a60d6833541cb0162 100644 --- a/Device/Detector/RectangularPixel.h +++ b/Device/Detector/RectangularPixel.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_RECTANGULARPIXEL_H #define BORNAGAIN_DEVICE_DETECTOR_RECTANGULARPIXEL_H diff --git a/Device/Detector/RegionOfInterest.h b/Device/Detector/RegionOfInterest.h index f5e00d9932bdf84db5a2b3362d29d1f7da417ed9..3466366fbf044d64d8126322f1c8a4f21e093109 100644 --- a/Device/Detector/RegionOfInterest.h +++ b/Device/Detector/RegionOfInterest.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_REGIONOFINTEREST_H #define BORNAGAIN_DEVICE_DETECTOR_REGIONOFINTEREST_H diff --git a/Device/Detector/SimpleUnitConverters.cpp b/Device/Detector/SimpleUnitConverters.cpp index 5b4b480d5f9cacc05b2fcd1c33e9d6327d1de616..17bfce06064e588b57d8b890e8aac977b82c1894 100644 --- a/Device/Detector/SimpleUnitConverters.cpp +++ b/Device/Detector/SimpleUnitConverters.cpp @@ -36,7 +36,9 @@ double getQ(double wavelength, double angle) { // ************************************************************************************************ UnitConverterSimple::UnitConverterSimple(const Beam& beam) - : m_wavelength(beam.getWavelength()), m_alpha_i(-beam.getAlpha()), m_phi_i(beam.getPhi()) {} + : m_wavelength(beam.wavelength()) + , m_alpha_i(-beam.direction().alpha()) + , m_phi_i(beam.direction().phi()) {} size_t UnitConverterSimple::dimension() const { return m_axis_data_table.size(); diff --git a/Device/Detector/SimpleUnitConverters.h b/Device/Detector/SimpleUnitConverters.h index 491db8a1f166b4d9a0098ffab572be81ff14efff..2b100f2f7756bb36641944aa1bc1b393abf58b95 100644 --- a/Device/Detector/SimpleUnitConverters.h +++ b/Device/Detector/SimpleUnitConverters.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_SIMPLEUNITCONVERTERS_H #define BORNAGAIN_DEVICE_DETECTOR_SIMPLEUNITCONVERTERS_H diff --git a/Device/Detector/SimulationArea.h b/Device/Detector/SimulationArea.h index bf79efa44159484064b394b963874d2c0c066a85..10ea8c4bed5c6520dc2d7ae28a6a84c726ebc0f4 100644 --- a/Device/Detector/SimulationArea.h +++ b/Device/Detector/SimulationArea.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREA_H #define BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREA_H diff --git a/Device/Detector/SimulationAreaIterator.h b/Device/Detector/SimulationAreaIterator.h index 2bfbb0c75f5fb6eff55147b81c98db651f769114..8593ea79c7a7556a8c7579c7a4baa15a8ef561c6 100644 --- a/Device/Detector/SimulationAreaIterator.h +++ b/Device/Detector/SimulationAreaIterator.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREAITERATOR_H #define BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREAITERATOR_H diff --git a/Device/Detector/SpecularDetector1D.h b/Device/Detector/SpecularDetector1D.h index 49d21651cf550147e513f84b0f4602bef64d48e2..38b3e7494ad33ea51717afbfba01962ec4c4c4a0 100644 --- a/Device/Detector/SpecularDetector1D.h +++ b/Device/Detector/SpecularDetector1D.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_SPECULARDETECTOR1D_H #define BORNAGAIN_DEVICE_DETECTOR_SPECULARDETECTOR1D_H diff --git a/Device/Detector/SphericalDetector.cpp b/Device/Detector/SphericalDetector.cpp index 5f61a66758704421ae2352a0c64b7d6c7a2c1515..5266e1c3f51215735ccb01b575e674722062fac0 100644 --- a/Device/Detector/SphericalDetector.cpp +++ b/Device/Detector/SphericalDetector.cpp @@ -68,8 +68,8 @@ std::string SphericalDetector::axisName(size_t index) const { size_t SphericalDetector::indexOfSpecular(const Beam& beam) const { if (dimension() != 2) return totalSize(); - double alpha = beam.getAlpha(); - double phi = beam.getPhi(); + double alpha = beam.direction().alpha(); + double phi = beam.direction().phi(); const IAxis& phi_axis = axis(0); const IAxis& alpha_axis = axis(1); if (phi_axis.contains(phi) && alpha_axis.contains(alpha)) diff --git a/Device/Detector/SphericalPixel.cpp b/Device/Detector/SphericalPixel.cpp index 8768aad62646ae654f476b811822e5f98bf2b9fb..1e218d1100c3aef55b8ab60a0c77508859c10d9a 100644 --- a/Device/Detector/SphericalPixel.cpp +++ b/Device/Detector/SphericalPixel.cpp @@ -14,6 +14,7 @@ #include "Device/Detector/SphericalPixel.h" #include "Base/Axis/Bin.h" +#include "Base/Vector/Direction.h" SphericalPixel::SphericalPixel(const Bin1D& alpha_bin, const Bin1D& phi_bin) : m_alpha(alpha_bin.m_lower) diff --git a/Device/Detector/SphericalPixel.h b/Device/Detector/SphericalPixel.h index f21306f0dd91bcf9898fddfec0cdcfa8717f9e21..2577b4c2685554c2555641160451c3af4f2590a8 100644 --- a/Device/Detector/SphericalPixel.h +++ b/Device/Detector/SphericalPixel.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_DETECTOR_SPHERICALPIXEL_H #define BORNAGAIN_DEVICE_DETECTOR_SPHERICALPIXEL_H diff --git a/Device/InputOutput/DataFormatUtils.h b/Device/InputOutput/DataFormatUtils.h index 07fee8ce0aa4121ac379fd5c431912f0c6988c4c..90fe0778af5c405a601a6b71b3c00a09914f2e32 100644 --- a/Device/InputOutput/DataFormatUtils.h +++ b/Device/InputOutput/DataFormatUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_DATAFORMATUTILS_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_DATAFORMATUTILS_H diff --git a/Device/InputOutput/OutputDataReadReflectometry.h b/Device/InputOutput/OutputDataReadReflectometry.h index ff50874fb225b2f00a9d2aa0e91c030f8131b303..4a536ce063dcf4e2619585b7e1b7fd875efb04de 100644 --- a/Device/InputOutput/OutputDataReadReflectometry.h +++ b/Device/InputOutput/OutputDataReadReflectometry.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADREFLECTOMETRY_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADREFLECTOMETRY_H diff --git a/Device/InputOutput/OutputDataReadWriteINT.h b/Device/InputOutput/OutputDataReadWriteINT.h index 4c256096e8659afcd20ce518a815951228c4830e..7e354328da62aa0c6c8190eee20e543d809ffece 100644 --- a/Device/InputOutput/OutputDataReadWriteINT.h +++ b/Device/InputOutput/OutputDataReadWriteINT.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITEINT_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITEINT_H diff --git a/Device/InputOutput/OutputDataReadWriteNumpyTXT.h b/Device/InputOutput/OutputDataReadWriteNumpyTXT.h index 121eb5e01859c78e627ad78c9707b982c0e17cf8..f8199964809d88615756b88d2bff22fb14c0b847 100644 --- a/Device/InputOutput/OutputDataReadWriteNumpyTXT.h +++ b/Device/InputOutput/OutputDataReadWriteNumpyTXT.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITENUMPYTXT_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITENUMPYTXT_H diff --git a/Device/InputOutput/OutputDataReadWriteTiff.h b/Device/InputOutput/OutputDataReadWriteTiff.h index 3e4e1cb7c870d12f1b112e73aef69887e0127f8b..286caa5b138aae0eac593d31feda43d0d1197d4d 100644 --- a/Device/InputOutput/OutputDataReadWriteTiff.h +++ b/Device/InputOutput/OutputDataReadWriteTiff.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITETIFF_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITETIFF_H diff --git a/Device/InputOutput/boost_streams.h b/Device/InputOutput/boost_streams.h index ea415afa1c516619295a5a3268d44367cbd7f967..aeda4f3cb92eefad9c31d308f37fec4e9441b1ef 100644 --- a/Device/InputOutput/boost_streams.h +++ b/Device/InputOutput/boost_streams.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_BOOST_STREAMS_H #define BORNAGAIN_DEVICE_INPUTOUTPUT_BOOST_STREAMS_H diff --git a/Device/Instrument/FourierTransform.h b/Device/Instrument/FourierTransform.h index 75be1261b9e9abbf695888c243c41fac7b65b1af..07e08ee8d252f66cab00207208e99acda1c1c590 100644 --- a/Device/Instrument/FourierTransform.h +++ b/Device/Instrument/FourierTransform.h @@ -13,6 +13,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INSTRUMENT_FOURIERTRANSFORM_H #define BORNAGAIN_DEVICE_INSTRUMENT_FOURIERTRANSFORM_H diff --git a/Device/Instrument/Instrument.cpp b/Device/Instrument/Instrument.cpp index 8df69595b7b6cfe85ec11c2f5c45eaba3ab834bd..dec056caedc9c75c0912a0d12bec6be76158725d 100644 --- a/Device/Instrument/Instrument.cpp +++ b/Device/Instrument/Instrument.cpp @@ -17,12 +17,16 @@ #include "Device/Histo/Histogram2D.h" #include "Device/Resolution/IResolutionFunction2D.h" -Instrument::Instrument() : m_detector(new SphericalDetector), m_beam(Beam::horizontalBeam()) { +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(), SphericalDetector()) {} + Instrument::Instrument(const Instrument& other) : INode(), m_beam(other.m_beam) { if (other.m_detector) setDetector(*other.m_detector); @@ -63,28 +67,13 @@ std::vector<const INode*> Instrument::getChildren() const { return result; } -void Instrument::setDetectorResolutionFunction(const IResolutionFunction2D& p_resolution_function) { - m_detector->setResolutionFunction(p_resolution_function); -} - -void Instrument::removeDetectorResolution() { - m_detector->removeDetectorResolution(); -} - -void Instrument::applyDetectorResolution(OutputData<double>* p_intensity_map) const { - m_detector->applyDetectorResolution(p_intensity_map); -} - void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i) { - m_beam.setCentralK(wavelength, alpha_i, phi_i); + m_beam.setWavelength(wavelength); + m_beam.setDirection({alpha_i, phi_i}); if (m_detector) initDetector(); } -const DetectorMask* Instrument::getDetectorMask() const { - return m_detector->detectorMask(); -} - void Instrument::setBeam(const Beam& beam) { m_beam = beam; if (m_detector) @@ -99,10 +88,6 @@ void Instrument::setBeamPolarization(const kvector_t bloch_vector) { m_beam.setPolarization(bloch_vector); } -double Instrument::getBeamIntensity() const { - return m_beam.getIntensity(); -} - const IDetector* Instrument::getDetector() const { ASSERT(m_detector); return m_detector.get(); @@ -133,16 +118,3 @@ const IDetector2D& Instrument::detector2D() const { throw std::runtime_error("Error: Detector is not twodimensional"); return *p; } - -const IAxis& Instrument::getDetectorAxis(size_t index) const { - return m_detector->axis(index); -} - -size_t Instrument::getDetectorDimension() const { - return m_detector->dimension(); -} - -void Instrument::setAnalyzerProperties(const kvector_t direction, double efficiency, - double total_transmission) { - m_detector->setAnalyzerProperties(direction, efficiency, total_transmission); -} diff --git a/Device/Instrument/Instrument.h b/Device/Instrument/Instrument.h index 18c72d98608eff41f2e4751a3edf488a86a98f85..76639628b5cb4e8f32438fc7665cc9b0da935fcb 100644 --- a/Device/Instrument/Instrument.h +++ b/Device/Instrument/Instrument.h @@ -12,20 +12,18 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INSTRUMENT_INSTRUMENT_H #define BORNAGAIN_DEVICE_INSTRUMENT_INSTRUMENT_H #include "Device/Beam/Beam.h" #include <memory> -template <class T> class OutputData; -class Histogram2D; -class DetectorMask; -class IAxis; class IDetector; class IDetector2D; -class IResolutionFunction2D; -class SimulationElement; //! Assembles beam, detector and their relative positions with respect to the sample. //! @ingroup simulation_internal @@ -33,6 +31,7 @@ class SimulationElement; class Instrument : public INode { public: Instrument(); + Instrument(const Beam& beam, const IDetector& detector); Instrument(const Instrument& other); Instrument& operator=(const Instrument& other); @@ -52,8 +51,6 @@ public: //! Sets the beam's polarization according to the given Bloch vector void setBeamPolarization(const kvector_t bloch_vector); - double getBeamIntensity() const; - const IDetector* getDetector() const; IDetector& detector(); const IDetector& detector() const; @@ -61,36 +58,17 @@ public: IDetector2D& detector2D(); const IDetector2D& detector2D() const; - const DetectorMask* getDetectorMask() const; - - const IAxis& getDetectorAxis(size_t index) const; - - size_t getDetectorDimension() const; - //! Sets the detector (axes can be overwritten later) void setDetector(const IDetector& detector); - //! Sets detector resolution function - void setDetectorResolutionFunction(const IResolutionFunction2D& p_resolution_function); - - //! Removes detector resolution function. - void removeDetectorResolution(); - - //! Sets the polarization analyzer characteristics of the detector - void setAnalyzerProperties(const kvector_t direction, double efficiency, - double total_transmission); - - //! apply the detector resolution to the given intensity map - void applyDetectorResolution(OutputData<double>* p_intensity_map) const; - //! init detector with beam settings void initDetector(); std::vector<const INode*> getChildren() const; protected: - std::unique_ptr<IDetector> m_detector; Beam m_beam; + std::unique_ptr<IDetector> m_detector; }; #endif // BORNAGAIN_DEVICE_INSTRUMENT_INSTRUMENT_H diff --git a/Device/Intensity/ArrayUtils.h b/Device/Intensity/ArrayUtils.h index 9a667484312696da7ec1ba4348f59f13ce4d9e4b..105daba33698de04f8cf001ad82f72101016a835 100644 --- a/Device/Intensity/ArrayUtils.h +++ b/Device/Intensity/ArrayUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_INTENSITY_ARRAYUTILS_H #define BORNAGAIN_DEVICE_INTENSITY_ARRAYUTILS_H diff --git a/Device/Mask/InfinitePlane.h b/Device/Mask/InfinitePlane.h index 1a767e6c17c2328fe3fc3558574f45cd2b9bb931..83df83711fb406737dd7b0556bf561acb73f253b 100644 --- a/Device/Mask/InfinitePlane.h +++ b/Device/Mask/InfinitePlane.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_MASK_INFINITEPLANE_H #define BORNAGAIN_DEVICE_MASK_INFINITEPLANE_H diff --git a/Device/Resolution/ConvolutionDetectorResolution.h b/Device/Resolution/ConvolutionDetectorResolution.h index 715724c3f85fe9b1579d35742f581374d20f9495..88d757ea1d2e76f8bd7eb8f4d84932bc99a688da 100644 --- a/Device/Resolution/ConvolutionDetectorResolution.h +++ b/Device/Resolution/ConvolutionDetectorResolution.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_RESOLUTION_CONVOLUTIONDETECTORRESOLUTION_H #define BORNAGAIN_DEVICE_RESOLUTION_CONVOLUTIONDETECTORRESOLUTION_H diff --git a/Device/Resolution/Convolve.h b/Device/Resolution/Convolve.h index 9b5bef7d79acb31a3ceb946b0df4da4c464813d7..d83dd05e4c5bb32f08201ebdf09420400f78fa33 100644 --- a/Device/Resolution/Convolve.h +++ b/Device/Resolution/Convolve.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_RESOLUTION_CONVOLVE_H #define BORNAGAIN_DEVICE_RESOLUTION_CONVOLVE_H diff --git a/Device/Unit/AxisNames.h b/Device/Unit/AxisNames.h index e83d67c1ad56fbd425f2674dad44ee3ed460d847..62c47573a9f222787b2f771a7cecd35310f1f8d7 100644 --- a/Device/Unit/AxisNames.h +++ b/Device/Unit/AxisNames.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_DEVICE_UNIT_AXISNAMES_H #define BORNAGAIN_DEVICE_UNIT_AXISNAMES_H diff --git a/Examples/Python/fit51_Basic/basic_fitting_tutorial.py b/Examples/Python/fit51_Basic/basic_fitting_tutorial.py index 7c24670e02cf641def86125bd3a9d1c136f06ec6..0ae9626101ea467aed45b96e75b3de5804d3bd47 100644 --- a/Examples/Python/fit51_Basic/basic_fitting_tutorial.py +++ b/Examples/Python/fit51_Basic/basic_fitting_tutorial.py @@ -50,7 +50,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit51_Basic/consecutive_fitting.py b/Examples/Python/fit51_Basic/consecutive_fitting.py index 4be55737e244530eae4c1cf8c354fc85e70da472..59193cf7f5d9f85db60fd8cfa022968fd4b899ee 100644 --- a/Examples/Python/fit51_Basic/consecutive_fitting.py +++ b/Examples/Python/fit51_Basic/consecutive_fitting.py @@ -47,7 +47,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, 0.0*deg, 2.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit51_Basic/minimizer_settings.py b/Examples/Python/fit51_Basic/minimizer_settings.py index 524c2907dd94bc15e1ca0762c7ee1f62a6862fb4..dfffad0b1fa9b38439e42f4eaa676dcf30e52d3d 100644 --- a/Examples/Python/fit51_Basic/minimizer_settings.py +++ b/Examples/Python/fit51_Basic/minimizer_settings.py @@ -48,7 +48,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit52_Advanced/find_background.py b/Examples/Python/fit52_Advanced/find_background.py index 4bd5ce029f85d5ac18263a411c82765626ed4b20..001f8382bcea36b6a57cb9741f674a14f99b3eab 100644 --- a/Examples/Python/fit52_Advanced/find_background.py +++ b/Examples/Python/fit52_Advanced/find_background.py @@ -50,7 +50,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e12*scale) + simulation.beam().setIntensity(1e12*scale) simulation.setBackground(ba.ConstantBackground(background)) simulation.setSample(get_sample(params)) diff --git a/Examples/Python/fit52_Advanced/fit_along_slices.py b/Examples/Python/fit52_Advanced/fit_along_slices.py index 17c6e3b7a95e36268322a6097516d1ff4bfdce91..52e1fe7ad1c603bd60b9dd948aefba17858cb892 100644 --- a/Examples/Python/fit52_Advanced/fit_along_slices.py +++ b/Examples/Python/fit52_Advanced/fit_along_slices.py @@ -45,7 +45,7 @@ def get_simulation(params, add_masks=True): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) if add_masks: """ diff --git a/Examples/Python/fit52_Advanced/fit_with_masks.py b/Examples/Python/fit52_Advanced/fit_with_masks.py index 7491e37562b84b5bef0815b2da555dcd9a588389..6c00d5a7a6278801a95f1042236a16367704801e 100644 --- a/Examples/Python/fit52_Advanced/fit_with_masks.py +++ b/Examples/Python/fit52_Advanced/fit_with_masks.py @@ -44,7 +44,7 @@ def get_simulation(params, add_masks=True): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) if add_masks: @@ -107,15 +107,6 @@ def add_mask_to_simulation(simulation): simulation.addMask(ba.Rectangle(0.75*deg, 0.95*deg, 0.85*deg, 1.05*deg), False) - # other mask's shapes are possible too - # simulation.removeMasks() - # # rotated ellipse: - # simulation.addMask(ba.Ellipse(0.11*deg, 1.25*deg, - # 1.0*deg, 0.5*deg, 45.0*deg), True) - # simulation.addMask(Line(-1.0*deg, 0.0*deg, 1.0*deg, 2.0*deg), True) - # simulation.addMask(ba.HorizontalLine(1.0*deg), False) - # simulation.addMask(ba.VerticalLine(0.0*deg), False) - def run_fitting(): """ diff --git a/Examples/Python/fit52_Advanced/multiple_datasets.py b/Examples/Python/fit52_Advanced/multiple_datasets.py index ff95b47817b18d4c18b1fd7fd18a630a6582638e..96a02b7ca043abca234a150a89ee8dcfb1c37abd 100644 --- a/Examples/Python/fit52_Advanced/multiple_datasets.py +++ b/Examples/Python/fit52_Advanced/multiple_datasets.py @@ -47,7 +47,7 @@ def get_simulation(params): simulation.setDetectorParameters(50, -1.5*deg, 1.5*deg, 50, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, incident_angle, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit53_CustomObjective/custom_objective_function.py b/Examples/Python/fit53_CustomObjective/custom_objective_function.py index daa8e8cb6de2c54419b0605a714bbc7d52530cdb..c9d41a5d81fd886efbbdae5688dc8b6e8ce3ac9c 100644 --- a/Examples/Python/fit53_CustomObjective/custom_objective_function.py +++ b/Examples/Python/fit53_CustomObjective/custom_objective_function.py @@ -75,7 +75,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit54_ExternalMinimizer/lmfit_basics.py b/Examples/Python/fit54_ExternalMinimizer/lmfit_basics.py index 9c4ce77ef235d3ba7468abd7a1a5024a344486f7..a2bd371deff962842473bdd2d430269a803c5492 100644 --- a/Examples/Python/fit54_ExternalMinimizer/lmfit_basics.py +++ b/Examples/Python/fit54_ExternalMinimizer/lmfit_basics.py @@ -49,7 +49,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit54_ExternalMinimizer/lmfit_with_plotting.py b/Examples/Python/fit54_ExternalMinimizer/lmfit_with_plotting.py index 1c020d21151ccae07e43a1afa0e672838e39f8c4..83a6aac72ee922d771be3204e5cfe3a5c6d93ff8 100644 --- a/Examples/Python/fit54_ExternalMinimizer/lmfit_with_plotting.py +++ b/Examples/Python/fit54_ExternalMinimizer/lmfit_with_plotting.py @@ -50,7 +50,7 @@ def get_simulation(params): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.setSample(get_sample(params)) return simulation diff --git a/Examples/Python/fit55_SpecularIntro/RealLifeReflectometryFitting.py b/Examples/Python/fit55_SpecularIntro/RealLifeReflectometryFitting.py index c76879c427e4cdc32d5f503dc06afd1feb07fc1f..d0b061bdffe15171b95d44837b3320e07470a206 100644 --- a/Examples/Python/fit55_SpecularIntro/RealLifeReflectometryFitting.py +++ b/Examples/Python/fit55_SpecularIntro/RealLifeReflectometryFitting.py @@ -100,7 +100,7 @@ def create_simulation(arg_dict, bin_start, bin_end): simulation = ba.SpecularSimulation() simulation.setScan(scan) - simulation.setBeamIntensity(arg_dict["intensity"]) + simulation.beam().setIntensity(arg_dict["intensity"]) return simulation diff --git a/Examples/Python/fit56_SpecularAdvanced/Honeycomb_fit.py b/Examples/Python/fit56_SpecularAdvanced/Honeycomb_fit.py index 2344575a1f8e6e3c6631bddd52f2f9b2da03a98c..e5977866c950d912380588ca9b2ed5592ae4ca31 100644 --- a/Examples/Python/fit56_SpecularAdvanced/Honeycomb_fit.py +++ b/Examples/Python/fit56_SpecularAdvanced/Honeycomb_fit.py @@ -97,7 +97,7 @@ def get_simulation(q_axis, fitParams, sign, ms150=False): simulation = ba.SpecularSimulation() simulation.setScan(scan) - simulation.setBeamIntensity(parameters["intensity"]) + simulation.beam().setIntensity(parameters["intensity"]) if ms150: sample = get_sample(parameters=parameters, diff --git a/Examples/Python/fit56_SpecularAdvanced/Pt_layer_fit.py b/Examples/Python/fit56_SpecularAdvanced/Pt_layer_fit.py index 93990f0eb6cc9964f99370a568c5e7034d855e25..95ea478c3acba5e0b77e12ff4353923debbdce26 100644 --- a/Examples/Python/fit56_SpecularAdvanced/Pt_layer_fit.py +++ b/Examples/Python/fit56_SpecularAdvanced/Pt_layer_fit.py @@ -67,7 +67,7 @@ def get_simulation(q_axis, parameters): scan.setAbsoluteQResolution(distr, parameters["q_res/q"]) simulation = ba.SpecularSimulation() - simulation.setBeamIntensity(parameters["intensity"]) + simulation.beam().setIntensity(parameters["intensity"]) simulation.setScan(scan) return simulation diff --git a/Examples/Python/fit61_Galaxi/fit_galaxi_data.py b/Examples/Python/fit61_Galaxi/fit_galaxi_data.py index 5bda0a44098f591f89d374573746b42aac82db31..fb7d6fcd69ea4e223e591fa22a3a0bdb4bcbf4df 100644 --- a/Examples/Python/fit61_Galaxi/fit_galaxi_data.py +++ b/Examples/Python/fit61_Galaxi/fit_galaxi_data.py @@ -37,7 +37,7 @@ def create_simulation(params): simulation = ba.GISASSimulation() simulation.setDetector(create_detector()) simulation.setBeamParameters(wavelength, alpha_i, 0.0) - simulation.setBeamIntensity(1.2e7) + simulation.beam().setIntensity(1.2e7) simulation.setRegionOfInterest(85.0, 70.0, 120.0, 92.) simulation.addMask(ba.Rectangle(101.9, 82.1, 103.7, 85.2), True) # beamstop diff --git a/Examples/Python/sim02_Complexes/BiMaterialCylinders.py b/Examples/Python/sim02_Complexes/BiMaterialCylinders.py index d2c4b45a9bb0b4c96391021b1a34f63c5fec72c6..c99b9de98ba2a6c4bfefebcc54c150e46627ea53 100644 --- a/Examples/Python/sim02_Complexes/BiMaterialCylinders.py +++ b/Examples/Python/sim02_Complexes/BiMaterialCylinders.py @@ -86,7 +86,7 @@ def get_simulation(): simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1.0e+08) + simulation.beam().setIntensity(1.0e+08) return simulation diff --git a/Examples/Python/sim03_Structures/FindPeaks.py b/Examples/Python/sim03_Structures/FindPeaks.py index 8ec943f7112c891bf6ad1efbaebd0cb4e8c2582b..73d5d3cc323d699c82bce0a2d72721adc9d43647 100644 --- a/Examples/Python/sim03_Structures/FindPeaks.py +++ b/Examples/Python/sim03_Structures/FindPeaks.py @@ -60,7 +60,7 @@ def get_simulation(): simulation.setDetectorParameters(200, -0.5*deg, 0.5*deg, 200, 0.0*deg, 0.6*deg) simulation.setBeamParameters(1.34*angstrom, 0.4*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.getOptions().setMonteCarloIntegration(True, 100) return simulation diff --git a/Examples/Python/sim03_Structures/RectangularGrating.py b/Examples/Python/sim03_Structures/RectangularGrating.py index 2fde5c4bc8803d8e961cd347fd24e16d6143e251..da5b67337499317af369d351c39d7c99a1c57af4 100644 --- a/Examples/Python/sim03_Structures/RectangularGrating.py +++ b/Examples/Python/sim03_Structures/RectangularGrating.py @@ -59,7 +59,7 @@ def get_simulation(): simulation.setDetectorParameters(200, -0.5*deg, 0.5*deg, 200, 0.0*deg, 0.6*deg) simulation.setBeamParameters(1.34*angstrom, 0.4*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.getOptions().setMonteCarloIntegration(True, 100) return simulation diff --git a/Examples/Python/sim04_Multilayers/CorrelatedRoughness.py b/Examples/Python/sim04_Multilayers/CorrelatedRoughness.py index b700ee46b850941757a0a7152de654672df11972..a32410384e7c997082411d3a6dbf060feee46284 100644 --- a/Examples/Python/sim04_Multilayers/CorrelatedRoughness.py +++ b/Examples/Python/sim04_Multilayers/CorrelatedRoughness.py @@ -52,7 +52,7 @@ def get_simulation(): simulation.setDetectorParameters(200, -0.5*deg, 0.5*deg, 200, 0.0*deg, 1.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(5e11) + simulation.beam().setIntensity(5e11) return simulation diff --git a/Examples/Python/sim04_Multilayers/GratingMC.py b/Examples/Python/sim04_Multilayers/GratingMC.py index c682f389350d63ab0e998b2bf24da7af8dc2791b..91cb58dfa3f6c1264b57abec931f3bc151e8ae57 100644 --- a/Examples/Python/sim04_Multilayers/GratingMC.py +++ b/Examples/Python/sim04_Multilayers/GratingMC.py @@ -60,7 +60,7 @@ def get_simulation(): simulation.setDetectorParameters(200, -0.5*deg, 0.5*deg, 200, 0.0*deg, 0.6*deg) simulation.setBeamParameters(1.34*angstrom, 0.4*deg, 0.0*deg) - simulation.setBeamIntensity(1e+08) + simulation.beam().setIntensity(1e+08) simulation.getOptions().setMonteCarloIntegration(True, 100) return simulation diff --git a/Examples/Python/sim05_Magnetism/MagneticSpheres.py b/Examples/Python/sim05_Magnetism/MagneticSpheres.py index 1b6277ea0a801dfb4a98908c95612aabf6fd4a44..171baed9ac7d00e256b8d063e3e2bed67e150fad 100644 --- a/Examples/Python/sim05_Magnetism/MagneticSpheres.py +++ b/Examples/Python/sim05_Magnetism/MagneticSpheres.py @@ -55,7 +55,7 @@ def get_simulation(): simulation.setDetectorParameters(200, -3.0*deg, 3.0*deg, 200, 0.0*deg, 6.0*deg) simulation.setBeamParameters(1.*angstrom, 0.5*deg, 0.0*deg) - simulation.setBeamIntensity(1e12) + simulation.beam().setIntensity(1e12) analyzer_dir = ba.kvector_t(0.0, 0.0, -1.0) beampol = ba.kvector_t(0.0, 0.0, 1.0) diff --git a/Examples/Python/sim11_Device/ConstantBackground.py b/Examples/Python/sim11_Device/ConstantBackground.py index 75935b4b9c9b04a5bcd5f0a08c49f783e4219943..a1e5e980907b73953ac9a142f39ef471663e25ad 100644 --- a/Examples/Python/sim11_Device/ConstantBackground.py +++ b/Examples/Python/sim11_Device/ConstantBackground.py @@ -48,7 +48,7 @@ def get_simulation(): simulation.setDetectorParameters(100, 0.0*deg, 2.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e6) + simulation.beam().setIntensity(1e6) bg = ba.ConstantBackground(1e3) simulation.setBackground(bg) return simulation diff --git a/Examples/Python/sim11_Device/OffSpecularSimulation.py b/Examples/Python/sim11_Device/OffSpecularSimulation.py index fae853ac2cf200101b68f245ea4b10bfbfcc603c..7784246f726613695eafa3ba83749b7853c4cff9 100644 --- a/Examples/Python/sim11_Device/OffSpecularSimulation.py +++ b/Examples/Python/sim11_Device/OffSpecularSimulation.py @@ -64,7 +64,7 @@ def get_simulation(): alpha_i_axis = ba.FixedBinAxis("alpha_i", 200, alpha_i_min*deg, alpha_i_max*deg) simulation.setBeamParameters(1.0*angstrom, alpha_i_axis, 0.0*deg) - simulation.setBeamIntensity(1e9) + simulation.beam().setIntensity(1e9) return simulation diff --git a/Examples/Python/sim11_Device/ResonatorOffSpecSetup.py b/Examples/Python/sim11_Device/ResonatorOffSpecSetup.py index 69de44dd35c387a24f8e15e632c06efe9b98c474..2ea4b1cc604c01e3fe6bcc1b629c631aee5aba74 100644 --- a/Examples/Python/sim11_Device/ResonatorOffSpecSetup.py +++ b/Examples/Python/sim11_Device/ResonatorOffSpecSetup.py @@ -72,7 +72,7 @@ def get_offspec_simulation(): alpha_i_max) simulation.setBeamParameters(5.0*angstrom, alpha_i_axis, 0.0) - simulation.setBeamIntensity(1e9) + simulation.beam().setIntensity(1e9) simulation.getOptions().setIncludeSpecular(True) # define detector resolution function with smearing depending on bin size diff --git a/Examples/Python/sim23_SAS/PolarizedSANS.py b/Examples/Python/sim23_SAS/PolarizedSANS.py index eff2352864e67fb3f72c99bb0de61adebcfe60f9..5c7f8a6f7c6cbac99e4ea1cb9928f0318e4d3782 100644 --- a/Examples/Python/sim23_SAS/PolarizedSANS.py +++ b/Examples/Python/sim23_SAS/PolarizedSANS.py @@ -63,7 +63,7 @@ def get_simulation(): # Defining beam parameters simulation.setBeamParameters(0.5*nm, 0.0*deg, 0.0*deg) - simulation.setBeamIntensity(1e12) + simulation.beam().setIntensity(1e12) # Defining beam polarization and polarization analysis for spin-flip channel analyzer_dir = kvector_t(0.0, 0.0, -1.0) diff --git a/Examples/Python/sim31_Parameterization/AccessingSimulationResults.py b/Examples/Python/sim31_Parameterization/AccessingSimulationResults.py index 5dd69b16e2eebbd937a9ad7d7c6944ce0eb5346e..b1e8ad350cd202d2ba4f521599eaecff9ff941ad 100644 --- a/Examples/Python/sim31_Parameterization/AccessingSimulationResults.py +++ b/Examples/Python/sim31_Parameterization/AccessingSimulationResults.py @@ -53,7 +53,7 @@ def get_simulation(): simulation.setDetectorParameters(201, -2.0*deg, 2.0*deg, 201, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) - simulation.setBeamIntensity(1e+05) + simulation.beam().setIntensity(1e+05) return simulation diff --git a/Fit/3rdParty/RootMinimizers/mathcore/Math/GSLMultiFitFunctionWrapper.h b/Fit/3rdParty/RootMinimizers/mathcore/Math/GSLMultiFitFunctionWrapper.h index e0bc9320a59423c56d1f3e0c39eeb2bbd48371ec..cfa97fcdb0738258283bc0129894b314caa9eaa8 100644 --- a/Fit/3rdParty/RootMinimizers/mathcore/Math/GSLMultiFitFunctionWrapper.h +++ b/Fit/3rdParty/RootMinimizers/mathcore/Math/GSLMultiFitFunctionWrapper.h @@ -32,6 +32,7 @@ #define ROOT_Math_GSLMultiFitFunctionWrapper #include "gsl/gsl_multifit.h" +#include "gsl/gsl_multifit_nlin.h" // patch JWu dec20 #include "GSLMultiFitFunctionAdapter.h" diff --git a/Fit/Adapter/GSLLevenbergMarquardtMinimizer.h b/Fit/Adapter/GSLLevenbergMarquardtMinimizer.h index 124a051d0494037750cc843e051d4326422fbbb4..7fa2133283f0ed7d2d5c96ec7bc1505326a155ce 100644 --- a/Fit/Adapter/GSLLevenbergMarquardtMinimizer.h +++ b/Fit/Adapter/GSLLevenbergMarquardtMinimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_GSLLEVENBERGMARQUARDTMINIMIZER_H #define BORNAGAIN_FIT_ADAPTER_GSLLEVENBERGMARQUARDTMINIMIZER_H diff --git a/Fit/Adapter/GSLMultiMinimizer.h b/Fit/Adapter/GSLMultiMinimizer.h index ccaae0ed179defb39e2dc3a36182877e9f3e0368..9ccf52a9489b4fe3e9e4b2bfd0330077cf8d4be8 100644 --- a/Fit/Adapter/GSLMultiMinimizer.h +++ b/Fit/Adapter/GSLMultiMinimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_GSLMULTIMINIMIZER_H #define BORNAGAIN_FIT_ADAPTER_GSLMULTIMINIMIZER_H diff --git a/Fit/Adapter/GeneticMinimizer.h b/Fit/Adapter/GeneticMinimizer.h index 34dcd51a263b9b67ae0d87d0b7f8d66a22b2574f..c3a2f548e67508f1a537e974e9b89a0eb3d1982a 100644 --- a/Fit/Adapter/GeneticMinimizer.h +++ b/Fit/Adapter/GeneticMinimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_GENETICMINIMIZER_H #define BORNAGAIN_FIT_ADAPTER_GENETICMINIMIZER_H diff --git a/Fit/Adapter/IFunctionAdapter.h b/Fit/Adapter/IFunctionAdapter.h index 3d56d5913de9bf17cdb77ab40603a8b389a14789..2cc5ea801f27e0fd2ed86fe8c667f82d34d268a9 100644 --- a/Fit/Adapter/IFunctionAdapter.h +++ b/Fit/Adapter/IFunctionAdapter.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_IFUNCTIONADAPTER_H #define BORNAGAIN_FIT_ADAPTER_IFUNCTIONADAPTER_H diff --git a/Fit/Adapter/MinimizerAdapter.h b/Fit/Adapter/MinimizerAdapter.h index 4afbff91042f1e6fffaa27d6b9c84468e1e46cad..4127c5935b5ef30bcac97091bc525158a805c136 100644 --- a/Fit/Adapter/MinimizerAdapter.h +++ b/Fit/Adapter/MinimizerAdapter.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_MINIMIZERADAPTER_H #define BORNAGAIN_FIT_ADAPTER_MINIMIZERADAPTER_H diff --git a/Fit/Adapter/Minuit2Minimizer.h b/Fit/Adapter/Minuit2Minimizer.h index 9222196e57302e6684be52a20e982beb7cf5c294..0784dfd33505a0b239c29abd151ad07ac674cae0 100644 --- a/Fit/Adapter/Minuit2Minimizer.h +++ b/Fit/Adapter/Minuit2Minimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_MINUIT2MINIMIZER_H #define BORNAGAIN_FIT_ADAPTER_MINUIT2MINIMIZER_H diff --git a/Fit/Adapter/ObjectiveFunctionAdapter.h b/Fit/Adapter/ObjectiveFunctionAdapter.h index 2927f93d21e74fdba41a5b50f681063916d9ecda..f0513d65e08911ae27d9d5e654e774e462964477 100644 --- a/Fit/Adapter/ObjectiveFunctionAdapter.h +++ b/Fit/Adapter/ObjectiveFunctionAdapter.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_OBJECTIVEFUNCTIONADAPTER_H #define BORNAGAIN_FIT_ADAPTER_OBJECTIVEFUNCTIONADAPTER_H diff --git a/Fit/Adapter/Report.h b/Fit/Adapter/Report.h index 76f9ace9d16d7d8ffca05a5dee957db61453bfb6..e00130bf7f8a6d2e319567d8d8901f82537ddaa9 100644 --- a/Fit/Adapter/Report.h +++ b/Fit/Adapter/Report.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_REPORT_H #define BORNAGAIN_FIT_ADAPTER_REPORT_H diff --git a/Fit/Adapter/ResidualFunctionAdapter.h b/Fit/Adapter/ResidualFunctionAdapter.h index 9c6ea89216116bd93a5fa33a3a64f32fa7d12c41..6372d89bcf1510c1a8914d27d6383a571b3cd933 100644 --- a/Fit/Adapter/ResidualFunctionAdapter.h +++ b/Fit/Adapter/ResidualFunctionAdapter.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_RESIDUALFUNCTIONADAPTER_H #define BORNAGAIN_FIT_ADAPTER_RESIDUALFUNCTIONADAPTER_H diff --git a/Fit/Adapter/RootResidualFunction.h b/Fit/Adapter/RootResidualFunction.h index ff09dbf4d8c2a9378c1bad77564d0a0604349ca8..bdd9b646bb4a3d54d7b7dfc832ad7b4e8756c714 100644 --- a/Fit/Adapter/RootResidualFunction.h +++ b/Fit/Adapter/RootResidualFunction.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_ROOTRESIDUALFUNCTION_H #define BORNAGAIN_FIT_ADAPTER_ROOTRESIDUALFUNCTION_H diff --git a/Fit/Adapter/RootScalarFunction.h b/Fit/Adapter/RootScalarFunction.h index dd103552ad1eb59869a1fd3894b77eedde9b4fbc..df593e1739529cc23aaeb80a1c903047c2a41761 100644 --- a/Fit/Adapter/RootScalarFunction.h +++ b/Fit/Adapter/RootScalarFunction.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_ROOTSCALARFUNCTION_H #define BORNAGAIN_FIT_ADAPTER_ROOTSCALARFUNCTION_H diff --git a/Fit/Adapter/ScalarFunctionAdapter.h b/Fit/Adapter/ScalarFunctionAdapter.h index 2e4ff6b06ac1699caeea429e97e8aa21074d39c3..18f0d55523eadac1eddcb3282409f2f9f41bd929 100644 --- a/Fit/Adapter/ScalarFunctionAdapter.h +++ b/Fit/Adapter/ScalarFunctionAdapter.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_SCALARFUNCTIONADAPTER_H #define BORNAGAIN_FIT_ADAPTER_SCALARFUNCTIONADAPTER_H diff --git a/Fit/Adapter/SimAnMinimizer.h b/Fit/Adapter/SimAnMinimizer.h index 986f1a2bc040d872a35a4c4ef4a62f4c3528a57d..8e88432c366c457653649326bfe27b7908bd14e9 100644 --- a/Fit/Adapter/SimAnMinimizer.h +++ b/Fit/Adapter/SimAnMinimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_ADAPTER_SIMANMINIMIZER_H #define BORNAGAIN_FIT_ADAPTER_SIMANMINIMIZER_H diff --git a/Fit/Kernel/Kernel.h b/Fit/Kernel/Kernel.h index 5a5740f7d18518eff744b22e1975b19e28faf018..2a6cee927a80273432d2671d313e6fe27c2ac28a 100644 --- a/Fit/Kernel/Kernel.h +++ b/Fit/Kernel/Kernel.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_KERNEL_KERNEL_H #define BORNAGAIN_FIT_KERNEL_KERNEL_H diff --git a/Fit/Minimizer/MinimizerInfo.h b/Fit/Minimizer/MinimizerInfo.h index 1f80be63bba29da53e14739ed4027165d66ddb24..d86ef8d2be291180b6e286843c3df5788355812b 100644 --- a/Fit/Minimizer/MinimizerInfo.h +++ b/Fit/Minimizer/MinimizerInfo.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_MINIMIZER_MINIMIZERINFO_H #define BORNAGAIN_FIT_MINIMIZER_MINIMIZERINFO_H diff --git a/Fit/Minimizer/MinimizerOptions.h b/Fit/Minimizer/MinimizerOptions.h index 011bb8bfecbb234c9513ad0a70711d128046b50f..f0b6110f484c6850e16ded6a87dff3982cc8e690 100644 --- a/Fit/Minimizer/MinimizerOptions.h +++ b/Fit/Minimizer/MinimizerOptions.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_MINIMIZER_MINIMIZEROPTIONS_H #define BORNAGAIN_FIT_MINIMIZER_MINIMIZEROPTIONS_H diff --git a/Fit/Minimizer/TestMinimizer.h b/Fit/Minimizer/TestMinimizer.h index fe902794b2c6b83dd505c74bbe791297e96e163d..b0708efa6ad08444b87dc0f8b9a0e3c637736747 100644 --- a/Fit/Minimizer/TestMinimizer.h +++ b/Fit/Minimizer/TestMinimizer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_MINIMIZER_TESTMINIMIZER_H #define BORNAGAIN_FIT_MINIMIZER_TESTMINIMIZER_H diff --git a/Fit/Minimizer/Types.h b/Fit/Minimizer/Types.h index 93ca51f4a68d601d82f6458724a71fde186b744a..976532d54df71abacd9d4e54aacf2099ff705605 100644 --- a/Fit/Minimizer/Types.h +++ b/Fit/Minimizer/Types.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_MINIMIZER_TYPES_H #define BORNAGAIN_FIT_MINIMIZER_TYPES_H diff --git a/Fit/Param/Attributes.h b/Fit/Param/Attributes.h index e22978ab4793e489e217dabb13f9081e607566fc..580815178b6b3965573a096b69bd055d091b8a19 100644 --- a/Fit/Param/Attributes.h +++ b/Fit/Param/Attributes.h @@ -12,6 +12,8 @@ // // ************************************************************************************************ +// Not exposed to Swig, but #include'd + #ifndef BORNAGAIN_FIT_PARAM_ATTRIBUTES_H #define BORNAGAIN_FIT_PARAM_ATTRIBUTES_H diff --git a/Fit/Param/ParameterPlan.h b/Fit/Param/ParameterPlan.h index 464986e927404f1d5ae0a6c08f6ee2041e9a3471..3e34cb54a5bd646c049e8aef654739353d025950 100644 --- a/Fit/Param/ParameterPlan.h +++ b/Fit/Param/ParameterPlan.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_PARAM_PARAMETERPLAN_H #define BORNAGAIN_FIT_PARAM_PARAMETERPLAN_H diff --git a/Fit/TestEngine/IFactory.h b/Fit/TestEngine/IFactory.h index 226204c0a44e92bbce6a06b726b853675444f6d0..673a4a0d7fde197fe403efd8bbed250c9a98ff94 100644 --- a/Fit/TestEngine/IFactory.h +++ b/Fit/TestEngine/IFactory.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TESTENGINE_IFACTORY_H #define BORNAGAIN_FIT_TESTENGINE_IFACTORY_H diff --git a/Fit/TestEngine/MinimizerTestPlan.h b/Fit/TestEngine/MinimizerTestPlan.h index 1a48b2a0dbd688bd16b329873b4159655bbbcb97..972ccb567aea35a2bc4cb6f6ba6e07213e25bbb4 100644 --- a/Fit/TestEngine/MinimizerTestPlan.h +++ b/Fit/TestEngine/MinimizerTestPlan.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TESTENGINE_MINIMIZERTESTPLAN_H #define BORNAGAIN_FIT_TESTENGINE_MINIMIZERTESTPLAN_H diff --git a/Fit/Tools/MinimizerUtils.h b/Fit/Tools/MinimizerUtils.h index 0dc0e43dc3b70b85a9a68b23c5bb48562bca0ca5..703b5474cda70a75623c558cd62383753af4cce7 100644 --- a/Fit/Tools/MinimizerUtils.h +++ b/Fit/Tools/MinimizerUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TOOLS_MINIMIZERUTILS_H #define BORNAGAIN_FIT_TOOLS_MINIMIZERUTILS_H diff --git a/Fit/Tools/MultiOption.h b/Fit/Tools/MultiOption.h index 5e16658251be4781cc16229fe7ffc0224209b81a..b15dc55a1206f3debfca0e18addd136d7012ec10 100644 --- a/Fit/Tools/MultiOption.h +++ b/Fit/Tools/MultiOption.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TOOLS_MULTIOPTION_H #define BORNAGAIN_FIT_TOOLS_MULTIOPTION_H diff --git a/Fit/Tools/OptionContainer.h b/Fit/Tools/OptionContainer.h index 32fbdd1ed7327e69fd65f93898f8a9cf6fb7a017..f279bc0a1bb3ea8b531da87979be585b7720350a 100644 --- a/Fit/Tools/OptionContainer.h +++ b/Fit/Tools/OptionContainer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H #define BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H diff --git a/Fit/Tools/StringUtils.h b/Fit/Tools/StringUtils.h index 1983afd3b6758cae32ae7dfb3ec54653d7ddb8be..18212851c31479f89e2f4162cde067c3db221903 100644 --- a/Fit/Tools/StringUtils.h +++ b/Fit/Tools/StringUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TOOLS_STRINGUTILS_H #define BORNAGAIN_FIT_TOOLS_STRINGUTILS_H diff --git a/Fit/Tools/WallclockTimer.h b/Fit/Tools/WallclockTimer.h index e1f72688ae8f6c4f60ab663841d6bf0c87ce4b48..d8625e4bad2000b0348bb55b2e93076ca5822608 100644 --- a/Fit/Tools/WallclockTimer.h +++ b/Fit/Tools/WallclockTimer.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_FIT_TOOLS_WALLCLOCKTIMER_H #define BORNAGAIN_FIT_TOOLS_WALLCLOCKTIMER_H diff --git a/GUI/coregui/Models/BeamItems.cpp b/GUI/coregui/Models/BeamItems.cpp index 151336dab966aca4b7749d2456cb5ace0821dbca..0a4cca23bf809867e0fb61bd8b9cc2e62add2568 100644 --- a/GUI/coregui/Models/BeamItems.cpp +++ b/GUI/coregui/Models/BeamItems.cpp @@ -56,7 +56,7 @@ BeamItem::BeamItem(const QString& beam_model) : SessionItem(beam_model) { BeamItem::~BeamItem() = default; -double BeamItem::getIntensity() const { +double BeamItem::intensity() const { return getItemValue(P_INTENSITY).toDouble(); } @@ -64,7 +64,7 @@ void BeamItem::setIntensity(double value) { setItemValue(P_INTENSITY, value); } -double BeamItem::getWavelength() const { +double BeamItem::wavelength() const { BeamWavelengthItem* beamWavelength = dynamic_cast<BeamWavelengthItem*>(getItem(P_WAVELENGTH)); return beamWavelength->wavelength(); } @@ -94,12 +94,12 @@ void BeamItem::setAzimuthalAngle(double value) { } std::unique_ptr<Beam> BeamItem::createBeam() const { - double lambda = getWavelength(); + double lambda = wavelength(); double inclination_angle = Units::deg2rad(getInclinationAngle()); double azimuthal_angle = Units::deg2rad(getAzimuthalAngle()); auto result = - std::make_unique<Beam>(lambda, inclination_angle, azimuthal_angle, getIntensity()); + std::make_unique<Beam>(intensity(), lambda, Direction(inclination_angle, azimuthal_angle)); result->setPolarization(GetVectorItem(*this, P_POLARIZATION)); diff --git a/GUI/coregui/Models/BeamItems.h b/GUI/coregui/Models/BeamItems.h index 67e5374ed0ab7d081578657832832498f927ddf7..f1e955039515e1a5d8dc8f1cf2afb2c99d3a8223 100644 --- a/GUI/coregui/Models/BeamItems.h +++ b/GUI/coregui/Models/BeamItems.h @@ -33,10 +33,10 @@ public: ~BeamItem() override; - double getIntensity() const; + double intensity() const; void setIntensity(double value); - double getWavelength() const; + double wavelength() const; void setWavelength(double value); virtual double getInclinationAngle() const = 0; diff --git a/GUI/coregui/Models/DepthProbeInstrumentItem.cpp b/GUI/coregui/Models/DepthProbeInstrumentItem.cpp index d856299084dc733165c1d3eedc9bee4303abec9e..3d566ef9cd2bd13c981a0ff43e889742c0164331 100644 --- a/GUI/coregui/Models/DepthProbeInstrumentItem.cpp +++ b/GUI/coregui/Models/DepthProbeInstrumentItem.cpp @@ -68,7 +68,7 @@ std::unique_ptr<DepthProbeSimulation> DepthProbeInstrumentItem::createSimulation auto axis = axis_item->createAxis(Units::deg); - simulation->setBeamParameters(beamItem()->getWavelength(), static_cast<int>(axis->size()), + simulation->setBeamParameters(beamItem()->wavelength(), static_cast<int>(axis->size()), axis->lowerBound(), axis->upperBound()); auto depthAxisItem = dynamic_cast<BasicAxisItem*>(getItem(P_Z_AXIS)); diff --git a/GUI/coregui/Models/DomainSimulationBuilder.cpp b/GUI/coregui/Models/DomainSimulationBuilder.cpp index 253542281c4489a865198ef21127a3aa1db718e4..b544247e94ba4e0ff503150b63ecb4ab01625c64 100644 --- a/GUI/coregui/Models/DomainSimulationBuilder.cpp +++ b/GUI/coregui/Models/DomainSimulationBuilder.cpp @@ -119,7 +119,7 @@ createOffSpecSimulation(std::unique_ptr<MultiLayer> P_multilayer, auto beamItem = instrument->beamItem(); auto axisItem = dynamic_cast<BasicAxisItem*>(instrument->getItem(OffSpecInstrumentItem::P_ALPHA_AXIS)); - ret->setBeamParameters(beamItem->getWavelength(), *axisItem->createAxis(Units::deg), + ret->setBeamParameters(beamItem->wavelength(), *axisItem->createAxis(Units::deg), beamItem->getAzimuthalAngle()); // TODO Take care about distributions @@ -146,12 +146,12 @@ createSpecularSimulation(std::unique_ptr<MultiLayer> P_multilayer, const auto axis_item = beam_item->currentInclinationAxisItem(); const auto footprint = beam_item->currentFootprintItem(); - AngularSpecScan scan(beam_item->getWavelength(), *axis_item->createAxis(Units::deg)); + AngularSpecScan scan(beam_item->wavelength(), *axis_item->createAxis(Units::deg)); scan.setFootprintFactor(footprint->createFootprint().get()); TransformToDomain::addBeamDivergencesToScan(*beam_item, scan); - ret->setBeamIntensity(beam_item->getIntensity()); + ret->setBeamIntensity(beam_item->intensity()); ret->setScan(scan); // ISimulation options diff --git a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp index 2f8c6095b0c9987eadf5ffcd6bf9aa38e3b612f0..996aacc2258e04862450ec0f279676dad9e8d476 100644 --- a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp @@ -78,8 +78,8 @@ SessionItem* GUIDomainSampleVisitor::populateSampleModel(SampleModel* sampleMode if (m_topSampleName.isEmpty()) m_topSampleName = sample.getName().c_str(); - for (const auto [child, depth, parent]: NodeUtils::progenyPlus(&sample)) { - setDepth(depth+1); + for (const auto [child, depth, parent] : NodeUtils::progenyPlus(&sample)) { + setDepth(depth + 1); child->accept(this); } SessionItem* result = m_levelToParentItem[1]; diff --git a/GUI/coregui/Models/GUIDomainSampleVisitor.h b/GUI/coregui/Models/GUIDomainSampleVisitor.h index 9993d57381af7a657a25180f3422a31606c83d75..c49aa4da0fd3679a6ed797ee2066ecf974df0a2e 100644 --- a/GUI/coregui/Models/GUIDomainSampleVisitor.h +++ b/GUI/coregui/Models/GUIDomainSampleVisitor.h @@ -24,8 +24,6 @@ class MaterialModel; class SessionItem; class ExternalProperty; class Material; -class ISimulation; -class MultiLayer; //! Visits domain sample tree to build GUI presentation. diff --git a/GUI/coregui/Models/RealDataItem.cpp b/GUI/coregui/Models/RealDataItem.cpp index 65041518756918af10311a0db057643039597c63..71f3d6f0b0622f0ccacd4068afe618e646176484 100644 --- a/GUI/coregui/Models/RealDataItem.cpp +++ b/GUI/coregui/Models/RealDataItem.cpp @@ -97,9 +97,8 @@ void RealDataItem::setOutputData(OutputData<double>* data) { ASSERT(data && "Assertion failed in RealDataItem::setOutputData: passed data is nullptr"); ASSERT(data->rank() < 3 && data->rank() > 0); - const QString& target_model_type = data->rank() == 2 ? "IntensityData" - : data->rank() == 1 ? "SpecularData" - : ""; + const QString& target_model_type = + data->rank() == 2 ? "IntensityData" : data->rank() == 1 ? "SpecularData" : ""; auto data_item = getItem(T_INTENSITY_DATA); if (data_item && data_item->modelType() != target_model_type) throw GUIHelpers::Error("Error in RealDataItem::setOutputData: trying to set data " diff --git a/GUI/coregui/Models/SessionXML.cpp b/GUI/coregui/Models/SessionXML.cpp index 5076fd3a3de3903261a254d91da7f34ebb16291a..0164d7f61055ce7dbde1d49dc9afb3daf499fc16 100644 --- a/GUI/coregui/Models/SessionXML.cpp +++ b/GUI/coregui/Models/SessionXML.cpp @@ -130,7 +130,7 @@ void SessionXML::readItems(QXmlStreamReader* reader, SessionItem* parent, QStrin if (!newItem) { QString message = QString("Error while parsing XML. Can't create item of " "modelType '%1' for tag '%2', parent '%3'") - .arg(model_type, tag, parent->P_NAME); + .arg(model_type, tag, parent->P_NAME); report_error(messageService, parent, message); // risky attempt to recover the rest of the project reader->skipCurrentElement(); diff --git a/GUI/coregui/Models/TransformFromDomain.cpp b/GUI/coregui/Models/TransformFromDomain.cpp index e31fe5ab63e844014f537184f63535b753e9ecaa..c0d4d35552fc31a7ed79594dc335f8f4aa47a6a0 100644 --- a/GUI/coregui/Models/TransformFromDomain.cpp +++ b/GUI/coregui/Models/TransformFromDomain.cpp @@ -230,10 +230,10 @@ void TransformFromDomain::setGISASBeamItem(BeamItem* beam_item, const GISASSimul ASSERT(beam_item); Beam beam = simulation.instrument().beam(); - beam_item->setIntensity(beam.getIntensity()); - beam_item->setWavelength(beam.getWavelength()); - beam_item->setInclinationAngle(Units::rad2deg(beam.getAlpha())); - beam_item->setAzimuthalAngle(Units::rad2deg(beam.getPhi())); + beam_item->setIntensity(beam.intensity()); + beam_item->setWavelength(beam.wavelength()); + beam_item->setInclinationAngle(Units::rad2deg(beam.direction().alpha())); + beam_item->setAzimuthalAngle(Units::rad2deg(beam.direction().phi())); // distribution parameters const DistributionHandler::Distributions_t distributions = @@ -255,10 +255,10 @@ void TransformFromDomain::setOffSpecBeamItem(BeamItem* beam_item, const OffSpecSimulation& simulation) { Beam beam = simulation.instrument().beam(); - beam_item->setIntensity(beam.getIntensity()); - beam_item->setWavelength(beam.getWavelength()); - beam_item->setInclinationAngle(Units::rad2deg(beam.getAlpha())); - beam_item->setAzimuthalAngle(Units::rad2deg(beam.getPhi())); + beam_item->setIntensity(beam.intensity()); + beam_item->setWavelength(beam.wavelength()); + beam_item->setInclinationAngle(Units::rad2deg(beam.direction().alpha())); + beam_item->setAzimuthalAngle(Units::rad2deg(beam.direction().phi())); // TODO implement beam divergence } @@ -266,8 +266,8 @@ void TransformFromDomain::setSpecularBeamItem(SpecularBeamItem* beam_item, const SpecularSimulation& simulation) { const Beam& beam = simulation.instrument().beam(); - beam_item->setIntensity(beam.getIntensity()); - beam_item->setWavelength(beam.getWavelength()); + beam_item->setIntensity(beam.intensity()); + beam_item->setWavelength(beam.wavelength()); beam_item->setInclinationAngle(0.0); // inclination angle is hardcoded beam_item->setAzimuthalAngle(0.0); // azimuthal angle is hardcoded diff --git a/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp b/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp index d32ee45e46cc6dda1a665d2c4e0ee0c972df7a94..68532ef8b35ea19d41cc9b0a3a9a32c39f9bc1c0 100644 --- a/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp +++ b/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp @@ -82,9 +82,9 @@ QString PropertyEditorFactory::toString(const QModelIndex& index) { auto item = static_cast<SessionItem*>(index.internalPointer()); return item->editorType() == "ScientificDouble" ? QString::number(item->value().toDouble(), 'g') - : item->editorType() == "ScientificSpinBox" - ? ScientificSpinBox::toString(item->value().toDouble(), item->decimals()) - : QString::number(item->value().toDouble(), 'f', item->decimals()); + : item->editorType() == "ScientificSpinBox" + ? ScientificSpinBox::toString(item->value().toDouble(), item->decimals()) + : QString::number(item->value().toDouble(), 'f', item->decimals()); } return ""; diff --git a/Param/Base/Unit.h b/Param/Base/Unit.h index f259bf3347080c6b66a20992e0564c73d18fa83e..26d46c39c2e7ea96c8e48cd5a36c8a6ff51feda4 100644 --- a/Param/Base/Unit.h +++ b/Param/Base/Unit.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_PARAM_BASE_UNIT_H #define BORNAGAIN_PARAM_BASE_UNIT_H diff --git a/Param/Distrib/DistributionHandler.h b/Param/Distrib/DistributionHandler.h index 60ef1234c03eb619af29f913a53a5a05c4c129b9..064d990abd62f78c5768e86bcd6abf40642805d7 100644 --- a/Param/Distrib/DistributionHandler.h +++ b/Param/Distrib/DistributionHandler.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_PARAM_DISTRIB_DISTRIBUTIONHANDLER_H #define BORNAGAIN_PARAM_DISTRIB_DISTRIBUTIONHANDLER_H diff --git a/Param/Distrib/ParameterDistribution.cpp b/Param/Distrib/ParameterDistribution.cpp index f6a62e8d9f479f3830f97ef93349068f2578b69e..7834fccad57680ed360c38d1e059f39422831456 100644 --- a/Param/Distrib/ParameterDistribution.cpp +++ b/Param/Distrib/ParameterDistribution.cpp @@ -20,7 +20,7 @@ ParameterDistribution::ParameterDistribution(const std::string& par_name, size_t nbr_samples, double sigma_factor, const RealLimits& limits) : IParametricComponent("ParameterDistribution") - , m_name(par_name) + , m_parname(par_name) , m_nbr_samples(nbr_samples) , m_sigma_factor(sigma_factor) , m_limits(limits) @@ -39,7 +39,7 @@ ParameterDistribution::ParameterDistribution(const std::string& par_name, const IDistribution1D& distribution, size_t nbr_samples, double xmin, double xmax) : IParametricComponent("ParameterDistribution") - , m_name(par_name) + , m_parname(par_name) , m_nbr_samples(nbr_samples) , m_sigma_factor(0.0) , m_xmin(xmin) @@ -58,7 +58,7 @@ ParameterDistribution::ParameterDistribution(const std::string& par_name, ParameterDistribution::ParameterDistribution(const ParameterDistribution& other) : IParametricComponent("ParameterDistribution") - , m_name(other.m_name) + , m_parname(other.m_parname) , m_nbr_samples(other.m_nbr_samples) , m_sigma_factor(other.m_sigma_factor) , m_linked_par_names(other.m_linked_par_names) @@ -72,7 +72,7 @@ ParameterDistribution::~ParameterDistribution() = default; ParameterDistribution& ParameterDistribution::operator=(const ParameterDistribution& other) { if (this != &other) { - this->m_name = other.m_name; + this->m_parname = other.m_parname; m_nbr_samples = other.m_nbr_samples; m_sigma_factor = other.m_sigma_factor; m_distribution.reset(other.m_distribution->clone()); diff --git a/Param/Distrib/ParameterDistribution.h b/Param/Distrib/ParameterDistribution.h index dfcaa8a0cbfa638dc760bdbd8eab7c9a2831564c..6b50304a18b0781e677c4b2f79981d866d73c528 100644 --- a/Param/Distrib/ParameterDistribution.h +++ b/Param/Distrib/ParameterDistribution.h @@ -43,7 +43,7 @@ public: ParameterDistribution& linkParameter(std::string par_name); //! get the main parameter's name - std::string getMainParameterName() const { return m_name; } + std::string getMainParameterName() const { return m_parname; } //! get number of samples for this distribution size_t getNbrSamples() const; @@ -66,7 +66,7 @@ public: double getMaxValue() const { return m_xmax; } private: - std::string m_name; + std::string m_parname; std::unique_ptr<IDistribution1D> m_distribution; size_t m_nbr_samples; double m_sigma_factor; diff --git a/Param/Node/INode.cpp b/Param/Node/INode.cpp index a63c0214d8dd32fd854d87f184b2b8581118b7c8..06cfbebd43ff7e92c797a22253da55bec97dbdeb 100644 --- a/Param/Node/INode.cpp +++ b/Param/Node/INode.cpp @@ -116,7 +116,7 @@ ParameterPool* INode::createParameterTree() const { std::unique_ptr<ParameterPool> result(new ParameterPool); for (const INode* child : progeny()) { - const std::string path = NodeUtils::nodePath(child, this->parent()) + "/"; + const std::string path = NodeUtils::nodePath(child, parent()) + "/"; child->parameterPool()->copyToExternalPool(path, result.get()); } diff --git a/Param/Varia/ParameterPattern.h b/Param/Varia/ParameterPattern.h index 07b9768cc3d57f1c7e1f20b29a5b954055a3399d..6bc7a0f4604adc8b03fdf9480945a8890009d558 100644 --- a/Param/Varia/ParameterPattern.h +++ b/Param/Varia/ParameterPattern.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_PARAM_VARIA_PARAMETERPATTERN_H #define BORNAGAIN_PARAM_VARIA_PARAMETERPATTERN_H diff --git a/Param/Varia/ParameterUtils.h b/Param/Varia/ParameterUtils.h index 47b144f9d24655cd98a7fedfde33e6a231b5473b..994c483379c8916f492cddcb50896eb8884e6911 100644 --- a/Param/Varia/ParameterUtils.h +++ b/Param/Varia/ParameterUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_PARAM_VARIA_PARAMETERUTILS_H #define BORNAGAIN_PARAM_VARIA_PARAMETERUTILS_H diff --git a/Sample/Aggregate/InterferenceFunctions.h b/Sample/Aggregate/InterferenceFunctions.h index d8a7619ca56ddcd714035b12513e2985f2ee8c1b..afcf7003ccafaac822ff0612bc076d26944dcfc6 100644 --- a/Sample/Aggregate/InterferenceFunctions.h +++ b/Sample/Aggregate/InterferenceFunctions.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTIONS_H #define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTIONS_H diff --git a/Sample/Correlations/IDistribution1DSampler.h b/Sample/Correlations/IDistribution1DSampler.h index 5b5efd5a26a7aa6bf7f105f298d4632a52ad5bd2..a1399a61a2e9898d3c99f06f8646b6fa6adea235 100644 --- a/Sample/Correlations/IDistribution1DSampler.h +++ b/Sample/Correlations/IDistribution1DSampler.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H #define BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H diff --git a/Sample/Correlations/IDistribution2DSampler.h b/Sample/Correlations/IDistribution2DSampler.h index c83e6f7322be099a84a6a62f0bdd0c782eeb3d1d..fda6cb305082ca28c9c2f09067475feaebe722a1 100644 --- a/Sample/Correlations/IDistribution2DSampler.h +++ b/Sample/Correlations/IDistribution2DSampler.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION2DSAMPLER_H #define BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION2DSAMPLER_H diff --git a/Sample/FFCompute/ComputeBA.h b/Sample/FFCompute/ComputeBA.h index cf2166459b96df3843952db3ac0ca958695bd4cd..a246855534bcc92ac7b5f4a94ee9bf4d7a263cf0 100644 --- a/Sample/FFCompute/ComputeBA.h +++ b/Sample/FFCompute/ComputeBA.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBA_H #define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBA_H diff --git a/Sample/FFCompute/ComputeBAPol.h b/Sample/FFCompute/ComputeBAPol.h index 669161b67c60d205035043eee25c59c7387c0a4a..a52901f5fdbc88a65bd3fe0370029de3b6eca661 100644 --- a/Sample/FFCompute/ComputeBAPol.h +++ b/Sample/FFCompute/ComputeBAPol.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBAPOL_H #define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBAPOL_H diff --git a/Sample/FFCompute/ComputeDWBA.cpp b/Sample/FFCompute/ComputeDWBA.cpp index d7c6630535c2ed326a84ff8cb5dae206807aae4c..09446cfa93855251bc347b56db3624d7b360b0e0 100644 --- a/Sample/FFCompute/ComputeDWBA.cpp +++ b/Sample/FFCompute/ComputeDWBA.cpp @@ -45,7 +45,7 @@ complex_t ComputeDWBA::evaluate(const WavevectorInfo& wavevectors) const { k_f_R.setZ(-k_f_T.z()); // Construct the four different scattering contributions wavevector infos - double wavelength = wavevectors.getWavelength(); + double wavelength = wavevectors.wavelength(); WavevectorInfo k_TT(k_i_T, k_f_T, wavelength); WavevectorInfo k_RT(k_i_R, k_f_T, wavelength); WavevectorInfo k_TR(k_i_T, k_f_R, wavelength); diff --git a/Sample/FFCompute/ComputeDWBA.h b/Sample/FFCompute/ComputeDWBA.h index 6742fbfe3753db3ffda5bc00388ec4a9df276ddb..0ddd0acb335b4ec9cba8a2b0e5b7431dd50c32b0 100644 --- a/Sample/FFCompute/ComputeDWBA.h +++ b/Sample/FFCompute/ComputeDWBA.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBA_H #define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBA_H diff --git a/Sample/FFCompute/ComputeDWBAPol.cpp b/Sample/FFCompute/ComputeDWBAPol.cpp index 7ba4e8ed7cbd18571c77f1e68aa930141156a096..befc74c84a8f241da5e2b5b29dff37f8e4a0f346 100644 --- a/Sample/FFCompute/ComputeDWBAPol.cpp +++ b/Sample/FFCompute/ComputeDWBAPol.cpp @@ -71,7 +71,7 @@ Eigen::Matrix2cd ComputeDWBAPol::evaluatePol(const WavevectorInfo& wavevectors) // since both eigenvalues are identical, this does not influence the result. Eigen::Matrix2cd ff_BA; - double wavelength = wavevectors.getWavelength(); + double wavelength = wavevectors.wavelength(); // The following matrices each contain the four polarization conditions // (p->p, p->m, m->p, m->m) diff --git a/Sample/FFCompute/ComputeDWBAPol.h b/Sample/FFCompute/ComputeDWBAPol.h index 513b03388a86bede5a022b588f2055de5a9dba40..4b8fb81427dd4042085a4d21813b80803410efe8 100644 --- a/Sample/FFCompute/ComputeDWBAPol.h +++ b/Sample/FFCompute/ComputeDWBAPol.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBAPOL_H #define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBAPOL_H diff --git a/Sample/FFCompute/IComputeFF.h b/Sample/FFCompute/IComputeFF.h index 2f6c13b0bdb08851e010370a954573deddc7eece..d567ef99584fe1480e847886d56db383543c158f 100644 --- a/Sample/FFCompute/IComputeFF.h +++ b/Sample/FFCompute/IComputeFF.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_ICOMPUTEFF_H #define BORNAGAIN_SAMPLE_FFCOMPUTE_ICOMPUTEFF_H diff --git a/Sample/Fresnel/FormFactorCoherentPart.cpp b/Sample/Fresnel/FormFactorCoherentPart.cpp index 0bf2b7d823e5600caeb6e0067298137e90f956d9..952d1636e29da7dcf4e08d868e2bf92e1ced180b 100644 --- a/Sample/Fresnel/FormFactorCoherentPart.cpp +++ b/Sample/Fresnel/FormFactorCoherentPart.cpp @@ -41,7 +41,7 @@ FormFactorCoherentPart::~FormFactorCoherentPart() = default; complex_t FormFactorCoherentPart::evaluate(const SimulationElement& sim_element) const { WavevectorInfo wavevectors(sim_element.getKi(), sim_element.getMeanKf(), - sim_element.getWavelength()); + sim_element.wavelength()); auto in_coeffs = m_fresnel_map->getInCoefficients(sim_element, m_layer_index); auto out_coeffs = m_fresnel_map->getOutCoefficients(sim_element, m_layer_index); @@ -51,7 +51,7 @@ complex_t FormFactorCoherentPart::evaluate(const SimulationElement& sim_element) Eigen::Matrix2cd FormFactorCoherentPart::evaluatePol(const SimulationElement& sim_element) const { WavevectorInfo wavevectors(sim_element.getKi(), sim_element.getMeanKf(), - sim_element.getWavelength()); + sim_element.wavelength()); auto in_coeffs = m_fresnel_map->getInCoefficients(sim_element, m_layer_index); auto out_coeffs = m_fresnel_map->getOutCoefficients(sim_element, m_layer_index); diff --git a/Sample/Fresnel/FormFactorCoherentPart.h b/Sample/Fresnel/FormFactorCoherentPart.h index 445bab2fe78824e5aec7d070dc26b957d1eac149..717b76902d694193a6180aaf85352e7fcd83bf3d 100644 --- a/Sample/Fresnel/FormFactorCoherentPart.h +++ b/Sample/Fresnel/FormFactorCoherentPart.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FRESNEL_FORMFACTORCOHERENTPART_H #define BORNAGAIN_SAMPLE_FRESNEL_FORMFACTORCOHERENTPART_H diff --git a/Sample/Fresnel/FormFactorCoherentSum.h b/Sample/Fresnel/FormFactorCoherentSum.h index 678f62cd9adc413f0d38a445f8f1e55b6c57e066..3edc468827f1c683709bbbe215e97c33c72583b4 100644 --- a/Sample/Fresnel/FormFactorCoherentSum.h +++ b/Sample/Fresnel/FormFactorCoherentSum.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FRESNEL_FORMFACTORCOHERENTSUM_H #define BORNAGAIN_SAMPLE_FRESNEL_FORMFACTORCOHERENTSUM_H diff --git a/Sample/Fresnel/IFresnelMap.h b/Sample/Fresnel/IFresnelMap.h index 95dd80776d47d892ff65c49579702be534e6cee9..ab37382a759196d8f0fbe909953e641720f1816f 100644 --- a/Sample/Fresnel/IFresnelMap.h +++ b/Sample/Fresnel/IFresnelMap.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FRESNEL_IFRESNELMAP_H #define BORNAGAIN_SAMPLE_FRESNEL_IFRESNELMAP_H diff --git a/Sample/Fresnel/MatrixFresnelMap.h b/Sample/Fresnel/MatrixFresnelMap.h index 1a669e4879fb43ead39ef9dbe38c68a4e95ea622..dadeaaa563c6ac2bbf58d44d293d7f19aed810ef 100644 --- a/Sample/Fresnel/MatrixFresnelMap.h +++ b/Sample/Fresnel/MatrixFresnelMap.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FRESNEL_MATRIXFRESNELMAP_H #define BORNAGAIN_SAMPLE_FRESNEL_MATRIXFRESNELMAP_H diff --git a/Sample/Fresnel/ScalarFresnelMap.cpp b/Sample/Fresnel/ScalarFresnelMap.cpp index ea36b4137884c86e4d7f1bb1590f9047a29d9a45..409ecbcf9409be9038efb04b1bd158e89e37c590 100644 --- a/Sample/Fresnel/ScalarFresnelMap.cpp +++ b/Sample/Fresnel/ScalarFresnelMap.cpp @@ -22,8 +22,8 @@ ScalarFresnelMap::ScalarFresnelMap(std::unique_ptr<ISpecularStrategy> strategy) ScalarFresnelMap::~ScalarFresnelMap() = default; //! Returns hash value of a pair of doubles, computed by exclusive-or of the component hash values. -size_t ScalarFresnelMap::Hash2Doubles::operator()( - const std::pair<double, double>& doubles) const noexcept { +size_t ScalarFresnelMap::Hash2Doubles::operator()(const std::pair<double, double>& doubles) const + noexcept { return std::hash<double>{}(doubles.first) ^ std::hash<double>{}(doubles.second); } diff --git a/Sample/Fresnel/ScalarFresnelMap.h b/Sample/Fresnel/ScalarFresnelMap.h index 4740d3f99bec25bbbfa4dfbf2275aa789f57b219..7a02e8a26339f80dc1850c40d81e2b8106a7dd4d 100644 --- a/Sample/Fresnel/ScalarFresnelMap.h +++ b/Sample/Fresnel/ScalarFresnelMap.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_FRESNEL_SCALARFRESNELMAP_H #define BORNAGAIN_SAMPLE_FRESNEL_SCALARFRESNELMAP_H diff --git a/Sample/HardParticle/FormFactorBar.h b/Sample/HardParticle/FormFactorBar.h index 66c386942373d42b46af76f1e8dcfe21916b7b5f..c4c0be554527a98a563461f1b3b97df3e480bf44 100644 --- a/Sample/HardParticle/FormFactorBar.h +++ b/Sample/HardParticle/FormFactorBar.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORBAR_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORBAR_H diff --git a/Sample/HardParticle/HardParticles.h b/Sample/HardParticle/HardParticles.h index 0c5582e437540469a456832d4083e3e0ed43bc36..296fd4d3ecf26bfb8f5f159dff42f87776172a9d 100644 --- a/Sample/HardParticle/HardParticles.h +++ b/Sample/HardParticle/HardParticles.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_HARDPARTICLES_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_HARDPARTICLES_H diff --git a/Sample/HardParticle/PolyhedralComponents.h b/Sample/HardParticle/PolyhedralComponents.h index 5f47a9c6864faf98f0f1b112d8a94a1117e421db..34b88c71bf2fe8910bcce9cd6f48a09cd5de6c15 100644 --- a/Sample/HardParticle/PolyhedralComponents.h +++ b/Sample/HardParticle/PolyhedralComponents.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALCOMPONENTS_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALCOMPONENTS_H diff --git a/Sample/HardParticle/PolyhedralTopology.h b/Sample/HardParticle/PolyhedralTopology.h index 25505ed80815224a956453aa671e3052e5f79ca2..020efad91e8bbfead648cb46e73add449d53727e 100644 --- a/Sample/HardParticle/PolyhedralTopology.h +++ b/Sample/HardParticle/PolyhedralTopology.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALTOPOLOGY_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRALTOPOLOGY_H diff --git a/Sample/HardParticle/Polyhedron.h b/Sample/HardParticle/Polyhedron.h index 3db9972c01d7d7655b228acfb204da3a52aa8eec..443aadaaa2622b605962e7e47cda545fda5943bb 100644 --- a/Sample/HardParticle/Polyhedron.h +++ b/Sample/HardParticle/Polyhedron.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRON_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRON_H diff --git a/Sample/HardParticle/Prism.h b/Sample/HardParticle/Prism.h index 957513cff59486270929b8dea3930aa00c9f866c..b2649933e8a6411e0225a1023820a1fa40f8cac1 100644 --- a/Sample/HardParticle/Prism.h +++ b/Sample/HardParticle/Prism.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_PRISM_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_PRISM_H diff --git a/Sample/HardParticle/Ripples.h b/Sample/HardParticle/Ripples.h index dafdee9d6365ddbaf3e0ed66996304c411e6ad18..e5e03553dc970b09c32a2cc2f7fe72e84682e99b 100644 --- a/Sample/HardParticle/Ripples.h +++ b/Sample/HardParticle/Ripples.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_RIPPLES_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_RIPPLES_H diff --git a/Sample/Interference/DecouplingApproximationStrategy.h b/Sample/Interference/DecouplingApproximationStrategy.h index e884ed3b3f42c0128a1e4e004ad76d3b3188d1e6..8a33b35dbb224fba129e66abd2a0143ccf628c22 100644 --- a/Sample/Interference/DecouplingApproximationStrategy.h +++ b/Sample/Interference/DecouplingApproximationStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_INTERFERENCE_DECOUPLINGAPPROXIMATIONSTRATEGY_H #define BORNAGAIN_SAMPLE_INTERFERENCE_DECOUPLINGAPPROXIMATIONSTRATEGY_H diff --git a/Sample/Interference/FormFactorPrecompute.h b/Sample/Interference/FormFactorPrecompute.h index 7101d478dba5620bfe968e9bfc68790393673531..f5cecc8e33e4082b89676fa2daf3547f7fc4d4d7 100644 --- a/Sample/Interference/FormFactorPrecompute.h +++ b/Sample/Interference/FormFactorPrecompute.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_INTERFERENCE_FORMFACTORPRECOMPUTE_H #define BORNAGAIN_SAMPLE_INTERFERENCE_FORMFACTORPRECOMPUTE_H diff --git a/Sample/Interference/IInterferenceFunctionStrategy.h b/Sample/Interference/IInterferenceFunctionStrategy.h index a8d8ce5af4dd282bebf9823a03608248b8663c12..de52ab267513f4635bd2077d10114dfbc609a8ea 100644 --- a/Sample/Interference/IInterferenceFunctionStrategy.h +++ b/Sample/Interference/IInterferenceFunctionStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_INTERFERENCE_IINTERFERENCEFUNCTIONSTRATEGY_H #define BORNAGAIN_SAMPLE_INTERFERENCE_IINTERFERENCEFUNCTIONSTRATEGY_H diff --git a/Sample/Interference/SSCApproximationStrategy.h b/Sample/Interference/SSCApproximationStrategy.h index 33b29b0b708bcac80554c8d8fcc5fabdfb0b3462..b3712a4a6f57d0cdc25e64c7f4a9dcf37f2eab0c 100644 --- a/Sample/Interference/SSCApproximationStrategy.h +++ b/Sample/Interference/SSCApproximationStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_INTERFERENCE_SSCAPPROXIMATIONSTRATEGY_H #define BORNAGAIN_SAMPLE_INTERFERENCE_SSCAPPROXIMATIONSTRATEGY_H diff --git a/Sample/LibFF/SomeFormFactors.h b/Sample/LibFF/SomeFormFactors.h index 873effee4bbf53256788f05b9b21454e89b6bc00..d879af7f89a3f9fb430d94259fb0c666e05dcb25 100644 --- a/Sample/LibFF/SomeFormFactors.h +++ b/Sample/LibFF/SomeFormFactors.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_LIBFF_SOMEFORMFACTORS_H #define BORNAGAIN_SAMPLE_LIBFF_SOMEFORMFACTORS_H diff --git a/Sample/Material/BaseMaterialImpl.h b/Sample/Material/BaseMaterialImpl.h index b9cc2b3d7366e4343248fd05c8dc5cc412534715..b484af4e33366c110c47a449b51db528266c18bf 100644 --- a/Sample/Material/BaseMaterialImpl.h +++ b/Sample/Material/BaseMaterialImpl.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MATERIAL_BASEMATERIALIMPL_H #define BORNAGAIN_SAMPLE_MATERIAL_BASEMATERIALIMPL_H diff --git a/Sample/Material/MagneticMaterialImpl.h b/Sample/Material/MagneticMaterialImpl.h index 830382dc85c13638d99b2da72684e81872a62591..a5a30613cedfc073c828c56b9ff69a4735e0a2ef 100644 --- a/Sample/Material/MagneticMaterialImpl.h +++ b/Sample/Material/MagneticMaterialImpl.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MATERIAL_MAGNETICMATERIALIMPL_H #define BORNAGAIN_SAMPLE_MATERIAL_MAGNETICMATERIALIMPL_H diff --git a/Sample/Material/MaterialBySLDImpl.cpp b/Sample/Material/MaterialBySLDImpl.cpp index 2424dca9bb8b6e859bc32983d4ad061224517ef9..7565c2738f7d6a5443ae89ccda73e49dd9c2fb54 100644 --- a/Sample/Material/MaterialBySLDImpl.cpp +++ b/Sample/Material/MaterialBySLDImpl.cpp @@ -49,7 +49,7 @@ complex_t MaterialBySLDImpl::materialData() const { } complex_t MaterialBySLDImpl::scalarSubtrSLD(const WavevectorInfo& wavevectors) const { - double wavelength = wavevectors.getWavelength(); + double wavelength = wavevectors.wavelength(); return 1.0 / getWlPrefactor(wavelength) - sld(); } diff --git a/Sample/Material/MaterialBySLDImpl.h b/Sample/Material/MaterialBySLDImpl.h index c67fb27a016b1ad041dc4d16dd6a99ff5797476b..95863ced0711d9d4942a20f70d6a0b1fe4788688 100644 --- a/Sample/Material/MaterialBySLDImpl.h +++ b/Sample/Material/MaterialBySLDImpl.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MATERIAL_MATERIALBYSLDIMPL_H #define BORNAGAIN_SAMPLE_MATERIAL_MATERIALBYSLDIMPL_H diff --git a/Sample/Material/MaterialUtils.h b/Sample/Material/MaterialUtils.h index dfd3b6379916de45805660d42844f90e83608969..d8acb02edfb976bce328e8b05fd6e5b10cf2b1ac 100644 --- a/Sample/Material/MaterialUtils.h +++ b/Sample/Material/MaterialUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MATERIAL_MATERIALUTILS_H #define BORNAGAIN_SAMPLE_MATERIAL_MATERIALUTILS_H diff --git a/Sample/Material/RefractiveMaterialImpl.cpp b/Sample/Material/RefractiveMaterialImpl.cpp index 63eacacf2a1cc178226e311ce36214e2ec2cf68f..66dbe51a3a0342b0cde07a20e717ec4ef824ee46 100644 --- a/Sample/Material/RefractiveMaterialImpl.cpp +++ b/Sample/Material/RefractiveMaterialImpl.cpp @@ -41,7 +41,7 @@ complex_t RefractiveMaterialImpl::materialData() const { } complex_t RefractiveMaterialImpl::scalarSubtrSLD(const WavevectorInfo& wavevectors) const { - double wavelength = wavevectors.getWavelength(); + double wavelength = wavevectors.wavelength(); return M_PI / wavelength / wavelength * refractiveIndex2(wavelength); } diff --git a/Sample/Material/RefractiveMaterialImpl.h b/Sample/Material/RefractiveMaterialImpl.h index 0128614e02488302a63e90e70b5d62c045053bca..35912e0ff6dcc0ef4080a9f8b78effb0245a7bdb 100644 --- a/Sample/Material/RefractiveMaterialImpl.h +++ b/Sample/Material/RefractiveMaterialImpl.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MATERIAL_REFRACTIVEMATERIALIMPL_H #define BORNAGAIN_SAMPLE_MATERIAL_REFRACTIVEMATERIALIMPL_H diff --git a/Sample/Material/WavevectorInfo.h b/Sample/Material/WavevectorInfo.h index fa4eff86bd0e429f175b62e3d5e8635fd425a8e3..96ee081d28ced3bebc408a461252348f2804bf37 100644 --- a/Sample/Material/WavevectorInfo.h +++ b/Sample/Material/WavevectorInfo.h @@ -34,7 +34,7 @@ public: cvector_t getKi() const { return m_ki; } cvector_t getKf() const { return m_kf; } cvector_t getQ() const { return m_ki - m_kf; } - double getWavelength() const { return m_vacuum_wavelength; } + double wavelength() const { return m_vacuum_wavelength; } private: WavevectorInfo(); diff --git a/Sample/Multilayer/MultiLayerUtils.h b/Sample/Multilayer/MultiLayerUtils.h index e15a7c7050390f25a89b5dbd98b34d8cfa2d0c50..a637ae33d4563db3a66138c52d305c423e3cc338 100644 --- a/Sample/Multilayer/MultiLayerUtils.h +++ b/Sample/Multilayer/MultiLayerUtils.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MULTILAYER_MULTILAYERUTILS_H #define BORNAGAIN_SAMPLE_MULTILAYER_MULTILAYERUTILS_H diff --git a/Sample/Multilayer/PyImport.h b/Sample/Multilayer/PyImport.h index c040e65cc2e7f187b7c9c8491d59c5439d3d0cb0..44d7040a75652077f6815ac58715f00365726cf7 100644 --- a/Sample/Multilayer/PyImport.h +++ b/Sample/Multilayer/PyImport.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_MULTILAYER_PYIMPORT_H #define BORNAGAIN_SAMPLE_MULTILAYER_PYIMPORT_H diff --git a/Sample/Particle/FormFactorCoreShell.h b/Sample/Particle/FormFactorCoreShell.h index f4fd15da1e3f11cddead5cfaf761fb11d3f91ccc..0b6fdce882f2294b8e49f9ff5beacb7bdaad2bf5 100644 --- a/Sample/Particle/FormFactorCoreShell.h +++ b/Sample/Particle/FormFactorCoreShell.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCORESHELL_H #define BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCORESHELL_H diff --git a/Sample/Particle/FormFactorCrystal.cpp b/Sample/Particle/FormFactorCrystal.cpp index b0d9edc0a1bd8bdc240c5b6cdc40faff8cfa4c99..c166e240d329f64de3093d030d80239f4d60a6e8 100644 --- a/Sample/Particle/FormFactorCrystal.cpp +++ b/Sample/Particle/FormFactorCrystal.cpp @@ -50,10 +50,9 @@ complex_t FormFactorCrystal::evaluate(const WavevectorInfo& wavevectors) const { complex_t result(0.0, 0.0); for (const auto& rec : rec_vectors) { auto dw_factor = debyeWallerFactor(rec); - WavevectorInfo basis_wavevectors(kvector_t(), -rec, wavevectors.getWavelength()); + WavevectorInfo basis_wavevectors(kvector_t(), -rec, wavevectors.wavelength()); complex_t basis_factor = m_basis_form_factor->evaluate(basis_wavevectors); - WavevectorInfo meso_wavevectors(cvector_t(), rec.complex() - q, - wavevectors.getWavelength()); + WavevectorInfo meso_wavevectors(cvector_t(), rec.complex() - q, wavevectors.wavelength()); complex_t meso_factor = m_meso_form_factor->evaluate(meso_wavevectors); result += dw_factor * basis_factor * meso_factor; } @@ -73,10 +72,9 @@ Eigen::Matrix2cd FormFactorCrystal::evaluatePol(const WavevectorInfo& wavevector Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero(); for (const auto& rec : rec_vectors) { auto dw_factor = debyeWallerFactor(rec); - WavevectorInfo basis_wavevectors(kvector_t(), -rec, wavevectors.getWavelength()); + WavevectorInfo basis_wavevectors(kvector_t(), -rec, wavevectors.wavelength()); Eigen::Matrix2cd basis_factor = m_basis_form_factor->evaluatePol(basis_wavevectors); - WavevectorInfo meso_wavevectors(cvector_t(), rec.complex() - q, - wavevectors.getWavelength()); + WavevectorInfo meso_wavevectors(cvector_t(), rec.complex() - q, wavevectors.wavelength()); complex_t meso_factor = m_meso_form_factor->evaluate(meso_wavevectors); result += dw_factor * basis_factor * meso_factor; } diff --git a/Sample/Particle/HomogeneousRegion.h b/Sample/Particle/HomogeneousRegion.h index a9ff19a9fc83f2cb4f1c729e722beb438c645519..0519b6c40aed59c54beedca9f4ec62396e9d256a 100644 --- a/Sample/Particle/HomogeneousRegion.h +++ b/Sample/Particle/HomogeneousRegion.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PARTICLE_HOMOGENEOUSREGION_H #define BORNAGAIN_SAMPLE_PARTICLE_HOMOGENEOUSREGION_H diff --git a/Sample/Particle/ParticleDistribution.cpp b/Sample/Particle/ParticleDistribution.cpp index cd8239f2fc193a742605dd5cddaaff6c11a0f3c5..c643f36f1377b2de8752c65b7a11a35370fa0fec 100644 --- a/Sample/Particle/ParticleDistribution.cpp +++ b/Sample/Particle/ParticleDistribution.cpp @@ -16,6 +16,7 @@ #include "Param/Base/ParameterPool.h" #include "Param/Base/RealParameter.h" #include "Param/Distrib/Distributions.h" +#include "Param/Node/NodeUtils.h" #include "Param/Varia/ParameterUtils.h" #include "Sample/Particle/IParticle.h" #include <map> @@ -49,25 +50,34 @@ void ParticleDistribution::rotate(const IRotation& rotation) { //! Returns particle clones with parameter values drawn from distribution. SafePointerVector<IParticle> ParticleDistribution::generateParticles() const { - std::unique_ptr<ParameterPool> pool{m_particle->createParameterTree()}; + // createParameterTree + ParameterPool pool; + for (const INode* child : m_particle->progeny()) { + const std::string path = NodeUtils::nodePath(child, m_particle->parent()) + "/"; + child->parameterPool()->copyToExternalPool(path, &pool); + } std::string main_par_name = m_par_distribution.getMainParameterName(); - double main_par_value = pool->getUniqueMatch(main_par_name)->value(); + double main_par_value = pool.getUniqueMatch(main_par_name)->value(); // Preset link ratios: std::map<std::string, double> linked_ratios; for (const std::string& name : m_par_distribution.getLinkedParameterNames()) linked_ratios[name] = - main_par_value == 0 ? 1.0 : pool->getUniqueMatch(name)->value() / main_par_value; + main_par_value == 0 ? 1.0 : pool.getUniqueMatch(name)->value() / main_par_value; // Draw distribution samples; for each sample, create one particle clone: std::vector<ParameterSample> main_par_samples = m_par_distribution.generateSamples(); SafePointerVector<IParticle> result; for (const ParameterSample& main_sample : main_par_samples) { IParticle* particle_clone = m_particle->clone(); - std::unique_ptr<ParameterPool> new_pool{particle_clone->createParameterTree()}; - new_pool->setUniqueMatchValue(main_par_name, main_sample.value); + ParameterPool pool2; + for (const INode* child : particle_clone->progeny()) { + const std::string path = NodeUtils::nodePath(child, particle_clone->parent()) + "/"; + child->parameterPool()->copyToExternalPool(path, &pool2); + } + pool2.setUniqueMatchValue(main_par_name, main_sample.value); for (const auto& it : linked_ratios) - new_pool->setUniqueMatchValue(it.first, main_sample.value * it.second); + pool2.setUniqueMatchValue(it.first, main_sample.value * it.second); particle_clone->setAbundance(abundance() * main_sample.weight); result.push_back(particle_clone); } diff --git a/Sample/Particle/SlicedParticle.h b/Sample/Particle/SlicedParticle.h index c15144bca8bd7c05d41483494c3bd0a1fa3ff23e..3eba07be1fba65bac197c367087e6f1c28f10a2e 100644 --- a/Sample/Particle/SlicedParticle.h +++ b/Sample/Particle/SlicedParticle.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PARTICLE_SLICEDPARTICLE_H #define BORNAGAIN_SAMPLE_PARTICLE_SLICEDPARTICLE_H diff --git a/Sample/Particle/TRange.h b/Sample/Particle/TRange.h index afed9188b3c86cba6471f3abca24ebac916633d8..613c23f6dc2c8605446a129bd628dcfe499d60ad 100644 --- a/Sample/Particle/TRange.h +++ b/Sample/Particle/TRange.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PARTICLE_TRANGE_H #define BORNAGAIN_SAMPLE_PARTICLE_TRANGE_H diff --git a/Sample/Processed/ProcessedLayout.h b/Sample/Processed/ProcessedLayout.h index 74edd2870a763c00a0c12a8f35e445efc58c0596..38f6a0cfc4d367515ba7ead153c3e606af809ede 100644 --- a/Sample/Processed/ProcessedLayout.h +++ b/Sample/Processed/ProcessedLayout.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDLAYOUT_H #define BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDLAYOUT_H diff --git a/Sample/Processed/ProcessedSample.h b/Sample/Processed/ProcessedSample.h index 8d17b842d86845b2bb3390e61dc3a343a4c55543..150dac0385740bb44541ec9f106c4061f6c82852 100644 --- a/Sample/Processed/ProcessedSample.h +++ b/Sample/Processed/ProcessedSample.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDSAMPLE_H #define BORNAGAIN_SAMPLE_PROCESSED_PROCESSEDSAMPLE_H diff --git a/Sample/Processed/ProfileHelper.h b/Sample/Processed/ProfileHelper.h index 5d6bf1fb22bd0faa31ae4ce9aa12dfedb57280e1..bbeeea8d453cabf43931ca53f6dfad7cf2ec843f 100644 --- a/Sample/Processed/ProfileHelper.h +++ b/Sample/Processed/ProfileHelper.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_PROCESSED_PROFILEHELPER_H #define BORNAGAIN_SAMPLE_PROCESSED_PROFILEHELPER_H diff --git a/Sample/RT/ILayerRTCoefficients.h b/Sample/RT/ILayerRTCoefficients.h index e3896fb9a9fc400d7a30d04b6c32709b79c7a372..647902aa57954cbfa90ab3de1d6984ecb66e3128 100644 --- a/Sample/RT/ILayerRTCoefficients.h +++ b/Sample/RT/ILayerRTCoefficients.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_RT_ILAYERRTCOEFFICIENTS_H #define BORNAGAIN_SAMPLE_RT_ILAYERRTCOEFFICIENTS_H diff --git a/Sample/RT/MatrixRTCoefficients.h b/Sample/RT/MatrixRTCoefficients.h index 74132d68cfe81e0c38f06225eac5e6bf2ce4a4cf..b10fa8a895bab9abe8b70db5b7f254d22a60cc0f 100644 --- a/Sample/RT/MatrixRTCoefficients.h +++ b/Sample/RT/MatrixRTCoefficients.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_RT_MATRIXRTCOEFFICIENTS_H #define BORNAGAIN_SAMPLE_RT_MATRIXRTCOEFFICIENTS_H diff --git a/Sample/RT/ScalarRTCoefficients.h b/Sample/RT/ScalarRTCoefficients.h index f6f3627fe67eec0688daf1a66a186c6428c6f790..f9eb38944357dc6b133004eb12fee1b2930d2c37 100644 --- a/Sample/RT/ScalarRTCoefficients.h +++ b/Sample/RT/ScalarRTCoefficients.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_RT_SCALARRTCOEFFICIENTS_H #define BORNAGAIN_SAMPLE_RT_SCALARRTCOEFFICIENTS_H @@ -67,6 +71,10 @@ private: // implementation // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + inline ScalarRTCoefficients::ScalarRTCoefficients() : kz(0) { m_plus(0) = 1.0; m_plus(1) = 0.0; diff --git a/Sample/SampleBuilderEngine/FixedBuilder.h b/Sample/SampleBuilderEngine/FixedBuilder.h index 813a399e56bdd4380f29b475fb151dc079b830b8..b0b15b24d9136f2d2e33610599fe61ed9180715a 100644 --- a/Sample/SampleBuilderEngine/FixedBuilder.h +++ b/Sample/SampleBuilderEngine/FixedBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_FIXEDBUILDER_H #define BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_FIXEDBUILDER_H diff --git a/Sample/SampleBuilderEngine/IRegistry.h b/Sample/SampleBuilderEngine/IRegistry.h index 50c1fc32e0d59793cf587481388cfdf7c648c5f5..1ebae261c838ff9f1785a8642e560833b0bb3273 100644 --- a/Sample/SampleBuilderEngine/IRegistry.h +++ b/Sample/SampleBuilderEngine/IRegistry.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_IREGISTRY_H #define BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_IREGISTRY_H diff --git a/Sample/SampleBuilderEngine/SampleBuilderNode.h b/Sample/SampleBuilderEngine/SampleBuilderNode.h index 03dc79c7a16ff46b99ca0834db47ef325cdb5db0..0fb43532aa4eb539f20a73bff80fbec287009533 100644 --- a/Sample/SampleBuilderEngine/SampleBuilderNode.h +++ b/Sample/SampleBuilderEngine/SampleBuilderNode.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLEBUILDERNODE_H #define BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLEBUILDERNODE_H diff --git a/Sample/SampleBuilderEngine/SampleComponents.h b/Sample/SampleBuilderEngine/SampleComponents.h index f92bc2b019e11aaff4e83d5bec96b2e657e077b4..17f107bac148516ab242d7b486d1d57084a52a24 100644 --- a/Sample/SampleBuilderEngine/SampleComponents.h +++ b/Sample/SampleBuilderEngine/SampleComponents.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLECOMPONENTS_H #define BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLECOMPONENTS_H diff --git a/Sample/SampleBuilderEngine/SampleProvider.h b/Sample/SampleBuilderEngine/SampleProvider.h index 58e3921a1473598754023fefa3f7fb285b56e5cd..8c0b67e904495842644f61237126523bca9eb497 100644 --- a/Sample/SampleBuilderEngine/SampleProvider.h +++ b/Sample/SampleBuilderEngine/SampleProvider.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLEPROVIDER_H #define BORNAGAIN_SAMPLE_SAMPLEBUILDERENGINE_SAMPLEPROVIDER_H diff --git a/Sample/Scattering/FormFactorDecoratorMaterial.h b/Sample/Scattering/FormFactorDecoratorMaterial.h index efee08b72f16781f4b75e0aef9ad70fc51a44cfc..a23a988d11d8381734282a1fe3fcc7f665efa0aa 100644 --- a/Sample/Scattering/FormFactorDecoratorMaterial.h +++ b/Sample/Scattering/FormFactorDecoratorMaterial.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORMATERIAL_H #define BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORMATERIAL_H diff --git a/Sample/Scattering/FormFactorDecoratorPositionFactor.h b/Sample/Scattering/FormFactorDecoratorPositionFactor.h index c998328bba4733d80a430731e4cd5f60f4eb3815..abe3c90e51fc195a714b8eda93c575e4bb5a55f4 100644 --- a/Sample/Scattering/FormFactorDecoratorPositionFactor.h +++ b/Sample/Scattering/FormFactorDecoratorPositionFactor.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORPOSITIONFACTOR_H #define BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORPOSITIONFACTOR_H diff --git a/Sample/Scattering/FormFactorDecoratorRotation.h b/Sample/Scattering/FormFactorDecoratorRotation.h index 062ac7fe88ab190ba9aa3d276999c651fc65b409..80fea1616bb0579a3c36965b12a7034889e9815c 100644 --- a/Sample/Scattering/FormFactorDecoratorRotation.h +++ b/Sample/Scattering/FormFactorDecoratorRotation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORROTATION_H #define BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORROTATION_H diff --git a/Sample/Scattering/LayerFillLimits.h b/Sample/Scattering/LayerFillLimits.h index 088a28bc68b83d506ec5ae29b563c6a1f2c73eaf..39c7252dfaaabb10c3a681b9cb725a7857847080 100644 --- a/Sample/Scattering/LayerFillLimits.h +++ b/Sample/Scattering/LayerFillLimits.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SCATTERING_LAYERFILLLIMITS_H #define BORNAGAIN_SAMPLE_SCATTERING_LAYERFILLLIMITS_H diff --git a/Sample/Scattering/ZLimits.h b/Sample/Scattering/ZLimits.h index 4d3a42205d2017f9aa46de28582e7e75aa27e060..46f81f2f422e14d49efa65d6c9f12e65cef784e8 100644 --- a/Sample/Scattering/ZLimits.h +++ b/Sample/Scattering/ZLimits.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SCATTERING_ZLIMITS_H #define BORNAGAIN_SAMPLE_SCATTERING_ZLIMITS_H diff --git a/Sample/Shapes/Box.h b/Sample/Shapes/Box.h index ae08c8f121ca466232aeac67109d6df9b0464a88..e166bf89e9a6339377bbc80939366959121dea00 100644 --- a/Sample/Shapes/Box.h +++ b/Sample/Shapes/Box.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_BOX_H #define BORNAGAIN_SAMPLE_SHAPES_BOX_H diff --git a/Sample/Shapes/DoubleEllipse.h b/Sample/Shapes/DoubleEllipse.h index f5bb1f850dc5c8d1b87735811577dc929d34373d..c616b6cfb97e67cdb0621c1eafe3ada23c469d3f 100644 --- a/Sample/Shapes/DoubleEllipse.h +++ b/Sample/Shapes/DoubleEllipse.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_DOUBLEELLIPSE_H #define BORNAGAIN_SAMPLE_SHAPES_DOUBLEELLIPSE_H diff --git a/Sample/Shapes/IShape.h b/Sample/Shapes/IShape.h index 08d8133f924954998ce9483bd4851440b238fb96..96d4c30b6ff8080b389323610ebfec5880eebaa2 100644 --- a/Sample/Shapes/IShape.h +++ b/Sample/Shapes/IShape.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_ISHAPE_H #define BORNAGAIN_SAMPLE_SHAPES_ISHAPE_H diff --git a/Sample/Shapes/RippleCosine.h b/Sample/Shapes/RippleCosine.h index d4caebe6705d6de2bdfa530b895ab766b8f10579..cef9cdd584d9204da56f597e77f093ed9ed763b7 100644 --- a/Sample/Shapes/RippleCosine.h +++ b/Sample/Shapes/RippleCosine.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_RIPPLECOSINE_H #define BORNAGAIN_SAMPLE_SHAPES_RIPPLECOSINE_H diff --git a/Sample/Shapes/RippleSawtooth.h b/Sample/Shapes/RippleSawtooth.h index 15a6972b74bb7c2a5a35bd0e7a24f7abf7d7bc1c..6e1c971c45d203d74f3a2d0f5637a04a8927f5ab 100644 --- a/Sample/Shapes/RippleSawtooth.h +++ b/Sample/Shapes/RippleSawtooth.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_RIPPLESAWTOOTH_H #define BORNAGAIN_SAMPLE_SHAPES_RIPPLESAWTOOTH_H diff --git a/Sample/Shapes/TruncatedEllipsoid.h b/Sample/Shapes/TruncatedEllipsoid.h index c6a0ca2406a32659cdb74c0fc9027d773fc62fe4..ff139024741cf71c5521217bf37754d93bb7c9d9 100644 --- a/Sample/Shapes/TruncatedEllipsoid.h +++ b/Sample/Shapes/TruncatedEllipsoid.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SHAPES_TRUNCATEDELLIPSOID_H #define BORNAGAIN_SAMPLE_SHAPES_TRUNCATEDELLIPSOID_H diff --git a/Sample/Slice/KzComputation.h b/Sample/Slice/KzComputation.h index ca86308ca30a7474588bc338d16e6854e164bd87..b64b97bad052ec9dd12741704240ef0cbbb521c8 100644 --- a/Sample/Slice/KzComputation.h +++ b/Sample/Slice/KzComputation.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SLICE_KZCOMPUTATION_H #define BORNAGAIN_SAMPLE_SLICE_KZCOMPUTATION_H diff --git a/Sample/Slice/LayerInterface.h b/Sample/Slice/LayerInterface.h index 661a5842e1ec7437206b55be072148ca15614a2a..3528b31fcc056d4ffa51fa4a28de558bdfd58226 100644 --- a/Sample/Slice/LayerInterface.h +++ b/Sample/Slice/LayerInterface.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SLICE_LAYERINTERFACE_H #define BORNAGAIN_SAMPLE_SLICE_LAYERINTERFACE_H diff --git a/Sample/Slice/Slice.h b/Sample/Slice/Slice.h index 5ada6acff015caabe643c34397c9547485a2c577..9c83e230326f18082a2d80a07ac41ae43496ce41 100644 --- a/Sample/Slice/Slice.h +++ b/Sample/Slice/Slice.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SLICE_SLICE_H #define BORNAGAIN_SAMPLE_SLICE_SLICE_H diff --git a/Sample/Slice/SlicedFormFactorList.h b/Sample/Slice/SlicedFormFactorList.h index 6741aa9cb3b5a70360e02086d1510771b13b3776..6780b0221a5601e676cfc2a77be32b035e571b13 100644 --- a/Sample/Slice/SlicedFormFactorList.h +++ b/Sample/Slice/SlicedFormFactorList.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SLICE_SLICEDFORMFACTORLIST_H #define BORNAGAIN_SAMPLE_SLICE_SLICEDFORMFACTORLIST_H diff --git a/Sample/SoftParticle/SoftParticles.h b/Sample/SoftParticle/SoftParticles.h index 99d75689a10c19d95eaa5b2fd2d32b01cb01ea6b..9e73cbdbb6234b6a5eec532ec21bea73389564e1 100644 --- a/Sample/SoftParticle/SoftParticles.h +++ b/Sample/SoftParticle/SoftParticles.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SOFTPARTICLE_SOFTPARTICLES_H #define BORNAGAIN_SAMPLE_SOFTPARTICLE_SOFTPARTICLES_H diff --git a/Sample/Specular/ISpecularStrategy.h b/Sample/Specular/ISpecularStrategy.h index 6ee8edf9134c8a0509188ae47cefd8ed3892dc6f..3fe2700168cce7e453477dbf380a74f5ca9efd9e 100644 --- a/Sample/Specular/ISpecularStrategy.h +++ b/Sample/Specular/ISpecularStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_ISPECULARSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_ISPECULARSTRATEGY_H diff --git a/Sample/Specular/SpecularMagneticNCStrategy.h b/Sample/Specular/SpecularMagneticNCStrategy.h index 573c5b9e7a322dd09705f8694beb526aa29b49af..da43b6575a130ba8c9bdbf6d40f0ee66ea058d6a 100644 --- a/Sample/Specular/SpecularMagneticNCStrategy.h +++ b/Sample/Specular/SpecularMagneticNCStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICNCSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICNCSTRATEGY_H diff --git a/Sample/Specular/SpecularMagneticStrategy.h b/Sample/Specular/SpecularMagneticStrategy.h index f542da0d856487d0d7e93f9282b5d2feb0f87b89..f936cc94d8b124eb7a430ecdd0f27d1ac1d76892 100644 --- a/Sample/Specular/SpecularMagneticStrategy.h +++ b/Sample/Specular/SpecularMagneticStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICSTRATEGY_H diff --git a/Sample/Specular/SpecularMagneticTanhStrategy.h b/Sample/Specular/SpecularMagneticTanhStrategy.h index cb10b10636b46930554656c8183a99b63a70b0c6..52322a81a7529ad9aa333ede9f79dade3e987cc2 100644 --- a/Sample/Specular/SpecularMagneticTanhStrategy.h +++ b/Sample/Specular/SpecularMagneticTanhStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICTANHSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARMAGNETICTANHSTRATEGY_H diff --git a/Sample/Specular/SpecularScalarNCStrategy.h b/Sample/Specular/SpecularScalarNCStrategy.h index 20323631e970744945ba71d1f3100213623871ac..f492ae35d2af3f410f555295e9aa0d07b2f666d5 100644 --- a/Sample/Specular/SpecularScalarNCStrategy.h +++ b/Sample/Specular/SpecularScalarNCStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARNCSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARNCSTRATEGY_H diff --git a/Sample/Specular/SpecularScalarStrategy.h b/Sample/Specular/SpecularScalarStrategy.h index a9889440cf5d20cc4b02ab0c2792fa69f7099116..6ba7a7ddd4bdbbe4ea8ff2da81055f346d17eb22 100644 --- a/Sample/Specular/SpecularScalarStrategy.h +++ b/Sample/Specular/SpecularScalarStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARSTRATEGY_H diff --git a/Sample/Specular/SpecularScalarTanhStrategy.h b/Sample/Specular/SpecularScalarTanhStrategy.h index 494622e6e721f89778772e1b0e7753e2c88a0d2e..bf8f908f141cb53cb98bb250773d7b86fff0913b 100644 --- a/Sample/Specular/SpecularScalarTanhStrategy.h +++ b/Sample/Specular/SpecularScalarTanhStrategy.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARTANHSTRATEGY_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARSCALARTANHSTRATEGY_H diff --git a/Sample/Specular/SpecularStrategyBuilder.h b/Sample/Specular/SpecularStrategyBuilder.h index bbe67b861508b55ed743a9d5e899369b8e9ae222..ee0c01cc950963591a2a2fca573c59b773b90a34 100644 --- a/Sample/Specular/SpecularStrategyBuilder.h +++ b/Sample/Specular/SpecularStrategyBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_SPECULAR_SPECULARSTRATEGYBUILDER_H #define BORNAGAIN_SAMPLE_SPECULAR_SPECULARSTRATEGYBUILDER_H diff --git a/Sample/StandardSamples/BoxCompositionBuilder.h b/Sample/StandardSamples/BoxCompositionBuilder.h index 414e377e3e02cde188bcbbcf96f0cd16e335ba41..12603fb3b61811dc6b40d69e7a81fcffbddf5db9 100644 --- a/Sample/StandardSamples/BoxCompositionBuilder.h +++ b/Sample/StandardSamples/BoxCompositionBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_BOXCOMPOSITIONBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_BOXCOMPOSITIONBUILDER_H diff --git a/Sample/StandardSamples/BoxesSquareLatticeBuilder.h b/Sample/StandardSamples/BoxesSquareLatticeBuilder.h index 880d1487c1c872ac64337ab3cede1b1a3e6cc334..9af2f5c4dff194e54b8e03c09852488bd7ab21bc 100644 --- a/Sample/StandardSamples/BoxesSquareLatticeBuilder.h +++ b/Sample/StandardSamples/BoxesSquareLatticeBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_BOXESSQUARELATTICEBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_BOXESSQUARELATTICEBUILDER_H diff --git a/Sample/StandardSamples/CoreShellParticleBuilder.h b/Sample/StandardSamples/CoreShellParticleBuilder.h index ed57756d85cceb5d965f53de82c37390aedeb0e6..3dde8bda2585721f20975fc5c059d706a93541be 100644 --- a/Sample/StandardSamples/CoreShellParticleBuilder.h +++ b/Sample/StandardSamples/CoreShellParticleBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_CORESHELLPARTICLEBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_CORESHELLPARTICLEBUILDER_H diff --git a/Sample/StandardSamples/CustomMorphologyBuilder.h b/Sample/StandardSamples/CustomMorphologyBuilder.h index 0e6b2f3f0e9251f83b0937e6f49b449a4d4bc5ac..a6e5767ad69df914814a49fba9ccd99c1dbf6cfc 100644 --- a/Sample/StandardSamples/CustomMorphologyBuilder.h +++ b/Sample/StandardSamples/CustomMorphologyBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_CUSTOMMORPHOLOGYBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_CUSTOMMORPHOLOGYBUILDER_H diff --git a/Sample/StandardSamples/CylindersAndPrismsBuilder.h b/Sample/StandardSamples/CylindersAndPrismsBuilder.h index 58b0d0a7c87cf5e7a98f49ca7ea7dc32ecc91a86..5d18aa8384ce07ba7ebdd789898ea65d855bf6fa 100644 --- a/Sample/StandardSamples/CylindersAndPrismsBuilder.h +++ b/Sample/StandardSamples/CylindersAndPrismsBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_CYLINDERSANDPRISMSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_CYLINDERSANDPRISMSBUILDER_H diff --git a/Sample/StandardSamples/CylindersBuilder.h b/Sample/StandardSamples/CylindersBuilder.h index f184fc37094113ce50e4c33c5a23665246d3bd70..cad88c2fea9919e9412ad0f4a2c5f8e2c7c2980d 100644 --- a/Sample/StandardSamples/CylindersBuilder.h +++ b/Sample/StandardSamples/CylindersBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_CYLINDERSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_CYLINDERSBUILDER_H diff --git a/Sample/StandardSamples/FeNiBilayerBuilder.h b/Sample/StandardSamples/FeNiBilayerBuilder.h index dead27269ba56a9cb58c35294e7afcf116f14aa8..0feb343dbd6906af7a4803795e4b1299b31cccb1 100644 --- a/Sample/StandardSamples/FeNiBilayerBuilder.h +++ b/Sample/StandardSamples/FeNiBilayerBuilder.h @@ -13,6 +13,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_FENIBILAYERBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_FENIBILAYERBUILDER_H diff --git a/Sample/StandardSamples/HomogeneousMultilayerBuilder.h b/Sample/StandardSamples/HomogeneousMultilayerBuilder.h index 09ee0e6dd258b7600132c4b862c4afe279cc2316..3cd30a87737661581c98622116beeb3ebe54127e 100644 --- a/Sample/StandardSamples/HomogeneousMultilayerBuilder.h +++ b/Sample/StandardSamples/HomogeneousMultilayerBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_HOMOGENEOUSMULTILAYERBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_HOMOGENEOUSMULTILAYERBUILDER_H diff --git a/Sample/StandardSamples/LatticeBuilder.h b/Sample/StandardSamples/LatticeBuilder.h index bf0e947636c352a7350a9d447bb52c6ec07ca141..997e74fc250585fa8e0b20a8cfc67a2ae95ae2ad 100644 --- a/Sample/StandardSamples/LatticeBuilder.h +++ b/Sample/StandardSamples/LatticeBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_LATTICEBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_LATTICEBUILDER_H diff --git a/Sample/StandardSamples/LayersWithAbsorptionBuilder.h b/Sample/StandardSamples/LayersWithAbsorptionBuilder.h index 508cc4bc5a79c515ef0c54aeec2db739bcd5470c..22688c186bd8222c9b7b79a4b6413ecc77e5b313 100644 --- a/Sample/StandardSamples/LayersWithAbsorptionBuilder.h +++ b/Sample/StandardSamples/LayersWithAbsorptionBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_LAYERSWITHABSORPTIONBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_LAYERSWITHABSORPTIONBUILDER_H diff --git a/Sample/StandardSamples/LayersWithAbsorptionBySLDBuilder.h b/Sample/StandardSamples/LayersWithAbsorptionBySLDBuilder.h index 8b6bc1796c545753ae116b706df55e66ca65a403..ae805e2b63bad22c37290976d2e0415cafdb8bf7 100644 --- a/Sample/StandardSamples/LayersWithAbsorptionBySLDBuilder.h +++ b/Sample/StandardSamples/LayersWithAbsorptionBySLDBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_LAYERSWITHABSORPTIONBYSLDBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_LAYERSWITHABSORPTIONBYSLDBUILDER_H diff --git a/Sample/StandardSamples/MagneticLayersBuilder.h b/Sample/StandardSamples/MagneticLayersBuilder.h index 77c0b1ed9d46ebf829cc483ed49e7faa1214759a..7b43960a7da610e91c049791ac70c8bf4e96a810 100644 --- a/Sample/StandardSamples/MagneticLayersBuilder.h +++ b/Sample/StandardSamples/MagneticLayersBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MAGNETICLAYERSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MAGNETICLAYERSBUILDER_H diff --git a/Sample/StandardSamples/MagneticParticlesBuilder.h b/Sample/StandardSamples/MagneticParticlesBuilder.h index 73fcce62a8be4f2cfeed091cf3a6a73e9c381001..3c258b94cc9685493f8bbb0059959a5ed6adc468 100644 --- a/Sample/StandardSamples/MagneticParticlesBuilder.h +++ b/Sample/StandardSamples/MagneticParticlesBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MAGNETICPARTICLESBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MAGNETICPARTICLESBUILDER_H diff --git a/Sample/StandardSamples/MesoCrystalBuilder.h b/Sample/StandardSamples/MesoCrystalBuilder.h index d5ea4154645900ca1f2170953333715e6acdc7fa..77f27453af7c6dd78d1a3b9fffcbe705726da531 100644 --- a/Sample/StandardSamples/MesoCrystalBuilder.h +++ b/Sample/StandardSamples/MesoCrystalBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MESOCRYSTALBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MESOCRYSTALBUILDER_H diff --git a/Sample/StandardSamples/MultiLayerWithNCRoughnessBuilder.h b/Sample/StandardSamples/MultiLayerWithNCRoughnessBuilder.h index 1ff76cec240171fd86a9cc1f255db8eff6c59ef2..ad0aa325d57ef61ec1bfdd21e5af8495c4de5000 100644 --- a/Sample/StandardSamples/MultiLayerWithNCRoughnessBuilder.h +++ b/Sample/StandardSamples/MultiLayerWithNCRoughnessBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTILAYERWITHNCROUGHNESSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTILAYERWITHNCROUGHNESSBUILDER_H diff --git a/Sample/StandardSamples/MultiLayerWithRoughnessBuilder.h b/Sample/StandardSamples/MultiLayerWithRoughnessBuilder.h index fdc7fa55b2a5d3f242889a9f0522d02b281eff6d..f87040eb72c4b4fa219364a5728569c0f7b515ec 100644 --- a/Sample/StandardSamples/MultiLayerWithRoughnessBuilder.h +++ b/Sample/StandardSamples/MultiLayerWithRoughnessBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTILAYERWITHROUGHNESSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTILAYERWITHROUGHNESSBUILDER_H diff --git a/Sample/StandardSamples/MultipleLayoutBuilder.h b/Sample/StandardSamples/MultipleLayoutBuilder.h index c4d3068b7ba74325d495bfdc2950959cb527cca1..05ee9b0e8cadaaa6819c29d4e24a2861a147cade 100644 --- a/Sample/StandardSamples/MultipleLayoutBuilder.h +++ b/Sample/StandardSamples/MultipleLayoutBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTIPLELAYOUTBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_MULTIPLELAYOUTBUILDER_H diff --git a/Sample/StandardSamples/ParaCrystalBuilder.h b/Sample/StandardSamples/ParaCrystalBuilder.h index 4ab0938a10f96908f19ffadc100f176bdce02872..51fc6573e9f604077319dabd44e2c7e05fa90464 100644 --- a/Sample/StandardSamples/ParaCrystalBuilder.h +++ b/Sample/StandardSamples/ParaCrystalBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARACRYSTALBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARACRYSTALBUILDER_H diff --git a/Sample/StandardSamples/ParticleCompositionBuilder.h b/Sample/StandardSamples/ParticleCompositionBuilder.h index af864965bd14850abbf8ecdad95e299684d2d0f9..22ca2a9395322b0e12ba2873ef661fca45c72bbe 100644 --- a/Sample/StandardSamples/ParticleCompositionBuilder.h +++ b/Sample/StandardSamples/ParticleCompositionBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLECOMPOSITIONBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLECOMPOSITIONBUILDER_H diff --git a/Sample/StandardSamples/ParticleDistributionsBuilder.h b/Sample/StandardSamples/ParticleDistributionsBuilder.h index 773503afe9ceab31b594610a05d7750d1277dee6..f0c643f643cffe83c3071905103215ac5ad053a0 100644 --- a/Sample/StandardSamples/ParticleDistributionsBuilder.h +++ b/Sample/StandardSamples/ParticleDistributionsBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLEDISTRIBUTIONSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLEDISTRIBUTIONSBUILDER_H diff --git a/Sample/StandardSamples/ParticleInVacuumBuilder.h b/Sample/StandardSamples/ParticleInVacuumBuilder.h index d36e1e5c8bab6890df5b5e0d563b7564c7b48519..200c6a5f156518bcd929f3fd743d9070bb0684fd 100644 --- a/Sample/StandardSamples/ParticleInVacuumBuilder.h +++ b/Sample/StandardSamples/ParticleInVacuumBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLEINVACUUMBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PARTICLEINVACUUMBUILDER_H diff --git a/Sample/StandardSamples/PercusYevickBuilder.h b/Sample/StandardSamples/PercusYevickBuilder.h index 7789c6e29566debde8c9d14a9faff1f10ec4f799..06cc34d1198c1401ae2b2a4c5d6e281c2c5df9d6 100644 --- a/Sample/StandardSamples/PercusYevickBuilder.h +++ b/Sample/StandardSamples/PercusYevickBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PERCUSYEVICKBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PERCUSYEVICKBUILDER_H diff --git a/Sample/StandardSamples/PlainMultiLayerBySLDBuilder.h b/Sample/StandardSamples/PlainMultiLayerBySLDBuilder.h index 46ea0b583d296388c4e21f94d68187cf2b37b3ba..5faf02f2e03883249f2e38f55be05e9e905e50e5 100644 --- a/Sample/StandardSamples/PlainMultiLayerBySLDBuilder.h +++ b/Sample/StandardSamples/PlainMultiLayerBySLDBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_PLAINMULTILAYERBYSLDBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_PLAINMULTILAYERBYSLDBUILDER_H diff --git a/Sample/StandardSamples/ReferenceMaterials.h b/Sample/StandardSamples/ReferenceMaterials.h index 2dccbb86e46e813e8ac93575723c402002c19bed..bd57e6dd130f24f6c8258efec32ae606ee2a2f20 100644 --- a/Sample/StandardSamples/ReferenceMaterials.h +++ b/Sample/StandardSamples/ReferenceMaterials.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_REFERENCEMATERIALS_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_REFERENCEMATERIALS_H diff --git a/Sample/StandardSamples/ResonatorBuilder.h b/Sample/StandardSamples/ResonatorBuilder.h index 6216d83292e001ccb19af0e19bdd5982da53b0c3..31271cd3da817722b4bf68887fdcf1766dd57efc 100644 --- a/Sample/StandardSamples/ResonatorBuilder.h +++ b/Sample/StandardSamples/ResonatorBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_RESONATORBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_RESONATORBUILDER_H diff --git a/Sample/StandardSamples/RipplesBuilder.h b/Sample/StandardSamples/RipplesBuilder.h index 6011c8e56287933dbdedd75773605bee37e0a36c..47f611b315e543447ef9f5024d7ab7bf9a54680a 100644 --- a/Sample/StandardSamples/RipplesBuilder.h +++ b/Sample/StandardSamples/RipplesBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_RIPPLESBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_RIPPLESBUILDER_H diff --git a/Sample/StandardSamples/RotatedPyramidsBuilder.h b/Sample/StandardSamples/RotatedPyramidsBuilder.h index 1d51914b59780cad0553959c239d5f2e737f5deb..7bf8d02379f41768a1f64247d36bdf1542caaf17 100644 --- a/Sample/StandardSamples/RotatedPyramidsBuilder.h +++ b/Sample/StandardSamples/RotatedPyramidsBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_ROTATEDPYRAMIDSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_ROTATEDPYRAMIDSBUILDER_H diff --git a/Sample/StandardSamples/SizeDistributionModelsBuilder.h b/Sample/StandardSamples/SizeDistributionModelsBuilder.h index d986fe50dce44faf2377e18edc7265f678d73174..757fc77bf3f9741d12e37bad18164dfc42d49b49 100644 --- a/Sample/StandardSamples/SizeDistributionModelsBuilder.h +++ b/Sample/StandardSamples/SizeDistributionModelsBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_SIZEDISTRIBUTIONMODELSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_SIZEDISTRIBUTIONMODELSBUILDER_H diff --git a/Sample/StandardSamples/SlicedCompositionBuilder.h b/Sample/StandardSamples/SlicedCompositionBuilder.h index 1f7d2d498cdefdec63f9c01f3f5185458a1c15fa..8770fe902381e469ba378dc13e54b1c6f36ca868 100644 --- a/Sample/StandardSamples/SlicedCompositionBuilder.h +++ b/Sample/StandardSamples/SlicedCompositionBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_SLICEDCOMPOSITIONBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_SLICEDCOMPOSITIONBUILDER_H diff --git a/Sample/StandardSamples/SlicedCylindersBuilder.h b/Sample/StandardSamples/SlicedCylindersBuilder.h index 64e43d7bc6758cc949d61fe1fe29d6163101b54b..848d8836338b1bb33c60460b19f94fa7339dfed7 100644 --- a/Sample/StandardSamples/SlicedCylindersBuilder.h +++ b/Sample/StandardSamples/SlicedCylindersBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_SLICEDCYLINDERSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_SLICEDCYLINDERSBUILDER_H diff --git a/Sample/StandardSamples/ThickAbsorptiveSampleBuilder.h b/Sample/StandardSamples/ThickAbsorptiveSampleBuilder.h index 16f8f18bc9bcd597bc22ed481874cab2e7594128..f2daabaec738b81a524ede75a1379db045cd35c2 100644 --- a/Sample/StandardSamples/ThickAbsorptiveSampleBuilder.h +++ b/Sample/StandardSamples/ThickAbsorptiveSampleBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_THICKABSORPTIVESAMPLEBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_THICKABSORPTIVESAMPLEBUILDER_H diff --git a/Sample/StandardSamples/TransformationsBuilder.h b/Sample/StandardSamples/TransformationsBuilder.h index d39dfe02ff4d11858c5b9d6ceff0482827c943bc..3b722d179e4b131d45f42b694961a5dd56aeb0e6 100644 --- a/Sample/StandardSamples/TransformationsBuilder.h +++ b/Sample/StandardSamples/TransformationsBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_TRANSFORMATIONSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_TRANSFORMATIONSBUILDER_H diff --git a/Sample/StandardSamples/TwoDimLatticeBuilder.h b/Sample/StandardSamples/TwoDimLatticeBuilder.h index def374cb8119e52f4c4913888326d859f99a249b..7c144696f0efd93df13d7135cb245af5dd0b057d 100644 --- a/Sample/StandardSamples/TwoDimLatticeBuilder.h +++ b/Sample/StandardSamples/TwoDimLatticeBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_TWODIMLATTICEBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_TWODIMLATTICEBUILDER_H diff --git a/Sample/StandardSamples/TwoLayerRoughnessBuilder.h b/Sample/StandardSamples/TwoLayerRoughnessBuilder.h index 76a19f28913cc45759d9c9c19175791498b4094e..bebd5f18589a7000a492e7d3112a824b5de1259c 100644 --- a/Sample/StandardSamples/TwoLayerRoughnessBuilder.h +++ b/Sample/StandardSamples/TwoLayerRoughnessBuilder.h @@ -12,6 +12,10 @@ // // ************************************************************************************************ +#ifdef SWIG +#error no need to expose this header to Swig +#endif + #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLES_TWOLAYERROUGHNESSBUILDER_H #define BORNAGAIN_SAMPLE_STANDARDSAMPLES_TWOLAYERROUGHNESSBUILDER_H diff --git a/Tests/Functional/Python/PyCore/mesocrystal1.py b/Tests/Functional/Python/PyCore/mesocrystal1.py index 6e1bbc7b1604e844be849f6188e3073cc37866ca..b4c5de2b1cce321074322ccfc349d8d3dc1be658 100644 --- a/Tests/Functional/Python/PyCore/mesocrystal1.py +++ b/Tests/Functional/Python/PyCore/mesocrystal1.py @@ -176,7 +176,7 @@ def runTest(): def createSimulation(): simulation = GISASSimulation() simulation.setBeamParameters(1.77*angstrom, 0.4*deg, 0.0*deg) - simulation.setBeamIntensity(5.0090e+12) + simulation.beam().setIntensity(5.0090e+12) simulation.setDetectorParameters(50, 0.2*deg, 2.5*deg, 50, 0.0*deg, 2.5*deg) return simulation diff --git a/Tests/Functional/Python/PyCore/polmagcylinders1.py b/Tests/Functional/Python/PyCore/polmagcylinders1.py index 6159e4a58ba1fe656af52a22524318bfa18584f6..81646345cde2e65b802f461309ec4b044f86840c 100644 --- a/Tests/Functional/Python/PyCore/polmagcylinders1.py +++ b/Tests/Functional/Python/PyCore/polmagcylinders1.py @@ -40,7 +40,7 @@ def runSimulation(): simulation.setDetectorParameters(100, 0*deg, 2.0*deg, 100, 0.0*deg, 2.0*deg) simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) simulation.setSample(multi_layer) - simulation.setBeamIntensity(1e2) + simulation.beam().setIntensity(1e2) simulation.runSimulation() ## intensity data return simulation.result() diff --git a/Tests/Functional/Python/PyCore/polmagcylinders2.py b/Tests/Functional/Python/PyCore/polmagcylinders2.py index 76189b4f1e9a8777cca0cb3a248f55691c01ac69..3e969efa3c3bc0a638e0e72de106e7bd0b09d806 100644 --- a/Tests/Functional/Python/PyCore/polmagcylinders2.py +++ b/Tests/Functional/Python/PyCore/polmagcylinders2.py @@ -47,7 +47,7 @@ def getSimulationIntensity(rho_beam, efficiency): simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg) simulation.setBeamPolarization(rho_beam) simulation.setSample(multi_layer) - simulation.setBeamIntensity(1e9) + simulation.beam().setIntensity(1e9) simulation.runSimulation() print("- - simulation done", flush=True) return simulation.result() diff --git a/Tests/Functional/Python/PyPersistence/PyPersistence.py.in b/Tests/Functional/Python/PyPersistence/PyPersistence.py.in index 6ae8cb8e2021850c535777ec594f3a47ac7e24fd..51a877e200299274c4656a5650f3d97824d0c592 100644 --- a/Tests/Functional/Python/PyPersistence/PyPersistence.py.in +++ b/Tests/Functional/Python/PyPersistence/PyPersistence.py.in @@ -34,8 +34,8 @@ def get_simulation_DepthProbe(): Returns custom simulation in the case of depth probe. """ simulation = example.get_simulation() - beam = simulation.instrument().beam() - wavelength = beam.getWavelength() + beam = simulation.beam() + wavelength = beam.wavelength() incl_axis = simulation.getAlphaAxis() z_axis = simulation.getZAxis() footprint = beam.footprintFactor() @@ -62,7 +62,7 @@ def get_simulation_GenericExample(): threads settings etc) remains intact. """ simulation = example.get_simulation() - detector = simulation.instrument().getDetector() + detector = simulation.detector() # preserving axes range, making less bins ax = detector.axis(0) diff --git a/Tests/UnitTests/Core/Axes/UnitConverter1DTest.cpp b/Tests/UnitTests/Core/Axes/UnitConverter1DTest.cpp index 1059ec1aeb39d6dfb4b232021e18e84800fea65a..68740f59027e9f6bd2dffa40e3d67efe62c67871 100644 --- a/Tests/UnitTests/Core/Axes/UnitConverter1DTest.cpp +++ b/Tests/UnitTests/Core/Axes/UnitConverter1DTest.cpp @@ -12,7 +12,7 @@ class UnitConverter1DTest : public ::testing::Test { public: UnitConverter1DTest(); - double getQ(double angle) { return 4.0 * M_PI * std::sin(angle) / m_beam.getWavelength(); } + double getQ(double angle) { return 4.0 * M_PI * std::sin(angle) / m_beam.wavelength(); } protected: void checkConventionalConverter(const UnitConverter1D& test_object); diff --git a/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp b/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp index 9579a08d3c0dff2263fabbf29c5e61c732896e05..289064bea75e9d021ed94af3b084f8f21e3faa30 100644 --- a/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp +++ b/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp @@ -79,13 +79,6 @@ TEST_F(DetectorMaskTest, AddMask) { EXPECT_FALSE(detectorMask.isMasked(index)); } } - - // clearing all masks - detectorMask.removeMasks(); - detectorMask.initMaskData(detector); - for (size_t index = 0; index < detectorMask.getMaskData()->getAllocatedSize(); ++index) { - EXPECT_FALSE(detectorMask.isMasked(index)); - } } TEST_F(DetectorMaskTest, AssignmentOperator) { diff --git a/Tests/UnitTests/Core/Detector/OffSpecularConverterTest.cpp b/Tests/UnitTests/Core/Detector/OffSpecularConverterTest.cpp index 04e0e066c9a0ba8ac1fb294c0d4838c17a2e531e..dd276565b021fc785e27ca15af39d421bf707c3a 100644 --- a/Tests/UnitTests/Core/Detector/OffSpecularConverterTest.cpp +++ b/Tests/UnitTests/Core/Detector/OffSpecularConverterTest.cpp @@ -17,7 +17,7 @@ protected: OffSpecularConverterTest::OffSpecularConverterTest() : m_detector(100, 0.0, 5.0 * Units::deg, 70, -2.0 * Units::deg, 1.5) , m_alpha_i_axis("alpha_i", 51, 0.0, 7.0 * Units::deg) - , m_beam(1.0, 1.0 * Units::deg, 0.0, 1.0) {} + , m_beam(1.0, 1.0, {1.0 * Units::deg, 0.0}) {} TEST_F(OffSpecularConverterTest, OffSpecularConverter) { OffSpecularConverter converter(m_detector, m_beam, m_alpha_i_axis); diff --git a/Tests/UnitTests/Core/Detector/RectangularConverterTest.cpp b/Tests/UnitTests/Core/Detector/RectangularConverterTest.cpp index 7dd6cb5209c97fb7fa1d7bf3ec1b3793afe59397..2f077de53181c1024c6ecb1583f8cbfa6ff477a0 100644 --- a/Tests/UnitTests/Core/Detector/RectangularConverterTest.cpp +++ b/Tests/UnitTests/Core/Detector/RectangularConverterTest.cpp @@ -25,14 +25,14 @@ protected: }; RectangularConverterTest::RectangularConverterTest() - : m_detector(det_nx, det_width, det_ny, det_height), m_beam(1.0, 1.0 * Units::deg, 0.0, 1.0) { + : m_detector(det_nx, det_width, det_ny, det_height), m_beam(1.0, 1.0, {1 * Units::deg, 0}) { m_detector.setPerpendicularToSampleX(det_distance, det_width / 2.0, 0.0); m_detector.init(m_beam); m_phi = std::atan2(det_width / 2.0, det_distance); m_alpha = std::atan2(det_height, det_distance / std::cos(m_phi)); auto k_i = m_beam.getCentralK(); m_kiz = k_i.z(); - double K = 2.0 * M_PI / m_beam.getWavelength(); + double K = 2.0 * M_PI / m_beam.wavelength(); m_kfy = K * std::sin(m_phi); m_kfz = K * std::sin(m_alpha); } diff --git a/Tests/UnitTests/Core/Detector/SphericalConverterTest.cpp b/Tests/UnitTests/Core/Detector/SphericalConverterTest.cpp index f0ca02d215ad30991b33acb886be32861567dc5f..f46b4a91a1282beddb03bcd802188f9325076eda 100644 --- a/Tests/UnitTests/Core/Detector/SphericalConverterTest.cpp +++ b/Tests/UnitTests/Core/Detector/SphericalConverterTest.cpp @@ -16,10 +16,10 @@ protected: SphericalConverterTest::SphericalConverterTest() : m_detector(100, 0.0, 5.0 * Units::deg, 70, -2.0 * Units::deg, 1.5) - , m_beam(1.0, 1.0 * Units::deg, 0.0, 1.0) { + , m_beam(1.0, 1.0, {1 * Units::deg, 0}) { const auto k_i = m_beam.getCentralK(); m_kiz = k_i.z(); - const double K = 2.0 * M_PI / m_beam.getWavelength(); + const double K = 2.0 * M_PI / m_beam.wavelength(); m_kfy = K * std::sin(5.0 * Units::deg); m_kfz1 = K * std::sin(-2.0 * Units::deg); m_kfz2 = K * std::sin(1.5); diff --git a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp index 5041a197682f37244ffa56380c1fe57d62dcfe6d..d647752596219e792f2cd20e55bebb67f0b5f9d5 100644 --- a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp @@ -97,15 +97,15 @@ TEST_F(DepthProbeSimulationTest, SetBeamParameters) { EXPECT_EQ(10u, sim.getAlphaAxis()->size()); EXPECT_EQ(1.0 * Units::deg, sim.getAlphaAxis()->lowerBound()); EXPECT_EQ(10.0 * Units::deg, sim.getAlphaAxis()->upperBound()); - EXPECT_EQ(1.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(1.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); sim.setBeamIntensity(2.0); - EXPECT_EQ(2.0, beam.getIntensity()); + EXPECT_EQ(2.0, beam.intensity()); EXPECT_THROW(sim.setBeamParameters(1.0, 10, -2.0, 3.0), std::runtime_error); EXPECT_THROW(sim.setBeamParameters(1.0, 10, 2.0, 1.0), std::runtime_error); @@ -115,10 +115,10 @@ TEST_F(DepthProbeSimulationTest, SetBeamParameters) { EXPECT_EQ(10u, sim.getAlphaAxis()->size()); EXPECT_EQ(1.0 * Units::deg, sim.getAlphaAxis()->lowerBound()); EXPECT_EQ(10.0 * Units::deg, sim.getAlphaAxis()->upperBound()); - EXPECT_EQ(2.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(2.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); diff --git a/Tests/UnitTests/Core/Fresnel/KzComputationTest.cpp b/Tests/UnitTests/Core/Fresnel/KzComputationTest.cpp index 6ffa36d49c611a30940f4ee20dc27afae4b12f32..9edfe350d2783391913944c969019b84a4ae93e4 100644 --- a/Tests/UnitTests/Core/Fresnel/KzComputationTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/KzComputationTest.cpp @@ -1,5 +1,6 @@ #include "Sample/Slice/KzComputation.h" #include "Base/Const/Units.h" +#include "Base/Vector/Direction.h" #include "Sample/Material/MaterialFactoryFuncs.h" #include "Sample/Multilayer/Layer.h" #include "Sample/Multilayer/MultiLayer.h" diff --git a/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp index e11310ffa269a450c2ede5d960b3737340240d2a..b03cccda414e131bf43c81e5d58a15cbb5184c49 100644 --- a/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp @@ -1,4 +1,5 @@ #include "Base/Const/Units.h" +#include "Base/Vector/Direction.h" #include "Core/Legacy/SpecularMagneticStrategy_v2.h" #include "Sample/Material/MaterialFactoryFuncs.h" #include "Sample/Multilayer/Layer.h" diff --git a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp index 2a5fb3a6d31a79b4c035b65d93b29126bb8fa626..0956f0c5146b8c0c701448eb07fb5365bf51798d 100644 --- a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp @@ -84,25 +84,25 @@ TEST_F(SpecularSimulationTest, SetAngularScan) { EXPECT_EQ(2u, sim.coordinateAxis()->size()); EXPECT_EQ(1.0 * Units::deg, sim.coordinateAxis()->lowerBound()); EXPECT_EQ(3.0 * Units::deg, sim.coordinateAxis()->upperBound()); - EXPECT_EQ(1.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(1.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); sim.setBeamIntensity(2.0); - EXPECT_EQ(2.0, beam.getIntensity()); + EXPECT_EQ(2.0, beam.intensity()); AngularSpecScan scan2(1.0, 10, 1.0 * Units::deg, 10.0 * Units::deg); sim.setScan(scan2); EXPECT_EQ(10u, sim.coordinateAxis()->size()); EXPECT_EQ(1.0 * Units::deg, sim.coordinateAxis()->lowerBound()); EXPECT_EQ(10.0 * Units::deg, sim.coordinateAxis()->upperBound()); - EXPECT_EQ(2.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(2.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); AngularSpecScan scan3(1.0, 10, -1.0 * Units::deg, 2.0 * Units::deg); @@ -111,10 +111,10 @@ TEST_F(SpecularSimulationTest, SetAngularScan) { EXPECT_EQ(10u, sim.coordinateAxis()->size()); EXPECT_EQ(1.0 * Units::deg, sim.coordinateAxis()->lowerBound()); EXPECT_EQ(10.0 * Units::deg, sim.coordinateAxis()->upperBound()); - EXPECT_EQ(2.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(2.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); sim.setInstrument(Instrument()); @@ -132,25 +132,25 @@ TEST_F(SpecularSimulationTest, SetQScan) { EXPECT_EQ(2u, sim.coordinateAxis()->size()); EXPECT_EQ(1.0, sim.coordinateAxis()->lowerBound()); EXPECT_EQ(3.0, sim.coordinateAxis()->upperBound()); - EXPECT_EQ(1.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(1.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); sim.setBeamIntensity(2.0); - EXPECT_EQ(2.0, beam.getIntensity()); + EXPECT_EQ(2.0, beam.intensity()); QSpecScan scan2(10, 1.0, 10.0); sim.setScan(scan2); EXPECT_EQ(10u, sim.coordinateAxis()->size()); EXPECT_EQ(1.0, sim.coordinateAxis()->lowerBound()); EXPECT_EQ(10.0, sim.coordinateAxis()->upperBound()); - EXPECT_EQ(2.0, beam.getIntensity()); - EXPECT_EQ(1.0, beam.getWavelength()); - EXPECT_EQ(0.0, beam.getAlpha()); - EXPECT_EQ(0.0, beam.getPhi()); + EXPECT_EQ(2.0, beam.intensity()); + EXPECT_EQ(1.0, beam.wavelength()); + EXPECT_EQ(0.0, beam.direction().alpha()); + EXPECT_EQ(0.0, beam.direction().phi()); checkBeamState(sim); } diff --git a/Tests/UnitTests/Core/Legacy/SpecularMagnetic_v1Test.cpp b/Tests/UnitTests/Core/Legacy/SpecularMagnetic_v1Test.cpp index 9f7c248d7d26fb07a8384b51fed1dfd3047b1ca9..ae4c28ae6b195ea8010fd3d3e2da70cf8ba7b71e 100644 --- a/Tests/UnitTests/Core/Legacy/SpecularMagnetic_v1Test.cpp +++ b/Tests/UnitTests/Core/Legacy/SpecularMagnetic_v1Test.cpp @@ -1,4 +1,5 @@ #include "Base/Const/Units.h" +#include "Base/Vector/Direction.h" #include "Core/Legacy/SpecularMagneticStrategy_v1.h" #include "Sample/Material/MaterialFactoryFuncs.h" #include "Sample/Multilayer/Layer.h" diff --git a/Tests/UnitTests/Core/Other/BeamTest.cpp b/Tests/UnitTests/Core/Other/BeamTest.cpp index 2b09a8f21bcaa1181ae85fe1b2d9035090e7b99b..28cdc25668ec3c4b02ac7ed91a8a65b4edd4e89b 100644 --- a/Tests/UnitTests/Core/Other/BeamTest.cpp +++ b/Tests/UnitTests/Core/Other/BeamTest.cpp @@ -15,7 +15,7 @@ TEST_F(BeamTest, BeamInitialState) { EXPECT_DOUBLE_EQ(M_TWOPI, beam.getCentralK()[0]); EXPECT_EQ(0.0, beam.getCentralK()[1]); EXPECT_EQ(0.0, beam.getCentralK()[2]); - EXPECT_EQ(1.0, beam.getIntensity()); + EXPECT_EQ(1.0, beam.intensity()); // EXPECT_EQ(size_t(4), beam.parameterPool()->size()); // EXPECT_EQ(1.0, beam.parameterPool()->parameter("Intensity")->value()); // EXPECT_EQ(1.0, beam.parameterPool()->parameter("Wavelength")->value()); @@ -28,14 +28,14 @@ TEST_F(BeamTest, BeamInitialState) { TEST_F(BeamTest, BeamAssignment) { kvector_t polarization(0.0, 0.0, 0.2); - std::unique_ptr<Beam> P_beam{new Beam(1.0, 1.0, 1.0, 2.0)}; + std::unique_ptr<Beam> P_beam{new Beam(2.0, 1.0, {1.0, 1.0})}; P_beam->setPolarization(polarization); Beam beam_copy = *P_beam; EXPECT_NEAR(1.83423, beam_copy.getCentralK()[0], 0.00001); EXPECT_NEAR(-2.85664, beam_copy.getCentralK()[1], 0.00001); EXPECT_NEAR(-5.28712, beam_copy.getCentralK()[2], 0.00001); - EXPECT_EQ(double(2.0), beam_copy.getIntensity()); + EXPECT_EQ(double(2.0), beam_copy.intensity()); /* TEMPORARILY DISABLED getParameterPool() EXPECT_EQ(size_t(4), beam_copy.getParameterPool()->size()); EXPECT_EQ(double(2.0), diff --git a/Tests/UnitTests/Core/Other/InstrumentTest.cpp b/Tests/UnitTests/Core/Other/InstrumentTest.cpp deleted file mode 100644 index 9385e174c43041817b63a4790268c5a9d43e60b3..0000000000000000000000000000000000000000 --- a/Tests/UnitTests/Core/Other/InstrumentTest.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "Device/Instrument/Instrument.h" -#include "Base/Math/Constants.h" -#include "Device/Data/OutputData.h" -#include "Tests/GTestWrapper/google_test.h" - -class InstrumentTest : public ::testing::Test { -protected: - InstrumentTest(); - - Instrument m_instrument; - OutputData<double> m_data; -}; - -InstrumentTest::InstrumentTest() { - m_data.addAxis("phi_f", 10, 0., 10.); - m_data.addAxis("theta_f", 20, 0., 20.); -} - -TEST_F(InstrumentTest, InstrumentInitialState) { - EXPECT_EQ(1.0, m_instrument.getBeamIntensity()); -} - -TEST_F(InstrumentTest, BeamManipulation) { - double lambda(1), alpha(-1), phi(1); - double k = M_TWOPI / lambda; - double x = k * std::cos(alpha) * std::cos(phi); - double y = -k * std::cos(alpha) * std::sin(phi); - double z = k * std::sin(alpha); - m_instrument.setBeamParameters(lambda, -1.0 * alpha, phi); - EXPECT_DOUBLE_EQ(x, m_instrument.beam().getCentralK().x()); - EXPECT_DOUBLE_EQ(y, m_instrument.beam().getCentralK().y()); - EXPECT_DOUBLE_EQ(z, m_instrument.beam().getCentralK().z()); - - m_instrument.setBeamIntensity(10); - EXPECT_EQ(double(10), m_instrument.getBeamIntensity()); -} - -TEST_F(InstrumentTest, InstrumentClone) { - Instrument clone(m_instrument); - EXPECT_EQ(size_t(0), clone.getDetectorDimension()); - EXPECT_EQ(1.0, clone.getBeamIntensity()); -} diff --git a/Tests/UnitTests/Core/SimulationElement/DepthProbeElementTest.cpp b/Tests/UnitTests/Core/SimulationElement/DepthProbeElementTest.cpp index cf568a7896099c650d57078652804012fdf8ab9c..cba586ab2735b002800b546fc25bd25963568fd4 100644 --- a/Tests/UnitTests/Core/SimulationElement/DepthProbeElementTest.cpp +++ b/Tests/UnitTests/Core/SimulationElement/DepthProbeElementTest.cpp @@ -1,5 +1,6 @@ #include "Core/Element/DepthProbeElement.h" #include "Base/Axis/FixedBinAxis.h" +#include "Base/Vector/Direction.h" #include "Tests/GTestWrapper/google_test.h" class DepthProbeElementTest : public ::testing::Test { @@ -23,7 +24,7 @@ DepthProbeElement DepthProbeElementTest::createDefaultElement() { void DepthProbeElementTest::compareEqualElements(const DepthProbeElement& lhs, const DepthProbeElement& rhs) { - EXPECT_EQ(lhs.getWavelength(), rhs.getWavelength()); + EXPECT_EQ(lhs.wavelength(), rhs.wavelength()); EXPECT_EQ(lhs.getAlphaI(), rhs.getAlphaI()); bool intensity_comparison_result = (lhs.getIntensities() == rhs.getIntensities()).min(); EXPECT_TRUE(intensity_comparison_result); @@ -38,7 +39,7 @@ TEST_F(DepthProbeElementTest, InitialState) { const kvector_t k_i = vecOfLambdaAlphaPhi(wavelength, angle, phi); const DepthProbeElement& element = createDefaultElement(); - EXPECT_EQ(wavelength, element.getWavelength()); + EXPECT_EQ(wavelength, element.wavelength()); EXPECT_EQ(angle, element.getAlphaI()); bool intensity_comparison_result = (element.getIntensities() == 0.0).min(); EXPECT_TRUE(intensity_comparison_result); diff --git a/Tests/UnitTests/Core/SimulationElement/SimulationElementTest.cpp b/Tests/UnitTests/Core/SimulationElement/SimulationElementTest.cpp index 3987b77fcbdd8563b8e9c90f2ef662297d44e737..18331b095fdf6778c1f227313322f9b060d15aab 100644 --- a/Tests/UnitTests/Core/SimulationElement/SimulationElementTest.cpp +++ b/Tests/UnitTests/Core/SimulationElement/SimulationElementTest.cpp @@ -1,6 +1,7 @@ #include "Base/Pixel/SimulationElement.h" #include "Base/Axis/Bin.h" #include "Base/Const/Units.h" +#include "Base/Vector/Direction.h" #include "Device/Detector/SphericalPixel.h" #include "Tests/GTestWrapper/google_test.h" #include <memory> @@ -27,10 +28,10 @@ public: TEST_F(SimulationElementTest, basicConstructor) { SimulationElement element(wavelength, alpha_i, phi_i, createPixel(), {}, {}, false); - EXPECT_EQ(element.getWavelength(), wavelength); + EXPECT_EQ(element.wavelength(), wavelength); EXPECT_EQ(element.getAlphaI(), alpha_i); EXPECT_EQ(element.getPhiI(), phi_i); - EXPECT_EQ(element.getIntensity(), 0.0); + EXPECT_EQ(element.intensity(), 0.0); EXPECT_NEAR(element.getAlphaMean(), 0.5 * Units::deg, 1e-14); EXPECT_NEAR(element.getPhiMean(), 0.0 * Units::deg, 1e-14); EXPECT_EQ(element.getKi(), vecOfLambdaAlphaPhi(wavelength, alpha_i, phi_i)); @@ -40,22 +41,22 @@ TEST_F(SimulationElementTest, basicConstructor) { TEST_F(SimulationElementTest, setIntensity) { auto element = createElement(); - EXPECT_EQ(element->getIntensity(), 0.0); + EXPECT_EQ(element->intensity(), 0.0); element->addIntensity(1.0); - EXPECT_EQ(element->getIntensity(), 1.0); + EXPECT_EQ(element->intensity(), 1.0); element->setIntensity(42.0); - EXPECT_EQ(element->getIntensity(), 42.0); + EXPECT_EQ(element->intensity(), 42.0); } TEST_F(SimulationElementTest, copyConstructor) { auto orig = createElement(); SimulationElement element(*orig); - EXPECT_EQ(orig->getWavelength(), element.getWavelength()); + EXPECT_EQ(orig->wavelength(), element.wavelength()); EXPECT_EQ(orig->getAlphaI(), element.getAlphaI()); EXPECT_EQ(orig->getPhiI(), element.getPhiI()); EXPECT_EQ(orig->getAlphaMean(), element.getAlphaMean()); EXPECT_EQ(orig->getPhiMean(), element.getPhiMean()); - EXPECT_EQ(orig->getIntensity(), element.getIntensity()); + EXPECT_EQ(orig->intensity(), element.intensity()); EXPECT_EQ(orig->getKi(), element.getKi()); EXPECT_EQ(orig->getMeanKf(), element.getMeanKf()); EXPECT_EQ(orig->getQ(0.5, 0.5), element.getQ(0.5, 0.5)); @@ -71,12 +72,12 @@ TEST_F(SimulationElementTest, moveConstruction) { SimulationElement orig(1.0, 2.0, 3.0, createPixel(), {}, {}, false); SimulationElement element(std::move(for_move)); - EXPECT_EQ(orig.getWavelength(), element.getWavelength()); + EXPECT_EQ(orig.wavelength(), element.wavelength()); EXPECT_EQ(orig.getAlphaI(), element.getAlphaI()); EXPECT_EQ(orig.getPhiI(), element.getPhiI()); EXPECT_EQ(orig.getAlphaMean(), element.getAlphaMean()); EXPECT_EQ(orig.getPhiMean(), element.getPhiMean()); - EXPECT_EQ(orig.getIntensity(), element.getIntensity()); + EXPECT_EQ(orig.intensity(), element.intensity()); EXPECT_EQ(orig.getKi(), element.getKi()); EXPECT_EQ(orig.getMeanKf(), element.getMeanKf()); EXPECT_EQ(orig.getQ(0.5, 0.5), element.getQ(0.5, 0.5)); diff --git a/Wrap/swig/DoxyfileSwig.in b/Wrap/Swig/DoxyfileSwig.in similarity index 100% rename from Wrap/swig/DoxyfileSwig.in rename to Wrap/Swig/DoxyfileSwig.in diff --git a/Wrap/swig/commons.i b/Wrap/Swig/commons.i similarity index 100% rename from Wrap/swig/commons.i rename to Wrap/Swig/commons.i diff --git a/Wrap/swig/deprecation.i b/Wrap/Swig/deprecation.i similarity index 100% rename from Wrap/swig/deprecation.i rename to Wrap/Swig/deprecation.i diff --git a/Wrap/swig/doxy2swig.py b/Wrap/Swig/doxy2swig.py similarity index 100% rename from Wrap/swig/doxy2swig.py rename to Wrap/Swig/doxy2swig.py diff --git a/Wrap/swig/fromBase.i b/Wrap/Swig/fromBase.i similarity index 100% rename from Wrap/swig/fromBase.i rename to Wrap/Swig/fromBase.i diff --git a/Wrap/swig/fromParam.i b/Wrap/Swig/fromParam.i similarity index 100% rename from Wrap/swig/fromParam.i rename to Wrap/Swig/fromParam.i diff --git a/Wrap/swig/ignoreBase.i b/Wrap/Swig/ignoreBase.i similarity index 100% rename from Wrap/swig/ignoreBase.i rename to Wrap/Swig/ignoreBase.i diff --git a/Wrap/swig/ignoreSample.i b/Wrap/Swig/ignoreSample.i similarity index 100% rename from Wrap/swig/ignoreSample.i rename to Wrap/Swig/ignoreSample.i diff --git a/Wrap/swig/libBornAgainBase.i b/Wrap/Swig/libBornAgainBase.i similarity index 96% rename from Wrap/swig/libBornAgainBase.i rename to Wrap/Swig/libBornAgainBase.i index 1c11aeddf35235580ead623452e0db46cf1e76b1..2497f9d26aa94c173e774a4ef48f4f7b7315e677 100644 --- a/Wrap/swig/libBornAgainBase.i +++ b/Wrap/Swig/libBornAgainBase.i @@ -31,6 +31,7 @@ #include "Base/Vector/BasicVector3D.h" #include "Base/Vector/Vectors3D.h" +#include "Base/Vector/Direction.h" #include "Base/Axis/Bin.h" #include "Base/Axis/ConstKBinAxis.h" @@ -51,6 +52,7 @@ %include "Base/Vector/BasicVector3D.h" %include "Base/Vector/Vectors3D.h" +%include "Base/Vector/Direction.h" %include "Base/Axis/Bin.h" %include "Base/Axis/IAxis.h" diff --git a/Wrap/swig/libBornAgainCore.i b/Wrap/Swig/libBornAgainCore.i similarity index 100% rename from Wrap/swig/libBornAgainCore.i rename to Wrap/Swig/libBornAgainCore.i diff --git a/Wrap/swig/libBornAgainDevice.i b/Wrap/Swig/libBornAgainDevice.i similarity index 98% rename from Wrap/swig/libBornAgainDevice.i rename to Wrap/Swig/libBornAgainDevice.i index 4d53072ab788da0e87219e489118782e74cc8457..e795c309a36a34ff144437e76514bb21c3dcdfbb 100644 --- a/Wrap/swig/libBornAgainDevice.i +++ b/Wrap/Swig/libBornAgainDevice.i @@ -51,7 +51,6 @@ #include "Device/Histo/SimulationResult.h" #include "Device/Instrument/ChiSquaredModule.h" #include "Device/Instrument/IChiSquaredModule.h" -#include "Device/Instrument/Instrument.h" #include "Device/Instrument/IntensityDataFunctions.h" #include "Device/Instrument/PyArrayImportUtils.h" #include "Device/Instrument/SpectrumUtils.h" @@ -113,7 +112,6 @@ %include "Device/Instrument/IChiSquaredModule.h" %include "Device/Instrument/ChiSquaredModule.h" -%include "Device/Instrument/Instrument.h" %include "Device/Instrument/IntensityDataFunctions.h" %include "Device/Instrument/PyArrayImportUtils.h" %include "Device/Instrument/SpectrumUtils.h" diff --git a/Wrap/swig/libBornAgainFit.i b/Wrap/Swig/libBornAgainFit.i similarity index 100% rename from Wrap/swig/libBornAgainFit.i rename to Wrap/Swig/libBornAgainFit.i diff --git a/Wrap/swig/libBornAgainParam.i b/Wrap/Swig/libBornAgainParam.i similarity index 100% rename from Wrap/swig/libBornAgainParam.i rename to Wrap/Swig/libBornAgainParam.i diff --git a/Wrap/swig/libBornAgainSample.i b/Wrap/Swig/libBornAgainSample.i similarity index 100% rename from Wrap/swig/libBornAgainSample.i rename to Wrap/Swig/libBornAgainSample.i diff --git a/Wrap/swig/numpy.i b/Wrap/Swig/numpy.i similarity index 100% rename from Wrap/swig/numpy.i rename to Wrap/Swig/numpy.i diff --git a/Wrap/swig/tweaks.py b/Wrap/Swig/tweaks.py similarity index 100% rename from Wrap/swig/tweaks.py rename to Wrap/Swig/tweaks.py diff --git a/Wrap/swig/warnings.i b/Wrap/Swig/warnings.i similarity index 100% rename from Wrap/swig/warnings.i rename to Wrap/Swig/warnings.i diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index a5c37c16ea8822ea598fa0bd635f5250338fd16f..a28a5913a953f0be27a10e9cce37c1cd665433e3 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -389,6 +389,33 @@ Increments inner counter; at regular intervals updates progress handler. "; +// File: classDirection.xml +%feature("docstring") Direction ""; + +%feature("docstring") Direction::Direction "Direction::Direction(double alpha, double phi) +"; + +%feature("docstring") Direction::Direction "Direction::Direction() +"; + +%feature("docstring") Direction::setAlpha "void Direction::setAlpha(double alpha) +"; + +%feature("docstring") Direction::setPhi "void Direction::setPhi(double phi) +"; + +%feature("docstring") Direction::alpha "double Direction::alpha() const +"; + +%feature("docstring") Direction::phi "double Direction::phi() const +"; + +%feature("docstring") Direction::vector "kvector_t Direction::vector() const + +Returns Cartesian 3D vector. +"; + + // File: classFixedBinAxis.xml %feature("docstring") FixedBinAxis " @@ -907,7 +934,7 @@ Returns copy of this SimulationElement with k_f given by in-pixel coordinate x, Returns assigned PolarizationHandler. "; -%feature("docstring") SimulationElement::getWavelength "double SimulationElement::getWavelength() const +%feature("docstring") SimulationElement::wavelength "double SimulationElement::wavelength() const "; %feature("docstring") SimulationElement::getAlphaI "double SimulationElement::getAlphaI() const @@ -928,7 +955,7 @@ Returns assigned PolarizationHandler. %feature("docstring") SimulationElement::addIntensity "void SimulationElement::addIntensity(double intensity) "; -%feature("docstring") SimulationElement::getIntensity "double SimulationElement::getIntensity() const +%feature("docstring") SimulationElement::intensity "double SimulationElement::intensity() const "; %feature("docstring") SimulationElement::getKi "kvector_t SimulationElement::getKi() const @@ -1387,7 +1414,7 @@ Returns token vector obtained by splitting string at delimiters. %feature("docstring") StringUtils::replaceItemsFromString "void StringUtils::replaceItemsFromString(std::string &text, const std::vector< std::string > &items, const std::string &replacement=\"\") -Replaces all occurences of items from string text with delimiter. +Replaces all occurrences of items from string text with delimiter. "; %feature("docstring") StringUtils::join "std::string StringUtils::join(const std::vector< std::string > &joinable, const std::string &joint) @@ -1397,7 +1424,7 @@ Returns string obtain by joining vector elements. %feature("docstring") StringUtils::removeSubstring "std::string StringUtils::removeSubstring(const std::string &text, const std::string &substr) -Removes multiple occurences of given substring from a string and returns result. +Removes multiple occurrences of given substring from a string and returns result. "; %feature("docstring") StringUtils::scientific "std::string StringUtils::scientific(const T value, int n=10) @@ -1410,6 +1437,11 @@ Returns scientific string representing given value of any numeric type. Returns new string which is lower case of text. "; +%feature("docstring") StringUtils::trim "std::string StringUtils::trim(const std::string &str, const std::string &whitespace=\" \\\\t\") + +Cuts any of the chars given in whitespace from start and end of str. +"; + // File: namespaceSysUtils.xml %feature("docstring") SysUtils::getCurrentDateAndTime "std::string SysUtils::getCurrentDateAndTime() @@ -1635,16 +1667,18 @@ This templated function is used in catalogs in form of a function pointer 'creat // File: BasicVector3D_8cpp.xml -%feature("docstring") vecOfLambdaAlphaPhi "BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) - -Creates a vector<double> as a wavevector with given wavelength and angles. Specifically needed for grazing-incidence scattering. -"; // File: BasicVector3D_8h.xml -%feature("docstring") vecOfLambdaAlphaPhi "BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) -Creates a vector<double> as a wavevector with given wavelength and angles. Specifically needed for grazing-incidence scattering. + +// File: Direction_8cpp.xml +%feature("docstring") vecOfLambdaAlphaPhi "kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) +"; + + +// File: Direction_8h.xml +%feature("docstring") vecOfLambdaAlphaPhi "kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) "; diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i index d2a93462617422b0d316d505b8a9b94975b3e651..d0749185511c3e8b5f18dd03f6f77d8cd4255913 100644 --- a/auto/Wrap/doxygenCore.i +++ b/auto/Wrap/doxygenCore.i @@ -298,7 +298,7 @@ C++ includes: DepthProbeComputation.h %feature("docstring") DepthProbeElement::~DepthProbeElement "DepthProbeElement::~DepthProbeElement() "; -%feature("docstring") DepthProbeElement::getWavelength "double DepthProbeElement::getWavelength() const +%feature("docstring") DepthProbeElement::wavelength "double DepthProbeElement::wavelength() const "; %feature("docstring") DepthProbeElement::getAlphaI "double DepthProbeElement::getAlphaI() const @@ -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() "; @@ -929,10 +935,19 @@ Run a simulation in a MPI environment. %feature("docstring") ISimulation::instrument "Instrument& ISimulation::instrument() "; -%feature("docstring") ISimulation::setBeamIntensity "void ISimulation::setBeamIntensity(double intensity) +%feature("docstring") ISimulation::beam "Beam& ISimulation::beam() "; -%feature("docstring") ISimulation::getBeamIntensity "double ISimulation::getBeamIntensity() const +%feature("docstring") ISimulation::beam "const Beam& ISimulation::beam() const +"; + +%feature("docstring") ISimulation::detector "IDetector& ISimulation::detector() +"; + +%feature("docstring") ISimulation::detector "const IDetector& ISimulation::detector() const +"; + +%feature("docstring") ISimulation::setBeamIntensity "void ISimulation::setBeamIntensity(double intensity) "; %feature("docstring") ISimulation::setBeamPolarization "void ISimulation::setBeamPolarization(const kvector_t bloch_vector) @@ -1018,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() "; @@ -1063,11 +1081,6 @@ upper edge of last alpha-bin Sets the detector (axes can be overwritten later) "; -%feature("docstring") ISimulation2D::removeMasks "void ISimulation2D::removeMasks() - -removes all masks from the detector -"; - %feature("docstring") ISimulation2D::addMask "void ISimulation2D::addMask(const IShape2D &shape, bool mask_value=true) Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority. @@ -1451,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() "; @@ -2157,7 +2173,7 @@ C++ includes: SpecularSimulationElement.h Returns assigned PolarizationHandler. "; -%feature("docstring") SpecularSimulationElement::getIntensity "double SpecularSimulationElement::getIntensity() const +%feature("docstring") SpecularSimulationElement::intensity "double SpecularSimulationElement::intensity() const "; %feature("docstring") SpecularSimulationElement::setIntensity "void SpecularSimulationElement::setIntensity(double intensity) diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index 2ec50fb1c7a5f83fdb889573cb4f591b59d66794..4d751daeffaf49b8043aa92fd57989ff7c7316f2 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -36,7 +36,7 @@ Beam defined by wavelength, direction and intensity. C++ includes: Beam.h "; -%feature("docstring") Beam::Beam "Beam::Beam(double wavelength, double alpha, double phi, double intensity) +%feature("docstring") Beam::Beam "Beam::Beam(double intensity, double wavelength, const Direction &direction) "; %feature("docstring") Beam::Beam "Beam::Beam(const Beam &other) @@ -45,24 +45,29 @@ C++ includes: Beam.h %feature("docstring") Beam::~Beam "Beam::~Beam() "; -%feature("docstring") Beam::getCentralK "kvector_t Beam::getCentralK() const +%feature("docstring") Beam::accept "void Beam::accept(INodeVisitor *visitor) const override +"; -Returns the wavevector. +%feature("docstring") Beam::getChildren "std::vector< const INode * > Beam::getChildren() const override "; -%feature("docstring") Beam::setCentralK "void Beam::setCentralK(double wavelength, double alpha_i, double phi_i) +%feature("docstring") Beam::intensity "double Beam::intensity() const -Sets the wavevector in terms of wavelength and incoming angles. +Returns the beam intensity in neutrons/sec. "; -%feature("docstring") Beam::getIntensity "double Beam::getIntensity() const +%feature("docstring") Beam::wavelength "double Beam::wavelength() const +"; -Returns the beam intensity in neutrons/sec. +%feature("docstring") Beam::direction "Direction Beam::direction() const "; -%feature("docstring") Beam::setIntensity "void Beam::setIntensity(double intensity) +%feature("docstring") Beam::getCentralK "kvector_t Beam::getCentralK() const -Sets the beam intensity in neutrons/sec. +Returns the wavevector. +"; + +%feature("docstring") Beam::getBlochVector "kvector_t Beam::getBlochVector() const "; %feature("docstring") Beam::footprintFactor "const IFootprintFactor * Beam::footprintFactor() const @@ -70,42 +75,38 @@ Sets the beam intensity in neutrons/sec. Returns footprint factor. "; -%feature("docstring") Beam::setFootprintFactor "void Beam::setFootprintFactor(const IFootprintFactor &shape_factor) +%feature("docstring") Beam::getPolarization "Eigen::Matrix2cd Beam::getPolarization() const -Sets footprint factor to the beam. +Returns the polarization density matrix (in spin basis along z-axis) "; -%feature("docstring") Beam::setWidthRatio "void Beam::setWidthRatio(double width_ratio) - -Sets beam to sample width ratio in footprint factor. +%feature("docstring") Beam::setWavelength "void Beam::setWavelength(double wavelength) "; -%feature("docstring") Beam::setPolarization "void Beam::setPolarization(const kvector_t bloch_vector) - -Sets the polarization density matrix according to the given Bloch vector. +%feature("docstring") Beam::setDirection "void Beam::setDirection(const Direction &direction) "; -%feature("docstring") Beam::getBlochVector "kvector_t Beam::getBlochVector() const +%feature("docstring") Beam::setInclination "void Beam::setInclination(const double alpha) "; -%feature("docstring") Beam::getPolarization "Eigen::Matrix2cd Beam::getPolarization() const +%feature("docstring") Beam::setIntensity "void Beam::setIntensity(double intensity) -Returns the polarization density matrix (in spin basis along z-axis) +Sets the beam intensity in neutrons/sec. "; -%feature("docstring") Beam::getWavelength "double Beam::getWavelength() const -"; +%feature("docstring") Beam::setFootprintFactor "void Beam::setFootprintFactor(const IFootprintFactor &shape_factor) -%feature("docstring") Beam::getAlpha "double Beam::getAlpha() const +Sets footprint factor to the beam. "; -%feature("docstring") Beam::getPhi "double Beam::getPhi() const -"; +%feature("docstring") Beam::setWidthRatio "void Beam::setWidthRatio(double width_ratio) -%feature("docstring") Beam::accept "void Beam::accept(INodeVisitor *visitor) const override +Sets beam to sample width ratio in footprint factor. "; -%feature("docstring") Beam::getChildren "std::vector< const INode * > Beam::getChildren() const override +%feature("docstring") Beam::setPolarization "void Beam::setPolarization(const kvector_t bloch_vector) + +Sets the polarization density matrix according to the given Bloch vector. "; @@ -393,11 +394,6 @@ Init the map of masks for the given detector plane. %feature("docstring") DetectorMask::createHistogram "Histogram2D * DetectorMask::createHistogram() const "; -%feature("docstring") DetectorMask::removeMasks "void DetectorMask::removeMasks() - -remove all masks and return object to initial state -"; - %feature("docstring") DetectorMask::hasMasks "bool DetectorMask::hasMasks() const returns true if has masks @@ -926,22 +922,22 @@ Inits detector with the beam settings. %feature("docstring") IDetector::addAxis "void IDetector::addAxis(const IAxis &axis) "; -%feature("docstring") IDetector::axis "const IAxis & IDetector::axis(size_t index) const +%feature("docstring") IDetector::setAnalyzerProperties "void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) + +Sets the polarization analyzer characteristics of the detector. "; -%feature("docstring") IDetector::dimension "size_t IDetector::dimension() const +%feature("docstring") IDetector::setDetectorResolution "void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution) -Returns actual dimensionality of the detector (number of defined axes) +Sets the detector resolution. "; -%feature("docstring") IDetector::axisBinIndex "size_t IDetector::axisBinIndex(size_t index, size_t selected_axis) const - -Calculate axis index for given global index. +%feature("docstring") IDetector::setResolutionFunction "void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc) "; -%feature("docstring") IDetector::totalSize "size_t IDetector::totalSize() const +%feature("docstring") IDetector::resetRegionOfInterest "virtual void IDetector::resetRegionOfInterest()=0 -Returns total number of pixels. +Resets region of interest making whole detector plane available for the simulation. "; %feature("docstring") IDetector::detectorMask "virtual const DetectorMask* IDetector::detectorMask() const =0 @@ -949,47 +945,43 @@ Returns total number of pixels. Returns detector masks container. "; -%feature("docstring") IDetector::setAnalyzerProperties "void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) - -Sets the polarization analyzer characteristics of the detector. +%feature("docstring") IDetector::getChildren "std::vector< const INode * > IDetector::getChildren() const override "; -%feature("docstring") IDetector::setDetectorResolution "void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution) - -Sets the detector resolution. +%feature("docstring") IDetector::iterate "void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const "; -%feature("docstring") IDetector::setResolutionFunction "void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc) +%feature("docstring") IDetector::axis "const IAxis & IDetector::axis(size_t index) const "; -%feature("docstring") IDetector::applyDetectorResolution "void IDetector::applyDetectorResolution(OutputData< double > *p_intensity_map) const +%feature("docstring") IDetector::dimension "size_t IDetector::dimension() const -Applies the detector resolution to the given intensity maps. +Returns actual dimensionality of the detector (number of defined axes) "; -%feature("docstring") IDetector::removeDetectorResolution "void IDetector::removeDetectorResolution() +%feature("docstring") IDetector::axisBinIndex "size_t IDetector::axisBinIndex(size_t index, size_t selected_axis) const -Removes detector resolution function. +Calculate axis index for given global index. "; -%feature("docstring") IDetector::detectorResolution "const IDetectorResolution * IDetector::detectorResolution() const +%feature("docstring") IDetector::totalSize "size_t IDetector::totalSize() const -Returns a pointer to detector resolution object. +Returns total number of pixels. "; -%feature("docstring") IDetector::createDetectorMap "std::unique_ptr< OutputData< double > > IDetector::createDetectorMap() const +%feature("docstring") IDetector::applyDetectorResolution "void IDetector::applyDetectorResolution(OutputData< double > *p_intensity_map) const -Returns empty detector map in given axes units. +Applies the detector resolution to the given intensity maps. "; -%feature("docstring") IDetector::regionOfInterest "virtual const RegionOfInterest* IDetector::regionOfInterest() const =0 +%feature("docstring") IDetector::detectorResolution "const IDetectorResolution * IDetector::detectorResolution() const -Returns region of interest if exists. +Returns a pointer to detector resolution object. "; -%feature("docstring") IDetector::resetRegionOfInterest "virtual void IDetector::resetRegionOfInterest()=0 +%feature("docstring") IDetector::createDetectorMap "std::unique_ptr< OutputData< double > > IDetector::createDetectorMap() const -Resets region of interest making whole detector plane available for the simulation. +Returns empty detector map in given axes units. "; %feature("docstring") IDetector::detectionProperties "const DetectionProperties& IDetector::detectionProperties() const @@ -1012,10 +1004,9 @@ Return default axes units. Returns number of simulation elements. "; -%feature("docstring") IDetector::getChildren "std::vector< const INode * > IDetector::getChildren() const override -"; +%feature("docstring") IDetector::regionOfInterest "virtual const RegionOfInterest* IDetector::regionOfInterest() const =0 -%feature("docstring") IDetector::iterate "void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const +Returns region of interest if exists. "; @@ -1041,11 +1032,6 @@ C++ includes: IDetector2D.h Sets detector parameters using angle ranges. "; -%feature("docstring") IDetector2D::removeMasks "void IDetector2D::removeMasks() - -Removes all masks from the detector. -"; - %feature("docstring") IDetector2D::detectorMask "const DetectorMask * IDetector2D::detectorMask() const override Returns detector masks container. @@ -1459,6 +1445,9 @@ C++ includes: Instrument.h %feature("docstring") Instrument::Instrument "Instrument::Instrument() "; +%feature("docstring") Instrument::Instrument "Instrument::Instrument(const Beam &beam, const IDetector &detector) +"; + %feature("docstring") Instrument::Instrument "Instrument::Instrument(const Instrument &other) "; @@ -1490,9 +1479,6 @@ Sets the beam wavelength and incoming angles. Sets the beam's polarization according to the given Bloch vector. "; -%feature("docstring") Instrument::getBeamIntensity "double Instrument::getBeamIntensity() const -"; - %feature("docstring") Instrument::getDetector "const IDetector * Instrument::getDetector() const "; @@ -1508,40 +1494,11 @@ Sets the beam's polarization according to the given Bloch vector. %feature("docstring") Instrument::detector2D "const IDetector2D & Instrument::detector2D() const "; -%feature("docstring") Instrument::getDetectorMask "const DetectorMask * Instrument::getDetectorMask() const -"; - -%feature("docstring") Instrument::getDetectorAxis "const IAxis & Instrument::getDetectorAxis(size_t index) const -"; - -%feature("docstring") Instrument::getDetectorDimension "size_t Instrument::getDetectorDimension() const -"; - %feature("docstring") Instrument::setDetector "void Instrument::setDetector(const IDetector &detector) Sets the detector (axes can be overwritten later) "; -%feature("docstring") Instrument::setDetectorResolutionFunction "void Instrument::setDetectorResolutionFunction(const IResolutionFunction2D &p_resolution_function) - -Sets detector resolution function. -"; - -%feature("docstring") Instrument::removeDetectorResolution "void Instrument::removeDetectorResolution() - -Removes detector resolution function. -"; - -%feature("docstring") Instrument::setAnalyzerProperties "void Instrument::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) - -Sets the polarization analyzer characteristics of the detector. -"; - -%feature("docstring") Instrument::applyDetectorResolution "void Instrument::applyDetectorResolution(OutputData< double > *p_intensity_map) const - -apply the detector resolution to the given intensity map -"; - %feature("docstring") Instrument::initDetector "void Instrument::initDetector() init detector with beam settings @@ -1554,7 +1511,7 @@ init detector with beam settings // File: classIntensityDataIOFactory.xml %feature("docstring") IntensityDataIOFactory " -Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends woth \"*.gz\" or \"*.bz2\" the file will be zipped on the fly using appropriate algorithm. +Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends with \"*.gz\" or \"*.bz2\" the file will be zipped on the fly using appropriate algorithm. Usage: @@ -1592,36 +1549,6 @@ C++ includes: IIntensityFunction.h "; -// File: classIOutputDataReadStrategy.xml -%feature("docstring") IOutputDataReadStrategy " - -Interface for reading strategy of OutputData from file. - -C++ includes: OutputDataReadStrategy.h -"; - -%feature("docstring") IOutputDataReadStrategy::~IOutputDataReadStrategy "virtual IOutputDataReadStrategy::~IOutputDataReadStrategy()=default -"; - -%feature("docstring") IOutputDataReadStrategy::readOutputData "virtual OutputData<double>* IOutputDataReadStrategy::readOutputData(std::istream &input_stream)=0 -"; - - -// File: classIOutputDataWriteStrategy.xml -%feature("docstring") IOutputDataWriteStrategy " - -Strategy interface to write OututData in file - -C++ includes: OutputDataWriteStrategy.h -"; - -%feature("docstring") IOutputDataWriteStrategy::~IOutputDataWriteStrategy "virtual IOutputDataWriteStrategy::~IOutputDataWriteStrategy()=default -"; - -%feature("docstring") IOutputDataWriteStrategy::writeOutputData "virtual void IOutputDataWriteStrategy::writeOutputData(const OutputData< double > &data, std::ostream &output_stream)=0 -"; - - // File: classIResolutionFunction2D.xml %feature("docstring") IResolutionFunction2D " @@ -2224,125 +2151,45 @@ Swaps iterators. "; -// File: classOutputDataReader.xml -%feature("docstring") OutputDataReader " +// File: classOutputDataReadReflectometry.xml +%feature("docstring") OutputDataReadReflectometry " -Reads OutputData from file using different reading strategies. +Class for reading reflectometry data from ASCII file. -C++ includes: OutputDataReader.h +C++ includes: OutputDataReadReflectometry.h "; -%feature("docstring") OutputDataReader::OutputDataReader "OutputDataReader::OutputDataReader(const std::string &file_name) +%feature("docstring") OutputDataReadReflectometry::readOutputData "OutputData< double > * OutputDataReadReflectometry::readOutputData(std::istream &input_stream) "; -%feature("docstring") OutputDataReader::getOutputData "OutputData< double > * OutputDataReader::getOutputData() -read output data from file (file name was set already from OutputDataIOFactory) -"; - -%feature("docstring") OutputDataReader::setStrategy "void OutputDataReader::setStrategy(IOutputDataReadStrategy *read_strategy) - -Sets concrete reading strategy. -"; - - -// File: classOutputDataReadFactory.xml -%feature("docstring") OutputDataReadFactory " +// File: classOutputDataReadWriteINT.xml +%feature("docstring") OutputDataReadWriteINT " -Creates reader appropariate for given type of files. +Class for reading and writing BornAgain native IntensityData from ASCII file. -C++ includes: OutputDataReadFactory.h +C++ includes: OutputDataReadWriteINT.h "; - -// File: classOutputDataReadINTStrategy.xml -%feature("docstring") OutputDataReadINTStrategy " - -Strategy to read BornAgain native IntensityData from ASCII file. - -C++ includes: OutputDataReadStrategy.h +%feature("docstring") OutputDataReadWriteINT::readOutputData "OutputData< double > * OutputDataReadWriteINT::readOutputData(std::istream &input_stream) "; -%feature("docstring") OutputDataReadINTStrategy::readOutputData "OutputData< double > * OutputDataReadINTStrategy::readOutputData(std::istream &input_stream) +%feature("docstring") OutputDataReadWriteINT::writeOutputData "void OutputDataReadWriteINT::writeOutputData(const OutputData< double > &data, std::ostream &output_stream) "; -// File: classOutputDataReadNumpyTXTStrategy.xml -%feature("docstring") OutputDataReadNumpyTXTStrategy " +// File: classOutputDataReadWriteNumpyTXT.xml +%feature("docstring") OutputDataReadWriteNumpyTXT " -Strategy to read OutputData from simple ASCII file with the layout as in numpy.savetxt. +Class for reading and writing OutputData from simple ASCII file with the layout as in numpy.savetxt. -C++ includes: OutputDataReadStrategy.h +C++ includes: OutputDataReadWriteNumpyTXT.h "; -%feature("docstring") OutputDataReadNumpyTXTStrategy::readOutputData "OutputData< double > * OutputDataReadNumpyTXTStrategy::readOutputData(std::istream &input_stream) +%feature("docstring") OutputDataReadWriteNumpyTXT::readOutputData "OutputData< double > * OutputDataReadWriteNumpyTXT::readOutputData(std::istream &input_stream) "; - -// File: classOutputDataReadReflectometryStrategy.xml -%feature("docstring") OutputDataReadReflectometryStrategy " - -Strategy to read Reflectometry data from ASCII file. - -C++ includes: OutputDataReadStrategy.h -"; - -%feature("docstring") OutputDataReadReflectometryStrategy::readOutputData "OutputData< double > * OutputDataReadReflectometryStrategy::readOutputData(std::istream &input_stream) -"; - - -// File: classOutputDataWriteFactory.xml -%feature("docstring") OutputDataWriteFactory " - -Creates writer appropariate for given type of files. - -C++ includes: OutputDataWriteFactory.h -"; - - -// File: classOutputDataWriteINTStrategy.xml -%feature("docstring") OutputDataWriteINTStrategy " - -Strategy to write OutputData to special BornAgain ASCII format - -C++ includes: OutputDataWriteStrategy.h -"; - -%feature("docstring") OutputDataWriteINTStrategy::writeOutputData "void OutputDataWriteINTStrategy::writeOutputData(const OutputData< double > &data, std::ostream &output_stream) -"; - - -// File: classOutputDataWriteNumpyTXTStrategy.xml -%feature("docstring") OutputDataWriteNumpyTXTStrategy " - -Strategy to write OutputData to simple ASCII file with the layout as in numpy.savetxt - -C++ includes: OutputDataWriteStrategy.h -"; - -%feature("docstring") OutputDataWriteNumpyTXTStrategy::writeOutputData "void OutputDataWriteNumpyTXTStrategy::writeOutputData(const OutputData< double > &data, std::ostream &output_stream) -"; - - -// File: classOutputDataWriter.xml -%feature("docstring") OutputDataWriter " - -Write OutputData to file using different witing strategies. - -C++ includes: OutputDataWriter.h -"; - -%feature("docstring") OutputDataWriter::OutputDataWriter "OutputDataWriter::OutputDataWriter(const std::string &file_name) -"; - -%feature("docstring") OutputDataWriter::writeOutputData "void OutputDataWriter::writeOutputData(const OutputData< double > &data) - -Writes output data to file. -"; - -%feature("docstring") OutputDataWriter::setStrategy "void OutputDataWriter::setStrategy(IOutputDataWriteStrategy *write_strategy) - -Sets concrete writing strategy. +%feature("docstring") OutputDataReadWriteNumpyTXT::writeOutputData "void OutputDataReadWriteNumpyTXT::writeOutputData(const OutputData< double > &data, std::ostream &output_stream) "; @@ -3156,7 +3003,7 @@ Returns true if area defined by two bins is inside or on border of polygon (more // File: classConvolve_1_1Workspace.xml -// File: namespace_0d111.xml +// File: namespace_0d105.xml // File: namespace_0d33.xml @@ -3165,15 +3012,9 @@ Returns true if area defined by two bins is inside or on border of polygon (more // File: namespace_0d56.xml -// File: namespace_0d58.xml - - // File: namespace_0d62.xml -// File: namespace_0d68.xml - - // File: namespaceArrayUtils.xml %feature("docstring") ArrayUtils::getShape "std::pair< size_t, size_t > ArrayUtils::getShape(const T &data) @@ -3557,46 +3398,28 @@ make Swappable // File: DataFormatUtils_8h.xml -// File: OutputDataReader_8cpp.xml - - -// File: OutputDataReader_8h.xml - - -// File: OutputDataReadFactory_8cpp.xml - - -// File: OutputDataReadFactory_8h.xml - - -// File: OutputDataReadStrategy_8cpp.xml - - -// File: OutputDataReadStrategy_8h.xml - - -// File: OutputDataWriteFactory_8cpp.xml +// File: OutputDataReadReflectometry_8cpp.xml -// File: OutputDataWriteFactory_8h.xml +// File: OutputDataReadReflectometry_8h.xml -// File: OutputDataWriter_8cpp.xml +// File: OutputDataReadWriteINT_8cpp.xml -// File: OutputDataWriter_8h.xml +// File: OutputDataReadWriteINT_8h.xml -// File: OutputDataWriteStrategy_8cpp.xml +// File: OutputDataReadWriteNumpyTXT_8cpp.xml -// File: OutputDataWriteStrategy_8h.xml +// File: OutputDataReadWriteNumpyTXT_8h.xml -// File: TiffHandler_8cpp.xml +// File: OutputDataReadWriteTiff_8cpp.xml -// File: TiffHandler_8h.xml +// File: OutputDataReadWriteTiff_8h.xml // File: ChiSquaredModule_8cpp.xml diff --git a/auto/Wrap/doxygenParam.i b/auto/Wrap/doxygenParam.i index a777a86bf758b52ee04d38f596d874918b8997fa..5c39d00ae1e728ca78f0fa88fefcbfec7f032970 100644 --- a/auto/Wrap/doxygenParam.i +++ b/auto/Wrap/doxygenParam.i @@ -1044,127 +1044,6 @@ Returns distribution name for python-formatted text. "; -// File: classIterationStrategy.xml -%feature("docstring") IterationStrategy " - -Abstract base class for tree traversal strategies, for use in INodeVisitor. - -For definition of different strategies see https://en.wikipedia.org/wiki/Tree_traversal. - -C++ includes: IterationStrategy.h -"; - -%feature("docstring") IterationStrategy::clone "virtual IterationStrategy* IterationStrategy::clone() const =0 -"; - -%feature("docstring") IterationStrategy::first "virtual IteratorMemento IterationStrategy::first(const INode *p_root)=0 -"; - -%feature("docstring") IterationStrategy::next "virtual void IterationStrategy::next(IteratorMemento &iterator_stack) const =0 -"; - -%feature("docstring") IterationStrategy::isDone "virtual bool IterationStrategy::isDone(IteratorMemento &iterator_stack) const =0 -"; - - -// File: classIteratorMemento.xml -%feature("docstring") IteratorMemento " - -Holds all iterator states encountered for SampleTreeIterator. - -C++ includes: NodeIterator.h -"; - -%feature("docstring") IteratorMemento::IteratorMemento "IteratorMemento::IteratorMemento() -"; - -%feature("docstring") IteratorMemento::~IteratorMemento "virtual IteratorMemento::~IteratorMemento() -"; - -%feature("docstring") IteratorMemento::push_state "void IteratorMemento::push_state(const IteratorState &state) -"; - -%feature("docstring") IteratorMemento::pop_state "void IteratorMemento::pop_state() -"; - -%feature("docstring") IteratorMemento::get_state "IteratorState& IteratorMemento::get_state() -"; - -%feature("docstring") IteratorMemento::empty "bool IteratorMemento::empty() const -"; - -%feature("docstring") IteratorMemento::reset "void IteratorMemento::reset() -"; - -%feature("docstring") IteratorMemento::getCurrent "const INode* IteratorMemento::getCurrent() -"; - -%feature("docstring") IteratorMemento::next "void IteratorMemento::next() -"; - -%feature("docstring") IteratorMemento::size "size_t IteratorMemento::size() const -"; - - -// File: classIteratorState.xml -%feature("docstring") IteratorState " - -Holds state of iterator at single level for SampleTreeIterator. - -C++ includes: NodeIterator.h -"; - -%feature("docstring") IteratorState::IteratorState "IteratorState::IteratorState(const INode *single_element) -"; - -%feature("docstring") IteratorState::IteratorState "IteratorState::IteratorState(std::vector< const INode * > samples) -"; - -%feature("docstring") IteratorState::~IteratorState "virtual IteratorState::~IteratorState() -"; - -%feature("docstring") IteratorState::getCurrent "const INode* IteratorState::getCurrent() const -"; - -%feature("docstring") IteratorState::isEnd "bool IteratorState::isEnd() const -"; - -%feature("docstring") IteratorState::next "void IteratorState::next() -"; - - -// File: classNodeIterator.xml -%feature("docstring") NodeIterator " - -Iterator through INode tree of objects. - -Usage example: SampleTreeIterator<Strategy> it(&sample); it.first(); while( !it.is_done() ) { INode *p_sample = it.get_current(); it.next(); } - -C++ includes: NodeIterator.h -"; - -%feature("docstring") NodeIterator::NodeIterator "NodeIterator< Strategy >::NodeIterator(const INode *root) -"; - -%feature("docstring") NodeIterator::~NodeIterator "virtual NodeIterator< Strategy >::~NodeIterator() -"; - -%feature("docstring") NodeIterator::first "void NodeIterator< Strategy >::first() -"; - -%feature("docstring") NodeIterator::next "void NodeIterator< Strategy >::next() -"; - -%feature("docstring") NodeIterator::getCurrent "const INode * NodeIterator< Strategy >::getCurrent() -"; - -%feature("docstring") NodeIterator::isDone "bool NodeIterator< Strategy >::isDone() const -"; - -%feature("docstring") NodeIterator::depth "int NodeIterator< Strategy >::depth() const -"; - - // File: structNodeMeta.xml %feature("docstring") NodeMeta " @@ -1378,30 +1257,6 @@ C++ includes: ParameterSample.h "; -// File: classPreorderStrategy.xml -%feature("docstring") PreorderStrategy " - -Traverse tree; visit parents before their children. - -C++ includes: IterationStrategy.h -"; - -%feature("docstring") PreorderStrategy::PreorderStrategy "PreorderStrategy::PreorderStrategy() -"; - -%feature("docstring") PreorderStrategy::clone "PreorderStrategy * PreorderStrategy::clone() const -"; - -%feature("docstring") PreorderStrategy::first "IteratorMemento PreorderStrategy::first(const INode *p_root) -"; - -%feature("docstring") PreorderStrategy::next "void PreorderStrategy::next(IteratorMemento &iterator_stack) const -"; - -%feature("docstring") PreorderStrategy::isDone "bool PreorderStrategy::isDone(IteratorMemento &iterator_stack) const -"; - - // File: classRangedDistributionCosine.xml %feature("docstring") RangedDistributionCosine " @@ -1630,10 +1485,10 @@ C++ includes: Unit.h // File: namespace_0d15.xml -// File: namespace_0d24.xml +// File: namespace_0d20.xml -// File: namespace_0d29.xml +// File: namespace_0d25.xml // File: namespaceNodeUtils.xml @@ -1729,18 +1584,6 @@ Returns units of main parameter. // File: INodeVisitor_8h.xml -// File: IterationStrategy_8cpp.xml - - -// File: IterationStrategy_8h.xml - - -// File: NodeIterator_8cpp.xml - - -// File: NodeIterator_8h.xml - - // File: NodeUtils_8cpp.xml diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index 0ad73a54aa74f9d5c7553716658c64c2401b22b5..f113d09dbfbcf1f3d95c3c9548bf7fa225ed5a67 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -7434,7 +7434,7 @@ C++ includes: WavevectorInfo.h %feature("docstring") WavevectorInfo::getQ "cvector_t WavevectorInfo::getQ() const "; -%feature("docstring") WavevectorInfo::getWavelength "double WavevectorInfo::getWavelength() const +%feature("docstring") WavevectorInfo::wavelength "double WavevectorInfo::wavelength() const "; diff --git a/auto/Wrap/libBornAgainBase.py b/auto/Wrap/libBornAgainBase.py index 6f3a7843bc39c314c6d39f5105a05aa2b80b0613..4248754550195b1ef42c9afee34922900443535d 100644 --- a/auto/Wrap/libBornAgainBase.py +++ b/auto/Wrap/libBornAgainBase.py @@ -1788,12 +1788,89 @@ def deg2rad(angle): def vecOfLambdaAlphaPhi(_lambda, _alpha, _phi): r""" vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) -> kvector_t - BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) - - Creates a vector<double> as a wavevector with given wavelength and angles. Specifically needed for grazing-incidence scattering. + kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) """ return _libBornAgainBase.vecOfLambdaAlphaPhi(_lambda, _alpha, _phi) +class Direction(object): + r"""Proxy of C++ Direction class.""" + + 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__(Direction self, double alpha, double phi) -> Direction + __init__(Direction self) -> Direction + Direction::Direction() + + """ + _libBornAgainBase.Direction_swiginit(self, _libBornAgainBase.new_Direction(*args)) + + def setAlpha(self, alpha): + r""" + setAlpha(Direction self, double alpha) + void Direction::setAlpha(double alpha) + + """ + return _libBornAgainBase.Direction_setAlpha(self, alpha) + + def setPhi(self, phi): + r""" + setPhi(Direction self, double phi) + void Direction::setPhi(double phi) + + """ + return _libBornAgainBase.Direction_setPhi(self, phi) + + def alpha(self): + r""" + alpha(Direction self) -> double + double Direction::alpha() const + + """ + return _libBornAgainBase.Direction_alpha(self) + + def phi(self): + r""" + phi(Direction self) -> double + double Direction::phi() const + + """ + return _libBornAgainBase.Direction_phi(self) + + def vector(self): + r""" + vector(Direction self) -> kvector_t + kvector_t Direction::vector() const + + Returns Cartesian 3D vector. + + """ + return _libBornAgainBase.Direction_vector(self) + __swig_destroy__ = _libBornAgainBase.delete_Direction + +# Register Direction in _libBornAgainBase: +_libBornAgainBase.Direction_swigregister(Direction) +nanometer = cvar.nanometer +angstrom = cvar.angstrom +micrometer = cvar.micrometer +millimeter = cvar.millimeter +meter = cvar.meter +nm = cvar.nm +nm2 = cvar.nm2 +barn = cvar.barn +radian = cvar.radian +milliradian = cvar.milliradian +degree = cvar.degree +steradian = cvar.steradian +rad = cvar.rad +mrad = cvar.mrad +sr = cvar.sr +deg = cvar.deg +tesla = cvar.tesla +gauss = cvar.gauss + class Bin1D(object): r"""Proxy of C++ Bin1D class.""" @@ -1830,24 +1907,6 @@ class Bin1D(object): # Register Bin1D in _libBornAgainBase: _libBornAgainBase.Bin1D_swigregister(Bin1D) -nanometer = cvar.nanometer -angstrom = cvar.angstrom -micrometer = cvar.micrometer -millimeter = cvar.millimeter -meter = cvar.meter -nm = cvar.nm -nm2 = cvar.nm2 -barn = cvar.barn -radian = cvar.radian -milliradian = cvar.milliradian -degree = cvar.degree -steradian = cvar.steradian -rad = cvar.rad -mrad = cvar.mrad -sr = cvar.sr -deg = cvar.deg -tesla = cvar.tesla -gauss = cvar.gauss def BinContains(bin, value): diff --git a/auto/Wrap/libBornAgainBase_wrap.cpp b/auto/Wrap/libBornAgainBase_wrap.cpp index bae9e60e08bfa73c4662619e53a64dba3cce68f7..20b8fd3b0156933b34560c4c169551c396535577 100644 --- a/auto/Wrap/libBornAgainBase_wrap.cpp +++ b/auto/Wrap/libBornAgainBase_wrap.cpp @@ -3105,59 +3105,60 @@ namespace Swig { #define SWIGTYPE_p_Bin1DKVector swig_types[5] #define SWIGTYPE_p_ConstKBinAxis swig_types[6] #define SWIGTYPE_p_CustomBinAxis swig_types[7] -#define SWIGTYPE_p_FixedBinAxis swig_types[8] -#define SWIGTYPE_p_IAxis swig_types[9] -#define SWIGTYPE_p_ICloneable swig_types[10] -#define SWIGTYPE_p_IPixel swig_types[11] -#define SWIGTYPE_p_ThreadInfo swig_types[12] -#define SWIGTYPE_p_VariableBinAxis swig_types[13] -#define SWIGTYPE_p_allocator_type swig_types[14] -#define SWIGTYPE_p_char swig_types[15] -#define SWIGTYPE_p_difference_type swig_types[16] -#define SWIGTYPE_p_first_type swig_types[17] -#define SWIGTYPE_p_int swig_types[18] -#define SWIGTYPE_p_key_type swig_types[19] -#define SWIGTYPE_p_long_long swig_types[20] -#define SWIGTYPE_p_mapped_type swig_types[21] -#define SWIGTYPE_p_p_PyObject swig_types[22] -#define SWIGTYPE_p_second_type swig_types[23] -#define SWIGTYPE_p_short swig_types[24] -#define SWIGTYPE_p_signed_char swig_types[25] -#define SWIGTYPE_p_size_type swig_types[26] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[27] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[28] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[29] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[30] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[31] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[32] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[33] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[34] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[35] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[36] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[37] -#define SWIGTYPE_p_std__complexT_double_t swig_types[38] -#define SWIGTYPE_p_std__invalid_argument swig_types[39] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[40] -#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[41] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[42] -#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[43] -#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[44] -#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[45] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[46] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[47] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[48] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[49] -#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[50] -#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[51] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[52] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[53] -#define SWIGTYPE_p_unsigned_char swig_types[54] -#define SWIGTYPE_p_unsigned_int swig_types[55] -#define SWIGTYPE_p_unsigned_long_long swig_types[56] -#define SWIGTYPE_p_unsigned_short swig_types[57] -#define SWIGTYPE_p_value_type swig_types[58] -static swig_type_info *swig_types[60]; -static swig_module_info swig_module = {swig_types, 59, 0, 0, 0, 0}; +#define SWIGTYPE_p_Direction swig_types[8] +#define SWIGTYPE_p_FixedBinAxis swig_types[9] +#define SWIGTYPE_p_IAxis swig_types[10] +#define SWIGTYPE_p_ICloneable swig_types[11] +#define SWIGTYPE_p_IPixel swig_types[12] +#define SWIGTYPE_p_ThreadInfo swig_types[13] +#define SWIGTYPE_p_VariableBinAxis swig_types[14] +#define SWIGTYPE_p_allocator_type swig_types[15] +#define SWIGTYPE_p_char swig_types[16] +#define SWIGTYPE_p_difference_type swig_types[17] +#define SWIGTYPE_p_first_type swig_types[18] +#define SWIGTYPE_p_int swig_types[19] +#define SWIGTYPE_p_key_type swig_types[20] +#define SWIGTYPE_p_long_long swig_types[21] +#define SWIGTYPE_p_mapped_type swig_types[22] +#define SWIGTYPE_p_p_PyObject swig_types[23] +#define SWIGTYPE_p_second_type swig_types[24] +#define SWIGTYPE_p_short swig_types[25] +#define SWIGTYPE_p_signed_char swig_types[26] +#define SWIGTYPE_p_size_type swig_types[27] +#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[28] +#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[29] +#define SWIGTYPE_p_std__allocatorT_double_t swig_types[30] +#define SWIGTYPE_p_std__allocatorT_int_t swig_types[31] +#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[32] +#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[33] +#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[34] +#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[35] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[36] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[37] +#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[38] +#define SWIGTYPE_p_std__complexT_double_t swig_types[39] +#define SWIGTYPE_p_std__invalid_argument swig_types[40] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[41] +#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[42] +#define SWIGTYPE_p_std__pairT_double_double_t swig_types[43] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[44] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[45] +#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[46] +#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[47] +#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[48] +#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[49] +#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[50] +#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[51] +#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[52] +#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[53] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[54] +#define SWIGTYPE_p_unsigned_char swig_types[55] +#define SWIGTYPE_p_unsigned_int swig_types[56] +#define SWIGTYPE_p_unsigned_long_long swig_types[57] +#define SWIGTYPE_p_unsigned_short swig_types[58] +#define SWIGTYPE_p_value_type swig_types[59] +static swig_type_info *swig_types[61]; +static swig_module_info swig_module = {swig_types, 60, 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) @@ -6659,6 +6660,7 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_double_Sc_double_Sg__Sg__insert__SWIG_ #include "Base/Vector/BasicVector3D.h" #include "Base/Vector/Vectors3D.h" +#include "Base/Vector/Direction.h" #include "Base/Axis/Bin.h" #include "Base/Axis/ConstKBinAxis.h" @@ -24549,7 +24551,7 @@ SWIGINTERN PyObject *_wrap_vecOfLambdaAlphaPhi(PyObject *SWIGUNUSEDPARM(self), P double val3 ; int ecode3 = 0 ; PyObject *swig_obj[3] ; - BasicVector3D< double > result; + kvector_t result; if (!SWIG_Python_UnpackTuple(args, "vecOfLambdaAlphaPhi", 3, 3, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); @@ -24568,13 +24570,252 @@ SWIGINTERN PyObject *_wrap_vecOfLambdaAlphaPhi(PyObject *SWIGUNUSEDPARM(self), P } arg3 = static_cast< double >(val3); result = vecOfLambdaAlphaPhi(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj((new BasicVector3D< double >(static_cast< const BasicVector3D< double >& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Direction__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + double arg1 ; + double arg2 ; + double val1 ; + int ecode1 = 0 ; + double val2 ; + int ecode2 = 0 ; + Direction *result = 0 ; + + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Direction" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Direction" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (Direction *)new Direction(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Direction, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Direction__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { + PyObject *resultobj = 0; + Direction *result = 0 ; + + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; + result = (Direction *)new Direction(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Direction, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Direction(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_Direction", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_new_Direction__SWIG_1(self, argc, argv); + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_double(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_Direction__SWIG_0(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Direction'.\n" + " Possible C/C++ prototypes are:\n" + " Direction::Direction(double,double)\n" + " Direction::Direction()\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_Direction_setAlpha(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "Direction_setAlpha", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Direction_setAlpha" "', argument " "1"" of type '" "Direction *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Direction_setAlpha" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setAlpha(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Direction_setPhi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "Direction_setPhi", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Direction_setPhi" "', argument " "1"" of type '" "Direction *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Direction_setPhi" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setPhi(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Direction_alpha(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + double result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Direction_alpha" "', argument " "1"" of type '" "Direction const *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + result = (double)((Direction const *)arg1)->alpha(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Direction_phi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + double result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Direction_phi" "', argument " "1"" of type '" "Direction const *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + result = (double)((Direction const *)arg1)->phi(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Direction_vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + kvector_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Direction_vector" "', argument " "1"" of type '" "Direction const *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + result = ((Direction const *)arg1)->vector(); + resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_delete_Direction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Direction *arg1 = (Direction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Direction, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Direction" "', argument " "1"" of type '" "Direction *""'"); + } + arg1 = reinterpret_cast< Direction * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Direction_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Direction, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *Direction_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_new_Bin1D__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; Bin1D *result = 0 ; @@ -32878,11 +33119,45 @@ static PyMethodDef SwigMethods[] = { ""}, { "vecOfLambdaAlphaPhi", _wrap_vecOfLambdaAlphaPhi, METH_VARARGS, "\n" "vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) -> kvector_t\n" - "BasicVector3D<double> vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)\n" + "kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)\n" + "\n" + ""}, + { "new_Direction", _wrap_new_Direction, METH_VARARGS, "\n" + "Direction(double alpha, double phi)\n" + "new_Direction() -> Direction\n" + "Direction::Direction()\n" + "\n" + ""}, + { "Direction_setAlpha", _wrap_Direction_setAlpha, METH_VARARGS, "\n" + "Direction_setAlpha(Direction self, double alpha)\n" + "void Direction::setAlpha(double alpha)\n" + "\n" + ""}, + { "Direction_setPhi", _wrap_Direction_setPhi, METH_VARARGS, "\n" + "Direction_setPhi(Direction self, double phi)\n" + "void Direction::setPhi(double phi)\n" + "\n" + ""}, + { "Direction_alpha", _wrap_Direction_alpha, METH_O, "\n" + "Direction_alpha(Direction self) -> double\n" + "double Direction::alpha() const\n" + "\n" + ""}, + { "Direction_phi", _wrap_Direction_phi, METH_O, "\n" + "Direction_phi(Direction self) -> double\n" + "double Direction::phi() const\n" + "\n" + ""}, + { "Direction_vector", _wrap_Direction_vector, METH_O, "\n" + "Direction_vector(Direction self) -> kvector_t\n" + "kvector_t Direction::vector() const\n" "\n" - "Creates a vector<double> as a wavevector with given wavelength and angles. Specifically needed for grazing-incidence scattering. \n" + "Returns Cartesian 3D vector. \n" "\n" ""}, + { "delete_Direction", _wrap_delete_Direction, METH_O, "delete_Direction(Direction self)"}, + { "Direction_swigregister", Direction_swigregister, METH_O, NULL}, + { "Direction_swiginit", Direction_swiginit, METH_VARARGS, NULL}, { "new_Bin1D", _wrap_new_Bin1D, METH_VARARGS, "\n" "Bin1D()\n" "new_Bin1D(double lower, double upper) -> Bin1D\n" @@ -33800,6 +34075,7 @@ static swig_type_info _swigt__p_Bin1DCVector = {"_p_Bin1DCVector", "Bin1DCVector static swig_type_info _swigt__p_Bin1DKVector = {"_p_Bin1DKVector", "Bin1DKVector *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ConstKBinAxis = {"_p_ConstKBinAxis", "ConstKBinAxis *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_CustomBinAxis = {"_p_CustomBinAxis", "CustomBinAxis *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Direction = {"_p_Direction", "Direction *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FixedBinAxis = {"_p_FixedBinAxis", "FixedBinAxis *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IAxis = {"_p_IAxis", "IAxis *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ICloneable = {"_p_ICloneable", "ICloneable *", 0, 0, (void*)0, 0}; @@ -33861,6 +34137,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Bin1DKVector, &_swigt__p_ConstKBinAxis, &_swigt__p_CustomBinAxis, + &_swigt__p_Direction, &_swigt__p_FixedBinAxis, &_swigt__p_IAxis, &_swigt__p_ICloneable, @@ -33922,6 +34199,7 @@ static swig_cast_info _swigc__p_Bin1DCVector[] = { {&_swigt__p_Bin1DCVector, 0, static swig_cast_info _swigc__p_Bin1DKVector[] = { {&_swigt__p_Bin1DKVector, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ConstKBinAxis[] = { {&_swigt__p_ConstKBinAxis, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CustomBinAxis[] = { {&_swigt__p_CustomBinAxis, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Direction[] = { {&_swigt__p_Direction, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FixedBinAxis[] = { {&_swigt__p_FixedBinAxis, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IAxis[] = { {&_swigt__p_IAxis, 0, 0, 0}, {&_swigt__p_VariableBinAxis, _p_VariableBinAxisTo_p_IAxis, 0, 0}, {&_swigt__p_ConstKBinAxis, _p_ConstKBinAxisTo_p_IAxis, 0, 0}, {&_swigt__p_CustomBinAxis, _p_CustomBinAxisTo_p_IAxis, 0, 0}, {&_swigt__p_FixedBinAxis, _p_FixedBinAxisTo_p_IAxis, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ICloneable[] = { {&_swigt__p_ICloneable, 0, 0, 0},{0, 0, 0, 0}}; @@ -33983,6 +34261,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Bin1DKVector, _swigc__p_ConstKBinAxis, _swigc__p_CustomBinAxis, + _swigc__p_Direction, _swigc__p_FixedBinAxis, _swigc__p_IAxis, _swigc__p_ICloneable, diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index b389485397684c3155d6e6c0684ad04a906c1374..f2636b40ee8b12804d84bbc1f946ff217738f66d 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -3603,21 +3603,31 @@ class ISimulation(libBornAgainBase.ICloneable, libBornAgainParam.INode): """ return _libBornAgainCore.ISimulation_instrument(self, *args) - def setBeamIntensity(self, intensity): + def beam(self, *args): r""" - setBeamIntensity(ISimulation self, double intensity) - void ISimulation::setBeamIntensity(double intensity) + beam(ISimulation self) -> Beam + beam(ISimulation self) -> Beam const & + const Beam& ISimulation::beam() const """ - return _libBornAgainCore.ISimulation_setBeamIntensity(self, intensity) + return _libBornAgainCore.ISimulation_beam(self, *args) - def getBeamIntensity(self): + def detector(self, *args): r""" - getBeamIntensity(ISimulation self) -> double - double ISimulation::getBeamIntensity() const + detector(ISimulation self) -> IDetector + detector(ISimulation self) -> IDetector const & + const IDetector& ISimulation::detector() const """ - return _libBornAgainCore.ISimulation_getBeamIntensity(self) + return _libBornAgainCore.ISimulation_detector(self, *args) + + def setBeamIntensity(self, intensity): + r""" + setBeamIntensity(ISimulation self, double intensity) + void ISimulation::setBeamIntensity(double intensity) + + """ + return _libBornAgainCore.ISimulation_setBeamIntensity(self, intensity) def setBeamPolarization(self, bloch_vector): r""" @@ -3863,16 +3873,6 @@ class ISimulation2D(ISimulation): """ return _libBornAgainCore.ISimulation2D_setDetector(self, detector) - def removeMasks(self): - r""" - removeMasks(ISimulation2D self) - void ISimulation2D::removeMasks() - - removes all masks from the detector - - """ - return _libBornAgainCore.ISimulation2D_removeMasks(self) - def addMask(self, shape, mask_value=True): r""" addMask(ISimulation2D self, IShape2D const & shape, bool mask_value=True) @@ -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 adb3ba4ba5f40b463269a0ce46f354665eab4e1b..2ac6c2e76d9156c9890c4370a38b047d02a780f9 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -3102,108 +3102,110 @@ namespace Swig { #define SWIGTYPE_p_BasicVector3DT_double_t swig_types[2] #define SWIGTYPE_p_BasicVector3DT_int_t swig_types[3] #define SWIGTYPE_p_BasicVector3DT_std__complexT_double_t_t swig_types[4] -#define SWIGTYPE_p_ConstantBackground swig_types[5] -#define SWIGTYPE_p_DepthProbeSimulation swig_types[6] -#define SWIGTYPE_p_DistributionHandler swig_types[7] -#define SWIGTYPE_p_FitObjective swig_types[8] -#define SWIGTYPE_p_GISASSimulation swig_types[9] -#define SWIGTYPE_p_IAxis swig_types[10] -#define SWIGTYPE_p_IBackground swig_types[11] -#define SWIGTYPE_p_IBornFF swig_types[12] -#define SWIGTYPE_p_IChiSquaredModule swig_types[13] -#define SWIGTYPE_p_ICloneable swig_types[14] -#define SWIGTYPE_p_IComponent swig_types[15] -#define SWIGTYPE_p_IDetector2D swig_types[16] -#define SWIGTYPE_p_IDistribution1D swig_types[17] -#define SWIGTYPE_p_IFootprintFactor swig_types[18] -#define SWIGTYPE_p_IFormFactor swig_types[19] -#define SWIGTYPE_p_INode swig_types[20] -#define SWIGTYPE_p_INodeVisitor swig_types[21] -#define SWIGTYPE_p_IObservable swig_types[22] -#define SWIGTYPE_p_IObserver swig_types[23] -#define SWIGTYPE_p_IParametricComponent swig_types[24] -#define SWIGTYPE_p_IRangedDistribution swig_types[25] -#define SWIGTYPE_p_IResolutionFunction2D swig_types[26] -#define SWIGTYPE_p_ISampleNode swig_types[27] -#define SWIGTYPE_p_IShape2D swig_types[28] -#define SWIGTYPE_p_ISimulation swig_types[29] -#define SWIGTYPE_p_ISimulation2D swig_types[30] -#define SWIGTYPE_p_ISpecularScan swig_types[31] -#define SWIGTYPE_p_Instrument swig_types[32] -#define SWIGTYPE_p_IterationInfo swig_types[33] -#define SWIGTYPE_p_MultiLayer swig_types[34] -#define SWIGTYPE_p_OffSpecSimulation swig_types[35] -#define SWIGTYPE_p_OutputDataT_double_t swig_types[36] -#define SWIGTYPE_p_ParameterDistribution swig_types[37] -#define SWIGTYPE_p_ParameterPool 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_QSpecScan 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_allocator_type swig_types[49] -#define SWIGTYPE_p_char swig_types[50] -#define SWIGTYPE_p_difference_type swig_types[51] -#define SWIGTYPE_p_first_type swig_types[52] -#define SWIGTYPE_p_int swig_types[53] -#define SWIGTYPE_p_key_type swig_types[54] -#define SWIGTYPE_p_long_long swig_types[55] -#define SWIGTYPE_p_mapped_type swig_types[56] -#define SWIGTYPE_p_mumufit__MinimizerResult swig_types[57] -#define SWIGTYPE_p_mumufit__Parameters swig_types[58] -#define SWIGTYPE_p_observer_t swig_types[59] -#define SWIGTYPE_p_p_PyObject swig_types[60] -#define SWIGTYPE_p_second_type swig_types[61] -#define SWIGTYPE_p_short swig_types[62] -#define SWIGTYPE_p_signed_char swig_types[63] -#define SWIGTYPE_p_size_type swig_types[64] -#define SWIGTYPE_p_std__allocatorT_AxisInfo_t swig_types[65] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[66] -#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[67] -#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[68] -#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[69] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[70] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[71] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[72] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[73] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[74] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[75] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[76] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[77] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[78] -#define SWIGTYPE_p_std__complexT_double_t swig_types[79] -#define SWIGTYPE_p_std__invalid_argument swig_types[80] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[81] -#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[82] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[83] -#define SWIGTYPE_p_std__shared_ptrT_IObserver_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_double_std__allocatorT_double_t_t swig_types[91] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[92] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[93] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[94] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[95] -#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[96] -#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[97] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[98] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[99] -#define SWIGTYPE_p_unsigned_char swig_types[100] -#define SWIGTYPE_p_unsigned_int swig_types[101] -#define SWIGTYPE_p_unsigned_long_long swig_types[102] -#define SWIGTYPE_p_unsigned_short swig_types[103] -#define SWIGTYPE_p_value_type swig_types[104] -static swig_type_info *swig_types[106]; -static swig_module_info swig_module = {swig_types, 105, 0, 0, 0, 0}; +#define SWIGTYPE_p_Beam swig_types[5] +#define SWIGTYPE_p_ConstantBackground swig_types[6] +#define SWIGTYPE_p_DepthProbeSimulation swig_types[7] +#define SWIGTYPE_p_DistributionHandler swig_types[8] +#define SWIGTYPE_p_FitObjective swig_types[9] +#define SWIGTYPE_p_GISASSimulation swig_types[10] +#define SWIGTYPE_p_IAxis swig_types[11] +#define SWIGTYPE_p_IBackground swig_types[12] +#define SWIGTYPE_p_IBornFF swig_types[13] +#define SWIGTYPE_p_IChiSquaredModule swig_types[14] +#define SWIGTYPE_p_ICloneable swig_types[15] +#define SWIGTYPE_p_IComponent swig_types[16] +#define SWIGTYPE_p_IDetector swig_types[17] +#define SWIGTYPE_p_IDetector2D swig_types[18] +#define SWIGTYPE_p_IDistribution1D swig_types[19] +#define SWIGTYPE_p_IFootprintFactor swig_types[20] +#define SWIGTYPE_p_IFormFactor swig_types[21] +#define SWIGTYPE_p_INode swig_types[22] +#define SWIGTYPE_p_INodeVisitor swig_types[23] +#define SWIGTYPE_p_IObservable swig_types[24] +#define SWIGTYPE_p_IObserver swig_types[25] +#define SWIGTYPE_p_IParametricComponent swig_types[26] +#define SWIGTYPE_p_IRangedDistribution swig_types[27] +#define SWIGTYPE_p_IResolutionFunction2D swig_types[28] +#define SWIGTYPE_p_ISampleNode swig_types[29] +#define SWIGTYPE_p_IShape2D swig_types[30] +#define SWIGTYPE_p_ISimulation swig_types[31] +#define SWIGTYPE_p_ISimulation2D swig_types[32] +#define SWIGTYPE_p_ISpecularScan swig_types[33] +#define SWIGTYPE_p_Instrument swig_types[34] +#define SWIGTYPE_p_IterationInfo swig_types[35] +#define SWIGTYPE_p_MultiLayer swig_types[36] +#define SWIGTYPE_p_OffSpecSimulation swig_types[37] +#define SWIGTYPE_p_OutputDataT_double_t swig_types[38] +#define SWIGTYPE_p_ParameterDistribution swig_types[39] +#define SWIGTYPE_p_ParameterPool swig_types[40] +#define SWIGTYPE_p_PoissonNoiseBackground swig_types[41] +#define SWIGTYPE_p_ProgressHandler__Callback_t swig_types[42] +#define SWIGTYPE_p_PyBuilderCallback swig_types[43] +#define SWIGTYPE_p_PyObserverCallback swig_types[44] +#define SWIGTYPE_p_QSpecScan swig_types[45] +#define SWIGTYPE_p_RealLimits swig_types[46] +#define SWIGTYPE_p_ScanResolution swig_types[47] +#define SWIGTYPE_p_SimulationOptions swig_types[48] +#define SWIGTYPE_p_SimulationResult swig_types[49] +#define SWIGTYPE_p_SpecularSimulation 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_observer_t 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_IObserver_t swig_types[86] +#define SWIGTYPE_p_std__shared_ptrT_ISampleBuilder_t swig_types[87] +#define SWIGTYPE_p_std__vectorT_AxisInfo_std__allocatorT_AxisInfo_t_t swig_types[88] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[89] +#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[90] +#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[91] +#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_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) @@ -39082,52 +39084,185 @@ fail: } -SWIGINTERN PyObject *_wrap_ISimulation_setBeamIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ISimulation_beam__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ISimulation *arg1 = (ISimulation *) 0 ; - double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + Beam *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "ISimulation_setBeamIntensity", 2, 2, swig_obj)) SWIG_fail; + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; 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_setBeamIntensity" "', argument " "1"" of type '" "ISimulation *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation_beam" "', argument " "1"" of type '" "ISimulation *""'"); } arg1 = reinterpret_cast< ISimulation * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ISimulation_setBeamIntensity" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->setBeamIntensity(arg2); - resultobj = SWIG_Py_Void(); + result = (Beam *) &(arg1)->beam(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ISimulation_getBeamIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ISimulation_beam__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ISimulation *arg1 = (ISimulation *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; + Beam *result = 0 ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; 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_getBeamIntensity" "', argument " "1"" of type '" "ISimulation const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation_beam" "', argument " "1"" of type '" "ISimulation const *""'"); } arg1 = reinterpret_cast< ISimulation * >(argp1); - result = (double)((ISimulation const *)arg1)->getBeamIntensity(); - resultobj = SWIG_From_double(static_cast< double >(result)); + result = (Beam *) &((ISimulation const *)arg1)->beam(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ISimulation_beam(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[2] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "ISimulation_beam", 0, 1, argv))) SWIG_fail; + --argc; + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ISimulation, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ISimulation_beam__SWIG_0(self, argc, argv); + } + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ISimulation, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ISimulation_beam__SWIG_1(self, argc, argv); + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ISimulation_beam'.\n" + " Possible C/C++ prototypes are:\n" + " ISimulation::beam()\n" + " ISimulation::beam() const\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_ISimulation_detector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + ISimulation *arg1 = (ISimulation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + IDetector *result = 0 ; + + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + 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_detector" "', argument " "1"" of type '" "ISimulation *""'"); + } + arg1 = reinterpret_cast< ISimulation * >(argp1); + result = (IDetector *) &(arg1)->detector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ISimulation_detector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + ISimulation *arg1 = (ISimulation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + IDetector *result = 0 ; + + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + 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_detector" "', argument " "1"" of type '" "ISimulation const *""'"); + } + arg1 = reinterpret_cast< ISimulation * >(argp1); + result = (IDetector *) &((ISimulation const *)arg1)->detector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ISimulation_detector(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[2] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "ISimulation_detector", 0, 1, argv))) SWIG_fail; + --argc; + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ISimulation, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ISimulation_detector__SWIG_0(self, argc, argv); + } + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ISimulation, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ISimulation_detector__SWIG_1(self, argc, argv); + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ISimulation_detector'.\n" + " Possible C/C++ prototypes are:\n" + " ISimulation::detector()\n" + " ISimulation::detector() const\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_ISimulation_setBeamIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ISimulation *arg1 = (ISimulation *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ISimulation_setBeamIntensity", 2, 2, swig_obj)) SWIG_fail; + 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_setBeamIntensity" "', argument " "1"" of type '" "ISimulation *""'"); + } + arg1 = reinterpret_cast< ISimulation * >(argp1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ISimulation_setBeamIntensity" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setBeamIntensity(arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; @@ -40294,28 +40429,6 @@ fail: } -SWIGINTERN PyObject *_wrap_ISimulation2D_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ISimulation2D *arg1 = (ISimulation2D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation2D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation2D_removeMasks" "', argument " "1"" of type '" "ISimulation2D *""'"); - } - arg1 = reinterpret_cast< ISimulation2D * >(argp1); - (arg1)->removeMasks(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_ISimulation2D_addMask__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ISimulation2D *arg1 = (ISimulation2D *) 0 ; @@ -40518,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; @@ -40531,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 ; @@ -41409,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; @@ -41422,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 ; @@ -43536,16 +43815,23 @@ static PyMethodDef SwigMethods[] = { "Instrument& ISimulation::instrument()\n" "\n" ""}, + { "ISimulation_beam", _wrap_ISimulation_beam, METH_VARARGS, "\n" + "ISimulation_beam(ISimulation self) -> Beam\n" + "ISimulation_beam(ISimulation self) -> Beam const &\n" + "const Beam& ISimulation::beam() const\n" + "\n" + ""}, + { "ISimulation_detector", _wrap_ISimulation_detector, METH_VARARGS, "\n" + "ISimulation_detector(ISimulation self) -> IDetector\n" + "ISimulation_detector(ISimulation self) -> IDetector const &\n" + "const IDetector& ISimulation::detector() const\n" + "\n" + ""}, { "ISimulation_setBeamIntensity", _wrap_ISimulation_setBeamIntensity, METH_VARARGS, "\n" "ISimulation_setBeamIntensity(ISimulation self, double intensity)\n" "void ISimulation::setBeamIntensity(double intensity)\n" "\n" ""}, - { "ISimulation_getBeamIntensity", _wrap_ISimulation_getBeamIntensity, METH_O, "\n" - "ISimulation_getBeamIntensity(ISimulation self) -> double\n" - "double ISimulation::getBeamIntensity() const\n" - "\n" - ""}, { "ISimulation_setBeamPolarization", _wrap_ISimulation_setBeamPolarization, METH_VARARGS, "\n" "ISimulation_setBeamPolarization(ISimulation self, kvector_t bloch_vector)\n" "void ISimulation::setBeamPolarization(const kvector_t bloch_vector)\n" @@ -43705,13 +43991,6 @@ static PyMethodDef SwigMethods[] = { "Sets the detector (axes can be overwritten later) \n" "\n" ""}, - { "ISimulation2D_removeMasks", _wrap_ISimulation2D_removeMasks, METH_O, "\n" - "ISimulation2D_removeMasks(ISimulation2D self)\n" - "void ISimulation2D::removeMasks()\n" - "\n" - "removes all masks from the detector \n" - "\n" - ""}, { "ISimulation2D_addMask", _wrap_ISimulation2D_addMask, METH_VARARGS, "\n" "ISimulation2D_addMask(ISimulation2D self, IShape2D const & shape, bool mask_value=True)\n" "void ISimulation2D::addMask(const IShape2D &shape, bool mask_value=true)\n" @@ -43743,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" @@ -43921,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" @@ -44275,6 +44556,7 @@ static swig_type_info _swigt__p_AxisInfo = {"_p_AxisInfo", "std::vector< AxisInf static swig_type_info _swigt__p_BasicVector3DT_double_t = {"_p_BasicVector3DT_double_t", "std::vector< BasicVector3D< double > >::value_type *|kvector_t *|BasicVector3D< double > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_BasicVector3DT_int_t = {"_p_BasicVector3DT_int_t", "ivector_t *|BasicVector3D< int > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_BasicVector3DT_std__complexT_double_t_t = {"_p_BasicVector3DT_std__complexT_double_t_t", "BasicVector3D< std::complex< double > > *|std::vector< BasicVector3D< std::complex< double > > >::value_type *|cvector_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Beam = {"_p_Beam", "Beam *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ConstantBackground = {"_p_ConstantBackground", "ConstantBackground *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DepthProbeSimulation = {"_p_DepthProbeSimulation", "DepthProbeSimulation *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DistributionHandler = {"_p_DistributionHandler", "DistributionHandler *", 0, 0, (void*)0, 0}; @@ -44289,6 +44571,7 @@ static swig_type_info _swigt__p_ParameterPool = {"_p_ParameterPool", 0, 0, 0, 0, static swig_type_info _swigt__p_IBornFF = {"_p_IBornFF", 0, 0, 0, 0, 0}; static swig_type_info _swigt__p_ISampleNode = {"_p_ISampleNode", 0, 0, 0, 0, 0}; static swig_type_info _swigt__p_IComponent = {"_p_IComponent", "IComponent *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_IDetector = {"_p_IDetector", "IDetector *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IDetector2D = {"_p_IDetector2D", "IDetector2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IDistribution1D = {"_p_IDistribution1D", "IDistribution1D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IFootprintFactor = {"_p_IFootprintFactor", "IFootprintFactor *", 0, 0, (void*)0, 0}; @@ -44382,6 +44665,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_BasicVector3DT_double_t, &_swigt__p_BasicVector3DT_int_t, &_swigt__p_BasicVector3DT_std__complexT_double_t_t, + &_swigt__p_Beam, &_swigt__p_ConstantBackground, &_swigt__p_DepthProbeSimulation, &_swigt__p_DistributionHandler, @@ -44393,6 +44677,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_IChiSquaredModule, &_swigt__p_ICloneable, &_swigt__p_IComponent, + &_swigt__p_IDetector, &_swigt__p_IDetector2D, &_swigt__p_IDistribution1D, &_swigt__p_IFootprintFactor, @@ -44489,6 +44774,7 @@ static swig_cast_info _swigc__p_AxisInfo[] = { {&_swigt__p_AxisInfo, 0, 0, 0},{ static swig_cast_info _swigc__p_BasicVector3DT_double_t[] = { {&_swigt__p_BasicVector3DT_double_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_BasicVector3DT_int_t[] = { {&_swigt__p_BasicVector3DT_int_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_BasicVector3DT_std__complexT_double_t_t[] = { {&_swigt__p_BasicVector3DT_std__complexT_double_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Beam[] = { {&_swigt__p_Beam, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ConstantBackground[] = { {&_swigt__p_ConstantBackground, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DepthProbeSimulation[] = { {&_swigt__p_DepthProbeSimulation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DistributionHandler[] = { {&_swigt__p_DistributionHandler, 0, 0, 0},{0, 0, 0, 0}}; @@ -44503,6 +44789,7 @@ static swig_cast_info _swigc__p_IBornFF[] = {{&_swigt__p_IBornFF, 0, 0, 0},{0, 0 static swig_cast_info _swigc__p_ISampleNode[] = {{&_swigt__p_ISampleNode, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ICloneable[] = { {&_swigt__p_IFormFactor, _p_IFormFactorTo_p_ICloneable, 0, 0}, {&_swigt__p_SpecularSimulation, _p_SpecularSimulationTo_p_ICloneable, 0, 0}, {&_swigt__p_DepthProbeSimulation, _p_DepthProbeSimulationTo_p_ICloneable, 0, 0}, {&_swigt__p_OffSpecSimulation, _p_OffSpecSimulationTo_p_ICloneable, 0, 0}, {&_swigt__p_GISASSimulation, _p_GISASSimulationTo_p_ICloneable, 0, 0}, {&_swigt__p_ISimulation, _p_ISimulationTo_p_ICloneable, 0, 0}, {&_swigt__p_ICloneable, 0, 0, 0}, {&_swigt__p_IBackground, _p_IBackgroundTo_p_ICloneable, 0, 0}, {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_ICloneable, 0, 0}, {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_ICloneable, 0, 0}, {&_swigt__p_ParameterPool, _p_ParameterPoolTo_p_ICloneable, 0, 0}, {&_swigt__p_ISpecularScan, _p_ISpecularScanTo_p_ICloneable, 0, 0}, {&_swigt__p_IBornFF, _p_IBornFFTo_p_ICloneable, 0, 0}, {&_swigt__p_AngularSpecScan, _p_AngularSpecScanTo_p_ICloneable, 0, 0}, {&_swigt__p_QSpecScan, _p_QSpecScanTo_p_ICloneable, 0, 0}, {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_ICloneable, 0, 0}, {&_swigt__p_ISimulation2D, _p_ISimulation2DTo_p_ICloneable, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IComponent[] = { {&_swigt__p_IFormFactor, _p_IFormFactorTo_p_IComponent, 0, 0}, {&_swigt__p_SpecularSimulation, _p_SpecularSimulationTo_p_IComponent, 0, 0}, {&_swigt__p_DepthProbeSimulation, _p_DepthProbeSimulationTo_p_IComponent, 0, 0}, {&_swigt__p_OffSpecSimulation, _p_OffSpecSimulationTo_p_IComponent, 0, 0}, {&_swigt__p_GISASSimulation, _p_GISASSimulationTo_p_IComponent, 0, 0}, {&_swigt__p_ISimulation, _p_ISimulationTo_p_IComponent, 0, 0}, {&_swigt__p_IParametricComponent, _p_IParametricComponentTo_p_IComponent, 0, 0}, {&_swigt__p_IComponent, 0, 0, 0}, {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_IComponent, 0, 0}, {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_IComponent, 0, 0}, {&_swigt__p_IBackground, _p_IBackgroundTo_p_IComponent, 0, 0}, {&_swigt__p_IBornFF, _p_IBornFFTo_p_IComponent, 0, 0}, {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_IComponent, 0, 0}, {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IComponent, 0, 0}, {&_swigt__p_ISimulation2D, _p_ISimulation2DTo_p_IComponent, 0, 0}, {&_swigt__p_INode, _p_INodeTo_p_IComponent, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IDetector[] = { {&_swigt__p_IDetector, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDetector2D[] = { {&_swigt__p_IDetector2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDistribution1D[] = { {&_swigt__p_IDistribution1D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IFootprintFactor[] = { {&_swigt__p_IFootprintFactor, 0, 0, 0},{0, 0, 0, 0}}; @@ -44596,6 +44883,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_BasicVector3DT_double_t, _swigc__p_BasicVector3DT_int_t, _swigc__p_BasicVector3DT_std__complexT_double_t_t, + _swigc__p_Beam, _swigc__p_ConstantBackground, _swigc__p_DepthProbeSimulation, _swigc__p_DistributionHandler, @@ -44607,6 +44895,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_IChiSquaredModule, _swigc__p_ICloneable, _swigc__p_IComponent, + _swigc__p_IDetector, _swigc__p_IDetector2D, _swigc__p_IDistribution1D, _swigc__p_IFootprintFactor, diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index e81a989a8ee955bff707a6893bf1f5fd3d8a2685..476eb2340edadc07de5eab51045a5a0a2744400e 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2631,7 +2631,7 @@ class Beam(libBornAgainParam.INode): def __init__(self, *args): r""" - __init__(Beam self, double wavelength, double alpha, double phi, double intensity) -> Beam + __init__(Beam self, double intensity, double wavelength, Direction const & direction) -> Beam __init__(Beam self, Beam other) -> Beam Beam::Beam(const Beam &other) @@ -2644,133 +2644,139 @@ class Beam(libBornAgainParam.INode): r"""horizontalBeam() -> Beam""" return _libBornAgainDevice.Beam_horizontalBeam() - def getCentralK(self): + def accept(self, visitor): r""" - getCentralK(Beam self) -> kvector_t - kvector_t Beam::getCentralK() const - - Returns the wavevector. + accept(Beam self, INodeVisitor * visitor) + void Beam::accept(INodeVisitor *visitor) const override """ - return _libBornAgainDevice.Beam_getCentralK(self) + return _libBornAgainDevice.Beam_accept(self, visitor) - def setCentralK(self, wavelength, alpha_i, phi_i): + def getChildren(self): r""" - setCentralK(Beam self, double wavelength, double alpha_i, double phi_i) - void Beam::setCentralK(double wavelength, double alpha_i, double phi_i) - - Sets the wavevector in terms of wavelength and incoming angles. + getChildren(Beam self) -> std::vector< INode const *,std::allocator< INode const * > > + std::vector< const INode * > Beam::getChildren() const override """ - return _libBornAgainDevice.Beam_setCentralK(self, wavelength, alpha_i, phi_i) + return _libBornAgainDevice.Beam_getChildren(self) - def getIntensity(self): + def intensity(self): r""" - getIntensity(Beam self) -> double - double Beam::getIntensity() const + intensity(Beam self) -> double + double Beam::intensity() const Returns the beam intensity in neutrons/sec. """ - return _libBornAgainDevice.Beam_getIntensity(self) + return _libBornAgainDevice.Beam_intensity(self) - def setIntensity(self, intensity): + def wavelength(self): r""" - setIntensity(Beam self, double intensity) - void Beam::setIntensity(double intensity) + wavelength(Beam self) -> double + double Beam::wavelength() const - Sets the beam intensity in neutrons/sec. + """ + return _libBornAgainDevice.Beam_wavelength(self) + + def direction(self): + r""" + direction(Beam self) -> Direction + Direction Beam::direction() const """ - return _libBornAgainDevice.Beam_setIntensity(self, intensity) + return _libBornAgainDevice.Beam_direction(self) - def footprintFactor(self): + def getCentralK(self): r""" - footprintFactor(Beam self) -> IFootprintFactor - const IFootprintFactor * Beam::footprintFactor() const + getCentralK(Beam self) -> kvector_t + kvector_t Beam::getCentralK() const - Returns footprint factor. + Returns the wavevector. """ - return _libBornAgainDevice.Beam_footprintFactor(self) + return _libBornAgainDevice.Beam_getCentralK(self) - def setFootprintFactor(self, shape_factor): + def getBlochVector(self): r""" - setFootprintFactor(Beam self, IFootprintFactor shape_factor) - void Beam::setFootprintFactor(const IFootprintFactor &shape_factor) - - Sets footprint factor to the beam. + getBlochVector(Beam self) -> kvector_t + kvector_t Beam::getBlochVector() const """ - return _libBornAgainDevice.Beam_setFootprintFactor(self, shape_factor) + return _libBornAgainDevice.Beam_getBlochVector(self) - def setWidthRatio(self, width_ratio): + def footprintFactor(self): r""" - setWidthRatio(Beam self, double width_ratio) - void Beam::setWidthRatio(double width_ratio) + footprintFactor(Beam self) -> IFootprintFactor + const IFootprintFactor * Beam::footprintFactor() const - Sets beam to sample width ratio in footprint factor. + Returns footprint factor. """ - return _libBornAgainDevice.Beam_setWidthRatio(self, width_ratio) + return _libBornAgainDevice.Beam_footprintFactor(self) - def setPolarization(self, bloch_vector): + def setWavelength(self, wavelength): r""" - setPolarization(Beam self, kvector_t bloch_vector) - void Beam::setPolarization(const kvector_t bloch_vector) - - Sets the polarization density matrix according to the given Bloch vector. + setWavelength(Beam self, double wavelength) + void Beam::setWavelength(double wavelength) """ - return _libBornAgainDevice.Beam_setPolarization(self, bloch_vector) + return _libBornAgainDevice.Beam_setWavelength(self, wavelength) - def getBlochVector(self): + def setDirection(self, direction): r""" - getBlochVector(Beam self) -> kvector_t - kvector_t Beam::getBlochVector() const + setDirection(Beam self, Direction const & direction) + void Beam::setDirection(const Direction &direction) """ - return _libBornAgainDevice.Beam_getBlochVector(self) + return _libBornAgainDevice.Beam_setDirection(self, direction) - def getWavelength(self): + def setInclination(self, alpha): r""" - getWavelength(Beam self) -> double - double Beam::getWavelength() const + setInclination(Beam self, double const alpha) + void Beam::setInclination(const double alpha) """ - return _libBornAgainDevice.Beam_getWavelength(self) + return _libBornAgainDevice.Beam_setInclination(self, alpha) - def getAlpha(self): + def setIntensity(self, intensity): r""" - getAlpha(Beam self) -> double - double Beam::getAlpha() const + setIntensity(Beam self, double intensity) + void Beam::setIntensity(double intensity) + + Sets the beam intensity in neutrons/sec. """ - return _libBornAgainDevice.Beam_getAlpha(self) + return _libBornAgainDevice.Beam_setIntensity(self, intensity) - def getPhi(self): + def setFootprintFactor(self, shape_factor): r""" - getPhi(Beam self) -> double - double Beam::getPhi() const + setFootprintFactor(Beam self, IFootprintFactor shape_factor) + void Beam::setFootprintFactor(const IFootprintFactor &shape_factor) + + Sets footprint factor to the beam. """ - return _libBornAgainDevice.Beam_getPhi(self) + return _libBornAgainDevice.Beam_setFootprintFactor(self, shape_factor) - def accept(self, visitor): + def setWidthRatio(self, width_ratio): r""" - accept(Beam self, INodeVisitor * visitor) - void Beam::accept(INodeVisitor *visitor) const override + setWidthRatio(Beam self, double width_ratio) + void Beam::setWidthRatio(double width_ratio) + + Sets beam to sample width ratio in footprint factor. """ - return _libBornAgainDevice.Beam_accept(self, visitor) + return _libBornAgainDevice.Beam_setWidthRatio(self, width_ratio) - def getChildren(self): + def setPolarization(self, bloch_vector): r""" - getChildren(Beam self) -> std::vector< INode const *,std::allocator< INode const * > > - std::vector< const INode * > Beam::getChildren() const override + setPolarization(Beam self, kvector_t bloch_vector) + void Beam::setPolarization(const kvector_t bloch_vector) + + Sets the polarization density matrix according to the given Bloch vector. """ - return _libBornAgainDevice.Beam_getChildren(self) + return _libBornAgainDevice.Beam_setPolarization(self, bloch_vector) # Register Beam in _libBornAgainDevice: _libBornAgainDevice.Beam_swigregister(Beam) @@ -3860,211 +3866,6 @@ class ChiSquaredModule(IChiSquaredModule): # Register ChiSquaredModule in _libBornAgainDevice: _libBornAgainDevice.ChiSquaredModule_swigregister(ChiSquaredModule) -class Instrument(libBornAgainParam.INode): - r""" - - - Assembles beam, detector and their relative positions with respect to the sample. - - C++ includes: Instrument.h - - """ - - 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__(Instrument self) -> Instrument - __init__(Instrument self, Instrument other) -> Instrument - Instrument::Instrument(const Instrument &other) - - """ - _libBornAgainDevice.Instrument_swiginit(self, _libBornAgainDevice.new_Instrument(*args)) - __swig_destroy__ = _libBornAgainDevice.delete_Instrument - - def accept(self, visitor): - r""" - accept(Instrument self, INodeVisitor * visitor) - void Instrument::accept(INodeVisitor *visitor) const final - - """ - return _libBornAgainDevice.Instrument_accept(self, visitor) - - def beam(self, *args): - r""" - beam(Instrument self) -> Beam - beam(Instrument self) -> Beam - const Beam& Instrument::beam() const - - """ - return _libBornAgainDevice.Instrument_beam(self, *args) - - def setBeam(self, beam): - r""" - setBeam(Instrument self, Beam beam) - void Instrument::setBeam(const Beam &beam) - - """ - return _libBornAgainDevice.Instrument_setBeam(self, beam) - - def setBeamParameters(self, wavelength, alpha_i, phi_i): - r""" - setBeamParameters(Instrument self, double wavelength, double alpha_i, double phi_i) - void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i) - - Sets the beam wavelength and incoming angles. - - """ - return _libBornAgainDevice.Instrument_setBeamParameters(self, wavelength, alpha_i, phi_i) - - def setBeamIntensity(self, intensity): - r""" - setBeamIntensity(Instrument self, double intensity) - void Instrument::setBeamIntensity(double intensity) - - """ - return _libBornAgainDevice.Instrument_setBeamIntensity(self, intensity) - - def setBeamPolarization(self, bloch_vector): - r""" - setBeamPolarization(Instrument self, kvector_t bloch_vector) - void Instrument::setBeamPolarization(const kvector_t bloch_vector) - - Sets the beam's polarization according to the given Bloch vector. - - """ - return _libBornAgainDevice.Instrument_setBeamPolarization(self, bloch_vector) - - def getBeamIntensity(self): - r""" - getBeamIntensity(Instrument self) -> double - double Instrument::getBeamIntensity() const - - """ - return _libBornAgainDevice.Instrument_getBeamIntensity(self) - - def getDetector(self): - r""" - getDetector(Instrument self) -> IDetector - const IDetector * Instrument::getDetector() const - - """ - return _libBornAgainDevice.Instrument_getDetector(self) - - def detector(self, *args): - r""" - detector(Instrument self) -> IDetector - detector(Instrument self) -> IDetector - const IDetector & Instrument::detector() const - - """ - return _libBornAgainDevice.Instrument_detector(self, *args) - - def detector2D(self, *args): - r""" - detector2D(Instrument self) -> IDetector2D - detector2D(Instrument self) -> IDetector2D - const IDetector2D & Instrument::detector2D() const - - """ - return _libBornAgainDevice.Instrument_detector2D(self, *args) - - def getDetectorMask(self): - r""" - getDetectorMask(Instrument self) -> DetectorMask - const DetectorMask * Instrument::getDetectorMask() const - - """ - return _libBornAgainDevice.Instrument_getDetectorMask(self) - - def getDetectorAxis(self, index): - r""" - getDetectorAxis(Instrument self, size_t index) -> IAxis - const IAxis & Instrument::getDetectorAxis(size_t index) const - - """ - return _libBornAgainDevice.Instrument_getDetectorAxis(self, index) - - def getDetectorDimension(self): - r""" - getDetectorDimension(Instrument self) -> size_t - size_t Instrument::getDetectorDimension() const - - """ - return _libBornAgainDevice.Instrument_getDetectorDimension(self) - - def setDetector(self, detector): - r""" - setDetector(Instrument self, IDetector detector) - void Instrument::setDetector(const IDetector &detector) - - Sets the detector (axes can be overwritten later) - - """ - return _libBornAgainDevice.Instrument_setDetector(self, detector) - - def setDetectorResolutionFunction(self, p_resolution_function): - r""" - setDetectorResolutionFunction(Instrument self, IResolutionFunction2D p_resolution_function) - void Instrument::setDetectorResolutionFunction(const IResolutionFunction2D &p_resolution_function) - - Sets detector resolution function. - - """ - return _libBornAgainDevice.Instrument_setDetectorResolutionFunction(self, p_resolution_function) - - def removeDetectorResolution(self): - r""" - removeDetectorResolution(Instrument self) - void Instrument::removeDetectorResolution() - - Removes detector resolution function. - - """ - return _libBornAgainDevice.Instrument_removeDetectorResolution(self) - - def setAnalyzerProperties(self, direction, efficiency, total_transmission): - r""" - setAnalyzerProperties(Instrument self, kvector_t direction, double efficiency, double total_transmission) - void Instrument::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) - - Sets the polarization analyzer characteristics of the detector. - - """ - return _libBornAgainDevice.Instrument_setAnalyzerProperties(self, direction, efficiency, total_transmission) - - def applyDetectorResolution(self, p_intensity_map): - r""" - applyDetectorResolution(Instrument self, IntensityData p_intensity_map) - void Instrument::applyDetectorResolution(OutputData< double > *p_intensity_map) const - - apply the detector resolution to the given intensity map - - """ - return _libBornAgainDevice.Instrument_applyDetectorResolution(self, p_intensity_map) - - def initDetector(self): - r""" - initDetector(Instrument self) - void Instrument::initDetector() - - init detector with beam settings - - """ - return _libBornAgainDevice.Instrument_initDetector(self) - - def getChildren(self): - r""" - getChildren(Instrument self) -> std::vector< INode const *,std::allocator< INode const * > > - std::vector< const INode * > Instrument::getChildren() const - - """ - return _libBornAgainDevice.Instrument_getChildren(self) - -# Register Instrument in _libBornAgainDevice: -_libBornAgainDevice.Instrument_swigregister(Instrument) - def RelativeDifference(dat, ref): r""" @@ -4492,16 +4293,6 @@ class DetectorMask(object): """ return _libBornAgainDevice.DetectorMask_createHistogram(self) - def removeMasks(self): - r""" - removeMasks(DetectorMask self) - void DetectorMask::removeMasks() - - remove all masks and return object to initial state - - """ - return _libBornAgainDevice.DetectorMask_removeMasks(self) - def hasMasks(self): r""" hasMasks(DetectorMask self) -> bool @@ -4583,43 +4374,43 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode): """ return _libBornAgainDevice.IDetector_addAxis(self, axis) - def axis(self, index): + def setAnalyzerProperties(self, direction, efficiency, total_transmission): r""" - axis(IDetector self, size_t index) -> IAxis - const IAxis & IDetector::axis(size_t index) const + setAnalyzerProperties(IDetector self, kvector_t direction, double efficiency, double total_transmission) + void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) + + Sets the polarization analyzer characteristics of the detector. """ - return _libBornAgainDevice.IDetector_axis(self, index) + return _libBornAgainDevice.IDetector_setAnalyzerProperties(self, direction, efficiency, total_transmission) - def dimension(self): + def setDetectorResolution(self, p_detector_resolution): r""" - dimension(IDetector self) -> size_t - size_t IDetector::dimension() const + setDetectorResolution(IDetector self, IDetectorResolution p_detector_resolution) + void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution) - Returns actual dimensionality of the detector (number of defined axes) + Sets the detector resolution. """ - return _libBornAgainDevice.IDetector_dimension(self) + return _libBornAgainDevice.IDetector_setDetectorResolution(self, p_detector_resolution) - def axisBinIndex(self, index, selected_axis): + def setResolutionFunction(self, resFunc): r""" - axisBinIndex(IDetector self, size_t index, size_t selected_axis) -> size_t - size_t IDetector::axisBinIndex(size_t index, size_t selected_axis) const - - Calculate axis index for given global index. + setResolutionFunction(IDetector self, IResolutionFunction2D resFunc) + void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc) """ - return _libBornAgainDevice.IDetector_axisBinIndex(self, index, selected_axis) + return _libBornAgainDevice.IDetector_setResolutionFunction(self, resFunc) - def totalSize(self): + def resetRegionOfInterest(self): r""" - totalSize(IDetector self) -> size_t - size_t IDetector::totalSize() const + resetRegionOfInterest(IDetector self) + virtual void IDetector::resetRegionOfInterest()=0 - Returns total number of pixels. + Resets region of interest making whole detector plane available for the simulation. """ - return _libBornAgainDevice.IDetector_totalSize(self) + return _libBornAgainDevice.IDetector_resetRegionOfInterest(self) def detectorMask(self): r""" @@ -4631,83 +4422,79 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode): """ return _libBornAgainDevice.IDetector_detectorMask(self) - def setAnalyzerProperties(self, direction, efficiency, total_transmission): + def getChildren(self): r""" - setAnalyzerProperties(IDetector self, kvector_t direction, double efficiency, double total_transmission) - void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission) - - Sets the polarization analyzer characteristics of the detector. + getChildren(IDetector self) -> std::vector< INode const *,std::allocator< INode const * > > + std::vector< const INode * > IDetector::getChildren() const override """ - return _libBornAgainDevice.IDetector_setAnalyzerProperties(self, direction, efficiency, total_transmission) + return _libBornAgainDevice.IDetector_getChildren(self) - def setDetectorResolution(self, p_detector_resolution): + def iterate(self, func, visit_masks=False): r""" - setDetectorResolution(IDetector self, IDetectorResolution p_detector_resolution) - void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution) - - Sets the detector resolution. + iterate(IDetector self, std::function< void (IDetector::const_iterator) > func, bool visit_masks=False) + void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const """ - return _libBornAgainDevice.IDetector_setDetectorResolution(self, p_detector_resolution) + return _libBornAgainDevice.IDetector_iterate(self, func, visit_masks) - def setResolutionFunction(self, resFunc): + def axis(self, index): r""" - setResolutionFunction(IDetector self, IResolutionFunction2D resFunc) - void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc) + axis(IDetector self, size_t index) -> IAxis + const IAxis & IDetector::axis(size_t index) const """ - return _libBornAgainDevice.IDetector_setResolutionFunction(self, resFunc) + return _libBornAgainDevice.IDetector_axis(self, index) - def applyDetectorResolution(self, p_intensity_map): + def dimension(self): r""" - applyDetectorResolution(IDetector self, IntensityData p_intensity_map) - void IDetector::applyDetectorResolution(OutputData< double > *p_intensity_map) const + dimension(IDetector self) -> size_t + size_t IDetector::dimension() const - Applies the detector resolution to the given intensity maps. + Returns actual dimensionality of the detector (number of defined axes) """ - return _libBornAgainDevice.IDetector_applyDetectorResolution(self, p_intensity_map) + return _libBornAgainDevice.IDetector_dimension(self) - def removeDetectorResolution(self): + def axisBinIndex(self, index, selected_axis): r""" - removeDetectorResolution(IDetector self) - void IDetector::removeDetectorResolution() + axisBinIndex(IDetector self, size_t index, size_t selected_axis) -> size_t + size_t IDetector::axisBinIndex(size_t index, size_t selected_axis) const - Removes detector resolution function. + Calculate axis index for given global index. """ - return _libBornAgainDevice.IDetector_removeDetectorResolution(self) + return _libBornAgainDevice.IDetector_axisBinIndex(self, index, selected_axis) - def detectorResolution(self): + def totalSize(self): r""" - detectorResolution(IDetector self) -> IDetectorResolution - const IDetectorResolution * IDetector::detectorResolution() const + totalSize(IDetector self) -> size_t + size_t IDetector::totalSize() const - Returns a pointer to detector resolution object. + Returns total number of pixels. """ - return _libBornAgainDevice.IDetector_detectorResolution(self) + return _libBornAgainDevice.IDetector_totalSize(self) - def regionOfInterest(self): + def applyDetectorResolution(self, p_intensity_map): r""" - regionOfInterest(IDetector self) -> RegionOfInterest const * - virtual const RegionOfInterest* IDetector::regionOfInterest() const =0 + applyDetectorResolution(IDetector self, IntensityData p_intensity_map) + void IDetector::applyDetectorResolution(OutputData< double > *p_intensity_map) const - Returns region of interest if exists. + Applies the detector resolution to the given intensity maps. """ - return _libBornAgainDevice.IDetector_regionOfInterest(self) + return _libBornAgainDevice.IDetector_applyDetectorResolution(self, p_intensity_map) - def resetRegionOfInterest(self): + def detectorResolution(self): r""" - resetRegionOfInterest(IDetector self) - virtual void IDetector::resetRegionOfInterest()=0 + detectorResolution(IDetector self) -> IDetectorResolution + const IDetectorResolution * IDetector::detectorResolution() const - Resets region of interest making whole detector plane available for the simulation. + Returns a pointer to detector resolution object. """ - return _libBornAgainDevice.IDetector_resetRegionOfInterest(self) + return _libBornAgainDevice.IDetector_detectorResolution(self) def detectionProperties(self): r""" @@ -4749,21 +4536,15 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode): """ return _libBornAgainDevice.IDetector_numberOfSimulationElements(self) - def getChildren(self): + def regionOfInterest(self): r""" - getChildren(IDetector self) -> std::vector< INode const *,std::allocator< INode const * > > - std::vector< const INode * > IDetector::getChildren() const override - - """ - return _libBornAgainDevice.IDetector_getChildren(self) + regionOfInterest(IDetector self) -> RegionOfInterest const * + virtual const RegionOfInterest* IDetector::regionOfInterest() const =0 - def iterate(self, func, visit_masks=False): - r""" - iterate(IDetector self, std::function< void (IDetector::const_iterator) > func, bool visit_masks=False) - void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const + Returns region of interest if exists. """ - return _libBornAgainDevice.IDetector_iterate(self, func, visit_masks) + return _libBornAgainDevice.IDetector_regionOfInterest(self) # Register IDetector in _libBornAgainDevice: _libBornAgainDevice.IDetector_swigregister(IDetector) @@ -4803,16 +4584,6 @@ class IDetector2D(IDetector): """ return _libBornAgainDevice.IDetector2D_setDetectorParameters(self, n_x, x_min, x_max, n_y, y_min, y_max) - def removeMasks(self): - r""" - removeMasks(IDetector2D self) - void IDetector2D::removeMasks() - - Removes all masks from the detector. - - """ - return _libBornAgainDevice.IDetector2D_removeMasks(self) - def detectorMask(self): r""" detectorMask(IDetector2D self) -> DetectorMask @@ -5943,7 +5714,7 @@ class IntensityDataIOFactory(object): r""" - Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends woth "*.gz" or "*.bz2" the file will be zipped on the fly using appropriate algorithm. + Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends with "*.gz" or "*.bz2" the file will be zipped on the fly using appropriate algorithm. Usage: @@ -5989,7 +5760,7 @@ class IntensityDataIOFactory(object): __init__(IntensityDataIOFactory self) -> IntensityDataIOFactory - Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends woth "*.gz" or "*.bz2" the file will be zipped on the fly using appropriate algorithm. + Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends with "*.gz" or "*.bz2" the file will be zipped on the fly using appropriate algorithm. Usage: diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index 64e13f935605f4e3be9e9341cb1ff8a85aefa58f..4a781d0bf52a2d09bc608c072e06df875479dd73 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -3107,32 +3107,32 @@ namespace Swig { #define SWIGTYPE_p_ChiSquaredModule swig_types[7] #define SWIGTYPE_p_DetectionProperties swig_types[8] #define SWIGTYPE_p_DetectorMask swig_types[9] -#define SWIGTYPE_p_Ellipse swig_types[10] -#define SWIGTYPE_p_FootprintGauss swig_types[11] -#define SWIGTYPE_p_FootprintSquare swig_types[12] -#define SWIGTYPE_p_Histogram1D swig_types[13] -#define SWIGTYPE_p_Histogram2D swig_types[14] -#define SWIGTYPE_p_HorizontalLine swig_types[15] -#define SWIGTYPE_p_IAxis swig_types[16] -#define SWIGTYPE_p_IChiSquaredModule swig_types[17] -#define SWIGTYPE_p_ICloneable swig_types[18] -#define SWIGTYPE_p_IComponent swig_types[19] -#define SWIGTYPE_p_IDetector swig_types[20] -#define SWIGTYPE_p_IDetector2D swig_types[21] -#define SWIGTYPE_p_IDetectorResolution swig_types[22] -#define SWIGTYPE_p_IFootprintFactor swig_types[23] -#define SWIGTYPE_p_IHistogram swig_types[24] -#define SWIGTYPE_p_IIntensityFunction swig_types[25] -#define SWIGTYPE_p_INode swig_types[26] -#define SWIGTYPE_p_INodeVisitor swig_types[27] -#define SWIGTYPE_p_IParametricComponent swig_types[28] -#define SWIGTYPE_p_IPixel swig_types[29] -#define SWIGTYPE_p_IRangedDistribution swig_types[30] -#define SWIGTYPE_p_IResolutionFunction2D swig_types[31] -#define SWIGTYPE_p_IShape2D swig_types[32] -#define SWIGTYPE_p_IUnitConverter swig_types[33] -#define SWIGTYPE_p_IVarianceFunction swig_types[34] -#define SWIGTYPE_p_Instrument swig_types[35] +#define SWIGTYPE_p_Direction swig_types[10] +#define SWIGTYPE_p_Ellipse swig_types[11] +#define SWIGTYPE_p_FootprintGauss swig_types[12] +#define SWIGTYPE_p_FootprintSquare swig_types[13] +#define SWIGTYPE_p_Histogram1D swig_types[14] +#define SWIGTYPE_p_Histogram2D swig_types[15] +#define SWIGTYPE_p_HorizontalLine swig_types[16] +#define SWIGTYPE_p_IAxis swig_types[17] +#define SWIGTYPE_p_IChiSquaredModule swig_types[18] +#define SWIGTYPE_p_ICloneable swig_types[19] +#define SWIGTYPE_p_IComponent swig_types[20] +#define SWIGTYPE_p_IDetector swig_types[21] +#define SWIGTYPE_p_IDetector2D swig_types[22] +#define SWIGTYPE_p_IDetectorResolution swig_types[23] +#define SWIGTYPE_p_IFootprintFactor swig_types[24] +#define SWIGTYPE_p_IHistogram swig_types[25] +#define SWIGTYPE_p_IIntensityFunction swig_types[26] +#define SWIGTYPE_p_INode swig_types[27] +#define SWIGTYPE_p_INodeVisitor swig_types[28] +#define SWIGTYPE_p_IParametricComponent swig_types[29] +#define SWIGTYPE_p_IPixel swig_types[30] +#define SWIGTYPE_p_IRangedDistribution swig_types[31] +#define SWIGTYPE_p_IResolutionFunction2D swig_types[32] +#define SWIGTYPE_p_IShape2D swig_types[33] +#define SWIGTYPE_p_IUnitConverter swig_types[34] +#define SWIGTYPE_p_IVarianceFunction swig_types[35] #define SWIGTYPE_p_IntensityDataIOFactory swig_types[36] #define SWIGTYPE_p_IntensityFunctionLog swig_types[37] #define SWIGTYPE_p_IntensityFunctionSqrt swig_types[38] @@ -6728,7 +6728,6 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_double_Sc_double_Sg__Sg__insert__SWIG_ #include "Device/Histo/SimulationResult.h" #include "Device/Instrument/ChiSquaredModule.h" #include "Device/Instrument/IChiSquaredModule.h" -#include "Device/Instrument/Instrument.h" #include "Device/Instrument/IntensityDataFunctions.h" #include "Device/Instrument/PyArrayImportUtils.h" #include "Device/Instrument/SpectrumUtils.h" @@ -30575,19 +30574,16 @@ SWIGINTERN PyObject *_wrap_new_Beam__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_s PyObject *resultobj = 0; double arg1 ; double arg2 ; - double arg3 ; - double arg4 ; + Direction *arg3 = 0 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; Beam *result = 0 ; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Beam" "', argument " "1"" of type '" "double""'"); @@ -30598,17 +30594,15 @@ SWIGINTERN PyObject *_wrap_new_Beam__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_s SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Beam" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Beam" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Beam" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - result = (Beam *)new Beam(arg1,arg2,arg3,arg4); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Direction, 0 | 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Beam" "', argument " "3"" of type '" "Direction const &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Beam" "', argument " "3"" of type '" "Direction const &""'"); + } + arg3 = reinterpret_cast< Direction * >(argp3); + result = (Beam *)new Beam(arg1,arg2,(Direction const &)*arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, SWIG_POINTER_NEW | 0 ); return resultobj; fail: @@ -30642,11 +30636,11 @@ fail: SWIGINTERN PyObject *_wrap_new_Beam(PyObject *self, PyObject *args) { Py_ssize_t argc; - PyObject *argv[5] = { + PyObject *argv[4] = { 0 }; - if (!(argc = SWIG_Python_UnpackTuple(args, "new_Beam", 0, 4, argv))) SWIG_fail; + if (!(argc = SWIG_Python_UnpackTuple(args, "new_Beam", 0, 3, argv))) SWIG_fail; --argc; if (argc == 1) { int _v; @@ -30656,7 +30650,7 @@ SWIGINTERN PyObject *_wrap_new_Beam(PyObject *self, PyObject *args) { return _wrap_new_Beam__SWIG_1(self, argc, argv); } } - if (argc == 4) { + if (argc == 3) { int _v; { int res = SWIG_AsVal_double(argv[0], NULL); @@ -30668,18 +30662,10 @@ SWIGINTERN PyObject *_wrap_new_Beam(PyObject *self, PyObject *args) { _v = SWIG_CheckState(res); } if (_v) { - { - int res = SWIG_AsVal_double(argv[2], NULL); - _v = SWIG_CheckState(res); - } + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_Direction, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); if (_v) { - { - int res = SWIG_AsVal_double(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Beam__SWIG_0(self, argc, argv); - } + return _wrap_new_Beam__SWIG_0(self, argc, argv); } } } @@ -30688,7 +30674,7 @@ SWIGINTERN PyObject *_wrap_new_Beam(PyObject *self, PyObject *args) { fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Beam'.\n" " Possible C/C++ prototypes are:\n" - " Beam::Beam(double,double,double,double)\n" + " Beam::Beam(double,double,Direction const &)\n" " Beam::Beam(Beam const &)\n"); return 0; } @@ -30729,75 +30715,82 @@ fail: } -SWIGINTERN PyObject *_wrap_Beam_getCentralK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Beam *arg1 = (Beam *) 0 ; + INodeVisitor *arg2 = (INodeVisitor *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "Beam_accept", 2, 2, swig_obj)) 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 '" "Beam_accept" "', argument " "1"" of type '" "Beam const *""'"); + } + arg1 = reinterpret_cast< Beam * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_INodeVisitor, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_accept" "', argument " "2"" of type '" "INodeVisitor *""'"); + } + arg2 = reinterpret_cast< INodeVisitor * >(argp2); + ((Beam const *)arg1)->accept(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Beam_getChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - kvector_t result; + SwigValueWrapper< std::vector< INode const *,std::allocator< INode const * > > > result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_getCentralK" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_getChildren" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = ((Beam const *)arg1)->getCentralK(); - resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); + result = ((Beam const *)arg1)->getChildren(); + resultobj = SWIG_NewPointerObj((new std::vector< INode const *,std::allocator< INode const * > >(static_cast< const std::vector< INode const *,std::allocator< INode const * > >& >(result))), SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_setCentralK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_intensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - double arg2 ; - double arg3 ; - double arg4 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; + PyObject *swig_obj[1] ; + double result; - if (!SWIG_Python_UnpackTuple(args, "Beam_setCentralK", 4, 4, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setCentralK" "', argument " "1"" of type '" "Beam *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_intensity" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setCentralK" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Beam_setCentralK" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Beam_setCentralK" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - (arg1)->setCentralK(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); + result = (double)((Beam const *)arg1)->intensity(); + resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_getIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_wavelength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; void *argp1 = 0 ; @@ -30809,10 +30802,10 @@ SWIGINTERN PyObject *_wrap_Beam_getIntensity(PyObject *SWIGUNUSEDPARM(self), PyO swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_getIntensity" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_wavelength" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = (double)((Beam const *)arg1)->getIntensity(); + result = (double)((Beam const *)arg1)->wavelength(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -30820,149 +30813,120 @@ fail: } -SWIGINTERN PyObject *_wrap_Beam_setIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_direction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + Direction result; - if (!SWIG_Python_UnpackTuple(args, "Beam_setIntensity", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setIntensity" "', argument " "1"" of type '" "Beam *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_direction" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setIntensity" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->setIntensity(arg2); - resultobj = SWIG_Py_Void(); + result = ((Beam const *)arg1)->direction(); + resultobj = SWIG_NewPointerObj((new Direction(static_cast< const Direction& >(result))), SWIGTYPE_p_Direction, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_footprintFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_getCentralK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - IFootprintFactor *result = 0 ; + kvector_t result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_footprintFactor" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_getCentralK" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = (IFootprintFactor *)((Beam const *)arg1)->footprintFactor(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IFootprintFactor, 0 | 0 ); + result = ((Beam const *)arg1)->getCentralK(); + resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_setFootprintFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_getBlochVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - IFootprintFactor *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + kvector_t result; - if (!SWIG_Python_UnpackTuple(args, "Beam_setFootprintFactor", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setFootprintFactor" "', argument " "1"" of type '" "Beam *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_getBlochVector" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IFootprintFactor, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_setFootprintFactor" "', argument " "2"" of type '" "IFootprintFactor const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Beam_setFootprintFactor" "', argument " "2"" of type '" "IFootprintFactor const &""'"); - } - arg2 = reinterpret_cast< IFootprintFactor * >(argp2); - (arg1)->setFootprintFactor((IFootprintFactor const &)*arg2); - resultobj = SWIG_Py_Void(); + result = ((Beam const *)arg1)->getBlochVector(); + resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_setWidthRatio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_footprintFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + IFootprintFactor *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "Beam_setWidthRatio", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setWidthRatio" "', argument " "1"" of type '" "Beam *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_footprintFactor" "', argument " "1"" of type '" "Beam const *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setWidthRatio" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->setWidthRatio(arg2); - resultobj = SWIG_Py_Void(); + result = (IFootprintFactor *)((Beam const *)arg1)->footprintFactor(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IFootprintFactor, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_setPolarization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setWavelength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - kvector_t arg2 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + double val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; - if (!SWIG_Python_UnpackTuple(args, "Beam_setPolarization", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "Beam_setWavelength", 2, 2, swig_obj)) 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 '" "Beam_setPolarization" "', argument " "1"" of type '" "Beam *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setWavelength" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_setPolarization" "', argument " "2"" of type '" "kvector_t const""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Beam_setPolarization" "', argument " "2"" of type '" "kvector_t const""'"); - } else { - kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->setPolarization(arg2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setWavelength" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setWavelength(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -30970,120 +30934,150 @@ fail: } -SWIGINTERN PyObject *_wrap_Beam_getBlochVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setDirection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; + Direction *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - kvector_t result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "Beam_setDirection", 2, 2, swig_obj)) 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 '" "Beam_getBlochVector" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setDirection" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = ((Beam const *)arg1)->getBlochVector(); - resultobj = SWIG_NewPointerObj((new kvector_t(static_cast< const kvector_t& >(result))), SWIGTYPE_p_BasicVector3DT_double_t, SWIG_POINTER_OWN | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Direction, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_setDirection" "', argument " "2"" of type '" "Direction const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Beam_setDirection" "', argument " "2"" of type '" "Direction const &""'"); + } + arg2 = reinterpret_cast< Direction * >(argp2); + (arg1)->setDirection((Direction const &)*arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_getWavelength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setInclination(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "Beam_setInclination", 2, 2, swig_obj)) 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 '" "Beam_getWavelength" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setInclination" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = (double)((Beam const *)arg1)->getWavelength(); - resultobj = SWIG_From_double(static_cast< double >(result)); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setInclination" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setInclination(arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_getAlpha(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "Beam_setIntensity", 2, 2, swig_obj)) 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 '" "Beam_getAlpha" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setIntensity" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = (double)((Beam const *)arg1)->getAlpha(); - resultobj = SWIG_From_double(static_cast< double >(result)); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setIntensity" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setIntensity(arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_getPhi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setFootprintFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; + IFootprintFactor *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "Beam_setFootprintFactor", 2, 2, swig_obj)) 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 '" "Beam_getPhi" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setFootprintFactor" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = (double)((Beam const *)arg1)->getPhi(); - resultobj = SWIG_From_double(static_cast< double >(result)); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IFootprintFactor, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_setFootprintFactor" "', argument " "2"" of type '" "IFootprintFactor const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Beam_setFootprintFactor" "', argument " "2"" of type '" "IFootprintFactor const &""'"); + } + arg2 = reinterpret_cast< IFootprintFactor * >(argp2); + (arg1)->setFootprintFactor((IFootprintFactor const &)*arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_Beam_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setWidthRatio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; - INodeVisitor *arg2 = (INodeVisitor *) 0 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + double val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; - if (!SWIG_Python_UnpackTuple(args, "Beam_accept", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "Beam_setWidthRatio", 2, 2, swig_obj)) 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 '" "Beam_accept" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setWidthRatio" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_INodeVisitor, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_accept" "', argument " "2"" of type '" "INodeVisitor *""'"); - } - arg2 = reinterpret_cast< INodeVisitor * >(argp2); - ((Beam const *)arg1)->accept(arg2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Beam_setWidthRatio" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setWidthRatio(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -31091,23 +31085,37 @@ fail: } -SWIGINTERN PyObject *_wrap_Beam_getChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Beam_setPolarization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Beam *arg1 = (Beam *) 0 ; + kvector_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - SwigValueWrapper< std::vector< INode const *,std::allocator< INode const * > > > result; + void *argp2 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "Beam_setPolarization", 2, 2, swig_obj)) 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 '" "Beam_getChildren" "', argument " "1"" of type '" "Beam const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_setPolarization" "', argument " "1"" of type '" "Beam *""'"); } arg1 = reinterpret_cast< Beam * >(argp1); - result = ((Beam const *)arg1)->getChildren(); - resultobj = SWIG_NewPointerObj((new std::vector< INode const *,std::allocator< INode const * > >(static_cast< const std::vector< INode const *,std::allocator< INode const * > >& >(result))), SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t, SWIG_POINTER_OWN | 0 ); + { + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Beam_setPolarization" "', argument " "2"" of type '" "kvector_t const""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Beam_setPolarization" "', argument " "2"" of type '" "kvector_t const""'"); + } else { + kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } + } + (arg1)->setPolarization(arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; @@ -35126,846 +35134,6 @@ SWIGINTERN PyObject *ChiSquaredModule_swiginit(PyObject *SWIGUNUSEDPARM(self), P return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_Instrument__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { - PyObject *resultobj = 0; - Instrument *result = 0 ; - - if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; - result = (Instrument *)new Instrument(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Instrument, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Instrument__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - Instrument *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Instrument, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Instrument" "', argument " "1"" of type '" "Instrument const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Instrument" "', argument " "1"" of type '" "Instrument const &""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (Instrument *)new Instrument((Instrument const &)*arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Instrument, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Instrument(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_Instrument", 0, 1, argv))) SWIG_fail; - --argc; - if (argc == 0) { - return _wrap_new_Instrument__SWIG_0(self, argc, argv); - } - if (argc == 1) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_Instrument, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Instrument__SWIG_1(self, argc, argv); - } - } - -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(Instrument const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Instrument(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Instrument" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - INodeVisitor *arg2 = (INodeVisitor *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_accept", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_accept" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_INodeVisitor, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_accept" "', argument " "2"" of type '" "INodeVisitor *""'"); - } - arg2 = reinterpret_cast< INodeVisitor * >(argp2); - ((Instrument const *)arg1)->accept(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_beam__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - Beam *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_beam" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (Beam *) &(arg1)->beam(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_beam__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - Beam *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_beam" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (Beam *) &((Instrument const *)arg1)->beam(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_beam(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "Instrument_beam", 0, 1, argv))) SWIG_fail; - --argc; - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_beam__SWIG_0(self, argc, argv); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_beam__SWIG_1(self, argc, argv); - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Instrument_beam'.\n" - " Possible C/C++ prototypes are:\n" - " Instrument::beam()\n" - " Instrument::beam() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setBeam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - Beam *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setBeam", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setBeam" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Beam, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_setBeam" "', argument " "2"" of type '" "Beam const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Instrument_setBeam" "', argument " "2"" of type '" "Beam const &""'"); - } - arg2 = reinterpret_cast< Beam * >(argp2); - (arg1)->setBeam((Beam const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setBeamParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - double arg2 ; - double arg3 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setBeamParameters", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setBeamParameters" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Instrument_setBeamParameters" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Instrument_setBeamParameters" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Instrument_setBeamParameters" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - (arg1)->setBeamParameters(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setBeamIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setBeamIntensity", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setBeamIntensity" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Instrument_setBeamIntensity" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->setBeamIntensity(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setBeamPolarization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - kvector_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setBeamPolarization", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setBeamPolarization" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_setBeamPolarization" "', argument " "2"" of type '" "kvector_t const""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Instrument_setBeamPolarization" "', argument " "2"" of type '" "kvector_t const""'"); - } else { - kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->setBeamPolarization(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getBeamIntensity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getBeamIntensity" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (double)((Instrument const *)arg1)->getBeamIntensity(); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getDetector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - IDetector *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getDetector" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (IDetector *)((Instrument const *)arg1)->getDetector(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - IDetector *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_detector" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (IDetector *) &(arg1)->detector(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - IDetector *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_detector" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (IDetector *) &((Instrument const *)arg1)->detector(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "Instrument_detector", 0, 1, argv))) SWIG_fail; - --argc; - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_detector__SWIG_0(self, argc, argv); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_detector__SWIG_1(self, argc, argv); - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Instrument_detector'.\n" - " Possible C/C++ prototypes are:\n" - " Instrument::detector()\n" - " Instrument::detector() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector2D__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - IDetector2D *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_detector2D" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (IDetector2D *) &(arg1)->detector2D(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector2D, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector2D__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - IDetector2D *result = 0 ; - - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_detector2D" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (IDetector2D *) &((Instrument const *)arg1)->detector2D(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetector2D, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_detector2D(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "Instrument_detector2D", 0, 1, argv))) SWIG_fail; - --argc; - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_detector2D__SWIG_0(self, argc, argv); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Instrument, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Instrument_detector2D__SWIG_1(self, argc, argv); - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Instrument_detector2D'.\n" - " Possible C/C++ prototypes are:\n" - " Instrument::detector2D()\n" - " Instrument::detector2D() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getDetectorMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - DetectorMask *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getDetectorMask" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = (DetectorMask *)((Instrument const *)arg1)->getDetectorMask(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DetectorMask, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getDetectorAxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - IAxis *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_getDetectorAxis", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getDetectorAxis" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Instrument_getDetectorAxis" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (IAxis *) &((Instrument const *)arg1)->getDetectorAxis(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IAxis, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getDetectorDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getDetectorDimension" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = ((Instrument const *)arg1)->getDetectorDimension(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setDetector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - IDetector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setDetector", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setDetector" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IDetector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_setDetector" "', argument " "2"" of type '" "IDetector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Instrument_setDetector" "', argument " "2"" of type '" "IDetector const &""'"); - } - arg2 = reinterpret_cast< IDetector * >(argp2); - (arg1)->setDetector((IDetector const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setDetectorResolutionFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - IResolutionFunction2D *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setDetectorResolutionFunction", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setDetectorResolutionFunction" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IResolutionFunction2D, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_setDetectorResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Instrument_setDetectorResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); - } - arg2 = reinterpret_cast< IResolutionFunction2D * >(argp2); - (arg1)->setDetectorResolutionFunction((IResolutionFunction2D const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_removeDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_removeDetectorResolution" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - (arg1)->removeDetectorResolution(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_setAnalyzerProperties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - kvector_t arg2 ; - double arg3 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - double val3 ; - int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_setAnalyzerProperties", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_setAnalyzerProperties" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Instrument_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); - } else { - kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Instrument_setAnalyzerProperties" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Instrument_setAnalyzerProperties" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - (arg1)->setAnalyzerProperties(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_applyDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - OutputData< double > *arg2 = (OutputData< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "Instrument_applyDetectorResolution", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_applyDetectorResolution" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_OutputDataT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Instrument_applyDetectorResolution" "', argument " "2"" of type '" "OutputData< double > *""'"); - } - arg2 = reinterpret_cast< OutputData< double > * >(argp2); - ((Instrument const *)arg1)->applyDetectorResolution(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_initDetector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_initDetector" "', argument " "1"" of type '" "Instrument *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - (arg1)->initDetector(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Instrument_getChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Instrument *arg1 = (Instrument *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - SwigValueWrapper< std::vector< INode const *,std::allocator< INode const * > > > result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Instrument, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Instrument_getChildren" "', argument " "1"" of type '" "Instrument const *""'"); - } - arg1 = reinterpret_cast< Instrument * >(argp1); - result = ((Instrument const *)arg1)->getChildren(); - resultobj = SWIG_NewPointerObj((new std::vector< INode const *,std::allocator< INode const * > >(static_cast< const std::vector< INode const *,std::allocator< INode const * > >& >(result))), SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Instrument_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Instrument, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *Instrument_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - SWIGINTERN PyObject *_wrap_RelativeDifference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; SimulationResult *arg1 = 0 ; @@ -37881,28 +37049,6 @@ fail: } -SWIGINTERN PyObject *_wrap_DetectorMask_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DetectorMask *arg1 = (DetectorMask *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DetectorMask, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DetectorMask_removeMasks" "', argument " "1"" of type '" "DetectorMask *""'"); - } - arg1 = reinterpret_cast< DetectorMask * >(argp1); - (arg1)->removeMasks(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_DetectorMask_hasMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DetectorMask *arg1 = (DetectorMask *) 0 ; @@ -38155,114 +37301,139 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector_axis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_setAnalyzerProperties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - size_t arg2 ; + kvector_t arg2 ; + double arg3 ; + double arg4 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - IAxis *result = 0 ; + void *argp2 ; + int res2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; - if (!SWIG_Python_UnpackTuple(args, "IDetector_axis", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "IDetector_setAnalyzerProperties", 4, 4, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_axis" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setAnalyzerProperties" "', argument " "1"" of type '" "IDetector *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDetector_axis" "', argument " "2"" of type '" "size_t""'"); + { + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); + } else { + kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } + } + ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_setAnalyzerProperties" "', argument " "3"" of type '" "double""'"); } - arg2 = static_cast< size_t >(val2); - result = (IAxis *) &((IDetector const *)arg1)->axis(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IAxis, 0 | 0 ); + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IDetector_setAnalyzerProperties" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + (arg1)->setAnalyzerProperties(arg2,arg3,arg4); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_dimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_setDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; + IDetectorResolution *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "IDetector_setDetectorResolution", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_dimension" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setDetectorResolution" "', argument " "1"" of type '" "IDetector *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - result = ((IDetector const *)arg1)->dimension(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IDetectorResolution, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setDetectorResolution" "', argument " "2"" of type '" "IDetectorResolution const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setDetectorResolution" "', argument " "2"" of type '" "IDetectorResolution const &""'"); + } + arg2 = reinterpret_cast< IDetectorResolution * >(argp2); + (arg1)->setDetectorResolution((IDetectorResolution const &)*arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_axisBinIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_setResolutionFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - size_t arg2 ; - size_t arg3 ; + IResolutionFunction2D *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - size_t result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!SWIG_Python_UnpackTuple(args, "IDetector_axisBinIndex", 3, 3, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "IDetector_setResolutionFunction", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_axisBinIndex" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setResolutionFunction" "', argument " "1"" of type '" "IDetector *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDetector_axisBinIndex" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_axisBinIndex" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = ((IDetector const *)arg1)->axisBinIndex(arg2,arg3); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IResolutionFunction2D, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); + } + arg2 = reinterpret_cast< IResolutionFunction2D * >(argp2); + (arg1)->setResolutionFunction((IResolutionFunction2D const &)*arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_totalSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_resetRegionOfInterest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - size_t result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_totalSize" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_resetRegionOfInterest" "', argument " "1"" of type '" "IDetector *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - result = ((IDetector const *)arg1)->totalSize(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + (arg1)->resetRegionOfInterest(); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; @@ -38292,52 +37463,66 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector_setAnalyzerProperties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_getChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - kvector_t arg2 ; - double arg3 ; - double arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::vector< INode const *,std::allocator< INode const * > > > result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_getChildren" "', argument " "1"" of type '" "IDetector const *""'"); + } + arg1 = reinterpret_cast< IDetector * >(argp1); + result = ((IDetector const *)arg1)->getChildren(); + resultobj = SWIG_NewPointerObj((new std::vector< INode const *,std::allocator< INode const * > >(static_cast< const std::vector< INode const *,std::allocator< INode const * > >& >(result))), SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IDetector_iterate__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + IDetector *arg1 = (IDetector *) 0 ; + std::function< void (IDetector::const_iterator) > arg2 ; + bool arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; - double val3 ; + bool val3 ; int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject *swig_obj[4] ; - if (!SWIG_Python_UnpackTuple(args, "IDetector_setAnalyzerProperties", 4, 4, swig_obj)) SWIG_fail; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setAnalyzerProperties" "', argument " "1"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_iterate" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_BasicVector3DT_double_t, 0 | 0); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setAnalyzerProperties" "', argument " "2"" of type '" "kvector_t const""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); } else { - kvector_t * temp = reinterpret_cast< kvector_t * >(argp2); + std::function< void (IDetector::const_iterator) > * temp = reinterpret_cast< std::function< void (IDetector::const_iterator) > * >(argp2); arg2 = *temp; if (SWIG_IsNewObj(res2)) delete temp; } } - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); + ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_setAnalyzerProperties" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IDetector_setAnalyzerProperties" "', argument " "4"" of type '" "double""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_iterate" "', argument " "3"" of type '" "bool""'"); } - arg4 = static_cast< double >(val4); - (arg1)->setAnalyzerProperties(arg2,arg3,arg4); + arg3 = static_cast< bool >(val3); + ((IDetector const *)arg1)->iterate(arg2,arg3); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -38345,31 +37530,35 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector_setDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_iterate__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - IDetectorResolution *arg2 = 0 ; + std::function< void (IDetector::const_iterator) > arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; + void *argp2 ; int res2 = 0 ; - PyObject *swig_obj[2] ; - if (!SWIG_Python_UnpackTuple(args, "IDetector_setDetectorResolution", 2, 2, swig_obj)) SWIG_fail; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setDetectorResolution" "', argument " "1"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_iterate" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IDetectorResolution, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setDetectorResolution" "', argument " "2"" of type '" "IDetectorResolution const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setDetectorResolution" "', argument " "2"" of type '" "IDetectorResolution const &""'"); + { + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); + } else { + std::function< void (IDetector::const_iterator) > * temp = reinterpret_cast< std::function< void (IDetector::const_iterator) > * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } } - arg2 = reinterpret_cast< IDetectorResolution * >(argp2); - (arg1)->setDetectorResolution((IDetectorResolution const &)*arg2); + ((IDetector const *)arg1)->iterate(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -38377,151 +37566,216 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector_setResolutionFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_iterate(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "IDetector_iterate", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_IDetector, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_IDetector_iterate__SWIG_1(self, argc, argv); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_IDetector, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_bool(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_IDetector_iterate__SWIG_0(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'IDetector_iterate'.\n" + " Possible C/C++ prototypes are:\n" + " IDetector::iterate(std::function< void (IDetector::const_iterator) >,bool) const\n" + " IDetector::iterate(std::function< void (IDetector::const_iterator) >) const\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_IDetector_axis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - IResolutionFunction2D *arg2 = 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; + IAxis *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "IDetector_setResolutionFunction", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "IDetector_axis", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_setResolutionFunction" "', argument " "1"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_axis" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IResolutionFunction2D, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_setResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_setResolutionFunction" "', argument " "2"" of type '" "IResolutionFunction2D const &""'"); - } - arg2 = reinterpret_cast< IResolutionFunction2D * >(argp2); - (arg1)->setResolutionFunction((IResolutionFunction2D const &)*arg2); - resultobj = SWIG_Py_Void(); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDetector_axis" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + result = (IAxis *) &((IDetector const *)arg1)->axis(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IAxis, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_applyDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_dimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; - OutputData< double > *arg2 = (OutputData< double > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + size_t result; - if (!SWIG_Python_UnpackTuple(args, "IDetector_applyDetectorResolution", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_applyDetectorResolution" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_dimension" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_OutputDataT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_applyDetectorResolution" "', argument " "2"" of type '" "OutputData< double > *""'"); - } - arg2 = reinterpret_cast< OutputData< double > * >(argp2); - ((IDetector const *)arg1)->applyDetectorResolution(arg2); - resultobj = SWIG_Py_Void(); + result = ((IDetector const *)arg1)->dimension(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_removeDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_axisBinIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; + size_t arg2 ; + size_t arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + size_t result; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "IDetector_axisBinIndex", 3, 3, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_removeDetectorResolution" "', argument " "1"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_axisBinIndex" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - (arg1)->removeDetectorResolution(); - resultobj = SWIG_Py_Void(); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDetector_axisBinIndex" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_axisBinIndex" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + result = ((IDetector const *)arg1)->axisBinIndex(arg2,arg3); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_detectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_totalSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - IDetectorResolution *result = 0 ; + size_t result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_detectorResolution" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_totalSize" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - result = (IDetectorResolution *)((IDetector const *)arg1)->detectorResolution(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetectorResolution, 0 | 0 ); + result = ((IDetector const *)arg1)->totalSize(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_regionOfInterest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_applyDetectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; + OutputData< double > *arg2 = (OutputData< double > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - RegionOfInterest *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "IDetector_applyDetectorResolution", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_regionOfInterest" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_applyDetectorResolution" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - result = (RegionOfInterest *)((IDetector const *)arg1)->regionOfInterest(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegionOfInterest, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_OutputDataT_double_t, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_applyDetectorResolution" "', argument " "2"" of type '" "OutputData< double > *""'"); + } + arg2 = reinterpret_cast< OutputData< double > * >(argp2); + ((IDetector const *)arg1)->applyDetectorResolution(arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_resetRegionOfInterest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_detectorResolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + IDetectorResolution *result = 0 ; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_resetRegionOfInterest" "', argument " "1"" of type '" "IDetector *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_detectorResolution" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - (arg1)->resetRegionOfInterest(); - resultobj = SWIG_Py_Void(); + result = (IDetectorResolution *)((IDetector const *)arg1)->detectorResolution(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IDetectorResolution, 0 | 0 ); return resultobj; fail: return NULL; @@ -38630,159 +37884,29 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector_getChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IDetector_regionOfInterest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector *arg1 = (IDetector *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - SwigValueWrapper< std::vector< INode const *,std::allocator< INode const * > > > result; + RegionOfInterest *result = 0 ; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_getChildren" "', argument " "1"" of type '" "IDetector const *""'"); - } - arg1 = reinterpret_cast< IDetector * >(argp1); - result = ((IDetector const *)arg1)->getChildren(); - resultobj = SWIG_NewPointerObj((new std::vector< INode const *,std::allocator< INode const * > >(static_cast< const std::vector< INode const *,std::allocator< INode const * > >& >(result))), SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDetector_iterate__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - IDetector *arg1 = (IDetector *) 0 ; - std::function< void (IDetector::const_iterator) > arg2 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_iterate" "', argument " "1"" of type '" "IDetector const *""'"); - } - arg1 = reinterpret_cast< IDetector * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); - } else { - std::function< void (IDetector::const_iterator) > * temp = reinterpret_cast< std::function< void (IDetector::const_iterator) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IDetector_iterate" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - ((IDetector const *)arg1)->iterate(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDetector_iterate__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - IDetector *arg1 = (IDetector *) 0 ; - std::function< void (IDetector::const_iterator) > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_iterate" "', argument " "1"" of type '" "IDetector const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_regionOfInterest" "', argument " "1"" of type '" "IDetector const *""'"); } arg1 = reinterpret_cast< IDetector * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IDetector_iterate" "', argument " "2"" of type '" "std::function< void (IDetector::const_iterator) >""'"); - } else { - std::function< void (IDetector::const_iterator) > * temp = reinterpret_cast< std::function< void (IDetector::const_iterator) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - ((IDetector const *)arg1)->iterate(arg2); - resultobj = SWIG_Py_Void(); + result = (RegionOfInterest *)((IDetector const *)arg1)->regionOfInterest(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegionOfInterest, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IDetector_iterate(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "IDetector_iterate", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_IDetector, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IDetector_iterate__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_IDetector, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IDetector_iterate__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'IDetector_iterate'.\n" - " Possible C/C++ prototypes are:\n" - " IDetector::iterate(std::function< void (IDetector::const_iterator) >,bool) const\n" - " IDetector::iterate(std::function< void (IDetector::const_iterator) >) const\n"); - return 0; -} - - SWIGINTERN PyObject *IDetector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -38904,28 +38028,6 @@ fail: } -SWIGINTERN PyObject *_wrap_IDetector2D_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - IDetector2D *arg1 = (IDetector2D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector2D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector2D_removeMasks" "', argument " "1"" of type '" "IDetector2D *""'"); - } - arg1 = reinterpret_cast< IDetector2D * >(argp1); - (arg1)->removeMasks(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_IDetector2D_detectorMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IDetector2D *arg1 = (IDetector2D *) 0 ; @@ -46696,7 +45798,7 @@ static PyMethodDef SwigMethods[] = { { "IntensityData_swigregister", IntensityData_swigregister, METH_O, NULL}, { "IntensityData_swiginit", IntensityData_swiginit, METH_VARARGS, NULL}, { "new_Beam", _wrap_new_Beam, METH_VARARGS, "\n" - "Beam(double wavelength, double alpha, double phi, double intensity)\n" + "Beam(double intensity, double wavelength, Direction const & direction)\n" "new_Beam(Beam other) -> Beam\n" "Beam::Beam(const Beam &other)\n" "\n" @@ -46707,6 +45809,33 @@ static PyMethodDef SwigMethods[] = { "\n" ""}, { "Beam_horizontalBeam", _wrap_Beam_horizontalBeam, METH_NOARGS, "Beam_horizontalBeam() -> Beam"}, + { "Beam_accept", _wrap_Beam_accept, METH_VARARGS, "\n" + "Beam_accept(Beam self, INodeVisitor * visitor)\n" + "void Beam::accept(INodeVisitor *visitor) const override\n" + "\n" + ""}, + { "Beam_getChildren", _wrap_Beam_getChildren, METH_O, "\n" + "Beam_getChildren(Beam self) -> std::vector< INode const *,std::allocator< INode const * > >\n" + "std::vector< const INode * > Beam::getChildren() const override\n" + "\n" + ""}, + { "Beam_intensity", _wrap_Beam_intensity, METH_O, "\n" + "Beam_intensity(Beam self) -> double\n" + "double Beam::intensity() const\n" + "\n" + "Returns the beam intensity in neutrons/sec. \n" + "\n" + ""}, + { "Beam_wavelength", _wrap_Beam_wavelength, METH_O, "\n" + "Beam_wavelength(Beam self) -> double\n" + "double Beam::wavelength() const\n" + "\n" + ""}, + { "Beam_direction", _wrap_Beam_direction, METH_O, "\n" + "Beam_direction(Beam self) -> Direction\n" + "Direction Beam::direction() const\n" + "\n" + ""}, { "Beam_getCentralK", _wrap_Beam_getCentralK, METH_O, "\n" "Beam_getCentralK(Beam self) -> kvector_t\n" "kvector_t Beam::getCentralK() const\n" @@ -46714,18 +45843,31 @@ static PyMethodDef SwigMethods[] = { "Returns the wavevector. \n" "\n" ""}, - { "Beam_setCentralK", _wrap_Beam_setCentralK, METH_VARARGS, "\n" - "Beam_setCentralK(Beam self, double wavelength, double alpha_i, double phi_i)\n" - "void Beam::setCentralK(double wavelength, double alpha_i, double phi_i)\n" + { "Beam_getBlochVector", _wrap_Beam_getBlochVector, METH_O, "\n" + "Beam_getBlochVector(Beam self) -> kvector_t\n" + "kvector_t Beam::getBlochVector() const\n" + "\n" + ""}, + { "Beam_footprintFactor", _wrap_Beam_footprintFactor, METH_O, "\n" + "Beam_footprintFactor(Beam self) -> IFootprintFactor\n" + "const IFootprintFactor * Beam::footprintFactor() const\n" + "\n" + "Returns footprint factor. \n" "\n" - "Sets the wavevector in terms of wavelength and incoming angles. \n" + ""}, + { "Beam_setWavelength", _wrap_Beam_setWavelength, METH_VARARGS, "\n" + "Beam_setWavelength(Beam self, double wavelength)\n" + "void Beam::setWavelength(double wavelength)\n" "\n" ""}, - { "Beam_getIntensity", _wrap_Beam_getIntensity, METH_O, "\n" - "Beam_getIntensity(Beam self) -> double\n" - "double Beam::getIntensity() const\n" + { "Beam_setDirection", _wrap_Beam_setDirection, METH_VARARGS, "\n" + "Beam_setDirection(Beam self, Direction const & direction)\n" + "void Beam::setDirection(const Direction &direction)\n" "\n" - "Returns the beam intensity in neutrons/sec. \n" + ""}, + { "Beam_setInclination", _wrap_Beam_setInclination, METH_VARARGS, "\n" + "Beam_setInclination(Beam self, double const alpha)\n" + "void Beam::setInclination(const double alpha)\n" "\n" ""}, { "Beam_setIntensity", _wrap_Beam_setIntensity, METH_VARARGS, "\n" @@ -46735,13 +45877,6 @@ static PyMethodDef SwigMethods[] = { "Sets the beam intensity in neutrons/sec. \n" "\n" ""}, - { "Beam_footprintFactor", _wrap_Beam_footprintFactor, METH_O, "\n" - "Beam_footprintFactor(Beam self) -> IFootprintFactor\n" - "const IFootprintFactor * Beam::footprintFactor() const\n" - "\n" - "Returns footprint factor. \n" - "\n" - ""}, { "Beam_setFootprintFactor", _wrap_Beam_setFootprintFactor, METH_VARARGS, "\n" "Beam_setFootprintFactor(Beam self, IFootprintFactor shape_factor)\n" "void Beam::setFootprintFactor(const IFootprintFactor &shape_factor)\n" @@ -46763,36 +45898,6 @@ static PyMethodDef SwigMethods[] = { "Sets the polarization density matrix according to the given Bloch vector. \n" "\n" ""}, - { "Beam_getBlochVector", _wrap_Beam_getBlochVector, METH_O, "\n" - "Beam_getBlochVector(Beam self) -> kvector_t\n" - "kvector_t Beam::getBlochVector() const\n" - "\n" - ""}, - { "Beam_getWavelength", _wrap_Beam_getWavelength, METH_O, "\n" - "Beam_getWavelength(Beam self) -> double\n" - "double Beam::getWavelength() const\n" - "\n" - ""}, - { "Beam_getAlpha", _wrap_Beam_getAlpha, METH_O, "\n" - "Beam_getAlpha(Beam self) -> double\n" - "double Beam::getAlpha() const\n" - "\n" - ""}, - { "Beam_getPhi", _wrap_Beam_getPhi, METH_O, "\n" - "Beam_getPhi(Beam self) -> double\n" - "double Beam::getPhi() const\n" - "\n" - ""}, - { "Beam_accept", _wrap_Beam_accept, METH_VARARGS, "\n" - "Beam_accept(Beam self, INodeVisitor * visitor)\n" - "void Beam::accept(INodeVisitor *visitor) const override\n" - "\n" - ""}, - { "Beam_getChildren", _wrap_Beam_getChildren, METH_O, "\n" - "Beam_getChildren(Beam self) -> std::vector< INode const *,std::allocator< INode const * > >\n" - "std::vector< const INode * > Beam::getChildren() const override\n" - "\n" - ""}, { "Beam_swigregister", Beam_swigregister, METH_O, NULL}, { "Beam_swiginit", Beam_swiginit, METH_VARARGS, NULL}, { "delete_IFootprintFactor", _wrap_delete_IFootprintFactor, METH_O, "\n" @@ -47364,138 +46469,6 @@ static PyMethodDef SwigMethods[] = { ""}, { "ChiSquaredModule_swigregister", ChiSquaredModule_swigregister, METH_O, NULL}, { "ChiSquaredModule_swiginit", ChiSquaredModule_swiginit, METH_VARARGS, NULL}, - { "new_Instrument", _wrap_new_Instrument, METH_VARARGS, "\n" - "Instrument()\n" - "new_Instrument(Instrument other) -> Instrument\n" - "Instrument::Instrument(const Instrument &other)\n" - "\n" - ""}, - { "delete_Instrument", _wrap_delete_Instrument, METH_O, "\n" - "delete_Instrument(Instrument self)\n" - "Instrument::~Instrument()\n" - "\n" - ""}, - { "Instrument_accept", _wrap_Instrument_accept, METH_VARARGS, "\n" - "Instrument_accept(Instrument self, INodeVisitor * visitor)\n" - "void Instrument::accept(INodeVisitor *visitor) const final\n" - "\n" - ""}, - { "Instrument_beam", _wrap_Instrument_beam, METH_VARARGS, "\n" - "Instrument_beam(Instrument self) -> Beam\n" - "Instrument_beam(Instrument self) -> Beam\n" - "const Beam& Instrument::beam() const\n" - "\n" - ""}, - { "Instrument_setBeam", _wrap_Instrument_setBeam, METH_VARARGS, "\n" - "Instrument_setBeam(Instrument self, Beam beam)\n" - "void Instrument::setBeam(const Beam &beam)\n" - "\n" - ""}, - { "Instrument_setBeamParameters", _wrap_Instrument_setBeamParameters, METH_VARARGS, "\n" - "Instrument_setBeamParameters(Instrument self, double wavelength, double alpha_i, double phi_i)\n" - "void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i)\n" - "\n" - "Sets the beam wavelength and incoming angles. \n" - "\n" - ""}, - { "Instrument_setBeamIntensity", _wrap_Instrument_setBeamIntensity, METH_VARARGS, "\n" - "Instrument_setBeamIntensity(Instrument self, double intensity)\n" - "void Instrument::setBeamIntensity(double intensity)\n" - "\n" - ""}, - { "Instrument_setBeamPolarization", _wrap_Instrument_setBeamPolarization, METH_VARARGS, "\n" - "Instrument_setBeamPolarization(Instrument self, kvector_t bloch_vector)\n" - "void Instrument::setBeamPolarization(const kvector_t bloch_vector)\n" - "\n" - "Sets the beam's polarization according to the given Bloch vector. \n" - "\n" - ""}, - { "Instrument_getBeamIntensity", _wrap_Instrument_getBeamIntensity, METH_O, "\n" - "Instrument_getBeamIntensity(Instrument self) -> double\n" - "double Instrument::getBeamIntensity() const\n" - "\n" - ""}, - { "Instrument_getDetector", _wrap_Instrument_getDetector, METH_O, "\n" - "Instrument_getDetector(Instrument self) -> IDetector\n" - "const IDetector * Instrument::getDetector() const\n" - "\n" - ""}, - { "Instrument_detector", _wrap_Instrument_detector, METH_VARARGS, "\n" - "Instrument_detector(Instrument self) -> IDetector\n" - "Instrument_detector(Instrument self) -> IDetector\n" - "const IDetector & Instrument::detector() const\n" - "\n" - ""}, - { "Instrument_detector2D", _wrap_Instrument_detector2D, METH_VARARGS, "\n" - "Instrument_detector2D(Instrument self) -> IDetector2D\n" - "Instrument_detector2D(Instrument self) -> IDetector2D\n" - "const IDetector2D & Instrument::detector2D() const\n" - "\n" - ""}, - { "Instrument_getDetectorMask", _wrap_Instrument_getDetectorMask, METH_O, "\n" - "Instrument_getDetectorMask(Instrument self) -> DetectorMask\n" - "const DetectorMask * Instrument::getDetectorMask() const\n" - "\n" - ""}, - { "Instrument_getDetectorAxis", _wrap_Instrument_getDetectorAxis, METH_VARARGS, "\n" - "Instrument_getDetectorAxis(Instrument self, size_t index) -> IAxis\n" - "const IAxis & Instrument::getDetectorAxis(size_t index) const\n" - "\n" - ""}, - { "Instrument_getDetectorDimension", _wrap_Instrument_getDetectorDimension, METH_O, "\n" - "Instrument_getDetectorDimension(Instrument self) -> size_t\n" - "size_t Instrument::getDetectorDimension() const\n" - "\n" - ""}, - { "Instrument_setDetector", _wrap_Instrument_setDetector, METH_VARARGS, "\n" - "Instrument_setDetector(Instrument self, IDetector detector)\n" - "void Instrument::setDetector(const IDetector &detector)\n" - "\n" - "Sets the detector (axes can be overwritten later) \n" - "\n" - ""}, - { "Instrument_setDetectorResolutionFunction", _wrap_Instrument_setDetectorResolutionFunction, METH_VARARGS, "\n" - "Instrument_setDetectorResolutionFunction(Instrument self, IResolutionFunction2D p_resolution_function)\n" - "void Instrument::setDetectorResolutionFunction(const IResolutionFunction2D &p_resolution_function)\n" - "\n" - "Sets detector resolution function. \n" - "\n" - ""}, - { "Instrument_removeDetectorResolution", _wrap_Instrument_removeDetectorResolution, METH_O, "\n" - "Instrument_removeDetectorResolution(Instrument self)\n" - "void Instrument::removeDetectorResolution()\n" - "\n" - "Removes detector resolution function. \n" - "\n" - ""}, - { "Instrument_setAnalyzerProperties", _wrap_Instrument_setAnalyzerProperties, METH_VARARGS, "\n" - "Instrument_setAnalyzerProperties(Instrument self, kvector_t direction, double efficiency, double total_transmission)\n" - "void Instrument::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)\n" - "\n" - "Sets the polarization analyzer characteristics of the detector. \n" - "\n" - ""}, - { "Instrument_applyDetectorResolution", _wrap_Instrument_applyDetectorResolution, METH_VARARGS, "\n" - "Instrument_applyDetectorResolution(Instrument self, IntensityData p_intensity_map)\n" - "void Instrument::applyDetectorResolution(OutputData< double > *p_intensity_map) const\n" - "\n" - "apply the detector resolution to the given intensity map \n" - "\n" - ""}, - { "Instrument_initDetector", _wrap_Instrument_initDetector, METH_O, "\n" - "Instrument_initDetector(Instrument self)\n" - "void Instrument::initDetector()\n" - "\n" - "init detector with beam settings \n" - "\n" - ""}, - { "Instrument_getChildren", _wrap_Instrument_getChildren, METH_O, "\n" - "Instrument_getChildren(Instrument self) -> std::vector< INode const *,std::allocator< INode const * > >\n" - "std::vector< const INode * > Instrument::getChildren() const\n" - "\n" - ""}, - { "Instrument_swigregister", Instrument_swigregister, METH_O, NULL}, - { "Instrument_swiginit", Instrument_swiginit, METH_VARARGS, NULL}, { "RelativeDifference", _wrap_RelativeDifference, METH_VARARGS, "\n" "RelativeDifference(SimulationResult dat, SimulationResult ref) -> double\n" "double IntensityDataFunctions::RelativeDifference(const SimulationResult &dat, const SimulationResult &ref)\n" @@ -47723,13 +46696,6 @@ static PyMethodDef SwigMethods[] = { "Histogram2D * DetectorMask::createHistogram() const\n" "\n" ""}, - { "DetectorMask_removeMasks", _wrap_DetectorMask_removeMasks, METH_O, "\n" - "DetectorMask_removeMasks(DetectorMask self)\n" - "void DetectorMask::removeMasks()\n" - "\n" - "remove all masks and return object to initial state \n" - "\n" - ""}, { "DetectorMask_hasMasks", _wrap_DetectorMask_hasMasks, METH_O, "\n" "DetectorMask_hasMasks(DetectorMask self) -> bool\n" "bool DetectorMask::hasMasks() const\n" @@ -47777,6 +46743,49 @@ static PyMethodDef SwigMethods[] = { "void IDetector::addAxis(const IAxis &axis)\n" "\n" ""}, + { "IDetector_setAnalyzerProperties", _wrap_IDetector_setAnalyzerProperties, METH_VARARGS, "\n" + "IDetector_setAnalyzerProperties(IDetector self, kvector_t direction, double efficiency, double total_transmission)\n" + "void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)\n" + "\n" + "Sets the polarization analyzer characteristics of the detector. \n" + "\n" + ""}, + { "IDetector_setDetectorResolution", _wrap_IDetector_setDetectorResolution, METH_VARARGS, "\n" + "IDetector_setDetectorResolution(IDetector self, IDetectorResolution p_detector_resolution)\n" + "void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution)\n" + "\n" + "Sets the detector resolution. \n" + "\n" + ""}, + { "IDetector_setResolutionFunction", _wrap_IDetector_setResolutionFunction, METH_VARARGS, "\n" + "IDetector_setResolutionFunction(IDetector self, IResolutionFunction2D resFunc)\n" + "void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc)\n" + "\n" + ""}, + { "IDetector_resetRegionOfInterest", _wrap_IDetector_resetRegionOfInterest, METH_O, "\n" + "IDetector_resetRegionOfInterest(IDetector self)\n" + "virtual void IDetector::resetRegionOfInterest()=0\n" + "\n" + "Resets region of interest making whole detector plane available for the simulation. \n" + "\n" + ""}, + { "IDetector_detectorMask", _wrap_IDetector_detectorMask, METH_O, "\n" + "IDetector_detectorMask(IDetector self) -> DetectorMask\n" + "virtual const DetectorMask* IDetector::detectorMask() const =0\n" + "\n" + "Returns detector masks container. \n" + "\n" + ""}, + { "IDetector_getChildren", _wrap_IDetector_getChildren, METH_O, "\n" + "IDetector_getChildren(IDetector self) -> std::vector< INode const *,std::allocator< INode const * > >\n" + "std::vector< const INode * > IDetector::getChildren() const override\n" + "\n" + ""}, + { "IDetector_iterate", _wrap_IDetector_iterate, METH_VARARGS, "\n" + "IDetector_iterate(IDetector self, std::function< void (IDetector::const_iterator) > func, bool visit_masks=False)\n" + "void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const\n" + "\n" + ""}, { "IDetector_axis", _wrap_IDetector_axis, METH_VARARGS, "\n" "IDetector_axis(IDetector self, size_t index) -> IAxis\n" "const IAxis & IDetector::axis(size_t index) const\n" @@ -47803,32 +46812,6 @@ static PyMethodDef SwigMethods[] = { "Returns total number of pixels. \n" "\n" ""}, - { "IDetector_detectorMask", _wrap_IDetector_detectorMask, METH_O, "\n" - "IDetector_detectorMask(IDetector self) -> DetectorMask\n" - "virtual const DetectorMask* IDetector::detectorMask() const =0\n" - "\n" - "Returns detector masks container. \n" - "\n" - ""}, - { "IDetector_setAnalyzerProperties", _wrap_IDetector_setAnalyzerProperties, METH_VARARGS, "\n" - "IDetector_setAnalyzerProperties(IDetector self, kvector_t direction, double efficiency, double total_transmission)\n" - "void IDetector::setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)\n" - "\n" - "Sets the polarization analyzer characteristics of the detector. \n" - "\n" - ""}, - { "IDetector_setDetectorResolution", _wrap_IDetector_setDetectorResolution, METH_VARARGS, "\n" - "IDetector_setDetectorResolution(IDetector self, IDetectorResolution p_detector_resolution)\n" - "void IDetector::setDetectorResolution(const IDetectorResolution &p_detector_resolution)\n" - "\n" - "Sets the detector resolution. \n" - "\n" - ""}, - { "IDetector_setResolutionFunction", _wrap_IDetector_setResolutionFunction, METH_VARARGS, "\n" - "IDetector_setResolutionFunction(IDetector self, IResolutionFunction2D resFunc)\n" - "void IDetector::setResolutionFunction(const IResolutionFunction2D &resFunc)\n" - "\n" - ""}, { "IDetector_applyDetectorResolution", _wrap_IDetector_applyDetectorResolution, METH_VARARGS, "\n" "IDetector_applyDetectorResolution(IDetector self, IntensityData p_intensity_map)\n" "void IDetector::applyDetectorResolution(OutputData< double > *p_intensity_map) const\n" @@ -47836,13 +46819,6 @@ static PyMethodDef SwigMethods[] = { "Applies the detector resolution to the given intensity maps. \n" "\n" ""}, - { "IDetector_removeDetectorResolution", _wrap_IDetector_removeDetectorResolution, METH_O, "\n" - "IDetector_removeDetectorResolution(IDetector self)\n" - "void IDetector::removeDetectorResolution()\n" - "\n" - "Removes detector resolution function. \n" - "\n" - ""}, { "IDetector_detectorResolution", _wrap_IDetector_detectorResolution, METH_O, "\n" "IDetector_detectorResolution(IDetector self) -> IDetectorResolution\n" "const IDetectorResolution * IDetector::detectorResolution() const\n" @@ -47850,20 +46826,6 @@ static PyMethodDef SwigMethods[] = { "Returns a pointer to detector resolution object. \n" "\n" ""}, - { "IDetector_regionOfInterest", _wrap_IDetector_regionOfInterest, METH_O, "\n" - "IDetector_regionOfInterest(IDetector self) -> RegionOfInterest const *\n" - "virtual const RegionOfInterest* IDetector::regionOfInterest() const =0\n" - "\n" - "Returns region of interest if exists. \n" - "\n" - ""}, - { "IDetector_resetRegionOfInterest", _wrap_IDetector_resetRegionOfInterest, METH_O, "\n" - "IDetector_resetRegionOfInterest(IDetector self)\n" - "virtual void IDetector::resetRegionOfInterest()=0\n" - "\n" - "Resets region of interest making whole detector plane available for the simulation. \n" - "\n" - ""}, { "IDetector_detectionProperties", _wrap_IDetector_detectionProperties, METH_O, "\n" "IDetector_detectionProperties(IDetector self) -> DetectionProperties const &\n" "const DetectionProperties& IDetector::detectionProperties() const\n" @@ -47892,14 +46854,11 @@ static PyMethodDef SwigMethods[] = { "Returns number of simulation elements. \n" "\n" ""}, - { "IDetector_getChildren", _wrap_IDetector_getChildren, METH_O, "\n" - "IDetector_getChildren(IDetector self) -> std::vector< INode const *,std::allocator< INode const * > >\n" - "std::vector< const INode * > IDetector::getChildren() const override\n" + { "IDetector_regionOfInterest", _wrap_IDetector_regionOfInterest, METH_O, "\n" + "IDetector_regionOfInterest(IDetector self) -> RegionOfInterest const *\n" + "virtual const RegionOfInterest* IDetector::regionOfInterest() const =0\n" "\n" - ""}, - { "IDetector_iterate", _wrap_IDetector_iterate, METH_VARARGS, "\n" - "IDetector_iterate(IDetector self, std::function< void (IDetector::const_iterator) > func, bool visit_masks=False)\n" - "void IDetector::iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const\n" + "Returns region of interest if exists. \n" "\n" ""}, { "IDetector_swigregister", IDetector_swigregister, METH_O, NULL}, @@ -47920,13 +46879,6 @@ static PyMethodDef SwigMethods[] = { "Sets detector parameters using angle ranges. \n" "\n" ""}, - { "IDetector2D_removeMasks", _wrap_IDetector2D_removeMasks, METH_O, "\n" - "IDetector2D_removeMasks(IDetector2D self)\n" - "void IDetector2D::removeMasks()\n" - "\n" - "Removes all masks from the detector. \n" - "\n" - ""}, { "IDetector2D_detectorMask", _wrap_IDetector2D_detectorMask, METH_O, "\n" "IDetector2D_detectorMask(IDetector2D self) -> DetectorMask\n" "const DetectorMask * IDetector2D::detectorMask() const override\n" @@ -48646,7 +47598,7 @@ static PyMethodDef SwigMethods[] = { "new_IntensityDataIOFactory() -> IntensityDataIOFactory\n" "\n" "\n" - "Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends woth \"*.gz\" or \"*.bz2\" the file will be zipped on the fly using appropriate algorithm.\n" + "Provides users with possibility to read and write IntensityData from/to files in different format. Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends with \"*.gz\" or \"*.bz2\" the file will be zipped on the fly using appropriate algorithm.\n" "\n" "Usage:\n" "\n" @@ -48830,9 +47782,6 @@ static void *_p_FootprintSquareTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory static void *_p_IDetectorResolutionTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) ((IDetectorResolution *) x)); } -static void *_p_InstrumentTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((INode *) ((Instrument *) x)); -} static void *_p_IFootprintFactorTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((INode *) ((IFootprintFactor *) x)); } @@ -48926,12 +47875,12 @@ static void *_p_ResolutionFunction2DGaussianTo_p_IParametricComponent(void *x, i static void *_p_IFootprintFactorTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IParametricComponent *) (INode *) ((IFootprintFactor *) x)); } -static void *_p_InstrumentTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((IParametricComponent *) (INode *) ((Instrument *) x)); -} static void *_p_BeamTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IParametricComponent *) (INode *) ((Beam *) x)); } +static void *_p_IsGISAXSDetectorTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((IParametricComponent *) (INode *)(IDetector *)(IDetector2D *)(SphericalDetector *) ((IsGISAXSDetector *) x)); +} static void *_p_SphericalDetectorTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IParametricComponent *) (INode *)(IDetector *)(IDetector2D *) ((SphericalDetector *) x)); } @@ -48941,9 +47890,6 @@ static void *_p_RectangularDetectorTo_p_IParametricComponent(void *x, int *SWIGU static void *_p_IDetectorTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IParametricComponent *) (INode *) ((IDetector *) x)); } -static void *_p_IsGISAXSDetectorTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((IParametricComponent *) (INode *)(IDetector *)(IDetector2D *)(SphericalDetector *) ((IsGISAXSDetector *) x)); -} static void *_p_ParameterDistributionTo_p_IParametricComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IParametricComponent *) ((ParameterDistribution *) x)); } @@ -48974,21 +47920,18 @@ static void *_p_ResolutionFunction2DGaussianTo_p_IComponent(void *x, int *SWIGUN static void *_p_IFootprintFactorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IComponent *) (IParametricComponent *)(INode *) ((IFootprintFactor *) x)); } -static void *_p_InstrumentTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((IComponent *) (IParametricComponent *)(INode *) ((Instrument *) x)); -} static void *_p_BeamTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IComponent *) (IParametricComponent *)(INode *) ((Beam *) x)); } +static void *_p_SphericalDetectorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((IComponent *) (IParametricComponent *)(INode *)(IDetector *)(IDetector2D *) ((SphericalDetector *) x)); +} static void *_p_RectangularDetectorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IComponent *) (IParametricComponent *)(INode *)(IDetector *)(IDetector2D *) ((RectangularDetector *) x)); } static void *_p_IDetectorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IComponent *) (IParametricComponent *)(INode *) ((IDetector *) x)); } -static void *_p_SphericalDetectorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((IComponent *) (IParametricComponent *)(INode *)(IDetector *)(IDetector2D *) ((SphericalDetector *) x)); -} static void *_p_IsGISAXSDetectorTo_p_IComponent(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((IComponent *) (IParametricComponent *)(INode *)(IDetector *)(IDetector2D *)(SphericalDetector *) ((IsGISAXSDetector *) x)); } @@ -49029,6 +47972,7 @@ static swig_type_info _swigt__p_Bin1D = {"_p_Bin1D", "Bin1D *", 0, 0, (void*)0, static swig_type_info _swigt__p_ChiSquaredModule = {"_p_ChiSquaredModule", "ChiSquaredModule *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DetectionProperties = {"_p_DetectionProperties", "DetectionProperties *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DetectorMask = {"_p_DetectorMask", "DetectorMask *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Direction = {"_p_Direction", "Direction *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Ellipse = {"_p_Ellipse", "Ellipse *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FootprintGauss = {"_p_FootprintGauss", "FootprintGauss *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FootprintSquare = {"_p_FootprintSquare", "FootprintSquare *", 0, 0, (void*)0, 0}; @@ -49056,7 +48000,6 @@ static swig_type_info _swigt__p_IResolutionFunction2D = {"_p_IResolutionFunction static swig_type_info _swigt__p_IShape2D = {"_p_IShape2D", "IShape2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IUnitConverter = {"_p_IUnitConverter", "IUnitConverter *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IVarianceFunction = {"_p_IVarianceFunction", "IVarianceFunction *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Instrument = {"_p_Instrument", "Instrument *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IntensityDataIOFactory = {"_p_IntensityDataIOFactory", "IntensityDataIOFactory *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IntensityFunctionLog = {"_p_IntensityFunctionLog", "IntensityFunctionLog *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_IntensityFunctionSqrt = {"_p_IntensityFunctionSqrt", "IntensityFunctionSqrt *", 0, 0, (void*)0, 0}; @@ -49151,6 +48094,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_ChiSquaredModule, &_swigt__p_DetectionProperties, &_swigt__p_DetectorMask, + &_swigt__p_Direction, &_swigt__p_Ellipse, &_swigt__p_FootprintGauss, &_swigt__p_FootprintSquare, @@ -49176,7 +48120,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_IShape2D, &_swigt__p_IUnitConverter, &_swigt__p_IVarianceFunction, - &_swigt__p_Instrument, &_swigt__p_IntensityDataIOFactory, &_swigt__p_IntensityFunctionLog, &_swigt__p_IntensityFunctionSqrt, @@ -49273,6 +48216,7 @@ static swig_cast_info _swigc__p_Bin1D[] = { {&_swigt__p_Bin1D, 0, 0, 0},{0, 0, static swig_cast_info _swigc__p_ChiSquaredModule[] = { {&_swigt__p_ChiSquaredModule, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DetectionProperties[] = { {&_swigt__p_DetectionProperties, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DetectorMask[] = { {&_swigt__p_DetectorMask, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Direction[] = { {&_swigt__p_Direction, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Ellipse[] = { {&_swigt__p_Ellipse, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FootprintGauss[] = { {&_swigt__p_FootprintGauss, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FootprintSquare[] = { {&_swigt__p_FootprintSquare, 0, 0, 0},{0, 0, 0, 0}}; @@ -49284,23 +48228,22 @@ static swig_cast_info _swigc__p_IChiSquaredModule[] = { {&_swigt__p_IChiSquared static swig_cast_info _swigc__p_ParameterPool[] = {{&_swigt__p_ParameterPool, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ICloneable[] = { {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_ICloneable, 0, 0}, {&_swigt__p_ScanResolution, _p_ScanResolutionTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Line, _p_LineTo_p_ICloneable, 0, 0}, {&_swigt__p_ICloneable, 0, 0, 0}, {&_swigt__p_Rectangle, _p_RectangleTo_p_ICloneable, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_ICloneable, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_ICloneable, 0, 0}, {&_swigt__p_IShape2D, _p_IShape2DTo_p_ICloneable, 0, 0}, {&_swigt__p_Ellipse, _p_EllipseTo_p_ICloneable, 0, 0}, {&_swigt__p_ParameterPool, _p_ParameterPoolTo_p_ICloneable, 0, 0}, {&_swigt__p_HorizontalLine, _p_HorizontalLineTo_p_ICloneable, 0, 0}, {&_swigt__p_VerticalLine, _p_VerticalLineTo_p_ICloneable, 0, 0}, {&_swigt__p_IChiSquaredModule, _p_IChiSquaredModuleTo_p_ICloneable, 0, 0}, {&_swigt__p_ChiSquaredModule, _p_ChiSquaredModuleTo_p_ICloneable, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_ICloneable, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_ICloneable, 0, 0}, {&_swigt__p_Polygon, _p_PolygonTo_p_ICloneable, 0, 0}, {&_swigt__p_IUnitConverter, _p_IUnitConverterTo_p_ICloneable, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_ICloneable, 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_IComponent[] = { {&_swigt__p_Beam, _p_BeamTo_p_IComponent, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IComponent, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_IComponent, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_IComponent, 0, 0}, {&_swigt__p_IParametricComponent, _p_IParametricComponentTo_p_IComponent, 0, 0}, {&_swigt__p_IComponent, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IComponent, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_IComponent, 0, 0}, {&_swigt__p_Instrument, _p_InstrumentTo_p_IComponent, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IComponent, 0, 0}, {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IComponent, 0, 0}, {&_swigt__p_INode, _p_INodeTo_p_IComponent, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_IComponent, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IComponent[] = { {&_swigt__p_Beam, _p_BeamTo_p_IComponent, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IComponent, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_IComponent, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_IComponent, 0, 0}, {&_swigt__p_IParametricComponent, _p_IParametricComponentTo_p_IComponent, 0, 0}, {&_swigt__p_IComponent, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IComponent, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_IComponent, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IComponent, 0, 0}, {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IComponent, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IComponent, 0, 0}, {&_swigt__p_INode, _p_INodeTo_p_IComponent, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_IComponent, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDetector[] = { {&_swigt__p_IDetector, 0, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IDetector, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IDetector, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IDetector, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_IDetector, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDetector2D[] = { {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IDetector2D, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IDetector2D, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IDetector2D, 0, 0}, {&_swigt__p_IDetector2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IDetectorResolution[] = { {&_swigt__p_IDetectorResolution, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IFootprintFactor[] = { {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IFootprintFactor, 0, 0}, {&_swigt__p_IFootprintFactor, 0, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IFootprintFactor, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IHistogram[] = { {&_swigt__p_IHistogram, 0, 0, 0}, {&_swigt__p_Histogram2D, _p_Histogram2DTo_p_IHistogram, 0, 0}, {&_swigt__p_Histogram1D, _p_Histogram1DTo_p_IHistogram, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IIntensityFunction[] = { {&_swigt__p_IntensityFunctionSqrt, _p_IntensityFunctionSqrtTo_p_IIntensityFunction, 0, 0}, {&_swigt__p_IIntensityFunction, 0, 0, 0}, {&_swigt__p_IntensityFunctionLog, _p_IntensityFunctionLogTo_p_IIntensityFunction, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_INode[] = { {&_swigt__p_Beam, _p_BeamTo_p_INode, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_INode, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_INode, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_INode, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_INode, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_INode, 0, 0}, {&_swigt__p_Instrument, _p_InstrumentTo_p_INode, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_INode, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_INode, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_INode, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_INode, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_INode, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_INode, 0, 0}, {&_swigt__p_INode, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_INode[] = { {&_swigt__p_INode, 0, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_INode, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_INode, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_INode, 0, 0}, {&_swigt__p_Beam, _p_BeamTo_p_INode, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_INode, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_INode, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_INode, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_INode, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_INode, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_INode, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_INode, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_INode, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_INodeVisitor[] = { {&_swigt__p_INodeVisitor, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_IParametricComponent[] = { {&_swigt__p_Beam, _p_BeamTo_p_IParametricComponent, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IParametricComponent, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_Instrument, _p_InstrumentTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IParametricComponent, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IParametricComponent, 0, 0}, {&_swigt__p_INode, _p_INodeTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_IParametricComponent, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IParametricComponent[] = { {&_swigt__p_Beam, _p_BeamTo_p_IParametricComponent, 0, 0}, {&_swigt__p_FootprintGauss, _p_FootprintGaussTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetectorResolution, _p_IDetectorResolutionTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetector2D, _p_IDetector2DTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IParametricComponent, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IFootprintFactor, _p_IFootprintFactorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IDetector, _p_IDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IsGISAXSDetector, _p_IsGISAXSDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_SphericalDetector, _p_SphericalDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_RectangularDetector, _p_RectangularDetectorTo_p_IParametricComponent, 0, 0}, {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IParametricComponent, 0, 0}, {&_swigt__p_FootprintSquare, _p_FootprintSquareTo_p_IParametricComponent, 0, 0}, {&_swigt__p_INode, _p_INodeTo_p_IParametricComponent, 0, 0}, {&_swigt__p_IResolutionFunction2D, _p_IResolutionFunction2DTo_p_IParametricComponent, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IPixel[] = { {&_swigt__p_IPixel, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IRangedDistribution[] = { {&_swigt__p_IRangedDistribution, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IResolutionFunction2D[] = { {&_swigt__p_IResolutionFunction2D, 0, 0, 0}, {&_swigt__p_ResolutionFunction2DGaussian, _p_ResolutionFunction2DGaussianTo_p_IResolutionFunction2D, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IShape2D[] = { {&_swigt__p_Polygon, _p_PolygonTo_p_IShape2D, 0, 0}, {&_swigt__p_Line, _p_LineTo_p_IShape2D, 0, 0}, {&_swigt__p_VerticalLine, _p_VerticalLineTo_p_IShape2D, 0, 0}, {&_swigt__p_Ellipse, _p_EllipseTo_p_IShape2D, 0, 0}, {&_swigt__p_HorizontalLine, _p_HorizontalLineTo_p_IShape2D, 0, 0}, {&_swigt__p_Rectangle, _p_RectangleTo_p_IShape2D, 0, 0}, {&_swigt__p_IShape2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IUnitConverter[] = { {&_swigt__p_IUnitConverter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IVarianceFunction[] = { {&_swigt__p_IVarianceFunction, 0, 0, 0}, {&_swigt__p_VarianceConstantFunction, _p_VarianceConstantFunctionTo_p_IVarianceFunction, 0, 0}, {&_swigt__p_VarianceSimFunction, _p_VarianceSimFunctionTo_p_IVarianceFunction, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Instrument[] = { {&_swigt__p_Instrument, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IntensityDataIOFactory[] = { {&_swigt__p_IntensityDataIOFactory, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IntensityFunctionLog[] = { {&_swigt__p_IntensityFunctionLog, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_IntensityFunctionSqrt[] = { {&_swigt__p_IntensityFunctionSqrt, 0, 0, 0},{0, 0, 0, 0}}; @@ -49395,6 +48338,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_ChiSquaredModule, _swigc__p_DetectionProperties, _swigc__p_DetectorMask, + _swigc__p_Direction, _swigc__p_Ellipse, _swigc__p_FootprintGauss, _swigc__p_FootprintSquare, @@ -49420,7 +48364,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_IShape2D, _swigc__p_IUnitConverter, _swigc__p_IVarianceFunction, - _swigc__p_Instrument, _swigc__p_IntensityDataIOFactory, _swigc__p_IntensityFunctionLog, _swigc__p_IntensityFunctionSqrt, diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py index 4f0714d42cf1f153385660f94d853b5d784efab7..fdbdd51b1e11202bd84c6e045e438a5eef0b6eb2 100644 --- a/auto/Wrap/libBornAgainSample.py +++ b/auto/Wrap/libBornAgainSample.py @@ -2985,13 +2985,13 @@ class WavevectorInfo(object): """ return _libBornAgainSample.WavevectorInfo_getQ(self) - def getWavelength(self): + def wavelength(self): r""" - getWavelength(WavevectorInfo self) -> double - double WavevectorInfo::getWavelength() const + wavelength(WavevectorInfo self) -> double + double WavevectorInfo::wavelength() const """ - return _libBornAgainSample.WavevectorInfo_getWavelength(self) + return _libBornAgainSample.WavevectorInfo_wavelength(self) __swig_destroy__ = _libBornAgainSample.delete_WavevectorInfo # Register WavevectorInfo in _libBornAgainSample: diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp index ac52181900573aa4b57b8de8b732d742e78ea35c..53071a0b3fb570f28157af990b8903e60825cd04 100644 --- a/auto/Wrap/libBornAgainSample_wrap.cpp +++ b/auto/Wrap/libBornAgainSample_wrap.cpp @@ -37784,7 +37784,7 @@ fail: } -SWIGINTERN PyObject *_wrap_WavevectorInfo_getWavelength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_WavevectorInfo_wavelength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; WavevectorInfo *arg1 = (WavevectorInfo *) 0 ; void *argp1 = 0 ; @@ -37796,10 +37796,10 @@ SWIGINTERN PyObject *_wrap_WavevectorInfo_getWavelength(PyObject *SWIGUNUSEDPARM swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_WavevectorInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WavevectorInfo_getWavelength" "', argument " "1"" of type '" "WavevectorInfo const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WavevectorInfo_wavelength" "', argument " "1"" of type '" "WavevectorInfo const *""'"); } arg1 = reinterpret_cast< WavevectorInfo * >(argp1); - result = (double)((WavevectorInfo const *)arg1)->getWavelength(); + result = (double)((WavevectorInfo const *)arg1)->wavelength(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -70399,9 +70399,9 @@ static PyMethodDef SwigMethods[] = { "cvector_t WavevectorInfo::getQ() const\n" "\n" ""}, - { "WavevectorInfo_getWavelength", _wrap_WavevectorInfo_getWavelength, METH_O, "\n" - "WavevectorInfo_getWavelength(WavevectorInfo self) -> double\n" - "double WavevectorInfo::getWavelength() const\n" + { "WavevectorInfo_wavelength", _wrap_WavevectorInfo_wavelength, METH_O, "\n" + "WavevectorInfo_wavelength(WavevectorInfo self) -> double\n" + "double WavevectorInfo::wavelength() const\n" "\n" ""}, { "delete_WavevectorInfo", _wrap_delete_WavevectorInfo, METH_O, "delete_WavevectorInfo(WavevectorInfo self)"}, diff --git a/cmake/BornAgain/Directories.cmake b/cmake/BornAgain/Directories.cmake index cdf0e39f7cfc7937bbe5b91948e83fe8ed76614a..bc51aee1ac7b5e6402f5d24a561f18837b737bec 100644 --- a/cmake/BornAgain/Directories.cmake +++ b/cmake/BornAgain/Directories.cmake @@ -3,6 +3,7 @@ # ----------------------------------------------------------------------------- set(WRAP_DIR ${CMAKE_SOURCE_DIR}/Wrap) +set(SWIG_DIR ${WRAP_DIR}/Swig) set(PY_EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/Examples/Python) set(TEST_REFERENCE_DIR ${CMAKE_SOURCE_DIR}/Tests/ReferenceData) diff --git a/cmake/BornAgain/SwigLib.cmake b/cmake/BornAgain/SwigLib.cmake index b1816f28dd82988d3e3583a4f1102034c42d0f03..f83a942e54c7c53b1b81eb561962d069f6fc274b 100644 --- a/cmake/BornAgain/SwigLib.cmake +++ b/cmake/BornAgain/SwigLib.cmake @@ -10,14 +10,14 @@ function(SwigLib name lib TMP_DIR) file(MAKE_DIRECTORY ${TMP_DIR}) - GeneratePythonDocs(${AUTO_DIR}/doxygen${name}.i ${WRAP_DIR}/swig) + GeneratePythonDocs(${AUTO_DIR}/doxygen${name}.i ${SWIG_DIR}) set(swig_dependencies - ${WRAP_DIR}/swig/lib${lib}.i - ${WRAP_DIR}/swig/deprecation.i - ${WRAP_DIR}/swig/warnings.i - ${WRAP_DIR}/swig/ignoreBase.i - ${WRAP_DIR}/swig/ignoreSample.i + ${SWIG_DIR}/lib${lib}.i + ${SWIG_DIR}/deprecation.i + ${SWIG_DIR}/warnings.i + ${SWIG_DIR}/ignoreBase.i + ${SWIG_DIR}/ignoreSample.i ) foreach(FNAM ${swig_dependencies}) if(NOT EXISTS ${FNAM}) @@ -35,7 +35,7 @@ function(SwigLib name lib TMP_DIR) add_custom_command( OUTPUT ${AUTO_DIR}/lib${lib}.py - COMMAND ${Python3_EXECUTABLE} ${WRAP_DIR}/swig/tweaks.py + COMMAND ${Python3_EXECUTABLE} ${SWIG_DIR}/tweaks.py ${TMP_DIR}/lib${lib}.py ${AUTO_DIR}/lib${lib}.py DEPENDS ${TMP_DIR}/lib${lib}.py @@ -44,7 +44,7 @@ function(SwigLib name lib TMP_DIR) OUTPUT ${TMP_DIR}/lib${lib}.py ${AUTO_DIR}/lib${lib}_wrap.h ${AUTO_DIR}/lib${lib}_wrap.cpp - COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} ${WRAP_DIR}/swig/lib${lib}.i + COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} ${SWIG_DIR}/lib${lib}.i DEPENDS ${swig_dependencies} ${include_files} ) diff --git a/cmake/configurables/BABuild.h.in b/cmake/configurables/BABuild.h.in index b2df56676f9de602e5b2c3d54bd192211e021edd..84f0817ddb5fb44cec6aecf501d90cbdf4959d5a 100644 --- a/cmake/configurables/BABuild.h.in +++ b/cmake/configurables/BABuild.h.in @@ -18,58 +18,45 @@ #include <string> -namespace BABuild -{ +namespace BABuild { -inline std::string cmakeBinaryDir() -{ +inline std::string cmakeBinaryDir() { return "@CMAKE_BINARY_DIR@"; } -inline std::string buildLibDir() -{ +inline std::string buildLibDir() { return "@CMAKE_BINARY_DIR@/lib"; } -inline std::string buildBinDir() -{ +inline std::string buildBinDir() { return "@CMAKE_BINARY_DIR@/bin"; } //! Methods to access info about Python used during the build. -inline std::string pythonExecutable() -{ +inline std::string pythonExecutable() { return "@Python3_EXECUTABLE@"; } -inline std::string pythonInterpreterID() -{ +inline std::string pythonInterpreterID() { return "@Python3_INTERPRETER_ID@"; } -inline std::string pythonVersionString() -{ +inline std::string pythonVersionString() { return "@Python3_VERSION@"; } -inline std::string pythonLibraries() -{ +inline std::string pythonLibraries() { return "@Python3_LIBRARIES@"; } -inline std::string pythonStdLib() -{ +inline std::string pythonStdLib() { return "@Python3_STDLIB@"; } -inline std::string pythonIncludeDirs() -{ +inline std::string pythonIncludeDirs() { return "@Python3_INCLUDE_DIRS@"; } -inline std::string numpyIncludeDir() -{ +inline std::string numpyIncludeDir() { return "@Python3_NumPy_INCLUDE_DIRS@"; } -inline std::string numpyVersionString() -{ +inline std::string numpyVersionString() { return "@Python3_NumPy_VERSION@"; } -inline std::string pythonSiteLib() -{ +inline std::string pythonSiteLib() { return "@Python3_SITELIB@"; } } // namespace BABuild diff --git a/cmake/configurables/BATesting.h.in b/cmake/configurables/BATesting.h.in index 0c2ae154fb4f6e08e711266266610f5a28fed22e..dd027a1184531325c0be59b2e094fe19695ca234 100644 --- a/cmake/configurables/BATesting.h.in +++ b/cmake/configurables/BATesting.h.in @@ -21,32 +21,25 @@ //! Containts methods to retrieve build time information to run functional tests. //! Automatically generated by CMake from BATesting.h.in -namespace BATesting -{ +namespace BATesting { -inline std::string ReferenceDir_Std() -{ +inline std::string ReferenceDir_Std() { return "@TEST_REFERENCE_DIR_STD@"; } -inline std::string ReferenceDir_Core() -{ +inline std::string ReferenceDir_Core() { return "@TEST_REFERENCE_DIR_CORE@"; } -inline std::string TestOutDir() -{ +inline std::string TestOutDir() { return "@TEST_OUTPUT_DIR@"; } -inline std::string TestOutDir_Std() -{ +inline std::string TestOutDir_Std() { return "@TEST_OUTPUT_DIR_STD@"; } -inline std::string TestOutDir_Core() -{ +inline std::string TestOutDir_Core() { return "@TEST_OUTPUT_DIR_CORE@"; } -inline std::string TestOutDir_PyStd() -{ +inline std::string TestOutDir_PyStd() { return "@TEST_OUTPUT_DIR_PY_STD@"; } diff --git a/cmake/configurables/BAVersion.h.in b/cmake/configurables/BAVersion.h.in index 75a8b4c3b5998b86bc0abad9f297bd9b94c812a2..1e580a5354ebbe7df16ebf12a6d8c141ed4ea280 100644 --- a/cmake/configurables/BAVersion.h.in +++ b/cmake/configurables/BAVersion.h.in @@ -19,31 +19,25 @@ #include <sstream> #include <string> -namespace BornAgain -{ +namespace BornAgain { const int major_version_number = @BornAgain_VERSION_MAJOR@; const int minor_version_number = @BornAgain_VERSION_MINOR@; const int patch_version_number = @BornAgain_VERSION_PATCH@; -inline int GetMajorVersionNumber() -{ +inline int GetMajorVersionNumber() { return major_version_number; } -inline int GetMinorVersionNumber() -{ +inline int GetMinorVersionNumber() { return minor_version_number; } -inline int GetPatchVersionNumber() -{ +inline int GetPatchVersionNumber() { return patch_version_number; } -inline std::string GetName() -{ +inline std::string GetName() { return std::string("BornAgain"); } -inline std::string GetVersionNumber() -{ +inline std::string GetVersionNumber() { std::ostringstream ostr; ostr << major_version_number << "." << minor_version_number << "." << patch_version_number; diff --git a/devtools/architecture/Lattice.md b/devtools/architecture/Lattice.md new file mode 100644 index 0000000000000000000000000000000000000000..41910b4fd557a578ce2cf6f0dafff62580c8815f --- /dev/null +++ b/devtools/architecture/Lattice.md @@ -0,0 +1,12 @@ +## Lattices + +Typical sample construction with a 3d lattice: +``` + lattice = ba.FCCLattice(30*nm).transformed(rot.getTransform3D()) + peak_shape = ba.MisesFisherGaussPeakShape(peak_intensity, peak_width, zenith, kappa, kappa2) + iff = ba.InterferenceFunction3DLattice(lattice) + iff.setPositionVariance(1.) + iff.setPeakShape(peak_shape) +``` + +`bake::FCCLattice` returns a `Lattice3d` with an fcc primitive cell. diff --git a/devtools/code-tools/normalize-usercode.py b/devtools/code-tools/normalize-usercode.py index b4d103809c118efb4216ec4cf8eb0c33ff70f6b1..c427a89801fe1296ef2e20c71a4c86a676f3a95b 100755 --- a/devtools/code-tools/normalize-usercode.py +++ b/devtools/code-tools/normalize-usercode.py @@ -2,6 +2,9 @@ """ Reads a BornAgain simulation script, and converts into normal form. +Does not touch function get_sample, for which there is the dedicated +script normalize-getsample.py. + Export to normal form is done by BornAgain's ExportToPython function. """ @@ -10,34 +13,28 @@ from yapf.yapflib.yapf_api import FormatCode import bornagain as ba -def substitute_sample(ti, tc): +def restitute_sample(ti, tc): """ - Returns script ti, except for the get_sample function which is taken from script tc. + Returns script tc, except for the get_sample function which is taken from script ti. """ pat = re.compile( - r'(\ndef get_sample\(.+?:\n)(\s*""".+?"""\n)?\n*(((\s{4}.*?)?\n)+?\n)(\w|$)', + r'((\ndef get_sample\(.+?:\n)(\s*""".+?"""\n)?\n*(((\s{4}.*?)?\n)+?\n)(\w|$))', flags=re.S) mi = re.search(pat, ti) if not mi: raise Exception("Input code has no function get_sample") - header = mi.group(1) + header = mi.group(2) mn = re.search(pat, tc) if not mn: raise Exception("Normalized code has no function get_sample") - if mn.group(1) != header: - raise Exception( - f'Signature of function get_sample has changed from "{header}" to "{mn.group(1)}"' - ) - - if mi.group(2): - header += mi.group(2) + '\n' + if mn.group(2) != header: + print(f'WARNING: Signature of function get_sample has changed from "{header}" to ' + f'"{mn.group(2)}"') - t = re.sub(pat, header + mn.group(3) + mi.group(6), ti) + t = re.sub(pat, mi.group(1), tc) - t = re.sub(r'\nfrom bornagain import.+', - '\nfrom bornagain import angstrom, deg, nm, nm2, kvector_t', t) return t @@ -60,12 +57,18 @@ def cycle_text(ti, fname): def normalize_text(ti, fname): - tc = cycle_text(ti, fname) + filecomment = "" + m = re.match(r'""".*?"""\n', ti, flags=re.S) + if m: + filecomment = m.group(0) + + tc = filecomment + cycle_text(ti, fname) + if verbose: print( f'.. cycled through BA, {len(ti.split())} -> {len(tc.split())} lines' ) - tf = substitute_sample(ti, tc) + tf = restitute_sample(ti, tc) if verbose: print(f'.. normalized, {len(ti.split())} -> {len(tf.split())} lines') # YAPF formatting