From 885da7bcf27f0f5860e032fabd1800bdcf4515bc Mon Sep 17 00:00:00 2001 From: amrita.vishnoi Date: Fri, 29 Jul 2016 17:30:27 +0530 Subject: [PATCH] List Manager is merged --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 591 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 28 +++++++++++++++++++++++++++- 400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js | 5 +++++ 400-SOURCECODE/AIAHTML5.Web/index.html | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------- 4 files changed, 677 insertions(+), 152 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index a0facf9..cd09477 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -19,9 +19,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.TermNumberData; $rootScope.BodySystemData $scope.bodyViewId = 0; - $scope.bgartData; + $rootScope.bgartData; //view specific constants - $scope.voId; + $rootScope.voId; $scope.layerNumber; $scope.daCounter = 1; $scope.bagartDetails; @@ -292,7 +292,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openBodyView = function () { //debugger; $rootScope.isLoading = true; - $scope.voId = localStorage.getItem("currentBodyViewId");; + $rootScope.voId = localStorage.getItem("currentBodyViewId");; //load bodyRegion data var brViewdata = DataService.getJson('~/../content/data/json/da/da_dat_brview.json') @@ -501,29 +501,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.layerNumber = 0; $scope.skinTone = DA[0].ethnicity; - $scope.viewOrientationId = $scope.voId; - if ($scope.voId == 5) { + $scope.viewOrientationId = $rootScope.voId; + if ($rootScope.voId == 5) { $scope.viewOrientationId = 1; } - else if ($scope.voId == 6) { + else if ($rootScope.voId == 6) { $scope.viewOrientationId = 2; } - else if ($scope.voId == 7) { + else if ($rootScope.voId == 7) { $scope.viewOrientationId = 3; } - else if ($scope.voId == 8) { + else if ($rootScope.voId == 8) { $scope.viewOrientationId = 4; } - else if ($scope.voId == 9) { + else if ($rootScope.voId == 9) { $scope.viewOrientationId = 5; } - else if ($scope.voId == 10) { + else if ($rootScope.voId == 10) { $scope.viewOrientationId = 6; } - else if ($scope.voId == 11) { + else if ($rootScope.voId == 11) { $scope.viewOrientationId = 5; } - else if ($scope.voId == 12) { + else if ($rootScope.voId == 12) { $scope.viewOrientationId = 6; } @@ -536,13 +536,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo bgartdata.then( function (result) { //debugger; - $scope.bgartData = result; + $rootScope.bgartData = result; $scope.CalculateImageCordinates($scope.viewOrientationId); }, function (error) { // handle errors here - console.log(' $scope.bgartData = ' + error.statusText); + console.log(' $rootScope.bgartData = ' + error.statusText); }); }; @@ -550,7 +550,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { - // debugger; + console.log('CalculateImageCordinates'); //remove the previous layer mask data from array var n = $rootScope.MaskCanvasData.length @@ -577,7 +577,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate image coordinates and draw image var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews; - // var viewOrientationId = String($scope.voId); + // var viewOrientationId = String($rootScope.voId); $scope.bodyRegionCoordinates = new jinqJs() @@ -585,10 +585,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo .where('_ViewOrientationId == ' + viewOrientationId) .select(); - // if ($scope.voId == 9 || $scope.voId == 11) { + // if ($rootScope.voId == 9 || $rootScope.voId == 11) { $scope.bagartDetails = new jinqJs() - .from($scope.bgartData.BackgroundArts.BackgroundArtDetail) + .from($rootScope.bgartData.BackgroundArts.BackgroundArtDetail) .where('_ViewOrientationId == ' + viewOrientationId) .select(); //} @@ -758,7 +758,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); - var src = "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; + var src = "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N') @@ -883,7 +883,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } } } @@ -891,10 +891,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { // debugger; //below 4 bodyviews have only single body region - if ($scope.voId == 9 || $scope.voId == 11 || $scope.voId == 10 || $scope.voId == 12) { + if ($rootScope.voId == 9 || $rootScope.voId == 11 || $rootScope.voId == 10 || $rootScope.voId == 12) { var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId; - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; } else // it is for other body view which have multiple body regions and layer no > 0 @@ -904,7 +904,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; if (bodyRegion == bodyRegionId) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } @@ -941,12 +941,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) { var gender = $scope.bagartDetailsOnSktn[z]._Gender; if (gender == selectedGender) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; } } } else { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; } } @@ -1229,7 +1229,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //set z index to make leaf canvas on top of hip canavs imgCanvas.style.zIndex = "200"; } - if (($scope.voId == 11 || $scope.voId == 9) && bodyRegionId == 6) { + if (($rootScope.voId == 11 || $rootScope.voId == 9) && bodyRegionId == 6) { imgCanvas.style.zIndex = "500"; } @@ -1302,7 +1302,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er // else if (maskCanvasId.match('modestyImg') && RGBColor == '000000') { - //if ($scope.voId == 11) { + //if ($rootScope.voId == 11) { // maskCanvasId = 'imageCanvas6_mci'; // x = $('#imageCanvas6_mci').left; // y = $('#imageCanvas6_mci').top; @@ -1630,6 +1630,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.HighlightBodyByTermList = function (TermList) { + + console.log('HighlightBodyByTermList is called'); + $scope.highlightedBR = null; $scope.highlightedBR = []; @@ -1653,9 +1656,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { for (var x = 0; x < 9; x++) { - // console.log('$rootScope.MaskCanvasData.length= ' + n) - // debugger + console.log('$rootScope.MaskCanvasData.length= ' + n) + // debugger + var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId; var canvasId = $rootScope.MaskCanvasData[x].canvasId; var maskData = $rootScope.MaskCanvasData[x].maskData; @@ -3025,8 +3029,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { - //if ($scope.voId != "9") { - // if ($scope.voId != "11") { + //if ($rootScope.voId != "9") { + // if ($rootScope.voId != "11") { // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); // } @@ -3038,7 +3042,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); // } //} - if (($scope.voId == "9" || $scope.voId == "11")) { + if (($rootScope.voId == "9" || $rootScope.voId == "11")) { if (value.bodyRegionId == "6") { $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); } @@ -3385,7 +3389,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var length = imageData.length; //change background of image from transparent to white - if ($scope.voId == 9 || $scope.voId == 11) { + if ($rootScope.voId == 9 || $rootScope.voId == 11) { for (var i = 3; i < length; i += 4) { imageData[i] = '#FFFFFFFF'; } @@ -4241,6 +4245,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highLightBody = function () { + console.log('highLightBody is called'); if ($rootScope.isHighLight == true) { @@ -4346,6 +4351,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.grayeddBR.length == 9) { if ($scope.isHighlightByListManager == true) { + + console.log('$scope.grayeddBR.length is ' + $scope.grayeddBR.length); $timeout(function () { // $rootScope.isHighLight = false; @@ -4569,7 +4576,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $(event.currentTarget.attributes[2].value).parent().addClass("active"); var viewname = localStorage.getItem("currentViewTitle") - var currentBodyViewId = $scope.correspondingBodyViewIds[$scope.voId]; + var currentBodyViewId = $scope.correspondingBodyViewIds[$rootScope.voId]; if ((event.currentTarget.attributes[1].value == 'Male') && (localStorage.getItem("genderId") == 'Female')) { @@ -4639,7 +4646,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.voId = currentBodyViewId; + $rootScope.voId = currentBodyViewId; var layerJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_layer_' + currentBodyViewId + '.json'; @@ -4688,18 +4695,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; $scope.viewOrientationId = selectedViewId; if (localStorage.getItem("genderId") == 'Male') { - if ($scope.voId != selectedViewId) { + if ($rootScope.voId != selectedViewId) { if (selectedViewId == 5) { - $scope.voId = 9; + $rootScope.voId = 9; } else if (selectedViewId == 6) { - $scope.voId = 10; + $rootScope.voId = 10; } else - $scope.voId = selectedViewId; + $rootScope.voId = selectedViewId; $rootScope.isLoading = true; - $scope.loadSelectedBodyView($scope.voId); + $scope.loadSelectedBodyView($rootScope.voId); }; @@ -4716,11 +4723,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } else selectedViewId = $scope.correspondingBodyViewIds[selectedViewId];; - if ($scope.voId != selectedViewId) { - $scope.voId = selectedViewId; + if ($rootScope.voId != selectedViewId) { + $rootScope.voId = selectedViewId; $rootScope.isLoading = true; - $scope.loadSelectedBodyView($scope.voId); + $scope.loadSelectedBodyView($rootScope.voId); }; @@ -4869,6 +4876,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + + function OnPaintCanvasMouseMove(event) { if ($rootScope.isDrawingToolSelected == true) { @@ -4893,7 +4902,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //body highlight options functinality $scope.LoadBodySystemData = function () { - var currentBodyViewId = $scope.voId; + var currentBodyViewId = $rootScope.voId; var systemListHtml = '