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

GISAS beam editor. Operates on GISASInstrumentItem. More...

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

Public Member Functions

 GISASBeamEditor (ColumnResizer *columnResizer, QWidget *parent=nullptr)
 
virtual 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

BeamItembeamItem ()
 
GISASInstrumentIteminstrumentItem ()
 
void onDialogRequest (SessionItem *item, const QString &name)
 

Private Attributes

ComponentEditorm_azimuthalEditor
 
ColumnResizerm_columnResizer
 
QGridLayout * m_gridLayout
 
ComponentEditorm_inclinationEditor
 
ComponentEditorm_intensityEditor
 
SessionItemControllerm_itemController
 
ComponentEditorm_wavelengthEditor
 

Detailed Description

GISAS beam editor. Operates on GISASInstrumentItem.

Definition at line 28 of file GISASBeamEditor.h.

Constructor & Destructor Documentation

◆ GISASBeamEditor()

GISASBeamEditor::GISASBeamEditor ( ColumnResizer columnResizer,
QWidget *  parent = nullptr 
)
explicit

Definition at line 31 of file GISASBeamEditor.cpp.

32  : SessionItemWidget(parent)
33  , m_columnResizer(columnResizer)
38  , m_gridLayout(new QGridLayout)
39 {
40  m_gridLayout->addWidget(m_intensityEditor, 0, 0);
41  m_gridLayout->addWidget(m_wavelengthEditor, 1, 0);
42  m_gridLayout->addWidget(m_inclinationEditor, 1, 1);
43  m_gridLayout->addWidget(m_azimuthalEditor, 1, 2);
44 
45  auto mainLayout = new QVBoxLayout;
46  mainLayout->addLayout(m_gridLayout);
47  mainLayout->addStretch();
48  setLayout(mainLayout);
49 
56 
60 }
void addWidgetsFromGridLayout(QGridLayout *, int column)
Component editor for SessionItem.
void dialogRequest(SessionItem *item, const QString &names)
ComponentEditor * m_wavelengthEditor
QGridLayout * m_gridLayout
ComponentEditor * m_intensityEditor
ComponentEditor * m_inclinationEditor
void onDialogRequest(SessionItem *item, const QString &name)
ColumnResizer * m_columnResizer
ComponentEditor * m_azimuthalEditor
SessionItemWidget(QWidget *parent=0)

References ColumnResizer::addWidgetsFromGridLayout(), ComponentEditor::dialogRequest(), m_azimuthalEditor, m_columnResizer, m_gridLayout, m_inclinationEditor, m_intensityEditor, m_wavelengthEditor, and onDialogRequest().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

QList< QAction * > SessionItemWidget::actionList ( )
virtualinherited

◆ beamItem()

BeamItem * GISASBeamEditor::beamItem ( )
private

Definition at line 91 of file GISASBeamEditor.cpp.

92 {
93  return instrumentItem()->beamItem();
94 }
GISASInstrumentItem * instrumentItem()
virtual BeamItem * beamItem() const

References InstrumentItem::beamItem(), and instrumentItem().

Referenced by subscribeToItem().

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(), instrumentItem(), GISASDetectorEditor::instrumentItem(), GISASInstrumentEditor::instrumentItem(), OffSpecularBeamEditor::instrumentItem(), OffSpecularInstrumentEditor::instrumentItem(), PolarizationAnalysisEditor::instrumentItem(), SpecularBeamEditor::instrumentItem(), SpecularInstrumentEditor::instrumentItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataProjectionsWidget::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:

◆ instrumentItem()

GISASInstrumentItem * GISASBeamEditor::instrumentItem ( )
private

Definition at line 84 of file GISASBeamEditor.cpp.

85 {
86  auto result = dynamic_cast<GISASInstrumentItem*>(currentItem());
87  ASSERT(result);
88  return result;
89 }
#define ASSERT(condition)
Definition: Assert.h:31

References ASSERT, and SessionItemWidget::currentItem().

Referenced by beamItem().

Here is the call graph for this function:

◆ onDialogRequest()

void GISASBeamEditor::onDialogRequest ( SessionItem item,
const QString &  name 
)
private

Definition at line 96 of file GISASBeamEditor.cpp.

97 {
98  if (!item)
99  return;
100 
101  auto dialog = new DistributionDialog(this);
102  dialog->setItem(item);
103  dialog->setNameOfEditor(name);
104  dialog->show();
105 }
The dialog which shows an editor to change parameters of DistributionItem.
QString const & name(EShape k)
Definition: particles.cpp:21

References RealSpace::Particles::name().

Referenced by GISASBeamEditor().

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 GISASBeamEditor::subscribeToItem ( )
protectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 62 of file GISASBeamEditor.cpp.

63 {
65 
66  auto wavelengthItem = beamItem()->getItem(BeamItem::P_WAVELENGTH);
68 
69  auto inclinationItem = beamItem()->getItem(BeamItem::P_INCLINATION_ANGLE);
71 
72  auto azimuthalItem = beamItem()->getItem(BeamItem::P_AZIMUTHAL_ANGLE);
74 }
static const QString P_DISTRIBUTION
static const QString P_AZIMUTHAL_ANGLE
Definition: BeamItems.h:31
static const QString P_WAVELENGTH
Definition: BeamItems.h:29
static const QString P_INCLINATION_ANGLE
Definition: BeamItems.h:30
static const QString P_INTENSITY
Definition: BeamItems.h:28
void setItem(SessionItem *item)
BeamItem * beamItem()
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.

References beamItem(), SessionItem::getItem(), m_azimuthalEditor, m_inclinationEditor, m_intensityEditor, m_wavelengthEditor, BeamItem::P_AZIMUTHAL_ANGLE, BeamDistributionItem::P_DISTRIBUTION, BeamItem::P_INCLINATION_ANGLE, BeamItem::P_INTENSITY, BeamItem::P_WAVELENGTH, and ComponentEditor::setItem().

Here is the call graph for this function:

◆ unsubscribeFromItem()

void GISASBeamEditor::unsubscribeFromItem ( )
protectedvirtual

Reimplemented from SessionItemWidget.

Definition at line 76 of file GISASBeamEditor.cpp.

References ComponentEditor::clearEditor(), m_azimuthalEditor, m_inclinationEditor, m_intensityEditor, and m_wavelengthEditor.

Here is the call graph for this function:

Member Data Documentation

◆ m_azimuthalEditor

ComponentEditor* GISASBeamEditor::m_azimuthalEditor
private

Definition at line 47 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor(), subscribeToItem(), and unsubscribeFromItem().

◆ m_columnResizer

ColumnResizer* GISASBeamEditor::m_columnResizer
private

Definition at line 43 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor().

◆ m_gridLayout

QGridLayout* GISASBeamEditor::m_gridLayout
private

Definition at line 48 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor().

◆ m_inclinationEditor

ComponentEditor* GISASBeamEditor::m_inclinationEditor
private

Definition at line 46 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor(), subscribeToItem(), and unsubscribeFromItem().

◆ m_intensityEditor

ComponentEditor* GISASBeamEditor::m_intensityEditor
private

Definition at line 44 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor(), subscribeToItem(), and unsubscribeFromItem().

◆ m_itemController

◆ m_wavelengthEditor

ComponentEditor* GISASBeamEditor::m_wavelengthEditor
private

Definition at line 45 of file GISASBeamEditor.h.

Referenced by GISASBeamEditor(), subscribeToItem(), and unsubscribeFromItem().


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