BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
gui2::LayerEditorActions::LayerEditorActionsImpl Struct Reference
Collaboration diagram for gui2::LayerEditorActions::LayerEditorActionsImpl:
[legend]

Public Member Functions

 LayerEditorActionsImpl ()
 
std::pair< SessionItem *, TagRowlocateInsertPlace ()
 Finds parent and tagrow to insert new item. More...
 
ModelView::SessionItemroot_item ()
 Returns a multi layer playing the role of invisible root item. More...
 

Public Attributes

SampleModelsample_model {nullptr}
 
LayerSelectionModelselection_model {nullptr}
 

Detailed Description

Definition at line 29 of file layereditoractions.cpp.

Constructor & Destructor Documentation

◆ LayerEditorActionsImpl()

gui2::LayerEditorActions::LayerEditorActionsImpl::LayerEditorActionsImpl ( )
inline

Definition at line 32 of file layereditoractions.cpp.

32 {}

Member Function Documentation

◆ locateInsertPlace()

std::pair<SessionItem*, TagRow> gui2::LayerEditorActions::LayerEditorActionsImpl::locateInsertPlace ( )
inline

Finds parent and tagrow to insert new item.

Definition at line 36 of file layereditoractions.cpp.

37  {
38  auto all_selected = selection_model->selectedItems();
39  auto selected = all_selected.empty() ? nullptr : all_selected.back();
40  if (selected)
41  return {selected->parent(), selected->tagRow().next()};
42  return {root_item(), TagRow{}};
43  }
Aggregate to hold (tag, row) information for SessionModel.
Definition: tagrow.h:25
std::vector< ModelView::SessionItem * > selectedItems() const
Returns vector of selected layers or multilayers.
ModelView::SessionItem * root_item()
Returns a multi layer playing the role of invisible root item.

◆ root_item()

ModelView::SessionItem* gui2::LayerEditorActions::LayerEditorActionsImpl::root_item ( )
inline

Returns a multi layer playing the role of invisible root item.

Definition at line 47 of file layereditoractions.cpp.

48  {
49  return selection_model->viewModel()->sessionItemFromIndex(QModelIndex());
50  }
SessionItem * sessionItemFromIndex(const QModelIndex &index) const
Definition: viewmodel.cpp:59
const ModelView::ViewModel * viewModel() const
Return the casted view model.

Member Data Documentation

◆ sample_model

SampleModel* gui2::LayerEditorActions::LayerEditorActionsImpl::sample_model {nullptr}

Definition at line 30 of file layereditoractions.cpp.

◆ selection_model

LayerSelectionModel* gui2::LayerEditorActions::LayerEditorActionsImpl::selection_model {nullptr}

Definition at line 31 of file layereditoractions.cpp.


The documentation for this struct was generated from the following file: