BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SampleLabelHandler.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Export/SampleLabelHandler.h
6 //! @brief Defines classes LabelMap and SampleLabelHandler.
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_SAMPLELABELHANDLER_H
16 #define BORNAGAIN_CORE_EXPORT_SAMPLELABELHANDLER_H
17 
18 #include "Base/Types/Exceptions.h"
19 #include "Core/Export/OrderedMap.h"
20 
21 class Crystal;
22 class IAbstractParticle;
23 class IFormFactor;
25 class ILayout;
26 class Material;
27 class IRotation;
28 class Lattice;
29 class Layer;
30 class LayerRoughness;
31 class MultiLayer;
32 class Particle;
34 class ParticleCoreShell;
36 class MesoCrystal;
37 
38 template <class Key> class LabelMap : public OrderedMap<Key, std::string>
39 {
40 };
41 
42 //! The handler which construct labels for sample variables during python script generation.
43 //! @ingroup tools_internal
44 
46 {
47 public:
63 
65  crystals_t* crystalMap() { return &m_CrystalLabel; }
66  formfactors_t* formFactorMap() { return &m_FormFactorLabel; }
67  interferences_t* interferenceFunctionMap() { return &m_InterferenceFunctionLabel; }
68  layers_t* layerMap() { return &m_LayerLabel; }
69  layouts_t* particleLayoutMap() { return &m_ILayoutLabel; }
70  materials_t* materialMap() { return &m_MaterialLabel; }
71  lattices_t* latticeMap() { return &m_LatticeLabel; }
72  mesocrystals_t* mesocrystalMap() { return &m_MesoCrystalLabel; }
73  multilayers_t* multiLayerMap() { return &m_MultiLayerLabel; }
74  particlecompositions_t* particleCompositionMap() { return &m_ParticleCompositionLabel; }
75  particledistributions_t* particleDistributionsMap() { return &m_ParticleDistributionLabel; }
76  particles_t* particleMap() { return &m_ParticleLabel; }
77  particlescoreshell_t* particleCoreShellMap() { return &m_ParticleCoreShellLabel; }
78  rotations_t* rotationsMap() { return &m_RotationsLabel; }
79  roughnesses_t* layerRoughnessMap() { return &m_LayerRoughnessLabel; }
80 
81  std::string labelCrystal(const Crystal* sample);
82  std::string labelFormFactor(const IFormFactor* sample);
83  std::string labelInterferenceFunction(const IInterferenceFunction* sample);
84  std::string labelLayer(const Layer* sample);
85  std::string labelLayout(const ILayout* sample);
86  std::string labelMaterial(const Material* sample);
87  std::string labelLattice(const Lattice* sample);
88  std::string labelMultiLayer(const MultiLayer* sample);
89  std::string labelParticle(const IAbstractParticle* sample);
90  std::string labelRotation(const IRotation* sample);
91  std::string labelRoughness(const LayerRoughness* sample);
92 
93  void insertCrystal(const Crystal* sample);
94  void insertFormFactor(const IFormFactor* sample);
95  void insertInterferenceFunction(const IInterferenceFunction* sample);
96  void insertLayer(const Layer* sample);
97  void insertLayout(const ILayout* sample);
98  void insertMaterial(const Material* sample);
99  void insertLattice(const Lattice* sample);
100  void insertMesoCrystal(const MesoCrystal* sample);
101  void insertMultiLayer(const MultiLayer* sample);
102  void insertParticleComposition(const ParticleComposition* sample);
103  void insertParticleDistribution(const ParticleDistribution* sample);
104  void insertParticle(const Particle* sample);
105  void insertParticleCoreShell(const ParticleCoreShell* sample);
106  void insertRotation(const IRotation* sample);
107  void insertRoughness(const LayerRoughness* sample);
108 
109 private:
110  crystals_t m_CrystalLabel;
111  formfactors_t m_FormFactorLabel;
112  interferences_t m_InterferenceFunctionLabel;
113  layers_t m_LayerLabel;
114  layouts_t m_ILayoutLabel;
115  materials_t m_MaterialLabel;
116  lattices_t m_LatticeLabel;
117  mesocrystals_t m_MesoCrystalLabel;
118  multilayers_t m_MultiLayerLabel;
119  particlecompositions_t m_ParticleCompositionLabel;
120  particledistributions_t m_ParticleDistributionLabel;
121  particles_t m_ParticleLabel;
122  particlescoreshell_t m_ParticleCoreShellLabel;
123  rotations_t m_RotationsLabel;
124  roughnesses_t m_LayerRoughnessLabel;
125 };
126 
127 #endif // BORNAGAIN_CORE_EXPORT_SAMPLELABELHANDLER_H
Defines many exception classes in namespace Exceptionss.
Defines class OrderedMap.
A crystal structure with a ParticleComposition as a basis.
Definition: Crystal.h:26
Interface for a generic particle.
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
Pure virtual base class of interference functions.
Pure virtual interface class to equip a sample layer with scattering properties.
Definition: ILayout.h:32
Pure virtual interface for rotations.
Definition: Rotations.h:27
A lattice with three basis vectors.
Definition: Lattice.h:28
A roughness of interface between two layers.
A layer, with thickness (in nanometer) and material.
Definition: Layer.h:28
A wrapper for underlying material implementation.
Definition: Material.h:29
A particle with an internal structure of smaller particles.
Definition: MesoCrystal.h:26
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
Ordered map which saves the order of insertion.
Definition: OrderedMap.h:29
A composition of particles at fixed positions.
A particle with a core/shell geometry.
A particle type that is a parametric distribution of IParticle's.
A particle with a form factor and refractive index.
Definition: Particle.h:26
The handler which construct labels for sample variables during python script generation.