Commit 274b2b94cee437ba88f43ab3a958f6971f04aa82

Authored by Nikita Kulshreshtha
1 parent 18e0a4a5

list manger is working for trems except few cases.

in few cases it is not hihlightihting the organ. also body system filter needs to be imlemented.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -26,7 +26,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
26 26 $scope.daCounter = 1;
27 27 $scope.bagartDetails;
28 28 $scope.transNumber = 50;
29   -
  29 + $scope.grayeddBR = [];
30 30 //for transarency scale
31 31 $scope.TBDrawStartX;
32 32 $scope.TBDrawStartY;
... ... @@ -464,7 +464,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
464 464 // debugger;
465 465 //void is to get images and json and vieworientationId is to get coordiantes from json of respective body view
466 466 $scope.layerNumber = 0;
467   - $scope.skinTone = DA[0].ethnicity;
  467 + $rootScope.skinTone = DA[0].ethnicity;
468 468  
469 469 $rootScope.viewOrientationId = $scope.voId;
470 470 if ( $rootScope.voId == 5) {
... ... @@ -736,7 +736,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
736 736  
737 737  
738 738 });
739   -
  739 + console.log('layer change done')
740 740 if ((DA[0].modesty == 'Y')) {
741 741 if ($('.modestyImg') != null) {
742 742 $('.modestyImg').css('visibility', 'visible');
... ... @@ -766,6 +766,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
766 766 // $('#spinner').css('visibility', 'hidden');
767 767 $rootScope.isLoading = false;
768 768  
  769 + //for list manager event
  770 + //if ($scope.isHighlightByListManager == true) {
  771 + // console.log('$scope.isHighlightByListManager in calcu;ate= ' + $scope.isHighlightByListManager)
  772 + // $rootScope.isHighLight = true;
  773 + // $scope.highLightBody()
  774 +
  775 + //}
769 776 }
770 777  
771 778 function scaleRectangle(x, y, height, width, mirrorValue) {
... ... @@ -842,9 +849,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
842 849 var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
843 850 var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone;
844 851  
845   - if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
  852 + if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $rootScope.skinTone) {
846 853  
847   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  854 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $rootScope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
848 855 }
849 856 }
850 857 }
... ... @@ -894,7 +901,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
894 901 //filter bodyRegion data basd on skintone
895 902 $scope.bagartDetailsOnSktn = new jinqJs()
896 903 .from($scope.bagartBodyRegionDetails)
897   - .where('_Skintone == ' + $scope.skinTone)
  904 + .where('_Skintone == ' + $rootScope.skinTone)
