MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / getSelectedInstances

Method getSelectedInstances

Gui/MultiInstancePanel.cpp:1570–1587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1568} // onInstanceKnobValueChanged
1569
1570void
1571MultiInstancePanel::getSelectedInstances(std::list<Node*>* instances) const
1572{
1573 const QItemSelection selection = _imp->view->selectionModel()->selection();
1574 QModelIndexList indexes = selection.indexes();
1575 std::set<int> rows;
1576
1577 for (int i = 0; i < indexes.size(); ++i) {
1578 rows.insert( indexes[i].row() );
1579 }
1580
1581 for (std::set<int>::iterator it = rows.begin(); it != rows.end(); ++it) {
1582 assert( *it >= 0 && *it < (int)_imp->instances.size() );
1583 std::list<std::pair<NodeWPtr, bool > >::iterator it2 = _imp->instances.begin();
1584 std::advance(it2, *it);
1585 instances->push_back( it2->first.lock().get() );
1586 }
1587}
1588
1589void
1590MultiInstancePanel::resetSelectedInstances()

Callers 1

Calls 8

sizeMethod · 0.45
insertMethod · 0.45
rowMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected