From 0b396b2463278832c0caa4632e4b249d573e9378 Mon Sep 17 00:00:00 2001
From: pospelov <pospelov@fz-juelich.de>
Date: Sat, 6 Apr 2013 14:56:32 +0200
Subject: [PATCH] All functional tests *Python, C++) are restored

---
 Core/PythonAPI/inc/FormFactorCrystal.pypp.h   |  11 +
 .../inc/FormFactorSphereGaussianRadius.pypp.h |  11 +
 .../PythonAPI/inc/IFormFactorDecorator.pypp.h |  11 +
 Core/PythonAPI/inc/MesoCrystal.pypp.h         |  11 +
 Core/PythonAPI/inc/PythonCoreList.h           |   1 +
 Core/PythonAPI/inc/SimpleSelectionRule.pypp.h |  11 +
 Core/PythonAPI/src/FormFactorCrystal.pypp.cpp | 467 ++++++++++++++++++
 .../FormFactorDecoratorDebyeWaller.pypp.cpp   |  95 +++-
 .../FormFactorSphereGaussianRadius.pypp.cpp   | 467 ++++++++++++++++++
 .../src/IFormFactorDecorator.pypp.cpp         | 418 ++++++++++++++++
 Core/PythonAPI/src/MesoCrystal.pypp.cpp       | 324 ++++++++++++
 .../PythonInterface_free_functions.pypp.cpp   |  11 +
 Core/PythonAPI/src/PythonModule.cpp           |  10 +
 .../src/SimpleSelectionRule.pypp.cpp          |  91 ++++
 Core/python_module.pri                        |  10 +
 Macros/BoostPythonGenerator/InstallPyCore.py  |   3 +-
 Macros/BoostPythonGenerator/InstallPyFit.py   |   3 +-
 Macros/BoostPythonGenerator/MakePyCore.py     |  18 +-
 Macros/BoostPythonGenerator/codegenerator.py  |   6 +-
 .../FunctionalTests/TestPyCore/isgisaxs09.py  |   5 +-
 .../TestPyCore/mesocrystal1.py                |   4 +-
 21 files changed, 1971 insertions(+), 17 deletions(-)
 create mode 100644 Core/PythonAPI/inc/FormFactorCrystal.pypp.h
 create mode 100644 Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
 create mode 100644 Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
 create mode 100644 Core/PythonAPI/inc/MesoCrystal.pypp.h
 create mode 100644 Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
 create mode 100644 Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
 create mode 100644 Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
 create mode 100644 Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
 create mode 100644 Core/PythonAPI/src/MesoCrystal.pypp.cpp
 create mode 100644 Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp

diff --git a/Core/PythonAPI/inc/FormFactorCrystal.pypp.h b/Core/PythonAPI/inc/FormFactorCrystal.pypp.h
new file mode 100644
index 00000000000..67ebb1157cd
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorCrystal.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorCrystal_hpp__pyplusplus_wrapper
+#define FormFactorCrystal_hpp__pyplusplus_wrapper
+
+void register_FormFactorCrystal_class();
+
+#endif//FormFactorCrystal_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h b/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
new file mode 100644
index 00000000000..63a9fffacb3
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorSphereGaussianRadius_hpp__pyplusplus_wrapper
+#define FormFactorSphereGaussianRadius_hpp__pyplusplus_wrapper
+
+void register_FormFactorSphereGaussianRadius_class();
+
+#endif//FormFactorSphereGaussianRadius_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h b/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
new file mode 100644
index 00000000000..5d1324ce162
--- /dev/null
+++ b/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef IFormFactorDecorator_hpp__pyplusplus_wrapper
+#define IFormFactorDecorator_hpp__pyplusplus_wrapper
+
+void register_IFormFactorDecorator_class();
+
+#endif//IFormFactorDecorator_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/MesoCrystal.pypp.h b/Core/PythonAPI/inc/MesoCrystal.pypp.h
new file mode 100644
index 00000000000..0feefbcd001
--- /dev/null
+++ b/Core/PythonAPI/inc/MesoCrystal.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef MesoCrystal_hpp__pyplusplus_wrapper
+#define MesoCrystal_hpp__pyplusplus_wrapper
+
+void register_MesoCrystal_class();
+
+#endif//MesoCrystal_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/PythonCoreList.h b/Core/PythonAPI/inc/PythonCoreList.h
index 3b6d80b631c..db28eea6eae 100644
--- a/Core/PythonAPI/inc/PythonCoreList.h
+++ b/Core/PythonAPI/inc/PythonCoreList.h
@@ -55,6 +55,7 @@
 #include "Layer.h"
 #include "LayerDecorator.h"
 #include "LayerRoughness.h"
+#include "MathFunctions.h"
 #include "MaterialManager.h"
 #include "MesoCrystal.h"
 #include "MultiLayer.h"