898 905 .select();
899 906  
900 907 //only brid=2 is having different male,female image, other bodr region have common images for male, female
... ... @@ -902,12 +909,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
902 909 for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) {
903 910 var gender = $scope.bagartDetailsOnSktn[z]._Gender;
904 911 if (gender == selectedGender) {
905   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
  912 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $rootScope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
906 913 }
907 914 }
908 915 }
909 916 else {
910   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId;
  917 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $rootScope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId;
911 918  
912 919 }
913 920 }
... ... @@ -3367,13 +3374,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3367 3374  
3368 3375  
3369 3376 $scope.highLightBody = function () {
3370   -
  3377 +
3371 3378 if ($rootScope.isHighLight == true) {
3372   - $timeout(function () {
3373   -
  3379 + $scope.grayeddBR = [];
3374 3380 angular.forEach($scope.ColoredImageSRC, function (value, key) {
3375   - console.log('highllight 1233')
3376   - debugger
  3381 +
  3382 + // debugger
3377 3383  
3378 3384 var id;
3379 3385 if (value.haveMirror == 'true') {
... ... @@ -3419,58 +3425,66 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3419 3425  
3420 3426  
3421 3427  
3422   - img.onload = function () {
3423   - //console.log(Math.max(img.width) + ', ' + Math.max(img.height))
3424   -
3425   - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
3426   - DAData.draw(img);
3427   - var RED = 0.3086; // luminance contrast value for red
3428   - var GREEN = 0.694; // luminance contrast value for green
3429   - var BLUE = 0.0820; // luminance contrast value for blue
  3428 + img.onload = function () {
  3429 + //console.log(Math.max(img.width) + ', ' + Math.max(img.height))
  3430 + console.log('highllight onload')
  3431 + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
  3432 + DAData.draw(img);
  3433 +
  3434 + var RED = 0.3086; // luminance contrast value for red
  3435 + var GREEN = 0.694; // luminance contrast value for green
  3436 + var BLUE = 0.0820; // luminance contrast value for blue
3430 3437  
3431   - var RGB = [RED, GREEN, BLUE, 0, 0];
3432   - var RGB2 = [RED, GREEN, BLUE, 0, 0];
3433   - var RGB3 = [RED, GREEN, BLUE, 0, 0];
3434   - var ALPHA = [0, 0, 0, 1, 0];
  3438 + var RGB = [RED, GREEN, BLUE, 0, 0];
  3439 + var RGB2 = [RED, GREEN, BLUE, 0, 0];
  3440 + var RGB3 = [RED, GREEN, BLUE, 0, 0];
  3441 + var ALPHA = [0, 0, 0, 1, 0];
3435 3442  
3436   - var rgbPx = RGB.concat(RGB2);
3437   - var rgbPx2 = rgbPx.concat(RGB3);
3438   - var matrix = rgbPx2.concat(ALPHA);
  3443 + var rgbPx = RGB.concat(RGB2);
  3444 + var rgbPx2 = rgbPx.concat(RGB3);
  3445 + var matrix = rgbPx2.concat(ALPHA);
3439 3446  
3440   - var zeroPoint = new Point();
3441   - var grayScale = new ColorMatrixFilter(matrix);
3442   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
  3447 + var zeroPoint = new Point();
  3448 + var grayScale = new ColorMatrixFilter(matrix);
  3449 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
3443 3450  
3444   - context_gray.putImageData(DAData.data, 0, 0)
  3451 + context_gray.putImageData(DAData.data, 0, 0)
3445 3452  
3446   - var grayImageData = context_gray.getImageData(0, 0, width, ht);
3447   - var grayImageImageDataVar = grayImageData.data;
  3453 + var grayImageData = context_gray.getImageData(0, 0, width, ht);
  3454 + var grayImageImageDataVar = grayImageData.data;
3448 3455  
3449   - if (value.haveMirror == 'true') {
3450   - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
3451   - }
3452   - else {
3453   - //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3456 + if (value.haveMirror == 'true') {
  3457 + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  3458 + }
  3459 + else {
  3460 + //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
3454 3461  
3455   - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3462 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3463 + }
3456 3464 }
3457   - }
3458   -
3459   - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
3460   - })
3461   - }, 50)
3462   -
3463 3465  
  3466 +
3464 3467  
3465   - //if ($scope.previousSelectedTermList.length > 0) {
  3468 + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
  3469 +
  3470 + $scope.grayeddBR.push({ 'BRID': value.bodyRegionId })
  3471 +
  3472 + if ($scope.grayeddBR.length == 9) {
  3473 + if ($scope.isHighlightByListManager == true) {
  3474 + $timeout(function () {
  3475 +
  3476 + // $rootScope.isHighLight = false;
  3477 +
  3478 + $scope.HighlightBodyByTermList($scope.TermList)
  3479 + }, 800);
3466 3480  
3467   - // //alert('previousSelectedTermList length: ' + $scope.previousSelectedTermList.length);
  3481 + }
  3482 + }
  3483 + })
3468 3484  
3469   - // for (var i = 0; i < $scope.previousSelectedTermList.length; i++) {
3470   - // $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]);
  3485 +
3471 3486  
3472   - // }
3473   - //}
  3487 +
3474 3488  
3475 3489 }
3476 3490 }
... ... @@ -3853,7 +3867,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3853 3867 //list manager
3854 3868 $scope.$on('listManagerEvent', function (event, data) {
3855 3869 // debugger;
3856   -
  3870 + console.log('listManagerEvent')
3857 3871 if ($rootScope.islistManagerEventAlredayDispachted == true) {
3858 3872  
3859 3873 var len = $rootScope.openModules.length;
... ... @@ -3963,19 +3977,47 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3963 3977 // alert('hi: ' + event.currentTarget.attributes[0].value);
3964 3978 //debugger;
3965 3979 var actualTermNumber = event.currentTarget.attributes[0].value;
3966   - var TermList = $scope.getTermNumberList(actualTermNumber);
3967   - var layerNumberList = [];
3968   - for (var i = 0; i < TermList.length; i++) {
3969   - var layerNumber = TermList[i]._InternalLayerNumber
  3980 + $scope.TermList = $scope.getTermNumberList(actualTermNumber);
  3981 + var internalLayerNumberList = [];
  3982 + for (var i = 0; i < $scope.TermList.length; i++) {
  3983 + var layerNumber = $scope.TermList[i]._InternalLayerNumber
3970 3984  
3971   - layerNumberList[i] = parseInt(layerNumber);
  3985 + internalLayerNumberList[i] = parseInt(layerNumber);
3972 3986 }
3973 3987 // debugger;
3974 3988 //4.
3975 3989 // layerNumberList.sort();
3976   - layerNumberList.sort(function (a, b) { return a - b })
3977   - var lNum = (layerNumberList[0]).toString().replace('00', '');
3978   - $scope.layerNumber = parseInt(lNum) - 1;
  3990 + internalLayerNumberList.sort(function (a, b) { return a - b })
  3991 + var internalLayerNumber = internalLayerNumberList[0]//.replace('00', '');
  3992 +
  3993 +
  3994 + if (internalLayerNumber >= DA[0].SKIN_START_INTERNAL_LAYER && internalLayerNumber <= DA[0].SKIN_END_INTERNAL_LAYER) {
  3995 +
  3996 + internalLayerNumber = DA[0].SKIN_DEFAULT_INTERNAL_LAYER;
  3997 + }
  3998 +
  3999 + var layerNumber;
  4000 + var matchedLayerNumber = new jinqJs()
  4001 + .from($rootScope.BodyLayerData.Layers.DataLayer)
  4002 + .where("_lni == "+internalLayerNumber)
  4003 + .select('_LayerNumber');
  4004 +
  4005 + if (matchedLayerNumber.length == 0) {
  4006 + layerNumber = 0;
  4007 + }
  4008 + else{
  4009 + layerNumber = matchedLayerNumber[0]._LayerNumber
  4010 + }
  4011 +
  4012 + if (layerNumber == 0) {
  4013 + layerNumber = $scope.totalLayers;
  4014 + }
  4015 + else {
  4016 + layerNumber = parseInt(layerNumber) - 1;
  4017 + }
  4018 +
  4019 + $scope.layerNumber = layerNumber;
  4020 +
3979 4021  
3980 4022 $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
3981 4023 $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
... ... @@ -4016,19 +4058,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4016 4058 $timeout(function () {
4017 4059 $rootScope.isHighLight = false;
4018 4060 $scope.CalculateImageCordinates($scope.viewOrientationId)
4019   - }, 100);
  4061 + }, 10);
4020 4062  
  4063 + $scope.isHighlightByListManager = true;
4021 4064  
4022 4065 $timeout(function () {
4023 4066 $rootScope.isHighLight = true;
4024 4067 $scope.highLightBody()
4025   - }, 100);
4026   - $timeout(function () {
  4068 + }, 500);
  4069 + //$timeout(function () {
4027 4070  
4028   - // $rootScope.isHighLight = false;
  4071 + // // $rootScope.isHighLight = false;
4029 4072  
4030   - $scope.HighlightBodyByTermList(TermList)
4031   - }, 1000);
  4073 + // $scope.HighlightBodyByTermList($scope.TermList)
  4074 + //}, 2000);
