Commit 895c9048500d068e66af7fc43b7452b4347648f7

Authored by Nikita Kulshreshtha
1 parent 1b583af9

now zoom with tbox is workking fine.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1718,7 +1718,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1718 1718 else {
1719 1719  
1720 1720 // for existing DA
1721   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  1721 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  1722 +
1722 1723 $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
1723 1724 }
1724 1725  
... ... @@ -1886,7 +1887,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1886 1887 $('#spinner').css('visibility', 'visible');
1887 1888  
1888 1889 //redraw body of respective layer
1889   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  1890 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  1891 +
1890 1892 $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
1891 1893  
1892 1894 }, 500);
... ... @@ -2319,13 +2321,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
2319 2321 else
2320 2322 lNumber = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw');
2321 2323  
2322   - alert("GetImageSource lNumber IF= " + lNumber);
2323   -
  2324 + console.log("GetImageSource lNumber IF= " + lNumber)
2324 2325 }
2325 2326 else{
2326 2327  
2327 2328 lNumber = $scope.GetwindowStoreData(windowviewid, 'layerNumber');
2328   - alert("GetImageSource lNumber = " + lNumber);
  2329 + console.log("GetImageSource lNumber = " + lNumber);
2329 2330  
2330 2331 }
2331 2332 $scope.userInput = parseInt(lNumber);
... ... @@ -4716,7 +4717,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4716 4717 }
4717 4718  
4718 4719 //2.
4719   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  4720 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  4721 + console.log("CalculateImageCordinates call from 4723");
  4722 +
4720 4723 $scope.CalculateImageCordinates(viewOrientationId,windowviewid);
4721 4724  
4722 4725 //3.
... ... @@ -5649,7 +5652,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
5649 5652 e.preventDefault();
5650 5653  
5651 5654 $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false);
5652   - $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
5653 5655 $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode'));
5654 5656 $scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight'));
5655 5657  
... ... @@ -5827,8 +5829,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
5827 5829 $scope.DrawTransparencyBox = function (windowviewid) {
5828 5830 var newDimes = null;
5829 5831 // if ($scope.GetwindowStoreData(windowviewid, 'zoomInOut') == 25) {
5830   - if ($scope.GetwindowStoreData(windowviewid, 'isZoomed') == true) {
5831   - alert("ZOOM");
  5832 + if ( $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated') && $scope.GetwindowStoreData(windowviewid, 'isZoomed') == true) {
  5833 + // alert("ZOOM");
5832 5834 newDimes = $scope.scaleTransparencyBox(windowviewid);
5833 5835  
5834 5836 $scope.TransparencyBoxStartX = newDimes.scaledX1;
... ... @@ -6046,7 +6048,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
6046 6048 else {
6047 6049 existingZoon = 25;
6048 6050 }
6049   - alert( 'nzoom = '+nzoom+',existingZoon= '+existingZoon )
6050 6051 var X = 0;
6051 6052 var scaledY = 0;
6052 6053 var scaledHeight = 0;
... ... @@ -6412,7 +6413,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
6412 6413 $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged, isResized, windowviewid) {
6413 6414  
6414 6415 $scope.SetwindowStoreData(windowviewid, 'isCallForTransparencyImage', true);
6415   -
  6416 + // $scope.SetwindowStoreData(windowviewid, 'isZoomed',false);
6416 6417 var transparencyCanvas = document.getElementById('transparencyCanvas_' + windowviewid);
6417 6418  
6418 6419 TransparencyBoxStartX = parseInt((transparencyCanvas.style.left).replace('px', ''));
... ... @@ -6431,21 +6432,24 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
6431 6432 var WidthforTransImage = TBImageDimensions.WidthforTransImageTB;
6432 6433 var HeightforTransImage = TBImageDimensions.HeightforTransImageTB;
6433 6434 var YforTransImage = TBImageDimensions.YforTransImageTB;
  6435 + var tranparencyLayer;
6434 6436  
  6437 + var isResized = $scope.GetwindowStoreData(windowviewid, "isResized");
6435 6438  
6436 6439 //0. get current layer number
6437 6440 if (isResized || isLayerChanged) {
6438 6441 //do nothing
6439 6442 $scope.SetwindowStoreData(windowviewid,'transNumber',100);
6440 6443 $("#tbSlider_" + windowviewid).slider('value', 100);
  6444 + tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val());
6441 6445  
6442 6446 }
6443 6447 else {
6444 6448  
6445 6449  
6446   - var tranparencyLayer;
  6450 +
6447 6451 // alert($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated")+"---"+($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked")))
6448   - if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true)) ){
  6452 + if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true) || $scope.GetwindowStoreData(windowviewid, "isZoomed") == true)) {
6449 6453 tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val());
6450 6454 $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false);
6451 6455 $scope.SetwindowStoreData(windowviewid, 'isHighlightlBtnClicked', false);
... ... @@ -6461,9 +6465,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
6461 6465 tranparencyLayer = currentLayer + 1;
6462 6466 }
6463 6467 }
6464   - $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer);
6465 6468  
6466 6469 }
  6470 + console.log("loadTransparencyImage::: tranparencyLayer = " + tranparencyLayer);
  6471 + $scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer);
  6472 + console.log(" $scope.GetwindowStoreData(windowviewid, 'layerNumber')===" + $scope.GetwindowStoreData(windowviewid, 'layerNumber'));
