From c18f047f7f3caacf8ee669eff4f1d51801b35de2 Mon Sep 17 00:00:00 2001 From: amrita.vishnoi Date: Fri, 15 Jul 2016 18:10:20 +0530 Subject: [PATCH] Refs: #4462 Normal mode is implemented. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 2 +- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index c3db1cd..058cdf2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -60,6 +60,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.previousHighlightList = []; + $rootScope.isNormalMode = false; + //array for bodyviewid correspoing to male female(used for gender change) $scope.correspondingBodyViewIds = { '1': '5', @@ -260,7 +262,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isBodyRegionDataLoaded = true; // alert('da_dat_brview= ' + result) - var currentBodyViewId = localStorage.getItem("currentBodyViewId"); + var currentBodyViewId; + if ($scope.isNormalMode == true) + { + currentBodyViewId = $scope.viewOrientationId; + } + else + { + currentBodyViewId = localStorage.getItem("currentBodyViewId"); + } var layerJsonPath = ''; var bgArtJsonPath = ''; var CommonViewId = 0; @@ -458,7 +468,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { - // debugger; + debugger; //remove the previous layer mask data from array var n = $rootScope.MaskCanvasData.length @@ -506,6 +516,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo angular.forEach($scope.bodyRegionCoordinates, function (value, key) { + debugger; if (value._HaveMirrorImage == 'Y') { @@ -580,7 +591,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } else { - //Draw body region which don't have mirror image + + debugger; + + + //Draw body region which don't have mirror image11 //0.Scaling as per default zoom @@ -623,6 +638,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //4.Draw body region for mask image $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y'); + debugger; //draw figLeaf for modesty @@ -1104,6 +1120,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + debugger; var imgCanvas = document.createElement('canvas'); // imgCanvas.style.backgroundColor = 'red'; imgCanvas.height = h; @@ -1380,7 +1397,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.highLightBodyBasedOnIcolor = function (RGBColor) { - debugger; + // debugger; //terminate previous running workers to create space for new workers var workerCount = $scope.runningWorkers.length; if (workerCount > 0) { @@ -3258,6 +3275,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } else { $rootScope.isHighLight = true; + $rootScope.isNormalMode = false; $scope.highLightBody(); } @@ -3267,7 +3285,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableExtract = function () { // alert('extract called'); - debugger; + //debugger; if ($rootScope.isExtract == true) { @@ -3275,6 +3293,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { $rootScope.isExtract = true; + $rootScope.isNormalMode = false; //1. $scope.highLightBody(); @@ -3282,11 +3301,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } + $scope.enableNormalMode = function () { + + if ($rootScope.isNormalMode == true) { + + } + else { + + //1. + $scope.flushCanvas(); + + //2. + $rootScope.isNormalMode = true; + + //3. + $rootScope.isHighLight = false; + + + $scope.CalculateImageCordinates($scope.viewOrientationId); + } + + + } + $scope.highLightBody = function () { - debugger; + //debugger; if ($rootScope.isHighLight == true) { @@ -3336,7 +3378,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo img.onload = function () { //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) - debugger; + //debugger; var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); DAData.draw(img); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index c5586a3..144bf5c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -101,7 +101,7 @@
- +
-- libgit2 0.21.4