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

Method selectInternal

Gui/TrackerPanel.cpp:1296–1349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294}
1295
1296void
1297TrackerPanel::selectInternal(const std::list<TrackMarkerPtr>& markers,
1298 int reason)
1299{
1300 TrackerContext::TrackSelectionReason selectionReason = (TrackerContext::TrackSelectionReason)reason;
1301
1302 if (_imp->selectionRecursion > 0) {
1303 return;
1304 }
1305 ++_imp->selectionRecursion;
1306 if (!_imp->selectionBlocked) {
1307 ///select the new item
1308 QItemSelection selection;
1309 _imp->markersToSelection(markers, &selection);
1310 if (selectionReason != TrackerContext::eTrackSelectionSettingsPanel) {
1311 _imp->view->selectionModel()->select(selection, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
1312 }
1313
1314
1315 std::list<int> keysToAdd, userKeysToAdd;
1316 for (std::list<TrackMarkerPtr>::const_iterator it = markers.begin(); it != markers.end(); ++it) {
1317 TrackKeys k;
1318 k.visible = true;
1319 (*it)->getCenterKeyframes(&k.centerKeys);
1320 (*it)->getUserKeyframes(&k.userKeys);
1321 for (std::set<double>::iterator it2 = k.centerKeys.begin(); it2 != k.centerKeys.end(); ++it2) {
1322 keysToAdd.push_back(*it2);
1323 }
1324 for (std::set<int>::iterator it2 = k.userKeys.begin(); it2 != k.userKeys.end(); ++it2) {
1325 userKeysToAdd.push_back(*it2);
1326 }
1327 _imp->keys[*it] = k;
1328 }
1329 if ( !keysToAdd.empty() ) {
1330 _imp->node.lock()->getNode()->getApp()->addMultipleKeyframeIndicatorsAdded(keysToAdd, true);
1331 }
1332 if ( !userKeysToAdd.empty() ) {
1333 _imp->node.lock()->getNode()->getApp()->addUserMultipleKeyframeIndicatorsAdded(userKeysToAdd, true);
1334 }
1335
1336 TrackerContextPtr context = getContext();
1337 assert(context);
1338 context->beginEditSelection(TrackerContext::eTrackSelectionSettingsPanel);
1339 context->clearSelection(TrackerContext::eTrackSelectionSettingsPanel);
1340 context->addTracksToSelection(markers, TrackerContext::eTrackSelectionSettingsPanel);
1341 context->endEditSelection(TrackerContext::eTrackSelectionSettingsPanel);
1342
1343 TimeLinePtr timeline = _imp->node.lock()->getNode()->getApp()->getTimeLine();
1344 _imp->updateTrackKeysInfoBar( timeline->currentFrame() );
1345 }
1346
1347
1348 --_imp->selectionRecursion;
1349} // TrackerPanel::selectInternal
1350
1351void
1352TrackerPanel::onItemRightClicked(TableItem* /*item*/)

Callers

nothing calls this directly

Calls 15

markersToSelectionMethod · 0.80
getCenterKeyframesMethod · 0.80
emptyMethod · 0.80
beginEditSelectionMethod · 0.80
addTracksToSelectionMethod · 0.80
endEditSelectionMethod · 0.80
selectMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected