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 
68  layers_t* layerMap() { return &m_LayerLabel; }
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);
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);
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:
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.
mesocrystals_t * mesocrystalMap()
void insertRotation(const IRotation *sample)
std::string labelLayer(const Layer *sample)
void insertInterferenceFunction(const IInterferenceFunction *sample)
LabelMap< const IRotation * > rotations_t
LabelMap< const Crystal * > crystals_t
LabelMap< const ParticleComposition * > particlecompositions_t
formfactors_t * formFactorMap()
particlecompositions_t * particleCompositionMap()
void insertFormFactor(const IFormFactor *sample)
particles_t * particleMap()
particledistributions_t m_ParticleDistributionLabel
interferences_t * interferenceFunctionMap()
materials_t * materialMap()
lattices_t * latticeMap()
LabelMap< const MesoCrystal * > mesocrystals_t
std::string labelParticle(const IAbstractParticle *sample)
particledistributions_t * particleDistributionsMap()
LabelMap< const ILayout * > layouts_t
std::string labelRotation(const IRotation *sample)
void insertRoughness(const LayerRoughness *sample)
void insertMesoCrystal(const MesoCrystal *sample)
particlecompositions_t m_ParticleCompositionLabel
LabelMap< const ParticleDistribution * > particledistributions_t
std::string labelInterferenceFunction(const IInterferenceFunction *sample)
std::string labelMultiLayer(const MultiLayer *sample)
void insertMultiLayer(const MultiLayer *sample)
LabelMap< const Particle * > particles_t
LabelMap< const Material * > materials_t
mesocrystals_t m_MesoCrystalLabel
particlescoreshell_t m_ParticleCoreShellLabel
void insertParticleCoreShell(const ParticleCoreShell *sample)
rotations_t m_RotationsLabel
layouts_t * particleLayoutMap()
multilayers_t * multiLayerMap()
std::string labelLattice(const Lattice *sample)
LabelMap< const MultiLayer * > multilayers_t
roughnesses_t m_LayerRoughnessLabel
std::string labelLayout(const ILayout *sample)
formfactors_t m_FormFactorLabel
LabelMap< const ParticleCoreShell * > particlescoreshell_t
crystals_t * crystalMap()
LabelMap< const IInterferenceFunction * > interferences_t
rotations_t * rotationsMap()
void insertLattice(const Lattice *sample)
std::string labelCrystal(const Crystal *sample)
LabelMap< const Layer * > layers_t
void insertParticle(const Particle *sample)
void insertCrystal(const Crystal *sample)
std::string labelRoughness(const LayerRoughness *sample)
void insertMaterial(const Material *sample)
roughnesses_t * layerRoughnessMap()
LabelMap< const Lattice * > lattices_t
interferences_t m_InterferenceFunctionLabel
void insertParticleComposition(const ParticleComposition *sample)
void insertParticleDistribution(const ParticleDistribution *sample)
void insertLayout(const ILayout *sample)
particlescoreshell_t * particleCoreShellMap()
LabelMap< const IFormFactor * > formfactors_t
multilayers_t m_MultiLayerLabel
std::string labelMaterial(const Material *sample)
std::string labelFormFactor(const IFormFactor *sample)
void insertLayer(const Layer *sample)
LabelMap< const LayerRoughness * > roughnesses_t