BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GUIDomainSampleVisitor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/GUIDomainSampleVisitor.h
6 //! @brief Defines class GUIDomainSampleVisitor
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_GUI_COREGUI_MODELS_GUIDOMAINSAMPLEVISITOR_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_GUIDOMAINSAMPLEVISITOR_H
17 
19 #include <QMap>
20 #include <QString>
21 
22 class SampleModel;
23 class MaterialModel;
24 class SessionItem;
25 class ExternalProperty;
26 class Material;
27 
28 //! Visits domain sample tree to build GUI presentation.
29 
31 public:
34 
35  SessionItem* populateSampleModel(SampleModel* sampleModel, MaterialModel* materialModel,
36  const MultiLayer& sample, const QString& sample_name = "");
37 
38  using INodeVisitor::visit;
39 
40  void visit(const ParticleLayout*);
41 
42  void visit(const Layer*);
43 
44  void visit(const MultiLayer*);
45 
46  void visit(const Particle*);
47  void visit(const ParticleDistribution*);
48  void visit(const ParticleCoreShell*);
49  void visit(const ParticleComposition*);
50  void visit(const MesoCrystal*);
51  void visit(const Crystal*);
52 
53  void visit(const FormFactorAnisoPyramid*);
54  void visit(const FormFactorBarGauss*);
55  void visit(const FormFactorBarLorentz*);
56  void visit(const FormFactorBox*);
57  void visit(const FormFactorCone*);
58  void visit(const FormFactorCone6*);
59  void visit(const FormFactorCuboctahedron*);
60  void visit(const FormFactorCylinder*);
61  void visit(const FormFactorDodecahedron*);
63  void visit(const FormFactorFullSphere*);
64  void visit(const FormFactorFullSpheroid*);
65  void visit(const FormFactorHemiEllipsoid*);
66  void visit(const FormFactorIcosahedron*);
67  void visit(const FormFactorPrism3*);
68  void visit(const FormFactorPrism6*);
69  void visit(const FormFactorPyramid*);
70  void visit(const FormFactorCosineRippleBox*);
76  void visit(const FormFactorTetrahedron*);
77  void visit(const FormFactorDot*);
78  void visit(const FormFactorTruncatedCube*);
79  void visit(const FormFactorTruncatedSphere*);
81 
88 
89  void visit(const RotationX*);
90  void visit(const RotationY*);
91  void visit(const RotationZ*);
92  void visit(const RotationEuler*);
93 
94 private:
95  void buildAbundanceInfo(SessionItem* particleItem);
96  void buildPositionInfo(SessionItem* particleItem, const IParticle* sample);
98  SessionItem* InsertIParticle(const IParticle* p_particle, QString model_type);
99 
100  QMap<int, SessionItem*> m_levelToParentItem;
101  QMap<QString, double> m_propertyToValue;
102  QMap<QString, bool> m_sample_encountered;
103  QMap<SessionItem*, const ISampleNode*> m_itemToSample;
105 
108 };
109 
110 #endif // BORNAGAIN_GUI_COREGUI_MODELS_GUIDOMAINSAMPLEVISITOR_H
Defines interface class INodeVisitor.
A crystal structure, defined by a Bravais lattice, a basis, and a position variance.
Definition: Crystal.h:35
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
A frustum (truncated pyramid) with rectangular base.
The form factor of an elongated bar, with Gaussian profile in elongation direction.
Definition: FormFactorBar.h:27
The form factor of an elongated, with Lorentz form factor in elongation direction.
Definition: FormFactorBar.h:40
A rectangular prism (parallelepiped).
Definition: FormFactorBox.h:23
A frustum (truncated pyramid) with regular hexagonal base.
A conical frustum (cone truncated parallel to the base) with circular base.
The form factor for a cosine ripple, with box profile in elongation direction.
The form factor for a cosine ripple, with Gaussian profile in elongation direction.
The form factor for a cosine ripple, with Lorentz form factor in elongation direction.
A truncated bifrustum with quadratic base.
A circular cylinder.
A regular dodecahedron.
A dot, with scattering power as a sphere of radius rscat, but with F(q)=const.
Definition: FormFactorDot.h:23
A cylinder with elliptical base.
A full spheroid (an ellipsoid with two equal axes, hence with circular cross section)
An hemi ellipsoid, obtained by truncating a full ellipsoid in the middle plane spanned by two princip...
A regular icosahedron.
A prism based on an equilateral triangle.
A prism based on a regular hexagonal.
A frustum with a quadratic base.
The form factor for a cosine ripple, with box profile in elongation direction.
The form factor for a cosine ripple, with Gaussian profile in elongation direction.
The form factor for a cosine ripple, with Lorentz form factor in elongation direction.
A frustum with equilateral trigonal base.
A cube, with tetrahedral truncation of all corners.
Visits domain sample tree to build GUI presentation.
SessionItem * populateSampleModel(SampleModel *sampleModel, MaterialModel *materialModel, const MultiLayer &sample, const QString &sample_name="")
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151
ExternalProperty createMaterialFromDomain(const Material *)
void buildAbundanceInfo(SessionItem *particleItem)
SessionItem * InsertIParticle(const IParticle *p_particle, QString model_type)
QMap< SessionItem *, const ISampleNode * > m_itemToSample
QMap< QString, double > m_propertyToValue
void buildPositionInfo(SessionItem *particleItem, const IParticle *sample)
QMap< QString, bool > m_sample_encountered
QMap< int, SessionItem * > m_levelToParentItem
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
Interference function of a 1D lattice.
Interference function of a 2D lattice.
Interference function of a 2D paracrystal.
Interference function of a finite 2D lattice.
Percus-Yevick hard disk interference function.
Interference function of radial paracrystal.
A layer in a MultiLayer sample.
Definition: Layer.h:27
A wrapper for underlying material implementation.
Definition: Material.h:29
A particle with an internal structure of smaller particles.
Definition: MesoCrystal.h:25
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
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.
Decorator class that adds particles to ISampleNode objects.
A particle with a form factor and refractive index.
Definition: Particle.h:24
A sequence of rotations about the z-x'-z'' axes.
Definition: Rotations.h:133
A rotation about the x axis.
Definition: Rotations.h:73
A rotation about the y axis.
Definition: Rotations.h:93
A rotation about the z axis.
Definition: Rotations.h:113
Main model to hold sample items.
Definition: SampleModel.h:24
std::string model_type
Definition: types.h:23