BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI::ExamplesFactory Namespace Reference

Description

Class that generates GUI model from.

Functions

std::tuple< QString, QString > exampleInfo (const QString &name)
 Returns human readable name and description. More...
 
QStringList exampleNames ()
 The internal example name, e.g. for creation with itemizeSample. More...
 
bool isValidExampleName (const QString &name)
 
MultiLayerItemitemizeSample (const QString &name)
 Create a sample item of the built-in example with the given internal name. More...
 

Function Documentation

◆ exampleInfo()

std::tuple< QString, QString > GUI::ExamplesFactory::exampleInfo ( const QString &  name)

Returns human readable name and description.

Definition at line 83 of file GUIExamplesFactory.cpp.

84 {
85  ASSERT(isValidExampleName(name));
86  auto [title, description, builder] = builders[name];
87  return {title, description};
88 }
bool isValidExampleName(const QString &name)
QString const & name(EShape k)
Definition: particles.cpp:20

References isValidExampleName(), and GUI::RealSpace::Particles::name().

Referenced by SampleListView::SampleListView().

Here is the call graph for this function:

◆ exampleNames()

QStringList GUI::ExamplesFactory::exampleNames ( )

The internal example name, e.g. for creation with itemizeSample.

Definition at line 78 of file GUIExamplesFactory.cpp.

79 {
80  return builders.keys();
81 }

Referenced by SampleListView::SampleListView().

◆ isValidExampleName()

bool GUI::ExamplesFactory::isValidExampleName ( const QString &  name)

Definition at line 65 of file GUIExamplesFactory.cpp.

66 {
67  return builders.find(name) != builders.end();
68 }

References GUI::RealSpace::Particles::name().

Referenced by exampleInfo(), and itemizeSample().

Here is the call graph for this function:

◆ itemizeSample()

MultiLayerItem * GUI::ExamplesFactory::itemizeSample ( const QString &  name)

Create a sample item of the built-in example with the given internal name.

Definition at line 70 of file GUIExamplesFactory.cpp.

71 {
72  ASSERT(isValidExampleName(name));
73  MultiLayer* sample = std::get<2>(builders[name])();
74 
76 }
MultiLayerItem * itemizeSample(const MultiLayer &sample, const QString &nodeName)
Builds GUI sample structure from a domain sample structure.

References isValidExampleName(), GUI::Transform::FromCore::itemizeSample(), and GUI::RealSpace::Particles::name().

Referenced by SampleListModel::createSampleFromExamples().

Here is the call graph for this function: