BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
RealDataPresenter.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Import/RealDataPresenter.cpp
6 //! @brief Implements class RealDataPresenter
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 
17 #include "GUI/Util/Error.h"
23 #include <QAction>
24 
26  : ItemComboWidget(parent)
27 {
28  registerWidget("Heat Map", create_new<IntensityDataWidget>);
29  registerWidget("Projections", create_new<IntensityDataProjectionsWidget>);
30  registerWidget("Mask Editor", create_new<RealDataMaskWidget>);
31  registerWidget("Reflectometry (Graph only)", create_new<SpecularDataWidget>);
32  registerWidget("Reflectometry (Configuration)", create_new<SpecularDataImportWidget>);
33 }
34 
36 {
37  return QList<QAction*>();
38 }
39 
41 {
42  auto* const realDataItem = dynamic_cast<RealDataItem*>(item);
43  ASSERT(realDataItem);
44 
45  QStringList result;
46  if (realDataItem->isIntensityData())
47  result << "Heat Map"
48  << "Projections"
49  << "Mask Editor";
50  else if (realDataItem->isSpecularData()) {
51  if (realDataItem->dataLoader() != nullptr)
52  result << "Reflectometry (Configuration)";
53  result << "Reflectometry (Graph only)";
54  } else
55  throw Error("Error in RealDataPresenter::activePresentationList: unsupported data type");
56  return result;
57 }
Defines error class.
Defines class IntensityDataProjectionsWidget.
Defines class IntensityDataWidget.
Defines class RealDataItem.
Defines class RealDataMaskWidget.
Defines class RealDataPresenter.
Defines class SpecularDataImportWidget.
Defines class SpecularDataWidget.
The ItemComboWidget class combines stack of widgets with QComboBox controller to switch between widge...
void registerWidget(const QString &presentationType, factory_function_t)
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33
RealDataPresenter(QWidget *parent=nullptr)
QStringList activePresentationList(SessionItem *item) override
Returns list of active presentations for given item. Active presentation is the one which is present ...
QList< QAction * > actionList() override
Base class for a GUI data item.
Definition: SessionItem.h:204