6467 6473  
6468 6474 $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber'));
6469 6475  
... ... @@ -7113,8 +7119,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
7113 7119  
7114 7120  
7115 7121 }
  7122 +
7116 7123 $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
7117 7124 $scope.EnableUI();
  7125 +
  7126 + $scope.SetwindowStoreData(windowviewid, 'isZoomed',false);
  7127 +
7118 7128 }
7119 7129  
7120 7130 $scope.changeTransparency = function (windowviewid) {
... ... @@ -7411,179 +7421,190 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
7411 7421  
7412 7422 if (tCanvasHeight != $scope.transparencyCanvasHeight || tCanvasWidth != $scope.transparencyCanvasWidth) {
7413 7423  
  7424 + $scope.TransparencyBoxStartX = tBoxStartX;
  7425 + $scope.TransparencyBoxStartY = tBoxStartY;
  7426 + $scope.TBoxEndX = tBoxEndX;
  7427 + $scope.TBoxEndY = tBoxEndY;
  7428 + $scope.TBHeight = tBoxEndY - tBoxStartY;
  7429 + $scope.TBWidth = tBoxEndX - tBoxStartX;
7414 7430  
7415   - var transparencyCanvas = document.createElement('canvas');
7416   - transparencyCanvas.id = 'transparencyCanvas_' + windowviewid;
7417   - $scope.transparencyCanvas = tCanvas.id;
7418   - transparencyCanvas.height = tCanvasHeight;
7419   - transparencyCanvas.width = tCanvasWidth;
7420   - transparencyCanvas.style.position = "absolute";
7421   - transparencyCanvas.style.left = tCanvas.style.left; // x + "px";
7422   - transparencyCanvas.style.top = tCanvas.style.top//y + "px";
7423   - transparencyCanvas.style.border = "black 1px solid";
7424   - transparencyCanvas.style.zIndex = 200;
  7431 + $scope.SetwindowStoreData(windowviewid, "isResized", true);
7425 7432  
7426 7433  
7427   - document.getElementById('canvasDivDA_' + windowviewid).appendChild(transparencyCanvas);
  7434 + $scope.DrawTransparencyBox(windowviewid);
7428 7435  
7429   - $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
7430   - $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid,'UIWrapperZIndex'));
  7436 + // var transparencyCanvas = document.createElement('canvas');
  7437 + // transparencyCanvas.id = 'transparencyCanvas_' + windowviewid;
  7438 + // $scope.transparencyCanvas = tCanvas.id;
  7439 + // transparencyCanvas.height = tCanvasHeight;
  7440 + // transparencyCanvas.width = tCanvasWidth;
  7441 + // transparencyCanvas.style.position = "absolute";
  7442 + // transparencyCanvas.style.left = tCanvas.style.left; // x + "px";
  7443 + // transparencyCanvas.style.top = tCanvas.style.top//y + "px";
  7444 + // transparencyCanvas.style.border = "black 1px solid";
  7445 + // transparencyCanvas.style.zIndex = 200;
7431 7446  
7432   - //bind click listener
7433   - transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
7434   - }
7435   - $scope.transparencyCanvasHeight = tCanvasHeight;
7436   - $scope.transparencyCanvasWidth = tCanvasWidth;
7437 7447  
  7448 + // document.getElementById('canvasDivDA_' + windowviewid).appendChild(transparencyCanvas);
