BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SampleToPython.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Export/SampleToPython.h
6 //! @brief Defines class SampleToPython.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
21 #define BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
22 
23 #include <memory>
24 #include <string>
25 
26 class IParticle;
27 class MultiLayer;
29 class MaterialKeyHandler;
30 
31 //! Generates Python code snippet from domain (C++) objects representing sample construction.
32 
34 public:
37 
38  std::string sampleCode(const MultiLayer& multilayer);
39 
40 private:
41  void initLabels(const MultiLayer& multilayer);
42 
43  std::string defineGetSample() const;
44  std::string defineMaterials() const;
45  std::string defineLayers() const;
46  std::string defineFormFactors() const;
47  std::string defineParticles() const;
48  std::string defineCoreShellParticles() const;
49  std::string defineParticleDistributions() const;
50  std::string defineParticleCompositions() const;
51  std::string defineLattices2D() const;
52  std::string defineLattices3D() const;
53  std::string defineCrystals() const;
54  std::string defineMesoCrystals() const;
55  std::string defineInterferenceFunctions() const;
56  std::string defineParticleLayouts() const;
57  std::string defineRoughnesses() const;
58  std::string defineMultiLayers() const;
59 
60  std::unique_ptr<ComponentKeyHandler> m_objs;
61  std::unique_ptr<MaterialKeyHandler> m_materials;
62 };
63 
64 #endif // BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
65 #endif // USER_API
Stores IComponent instances, associates them with given tag, and provides unique keys.
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Stores Material instances, associates them with given tag, and provides unique keys.
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
Generates Python code snippet from domain (C++) objects representing sample construction.
std::string defineLayers() const
std::string defineGetSample() const
std::string defineFormFactors() const
std::string defineMaterials() const
std::string defineLattices3D() const
std::string defineMesoCrystals() const
void initLabels(const MultiLayer &multilayer)
std::string defineCrystals() const
std::string defineParticles() const
std::string defineParticleCompositions() const
std::string defineParticleDistributions() const
std::unique_ptr< ComponentKeyHandler > m_objs
std::string defineLattices2D() const
std::string defineParticleLayouts() const
std::string defineCoreShellParticles() const
std::string defineInterferenceFunctions() const
std::string defineMultiLayers() const
std::string defineRoughnesses() const
std::string sampleCode(const MultiLayer &multilayer)
std::unique_ptr< MaterialKeyHandler > m_materials