BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
IntensityDataProjectionsWidget.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Projection/IntensityDataProjectionsWidget.cpp
6 //! @brief Defines class IntensityDataProjectionsWidget
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 
20 #include <QVBoxLayout>
21 
23  : SessionItemWidget(parent)
24  , m_projectionsEditor(new ProjectionsEditor(this))
25 {
26  auto* vlayout = new QVBoxLayout;
27  vlayout->setMargin(0);
28  vlayout->setSpacing(0);
29  vlayout->addWidget(m_projectionsEditor);
30  setLayout(vlayout);
31 }
32 
34 {
36 }
37 
39 {
40  auto* container = projectionContainer(intensityDataItem());
41 
42  m_projectionsEditor->setContext(intensityDataItem()->model(), container->index(),
44 }
45 
47 {
49 }
50 
52 {
54 }
55 
58 {
59  ASSERT(intensityItem);
60 
61  ProjectionContainerItem* containerItem = intensityItem->getOrCreateProjectionContainerItem();
62  ASSERT(containerItem);
63  return containerItem;
64 }
Defines functions in namespace GUI::Model::DataItemUtils.
Defines class IntensityDataItem.
Defines class IntensityDataProjectionsWidget.
Defines items related to projections over color map.
Defines class ProjectionsEditor.
ProjectionContainerItem * getOrCreateProjectionContainerItem()
IntensityDataProjectionsWidget(QWidget *parent=nullptr)
ProjectionContainerItem * projectionContainer(IntensityDataItem *intensityItem)
A container to hold ProjectionItems, intended to store projections of color map on X,...
Editor to draw projections on top of intensity plot. Part of.
void setContext(SessionModel *model, const QModelIndex &shapeContainerIndex, IntensityDataItem *intensityItem)
QList< QAction * > topToolbarActions()
The SessionItemWidget class is a base for all widgets representing the content of SessionItem....
SessionItem * currentItem()
QModelIndex index() const
Returns model index of this item.
Definition: SessionItem.cpp:74
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.