BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SampleViewFactory Class Reference

Static Public Member Functions

static IViewcreateSampleView (const QString &name)
 
static bool isValidExampleName ()
 
static bool isValidType (const QString &name)
 

Static Private Attributes

static QStringList m_valid_item_names
 

Detailed Description

Definition at line 23 of file SampleViewFactory.h.

Member Function Documentation

◆ createSampleView()

IView * SampleViewFactory::createSampleView ( const QString &  name)
static

Definition at line 53 of file SampleViewFactory.cpp.

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 }
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
QString const & name(EShape k)
Definition: particles.cpp:21

References RealSpace::Particles::name().

Referenced by DesignerScene::addViewForItem().

Here is the call graph for this function:

◆ isValidExampleName()

static bool SampleViewFactory::isValidExampleName ( )
static

◆ isValidType()

bool SampleViewFactory::isValidType ( const QString &  name)
static

Definition at line 44 of file SampleViewFactory.cpp.

45 {
46  if (name.startsWith("FormFactor")) {
47  return true;
48  } else {
49  return m_valid_item_names.contains(name);
50  }
51 }
static QStringList m_valid_item_names

References m_valid_item_names, and RealSpace::Particles::name().

Referenced by DesignerScene::dropEvent(), and DesignerScene::updateViews().

Here is the call graph for this function:

Member Data Documentation

◆ m_valid_item_names

QStringList SampleViewFactory::m_valid_item_names
staticprivate
Initial value:
= QStringList()
<< "MultiLayer"
<< "Layer"
<< "ParticleLayout"
<< "Particle"
<< "Rotation"
<< "ParticleCoreShell"
<< "ParticleComposition"
<< "MesoCrystal"
<< "ParticleDistribution"
<< "Interference1DLattice"
<< "Interference2DLattice"
<< "Interference2DParaCrystal"
<< "InterferenceFinite2DLattice"
<< "InterferenceHardDisk"
<< "InterferenceRadialParaCrystal"

Definition at line 31 of file SampleViewFactory.h.

Referenced by isValidType().


The documentation for this class was generated from the following files: