| 850 | } // TrackerNodeInteract::drawSelectedMarkerKeyframes |
| 851 | |
| 852 | void |
| 853 | TrackerNodeInteract::drawSelectedMarkerTexture(const std::pair<double, double>& pixelScale, |
| 854 | int currentTime, |
| 855 | const Point& ptnCenter, |
| 856 | const Point& offset, |
| 857 | const Point& ptnTopLeft, |
| 858 | const Point& ptnTopRight, |
| 859 | const Point& ptnBtmRight, |
| 860 | const Point& ptnBtmLeft, |
| 861 | const Point& /*selectedSearchWndBtmLeft*/, |
| 862 | const Point& /*selectedSearchWndTopRight*/) |
| 863 | { |
| 864 | TrackMarkerPtr marker = selectedMarker.lock(); |
| 865 | OverlaySupport* overlay = _p->publicInterface->getCurrentViewportForOverlays(); |
| 866 | double screenPixelRatio = overlay->getScreenPixelRatio(); |
| 867 | |
| 868 | assert(overlay); |
| 869 | ViewerInstance* viewer = overlay->getInternalViewerNode(); |
| 870 | assert(viewer); |
| 871 | |
| 872 | if ( isTracking || !selectedMarkerTexture || !marker || !marker->isEnabled(currentTime) || viewer->getRenderEngine()->isDoingSequentialRender() ) { |
| 873 | return; |
| 874 | } |
| 875 | |
| 876 | RectD textureRectCanonical; |
| 877 | computeSelectedMarkerCanonicalRect(&textureRectCanonical); |
| 878 | |
| 879 | |
| 880 | double overlayColor[3]; |
| 881 | if ( !_p->publicInterface->getNode()->getOverlayColor(&overlayColor[0], &overlayColor[1], &overlayColor[2]) ) { |
| 882 | overlayColor[0] = overlayColor[1] = overlayColor[2] = 0.8; |
| 883 | } |
| 884 | |
| 885 | const TextureRect& texRect = selectedMarkerTexture->getTextureRect(); |
| 886 | RectD texCoords; |
| 887 | /*texCoords.x1 = (texRect.x1 - selectedMarkerTextureRoI.x1) / (double)selectedMarkerTextureRoI.width(); |
| 888 | texCoords.y1 = (texRect.y1 - selectedMarkerTextureRoI.y1) / (double)selectedMarkerTextureRoI.height(); |
| 889 | if (texRect.x2 <= selectedMarkerTextureRoI.x2) { |
| 890 | texCoords.x2 = (texRect.x2 - selectedMarkerTextureRoI.x1) / (double)selectedMarkerTextureRoI.width(); |
| 891 | } else { |
| 892 | texCoords.x2 = 1.; |
| 893 | } |
| 894 | if (texRect.y2 <= selectedMarkerTextureRoI.y2) { |
| 895 | texCoords.y2 = (texRect.y2 - selectedMarkerTextureRoI.y1) / (double)selectedMarkerTextureRoI.height(); |
| 896 | } else { |
| 897 | texCoords.y2 = 1.; |
| 898 | }*/ |
| 899 | texCoords.x1 = texCoords.y1 = 0.; |
| 900 | texCoords.x2 = texCoords.y2 = 1.; |
| 901 | |
| 902 | RectD canonicalSearchWindow; |
| 903 | texRect.toCanonical_noClipping(0, texRect.par, &canonicalSearchWindow); |
| 904 | |
| 905 | Point centerPoint, innerTopLeft, innerTopRight, innerBtmLeft, innerBtmRight; |
| 906 | |
| 907 | //Remove any offset to the center to see the marker in the magnification window |
| 908 | double xCenterPercent = (ptnCenter.x - canonicalSearchWindow.x1 + offset.x) / (canonicalSearchWindow.x2 - canonicalSearchWindow.x1); |
| 909 | double yCenterPercent = (ptnCenter.y - canonicalSearchWindow.y1 + offset.y) / (canonicalSearchWindow.y2 - canonicalSearchWindow.y1); |
no test coverage detected