BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
RealSpaceBuilder.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Realspace/RealSpaceBuilder.h
6 //! @brief Defines class RealSpaceBuilder
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_VIEW_REALSPACE_REALSPACEBUILDER_H
16 #define BORNAGAIN_GUI_VIEW_REALSPACE_REALSPACEBUILDER_H
17 
20 #include "GUI/ba3d/view/camera.h"
21 #include <QVector3D>
22 
23 class LayerItem;
24 class MultiLayerItem;
25 class ParticleLayoutItem;
26 class Shape3D;
27 struct SceneGeometry;
29 class ItemWithParticles;
30 
31 namespace GUI::RealSpace {
32 class Model;
33 }
34 
35 using namespace GUI;
36 
38 
39 public:
40  //! Defines the item types this class can handle
42  std::variant<MultiLayerItem*, LayerItem*, ParticleLayoutItem*, ItemWithParticles*>;
43 
44  RealSpaceBuilder(std::function<QColor(const QString&)> fnColorFromMaterialName);
45 
46  void populate(RealSpace::Model* model, ItemForRealSpace item,
47  const SceneGeometry& sceneGeometry,
48  const RealSpace::Camera::Position& cameraPosition =
50  RealSpace::Vector3D(0, 0, 0), // center
52  const;
53 
54  void populateParticleFromParticle3DContainer(RealSpace::Model* model,
55  const Particle3DContainer& particle3DContainer,
56  const QVector3D& lattice_position = {}) const;
57 
58 private:
59  void populateMultiLayer(RealSpace::Model* model, const MultiLayerItem& mlayerItem,
60  const SceneGeometry& sceneGeometry, const QVector3D& origin = {}) const;
61 
62  void populateLayer(RealSpace::Model* model, const LayerItem& layerItem,
63  const SceneGeometry& sceneGeometry, const QVector3D& origin = {},
64  bool isTopLayer = false) const;
65 
66  void populateLayout(RealSpace::Model* model, const ParticleLayoutItem& layoutItem,
67  const SceneGeometry& sceneGeometry, const QVector3D& origin = {}) const;
68 
69  void populateParticleFromParticleItem(RealSpace::Model* model,
70  const ItemWithParticles& particleItem) const;
71 
72 
73 private:
74  std::unique_ptr<RealSpace::BuilderUtils> m_builderUtils;
75 };
76 
77 #endif // BORNAGAIN_GUI_VIEW_REALSPACE_REALSPACEBUILDER_H
Defines GUI::RealSpace::BuilderUtils namespace.
Defines class SampleItem.
Defines Camera class.
std::variant< MultiLayerItem *, LayerItem *, ParticleLayoutItem *, ItemWithParticles * > ItemForRealSpace
Defines the item types this class can handle.
std::unique_ptr< RealSpace::BuilderUtils > m_builderUtils
Definition: def.cpp:20
static Vector3D const _z
Definition: def.h:46
Size and thickness information of layers.