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

Main widget to embed projections editor for IntensityDataItem. More...

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

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

IntensityDataItemintensityDataItem ()
 
ProjectionContainerItemprojectionContainer (IntensityDataItem *intensityItem)
 

Private Attributes

SessionItemControllerm_itemController
 
ProjectionsEditorm_projectionsEditor
 

Detailed Description

Main widget to embed projections editor for IntensityDataItem.

Part of RealDataPresenter and JobResultsPresenter.

Definition at line 27 of file IntensityDataProjectionsWidget.h.

Constructor & Destructor Documentation

◆ IntensityDataProjectionsWidget()

IntensityDataProjectionsWidget::IntensityDataProjectionsWidget ( QWidget *  parent = 0)

Definition at line 24 of file IntensityDataProjectionsWidget.cpp.

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

References m_projectionsEditor.

Member Function Documentation

◆ actionList()

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

Reimplemented from SessionItemWidget.

Definition at line 35 of file IntensityDataProjectionsWidget.cpp.

36 {
38 }
QList< QAction * > topToolBarActions()

References m_projectionsEditor, and ProjectionsEditor::topToolBarActions().

Here is the call graph for this function:

◆ currentItem() [1/2]

SessionItem * SessionItemWidget::currentItem ( )
inherited

Definition at line 41 of file SessionItemWidget.cpp.

42 {
43  return const_cast<SessionItem*>(static_cast<const SessionItemWidget*>(this)->currentItem());
44 }
The SessionItemWidget class is a base for all widgets representing the content of SessionItem.
SessionItem * currentItem()

Referenced by RectangularDetectorEditor::detectorItem(), SphericalDetectorEditor::detectorItem(), FitFlowWidget::fitSuiteItem(), DistributionEditor::groupItem(), DepthProbeInstrumentEditor::instrumentItem(), EnvironmentEditor::instrumentItem(), GISASBeamEditor::instrumentItem(), GISASDetectorEditor::instrumentItem(), GISASInstrumentEditor::instrumentItem(), OffSpecularBeamEditor::instrumentItem(), OffSpecularInstrumentEditor::instrumentItem(), PolarizationAnalysisEditor::instrumentItem(), SpecularBeamEditor::instrumentItem(), SpecularInstrumentEditor::instrumentItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), intensityDataItem(), IntensityDataWidget::intensityDataItem(), ProjectionsPlot::intensityItem(), ColorMap::intensityItem(), DetectorPresenter::itemPresentation(), InstrumentPresenter::itemPresentation(), JobResultsPresenter::itemPresentation(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), FitParameterWidget::jobItem(), RunFitControlWidget::jobItem(), JobPropertiesWidget::jobItem(), ParameterTuningWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataCanvas::specularDataItem(), SpecularDataImportWidget::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), DistributionEditor::subscribeToItem(), GISASDetectorEditor::subscribeToItem(), PolarizationAnalysisEditor::subscribeToItem(), IntensityDataPropertyWidget::subscribeToItem(), JobPropertiesWidget::subscribeToItem(), ProjectionsPropertyPanel::subscribeToItem(), ProjectionsPlot::unsubscribeFromChildren(), and Plot1D::viewItem().

◆ 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 *  )
protectedvirtualinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals.

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

Here is the call graph for this function:

◆ intensityDataItem()

IntensityDataItem * IntensityDataProjectionsWidget::intensityDataItem ( )
private

Definition at line 53 of file IntensityDataProjectionsWidget.cpp.

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

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

Referenced by subscribeToItem().

Here is the call graph for this function:

◆ projectionContainer()

ProjectionContainerItem * IntensityDataProjectionsWidget::projectionContainer ( IntensityDataItem intensityItem)
private

Definition at line 59 of file IntensityDataProjectionsWidget.cpp.

60 {
61  ASSERT(intensityItem);
62 
63  auto containerItem = intensityItem->getItem(IntensityDataItem::T_PROJECTIONS);
64  if (!containerItem)
65  containerItem = intensityItem->model()->insertNewItem("ProjectionContainer", intensityItem,
67 
68  return dynamic_cast<ProjectionContainerItem*>(containerItem);
69 }
#define ASSERT(condition)
Definition: Assert.h:31
static const QString T_PROJECTIONS
A container to hold ProjectionItems, intended to store projections of color map on X,...
SessionModel * model() const
Returns model of this item.
Definition: SessionItem.cpp:66
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem * insertNewItem(QString model_type, SessionItem *parent_item=nullptr, int row=-1, QString tag="")

References ASSERT, SessionItem::getItem(), SessionModel::insertNewItem(), SessionItem::model(), and IntensityDataItem::T_PROJECTIONS.

Referenced by subscribeToItem().

Here is the call graph for this function:

◆ setItem()

void SessionItemWidget::setItem ( SessionItem item)
virtualinherited

Reimplemented in SpecularPlotCanvas, SpecularDataImportWidget, SpecularDataWidget, IntensityDataWidget, SpecularDataCanvas, ProjectionsWidget, IntensityDataCanvas, ColorMapCanvas, and Plot1DCanvas.

Definition at line 28 of file SessionItemWidget.cpp.

29 {
31 
32  if (isVisible())
34 }
void setItem(SessionItem *item)
void subscribe()
Subscribe parent to item's signals.

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

Referenced by IntensityDataWidget::onFFTAction(), JobSelectorWidget::onSelectionChanged(), ProjectionsEditor::resetContext(), ProjectionsEditor::setContext(), MaskGraphicsProxy::setIntensityItem(), FitSessionWidget::setItem(), Plot1DCanvas::setItem(), InstrumentEditorWidget::setItem(), ColorMapCanvas::setItem(), IntensityDataCanvas::setItem(), ProjectionsWidget::setItem(), SpecularDataCanvas::setItem(), DistributionDialog::setItem(), IntensityDataWidget::setItem(), SpecularDataWidget::setItem(), SpecularDataImportWidget::setItem(), SpecularPlotCanvas::setItem(), ItemComboWidget::setPresentation(), GISASInstrumentEditor::subscribeToItem(), OffSpecularInstrumentEditor::subscribeToItem(), SpecularInstrumentEditor::subscribeToItem(), FitComparisonWidget::subscribeToItem(), FitComparisonWidget1D::subscribeToItem(), and GISASDetectorEditor::updateDetectorPresenter().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
protectedvirtualinherited

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 ( )
protectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 40 of file IntensityDataProjectionsWidget.cpp.

41 {
42  auto container = projectionContainer(intensityDataItem());
43 
44  m_projectionsEditor->setContext(intensityDataItem()->model(), container->index(),
46 }
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:80

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

Here is the call graph for this function:

◆ unsubscribeFromItem()

void IntensityDataProjectionsWidget::unsubscribeFromItem ( )
protectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 48 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: