BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SampleViewFactory.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/SampleViewFactory.cpp
6 //! @brief Implements class SampleViewFactory
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 
26 
27 QStringList SampleViewFactory::m_valid_item_names = QStringList()
28  << "MultiLayer"
29  << "Layer"
30  << "ParticleLayout"
31  << "Particle"
32  << "Rotation"
33  << "ParticleCoreShell"
34  << "ParticleComposition"
35  << "MesoCrystal"
36  << "ParticleDistribution"
37  << "Interference1DLattice"
38  << "Interference2DLattice"
39  << "Interference2DParaCrystal"
40  << "InterferenceFinite2DLattice"
41  << "InterferenceHardDisk"
42  << "InterferenceRadialParaCrystal";
43 
45 {
46  if (name.startsWith("FormFactor")) {
47  return true;
48  } else {
49  return m_valid_item_names.contains(name);
50  }
51 }
52 
54 {
55  if (name == "MultiLayer") {
56  return new MultiLayerView();
57  } else if (name == "Layer") {
58  return new LayerView();
59  } else if (name == "ParticleLayout") {
60  return new ParticleLayoutView();
61  } else if (name == "Particle") {
62  return new ParticleView();
63  } else if (name == "Rotation") {
64  return new TransformationView();
65  } else if (name == "ParticleCoreShell") {
66  return new ParticleCoreShellView();
67  } else if (name == "ParticleComposition") {
68  return new ParticleCompositionView();
69  } else if (name == "MesoCrystal") {
70  return new MesoCrystalView();
71  } else if (name == "ParticleDistribution") {
72  return new ParticleDistributionView();
73  } else if (name == "Interference1DLattice") {
75  } else if (name == "Interference2DLattice") {
77  } else if (name == "Interference2DParaCrystal") {
79  } else if (name == "InterferenceFinite2DLattice") {
81  } else if (name == "InterferenceHardDisk") {
83  } else if (name == "InterferenceRadialParaCrystal") {
85  }
86  return 0;
87 }
Defines classes InterferenceFunctionViews.
Defines class LayerView.
Defines class MesoCrystalView.
Defines class MultiLayerView.
Defines class ParticleCompositionView.
Defines class ParticleCoreShellView.
Defines class ParticleDistributionView.
Defines class ParticleLayoutView.
Defines class ParticleView.
Defines class SampleViewFactory.
Defines class TransformationView.
parent class for graphic representation of all ISampleNode's
Definition: IView.h:25
Class that represents view of Layer.
Definition: LayerView.h:21
Class representing view of a meso crystal item.
Class representing view of MultiLayer.
Class representing view of Particle item.
Class representing view of Particle item.
Class representing view of distributed particle item.
Class representing view of Particle item.
Definition: ParticleView.h:22
static IView * createSampleView(const QString &name)
static QStringList m_valid_item_names
static bool isValidType(const QString &name)
QString const & name(EShape k)
Definition: particles.cpp:21