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

Prototype of real space widget to present sample structure in 3D view. More...

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

Public Member Functions

 RealSpaceWidget (SampleModel *sampleModel=nullptr, QItemSelectionModel *selectionModel=nullptr, QWidget *parent=nullptr)
 

Protected Member Functions

void hideEvent (QHideEvent *) override
 
void showEvent (QShowEvent *) override
 

Private Attributes

RealSpaceActionsm_actions
 
RealSpaceCanvasm_canvas
 
SampleModelm_sampleModel
 
QItemSelectionModel * m_selectionModel
 
RealSpaceToolBarm_toolBar
 

Detailed Description

Prototype of real space widget to present sample structure in 3D view.

Definition at line 29 of file RealSpaceWidget.h.

Constructor & Destructor Documentation

◆ RealSpaceWidget()

RealSpaceWidget::RealSpaceWidget ( SampleModel sampleModel = nullptr,
QItemSelectionModel *  selectionModel = nullptr,
QWidget *  parent = nullptr 
)

Definition at line 22 of file RealSpaceWidget.cpp.

24  : QWidget(parent)
25  , m_actions(new RealSpaceActions(this))
28  , m_sampleModel(sampleModel)
29  , m_selectionModel(selectionModel)
30 {
31  auto hlayout = new QHBoxLayout;
32  hlayout->setMargin(0);
33  hlayout->setSpacing(0);
34  hlayout->setContentsMargins(0, 0, 0, 0);
35  hlayout->addWidget(m_canvas);
36 
37  auto* mainLayout = new QVBoxLayout;
38  mainLayout->setMargin(0);
39  mainLayout->setSpacing(0);
40  mainLayout->setContentsMargins(0, 0, 0, 0);
41  mainLayout->addWidget(m_toolBar);
42  mainLayout->addLayout(hlayout);
43 
44  setLayout(mainLayout);
45 
48 
51 
54 
57 
60 
63 }
Collection of actions for RealSpaceWidget.
Provides 3D object generation for RealSpaceWidget.
void onLockViewAction(bool view_locked)
void onChangeLayerSizeAction(double layer_size_scale)
Thin toolbar on top of RealSpaceWidget.
void changeLayerSizeAction(double)
void savePictureAction()
void defaultViewAction()
void lockViewAction(bool)
RealSpaceActions * m_actions
SampleModel * m_sampleModel
RealSpaceToolBar * m_toolBar
QItemSelectionModel * m_selectionModel
RealSpaceCanvas * m_canvas

References RealSpaceToolBar::changeLayerSizeAction(), RealSpaceToolBar::defaultViewAction(), RealSpaceToolBar::lockViewAction(), m_canvas, m_toolBar, RealSpaceCanvas::onChangeLayerSizeAction(), RealSpaceCanvas::onDefaultViewAction(), RealSpaceCanvas::onLockViewAction(), RealSpaceCanvas::onSavePictureAction(), RealSpaceCanvas::onSideViewAction(), RealSpaceCanvas::onTopViewAction(), RealSpaceToolBar::savePictureAction(), RealSpaceToolBar::sideViewAction(), and RealSpaceToolBar::topViewAction().

Here is the call graph for this function:

Member Function Documentation

◆ hideEvent()

void RealSpaceWidget::hideEvent ( QHideEvent *  )
overrideprotected

Definition at line 70 of file RealSpaceWidget.cpp.

71 {
72  m_canvas->setModel(nullptr, nullptr);
73 }
void setModel(SampleModel *sampleModel=nullptr, QItemSelectionModel *selectionModel=nullptr)

References m_canvas, and RealSpaceCanvas::setModel().

Here is the call graph for this function:

◆ showEvent()

void RealSpaceWidget::showEvent ( QShowEvent *  )
overrideprotected

Definition at line 65 of file RealSpaceWidget.cpp.

References m_canvas, m_sampleModel, m_selectionModel, and RealSpaceCanvas::setModel().

Here is the call graph for this function:

Member Data Documentation

◆ m_actions

RealSpaceActions* RealSpaceWidget::m_actions
private

Definition at line 41 of file RealSpaceWidget.h.

◆ m_canvas

RealSpaceCanvas* RealSpaceWidget::m_canvas
private

Definition at line 43 of file RealSpaceWidget.h.

Referenced by RealSpaceWidget(), hideEvent(), and showEvent().

◆ m_sampleModel

SampleModel* RealSpaceWidget::m_sampleModel
private

Definition at line 44 of file RealSpaceWidget.h.

Referenced by showEvent().

◆ m_selectionModel

QItemSelectionModel* RealSpaceWidget::m_selectionModel
private

Definition at line 45 of file RealSpaceWidget.h.

Referenced by showEvent().

◆ m_toolBar

RealSpaceToolBar* RealSpaceWidget::m_toolBar
private

Definition at line 42 of file RealSpaceWidget.h.

Referenced by RealSpaceWidget().


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