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

Method getKnobForItem

Gui/MultiInstancePanel.cpp:1301–1327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301KnobIPtr
1302MultiInstancePanel::getKnobForItem(TableItem* item,
1303 int* dimension) const
1304{
1305 QModelIndex modelIndex = _imp->model->index(item);
1306
1307 assert( modelIndex.row() < (int)_imp->instances.size() );
1308 Nodes::iterator nIt = _imp->instances.begin();
1309 std::advance( nIt, modelIndex.row() );
1310 const std::vector<KnobIPtr> & knobs = nIt->first.lock()->getKnobs();
1311 int instanceSpecificIndex = COL_FIRST_KNOB;
1312 for (U32 i = 0; i < knobs.size(); ++i) {
1313 if ( knobs[i]->isInstanceSpecific() ) {
1314 for (int j = 0; j < knobs[i]->getDimension(); ++j) {
1315 if ( instanceSpecificIndex == modelIndex.column() ) {
1316 *dimension = j;
1317
1318 return knobs[i];
1319 }
1320 ++instanceSpecificIndex;
1321 }
1322 }
1323 }
1324 *dimension = -1;
1325
1326 return KnobIPtr();
1327}
1328
1329void
1330MultiInstancePanel::onItemDataChanged(TableItem* item)

Callers 1

paintMethod · 0.80

Calls 8

isInstanceSpecificMethod · 0.80
columnMethod · 0.80
indexMethod · 0.45
rowMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
lockMethod · 0.45
getDimensionMethod · 0.45

Tested by

no test coverage detected