diff --git a/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h b/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
new file mode 100644
index 00000000000..9b2457cf858
--- /dev/null
+++ b/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef SimpleSelectionRule_hpp__pyplusplus_wrapper
+#define SimpleSelectionRule_hpp__pyplusplus_wrapper
+
+void register_SimpleSelectionRule_class();
+
+#endif//SimpleSelectionRule_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp b/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
new file mode 100644
index 00000000000..69b827c9c17
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
@@ -0,0 +1,467 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorCrystal.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorCrystal_wrapper : FormFactorCrystal, bp::wrapper< FormFactorCrystal > {
+
+    FormFactorCrystal_wrapper(::Crystal const & p_crystal, ::IFormFactor const & meso_crystal_form_factor, ::complex_t const & ambient_refractive_index )
+    : FormFactorCrystal( boost::ref(p_crystal), boost::ref(meso_crystal_form_factor), boost::ref(ambient_refractive_index) )
+      , bp::wrapper< FormFactorCrystal >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorCrystal * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorCrystal::clone(  );
+        }
+    }
+    
+    ::FormFactorCrystal * default_clone(  ) const  {
+        return FormFactorCrystal::clone( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->FormFactorCrystal::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return FormFactorCrystal::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
+        if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
+            return func_evaluate_for_q( boost::ref(q) );
+        else{
+            return this->FormFactorCrystal::evaluate_for_q( boost::ref(q) );
+        }
+    }
+    
+    ::complex_t default_evaluate_for_q( ::cvector_t const & q ) const  {
+        return FormFactorCrystal::evaluate_for_q( boost::ref(q) );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->FormFactorCrystal::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return FormFactorCrystal::getVolume( );
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->FormFactorCrystal::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        FormFactorCrystal::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->IFormFactor::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return IFormFactor::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->IFormFactor::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return IFormFactor::getNumberOfStochasticParameters( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorCrystal_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorCrystal_class(){
+
+    { //::FormFactorCrystal
+        typedef bp::class_< FormFactorCrystal_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorCrystal_exposer_t;
+        FormFactorCrystal_exposer_t FormFactorCrystal_exposer = FormFactorCrystal_exposer_t( "FormFactorCrystal", bp::init< Crystal const &, IFormFactor const &, complex_t const & >(( bp::arg("p_crystal"), bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )) );
+        bp::scope FormFactorCrystal_scope( FormFactorCrystal_exposer );
+        { //::FormFactorCrystal::clone
+        
+            typedef ::FormFactorCrystal * ( ::FormFactorCrystal::*clone_function_type )(  ) const;
+            typedef ::FormFactorCrystal * ( FormFactorCrystal_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorCrystal::clone)
+                , default_clone_function_type(&FormFactorCrystal_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorCrystal::evaluate
+        
+            typedef ::complex_t ( ::FormFactorCrystal::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorCrystal_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::FormFactorCrystal::evaluate)
+                , default_evaluate_function_type(&FormFactorCrystal_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::FormFactorCrystal::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorCrystal::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorCrystal_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorCrystal::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorCrystal_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorCrystal::getVolume
+        
+            typedef double ( ::FormFactorCrystal::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::FormFactorCrystal::getVolume)
+                , default_getVolume_function_type(&FormFactorCrystal_wrapper::default_getVolume) );
+        
+        }
+        { //::FormFactorCrystal::setAmbientRefractiveIndex
+        
+            typedef void ( ::FormFactorCrystal::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::FormFactorCrystal::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorCrystal_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorCrystal_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorCrystal_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&FormFactorCrystal_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorCrystal_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorCrystal_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorCrystal_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorCrystal_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorCrystal_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp b/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
index 2f89635f132..db7a0dc0967 100644
--- a/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
@@ -121,6 +121,42 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
         return ISample::getCompositeSample( );
     }
 
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->IFormFactorDecorator::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return IFormFactorDecorator::getHeight( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactorDecorator::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactorDecorator::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorDecorator::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorDecorator::getVolume( );
+    }
+
     virtual bool isDistributedFormFactor(  ) const  {
         if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
             return func_isDistributedFormFactor(  );
@@ -164,6 +200,18 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
         }
     }
 
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactorDecorator::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactorDecorator::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
     virtual bool setParameterValue( ::std::string const & name, double value ) {
         if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
             return func_setParameterValue( name, value );
@@ -193,7 +241,7 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
 void register_FormFactorDecoratorDebyeWaller_class(){
 
     { //::FormFactorDecoratorDebyeWaller
-        typedef bp::class_< FormFactorDecoratorDebyeWaller_wrapper, boost::noncopyable > FormFactorDecoratorDebyeWaller_exposer_t;
+        typedef bp::class_< FormFactorDecoratorDebyeWaller_wrapper, bp::bases< IFormFactorDecorator >, boost::noncopyable > FormFactorDecoratorDebyeWaller_exposer_t;
         FormFactorDecoratorDebyeWaller_exposer_t FormFactorDecoratorDebyeWaller_exposer = FormFactorDecoratorDebyeWaller_exposer_t( "FormFactorDecoratorDebyeWaller", bp::init< IFormFactor const &, double, double >(( bp::arg("p_form_factor"), bp::arg("dw_h_factor"), bp::arg("dw_r_factor") )) );
         bp::scope FormFactorDecoratorDebyeWaller_scope( FormFactorDecoratorDebyeWaller_exposer );
         { //::FormFactorDecoratorDebyeWaller::clone
@@ -289,6 +337,39 @@ void register_FormFactorDecoratorDebyeWaller_class(){
                 , default_getCompositeSample_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getCompositeSample)
                 , bp::return_value_policy< bp::reference_existing_object >() );
         
+        }
+        { //::IFormFactorDecorator::getHeight
+        
+            typedef double ( ::IFormFactorDecorator::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactorDecorator::getHeight)
+                , default_getHeight_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactorDecorator::getRadius
+        
+            typedef double ( ::IFormFactorDecorator::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactorDecorator::getRadius)
+                , default_getRadius_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorDecorator::getVolume
+        
+            typedef double ( ::IFormFactorDecorator::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorDecorator::getVolume)
+                , default_getVolume_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getVolume) );
+        
         }
         { //::IFormFactor::isDistributedFormFactor
         
@@ -321,6 +402,18 @@ void register_FormFactorDecoratorDebyeWaller_class(){
                 , default_registerParameter_function_type( &FormFactorDecoratorDebyeWaller_wrapper::default_registerParameter )
                 , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
         
+        }
+        { //::IFormFactorDecorator::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactorDecorator::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactorDecorator::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
         }
         { //::IParameterized::setParameterValue
         
diff --git a/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp b/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
new file mode 100644
index 00000000000..a6355deec27
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
@@ -0,0 +1,467 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorSphereGaussianRadius.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorSphereGaussianRadius_wrapper : FormFactorSphereGaussianRadius, bp::wrapper< FormFactorSphereGaussianRadius > {
+
+    FormFactorSphereGaussianRadius_wrapper(double mean, double sigma )
+    : FormFactorSphereGaussianRadius( mean, sigma )
+      , bp::wrapper< FormFactorSphereGaussianRadius >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorSphereGaussianRadius * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorSphereGaussianRadius::clone(  );
+        }
+    }
+    
+    ::FormFactorSphereGaussianRadius * default_clone(  ) const  {
+        return FormFactorSphereGaussianRadius::clone( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->FormFactorSphereGaussianRadius::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        FormFactorSphereGaussianRadius::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
+        if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
+            return func_evaluate_for_q( boost::ref(q) );
+        else{
+            return this->FormFactorSphereGaussianRadius::evaluate_for_q( boost::ref(q) );
+        }
+    }
+    
+    ::complex_t default_evaluate_for_q( ::cvector_t const & q ) const  {
+        return FormFactorSphereGaussianRadius::evaluate_for_q( boost::ref(q) );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorSphereGaussianRadius::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorSphereGaussianRadius::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorSphereGaussianRadius::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorSphereGaussianRadius::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->FormFactorSphereGaussianRadius::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return FormFactorSphereGaussianRadius::isDistributedFormFactor( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorSphereGaussianRadius_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorSphereGaussianRadius_class(){
+
+    { //::FormFactorSphereGaussianRadius
+        typedef bp::class_< FormFactorSphereGaussianRadius_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorSphereGaussianRadius_exposer_t;
+        FormFactorSphereGaussianRadius_exposer_t FormFactorSphereGaussianRadius_exposer = FormFactorSphereGaussianRadius_exposer_t( "FormFactorSphereGaussianRadius", bp::init< double, double >(( bp::arg("mean"), bp::arg("sigma") )) );
+        bp::scope FormFactorSphereGaussianRadius_scope( FormFactorSphereGaussianRadius_exposer );
+        { //::FormFactorSphereGaussianRadius::clone
+        
+            typedef ::FormFactorSphereGaussianRadius * ( ::FormFactorSphereGaussianRadius::*clone_function_type )(  ) const;
+            typedef ::FormFactorSphereGaussianRadius * ( FormFactorSphereGaussianRadius_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorSphereGaussianRadius::clone)
+                , default_clone_function_type(&FormFactorSphereGaussianRadius_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::createDistributedFormFactors
+        
+            typedef void ( ::FormFactorSphereGaussianRadius::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::FormFactorSphereGaussianRadius::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorSphereGaussianRadius_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorSphereGaussianRadius::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorSphereGaussianRadius_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorSphereGaussianRadius::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorSphereGaussianRadius_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::getHeight
+        
+            typedef double ( ::FormFactorSphereGaussianRadius::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorSphereGaussianRadius::getHeight)
+                , default_getHeight_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorSphereGaussianRadius::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorSphereGaussianRadius_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorSphereGaussianRadius::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::isDistributedFormFactor
+        
+            typedef bool ( ::FormFactorSphereGaussianRadius::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::FormFactorSphereGaussianRadius::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorSphereGaussianRadius_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorSphereGaussianRadius_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorSphereGaussianRadius_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorSphereGaussianRadius_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorSphereGaussianRadius_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorSphereGaussianRadius_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorSphereGaussianRadius_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorSphereGaussianRadius_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getVolume) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorSphereGaussianRadius_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorSphereGaussianRadius_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp b/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
new file mode 100644
index 00000000000..37ffbc13a4c
--- /dev/null
+++ b/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
@@ -0,0 +1,418 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "IFormFactorDecorator.pypp.h"
+
+namespace bp = boost::python;
+
+struct IFormFactorDecorator_wrapper : IFormFactorDecorator, bp::wrapper< IFormFactorDecorator > {
+
+    virtual ::IFormFactorDecorator * clone(  ) const {
+        bp::override func_clone = this->get_override( "clone" );
+        return func_clone(  );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->IFormFactorDecorator::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return IFormFactorDecorator::getHeight( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactorDecorator::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactorDecorator::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorDecorator::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorDecorator::getVolume( );
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactorDecorator::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactorDecorator::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const {
+        bp::override func_evaluate = this->get_override( "evaluate" );
+        return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->IFormFactor::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return IFormFactor::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< IFormFactorDecorator_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_IFormFactorDecorator_class(){
+
+    { //::IFormFactorDecorator
+        typedef bp::class_< IFormFactorDecorator_wrapper, bp::bases< IFormFactor >, boost::noncopyable > IFormFactorDecorator_exposer_t;
+        IFormFactorDecorator_exposer_t IFormFactorDecorator_exposer = IFormFactorDecorator_exposer_t( "IFormFactorDecorator", bp::no_init );
+        bp::scope IFormFactorDecorator_scope( IFormFactorDecorator_exposer );
+        { //::IFormFactorDecorator::clone
+        
+            typedef ::IFormFactorDecorator * ( ::IFormFactorDecorator::*clone_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IFormFactorDecorator::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorDecorator::getHeight
+        
+            typedef double ( ::IFormFactorDecorator::*getHeight_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactorDecorator::getHeight)
+                , default_getHeight_function_type(&IFormFactorDecorator_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactorDecorator::getRadius
+        
+            typedef double ( ::IFormFactorDecorator::*getRadius_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactorDecorator::getRadius)
+                , default_getRadius_function_type(&IFormFactorDecorator_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorDecorator::getVolume
+        
+            typedef double ( ::IFormFactorDecorator::*getVolume_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorDecorator::getVolume)
+                , default_getVolume_function_type(&IFormFactorDecorator_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactorDecorator::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactorDecorator::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactorDecorator::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&IFormFactorDecorator_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IFormFactorDecorator_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IFormFactorDecorator_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( IFormFactorDecorator_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&IFormFactorDecorator_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IFormFactorDecorator_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IFormFactorDecorator_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactor::evaluate
+        
+            typedef ::complex_t ( ::IFormFactor::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "evaluate"
+                , bp::pure_virtual( evaluate_function_type(&::IFormFactor::evaluate) )
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IFormFactorDecorator_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IFormFactorDecorator_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( IFormFactorDecorator_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&IFormFactorDecorator_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&IFormFactorDecorator_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IFormFactorDecorator_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IFormFactorDecorator_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IFormFactorDecorator_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IFormFactorDecorator_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IFormFactorDecorator_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IFormFactorDecorator_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/MesoCrystal.pypp.cpp b/Core/PythonAPI/src/MesoCrystal.pypp.cpp
new file mode 100644
index 00000000000..cfb60d884f8
--- /dev/null
+++ b/Core/PythonAPI/src/MesoCrystal.pypp.cpp
@@ -0,0 +1,324 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "MesoCrystal.pypp.h"
+
+namespace bp = boost::python;
+
+struct MesoCrystal_wrapper : MesoCrystal, bp::wrapper< MesoCrystal > {
+
+    MesoCrystal_wrapper(::IClusteredParticles const & particle_structure, ::IFormFactor & form_factor )
+    : MesoCrystal( boost::ref(particle_structure), boost::ref(form_factor) )
+      , bp::wrapper< MesoCrystal >(){
+        // constructor
+    
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::ICompositeSample * getCompositeSample(  ) {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ICompositeSample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample * default_getCompositeSample(  ) {
+        return ICompositeSample::getCompositeSample( );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ICompositeSample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ICompositeSample::getCompositeSample( );
+    }
+
+    virtual ::complex_t const getRefractiveIndex(  ) const  {
+        if( bp::override func_getRefractiveIndex = this->get_override( "getRefractiveIndex" ) )
+            return func_getRefractiveIndex(  );
+        else{
+            return this->Particle::getRefractiveIndex(  );
+        }
+    }
+    
+    ::complex_t const default_getRefractiveIndex(  ) const  {
+        return Particle::getRefractiveIndex( );
+    }
+
+    virtual bool hasDistributedFormFactor(  ) const  {
+        if( bp::override func_hasDistributedFormFactor = this->get_override( "hasDistributedFormFactor" ) )
+            return func_hasDistributedFormFactor(  );
+        else{
+            return this->Particle::hasDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_hasDistributedFormFactor(  ) const  {
+        return Particle::hasDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< MesoCrystal_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+    virtual ::size_t size(  ) const  {
+        if( bp::override func_size = this->get_override( "size" ) )
+            return func_size(  );
+        else{
+            return this->ICompositeSample::size(  );
+        }
+    }
+    
+    ::size_t default_size(  ) const  {
+        return ICompositeSample::size( );
+    }
+
+};
+
+void register_MesoCrystal_class(){
+
+    { //::MesoCrystal
+        typedef bp::class_< MesoCrystal_wrapper, bp::bases< Particle >, boost::noncopyable > MesoCrystal_exposer_t;
+        MesoCrystal_exposer_t MesoCrystal_exposer = MesoCrystal_exposer_t( "MesoCrystal", bp::init< IClusteredParticles const &, IFormFactor & >(( bp::arg("particle_structure"), bp::arg("form_factor") )) );
+        bp::scope MesoCrystal_scope( MesoCrystal_exposer );
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( MesoCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&MesoCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( MesoCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&MesoCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( MesoCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&MesoCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( MesoCrystal_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MesoCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( MesoCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MesoCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::getRefractiveIndex
+        
+            typedef ::complex_t const ( ::Particle::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t const ( MesoCrystal_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Particle::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&MesoCrystal_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Particle::hasDistributedFormFactor
+        
+            typedef bool ( ::Particle::*hasDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( MesoCrystal_wrapper::*default_hasDistributedFormFactor_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "hasDistributedFormFactor"
+                , hasDistributedFormFactor_function_type(&::Particle::hasDistributedFormFactor)
+                , default_hasDistributedFormFactor_function_type(&MesoCrystal_wrapper::default_hasDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( MesoCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&MesoCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            MesoCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &MesoCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( MesoCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            MesoCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&MesoCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( MesoCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&MesoCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( MesoCrystal_wrapper::*default_size_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&MesoCrystal_wrapper::default_size) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
index def4925a656..3bad3113fb1 100644
--- a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
+++ b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
@@ -16,6 +16,17 @@ namespace bp = boost::python;
 
 void register_free_functions(){
 
+    { //::MathFunctions::GenerateNormalRandom
+    
+        typedef double ( *GenerateNormalRandom_function_type )( double,double );
+        
+        bp::def( 
+            "GenerateNormalRandom"
+            , GenerateNormalRandom_function_type( &::MathFunctions::GenerateNormalRandom )
+            , ( bp::arg("average"), bp::arg("std_dev") ) );
+    
+    }
+
     { //::GetOutputData
     
         typedef ::PyObject * ( *GetOutputData_function_type )( ::Simulation const & );
diff --git a/Core/PythonAPI/src/PythonModule.cpp b/Core/PythonAPI/src/PythonModule.cpp
index fd11e056c69..70193c43aeb 100644
--- a/Core/PythonAPI/src/PythonModule.cpp
+++ b/Core/PythonAPI/src/PythonModule.cpp
@@ -11,6 +11,7 @@
 #include "Detector.pypp.h" 
 #include "FormFactorBox.pypp.h" 
 #include "FormFactorCone.pypp.h" 
+#include "FormFactorCrystal.pypp.h" 
 #include "FormFactorCylinder.pypp.h" 
 #include "FormFactorDecoratorDebyeWaller.pypp.h" 
 #include "FormFactorEllipsoid.pypp.h" 
@@ -24,6 +25,7 @@
 #include "FormFactorPrism6.pypp.h" 
 #include "FormFactorPyramid.pypp.h" 
 #include "FormFactorSphere.pypp.h" 
+#include "FormFactorSphereGaussianRadius.pypp.h" 
 #include "FTDistribution2DCauchy.pypp.h" 
 #include "HomogeneousMaterial.pypp.h" 
 #include "IAxis.pypp.h" 
@@ -34,6 +36,7 @@
 #include "IDetectorResolution.pypp.h" 
 #include "IFormFactor.pypp.h" 
 #include "IFormFactorBorn.pypp.h" 
+#include "IFormFactorDecorator.pypp.h" 
 #include "IFTDistribution2D.pypp.h" 
 #include "IInterferenceFunction.pypp.h" 
 #include "IMaterial.pypp.h" 
@@ -57,6 +60,7 @@
 #include "LayerInterface.pypp.h" 
 #include "LayerRoughness.pypp.h" 
 #include "MaterialManager.pypp.h" 
+#include "MesoCrystal.pypp.h" 
 #include "MultiLayer.pypp.h" 
 #include "ndimdata_t.pypp.h" 
 #include "OutputDataIOFactory.pypp.h" 
@@ -73,6 +77,7 @@
 #include "ResolutionFunction2DSimple.pypp.h" 
 #include "RotateY_3D.pypp.h" 
 #include "RotateZ_3D.pypp.h" 
+#include "SimpleSelectionRule.pypp.h" 
 #include "Simulation.pypp.h" 
 #include "SimulationParameters.pypp.h" 
 #include "StochasticDoubleGate.pypp.h" 
@@ -112,7 +117,9 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_IFormFactorBorn_class();
     register_FormFactorBox_class();
     register_FormFactorCone_class();
+    register_FormFactorCrystal_class();
     register_FormFactorCylinder_class();
+    register_IFormFactorDecorator_class();
     register_FormFactorDecoratorDebyeWaller_class();
     register_FormFactorEllipsoid_class();
     register_FormFactorFullSphere_class();
@@ -125,6 +132,7 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_FormFactorPrism6_class();
     register_FormFactorPyramid_class();
     register_FormFactorSphere_class();
+    register_FormFactorSphereGaussianRadius_class();
     register_kvector_t_class();
     register_cvector_t_class();
     register_ITransform3D_class();
@@ -153,6 +161,7 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_LayerInterface_class();
     register_LayerRoughness_class();
     register_MaterialManager_class();
+    register_MesoCrystal_class();
     register_MultiLayer_class();
     register_ndimdata_t_class();
     register_OutputDataIOFactory_class();
@@ -164,6 +173,7 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_PositionParticleInfo_class();
     register_RealParameterWrapper_class();
     register_ResolutionFunction2DSimple_class();
+    register_SimpleSelectionRule_class();
     register_Simulation_class();
     register_SimulationParameters_class();
     register_StochasticParameter_t_class();
diff --git a/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp b/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp
new file mode 100644
index 00000000000..cb07c7da7f2
--- /dev/null
+++ b/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp
@@ -0,0 +1,91 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "PythonCoreList.h"
+#include "SimpleSelectionRule.pypp.h"
+
+namespace bp = boost::python;
+
+struct SimpleSelectionRule_wrapper : SimpleSelectionRule, bp::wrapper< SimpleSelectionRule > {
+
+    SimpleSelectionRule_wrapper(SimpleSelectionRule const & arg )
+    : SimpleSelectionRule( arg )
+      , bp::wrapper< SimpleSelectionRule >(){
+        // copy constructor
+        
+    }
+
+    SimpleSelectionRule_wrapper(int a, int b, int c, int modulus )
+    : SimpleSelectionRule( a, b, c, modulus )
+      , bp::wrapper< SimpleSelectionRule >(){
+        // constructor
+    
+    }
+
+    virtual ::SimpleSelectionRule * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->SimpleSelectionRule::clone(  );
+        }
+    }
+    
+    ::SimpleSelectionRule * default_clone(  ) const  {
+        return SimpleSelectionRule::clone( );
+    }
+
+    virtual bool coordinateSelected( ::IndexVector3D const & coordinate ) const  {
+        if( bp::override func_coordinateSelected = this->get_override( "coordinateSelected" ) )
+            return func_coordinateSelected( boost::ref(coordinate) );
+        else{
+            return this->SimpleSelectionRule::coordinateSelected( boost::ref(coordinate) );
+        }
+    }
+    
+    bool default_coordinateSelected( ::IndexVector3D const & coordinate ) const  {
+        return SimpleSelectionRule::coordinateSelected( boost::ref(coordinate) );
+    }
+
+};
+
+void register_SimpleSelectionRule_class(){
+
+    { //::SimpleSelectionRule
+        typedef bp::class_< SimpleSelectionRule_wrapper, bp::bases< ISelectionRule > > SimpleSelectionRule_exposer_t;
+        SimpleSelectionRule_exposer_t SimpleSelectionRule_exposer = SimpleSelectionRule_exposer_t( "SimpleSelectionRule", bp::init< int, int, int, int >(( bp::arg("a"), bp::arg("b"), bp::arg("c"), bp::arg("modulus") )) );
+        bp::scope SimpleSelectionRule_scope( SimpleSelectionRule_exposer );
+        { //::SimpleSelectionRule::clone
+        
+            typedef ::SimpleSelectionRule * ( ::SimpleSelectionRule::*clone_function_type )(  ) const;
+            typedef ::SimpleSelectionRule * ( SimpleSelectionRule_wrapper::*default_clone_function_type )(  ) const;
+            
+            SimpleSelectionRule_exposer.def( 
+                "clone"
+                , clone_function_type(&::SimpleSelectionRule::clone)
+                , default_clone_function_type(&SimpleSelectionRule_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::SimpleSelectionRule::coordinateSelected
+        
+            typedef bool ( ::SimpleSelectionRule::*coordinateSelected_function_type )( ::IndexVector3D const & ) const;
+            typedef bool ( SimpleSelectionRule_wrapper::*default_coordinateSelected_function_type )( ::IndexVector3D const & ) const;
+            
+            SimpleSelectionRule_exposer.def( 
+                "coordinateSelected"
+                , coordinateSelected_function_type(&::SimpleSelectionRule::coordinateSelected)
+                , default_coordinateSelected_function_type(&SimpleSelectionRule_wrapper::default_coordinateSelected)
+                , ( bp::arg("coordinate") ) );
+        
+        }
+    }
+
+}
diff --git a/Core/python_module.pri b/Core/python_module.pri
index 98945eff9d9..642092941e6 100644
--- a/Core/python_module.pri
+++ b/Core/python_module.pri
@@ -12,6 +12,7 @@ HEADERS +=  \
     PythonAPI/inc/Detector.pypp.h \
     PythonAPI/inc/FormFactorBox.pypp.h \
     PythonAPI/inc/FormFactorCone.pypp.h \
+    PythonAPI/inc/FormFactorCrystal.pypp.h \
     PythonAPI/inc/FormFactorCylinder.pypp.h \
     PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h \
     PythonAPI/inc/FormFactorEllipsoid.pypp.h \
@@ -25,6 +26,7 @@ HEADERS +=  \
     PythonAPI/inc/FormFactorPrism6.pypp.h \
     PythonAPI/inc/FormFactorPyramid.pypp.h \
     PythonAPI/inc/FormFactorSphere.pypp.h \
+    PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h \
     PythonAPI/inc/FTDistribution2DCauchy.pypp.h \
     PythonAPI/inc/HomogeneousMaterial.pypp.h \
     PythonAPI/inc/IAxis.pypp.h \
@@ -35,6 +37,7 @@ HEADERS +=  \
     PythonAPI/inc/IDetectorResolution.pypp.h \
     PythonAPI/inc/IFormFactor.pypp.h \
     PythonAPI/inc/IFormFactorBorn.pypp.h \
+    PythonAPI/inc/IFormFactorDecorator.pypp.h \
     PythonAPI/inc/IFTDistribution2D.pypp.h \
     PythonAPI/inc/IInterferenceFunction.pypp.h \
     PythonAPI/inc/IMaterial.pypp.h \
@@ -58,6 +61,7 @@ HEADERS +=  \
     PythonAPI/inc/LayerInterface.pypp.h \
     PythonAPI/inc/LayerRoughness.pypp.h \
     PythonAPI/inc/MaterialManager.pypp.h \
+    PythonAPI/inc/MesoCrystal.pypp.h \
     PythonAPI/inc/MultiLayer.pypp.h \
     PythonAPI/inc/ndimdata_t.pypp.h \
     PythonAPI/inc/OutputDataIOFactory.pypp.h \
@@ -74,6 +78,7 @@ HEADERS +=  \
     PythonAPI/inc/ResolutionFunction2DSimple.pypp.h \
     PythonAPI/inc/RotateY_3D.pypp.h \
     PythonAPI/inc/RotateZ_3D.pypp.h \
+    PythonAPI/inc/SimpleSelectionRule.pypp.h \
     PythonAPI/inc/Simulation.pypp.h \
     PythonAPI/inc/SimulationParameters.pypp.h \
     PythonAPI/inc/StochasticDoubleGate.pypp.h \
@@ -101,6 +106,7 @@ SOURCES +=  \
     PythonAPI/src/Detector.pypp.cpp \
     PythonAPI/src/FormFactorBox.pypp.cpp \
     PythonAPI/src/FormFactorCone.pypp.cpp \
+    PythonAPI/src/FormFactorCrystal.pypp.cpp \
     PythonAPI/src/FormFactorCylinder.pypp.cpp \
     PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp \
     PythonAPI/src/FormFactorEllipsoid.pypp.cpp \
@@ -114,6 +120,7 @@ SOURCES +=  \
     PythonAPI/src/FormFactorPrism6.pypp.cpp \
     PythonAPI/src/FormFactorPyramid.pypp.cpp \
     PythonAPI/src/FormFactorSphere.pypp.cpp \
+    PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp \
     PythonAPI/src/FTDistribution2DCauchy.pypp.cpp \
     PythonAPI/src/HomogeneousMaterial.pypp.cpp \
     PythonAPI/src/IAxis.pypp.cpp \
@@ -124,6 +131,7 @@ SOURCES +=  \
     PythonAPI/src/IDetectorResolution.pypp.cpp \
     PythonAPI/src/IFormFactor.pypp.cpp \
     PythonAPI/src/IFormFactorBorn.pypp.cpp \
+    PythonAPI/src/IFormFactorDecorator.pypp.cpp \
     PythonAPI/src/IFTDistribution2D.pypp.cpp \
     PythonAPI/src/IInterferenceFunction.pypp.cpp \
     PythonAPI/src/IMaterial.pypp.cpp \
@@ -147,6 +155,7 @@ SOURCES +=  \
     PythonAPI/src/LayerInterface.pypp.cpp \
     PythonAPI/src/LayerRoughness.pypp.cpp \
     PythonAPI/src/MaterialManager.pypp.cpp \
+    PythonAPI/src/MesoCrystal.pypp.cpp \
     PythonAPI/src/MultiLayer.pypp.cpp \
     PythonAPI/src/ndimdata_t.pypp.cpp \
     PythonAPI/src/OutputDataIOFactory.pypp.cpp \
@@ -163,6 +172,7 @@ SOURCES +=  \
     PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp \
     PythonAPI/src/RotateY_3D.pypp.cpp \
     PythonAPI/src/RotateZ_3D.pypp.cpp \
+    PythonAPI/src/SimpleSelectionRule.pypp.cpp \
     PythonAPI/src/Simulation.pypp.cpp \
     PythonAPI/src/SimulationParameters.pypp.cpp \
     PythonAPI/src/StochasticDoubleGate.pypp.cpp \
diff --git a/Macros/BoostPythonGenerator/InstallPyCore.py b/Macros/BoostPythonGenerator/InstallPyCore.py
index dc67aced5d3..a277fc767fd 100644
--- a/Macros/BoostPythonGenerator/InstallPyCore.py
+++ b/Macros/BoostPythonGenerator/InstallPyCore.py
@@ -103,6 +103,7 @@ def GenerateModuleFile(OutputTempDir, files_inc, files_src):
 # InstallCode()
 #------------------------------------------------------------------------------
 def InstallCode(OutputTempDir, InstallDir):
+    print "Installing generated PythonFitAPI into ", InstallDir
     if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
     if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
 
@@ -123,6 +124,7 @@ def InstallCode(OutputTempDir, InstallDir):
     install_utils.CopyFiles(files, InstallDir)
 
     install_utils.ClearPythonAPI(files, InstallDir)
+    print "Done"
 
 
 #------------------------------------------------------------------------------
@@ -130,6 +132,5 @@ def InstallCode(OutputTempDir, InstallDir):
 #------------------------------------------------------------------------------
 if __name__ == '__main__':
     InstallCode("output/PyCore","../../Core/PythonAPI")
-    print "Done"
 
 
diff --git a/Macros/BoostPythonGenerator/InstallPyFit.py b/Macros/BoostPythonGenerator/InstallPyFit.py
index 5e811c4fb0d..0b156becb0c 100644
--- a/Macros/BoostPythonGenerator/InstallPyFit.py
+++ b/Macros/BoostPythonGenerator/InstallPyFit.py
@@ -84,6 +84,7 @@ def GenerateModuleFile(OutputTempDir, files_inc, files_src, PatternsToExclude):
 # InstallCode()
 #------------------------------------------------------------------------------
 def InstallCode(OutputTempDir, InstallDir):
+    print "Installing generated PythonCoreAPI into ", InstallDir
     if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
     if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
 
@@ -111,6 +112,7 @@ def InstallCode(OutputTempDir, InstallDir):
     install_utils.CopyFiles(files, InstallDir)
 
     install_utils.ClearPythonAPI(files, InstallDir)
+    print "Done"
 
 
 #------------------------------------------------------------------------------
@@ -118,6 +120,5 @@ def InstallCode(OutputTempDir, InstallDir):
 #------------------------------------------------------------------------------
 if __name__ == '__main__':
     InstallCode("output/PyFit","../../Fit/PythonAPI")
-    print "Done"
 
 
diff --git a/Macros/BoostPythonGenerator/MakePyCore.py b/Macros/BoostPythonGenerator/MakePyCore.py
index 490707658f4..21d3b018562 100644
--- a/Macros/BoostPythonGenerator/MakePyCore.py
+++ b/Macros/BoostPythonGenerator/MakePyCore.py
@@ -41,6 +41,7 @@ include_classes = [
 "FormFactorBox",
 "FormFactorCone",
 "FormFactorCylinder",
+"FormFactorCrystal",
 "FormFactorDecoratorDebyeWaller",
 "FormFactorEllipsoid",
 "FormFactorFullSphere",
@@ -53,6 +54,7 @@ include_classes = [
 "FormFactorPrism6",
 "FormFactorPyramid",
 "FormFactorSphere",
+"FormFactorSphereGaussianRadius",
 "HomogeneousMaterial",
 "IAxis",
 "ICloneable",
@@ -63,6 +65,7 @@ include_classes = [
 "IFTDistribution2D",
 "IFormFactor",
 "IFormFactorBorn",
+"IFormFactorDecorator",
 "IInterferenceFunction",
 "IMaterial",
 "IParameterized",
@@ -84,12 +87,12 @@ include_classes = [
 "LayerInterface",
 "LayerRoughness",
 "MaterialManager",
+"MesoCrystal",
 "MultiLayer",
 "OutputData<double>",
 "OutputDataIOFactory",
 "ParameterPool",
 "Particle",
-"Particle",
 "ParticleCoreShell",
 "ParticleBuilder",
 "ParticleDecoration",
@@ -101,6 +104,7 @@ include_classes = [
 "RotateZ_3D",
 "Simulation",
 "SimulationParameters",
+"SimpleSelectionRule",
 "StochasticDoubleGate",
 "StochasticDoubleGaussian",
 "StochasticParameter<double>",
@@ -115,10 +119,6 @@ include_classes = [
 # -----------------------------------------------------------------------------
 def ManualClassTunings(mb):
     mb.class_("Detector").member_functions("addAxis").exclude()
-    #mb.class_("Instrument").member_functions("setDetectorParameters").exclude()
-    #mb.class_("Simulation").member_functions("setDetectorParameters").exclude()
-    #mb.class_("IFTDistribution2D").member_functions("transformToStarBasis").exclude()
-    #mb.class_("FTDistribution2DCauchy").member_functions("transformToStarBasis").exclude()
     #
     shared_ptrs = mb.decls( lambda decl: decl.name.startswith( 'shared_ptr<' ) )
     shared_ptrs.disable_warnings( messages.W1040 )
@@ -130,7 +130,6 @@ def ManualClassTunings(mb):
     ]
     classes_to_exclude = ["BasicVector3D<std::complex<double> >","BasicVector3D<double>","BasicVector3D<int>"]
     builder_utils.ExcludeMemberFunctionsForClasses(mb, methods_to_exclude, classes_to_exclude)
-    pass
     # Pure virtual should always be included
     mb.class_("IDetectorResolution").member_function("applyDetectorResolution").include()
     #
@@ -183,7 +182,7 @@ def ManualClassTunings(mb):
     cl.constructors().exclude()
     #
     cl = mb.class_("OutputData<double>")
-    cl.add_code('def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> )')
+    cl.add_code('def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> )') # [] operator for OutputData
     #
     cl = mb.class_( "Particle" )
     cl.member_function( "createDiffuseParticleInfo" ).exclude()
@@ -209,6 +208,11 @@ def ManualClassTunings(mb):
     #
     cl = mb.class_( "ParticleCoreShell" )
     cl.member_functions().exclude()
+    #
+    cl = mb.class_( "MesoCrystal" )
+    cl.member_functions( ).exclude()
+    #
+    mb.namespace( "MathFunctions" ).free_function("GenerateNormalRandom").include()
 
 
 # excluding specific member functions
diff --git a/Macros/BoostPythonGenerator/codegenerator.py b/Macros/BoostPythonGenerator/codegenerator.py
index ca3c78a9f49..ab3b160c5d3 100644
--- a/Macros/BoostPythonGenerator/codegenerator.py
+++ b/Macros/BoostPythonGenerator/codegenerator.py
@@ -1,4 +1,4 @@
-# c++ wrapper generator for exposing libBornAgainCore to python
+# c++ wrapper generator for exposing libBornAgainCore and libBornAgainFit libraries to python
 #
 # Usage: 'python codegenerator.py make'  - to generate python-boost C++ wrappers
 # Usage: 'python codegenerator.py install'  - to copy files into BornAgain/Core/PythonAPI directory
@@ -42,8 +42,8 @@ def main():
             InstallPyCore.InstallCode(PyCoreTempDir, PyCoreInstallDir)
             InstallPyFit.InstallCode(PyFitTempDir, PyFitInstallDir)
         elif sys.argv[1] == 'clean':
-            clean = ["rm -r -f output", "rm -f cache_core.xml", "rm -f cache_fit.xml", "rm -f *~","rm -f named_tuple.py","rm -f *.pyc","rm -f exposed_decl.pypp.txt","rm -f tmp.pypp.cpp"]
-            for x in clean: os.system(x)
+            clean = ["output", "cache_*.xml", "*~","named_tuple.py","*.pyc","exposed_decl.pypp.txt","tmp.pypp.cpp"]
+            for x in clean: os.system("rm -r -f "+x)
         else:
             print "Nothing to do, run 'python codegenerator.py' to get help"
 
diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
index 28ca82cd20a..0ead0094cce 100644
--- a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
+++ b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
@@ -56,8 +56,9 @@ def RunSimulation2():
     pyramid = Particle(n_particle, pyramid_ff)
     interference = InterferenceFunctionNone()
     angle_around_z = 45.*degree
-    rotatez3d = RotateZ3D(angle_around_z)
-    transform = Transform3D(rotatez3d)
+    #rotatez3d = RotateZ3D(angle_around_z)
+    #transform = Transform3D(rotatez3d)
+    transform = RotateZ_3D(angle_around_z)
     particle_decoration = ParticleDecoration()
     particle_decoration.addParticle(pyramid, transform)
     
diff --git a/Tests/FunctionalTests/TestPyCore/mesocrystal1.py b/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
index 43f66600c9f..3cd397ac6f4 100644
--- a/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
+++ b/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
@@ -84,9 +84,9 @@ class MySampleBuilder(ISampleBuilder):
         for i in range(0, n_max_phi_rotation_steps):
             for j in range(0, n_alpha_rotation_steps):
 
-                transform1 = RotateZ3D(phi_start + i*phi_step)
+                #transform1 = RotateZ3D(phi_start + i*phi_step)
                 #transform2 = RotateY3D(alpha_start + j*alpha_step);
-                p_total_transform = Transform3D(transform1)
+                p_total_transform = RotateZ_3D(phi_start + i*phi_step)
                 meso = self.createMesoCrystal(self.lattice_length_a.value, self.lattice_length_c.value, n_particle_adapted, ff_meso)
                 particle_decoration.addParticle(meso, p_total_transform, self.meso_height.value)
 
-- 
GitLab