BornAgain  1.18.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 scattering at grazing incidence
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 #ifndef BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
16 #define BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
17 
18 #include <memory>
19 #include <string>
20 
21 class IParticle;
22 class MultiLayer;
23 class SampleLabelHandler;
24 
25 //! Generates Python code snippet from domain (C++) objects representing sample construction.
26 
28 {
29 public:
32 
33  std::string generateSampleCode(const MultiLayer& multilayer);
34 
35 private:
36  void initLabels(const MultiLayer& multilayer);
37 
38  std::string defineGetSample() const;
39  std::string defineMaterials() const;
40  std::string defineLayers() const;
41  std::string defineFormFactors() const;
42  std::string defineParticles() const;
43  std::string defineCoreShellParticles() const;
44  std::string defineParticleDistributions() const;
45  std::string defineParticleCompositions() const;
46  std::string defineLattices() const;
47  std::string defineCrystals() const;
48  std::string defineMesoCrystals() const;
49  std::string defineInterferenceFunctions() const;
50  std::string defineParticleLayouts() const;
51  std::string defineRoughnesses() const;
52  std::string addLayoutsToLayers() const;
53  std::string defineMultiLayers() const;
54 
55  std::string indent() const;
56 
57  void setRotationInformation(const IParticle* particle, std::string particle_name,
58  std::ostringstream& result) const;
59  void setPositionInformation(const IParticle* particle, std::string particle_name,
60  std::ostringstream& result) const;
61 
62  std::unique_ptr<SampleLabelHandler> m_label;
63 };
64 
65 #endif // BORNAGAIN_CORE_EXPORT_SAMPLETOPYTHON_H
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
The handler which construct labels for sample variables during python script generation.
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 generateSampleCode(const MultiLayer &multilayer)
std::string defineMaterials() const
std::string defineMesoCrystals() const
void initLabels(const MultiLayer &multilayer)
std::string defineCrystals() const
std::unique_ptr< SampleLabelHandler > m_label
std::string defineParticles() const
std::string defineParticleCompositions() const
std::string indent() const
std::string defineParticleDistributions() const
std::string addLayoutsToLayers() const
std::string defineParticleLayouts() const
void setRotationInformation(const IParticle *particle, std::string particle_name, std::ostringstream &result) const
void setPositionInformation(const IParticle *particle, std::string particle_name, std::ostringstream &result) const
std::string defineLattices() const
std::string defineCoreShellParticles() const
std::string defineInterferenceFunctions() const
std::string defineMultiLayers() const
std::string defineRoughnesses() const