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

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

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

Public Member Functions

 ProjectionsEditor (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...
 
ProjectionsPropertyPanelm_propertyPanel
 bottom widget to draw projections plot More...
 
QItemSelectionModel * m_selectionModel
 pannel at the right with properties More...
 
ProjectionsToolBarm_toolBar
 

Detailed Description

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

Definition at line 33 of file ProjectionsEditor.h.

Constructor & Destructor Documentation

◆ ProjectionsEditor()

ProjectionsEditor::ProjectionsEditor ( QWidget *  parent = nullptr)

Definition at line 26 of file ProjectionsEditor.cpp.

27  : QMainWindow(parent)
33  , m_selectionModel(nullptr)
34 {
35  addToolBar(Qt::RightToolBarArea, m_toolBar);
36 
37  auto bottomSplitter = new QSplitter;
38  bottomSplitter->setOrientation(Qt::Vertical);
39  bottomSplitter->addWidget(m_projectionsCanvas);
40  bottomSplitter->addWidget(m_projectionsWidget);
41 
42  auto rightSplitter(new QSplitter);
43  rightSplitter->addWidget(bottomSplitter);
44  rightSplitter->addWidget(m_propertyPanel);
45 
46  setCentralWidget(rightSplitter);
47 
48  m_propertyPanel->setHidden(true);
50 }
Provides various actions for ProjectionsEditor.
Holds a graphics scene to draw projections on top of ColorMap.
ProjectionsEditorCanvas * m_projectionsCanvas
main tool bar with bottoms at the right
ProjectionsToolBar * m_toolBar
QItemSelectionModel * m_selectionModel
pannel at the right with properties
ProjectionsEditorActions * m_editorActions
ProjectionsPropertyPanel * m_propertyPanel
bottom widget to draw projections plot
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 70 of file ProjectionsEditor.cpp.

71 {
72  m_propertyPanel->setItem(nullptr);
74  m_projectionsWidget->setItem(nullptr);
75 }
void setItem(SessionItem *intensityItem)
virtual void setItem(SessionItem *item)

References m_projectionsCanvas, m_projectionsWidget, m_propertyPanel, ProjectionsEditorCanvas::resetContext(), ProjectionsWidget::setItem(), and SessionItemWidget::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 52 of file ProjectionsEditor.cpp.

54 {
55  Q_UNUSED(model);
56  Q_UNUSED(shapeContainerIndex);
57 
58  delete m_selectionModel;
59  m_selectionModel = new QItemSelectionModel(model, this);
60 
61  m_propertyPanel->setItem(intensityItem);
63  m_projectionsCanvas->setContext(model, shapeContainerIndex, intensityItem);
64  m_projectionsWidget->setItem(intensityItem);
65 
66  m_editorActions->setContext(model, shapeContainerIndex, intensityItem);
68 }
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(), ProjectionsWidget::setItem(), SessionItemWidget::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 82 of file ProjectionsEditor.cpp.

83 {
84  // tool panel request is propagated from editorActions to this MaskEditor
87 
88  // tool panel request is propagated from editorActions to this MaskEditor
90  [=]() { m_propertyPanel->setHidden(!m_propertyPanel->isHidden()); });
91 
92  // selection/drawing activity is propagated from ToolBar to graphics scene
95 
96  // selection/drawing activity is propagated from ToolBar to Projections Widget
99 
100  // click on projections tab is propagated to tool bar
103 
104  // Delete request is propagated from canvas to actions
107 
108  // space bar push (request for zoom mode) is propagated from graphics view to ToolBar
111 
112  // ColorMap margins changed, canvas -> projection widget
115 
117 }
void onActivityModeChanged(MaskEditorFlags::Activity value)
void changeActivityRequest(MaskEditorFlags::Activity)
void marginsChanged(double left, double right)
void onProjectionTabChange(MaskEditorFlags::Activity value)
Change activity only if current activity is one of drawing mode (horizontal, vertical projections dra...
void activityModeChanged(MaskEditorFlags::Activity)
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 77 of file ProjectionsEditor.cpp.

78 {
80 }
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 49 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 51 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 52 of file ProjectionsEditor.h.

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

◆ m_propertyPanel

ProjectionsPropertyPanel* ProjectionsEditor::m_propertyPanel
private

bottom widget to draw projections plot

Definition at line 53 of file ProjectionsEditor.h.

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

◆ m_selectionModel

QItemSelectionModel* ProjectionsEditor::m_selectionModel
private

pannel at the right with properties

Definition at line 54 of file ProjectionsEditor.h.

Referenced by setContext().

◆ m_toolBar

ProjectionsToolBar* ProjectionsEditor::m_toolBar
private

Definition at line 50 of file ProjectionsEditor.h.

Referenced by ProjectionsEditor(), and setup_connections().


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