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

Description

A common widget to display color map (IntensityDataCanvas) and properties (ItemPropertyWidget) of intensity data item.

Definition at line 32 of file IntensityDataWidget.h.

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

Public Member Functions

 IntensityDataWidget (QWidget *parent=nullptr)
 
QList< QAction * > actionList () override
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
void setItem (SessionItem *jobItem) override
 

Protected Member Functions

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

Private Slots

void onContextMenuRequest (const QPoint &point)
 
void onFFTAction ()
 

Private Member Functions

IntensityDataItemintensityDataItem ()
 

Private Attributes

IntensityDataFFTPresenterm_fftPresenter
 
IntensityDataCanvasm_intensityCanvas
 
SessionItemControllerm_itemController
 
IntensityDataPropertyWidgetm_propertyWidget
 
QAction * m_togglePropertiesAction
 

Constructor & Destructor Documentation

◆ IntensityDataWidget()

IntensityDataWidget::IntensityDataWidget ( QWidget *  parent = nullptr)

Definition at line 27 of file IntensityDataWidget.cpp.

28  : SessionItemWidget(parent)
32 {
33  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
34 
35  m_propertyWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
36 
37  auto* hlayout = new QHBoxLayout(this);
38  hlayout->setMargin(0);
39  hlayout->setSpacing(0);
40  hlayout->addWidget(m_intensityCanvas);
41  hlayout->addWidget(m_propertyWidget);
42 
43  connect(m_intensityCanvas, &IntensityDataCanvas::customContextMenuRequested, this,
45 
48 
51 
52 
53  m_propertyWidget->setVisible(false);
54 }
static QAction * createTogglePropertiesPanelAction(QObject *parent, QWidget *toggledWidget=nullptr)
Create "toggle properties panel" action.
The IntensityDataCanvas class represents IntensityDataItem as color map, provides standard actions (r...
Provides support in Fast Fourier transformation of IntensityDataItem. Contains own model to hold Inte...
Widget to edit properties of an IntensityDataItem.
IntensityDataCanvas * m_intensityCanvas
IntensityDataPropertyWidget * m_propertyWidget
void onContextMenuRequest(const QPoint &point)
QAction * m_togglePropertiesAction
IntensityDataFFTPresenter * m_fftPresenter
SessionItemWidget(QWidget *parent=nullptr)

References ActionFactory::createTogglePropertiesPanelAction(), IntensityDataFFTPresenter::fftActionRequest(), m_fftPresenter, m_intensityCanvas, m_propertyWidget, m_togglePropertiesAction, onContextMenuRequest(), and onFFTAction().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

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

Reimplemented from SessionItemWidget.

Definition at line 64 of file IntensityDataWidget.cpp.

65 {
67  + QList<QAction*>{m_togglePropertiesAction};
68 }
QList< QAction * > actionList() override

References IntensityDataFFTPresenter::actionList(), IntensityDataCanvas::actionList(), m_fftPresenter, m_intensityCanvas, and m_togglePropertiesAction.

Referenced by onContextMenuRequest().

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 * IntensityDataWidget::intensityDataItem ( )
private

Definition at line 94 of file IntensityDataWidget.cpp.

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

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

Referenced by onFFTAction(), and setItem().

Here is the call graph for this function:

◆ onContextMenuRequest

void IntensityDataWidget::onContextMenuRequest ( const QPoint &  point)
privateslot

Definition at line 70 of file IntensityDataWidget.cpp.

71 {
72  QMenu menu;
73  for (auto* action : actionList())
74  menu.addAction(action);
75  menu.exec(point);
76 }
QList< QAction * > actionList() override

References actionList().

Referenced by IntensityDataWidget().

Here is the call graph for this function:

◆ onFFTAction

void IntensityDataWidget::onFFTAction ( )
privateslot

Definition at line 78 of file IntensityDataWidget.cpp.

79 {
80  if (!intensityDataItem() || !intensityDataItem()->getDatafield())
81  return;
82 
83  if (m_fftPresenter->inFFTMode()) {
84  auto* fftItem = m_fftPresenter->fftItem(intensityDataItem());
85  m_intensityCanvas->setItem(fftItem);
86  m_propertyWidget->setItem(fftItem);
87  } else {
88  // returning ColorMap to non-fft presentation
91  }
92 }
void setItem(SessionItem *intensityItem) override
IntensityDataItem * fftItem(IntensityDataItem *origItem)
void setItem(IntensityDataItem *mainItem, IntensityDataItem *realItem=nullptr)
IntensityDataItem * intensityDataItem()

References IntensityDataFFTPresenter::fftItem(), IntensityDataFFTPresenter::inFFTMode(), intensityDataItem(), m_fftPresenter, m_intensityCanvas, m_propertyWidget, IntensityDataPropertyWidget::setItem(), and IntensityDataCanvas::setItem().

Referenced by IntensityDataWidget().

Here is the call graph for this function:

◆ setItem()

void IntensityDataWidget::setItem ( SessionItem jobItem)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 56 of file IntensityDataWidget.cpp.

References intensityDataItem(), m_fftPresenter, m_intensityCanvas, m_propertyWidget, IntensityDataFFTPresenter::reset(), IntensityDataPropertyWidget::setItem(), IntensityDataCanvas::setItem(), and SessionItemWidget::setItem().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotectedinherited

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }
void subscribe()
Subscribe parent to item's signals.

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

Here is the call graph for this function:

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_fftPresenter

IntensityDataFFTPresenter* IntensityDataWidget::m_fftPresenter
private

Definition at line 51 of file IntensityDataWidget.h.

Referenced by IntensityDataWidget(), actionList(), onFFTAction(), and setItem().

◆ m_intensityCanvas

IntensityDataCanvas* IntensityDataWidget::m_intensityCanvas
private

Definition at line 49 of file IntensityDataWidget.h.

Referenced by IntensityDataWidget(), actionList(), onFFTAction(), and setItem().

◆ m_itemController

◆ m_propertyWidget

IntensityDataPropertyWidget* IntensityDataWidget::m_propertyWidget
private

Definition at line 50 of file IntensityDataWidget.h.

Referenced by IntensityDataWidget(), onFFTAction(), and setItem().

◆ m_togglePropertiesAction

QAction* IntensityDataWidget::m_togglePropertiesAction
private

Definition at line 52 of file IntensityDataWidget.h.

Referenced by IntensityDataWidget(), and actionList().


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