Commit 63614e67ee8ba1ccf2c4527e27a5df729fe74ebf
1 parent
ad813573
aligning canvasdiv byusing coordinated defined for selected term.
In case of multipleterm selection, last term's coordinates will be used.
Showing
1 changed file
with
34 additions
and
31 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1943,8 +1943,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1943 | 1943 | $scope.HighlightBodyOnExtract = function () { |
1944 | 1944 | console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) |
1945 | 1945 | |
1946 | + //terminate previous running workers to create space for new workers | |
1947 | + $scope.layerNumber = $('#txtlayerNumber').val(); | |
1948 | + $scope.terminateCurrentlyRunningWPs(); | |
1949 | + | |
1946 | 1950 | var multiTermList = []; |
1947 | 1951 | var CallBackBodyRegion = []; |
1952 | + var selectedAnnotation; | |
1948 | 1953 | |
1949 | 1954 | if ($rootScope.isListManagerSelected) { |
1950 | 1955 | |
... | ... | @@ -1955,6 +1960,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1955 | 1960 | angular.forEach($rootScope.previousHighlightList, function (value, key) { |
1956 | 1961 | |
1957 | 1962 | var ActualTermNo = $scope.getActualTermNumber(value); |
1963 | + selectedAnnotation = ActualTermNo; | |
1958 | 1964 | if (ActualTermNo != null) { |
1959 | 1965 | var TermList = $scope.getTermNumberList(ActualTermNo); |
1960 | 1966 | if (TermList != null) { |
... | ... | @@ -1968,16 +1974,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1968 | 1974 | }); |
1969 | 1975 | } |
1970 | 1976 | |
1971 | - //2. Find Actul Term No Based on Icolor. | |
1972 | - //var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1973 | - | |
1974 | - ////3. Find Term No List Based on ActualTermNo | |
1975 | - //var TermList = $scope.getTermNumberList(ActualTermNo); | |
1976 | - | |
1977 | + //get term list to get term coordinates | |
1978 | + $scope.TermList = $scope.getTermNumberList(selectedAnnotation); | |
1977 | 1979 | |
1978 | - //terminate previous running workers to create space for new workers | |
1979 | - $scope.layerNumber = $('#txtlayerNumber').val(); | |
1980 | - $scope.terminateCurrentlyRunningWPs(); | |
1980 | + $scope.termCoordinate = $scope.getTermCoordinate(selectedAnnotation); | |
1981 | + | |
1982 | + | |
1981 | 1983 | |
1982 | 1984 | $timeout(function () { |
1983 | 1985 | |
... | ... | @@ -2076,7 +2078,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2076 | 2078 | |
2077 | 2079 | grayCanvasContext.putImageData(updatedData, 0, 0); |
2078 | 2080 | |
2079 | - | |
2080 | 2081 | //to resolve lateral arm black issue in highlight mode |
2081 | 2082 | |
2082 | 2083 | if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) { |
... | ... | @@ -2098,6 +2099,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2098 | 2099 | grayCanvasContext.putImageData(imgData, 0, 0); |
2099 | 2100 | } |
2100 | 2101 | |
2102 | + CallBackBodyRegion.push(bodyRegionId); | |
2103 | + | |
2104 | + $scope.doAligneCanvasWithTerm = false; | |
2105 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && (CallBackBodyRegion.length == 9)) { | |
2106 | + $scope.doAligneCanvasWithTerm = true; | |
2107 | + } | |
2108 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && (CallBackBodyRegion.length == 5)) { | |
2109 | + $scope.doAligneCanvasWithTerm = true; | |
2110 | + } | |
2111 | + else if ((($rootScope.viewOrientationId == '5')) && (CallBackBodyRegion.length == 1)) { | |
2112 | + $scope.doAligneCanvasWithTerm = true; | |
2113 | + } | |
2114 | + else if ((($rootScope.viewOrientationId == '6')) && (CallBackBodyRegion.length == 1)) { | |
2115 | + $scope.doAligneCanvasWithTerm = true; | |
2116 | + } | |
2117 | + | |
2101 | 2118 | |
2102 | 2119 | if ($rootScope.multiAnnotationIsON == true) { |
2103 | 2120 | |
... | ... | @@ -2125,8 +2142,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2125 | 2142 | // } |
2126 | 2143 | //} |
2127 | 2144 | |
2145 | + if ($scope.doAligneCanvasWithTerm == true) { | |
2146 | + $scope.aligneCanvasWithTerm() | |
2147 | + } | |
2128 | 2148 | |
2129 | 2149 | $timeout(function () { $scope.DisableProgressBar() }, 1000); |
2150 | + | |
2130 | 2151 | |
2131 | 2152 | |
2132 | 2153 | }; |
... | ... | @@ -4903,10 +4924,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4903 | 4924 | $rootScope.isNormalMode = false; |
4904 | 4925 | |
4905 | 4926 | |
4906 | - //$rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); | |
4907 | - | |
4908 | - //$rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); | |
4909 | - | |
4910 | 4927 | //if listanager is visisble then close it |
4911 | 4928 | |
4912 | 4929 | $rootScope.CloseListManager(); |
... | ... | @@ -4946,16 +4963,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4946 | 4963 | |
4947 | 4964 | //3. |
4948 | 4965 | |
4949 | - if ($rootScope.isExtract == true) { | |
4950 | - | |
4951 | - | |
4952 | - $("#canvasDiv").scrollTop($rootScope.canavsDivTop); | |
4953 | - | |
4954 | - $("#canvasDiv").scrollLeft($rootScope.canavsDivLeft); | |
4955 | - | |
4956 | - console.log('$rootScope.CanvasDivTopPosition= ' + $rootScope.CanvasDivTopPosition + 'and $rootScope.CanvasDivLeftPosition= ' + $rootScope.CanvasDivLeftPosition) | |
4957 | - } | |
4958 | - else { | |
4966 | + | |
4959 | 4967 | if ($scope.zoomInOut == 25) { |
4960 | 4968 | if ($('#canvasDiv') != null) |
4961 | 4969 | $('#canvasDiv').scrollLeft(0) |
... | ... | @@ -4968,7 +4976,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4968 | 4976 | |
4969 | 4977 | } |
4970 | 4978 | |
4971 | - } | |
4979 | + | |
4972 | 4980 | //remove annotation speech bubble |
4973 | 4981 | if ($('#dot').length > 0) { |
4974 | 4982 | $('#dot').remove(); |
... | ... | @@ -5271,7 +5279,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5271 | 5279 | $("#canvasDiv").scroll(function (event) { |
5272 | 5280 | $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); |
5273 | 5281 | $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); |
5274 | - console.log('scroll event. $rootScope.CanvasDivTopPosition= ' + $rootScope.CanvasDivTopPosition + ' and $rootScope.CanvasDivLeftPosition= ' + $rootScope.CanvasDivLeftPosition) | |
5275 | 5282 | |
5276 | 5283 | }); |
5277 | 5284 | |
... | ... | @@ -5288,11 +5295,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5288 | 5295 | |
5289 | 5296 | $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); |
5290 | 5297 | |
5291 | - //befoe extracr scroll pos | |
5292 | - $rootScope.canavsDivTop = $("#canvasDiv").scrollTop(); | |
5293 | - $rootScope.canavsDivLeft = $("#canvasDiv").scrollLeft(); | |
5294 | - | |
5295 | - | |
5298 | + | |
5296 | 5299 | if ($scope.isTransparencyActivated == true) { |
5297 | 5300 | |
5298 | 5301 | $("#btnExtract").addClass("disabled"); | ... | ... |