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

Public Member Functions

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

MaterialModelmaterial_model {nullptr}
 
MaterialSelectionModelselection_model {nullptr}
 

Detailed Description

Definition at line 29 of file materialeditoractions.cpp.

Constructor & Destructor Documentation

◆ MaterialEditorActionsImpl()

gui2::MaterialEditorActions::MaterialEditorActionsImpl::MaterialEditorActionsImpl ( )
inline

Definition at line 32 of file materialeditoractions.cpp.

32 {}

Member Function Documentation

◆ locateInsertPlace()

std::pair<SessionItem*, TagRow> gui2::MaterialEditorActions::MaterialEditorActionsImpl::locateInsertPlace ( )
inline

Finds parent and tagrow to insert new item.

Definition at line 36 of file materialeditoractions.cpp.

37  {
38  auto all_selected = selection_model->selectedMaterials();
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< MaterialBaseItem * > selectedMaterials() const
Returns vector of selected materials.
ModelView::SessionItem * root_item()
Returns a multi layer playing the role of invisible root item.

◆ root_item()

ModelView::SessionItem* gui2::MaterialEditorActions::MaterialEditorActionsImpl::root_item ( )
inline

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

Definition at line 47 of file materialeditoractions.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

Member Data Documentation

◆ material_model

MaterialModel* gui2::MaterialEditorActions::MaterialEditorActionsImpl::material_model {nullptr}

Definition at line 30 of file materialeditoractions.cpp.

◆ selection_model

MaterialSelectionModel* gui2::MaterialEditorActions::MaterialEditorActionsImpl::selection_model {nullptr}

Definition at line 31 of file materialeditoractions.cpp.


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