BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::PropertyItemsStrategy Class Reference

Strategy to find children of given item: only property item will be given, all top level items will be filtered out, all inactive children of GroupItem will be filtered out. More...

Inheritance diagram for ModelView::PropertyItemsStrategy:
[legend]
Collaboration diagram for ModelView::PropertyItemsStrategy:
[legend]

Public Member Functions

std::vector< SessionItem * > children (const SessionItem *item) const override
 Returns vector of children of given item. More...
 

Detailed Description

Strategy to find children of given item: only property item will be given, all top level items will be filtered out, all inactive children of GroupItem will be filtered out.

See example in code.

Definition at line 47 of file standardchildrenstrategies.h.

Member Function Documentation

◆ children()

std::vector< SessionItem * > PropertyItemsStrategy::children ( const SessionItem item) const
overridevirtual

Returns vector of children of given item.

Implements ModelView::ChildrenStrategyInterface.

Definition at line 53 of file standardchildrenstrategies.cpp.

54 {
55  if (!item)
56  return std::vector<SessionItem*>();
57 
58  auto group = dynamic_cast<const GroupItem*>(item);
59  auto next_item = group ? group->currentItem() : item;
60  return Utils::SinglePropertyItems(*next_item);
61 }
Group item holds collection of predefined items.
Definition: groupitem.h:26
const SessionItem * currentItem() const
Returns currently selected item.
Definition: groupitem.cpp:41
MVVM_MODEL_EXPORT std::vector< SessionItem * > SinglePropertyItems(const SessionItem &item)
Returns vector of children representing property items.
Definition: itemutils.cpp:122

References ModelView::GroupItem::currentItem(), and ModelView::Utils::SinglePropertyItems().

Referenced by TEST_F().

Here is the call graph for this function:

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