BornAgain  1.19.0
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/coregui/Views/ImportDataWidgets/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 
23 #include <QAction>
24 
26 {
27  registerWidget("Color Map", create_new<IntensityDataWidget>);
28  registerWidget("Projections", create_new<IntensityDataProjectionsWidget>);
29  registerWidget("Mask Editor", create_new<RealDataMaskWidget>);
30  registerWidget("Reflectometry (Graph only)", create_new<SpecularDataWidget>);
31  registerWidget("Reflectometry (Configuration)", create_new<SpecularDataImportWidget>);
32 }
33 
35 {
36  return QList<QAction*>();
37 }
38 
40 {
41  const auto realDataItem = dynamic_cast<RealDataItem*>(item);
42  ASSERT(realDataItem);
43 
44  QStringList result;
45  if (realDataItem->isIntensityData())
46  result << "Color Map"
47  << "Projections"
48  << "Mask Editor";
49  else if (realDataItem->isSpecularData()) {
50  if (realDataItem->dataLoader() != nullptr)
51  result << "Reflectometry (Configuration)";
52  result << "Reflectometry (Graph only)";
53  } else
54  throw GUIHelpers::Error(
55  "Error in RealDataPresenter::activePresentationList: unsupported data type");
56  return result;
57 }
#define ASSERT(condition)
Definition: Assert.h:31
Defines class GUIHelpers functions.
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)
The RealDataItem class represents intensity data imported from file and intended for fitting.
Definition: RealDataItem.h:35
RealDataPresenter(QWidget *parent=nullptr)
QList< QAction * > actionList()
QStringList activePresentationList(SessionItem *item)
Returns list of active presentations for given item.