BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
IntensityDataProjectionsWidget Class Reference

Description

Main widget to embed projections editor for IntensityDataItem. Part of RealDataPresenter and JobResultsPresenter.

Definition at line 27 of file IntensityDataProjectionsWidget.h.

Inheritance diagram for IntensityDataProjectionsWidget:
[legend]
Collaboration diagram for IntensityDataProjectionsWidget:
[legend]

Public Member Functions

 IntensityDataProjectionsWidget (QWidget *parent=nullptr)
 
QList< QAction * > actionList () override
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
virtual void setItem (SessionItem *item)
 

Protected Member Functions

void hideEvent (QHideEvent *) override
 
void showEvent (QShowEvent *) override
 
void subscribeToItem () override
 
void unsubscribeFromItem () override
 

Private Member Functions

IntensityDataItemintensityDataItem ()
 
ProjectionContainerItemprojectionContainer (IntensityDataItem *intensityItem)
 

Private Attributes

SessionItemControllerm_itemController
 
ProjectionsEditorm_projectionsEditor
 

Constructor & Destructor Documentation

◆ IntensityDataProjectionsWidget()

IntensityDataProjectionsWidget::IntensityDataProjectionsWidget ( QWidget *  parent = nullptr)

Definition at line 22 of file IntensityDataProjectionsWidget.cpp.

23  : SessionItemWidget(parent)
25 {
26  auto* vlayout = new QVBoxLayout;
27  vlayout->setMargin(0);
28  vlayout->setSpacing(0);
29  vlayout->addWidget(m_projectionsEditor);
30  setLayout(vlayout);
31 }
Editor to draw projections on top of intensity plot. Part of.
SessionItemWidget(QWidget *parent=nullptr)

References m_projectionsEditor.

Member Function Documentation

◆ actionList()

QList< QAction * > IntensityDataProjectionsWidget::actionList ( )
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 33 of file IntensityDataProjectionsWidget.cpp.

34 {
36 }
QList< QAction * > topToolbarActions()

References m_projectionsEditor, and ProjectionsEditor::topToolbarActions().

Here is the call graph for this function:

◆ currentItem() [1/2]

◆ currentItem() [2/2]

const SessionItem * SessionItemWidget::currentItem ( ) const
inherited

Definition at line 46 of file SessionItemWidget.cpp.

47 {
48  return m_itemController->currentItem();
49 }
SessionItemController * m_itemController

References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.

Here is the call graph for this function:

◆ hideEvent()

void SessionItemWidget::hideEvent ( QHideEvent *  )
overrideprotectedinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals. Controller stays active to track item de...

References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().

Here is the call graph for this function:

◆ intensityDataItem()

IntensityDataItem * IntensityDataProjectionsWidget::intensityDataItem ( )
private

Definition at line 51 of file IntensityDataProjectionsWidget.cpp.

52 {
54 }
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.

References SessionItemWidget::currentItem(), and GUI::Model::DataItemUtils::intensityDataItem().

Referenced by subscribeToItem().

Here is the call graph for this function:

◆ projectionContainer()

ProjectionContainerItem * IntensityDataProjectionsWidget::projectionContainer ( IntensityDataItem intensityItem)
private

Definition at line 57 of file IntensityDataProjectionsWidget.cpp.

58 {
59  ASSERT(intensityItem);
60 
61  ProjectionContainerItem* containerItem = intensityItem->getOrCreateProjectionContainerItem();
62  ASSERT(containerItem);
63  return containerItem;
64 }
ProjectionContainerItem * getOrCreateProjectionContainerItem()
A container to hold ProjectionItems, intended to store projections of color map on X,...

References IntensityDataItem::getOrCreateProjectionContainerItem().

Referenced by subscribeToItem().

Here is the call graph for this function:

◆ setItem()

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotectedinherited

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }

References SessionItemWidget::m_itemController, and SessionItemController::subscribe().

Here is the call graph for this function:

◆ subscribeToItem()

void IntensityDataProjectionsWidget::subscribeToItem ( )
overrideprotectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 38 of file IntensityDataProjectionsWidget.cpp.

39 {
40  auto* container = projectionContainer(intensityDataItem());
41 
42  m_projectionsEditor->setContext(intensityDataItem()->model(), container->index(),
44 }
ProjectionContainerItem * projectionContainer(IntensityDataItem *intensityItem)
void setContext(SessionModel *model, const QModelIndex &shapeContainerIndex, IntensityDataItem *intensityItem)
QModelIndex index() const
Returns model index of this item.
Definition: SessionItem.cpp:74

References SessionItem::index(), intensityDataItem(), m_projectionsEditor, projectionContainer(), and ProjectionsEditor::setContext().

Here is the call graph for this function:

◆ unsubscribeFromItem()

void IntensityDataProjectionsWidget::unsubscribeFromItem ( )
overrideprotectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 46 of file IntensityDataProjectionsWidget.cpp.

References m_projectionsEditor, and ProjectionsEditor::resetContext().

Here is the call graph for this function:

Member Data Documentation

◆ m_itemController

◆ m_projectionsEditor

ProjectionsEditor* IntensityDataProjectionsWidget::m_projectionsEditor
private

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