diff --git a/.gitignore b/.gitignore
index 5920fe1..9725b84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,4 +46,5 @@ $tf*/
400-SOURCECODE/AIAHTML5.ADMIN.Web
400-SOURCECODE/AIAHTML5.ADMIN.API/LogDetailsFile/LicenseCreation/LicenseCreation-30-11-18.txt
400-SOURCECODE/AIAHTML5.Web/Web.config
+400-SOURCECODE/AIAHTML5.Web/Web.config
400-SOURCECODE/AIAHTML5.Web/Web.config
\ No newline at end of file
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
index 9a0a875..e9c36b9 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -150,6 +150,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
'moduleName': '',
'mode': '',
'transparencyBounds': [],
+ 'isCallForTransparencyImage':false,
'layerNumberTransparency': 0,
'transparencyValue': 0,
'transparencyX': 0,
@@ -259,6 +260,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
'moduleName': '',
'mode': '',
'transparencyBounds': [],
+ 'isCallForTransparencyImage': false,
'layerNumberTransparency': 0,
'transparencyValue': 0,
'transparencyX': 0,
@@ -1760,7 +1762,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
else {
// for existing DA
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid);
}
@@ -1941,7 +1944,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#spinner').css('visibility', 'visible');
//redraw body of respective layer
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid);
}, 500);
@@ -2363,9 +2367,25 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if (isListManagerSelected == true) {
$scope.SetwindowStoreData(windowviewid,'layerNumber',$('#txtLayerNumberDA_' + windowviewid).val());
}
+
+ var lNumber=null;
+ if ($scope.GetwindowStoreData(windowviewid, 'isZoomed') && ($scope.GetwindowStoreData(windowviewid, 'isTransparencyBtnClicked') == true || $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated')))
+ {
+ if ($scope.GetwindowStoreData(windowviewid, 'isCallForTransparencyImage') == true) {
+ lNumber = $scope.GetwindowStoreData(windowviewid, 'layerNumber');
- var lNumber=$scope.GetwindowStoreData(windowviewid,'layerNumber');
+ }
+ else
+ lNumber = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw');
+
+ console.log("GetImageSource lNumber IF= " + lNumber)
+ }
+ else{
+
+ lNumber = $scope.GetwindowStoreData(windowviewid, 'layerNumber');
+ console.log("GetImageSource lNumber = " + lNumber);
+ }
$scope.userInput = parseInt(lNumber);
if (!$rootScope.isCallFromOtherModule) {
@@ -2921,8 +2941,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var isGenderChnage = $scope.GetwindowStoreData(windowviewid,'isGenderChnage');
var isViewChange = $scope.GetwindowStoreData(windowviewid,'isViewChange');
var isHighlightBodyByBodySystem=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem');
- var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected');
- if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
+ var isListManagerSelected = $scope.GetwindowStoreData(windowviewid, 'isListManagerSelected');
+ // var isTBACtive = $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated');
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated')) {
+
+ $scope.DrawTransparencyBox(windowviewid);
+
+ }
+ else if ($scope.GetwindowStoreData(windowviewid, 'isExtract') == true) {
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
$scope.DisableUI();
@@ -2935,11 +2961,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
- $scope.SetwindowStoreData(windowviewid,'isHighLight',true);
+ $scope.SetwindowStoreData(windowviewid, 'isHighLight', true);
$scope.DisableUI();
$scope.highLightBody(windowviewid);
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
+ $scope.CalculateDimensionsAndDrawTBox(windowviewid);
+ }
}
else {
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
+ $scope.CalculateDimensionsAndDrawTBox(windowviewid);
+ }
var isHighlightBodyWithCBTermData = $scope.GetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData');
if (isHighlightBodyWithCBTermData == true) {
$scope.ShowCBDataBodyView(windowviewid);
@@ -3424,8 +3456,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var isViewChange = $scope.GetwindowStoreData(windowviewid,'isViewChange');
var isHighlightBodyByBodySystem=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem');
var isExtract= $scope.GetwindowStoreData(windowviewid,'isExtract')
- var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected');
- if (isExtract == true) {
+ var isListManagerSelected = $scope.GetwindowStoreData(windowviewid, 'isListManagerSelected');
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated')) {
+
+ $scope.DrawTransparencyBox(windowviewid);
+
+ }
+ else if (isExtract == true) {
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
$scope.DisableUI();
@@ -3457,9 +3494,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.highLightBody(windowviewid);
console.log('just after highLightBody call');
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
+ $scope.CalculateDimensionsAndDrawTBox(windowviewid);
+ }
}
else {
+ if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
+ $scope.CalculateDimensionsAndDrawTBox(windowviewid);
+ }
var isHighlightBodyWithCBTermData = $scope.GetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData');
if (isHighlightBodyWithCBTermData == true) {
$scope.ShowCBDataBodyView(windowviewid);
@@ -3471,13 +3514,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
//Added Code by sandy to create Draw transparencybox autometically for save CB
- if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
- $scope.CalculateDimensionsAndDrawTBox(windowviewid);
- //$scope.setOriginalDataAndChangeTransparency(windowviewid);
- // finish CB window load
- //$rootScope.DAWindowLoadComplete = true;
- $rootScope.isLoading = true;
- }
+ //if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) {
+ // $scope.CalculateDimensionsAndDrawTBox(windowviewid);
+ // //$scope.setOriginalDataAndChangeTransparency(windowviewid);
+ // // finish CB window load
+ // //$rootScope.DAWindowLoadComplete = true;
+ // $rootScope.isLoading = true;
+ //}
}
@@ -4698,6 +4741,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
//layer change function
$scope.LayerChange = function (windowviewid) {
+
$scope.DisableUI();
$rootScope.CloseListManager();
$scope.isLayerChange = true;
@@ -4871,7 +4915,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
//2.
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+ console.log("CalculateImageCordinates call from 4723");
+
$scope.CalculateImageCordinates(viewOrientationId,windowviewid);
//3.
@@ -5258,7 +5304,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var sub_id_annotation = "black_annotation" + TPspeechBubbleCounter+"_"+windowviewid + '-' + termNumber;
var pointClicked_annotation = parseInt(x) + parseInt(y);
var Exists_annotation = $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").length;
- $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation,windowviewid,TPspeechBubbleCounter);
+ $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation, windowviewid, TPspeechBubbleCounter);
$scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: sub_id_annotation });
$scope.SetwindowStoreData(windowviewid,'speachBubbleArrayAnnotation',$scope.speechList1);
$('.appendDragg_annotation').draggable({
@@ -5507,7 +5553,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if ($('#dot_annotation_' + windowviewid).length > 0) {
$('#dot_annotation_' + windowviewid).show();
}
- $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "block" });
+ //$('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "block" });
if ($('#dot_' + windowviewid).length > 0) {
$('#dot_' + windowviewid).show();
@@ -5677,7 +5723,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = (Globe[0].currentY) + 'px';
}
- $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation,windowviewid,TPspeechBubbleCounter) {
+ $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation, windowviewid, TPspeechBubbleCounter) {
var sppechBubbleHTML_annotation = "
";
if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
@@ -5725,6 +5771,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
else {
$('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").css("display", "block");
}
+
}
}
$scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl = function (x, y, windowviewid, termNumber) {
@@ -5989,7 +6036,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var currentlayer=$scope.GetwindowStoreData(windowviewid,'currentLayerNumber');
//Dated:19-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
- if ($('#txtLayerNumberDA_' + windowviewid).val() != 0 && currentlayer != undefined) {
+ if ($('#txtLayerNumberDA_' + windowviewid).val() != 0 && currentlayer != undefined && currentlayer != 0) {
var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
@@ -6053,8 +6100,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
function mouseUpListener(e) {
- var len= (e.currentTarget.id).split("_").length;
- var windowviewid = (e.currentTarget.id).split("_")[len-1];
+ var len = (e.currentTarget.id).split("_").length;
+ var windowviewid = (e.currentTarget.id).split("_")[len - 1];
e.preventDefault();
//to prevent screen scroll on ipad while drawing TB
@@ -6065,7 +6112,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode'));
$scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight'));
- // alert($scope.GetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw'));
+ // alert($scope.GetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw'));
//$('.com_'+windowviewid).remove();
//$('#dot_'+windowviewid).remove();
//$('#bord_'+windowviewid).remove();
@@ -6113,11 +6160,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var previewRectangleWidth = $('.rectangle').width();
var previewRectangleHeight = $('.rectangle').height()
- $scope.SetwindowStoreData(windowviewid,'currentLayerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
+ $scope.SetwindowStoreData(windowviewid, 'currentLayerNumber', parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
$('.rectangle').remove();
- var currentMousePosition = $scope.getMousePos(e.pageX,e.pageY,windowviewid);
+ var currentMousePosition = $scope.getMousePos(e.pageX, e.pageY, windowviewid);
var canavsDivScrollPos = $scope.getCanavsDivScrollPosition(windowviewid);
@@ -6135,11 +6182,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
//Save TranparencyBox and slider for CurriculmBuilder
//$rootScope.commonTBEndX = TransparencyEndX;
//$rootScope.commonTBEndY = TransparencyBoxEndY;
- var transparencyBounds = $scope.GetwindowStoreData(windowviewid,'transparencyBounds');
- transparencyBounds.push({
- 'h': $scope.TransparencyEndX, 'x': $scope.TransparencyBoxStartX,
- 'w': $scope.TransparencyBoxEndY, 'y': $scope.TransparencyBoxStartY
- });
+ //var transparencyBounds = $scope.GetwindowStoreData(windowviewid,'transparencyBounds');
+ //transparencyBounds.push({
+ // 'h': $scope.TransparencyEndX, 'x': $scope.TransparencyBoxStartX,
+ // 'w': $scope.TransparencyBoxEndY, 'y': $scope.TransparencyBoxStartY
+ //});
+ //$scope.SetwindowStoreData(windowviewid, 'transparencyBounds', transparencyBounds);
if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) {
@@ -6164,29 +6212,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#btnTranparency_' + windowviewid).removeClass('btn-black');
$('#btnTranparency_' + windowviewid).addClass('tButtonActive');
- $scope.SetwindowStoreData(windowviewid,'layerNumberBeforeTBDraw',parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
+ $scope.SetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw', parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
// $scope.layerNumberBeforeTBDraw = parseInt($('#txtLayerNumberDA_' + windowviewid).val());
- //draw temp box to store the canvas data with original transparecy
- if (document.getElementById('tempCanvas_' + windowviewid) != null) {
- $('#tempCanvas_' + windowviewid).remove();
- }
- if (document.getElementById('tempCanvas_'+ windowviewid) == null || document.getElementById('tempCanvas_'+ windowviewid) == undefined) {
- var tempCanvas = document.createElement('canvas');
- tempCanvas.id = 'tempCanvas_' + windowviewid;
- tempCanvas.height = TransparencyBoxEndY - $scope.startY;
- tempCanvas.width = TransparencyEndX - $scope.startX;
- tempCanvas.style.position = "absolute";
- tempCanvas.style.left = 200 + 'px';
- tempCanvas.style.top = 200 + 'px';
- tempCanvas.style.backgroundColor = "transparent";
- tempCanvas.style.visibility = 'hidden';
- tempCanvas.style.border = "black 1px solid";
- document.getElementById("canvasDivDA_" + windowviewid).appendChild(tempCanvas);
- }
-
+
- $scope.SetwindowStoreData(windowviewid,'isTransparencyBtnClicked',false);
+ $scope.SetwindowStoreData(windowviewid, 'isTransparencyBtnClicked', false);
@@ -6210,189 +6241,294 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
- var new_startx = (TransparencyEndX < $scope.TransparencyBoxStartX) ? TransparencyEndX : $scope.TransparencyBoxStartX;
- var new_starty = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? TransparencyBoxEndY : $scope.TransparencyBoxStartY;
- var new_endx = (TransparencyEndX < $scope.TransparencyBoxStartX) ? $scope.TransparencyBoxStartX : TransparencyEndX;
- var new_endy= (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? $scope.TransparencyBoxStartY:TransparencyBoxEndY ;
-
- $scope.TransparencyBoxStartX = new_startx;
- TransparencyEndX = new_endx;
- $scope.TransparencyBoxStartY = new_starty;
- TransparencyBoxEndY = new_endy;
+ var new_startx = (TransparencyEndX < $scope.TransparencyBoxStartX) ? TransparencyEndX : $scope.TransparencyBoxStartX;
+ var new_starty = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? TransparencyBoxEndY : $scope.TransparencyBoxStartY;
+ var new_endx = (TransparencyEndX < $scope.TransparencyBoxStartX) ? $scope.TransparencyBoxStartX : TransparencyEndX;
+ var new_endy = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? $scope.TransparencyBoxStartY : TransparencyBoxEndY;
+ $scope.TransparencyBoxStartX = new_startx;
+ var TransparencyEndX = new_endx;
+ $scope.TransparencyBoxStartY = new_starty;
+ var TransparencyBoxEndY = new_endy;
+ $scope.TBoxEndX = TransparencyEndX;
+ $scope.TBoxEndY = TransparencyBoxEndY;
+ $scope.TBHeight = height;
+ $scope.TBWidth = width;
+
+ $scope.DrawTransparencyBox(windowviewid);
+ }
+
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousedown", mouseDownListener);
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousemove", mouseMoveListener);
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mouseup", mouseUpListener);
var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData');
- $.each(BodyRegionDictionary, function (index, value) {
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchstart", mouseDownListener);
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchmove", mouseMoveListener);
- var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.X, value.Y, value.Height, value.Width);
+ document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchend", mouseUpListener);
+
+
+
+ //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
+ $('#btnTranparency_' + windowviewid).removeClass('tButtonActive');
+ $('#btnTranparency_' + windowviewid).addClass('btn-black');
+ $('#btnIdentify_' + windowviewid).removeClass('btn-black');
+ $('#btnIdentify_' + windowviewid).addClass('btn-primary');
+
+ // clear canvas before drawing transparency box
+ if ($rootScope.isAnnotationWindowOpen == true) {
+ $('#canvasDA_' + windowviewid).removeLayers();
+ var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid);
+ if (paintCanvasObj != null) {
+ var ctx = paintCanvasObj.getContext("2d");
+ ctx.clearRect(0, 0, 2277, 3248);
+ }
+ var sktch = $("#canvasPaintDA_" + windowviewid).sketch();
+ $("#canvasPaintDA_" + windowviewid).sketch().actions = [];
+ $("#annotationpaintbrushsize").removeClass("activebtncolor");
+ $("#annotationpainteraser").removeClass("activebtncolor");
+ if ($("#DrawMode").hasClass("annotationtoolbartab")) {
+ if ($scope.GetwindowStoreData(windowviewid, 'isTBoxModestyVisible') == true) {
+
+ $rootScope.switchCanvas();
- var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight;
- var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth;
- var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom;
- var transparencyBoxRight = tBoxDimesions.transparencyBoxRight;
- var bodyRegionRight = tBoxDimesions.bodyRegionRight;
- var bodyRegionBottom = tBoxDimesions.bodyRegionBottom;
- var width = 0;
- var height = 0;
- if (TransparencyEndX < $scope.TransparencyBoxStartX) {
- width = $scope.TransparencyBoxStartX - TransparencyEndX;
- }
- else {
- width = TransparencyEndX - $scope.TransparencyBoxStartX;
- }
- if (TransparencyBoxEndY < $scope.TransparencyBoxStartY) {
- height = $scope.TransparencyBoxStartY - TransparencyBoxEndY;
}
else {
- height = TransparencyBoxEndY - $scope.TransparencyBoxStartY;
+ var drawCanvasZindex = $('#canvasDA_' + windowviewid).css("z-index");
+ var paintCanvasZindex = $("#canvasPaintDA_" + windowviewid).css("z-index");
+ drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
+ paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
+ if (drawCanvasZindex > paintCanvasZindex) {
+ $(".ui-wrapper").css("z-index", drawCanvasZindex);
+ $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', drawCanvasZindex);
+ }
+ else {
+ $(".ui-wrapper").css("z-index", paintCanvasZindex);
+ $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex);
+ }
}
- var new_x, new_y;
+ }
+ else {
+ $rootScope.switchToTransparencycanvas();
+ }
+ }
+ else {
- new_x = (TransparencyEndX < $scope.TransparencyBoxStartX) ? TransparencyEndX : $scope.TransparencyBoxStartX;
- new_y = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? TransparencyBoxEndY : $scope.TransparencyBoxStartY;
+ $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', 12000);
+ $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
- var transparencyCanvas = document.createElement('canvas');
- var tBox = document.getElementById('transparencyCanvas_'+ windowviewid);
- if (tBox == null) {
+ }
+ //hide the speechbubble
- transparencyCanvas.id = 'transparencyCanvas_'+ windowviewid;
- $scope.transparencyCanvasId = transparencyCanvas.id;
- transparencyCanvas.height = height;
- transparencyCanvas.width = width;
- transparencyCanvas.style.position = "absolute";
- //transparencyCanvas.style.left = $scope.startX + 'px' // x + "px";
- //transparencyCanvas.style.top = $scope.startY + "px"//y + "px";
- transparencyCanvas.style.left = new_x + 'px' // x + "px";
- transparencyCanvas.style.top = new_y + "px"
- transparencyCanvas.style.border = "black 1px solid";
- transparencyCanvas.style.backgroundColor = "transparent";
- transparencyCanvas.style.zIndex = 200;
- document.getElementById("canvasDivDA_" + windowviewid).appendChild(transparencyCanvas);
- $scope.transparencyChangeCounter = 0;
- $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
+ if ($rootScope.isAnnotationWindowOpen == true)
+ $rootScope.isTBCompleted = true;
+ }
+ }
- $scope.transparencyCanvasHeight = transparencyCanvas.height;
- $scope.transparencyCanvasWidth = transparencyCanvas.width;
+// $scope.DrawTransparencyBox = function (TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, windowviewid) {
- //bind click listener
- transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
+ $scope.DrawTransparencyBox = function (windowviewid) {
+ var newDimes = null;
+ // if ($scope.GetwindowStoreData(windowviewid, 'zoomInOut') == 25) {
+ if ( $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated') && $scope.GetwindowStoreData(windowviewid, 'isZoomed') == true) {
+ // alert("ZOOM");
+ newDimes = $scope.scaleTransparencyBox(windowviewid);
- $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid,'UIWrapperZIndex'));
+ $scope.TransparencyBoxStartX = newDimes.scaledX1;
+ TransparencyEndX = newDimes.scaledX2;
+ $scope.TransparencyBoxStartY = newDimes.scaledY1;
+ TransparencyBoxEndY = newDimes.scaledY2;
+ $scope.TBoxEndX = newDimes.scaledX2;
+ $scope.TBoxEndY = newDimes.scaledY2;
+ $scope.TBHeight = newDimes.scaledHeight;
+ $scope.TBWidth = newDimes.scaledWidth;
+ }
+ $scope.transparencyDrawnRegions = [];
+ $scope.canThirdBRDrawn = false;
- }
- if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
+ var TransparencyBoxStartX = newDimes != null ? newDimes.scaledX1 : $scope.TransparencyBoxStartX, TransparencyEndX = newDimes != null ? newDimes.scaledX2 : $scope.TBoxEndX, TransparencyBoxStartY = newDimes != null ? newDimes.scaledY1 : $scope.TransparencyBoxStartY, TransparencyBoxEndY = newDimes != null ? newDimes.scaledY2 : $scope.TBoxEndY;
+ //draw temp box to store the canvas data with original transparecy
+ if (document.getElementById('tempCanvas_' + windowviewid) != null) {
+ $('#tempCanvas_' + windowviewid).remove();
+ }
+ if (document.getElementById('tempCanvas_' + windowviewid) == null || document.getElementById('tempCanvas_' + windowviewid) == undefined) {
+ var tempCanvas = document.createElement('canvas');
+ tempCanvas.id = 'tempCanvas_' + windowviewid;
+ tempCanvas.height = TransparencyBoxEndY - TransparencyBoxStartY;
+ tempCanvas.width = TransparencyEndX - TransparencyBoxStartX;
+ tempCanvas.style.position = "absolute";
+ tempCanvas.style.left = 200 + 'px';
+ tempCanvas.style.top = 200 + 'px';
+ tempCanvas.style.backgroundColor = "transparent";
+ tempCanvas.style.visibility = 'hidden';
+ tempCanvas.style.border = "black 1px solid";
+ document.getElementById("canvasDivDA_" + windowviewid).appendChild(tempCanvas);
+ }
+ var transparencyCanvas = document.createElement('canvas');
+ var tBox = document.getElementById('transparencyCanvas_' + windowviewid);
- $scope.SetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion',true);
+ if (document.getElementById('transparencyCanvas_' + windowviewid) != null) {
+ $('#transparencyCanvas_' + windowviewid).remove();
+ $('#transparencyCanvas_' + windowviewid).parent().remove();
+ }
+ if (document.getElementById('transparencyCanvas_' + windowviewid) == null) {
- if (value.bodyRegionId == '3') {
+ transparencyCanvas.id = 'transparencyCanvas_' + windowviewid;
+ $scope.transparencyCanvasId = transparencyCanvas.id;
+ transparencyCanvas.height = TransparencyBoxEndY - TransparencyBoxStartY;;
+ transparencyCanvas.width = TransparencyEndX - TransparencyBoxStartX;
+ transparencyCanvas.style.position = "absolute";
+ //transparencyCanvas.style.left = $scope.startX + 'px' // x + "px";
+ //transparencyCanvas.style.top = $scope.startY + "px"//y + "px";
+ transparencyCanvas.style.left = TransparencyBoxStartX + 'px'//new_x + 'px' // x + "px";
+ transparencyCanvas.style.top = TransparencyBoxStartY + 'px'// + "px"
+ transparencyCanvas.style.border = "black 1px solid";
+ transparencyCanvas.style.backgroundColor = "transparent";
+ transparencyCanvas.style.zIndex = 200;
+ document.getElementById("canvasDivDA_" + windowviewid).appendChild(transparencyCanvas);
+ $scope.transparencyChangeCounter = 0;
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
+ $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
- if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
+ $scope.transparencyCanvasHeight = transparencyCanvas.height;
+ $scope.transparencyCanvasWidth = transparencyCanvas.width;
- $scope.canThirdBRDrawn = true;
+ //bind click listener
+ transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
- }
+ $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
+
+ }
+
+ var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData');
+ $.each(BodyRegionDictionary, function (index, value) {
+
+
+ var tBoxDimesions = $scope.getTBoxDimesions(TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, value.X, value.Y, value.Height, value.Width);
+
+ var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight;
+ var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth;
+ var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom;
+ var transparencyBoxRight = tBoxDimesions.transparencyBoxRight;
+ var bodyRegionRight = tBoxDimesions.bodyRegionRight;
+ var bodyRegionBottom = tBoxDimesions.bodyRegionBottom;
+
+
+
+ if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
+
+ $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', true);
+
+ if (value.bodyRegionId == '3') {
+
+ var BR_SixTBData = new jinqJs()
+ .from($scope.transparencyDrawnRegions)
+ .where('BRID == 6')
+ .select();
+
+ if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
+ $scope.canThirdBRDrawn = true;
}
- var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
- if (bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" || bodyVid == "7") {
- 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, false, windowviewid);
- }
- else {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- }
+
+
+ }
+ var bodyVid = $scope.GetwindowStoreData(windowviewid, 'voId');
+ if (bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" || bodyVid == "7") {
+ if (value.bodyRegionId == "6") {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
}
else {
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
-
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- }
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ }
+ }
+ else {
+ if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
- else {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ }
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
+ else {
- //1. draw 6th
- var BRSixData = new jinqJs()
- .from(BodyRegionDictionary)
- .where('bodyRegionId == 6')
- .select();
- var isMirror = BRSixData[0].IsMirror;
- if (isMirror == 'Yes') {
- //draw mirror arm
- $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- //draw non mirror arm
- $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- //draw 3rd BR
- $timeout(function () {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- }, 200);
- }
- else {
- //draw mirror arm
- $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- //draw mirror arm
- $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- //draw mirror arm
- $timeout(function () {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
- }, 200);
- }
+ if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
+ //1. draw 6th
+ var BRSixData = new jinqJs()
+ .from(BodyRegionDictionary)
+ .where('bodyRegionId == 6')
+ .select();
+ var isMirror = BRSixData[0].IsMirror;
+ if (isMirror == 'Yes') {
+ //draw mirror arm
+ $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ //draw non mirror arm
+ $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ //draw 3rd BR
+ $timeout(function () {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ }, 200);
}
else {
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
- if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) { }
- else
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ //draw mirror arm
+ $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ //draw mirror arm
+ $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ //draw mirror arm
+ $timeout(function () {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ }, 200);
}
- }
+ }
+ else {
+ var BR_SixTBData = new jinqJs()
+ .from($scope.transparencyDrawnRegions)
+ .where('BRID == 6')
+ .select();
+ if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) { }
+ else
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+ }
}
}
- else {
- //when user draw TB outside body than no bodyRegion
- //is covred and nothing is drawn so the function is not called in which we are enabling UI
- $scope.EnableUI();
- }
- })
- //for modesty
- var modestyImageInfo=$scope.GetwindowStoreData(windowviewid,'modestyImageInfo');
- if (modestyImageInfo.length > 0) {
+ }
+ else {
+ //when user draw TB outside body than no bodyRegion
+ //is covred and nothing is drawn so the function is not called in which we are enabling UI
+ $scope.EnableUI();
+ }
+ })
- $.each(modestyImageInfo, function (index, value) {
+ //for modesty
+ var modestyImageInfo = $scope.GetwindowStoreData(windowviewid, 'modestyImageInfo');
+ if (modestyImageInfo.length > 0) {
- var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.x, value.y, value.Height, value.Width);
+ $.each(modestyImageInfo, function (index, value) {
- var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight;
- var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth;
- var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom;
- var transparencyBoxRight = tBoxDimesions.transparencyBoxRight;
- var bodyRegionRight = tBoxDimesions.bodyRegionRight;
- var bodyRegionBottom = tBoxDimesions.bodyRegionBottom;
+ var tBoxDimesions = $scope.getTBoxDimesions(TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, value.x, value.y, value.Height, value.Width);
- if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) {
+ var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight;
+ var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth;
+ var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom;
+ var transparencyBoxRight = tBoxDimesions.transparencyBoxRight;
+ var bodyRegionRight = tBoxDimesions.bodyRegionRight;
+ var bodyRegionBottom = tBoxDimesions.bodyRegionBottom;
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false,false, windowviewid);
+ if (TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) {
- }
- })
- }
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid);
+
+ }
+ })
+ }
// var transparencySliderHTML =
// '' +
@@ -6419,96 +6555,88 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
- // $('#transparencyScale').modal('show');
- $('#transparencyScale_' + windowviewid).css('position', 'fixed');
- $('#transparencyScale_' + windowviewid).draggable({ containment: 'window', scroll: false });
+ // $('#transparencyScale').modal('show');
+ $('#transparencyScale_' + windowviewid).css('position', 'fixed');
+ $('#transparencyScale_' + windowviewid).draggable({ containment: 'window', scroll: false });
if ($rootScope.isCallFromOtherModule) {
$('#transparencyScale_' + windowviewid).draggable({ containment: '#canvasDivDA_' + windowviewid });
-
- $scope.SetwindowStoreData(windowviewid, 'transparencyBounds', transparencyBounds);
+ $scope.SetwindowStoreData(windowviewid, 'transparencyBounds', []);
+ var transparencyBounds = $scope.GetwindowStoreData(windowviewid, 'transparencyBounds');
+ transparencyBounds.push({
+ 'h': $scope.TBoxEndX, 'x': $scope.TransparencyBoxStartX,
+ 'w': $scope.TBoxEndY, 'y': $scope.TransparencyBoxStartY
+ });
+ //$scope.SetwindowStoreData(windowviewid, 'transparencyBounds', transparencyBounds);
//$scope.SetwindowStoreData(windowviewid, 'transparencyValue', 0);
//$scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', 0);
$scope.SetwindowStoreData(windowviewid, 'transparencyX', $scope.TBDrawStartX);
$scope.SetwindowStoreData(windowviewid, 'transparencyY', $scope.TBDrawStartY );
}
- $('#transparencyScale_' + windowviewid).css('top', $scope.TBDrawStartY - 10)
- $('#transparencyScale_' + windowviewid).css('left', $scope.TBDrawStartX + 130)
- $('#transparencyScale_' + windowviewid).css('visibility', 'visible')
- $('#transparencyScale_' + windowviewid).css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top.
- $("#tbSlider_" + windowviewid + " .ui-slider-range-min").css("width", "100%");
- $("#tbSlider_" + windowviewid + " .ui-slider-handle").css("left", "100%");
- }
+ $('#transparencyScale_' + windowviewid).css('top', $scope.TBDrawStartY - 10)
+ $('#transparencyScale_' + windowviewid).css('left', $scope.TBDrawStartX + 130)
+ $('#transparencyScale_' + windowviewid).css('visibility', 'visible')
+ $('#transparencyScale_' + windowviewid).css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top.
+ $("#tbSlider_" + windowviewid + " .ui-slider-range-min").css("width", "100%");
+ $("#tbSlider_" + windowviewid + " .ui-slider-handle").css("left", "100%");
}
+
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousedown", mouseDownListener);
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousemove", mouseMoveListener);
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mouseup", mouseUpListener);
-
-
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchstart", mouseDownListener);
-
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchmove", mouseMoveListener);
-
- document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchend", mouseUpListener);
-
-
-
- //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
- $('#btnTranparency_' + windowviewid).removeClass('tButtonActive');
- $('#btnTranparency_' + windowviewid).addClass('btn-black');
- $('#btnIdentify_' + windowviewid).removeClass('btn-black');
- $('#btnIdentify_' + windowviewid).addClass('btn-primary');
-
- // clear canvas before drawing transparency box
- if ($rootScope.isAnnotationWindowOpen == true) {
- $('#canvasDA_' + windowviewid).removeLayers();
- var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid);
- if (paintCanvasObj != null) {
- var ctx = paintCanvasObj.getContext("2d");
- ctx.clearRect(0, 0, 2277, 3248);
- }
- var sktch = $("#canvasPaintDA_" + windowviewid).sketch();
- $("#canvasPaintDA_" + windowviewid).sketch().actions = [];
- $("#annotationpaintbrushsize").removeClass("activebtncolor");
- $("#annotationpainteraser").removeClass("activebtncolor");
- if ($("#DrawMode").hasClass("annotationtoolbartab")) {
- if ($scope.GetwindowStoreData(windowviewid, 'isTBoxModestyVisible') == true) {
-
- $rootScope.switchCanvas();
-
- }
- else {
- var drawCanvasZindex = $('#canvasDA_' + windowviewid).css("z-index");
- var paintCanvasZindex = $("#canvasPaintDA_" + windowviewid).css("z-index");
- drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
- paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
- if (drawCanvasZindex > paintCanvasZindex) {
- $(".ui-wrapper").css("z-index", drawCanvasZindex);
- $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', drawCanvasZindex);
- }
- else {
- $(".ui-wrapper").css("z-index", paintCanvasZindex);
- $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex);
- }
- }
-
- }
- else {
- $rootScope.switchToTransparencycanvas();
- }
+ $scope.scaleTransparencyBox = function(windowviewid) {
+ var nzoom = $scope.GetwindowStoreData(windowviewid, 'zoomInOut');
+ var existingZoon=0;
+ if (nzoom == 25) {
+ existingZoon = 75;
}
else {
+ existingZoon = 25;
+ }
+ var X = 0;
+ var scaledY = 0;
+ var scaledHeight = 0;
+ var scaledWidth = 0;
- $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', 12000);
+ /* $scope.TransparencyBoxStartX = new_startx;
+ TransparencyEndX = new_endx;
+ $scope.TransparencyBoxStartY = new_starty;
+ TransparencyBoxEndY = new_endy;
+ $scope.TBoxEndX = TransparencyEndX;
+ $scope.TBoxEndY = TransparencyBoxEndY;
+ $scope.TBHeight = height;
+ $scope.TBWidth = width;
+ */
+ //if (mirrorValue != 0) {
+ // var mirroredX = parseInt(mirrorValue) + parseInt(x);
+ // var newX = (mirroredX * nzoom);
+ // mirroredX = (newX / existingZoon);
+ // X = mirroredX;
+ //}
+ //else {
+ var newStartX = ($scope.TransparencyBoxStartX * nzoom);
+ var X1 = (newStartX / existingZoon);
+ //}
+ var newEndX = ($scope.TBoxEndX * nzoom);
+ var X2 = (newEndX / existingZoon);
- $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
+ var newStatY = ($scope.TransparencyBoxStartY * nzoom);
+ var Y1 = (newStatY / existingZoon);
- }
- //hide the speechbubble
+ var newEndY = ($scope.TBoxEndY * nzoom);
+ var Y2 = (newEndY / existingZoon);
+ var newHeight = ($scope.TBHeight * nzoom);
+ var ht = (newHeight / existingZoon);
- if ($rootScope.isAnnotationWindowOpen == true)
- $rootScope.isTBCompleted = true;
+ var newWidth = ($scope.TBWidth * nzoom);
+ var wt = (newWidth / existingZoon);
+
+ return {
+ scaledX1: X1,
+ scaledY1: Y1,
+ scaledX2: X2,
+ scaledY2: Y2,
+ scaledHeight: ht,
+ scaledWidth: wt
+ }
}
$scope.CalculateDimensionsAndDrawTBox = function (windowviewid) {
@@ -6540,13 +6668,42 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.TransparencyBoxStartY = value.y;
$scope.TransparencyEndX = value.h;
$scope.TransparencyBoxEndY = value.w;
+
+ $scope.TBoxEndX = value.h;
+ $scope.TBoxEndY = value.w;
+
})
- $scope.TBDrawStartX = $scope.GetwindowStoreData(windowviewid, 'transparencyX');
- $scope.TBDrawStartY = $scope.GetwindowStoreData(windowviewid, 'transparencyY');
+
+ $scope.TBHeight = $scope.GetwindowStoreData(windowviewid, 'transparencyX');
+ $scope.TBWidth = $scope.GetwindowStoreData(windowviewid, 'transparencyY');
+
+ $scope.TBDrawStartX = $scope.GetwindowStoreData(windowviewid, 'transparencyX');
+ $scope.TBDrawStartY = $scope.GetwindowStoreData(windowviewid, 'transparencyY');
$scope.IncludedBodyRegions = [];
$scope.transparencyDrawnRegions = [];
$scope.canThirdBRDrawn = false;
+ //var newDimes = $scope.scaleTransparencyBox(windowviewid);
+ //if(newDimes != null){
+ // $scope.startX = newDimes.scaledX1;
+ // $scope.startY = newDimes.scaledY1;
+
+ // $scope.TransparencyBoxStartX = newDimes.scaledX1;
+ // $scope.TransparencyEndX = newDimes.scaledX2;
+ // $scope.TransparencyBoxStartY = newDimes.scaledY1;
+ // $scope.TransparencyBoxEndY = newDimes.scaledY2;
+
+ // $scope.TBDrawStartX = newDimes.scaledHeight;
+ // $scope.TBDrawStartY = newDimes.scaledWidth;
+
+ // $scope.TBoxEndX = newDimes.scaledX2;
+ // $scope.TBoxEndY = newDimes.scaledY2;
+ // $scope.TBHeight = newDimes.scaledHeight;
+ // $scope.TBWidth = newDimes.scaledWidth;
+
+ // }
+
+
//var tranparencyLayer;
//if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true))) {
@@ -6600,7 +6757,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
document.getElementById("canvasDivDA_" + windowviewid).appendChild(tempCanvas);
}
- //$scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer);
+
+
var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData');
@@ -6876,6 +7034,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged, isResized, windowviewid) {
+ $scope.SetwindowStoreData(windowviewid, 'isCallForTransparencyImage', true);
+ // $scope.SetwindowStoreData(windowviewid, 'isZoomed',false);
var transparencyCanvas = document.getElementById('transparencyCanvas_' + windowviewid);
TransparencyBoxStartX = parseInt((transparencyCanvas.style.left).replace('px', ''));
@@ -6894,13 +7054,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var WidthforTransImage = TBImageDimensions.WidthforTransImageTB;
var HeightforTransImage = TBImageDimensions.HeightforTransImageTB;
var YforTransImage = TBImageDimensions.YforTransImageTB;
+ //var tranparencyLayer;
+ //var isResized = $scope.GetwindowStoreData(windowviewid, "isResized");
//0. get current layer number
if (isResized || isLayerChanged) {
//do nothing
$scope.SetwindowStoreData(windowviewid,'transNumber',100);
$("#tbSlider_" + windowviewid).slider('value', 100);
+ //tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val());
}
else {
@@ -6931,6 +7094,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer);
$scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', tranparencyLayer);
}
+ //$scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer);
+ //console.log(" $scope.GetwindowStoreData(windowviewid, 'layerNumber')===" + $scope.GetwindowStoreData(windowviewid, 'layerNumber'));
$('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber'));
$scope.SetwindowStoreData(windowviewid, 'isTransparent', true);
@@ -7129,6 +7294,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
+ $scope.SetwindowStoreData(windowviewid, 'isCallForTransparencyImage', false);
if ($scope.GetwindowStoreData(windowviewid,'isHighLight') != true) {
@@ -7580,8 +7746,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
+
$scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
$scope.EnableUI();
+
+ $scope.SetwindowStoreData(windowviewid, 'isZoomed',false);
+
}
$scope.changeTransparency = function (windowviewid) {
@@ -7910,179 +8080,190 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if (tCanvasHeight != $scope.transparencyCanvasHeight || tCanvasWidth != $scope.transparencyCanvasWidth) {
+ $scope.TransparencyBoxStartX = tBoxStartX;
+ $scope.TransparencyBoxStartY = tBoxStartY;
+ $scope.TBoxEndX = tBoxEndX;
+ $scope.TBoxEndY = tBoxEndY;
+ $scope.TBHeight = tBoxEndY - tBoxStartY;
+ $scope.TBWidth = tBoxEndX - tBoxStartX;
- var transparencyCanvas = document.createElement('canvas');
- transparencyCanvas.id = 'transparencyCanvas_' + windowviewid;
- $scope.transparencyCanvas = tCanvas.id;
- transparencyCanvas.height = tCanvasHeight;
- transparencyCanvas.width = tCanvasWidth;
- transparencyCanvas.style.position = "absolute";
- transparencyCanvas.style.left = tCanvas.style.left; // x + "px";
- transparencyCanvas.style.top = tCanvas.style.top//y + "px";
- transparencyCanvas.style.border = "black 1px solid";
- transparencyCanvas.style.zIndex = 200;
-
-
- document.getElementById('canvasDivDA_' + windowviewid).appendChild(transparencyCanvas);
-
- $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
- $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid,'UIWrapperZIndex'));
-
- //bind click listener
- transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
- }
- $scope.transparencyCanvasHeight = tCanvasHeight;
- $scope.transparencyCanvasWidth = tCanvasWidth;
-
-
- //create temp cavas to retain the original anavs data for use in transparency change as
- //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
- if (document.getElementById('tempCanvas_' + windowviewid) != null) {
- $('#tempCanvas_'+ windowviewid).remove();
- }
- var tempCanvas = document.createElement('canvas');
- tempCanvas.id = 'tempCanvas_' + windowviewid;
- $scope.tempCanvas = tempCanvas.id;
- tempCanvas.height = $scope.transparencyCanvasHeight;
- tempCanvas.width = $scope.transparencyCanvasWidth;
- tempCanvas.style.position = "absolute";
- tempCanvas.style.left = 200 + 'px';
- tempCanvas.style.backgroundColor = "transparent";
- tempCanvas.style.visibility = 'hidden';
- // tempCanvas.style.border = "black 1px solid";
-
- document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas);
-
- var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData');
-
- $scope.IncludedBodyRegions = [];
- $scope.transparencyDrawnRegions = [];
- $scope.canThirdBRDrawn = false;
- var counter = 0;
- var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
- $.each(BodyRegionDictionary, function (index, value) {
-
- var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
- var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
- var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
- var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
- var TBStartX = parseInt((document.getElementById('transparencyCanvas_'+ windowviewid).style.left).replace('px', ''));
- var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
-
- if (TBStartX <= bodyRegionRight && value.X <= TBRight && TBStartY <= bodyRegionBottom && value.Y <= TBBottom) {
-
- if ($scope.GetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion') == false) {
- var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
- var layer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
- if (layer < totalayer) {
-
- var layerup=layer+1;
- $scope.SetwindowStoreData(windowviewid,'layerNumber',layerup);
- }
-
- }
-
- if (value.bodyRegionId == '3') {
-
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
+ $scope.SetwindowStoreData(windowviewid, "isResized", true);
- if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
- $scope.canThirdBRDrawn = true;
+ $scope.DrawTransparencyBox(windowviewid);
- }
+ // var transparencyCanvas = document.createElement('canvas');
+ // transparencyCanvas.id = 'transparencyCanvas_' + windowviewid;
+ // $scope.transparencyCanvas = tCanvas.id;
+ // transparencyCanvas.height = tCanvasHeight;
+ // transparencyCanvas.width = tCanvasWidth;
+ // transparencyCanvas.style.position = "absolute";
+ // transparencyCanvas.style.left = tCanvas.style.left; // x + "px";
+ // transparencyCanvas.style.top = tCanvas.style.top//y + "px";
+ // transparencyCanvas.style.border = "black 1px solid";
+ // transparencyCanvas.style.zIndex = 200;
- }
-
- if ((bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" ||bodyVid == "7")) {
- if (value.bodyRegionId == "6") {
- $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);
- }
- else {
- $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);
- }
- }
- else {
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
+ // document.getElementById('canvasDivDA_' + windowviewid).appendChild(transparencyCanvas);
- $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);
- }
+ // $('#transparencyCanvas_' + windowviewid).resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(windowviewid); }, start: function (event, ui) { clearTransCanvas(windowviewid); } });
+ // $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid,'UIWrapperZIndex'));
- else {
-
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
-
- //1. draw 6th
- var BRSixData = new jinqJs()
- .from(BodyRegionDictionary)
- .where('bodyRegionId == 6')
- .select();
- var isMirror = BRSixData[0].IsMirror;
- if (isMirror == 'Yes') {
- //draw mirror arm
- $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);
- //draw non mirror arm
- $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);
- //draw 3rd BR
- $timeout(function () {
- $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);
- }, 200);
- }
- else {
- //draw mirror arm
- $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);
- //draw non mirror arm
- $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);
- //draw 3rd BR
- $timeout(function () {
- $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);
- }, 200);
- }
+ // //bind click listener
+ // transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
+ //}
+ //$scope.transparencyCanvasHeight = tCanvasHeight;
+ //$scope.transparencyCanvasWidth = tCanvasWidth;
- }
- else {
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
- if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) {
- //do not draw 6 BR again, its already drawn
- }
- else
- $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);
- }
- }
- }
- $scope.SetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion',true);
- }
+ ////create temp cavas to retain the original anavs data for use in transparency change as
+ ////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
+ //if (document.getElementById('tempCanvas_' + windowviewid) != null) {
+ // $('#tempCanvas_'+ windowviewid).remove();
+ //}
+ //var tempCanvas = document.createElement('canvas');
+ //tempCanvas.id = 'tempCanvas_' + windowviewid;
+ //$scope.tempCanvas = tempCanvas.id;
+ //tempCanvas.height = $scope.transparencyCanvasHeight;
+ //tempCanvas.width = $scope.transparencyCanvasWidth;
+ //tempCanvas.style.position = "absolute";
+ //tempCanvas.style.left = 200 + 'px';
+ //tempCanvas.style.backgroundColor = "transparent";
+ //tempCanvas.style.visibility = 'hidden';
+ //// tempCanvas.style.border = "black 1px solid";
+
+ //document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas);
+
+ //var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData');
+
+ //$scope.IncludedBodyRegions = [];
+ //$scope.transparencyDrawnRegions = [];
+ //$scope.canThirdBRDrawn = false;
+ //var counter = 0;
+ //var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
+ //$.each(BodyRegionDictionary, function (index, value) {
+
+ // var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
+ // var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
+ // var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
+ // var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
+ // var TBStartX = parseInt((document.getElementById('transparencyCanvas_'+ windowviewid).style.left).replace('px', ''));
+ // var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
+
+ // if (TBStartX <= bodyRegionRight && value.X <= TBRight && TBStartY <= bodyRegionBottom && value.Y <= TBBottom) {
+
+ // if ($scope.GetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion') == false) {
+ // var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
+ // var layer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
+ // if (layer < totalayer) {
+
+ // var layerup=layer+1;
+ // $scope.SetwindowStoreData(windowviewid,'layerNumber',layerup);
+ // }
+
+ // }
+
+ // if (value.bodyRegionId == '3') {
+
+ // var BR_SixTBData = new jinqJs()
+ // .from($scope.transparencyDrawnRegions)
+ // .where('BRID == 6')
+ // .select();
+
+ // if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
+
+ // $scope.canThirdBRDrawn = true;
+
+ // }
+
+
+ // }
+
+ // if ((bodyVid == "9" || bodyVid == "11" || bodyVid == "2" || bodyVid == "3" || bodyVid == "6" ||bodyVid == "7")) {
+ // if (value.bodyRegionId == "6") {
+ // $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);
+ // }
+ // else {
+ // $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);
+ // }
+ // }
+ // else {
+ // if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
+
+ // $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);
+ // }
+
+ // else {
+
+ // if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
+
+ // //1. draw 6th
+ // var BRSixData = new jinqJs()
+ // .from(BodyRegionDictionary)
+ // .where('bodyRegionId == 6')
+ // .select();
+ // var isMirror = BRSixData[0].IsMirror;
+ // if (isMirror == 'Yes') {
+ // //draw mirror arm
+ // $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);
+ // //draw non mirror arm
+ // $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);
+ // //draw 3rd BR
+ // $timeout(function () {
+ // $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);
+ // }, 200);
+ // }
+ // else {
+ // //draw mirror arm
+ // $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);
+ // //draw non mirror arm
+ // $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);
+ // //draw 3rd BR
+ // $timeout(function () {
+ // $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);
+ // }, 200);
+ // }
+
+
+ // }
+ // else {
+ // var BR_SixTBData = new jinqJs()
+ // .from($scope.transparencyDrawnRegions)
+ // .where('BRID == 6')
+ // .select();
+ // if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) {
+ // //do not draw 6 BR again, its already drawn
+ // }
+ // else
+ // $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);
+ // }
+ // }
+ // }
+ // $scope.SetwindowStoreData(windowviewid,'isTBDrawnOnBodyRegion',true);
+ // }
- })
+ //})
- var isModestyOn=$scope.GetwindowStoreData(windowviewid,'isModestyOn');
- var modestyImageInfo=$scope.GetwindowStoreData(windowviewid,'modestyImageInfo');
- //for modesty
- if (isModestyOn == true && modestyImageInfo.length > 0) {
- $.each(modestyImageInfo, function (index, value) {
+ //var isModestyOn=$scope.GetwindowStoreData(windowviewid,'isModestyOn');
+ //var modestyImageInfo=$scope.GetwindowStoreData(windowviewid,'modestyImageInfo');
+ ////for modesty
+ //if (isModestyOn == true && modestyImageInfo.length > 0) {
+ // $.each(modestyImageInfo, function (index, value) {
- var bodyRegionRight = parseInt(value.x) + parseInt(value.Width);
- var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height);
- var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
- var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
- var TBStartX = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', ''));
- var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
+ // var bodyRegionRight = parseInt(value.x) + parseInt(value.Width);
+ // var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height);
+ // var TBRight = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.width).replace('px', ''));
+ // var TBBottom = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.height).replace('px', ''));
+ // var TBStartX = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.left).replace('px', ''));
+ // var TBStartY = parseInt((document.getElementById('transparencyCanvas_' + windowviewid).style.top).replace('px', ''));
- if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) {
+ // if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) {
- $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);
+ // $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);
- }
- })
+ // }
+ // })
}
}
@@ -8823,6 +9004,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) {
currentlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw');
+ $scope.SetwindowStoreData(windowviewid, 'currentLayerNumber', currentlayer);
}
var sliderVal = parseInt(totalayer) - parseInt(currentlayer);
@@ -8852,7 +9034,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('.ui-wrapper').remove();
$scope.SetwindowStoreData(windowviewid,'layerNumber',currentlayer);
- $scope.SetwindowStoreData(windowviewid,'transNumber',100);
+ $scope.SetwindowStoreData(windowviewid, 'transNumber', 100);
+
+ $scope.SetwindowStoreData(windowviewid, 'isTransparencyBtnClicked', false);
+
+ $scope.SetwindowStoreData(windowviewid, 'isZoomed', false);
+ $scope.SetwindowStoreData(windowviewid, 'isResized', false);
+
}
var modestyTempCanvases = $("canvas[id*='tempCanvasModesty']");
@@ -8968,9 +9156,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.enableZoom = function (event) {
- var len= (event.currentTarget.id).split("_").length;
+
+ var len = (event.currentTarget.id).split("_").length;
var windowviewid = (event.currentTarget.id).split("_")[len-1];
+
$("#OnIdentify").removeClass("annotationtoolbartab");
$("#DrawMode").removeClass("annotationtoolbartab");
$('.btnCursor').removeClass('activebtncolor');
@@ -8991,7 +9181,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#btnTranparency_' + windowviewid).removeClass("disabled");
$('#btnTranparency_' + windowviewid).css("pointer-events", "auto");
- $rootScope.isTransparencyBoxActivated = false;
+ // $rootScope.isTransparencyBoxActivated = false;
$scope.SetwindowStoreData(windowviewid,'isNormalMode',false);
$scope.SetwindowStoreData(windowviewid,'isGenderChnage',false);
$scope.SetwindowStoreData(windowviewid,'isViewChange',false);
@@ -9006,10 +9196,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated')) {
- $scope.CloseTransparencyBox(windowviewid);
+ //$scope.CloseTransparencyBox(windowviewid);
+ $scope.SetwindowStoreData(windowviewid, 'isZoomed', true);
}
- $scope.SetwindowStoreData(windowviewid,'isZoomed',true);
+ //$scope.SetwindowStoreData(windowviewid,'isZoomed',true);
//1.
$scope.flushCanvas(windowviewid);
@@ -9024,7 +9215,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut'));
}
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
$scope.CalculateImageCordinates(viewOrientationId,windowviewid);
@@ -9047,6 +9238,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#sppeachBubble_'+windowviewid).remove();
}
+ $scope.removeAllTermNumberForSaveCB(windowviewid);
+
}
@@ -9161,7 +9354,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.flushCanvas(windowviewid);
//3.
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+
$scope.CalculateImageCordinates(viewOrientationId,windowviewid);
@@ -9209,6 +9403,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.SetwindowStoreData(windowviewid, 'mode', "NORMAL");
$scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', true);
+
$scope.SetwindowStoreData(windowviewid, 'previousHighlightList', []);
$('#btnTranparency_' + windowviewid).removeClass("disabled");
@@ -9271,6 +9466,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid);
var CanvasDivLeftPosition = $scope.GetwindowStoreData(windowviewid, 'CanvasDivLeftPosition');
@@ -9330,6 +9526,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.enableExtract = function (isCalledFromButton,windowviewid) {
$scope.SetwindowStoreData(windowviewid, 'mode', "EXTRACT");
+
$scope.DisableUI();
console.log('isCalledFromButton= ' + isCalledFromButton);
@@ -9471,6 +9668,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
// $scope.CloseTransparencyBox(windowviewid);
$scope.GetwindowStoreData(windowviewid, 'isHighLight', true);
//Added Code by sandy to create Draw transparencybox autometically for save CB
+ //Need to Uncooment this Line-04-05-2020
//$scope.CalculateDimensionsAndDrawTBox(windowviewid);
//$timeout(function () {
@@ -10347,6 +10545,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
else {
//actual term number is not found in thsi view menas previously selected body part does not exist in this view
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid)
}
}
@@ -10768,7 +10967,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.SetwindowStoreData(windowviewid,'isHighLight',true);
if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
- $scope.SetwindowStoreData(windowviewid,'isExtract',false);
+ $scope.SetwindowStoreData(windowviewid, 'isExtract', false);
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid);
}
else
@@ -11437,7 +11637,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$('#spinner').css('visibility', 'visible');
//redraw body of respective layer
- var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
+ var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
+
$scope.CalculateImageCordinates(viewOrientationId, windowviewid);
}, 500);