7438 7449  
7439   - //create temp cavas to retain the original anavs data for use in transparency change as
7440   - //if u use original canvas data for transprency change then at 0 transparency all data will become transparent and if u increase transparency with this data then the canavs will be blank
7441   - if (document.getElementById('tempCanvas_' + windowviewid) != null) {
7442   - $('#tempCanvas_'+ windowviewid).remove();
7443   - }
7444   - var tempCanvas = document.createElement('canvas');
7445   - tempCanvas.id = 'tempCanvas_' + windowviewid;
7446   - $scope.tempCanvas = tempCanvas.id;
7447   - tempCanvas.height = $scope.transparencyCanvasHeight;
7448   - tempCanvas.width = $scope.transparencyCanvasWidth;
7449   - tempCanvas.style.position = "absolute";
7450   - tempCanvas.style.left = 200 + 'px';
7451   - tempCanvas.style.backgroundColor = "transparent";
7452   - tempCanvas.style.visibility = 'hidden';
7453   - // tempCanvas.style.border = "black 1px solid";
7454   -
7455   - document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas);
7456   -
7457   - var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData');
7458   -
7459   - $scope.IncludedBodyRegions = [];
7460   - $scope.transparencyDrawnRegions = [];
7461   - $scope.canThirdBRDrawn = false;
7462   - var counter = 0;
7463   - var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
7464   - $.each(BodyRegionDictionary, function (index, value) {
7465   -
7466   - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
7467   - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
7468   - var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
7469   - var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
7470   - var TBStartX = parseInt((document.getElementById('transparencyCanvas_'+ windowviewid).style.left).replace('px', ''));
7471   - var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
7472   -
7473   - if (TBStartX <= bodyRegionRight && value.X <= TBRight && TBStartY <= bodyRegionBottom && value.Y <= TBBottom) {
7474   -
7475   - if ($scope.GetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion') == false) {
7476   - var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
7477   - var layer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
7478   - if (layer < totalayer) {
7479   -
7480   - var layerup=layer+1;
7481   - $scope.SetwindowStoreData(windowviewid,'layerNumber',layerup);
7482   - }
7483   -
7484   - }
7485   -
7486   - if (value.bodyRegionId == '3') {
7487   -
7488   - var BR_SixTBData = new jinqJs()
7489   - .from($scope.transparencyDrawnRegions)
7490   - .where('BRID == 6')
7491   - .select();
7492   -
7493   - if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
7494   -
7495   - $scope.canThirdBRDrawn = true;
7496   -
7497   - }
7498   -
7499   -
7500   - }
7501   -
7502   - if ((bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" ||bodyVid == "7")) {
7503   - if (value.bodyRegionId == "6") {
7504   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7505   - }
7506   - else {
7507   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7508   - }
7509   - }
7510   - else {
7511   - if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
  7450 + // $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
  7451 + // $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid,'UIWrapperZIndex'));
7512 7452  
7513   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7514   - }
7515   -
7516   - else {
7517   -
7518   - if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
7519   -
7520   - //1. draw 6th
7521   - var BRSixData = new jinqJs()
7522   - .from(BodyRegionDictionary)
7523   - .where('bodyRegionId == 6')
7524   - .select();
7525   - var isMirror = BRSixData[0].IsMirror;
7526   - if (isMirror == 'Yes') {
7527   - //draw mirror arm
7528   - $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7529   - //draw non mirror arm
7530   - $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7531   - //draw 3rd BR
7532   - $timeout(function () {
7533   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7534   - }, 200);
7535   - }
7536   - else {
7537   - //draw mirror arm
7538   - $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7539   - //draw non mirror arm
7540   - $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7541   - //draw 3rd BR
7542   - $timeout(function () {
7543   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7544   - }, 200);
7545   - }
7546   -
7547   -
7548   - }
7549   - else {
7550   - var BR_SixTBData = new jinqJs()
7551   - .from($scope.transparencyDrawnRegions)
7552   - .where('BRID == 6')
7553   - .select();
7554   - if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) {
7555   - //do not draw 6 BR again, its already drawn
7556   - }
7557   - else
7558   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7559   - }
7560   - }
7561   - }
7562   - $scope.SetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion',true);
7563   - }
7564   -
7565   -
7566   - })
7567   -
7568   - var isModestyOn=$scope.GetwindowStoreData(windowviewid,'isModestyOn');
7569   - var modestyImageInfo=$scope.GetwindowStoreData(windowviewid,'modestyImageInfo');
7570   - //for modesty
7571   - if (isModestyOn == true && modestyImageInfo.length > 0) {
7572   - $.each(modestyImageInfo, function (index, value) {
7573   -
7574   - var bodyRegionRight = parseInt(value.x) + parseInt(value.Width);
7575   - var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height);
7576   - var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
7577   - var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
7578   - var TBStartX = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', ''));
7579   - var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
7580   -
7581   - if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) {
  7453 + // //bind click listener
  7454 + // transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
  7455 + //}
  7456 + //$scope.transparencyCanvasHeight = tCanvasHeight;
  7457 + //$scope.transparencyCanvasWidth = tCanvasWidth;
7582 7458  
7583   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
7584 7459  
7585   - }
7586   - })
  7460 + ////create temp cavas to retain the original anavs data for use in transparency change as
  7461 + ////if u use original canvas data for transprency change then at 0 transparency all data will become transparent and if u increase transparency with this data then the canavs will be blank
  7462 + //if (document.getElementById('tempCanvas_' + windowviewid) != null) {
  7463 + // $('#tempCanvas_'+ windowviewid).remove();
  7464 + //}
  7465 + //var tempCanvas = document.createElement('canvas');
  7466 + //tempCanvas.id = 'tempCanvas_' + windowviewid;
  7467 + //$scope.tempCanvas = tempCanvas.id;
  7468 + //tempCanvas.height = $scope.transparencyCanvasHeight;
  7469 + //tempCanvas.width = $scope.transparencyCanvasWidth;
  7470 + //tempCanvas.style.position = "absolute";
  7471 + //tempCanvas.style.left = 200 + 'px';
  7472 + //tempCanvas.style.backgroundColor = "transparent";
  7473 + //tempCanvas.style.visibility = 'hidden';
  7474 + //// tempCanvas.style.border = "black 1px solid";
  7475 +
  7476 + //document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas);
  7477 +
  7478 + //var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData');
  7479 +
  7480 + //$scope.IncludedBodyRegions = [];
  7481 + //$scope.transparencyDrawnRegions = [];
  7482 + //$scope.canThirdBRDrawn = false;
  7483 + //var counter = 0;
  7484 + //var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
  7485 + //$.each(BodyRegionDictionary, function (index, value) {
  7486 +
  7487 + // var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
  7488 + // var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
  7489 + // var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
  7490 + // var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
  7491 + // var TBStartX = parseInt((document.getElementById('transparencyCanvas_'+ windowviewid).style.left).replace('px', ''));
  7492 + // var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
  7493 +
  7494 + // if (TBStartX <= bodyRegionRight && value.X <= TBRight && TBStartY <= bodyRegionBottom && value.Y <= TBBottom) {
  7495 +
  7496 + // if ($scope.GetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion') == false) {
  7497 + // var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
  7498 + // var layer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
  7499 + // if (layer < totalayer) {
  7500 +
  7501 + // var layerup=layer+1;
  7502 + // $scope.SetwindowStoreData(windowviewid,'layerNumber',layerup);
  7503 + // }
  7504 +
  7505 + // }
  7506 +
  7507 + // if (value.bodyRegionId == '3') {
  7508 +
  7509 + // var BR_SixTBData = new jinqJs()
  7510 + // .from($scope.transparencyDrawnRegions)
  7511 + // .where('BRID == 6')
  7512 + // .select();
  7513 +
  7514 + // if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
  7515 +
  7516 + // $scope.canThirdBRDrawn = true;
  7517 +
  7518 + // }
  7519 +
  7520 +
  7521 + // }
  7522 +
  7523 + // if ((bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" ||bodyVid == "7")) {
  7524 + // if (value.bodyRegionId == "6") {
  7525 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7526 + // }
  7527 + // else {
  7528 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7529 + // }
  7530 + // }
  7531 + // else {
  7532 + // if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
  7533 +
  7534 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7535 + // }
  7536 +
  7537 + // else {
  7538 +
  7539 + // if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
  7540 +
  7541 + // //1. draw 6th
  7542 + // var BRSixData = new jinqJs()
  7543 + // .from(BodyRegionDictionary)
  7544 + // .where('bodyRegionId == 6')
  7545 + // .select();
  7546 + // var isMirror = BRSixData[0].IsMirror;
  7547 + // if (isMirror == 'Yes') {
  7548 + // //draw mirror arm
  7549 + // $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7550 + // //draw non mirror arm
  7551 + // $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7552 + // //draw 3rd BR
  7553 + // $timeout(function () {
  7554 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7555 + // }, 200);
  7556 + // }
  7557 + // else {
  7558 + // //draw mirror arm
  7559 + // $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7560 + // //draw non mirror arm
  7561 + // $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7562 + // //draw 3rd BR
  7563 + // $timeout(function () {
  7564 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7565 + // }, 200);
  7566 + // }
  7567 +
  7568 +
  7569 + // }
  7570 + // else {
  7571 + // var BR_SixTBData = new jinqJs()
  7572 + // .from($scope.transparencyDrawnRegions)
  7573 + // .where('BRID == 6')
  7574 + // .select();
  7575 + // if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) {
  7576 + // //do not draw 6 BR again, its already drawn
  7577 + // }
  7578 + // else
  7579 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7580 + // }
  7581 + // }
  7582 + // }
  7583 + // $scope.SetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion',true);
  7584 + // }
  7585 +
  7586 +
  7587 + //})
  7588 +
  7589 + //var isModestyOn=$scope.GetwindowStoreData(windowviewid,'isModestyOn');
  7590 + //var modestyImageInfo=$scope.GetwindowStoreData(windowviewid,'modestyImageInfo');
  7591 + ////for modesty
  7592 + //if (isModestyOn == true && modestyImageInfo.length > 0) {
  7593 + // $.each(modestyImageInfo, function (index, value) {
  7594 +
  7595 + // var bodyRegionRight = parseInt(value.x) + parseInt(value.Width);
  7596 + // var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height);
  7597 + // var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
  7598 + // var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
  7599 + // var TBStartX = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', ''));
  7600 + // var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
  7601 +
  7602 + // if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) {
  7603 +
  7604 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true, windowviewid);
  7605 +
  7606 + // }
  7607 + // })
