Commit c18f047f7f3caacf8ee669eff4f1d51801b35de2

Authored by Amrita Vishnoi
1 parent b5f7eba2

Refs: #4462

Normal mode is implemented.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -60,6 +60,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
60 60  
61 61 $rootScope.previousHighlightList = [];
62 62  
  63 + $rootScope.isNormalMode = false;
  64 +
63 65 //array for bodyviewid correspoing to male female(used for gender change)
64 66 $scope.correspondingBodyViewIds = {
65 67 '1': '5',
... ... @@ -260,7 +262,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
260 262 $scope.isBodyRegionDataLoaded = true;
261 263 // alert('da_dat_brview= ' + result)
262 264  
263   - var currentBodyViewId = localStorage.getItem("currentBodyViewId");
  265 + var currentBodyViewId;
  266 + if ($scope.isNormalMode == true)
  267 + {
  268 + currentBodyViewId = $scope.viewOrientationId;
  269 + }
  270 + else
  271 + {
  272 + currentBodyViewId = localStorage.getItem("currentBodyViewId");
  273 + }
264 274 var layerJsonPath = '';
265 275 var bgArtJsonPath = '';
266 276 var CommonViewId = 0;
... ... @@ -458,7 +468,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
458 468 //calculate coordinates for body region images
459 469 $scope.CalculateImageCordinates = function (viewOrientationId) {
460 470  
461   - // debugger;
  471 + debugger;
462 472 //remove the previous layer mask data from array
463 473 var n = $rootScope.MaskCanvasData.length
464 474  
... ... @@ -506,6 +516,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
506 516 angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
507 517  
508 518  
  519 + debugger;
509 520  
510 521 if (value._HaveMirrorImage == 'Y') {
511 522  
... ... @@ -580,7 +591,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
580 591  
581 592 }
582 593 else {
583   - //Draw body region which don't have mirror image
  594 +
  595 + debugger;
  596 +
  597 +
  598 + //Draw body region which don't have mirror image11
584 599  
585 600  
586 601 //0.Scaling as per default zoom
... ... @@ -623,6 +638,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
623 638 //4.Draw body region for mask image
624 639 $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y');
625 640  
  641 + debugger;
626 642  
627 643 //draw figLeaf for modesty
628 644  
... ... @@ -1104,6 +1120,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1104 1120  
1105 1121 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1106 1122  
  1123 + debugger;
1107 1124 var imgCanvas = document.createElement('canvas');
1108 1125 // imgCanvas.style.backgroundColor = 'red';
1109 1126 imgCanvas.height = h;
... ... @@ -1380,7 +1397,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1380 1397 }
1381 1398 $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
1382 1399  
1383   - debugger;
  1400 + // debugger;
1384 1401 //terminate previous running workers to create space for new workers
1385 1402 var workerCount = $scope.runningWorkers.length;
1386 1403 if (workerCount > 0) {
... ... @@ -3258,6 +3275,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3258 3275 }
3259 3276 else {
3260 3277 $rootScope.isHighLight = true;
  3278 + $rootScope.isNormalMode = false;
3261 3279 $scope.highLightBody();
3262 3280 }
3263 3281  
... ... @@ -3267,7 +3285,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3267 3285 $scope.enableExtract = function () {
3268 3286 // alert('extract called');
3269 3287  
3270   - debugger;
  3288 + //debugger;
3271 3289  
3272 3290 if ($rootScope.isExtract == true) {
3273 3291  
... ... @@ -3275,6 +3293,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3275 3293 else {
3276 3294 $rootScope.isExtract = true;
3277 3295  
  3296 + $rootScope.isNormalMode = false;
3278 3297 //1.
3279 3298 $scope.highLightBody();
3280 3299  
... ... @@ -3282,11 +3301,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3282 3301 }
3283 3302 }
3284 3303  
  3304 + $scope.enableNormalMode = function () {
  3305 +
  3306 + if ($rootScope.isNormalMode == true) {
  3307 +
  3308 + }
  3309 + else {
  3310 +
  3311 + //1.
  3312 + $scope.flushCanvas();
  3313 +
  3314 + //2.
  3315 + $rootScope.isNormalMode = true;
  3316 +
  3317 + //3.
  3318 + $rootScope.isHighLight = false;
  3319 +
  3320 +
  3321 + $scope.CalculateImageCordinates($scope.viewOrientationId);
  3322 + }
  3323 +
  3324 +
  3325 + }
  3326 +
3285 3327  
3286 3328  
3287 3329 $scope.highLightBody = function () {
3288 3330  
3289   - debugger;
  3331 + //debugger;
3290 3332  
3291 3333 if ($rootScope.isHighLight == true) {
3292 3334  
... ... @@ -3336,7 +3378,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3336 3378  
3337 3379 img.onload = function () {
3338 3380 //console.log(Math.max(img.width) + ', ' + Math.max(img.height))
3339   - debugger;
  3381 + //debugger;
3340 3382 var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
3341 3383 DAData.draw(img);
3342 3384  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -101,7 +101,7 @@
101 101 <button id="btnTranparency" class="btn btn-black btn-sm btn-block marginTop5 tooltip-custom" ng-click="createTransparencyBox()" data-toggle="tooltip" data-placement="bottom" title="Transparency Box"><img src="content/images/icon-transparency.png" alt="" title=""></button>
102 102 </div>
103 103 <div class="col-sm-6">
104   - <button class="btn btn-primary btn-sm marginTop5 tooltip-custom" data-toggle="tooltip" data-placement="bottom" title="Normal"> <img src="content/images/bulb1.png" alt="" title=""></button>
  104 + <button class="btn btn-primary btn-sm marginTop5 tooltip-custom" ng-click="enableNormalMode()" data-toggle=" tooltip" data-placement="bottom" title="Normal"> <img src="content/images/bulb1.png" alt="" title=""></button>
105 105 </div>
106 106 <div class="col-sm-6">
107 107 <button class="btn btn-black btn-sm pull-right marginTop5 tooltip-custom" ng-click="enableExtract()" data-toggle="tooltip" data-placement="bottom" title="Extract"><img src="content/images/bulb1.png" alt="" title=""></button>
... ...