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

Description

The RealDataMaskWidget class provides mask editing for RealDataItem on ImportDataView.

Definition at line 28 of file RealDataMaskWidget.h.

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

Public Member Functions

 RealDataMaskWidget (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 ()
 
MaskContainerItemmaskContainer (IntensityDataItem *intensityData)
 

Private Attributes

SessionItemControllerm_itemController
 
MaskEditorm_maskEditor
 

Constructor & Destructor Documentation

◆ RealDataMaskWidget()

RealDataMaskWidget::RealDataMaskWidget ( QWidget *  parent = nullptr)

Definition at line 23 of file RealDataMaskWidget.cpp.

24  : SessionItemWidget(parent)
26 {
27  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
28 
29  auto* hlayout = new QHBoxLayout;
30  hlayout->setMargin(0);
31  hlayout->setSpacing(0);
32 
33  hlayout->addWidget(m_maskEditor);
34 
35  auto* mainLayout = new QVBoxLayout;
36  mainLayout->setMargin(0);
37  mainLayout->setSpacing(0);
38 
39  mainLayout->addLayout(hlayout);
40  setLayout(mainLayout);
41 }
Main class to draw masks on top of intensity data map.
Definition: MaskEditor.h:31
MaskEditor * m_maskEditor
SessionItemWidget(QWidget *parent=nullptr)

References m_maskEditor.

Member Function Documentation

◆ actionList()

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

Reimplemented from SessionItemWidget.

Definition at line 43 of file RealDataMaskWidget.cpp.

44 {
46 }
QList< QAction * > topToolbarActions()
Returns list of actions intended for styled toolbar (on the top).
Definition: MaskEditor.cpp:87

References m_maskEditor, and MaskEditor::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 * RealDataMaskWidget::intensityDataItem ( )
private

Definition at line 61 of file RealDataMaskWidget.cpp.

62 {
63  IntensityDataItem* result = dynamic_cast<RealDataItem*>(currentItem())->intensityDataItem();
64  ASSERT(result);
65  return result;
66 }
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33
IntensityDataItem * intensityDataItem()

References SessionItemWidget::currentItem().

Referenced by subscribeToItem().

Here is the call graph for this function:

◆ maskContainer()

MaskContainerItem * RealDataMaskWidget::maskContainer ( IntensityDataItem intensityData)
private

Definition at line 68 of file RealDataMaskWidget.cpp.

69 {
70  MaskContainerItem* containerItem = intensityData->getOrCreateMaskContainerItem();
71  ASSERT(containerItem);
72  return containerItem;
73 }
MaskContainerItem * getOrCreateMaskContainerItem()
Container holding various masks as children.
Definition: MaskItems.h:202

References IntensityDataItem::getOrCreateMaskContainerItem().

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 RealDataMaskWidget::subscribeToItem ( )
overrideprotectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 48 of file RealDataMaskWidget.cpp.

49 {
50  auto* intensityItem = intensityDataItem();
51  auto* container = maskContainer(intensityItem);
52  m_maskEditor->setMaskContext(intensityItem->model(), container->index(), intensityItem);
53  m_maskEditor->update();
54 }
void setMaskContext(SessionModel *model, const QModelIndex &maskContainerIndex, IntensityDataItem *intensityItem)
Main method to setup context for mask editing.
Definition: MaskEditor.cpp:51
MaskContainerItem * maskContainer(IntensityDataItem *intensityData)

References intensityDataItem(), m_maskEditor, maskContainer(), and MaskEditor::setMaskContext().

Here is the call graph for this function:

◆ unsubscribeFromItem()

void RealDataMaskWidget::unsubscribeFromItem ( )
overrideprotectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 56 of file RealDataMaskWidget.cpp.

57 {
59 }
void resetContext()
Definition: MaskEditor.cpp:67

References m_maskEditor, and MaskEditor::resetContext().

Here is the call graph for this function:

Member Data Documentation

◆ m_itemController

◆ m_maskEditor

MaskEditor* RealDataMaskWidget::m_maskEditor
private

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