4032 4075 }
4033 4076  
4034 4077  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -210,7 +210,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
210 210 //list manager function
211 211  
212 212 $rootScope.ShowListManager = function () {
213   -
  213 + console.log('ShowListManager')
  214 +
214 215 $('#listManager').css('display', 'block');
215 216 $("#listManager").css("visibility", "visible");
216 217 $('#listManager').draggable();
... ...
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... ... @@ -162,6 +162,9 @@ AIA.constant(&#39;DA&#39;, [
162 162 ethnicity: 'W',
163 163 modesty: 'Y',
164 164 figLeafTermId: '5868',
  165 + SKIN_START_INTERNAL_LAYER: 100,
  166 + SKIN_END_INTERNAL_LAYER: 199,
  167 + SKIN_DEFAULT_INTERNAL_LAYER: 100
165 168 },
166 169 ]);
167 170  
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -294,10 +294,10 @@
294 294 padding-right: 15px;
295 295 }
296 296 </style>
297   - <div id="listManager" style="position:fixed;top:80px;left:200px;display:none;z-index:1100;">
  297 + <div id="listManager" style="position:fixed;top:150px;left:130px;display:none;z-index:1100;">
298 298 <div class="modal-header annotation-modal-header">
299 299 <button type="button" class="close" aria-label="Close" ng-click="CloseListManager()"><span aria-hidden="true">&times;</span></button>
300   - <h4 class="modal-title" id="myModalLabel">List Manage</h4>
  300 + <h4 class="modal-title" id="myModalLabel">List Manager</h4>
301 301 </div>
302 302 <div class="container" style="background:white;width:400px;height:500px;" ng-init="FillListManager()">
303 303 <div class="form-group">
... ...