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

Method drawOverlay

Engine/TrackerNode.cpp:726–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724typedef std::map<double, CenterPointDisplayInfo> CenterPointsMap;
725
726void
727TrackerNode::drawOverlay(double time,
728 const RenderScale & /*renderScale*/,
729 ViewIdx /*view*/)
730{
731 double pixelScaleX, pixelScaleY;
732 OverlaySupport* overlay = getCurrentViewportForOverlays();
733
734 assert(overlay);
735 overlay->getPixelScale(pixelScaleX, pixelScaleY);
736 double viewportSize[2];
737 overlay->getViewportSize(viewportSize[0], viewportSize[1]);
738 double screenPixelRatio = overlay->getScreenPixelRatio();
739
740 {
741 GLProtectAttrib a(GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_POINT_BIT | GL_ENABLE_BIT | GL_HINT_BIT | GL_TRANSFORM_BIT);
742 double markerColor[3];
743 if ( !getNode()->getOverlayColor(&markerColor[0], &markerColor[1], &markerColor[2]) ) {
744 markerColor[0] = markerColor[1] = markerColor[2] = 0.8;
745 }
746
747 std::vector<TrackMarkerPtr> allMarkers;
748 std::list<TrackMarkerPtr> selectedMarkers;
749 TrackerContextPtr context = getNode()->getTrackerContext();
750 context->getSelectedMarkers(&selectedMarkers);
751 context->getAllMarkers(&allMarkers);
752
753 bool trackingPageSecret = context->getTrackingPageKnob()->getIsSecret();
754 bool showErrorColor = _imp->ui->showCorrelationButton.lock()->getValue();
755 TrackMarkerPtr selectedMarker = _imp->ui->selectedMarker.lock();
756 bool selectedFound = false;
757 Point selectedCenter;
758 Point selectedPtnTopLeft;
759 Point selectedPtnTopRight;
760 Point selectedPtnBtmRight;
761 Point selectedPtnBtmLeft;
762 Point selectedOffset;
763 Point selectedSearchBtmLeft;
764 Point selectedSearchTopRight;
765
766 for (std::vector<TrackMarkerPtr>::iterator it = allMarkers.begin(); it != allMarkers.end(); ++it) {
767 bool isEnabled = (*it)->isEnabled(time);
768
769 double thisMarkerColor[3];
770 if (!isEnabled) {
771 for (int i = 0; i < 3; ++i) {
772 thisMarkerColor[i] = markerColor[i] / 2.;
773 }
774 } else {
775 for (int i = 0; i < 3; ++i) {
776 thisMarkerColor[i] = markerColor[i];
777 }
778 }
779
780 bool isHoverMarker = *it == _imp->ui->hoverMarker;
781 bool isDraggedMarker = *it == _imp->ui->interactMarker;
782 bool isHoverOrDraggedMarker = isHoverMarker || isDraggedMarker;
783 std::list<TrackMarkerPtr>::iterator foundSelected = std::find(selectedMarkers.begin(), selectedMarkers.end(), *it);

Callers

nothing calls this directly

Calls 15

currentFunction · 0.85
clampFunction · 0.85
hsv_to_rgbFunction · 0.85
getTrackerContextMethod · 0.80
getSelectedMarkersMethod · 0.80
getAllMarkersMethod · 0.80
getIsSecretMethod · 0.80
getTrackingPageKnobMethod · 0.80
getOffsetKnobMethod · 0.80
getErrorKnobMethod · 0.80
getPatternTopLeftKnobMethod · 0.80

Tested by

no test coverage detected