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

Holds tabs of vertical and horizontal projections, located at the bottom of ProjectionsEditor. More...

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

Public Types

enum  ETabId { HORIZONTAL , VERTICAL }
 

Public Slots

void onActivityModeChanged (MaskEditorFlags::Activity value)
 
void onMarginsChanged (double left, double right)
 

Signals

void changeActivityRequest (MaskEditorFlags::Activity value)
 

Public Member Functions

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

Protected Member Functions

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

Private Slots

void onTabChanged (int tab_index)
 

Private Member Functions

void setConnected (bool isConnected)
 

Private Attributes

SessionItemControllerm_itemController
 
QTabWidget * m_tabWidget
 
ProjectionsPlotm_xProjection
 
ProjectionsPlotm_yProjection
 

Detailed Description

Holds tabs of vertical and horizontal projections, located at the bottom of ProjectionsEditor.

Definition at line 26 of file ProjectionsWidget.h.

Member Enumeration Documentation

◆ ETabId

Enumerator
HORIZONTAL 
VERTICAL 

Definition at line 30 of file ProjectionsWidget.h.

Constructor & Destructor Documentation

◆ ProjectionsWidget()

ProjectionsWidget::ProjectionsWidget ( QWidget *  parent = 0)

Definition at line 25 of file ProjectionsWidget.cpp.

26  : SessionItemWidget(parent)
27  , m_xProjection(new ProjectionsPlot("HorizontalLineMask"))
28  , m_yProjection(new ProjectionsPlot("VerticalLineMask"))
29  , m_tabWidget(new QTabWidget)
30 {
31  QVBoxLayout* layout = new QVBoxLayout;
32  layout->setMargin(0);
33  layout->setSpacing(0);
34 
35  m_tabWidget->setTabPosition(QTabWidget::North);
36  m_tabWidget->insertTab(HORIZONTAL, m_xProjection, "Horizontal");
37  m_tabWidget->insertTab(VERTICAL, m_yProjection, "Vertical");
38 
39  layout->addWidget(m_tabWidget);
40  setLayout(layout);
41 
42  setConnected(true);
43 }
A customplot based widget to display projections of IntensityDataItem on X,Y axes.
ProjectionsPlot * m_yProjection
void setConnected(bool isConnected)
QTabWidget * m_tabWidget
ProjectionsPlot * m_xProjection
SessionItemWidget(QWidget *parent=0)

References HORIZONTAL, m_tabWidget, m_xProjection, m_yProjection, setConnected(), and VERTICAL.

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

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

◆ changeActivityRequest

void ProjectionsWidget::changeActivityRequest ( MaskEditorFlags::Activity  value)
signal

◆ 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(), 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:

◆ onActivityModeChanged

void ProjectionsWidget::onActivityModeChanged ( MaskEditorFlags::Activity  value)
slot

Definition at line 52 of file ProjectionsWidget.cpp.

53 {
54  setConnected(false);
55 
57  m_tabWidget->setCurrentIndex(horizontal_projection_tab);
58  else if (value == MaskEditorFlags::VERTICAL_LINE_MODE)
59  m_tabWidget->setCurrentIndex(vertical_projection_tab);
60 
61  setConnected(true);
62 }

References MaskEditorFlags::HORIZONTAL_LINE_MODE, m_tabWidget, setConnected(), and MaskEditorFlags::VERTICAL_LINE_MODE.

Referenced by ProjectionsEditor::setup_connections().

Here is the call graph for this function:

◆ onMarginsChanged

void ProjectionsWidget::onMarginsChanged ( double  left,
double  right 
)
slot

Definition at line 64 of file ProjectionsWidget.cpp.

65 {
66  m_xProjection->onMarginsChanged(left, right);
67  m_yProjection->onMarginsChanged(left, right);
68 }
void onMarginsChanged(double left, double right)

References m_xProjection, m_yProjection, and ProjectionsPlot::onMarginsChanged().

Referenced by ProjectionsEditor::setup_connections().

Here is the call graph for this function:

◆ onTabChanged

void ProjectionsWidget::onTabChanged ( int  tab_index)
privateslot

Definition at line 70 of file ProjectionsWidget.cpp.

71 {
72  if (tab_index == horizontal_projection_tab)
74  else if (tab_index == vertical_projection_tab)
76 }
void changeActivityRequest(MaskEditorFlags::Activity value)

References changeActivityRequest(), MaskEditorFlags::HORIZONTAL_LINE_MODE, and MaskEditorFlags::VERTICAL_LINE_MODE.

Referenced by setConnected().

◆ setConnected()

void ProjectionsWidget::setConnected ( bool  isConnected)
private

Definition at line 78 of file ProjectionsWidget.cpp.

79 {
80  if (isConnected)
81  connect(m_tabWidget, &QTabWidget::currentChanged, this, &ProjectionsWidget::onTabChanged);
82  else
83  disconnect(m_tabWidget, &QTabWidget::currentChanged, this,
85 }
void onTabChanged(int tab_index)

References m_tabWidget, and onTabChanged().

Referenced by ProjectionsWidget(), and onActivityModeChanged().

Here is the call graph for this function:

◆ setItem()

void ProjectionsWidget::setItem ( SessionItem intensityItem)
virtual

Reimplemented from SessionItemWidget.

Definition at line 45 of file ProjectionsWidget.cpp.

46 {
47  SessionItemWidget::setItem(intensityItem);
48  m_xProjection->setItem(intensityItem);
49  m_yProjection->setItem(intensityItem);
50 }
virtual void setItem(SessionItem *item)

References m_xProjection, m_yProjection, and SessionItemWidget::setItem().

Referenced by ProjectionsEditor::resetContext(), and ProjectionsEditor::setContext().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
protectedvirtualinherited

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

Member Data Documentation

◆ m_itemController

◆ m_tabWidget

QTabWidget* ProjectionsWidget::m_tabWidget
private

Definition at line 50 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onActivityModeChanged(), and setConnected().

◆ m_xProjection

ProjectionsPlot* ProjectionsWidget::m_xProjection
private

Definition at line 48 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onMarginsChanged(), and setItem().

◆ m_yProjection

ProjectionsPlot* ProjectionsWidget::m_yProjection
private

Definition at line 49 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onMarginsChanged(), and setItem().


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