Commit 0069bce90a119ae478ebcb59fe13fcb5c3635ccd

Authored by Amrita Vishnoi
1 parent cdb74fb6

Refs: #4464

Now we are able to maintain previous single and multiple highlights on layer chnage
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -39,9 +39,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
39 39 $scope.multiAnnotationIsON = true;
40 40 $scope.previousGrayImageDataVar;
41 41 $scope.previousGrayCanvas;
42   - $scope.previousIcolor =0;
43   - $scope.previousX =0;
44   - $scope.previousY=0;
  42 +
  43 + $scope.previousSelectedTermList = [];
  44 +
  45 +
  46 +
45 47 $scope.machedBodyRegion = [];
46 48  
47 49 //array for bodyviewid correspoing to male female(used for gender change)
... ... @@ -920,7 +922,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
920 922 var termNumber = parseInt(TermList[i]._TermNumber);
921 923  
922 924 //Match Term No List in each bodyRegion
923   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
  925 + $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
924 926 }
925 927 }
926 928  
... ... @@ -1101,14 +1103,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1101 1103 }
1102 1104 }
1103 1105 }
  1106 +
  1107 + // var IcolorWithCordinate = new Object;
  1108 + var previousIcolor = RGBColor;
  1109 + //var previousX;
  1110 + // var previousY;
1104 1111  
1105   -
  1112 + //IcolorWithCordinate.previousIcolor= RGBColor;
  1113 + // IcolorWithCordinate.previousX = x;
  1114 + // IcolorWithCordinate.previousY = y;
1106 1115  
1107   - $scope.previousIcolor= RGBColor;
1108   - $scope.previousX = x;
1109   - $scope.previousY = y;
  1116 + $scope.previousSelectedTermList.push(previousIcolor);
1110 1117  
1111   - $scope.highLightBodyBasedOnIcolor(RGBColor, x, y);
  1118 + $scope.highLightBodyBasedOnIcolor(RGBColor);
1112 1119  
1113 1120 //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
1114 1121 ////3. Find Term No List Based on ActualTermNo
... ... @@ -1130,10 +1137,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1130 1137  
1131 1138 else
1132 1139 {
1133   - $scope.previousIcolor = RGBColor;
1134   - $scope.previousX = x;
1135   - $scope.previousY = y;
1136   - $scope.highLightBodyBasedOnIcolor(RGBColor,x,y);
  1140 + $scope.highLightBodyBasedOnIcolor(RGBColor);
1137 1141  
1138 1142 ////2. Find Actul Term No Based on Icolor.
1139 1143 //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
... ... @@ -1231,11 +1235,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1231 1235  
1232 1236 }
1233 1237  
1234   - $scope.highLightBodyBasedOnIcolor = function (RGBColor,x,y)
  1238 + $scope.highLightBodyBasedOnIcolor = function (RGBColor)
1235 1239 {
1236 1240  
1237 1241 //2. Find Actul Term No Based on Icolor.
1238   - var ActualTermNo = $scope.getActualTermNumber(RGBColor);
  1242 + var ActualTermNo = $scope.getActualTermNumber(RGBColor);
1239 1243  
1240 1244 //3. Find Term No List Based on ActualTermNo
1241 1245 var TermList = $scope.getTermNumberList(ActualTermNo);
... ... @@ -1249,11 +1253,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1249 1253 var termNumber = parseInt(TermList[i]._TermNumber);
1250 1254  
1251 1255 //Match Term No List in each bodyRegion
1252   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
  1256 + $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
1253 1257 }
1254 1258 }
1255 1259  
1256   - $scope.getLocationsForMatchedTermsInWholeBody = function (termNo, x, y)
  1260 + $scope.getLocationsForMatchedTermsInWholeBody = function (termNo)
1257 1261 {
1258 1262  
1259 1263 for (var x = 0; x < $scope.ColoredImageSRC.length; x++)
... ... @@ -1610,10 +1614,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1610 1614  
1611 1615 $timeout(function () { $scope.highLightBody() }, 350);
1612 1616  
1613   - if ($scope.previousIcolor != 0 && $scope.previousX != 0 && $scope.previousY != 0) {
1614   -
1615   - $timeout(function () { $scope.highLightBodyBasedOnIcolor($scope.previousIcolor, $scope.previousX, $scope.previousY) }, 350);
1616   - }
  1617 +
1617 1618  
1618 1619 }
1619 1620  
... ... @@ -2251,6 +2252,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2251 2252 }
2252 2253 else if (isLayerChanged) {
2253 2254 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
  2255 +
2254 2256 }
2255 2257 else {
2256 2258 var currentLayer = parseInt($('#txtlayerNumber').val());
... ... @@ -3187,6 +3189,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3187 3189 // alert('length: '+ $scope.coloredImageCanvasList.length);
3188 3190  
3189 3191 }
  3192 +
  3193 + if ($scope.previousSelectedTermList.length > 0) {
  3194 + for (var i = 0; i < $scope.previousSelectedTermList.length; i++) {
  3195 + $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]) ;
  3196 +
  3197 + }
  3198 + }
3190 3199 }
3191 3200  
3192 3201 $scope.applyGrayMatrix = function (img, context_gray)
... ...