7587 7608 }
7588 7609  
7589 7610 }
... ... @@ -8265,7 +8286,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8265 8286 $('.ui-wrapper').remove();
8266 8287  
8267 8288 $scope.SetwindowStoreData(windowviewid,'layerNumber',currentlayer);
8268   - $scope.SetwindowStoreData(windowviewid,'transNumber',100);
  8289 + $scope.SetwindowStoreData(windowviewid, 'transNumber', 100);
  8290 +
  8291 + $scope.SetwindowStoreData(windowviewid, 'isTransparencyBtnClicked', false);
  8292 +
  8293 + $scope.SetwindowStoreData(windowviewid, 'isZoomed', false);
  8294 + $scope.SetwindowStoreData(windowviewid, 'isResized', false);
  8295 +
8269 8296  
8270 8297 }
8271 8298 var modestyTempCanvases = $("canvas[id*='tempCanvasModesty']");
... ... @@ -8439,7 +8466,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8439 8466 $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut'));
8440 8467 }
8441 8468  
8442   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  8469 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
8443 8470 $scope.CalculateImageCordinates(viewOrientationId,windowviewid);
8444 8471  
8445 8472  
... ... @@ -8576,7 +8603,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8576 8603 $scope.flushCanvas(windowviewid);
8577 8604  
8578 8605 //3.
8579   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  8606 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  8607 +
8580 8608 $scope.CalculateImageCordinates(viewOrientationId,windowviewid);
8581 8609  
8582 8610  
... ... @@ -8687,6 +8715,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8687 8715 }
8688 8716  
8689 8717 var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  8718 +
8690 8719 $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
8691 8720  
8692 8721 var CanvasDivLeftPosition = $scope.GetwindowStoreData(windowviewid, 'CanvasDivLeftPosition');
... ... @@ -9757,6 +9786,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9757 9786 }
9758 9787 else {
9759 9788 //actual term number is not found in thsi view menas previously selected body part does not exist in this view
  9789 +
9760 9790 $scope.CalculateImageCordinates(viewOrientationId, windowviewid)
9761 9791 }
9762 9792 }
... ... @@ -10178,7 +10208,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10178 10208 $scope.SetwindowStoreData(windowviewid,'isHighLight',true);
10179 10209  
10180 10210 if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
10181   - $scope.SetwindowStoreData(windowviewid,'isExtract',false);
  10211 + $scope.SetwindowStoreData(windowviewid, 'isExtract', false);
  10212 +
10182 10213 $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
10183 10214 }
10184 10215 else
... ... @@ -10847,7 +10878,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10847 10878 $('#spinner').css('visibility', 'visible');
10848 10879  
10849 10880 //redraw body of respective layer
10850   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  10881 + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
  10882 +
10851 10883 $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
10852 10884 }, 500);
10853 10885  
... ...