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

Method onInteractViewportSelectionUpdated

Engine/TrackerNode.cpp:2424–2459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2422}
2423
2424void
2425TrackerNode::onInteractViewportSelectionUpdated(const RectD& rectangle,
2426 bool onRelease)
2427{
2428 if (!onRelease) {
2429 return;
2430 }
2431
2432
2433 bool trackingPageSecret = getNode()->getTrackerContext()->getTrackingPageKnob()->getIsSecret();
2434 if (trackingPageSecret) {
2435 return;
2436 }
2437
2438 std::vector<TrackMarkerPtr> allMarkers;
2439 std::list<TrackMarkerPtr> selectedMarkers;
2440 TrackerContextPtr context = getNode()->getTrackerContext();
2441 context->getAllMarkers(&allMarkers);
2442 for (std::size_t i = 0; i < allMarkers.size(); ++i) {
2443 if ( !allMarkers[i]->isEnabled( allMarkers[i]->getCurrentTime() ) ) {
2444 continue;
2445 }
2446 KnobDoublePtr center = allMarkers[i]->getCenterKnob();
2447 double x, y;
2448 x = center->getValue(0);
2449 y = center->getValue(1);
2450 if ( (x >= rectangle.x1) && (x <= rectangle.x2) && (y >= rectangle.y1) && (y <= rectangle.y2) ) {
2451 selectedMarkers.push_back(allMarkers[i]);
2452 }
2453 }
2454
2455 context->beginEditSelection(TrackerContext::eTrackSelectionInternal);
2456 context->clearSelection(TrackerContext::eTrackSelectionInternal);
2457 context->addTracksToSelection(selectedMarkers, TrackerContext::eTrackSelectionInternal);
2458 context->endEditSelection(TrackerContext::eTrackSelectionInternal);
2459}
2460
2461void
2462TrackerNode::refreshExtraStateAfterTimeChanged(bool isPlayback,

Callers

nothing calls this directly

Calls 15

getIsSecretMethod · 0.80
getTrackingPageKnobMethod · 0.80
getTrackerContextMethod · 0.80
getAllMarkersMethod · 0.80
beginEditSelectionMethod · 0.80
addTracksToSelectionMethod · 0.80
endEditSelectionMethod · 0.80
getNodeFunction · 0.70
sizeMethod · 0.45
isEnabledMethod · 0.45
getCurrentTimeMethod · 0.45
getCenterKnobMethod · 0.45

Tested by

no test coverage detected