BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MesoCrystalItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Sample/MesoCrystalItem.h
6 //! @brief Defines class MesoCrystalItem
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_SAMPLE_MESOCRYSTALITEM_H
16 #define BORNAGAIN_GUI_MODEL_SAMPLE_MESOCRYSTALITEM_H
17 
22 #include "Sample/Lattice/Lattice3D.h"
23 #include <memory>
24 
25 class IFormFactor;
26 class IParticle;
27 class MesoCrystal;
28 class MaterialItems;
29 
31 public:
32  explicit MesoCrystalItem(const MaterialItems* materials);
33  void serialize(Streamer& s) override;
34 
35  std::unique_ptr<MesoCrystal> createMesoCrystal() const;
36 
37  Lattice3D getLattice() const;
38  std::unique_ptr<IParticle> getBasis() const;
39 
40  std::unique_ptr<IFormFactor> getOuterShape() const;
41  template <typename T>
42  T* setOuterShapeType();
43 
46 
48  void setBasis(ItemWithParticles* basis);
49 
50  void setRawDataVectorA(const R3& vector_a);
51  void setRawDataVectorB(const R3& vector_b);
52  void setRawDataVectorC(const R3& vector_c);
53 
54  VectorDescriptor vectorA() const;
55  VectorDescriptor vectorB() const;
56  VectorDescriptor vectorC() const;
57 
58  QVector<ItemWithParticles*> containedItemsWithParticles() const override;
59 
60 private:
67 };
68 
69 template <typename T>
71 {
72  auto* p = new T();
73  setOuterShape(p);
74  return p;
75 }
76 
77 #endif // BORNAGAIN_GUI_MODEL_SAMPLE_MESOCRYSTALITEM_H
Defines FormFactorItems classes.
Defines abstract item with a material property.
Defines class SelectionProperty.
Defines class VectorProperty.
void setRawDataVectorA(const R3 &vector_a)
void setOuterShape(FormFactorItem *p)
std::unique_ptr< IFormFactor > getOuterShape() const
void setRawDataVectorC(const R3 &vector_c)
VectorDescriptor vectorB() const
VectorDescriptor vectorC() const
void setRawDataVectorB(const R3 &vector_b)
void setBasis(ItemWithParticles *basis)
VectorProperty m_vectorB
const MaterialItems * m_materials
VectorProperty m_vectorC
std::unique_ptr< MesoCrystal > createMesoCrystal() const
SelectionProperty< FormFactorItem * > m_outerShape
std::unique_ptr< IParticle > getBasis() const
VectorDescriptor vectorA() const
SelectionDescriptor< FormFactorItem * > outerShape() const
VectorProperty m_vectorA
Lattice3D getLattice() const
MesoCrystalItem(const MaterialItems *materials)
void serialize(Streamer &s) override
SelectionProperty< ItemWithParticles * > m_basisParticle
ItemWithParticles * basisParticle() const
QVector< ItemWithParticles * > containedItemsWithParticles() const override
Return full hierarchical contained items with particles.
Describes a selection (various possibilities and the current one).
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36
Describes properties of a 3D vector, consisting of three double values.
Holds a 3D vector of type R3 as well as additional info like label, tooltip.