| 1568 | } // onInstanceKnobValueChanged |
| 1569 | |
| 1570 | void |
| 1571 | MultiInstancePanel::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 | |
| 1589 | void |
| 1590 | MultiInstancePanel::resetSelectedInstances() |