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

Description

Editor to draw projections on top of intensity plot. Part of.

Definition at line 34 of file ProjectionsEditor.h.

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

Public Member Functions

 ProjectionsEditor (SessionItemWidget *upperSessionItemWidget=nullptr, QWidget *parent=nullptr)
 
void resetContext ()
 
void setContext (SessionModel *model, const QModelIndex &shapeContainerIndex, IntensityDataItem *intensityItem)
 
QList< QAction * > topToolbarActions ()
 

Private Member Functions

void setup_connections ()
 

Private Attributes

ProjectionsEditorActionsm_editorActions
 
ProjectionsEditorCanvasm_projectionsCanvas
 main tool bar with bottoms at the right More...
 
ProjectionsWidgetm_projectionsWidget
 canvas with color map at the top More...
 
IntensityDataPropertyWidgetm_propertyPanel
 bottom widget to draw projections plot More...
 
QItemSelectionModel * m_selectionModel
 panel at the right with properties More...
 
ProjectionsToolbarm_toolbar
 

Constructor & Destructor Documentation

◆ ProjectionsEditor()

ProjectionsEditor::ProjectionsEditor ( SessionItemWidget upperSessionItemWidget = nullptr,
QWidget *  parent = nullptr 
)

Definition at line 27 of file ProjectionsEditor.cpp.

28  : QMainWindow(parent)
34  upperSessionItemWidget)) // here not "this", because IntensityDataPropertyWidget requires
35  // access to jobItem
36  , m_selectionModel(nullptr)
37 {
38  addToolBar(Qt::RightToolBarArea, m_toolbar);
39 
40  auto* splitter = new QSplitter;
41  splitter->setOrientation(Qt::Vertical);
42  splitter->addWidget(m_projectionsCanvas);
43  splitter->addWidget(m_projectionsWidget);
44 
45  auto* centralWidget = new QWidget(this);
46  auto* hLayout = new QHBoxLayout(centralWidget);
47  hLayout->setContentsMargins(0, 0, 0, 0);
48  hLayout->setSpacing(0);
49  hLayout->addWidget(splitter);
50  hLayout->addWidget(m_propertyPanel);
51 
52  setCentralWidget(centralWidget);
53 
54  m_propertyPanel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
55  m_propertyPanel->setHidden(true);
57 }
Widget to edit properties of an IntensityDataItem.
Provides various actions for ProjectionsEditor.
Holds a graphics scene to draw projections on top of ColorMap. Being a part of ProjectionEditor,...
ProjectionsEditorCanvas * m_projectionsCanvas
main tool bar with bottoms at the right
IntensityDataPropertyWidget * m_propertyPanel
bottom widget to draw projections plot
QItemSelectionModel * m_selectionModel
panel at the right with properties
ProjectionsToolbar * m_toolbar
ProjectionsEditorActions * m_editorActions
ProjectionsWidget * m_projectionsWidget
canvas with color map at the top
Toolbar with projections buttons (horizontal projections, vertical projections, select,...
Holds tabs of vertical and horizontal projections, located at the bottom of ProjectionsEditor.

References m_projectionsCanvas, m_projectionsWidget, m_propertyPanel, m_toolbar, and setup_connections().

Here is the call graph for this function:

Member Function Documentation

◆ resetContext()

void ProjectionsEditor::resetContext ( )

Definition at line 77 of file ProjectionsEditor.cpp.

78 {
79  m_propertyPanel->setItem(nullptr);
81  m_projectionsWidget->setItem(nullptr);
82 }
void setItem(IntensityDataItem *mainItem, IntensityDataItem *realItem=nullptr)
void setItem(SessionItem *intensityItem) override

References m_projectionsCanvas, m_projectionsWidget, m_propertyPanel, ProjectionsEditorCanvas::resetContext(), IntensityDataPropertyWidget::setItem(), and ProjectionsWidget::setItem().

Referenced by IntensityDataProjectionsWidget::unsubscribeFromItem().

Here is the call graph for this function:

◆ setContext()

void ProjectionsEditor::setContext ( SessionModel model,
const QModelIndex &  shapeContainerIndex,
IntensityDataItem intensityItem 
)

Definition at line 59 of file ProjectionsEditor.cpp.

61 {
62  Q_UNUSED(model);
63  Q_UNUSED(shapeContainerIndex);
64 
65  delete m_selectionModel;
66  m_selectionModel = new QItemSelectionModel(model, this);
67 
68  m_propertyPanel->setItem(intensityItem);
70  m_projectionsCanvas->setContext(model, shapeContainerIndex, intensityItem);
71  m_projectionsWidget->setItem(intensityItem);
72 
73  m_editorActions->setContext(model, shapeContainerIndex, intensityItem);
75 }
void setContext(SessionModel *model, const QModelIndex &shapeContainerIndex, IntensityDataItem *intensityItem)
void setSelectionModel(QItemSelectionModel *selectionModel)
void setSelectionModel(QItemSelectionModel *model)
void setContext(SessionModel *model, const QModelIndex &shapeContainerIndex, IntensityDataItem *intensityItem)

References m_editorActions, m_projectionsCanvas, m_projectionsWidget, m_propertyPanel, m_selectionModel, ProjectionsEditorActions::setContext(), ProjectionsEditorCanvas::setContext(), IntensityDataPropertyWidget::setItem(), ProjectionsWidget::setItem(), ProjectionsEditorCanvas::setSelectionModel(), and ProjectionsEditorActions::setSelectionModel().

Referenced by IntensityDataProjectionsWidget::subscribeToItem().

Here is the call graph for this function:

◆ setup_connections()

void ProjectionsEditor::setup_connections ( )
private

Definition at line 89 of file ProjectionsEditor.cpp.

90 {
91  // tool panel request is propagated from editorActions to this MaskEditor
94 
95  // tool panel request is propagated from editorActions to this MaskEditor
97  [=]() { m_propertyPanel->setHidden(!m_propertyPanel->isHidden()); });
98 
99  // selection/drawing activity is propagated from Toolbar to graphics scene
102 
103  // selection/drawing activity is propagated from Toolbar to Projections Widget
106 
107  // click on projections tab is propagated to tool bar
110 
111  // Delete request is propagated from canvas to actions
114 
115  // space bar push (request for zoom mode) is propagated from graphics view to Toolbar
118 
119  // ColorMap margins changed, canvas -> projection widget
122 
124 }
void onActivityModeChanged(MaskEditorFlags::Activity value)
void changeActivityRequest(MaskEditorFlags::Activity)
void marginsChanged(double left, double right)
void activityModeChanged(MaskEditorFlags::Activity)
void onProjectionTabChange(MaskEditorFlags::Activity value)
Change activity only if current activity is one of drawing mode (horizontal, vertical projections dra...
void onChangeActivityRequest(MaskEditorFlags::Activity value)
void changeActivityRequest(MaskEditorFlags::Activity value)
void onActivityModeChanged(MaskEditorFlags::Activity value)
void onMarginsChanged(double left, double right)

References ProjectionsToolbar::activityModeChanged(), ProjectionsWidget::changeActivityRequest(), ProjectionsEditorCanvas::changeActivityRequest(), ProjectionsEditorCanvas::deleteSelectedRequest(), MaskEditorFlags::HORIZONTAL_LINE_MODE, m_editorActions, m_projectionsCanvas, m_projectionsWidget, m_propertyPanel, m_toolbar, ProjectionsEditorCanvas::marginsChanged(), ProjectionsEditorCanvas::onActivityModeChanged(), ProjectionsWidget::onActivityModeChanged(), ProjectionsToolbar::onChangeActivityRequest(), ProjectionsEditorActions::onDeleteAction(), ProjectionsWidget::onMarginsChanged(), ProjectionsToolbar::onProjectionTabChange(), ProjectionsEditorCanvas::onResetViewRequest(), ProjectionsEditorActions::propertyPanelRequest(), and ProjectionsEditorActions::resetViewRequest().

Referenced by ProjectionsEditor().

Here is the call graph for this function:

◆ topToolbarActions()

QList< QAction * > ProjectionsEditor::topToolbarActions ( )

Definition at line 84 of file ProjectionsEditor.cpp.

85 {
87 }
QList< QAction * > topToolbarActions()

References m_editorActions, and ProjectionsEditorActions::topToolbarActions().

Referenced by IntensityDataProjectionsWidget::actionList().

Here is the call graph for this function:

Member Data Documentation

◆ m_editorActions

ProjectionsEditorActions* ProjectionsEditor::m_editorActions
private

Definition at line 51 of file ProjectionsEditor.h.

Referenced by setContext(), setup_connections(), and topToolbarActions().

◆ m_projectionsCanvas

ProjectionsEditorCanvas* ProjectionsEditor::m_projectionsCanvas
private

main tool bar with bottoms at the right

Definition at line 53 of file ProjectionsEditor.h.

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

◆ m_projectionsWidget

ProjectionsWidget* ProjectionsEditor::m_projectionsWidget
private

canvas with color map at the top

Definition at line 54 of file ProjectionsEditor.h.

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

◆ m_propertyPanel

IntensityDataPropertyWidget* ProjectionsEditor::m_propertyPanel
private

bottom widget to draw projections plot

Definition at line 55 of file ProjectionsEditor.h.

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

◆ m_selectionModel

QItemSelectionModel* ProjectionsEditor::m_selectionModel
private

panel at the right with properties

Definition at line 56 of file ProjectionsEditor.h.

Referenced by setContext().

◆ m_toolbar

ProjectionsToolbar* ProjectionsEditor::m_toolbar
private

Definition at line 52 of file ProjectionsEditor.h.

Referenced by ProjectionsEditor(), and setup_connections().


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