Commit 472ca016185f77b2b22abe1ead8aae2e081b5f53
1 parent
00de6fce
modesty image is set in normal case and on resize on right place but in Female 2…
…nd image is not visible. Also need to work on change transparecy
Showing
1 changed file
with
448 additions
and
176 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -742,7 +742,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
742 | 742 | |
743 | 743 | $rootScope.isLoading = true; |
744 | 744 | $('#spinner').css('visibility', 'visible'); |
745 | - | |
745 | + $scope.modestyImageInfo = []; | |
746 | 746 | // annotation toolbar canvas |
747 | 747 | if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { |
748 | 748 | |
... | ... | @@ -964,7 +964,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
964 | 964 | |
965 | 965 | if (($rootScope.globalSetting.modesty == 'Y')) { |
966 | 966 | if ($('.modestyImg') != null) { |
967 | - $('.modestyImg').css('visibility', 'visible'); | |
967 | + // $('.modestyImg').css('visibility', 'visible'); | |
968 | 968 | } |
969 | 969 | } |
970 | 970 | //set scrollbars on canvas and hide loading label |
... | ... | @@ -1835,7 +1835,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1835 | 1835 | |
1836 | 1836 | if (isMaskImage == 'N') { |
1837 | 1837 | if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') { |
1838 | - //do nothing | |
1838 | + $scope.modestyImageInfo.push( | |
1839 | + | |
1840 | + { | |
1841 | + "bodyRegionId": bodyRegionId, "SRC": src, | |
1842 | + "Height": h, | |
1843 | + "Width": w, | |
1844 | + "x": x, | |
1845 | + "y": y, | |
1846 | + "haveMirror": 'false' | |
1847 | + } | |
1848 | + | |
1849 | + ); | |
1839 | 1850 | } |
1840 | 1851 | else { |
1841 | 1852 | |
... | ... | @@ -3824,7 +3835,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3824 | 3835 | if (document.getElementById('tempCanvas') != null) { |
3825 | 3836 | $('#tempCanvas').remove(); |
3826 | 3837 | } |
3827 | - if (document.getElementById('tempCanvas') == null) { | |
3838 | + if (document.getElementById('tempCanvas') == null || document.getElementById('tempCanvas') == undefined) { | |
3828 | 3839 | var tempCanvas = document.createElement('canvas'); |
3829 | 3840 | tempCanvas.id = 'tempCanvas'; |
3830 | 3841 | // $scope.tempCanvas = transparencyCanvas.id; |
... | ... | @@ -3839,6 +3850,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3839 | 3850 | document.getElementById('canvasDiv').appendChild(tempCanvas); |
3840 | 3851 | } |
3841 | 3852 | |
3853 | + | |
3842 | 3854 | $scope.isTransparencyActivated = true; |
3843 | 3855 | |
3844 | 3856 | var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; |
... | ... | @@ -3870,6 +3882,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3870 | 3882 | transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; |
3871 | 3883 | transparencyCanvas.style.border = "black 1px solid"; |
3872 | 3884 | transparencyCanvas.style.backgroundColor = "transparent"; |
3885 | + transparencyCanvas.style.zIndex = 200; | |
3873 | 3886 | // transparencyCanvas.style.visibility = 'hidden'; |
3874 | 3887 | document.getElementById('canvasDiv').appendChild(transparencyCanvas); |
3875 | 3888 | $scope.transparencyChangeCounter = 0; |
... | ... | @@ -3884,27 +3897,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3884 | 3897 | |
3885 | 3898 | $(".ui-wrapper").css("z-index", "600"); |
3886 | 3899 | |
3887 | - // $('#transparencyScale').modal('show'); | |
3888 | - | |
3889 | - //canvasDiv.removeEventListener('mouseup', arguments.callee); | |
3890 | - //canvasDiv.removeEventListener('mousedown', arguments.callee); | |
3891 | - //canvasDiv.removeEventListener('mousemove', arguments.callee); | |
3892 | 3900 | } |
3893 | 3901 | if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { |
3894 | 3902 | |
3895 | - //if ($rootScope.voId != "9") { | |
3896 | - // if ($rootScope.voId != "11") { | |
3897 | - // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3898 | - | |
3899 | - // } | |
3900 | - | |
3901 | - //} | |
3902 | 3903 | |
3903 | - //else { | |
3904 | - // if (value.bodyRegionId == "6") { | |
3905 | - // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3906 | - // } | |
3907 | - //} | |
3908 | 3904 | if (($rootScope.voId == "9" || $rootScope.voId == "11")) { |
3909 | 3905 | if (value.bodyRegionId == "6") { |
3910 | 3906 | $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); |
... | ... | @@ -3920,6 +3916,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3920 | 3916 | } |
3921 | 3917 | }) |
3922 | 3918 | |
3919 | + //for modesty | |
3920 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
3921 | + $.each($scope.modestyImageInfo, function (index, value) { | |
3922 | + // alert(' $.each(BodyRegionDictionary1') | |
3923 | + var transparencyBoxHeight = parseInt(TransparencyBoxEndY) - parseInt($scope.TransparencyBoxStartY); | |
3924 | + var transparencyBoxWidth = parseInt(TransparencyEndX) - parseInt($scope.TransparencyBoxStartX); | |
3925 | + var transparencyBoxBottom = parseInt($scope.TransparencyBoxStartY) + parseInt(transparencyBoxHeight); | |
3926 | + var transparencyBoxRight = parseInt($scope.TransparencyBoxStartX) + parseInt(transparencyBoxWidth); | |
3927 | + // alert(' $.each(BodyRegionDictionary2. transparencyBoxHeight: ' + transparencyBoxHeight + ',transparencyBoxBottom: ' + transparencyBoxBottom+', transparencyBoxRight: '+transparencyBoxRight) | |
3928 | + var bodyRegionRight = parseInt(value.x) + parseInt(value.Width); | |
3929 | + var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height); | |
3930 | + | |
3931 | + if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) { | |
3932 | + | |
3933 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3934 | + | |
3935 | + } | |
3936 | + }) | |
3937 | + } | |
3938 | + | |
3939 | + | |
3940 | + // | |
3941 | + | |
3923 | 3942 | // $('#transparencyScale').modal('show'); |
3924 | 3943 | $('#transparencyScale').css('position', 'fixed') |
3925 | 3944 | $('#transparencyScale').css('top', $scope.TBDrawStartY - 10) |
... | ... | @@ -3929,8 +3948,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3929 | 3948 | |
3930 | 3949 | |
3931 | 3950 | |
3932 | - document.getElementById('canvasDiv').removeEventListener("mousedown", mouseUpListener); | |
3933 | - document.getElementById('canvasDiv').removeEventListener("mousemove", mouseUpListener); | |
3951 | + document.getElementById('canvasDiv').removeEventListener("mousedown", mouseDownListener); | |
3952 | + document.getElementById('canvasDiv').removeEventListener("mousemove", mouseMoveListener); | |
3934 | 3953 | |
3935 | 3954 | document.getElementById('canvasDiv').removeEventListener("mouseup", mouseUpListener); |
3936 | 3955 | // document.getElementById('canvasDiv').removeEventListener("mousemove", mouseMoveListener); |
... | ... | @@ -3948,6 +3967,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3948 | 3967 | |
3949 | 3968 | $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged) { |
3950 | 3969 | // debugger; |
3970 | + | |
3971 | + // else { | |
3972 | + | |
3951 | 3973 | var scope1 = angular.element(document.getElementById("DAView")).scope(); |
3952 | 3974 | var transparencyCanvas = document.getElementById('transparencyCanvas'); |
3953 | 3975 | |
... | ... | @@ -3973,11 +3995,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3973 | 3995 | var transparencyTempCanvas; |
3974 | 3996 | |
3975 | 3997 | |
3998 | + | |
3976 | 3999 | //X ends outside and start outside of bodyregion |
3977 | 4000 | if (TransparencyBoxStartX < X && TransparencyEndX > parseInt(X) + parseInt(Width)) { |
3978 | 4001 | XforCopyImage = 0; |
3979 | 4002 | WidthforCopyImage = Width; |
3980 | 4003 | WidthforTransImage = Width; |
4004 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4005 | + XforTransImage = 0; | |
4006 | + } | |
4007 | + else | |
3981 | 4008 | XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); |
3982 | 4009 | // alert('1') |
3983 | 4010 | } |
... | ... | @@ -3990,6 +4017,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3990 | 4017 | WidthforTransImage = parseInt(TransparencyEndX) - parseInt(X); |
3991 | 4018 | |
3992 | 4019 | // alert(' scope.WidthforCopyImage: ' + scope.WidthforCopyImage) |
4020 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4021 | + XforTransImage = 0; | |
4022 | + } | |
4023 | + else | |
3993 | 4024 | XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); |
3994 | 4025 | |
3995 | 4026 | // alert('2') |
... | ... | @@ -4000,6 +4031,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4000 | 4031 | XforCopyImage = parseInt(TransparencyBoxStartX) - parseInt(X); |
4001 | 4032 | WidthforCopyImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX); |
4002 | 4033 | WidthforTransImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX); |
4034 | + | |
4035 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4036 | + | |
4037 | + XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X); | |
4038 | + } | |
4039 | + else | |
4003 | 4040 | XforTransImage = 0; |
4004 | 4041 | // alert('3') |
4005 | 4042 | } |
... | ... | @@ -4008,7 +4045,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4008 | 4045 | XforCopyImage = parseInt(TransparencyBoxStartX) - parseInt(X);//parseInt(X) + parseInt(Width) - parseInt(scope.TransparencyBoxStartX)// scope.TransparencyBoxStartX ; |
4009 | 4046 | WidthforCopyImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX); |
4010 | 4047 | WidthforTransImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX); |
4011 | - XforTransImage = 0 | |
4048 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4049 | + | |
4050 | + XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X); | |
4051 | + } | |
4052 | + else | |
4053 | + XforTransImage = 0; | |
4012 | 4054 | // alert('4. TransparencyBoxStartX: ' + TransparencyBoxStartX + ',X: ' + parseInt(X) + ',TransparencyEndX: ' + TransparencyEndX + ',XforCopyImage: ' + XforCopyImage) |
4013 | 4055 | } |
4014 | 4056 | |
... | ... | @@ -4042,7 +4084,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4042 | 4084 | YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y); |
4043 | 4085 | HeightforCopyImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY); |
4044 | 4086 | HeightforTransImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY); |
4045 | - YforTransImage = 0; | |
4087 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4088 | + YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y); | |
4089 | + | |
4090 | + } | |
4091 | + else | |
4092 | + YforTransImage = 0; | |
4046 | 4093 | |
4047 | 4094 | } |
4048 | 4095 | else if (TransparencyBoxStartY > Y && TransparencyBoxEndY < parseInt(Y) + parseInt(Height)) { |
... | ... | @@ -4050,149 +4097,139 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4050 | 4097 | YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y); |
4051 | 4098 | HeightforCopyImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY); |
4052 | 4099 | HeightforTransImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY); |
4053 | - YforTransImage = 0; | |
4054 | - } | |
4055 | - | |
4056 | - | |
4057 | - //this changes the transparency when user click on transparency scale(we have already set the original | |
4058 | - //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated) | |
4059 | - if (isTransparencyChanged == true) { | |
4060 | - | |
4061 | - // var txtTransparencyChange = document.getElementById("txtTransparencyChange"); | |
4062 | - | |
4063 | - var transNumber = $scope.transNumber; | |
4064 | - | |
4065 | - var ctx = document.getElementById('transparencyCanvas').getContext('2d'); | |
4066 | - | |
4067 | - var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4100 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4101 | + YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y); | |
4068 | 4102 | |
4069 | - // get the image data values | |
4070 | - var imageData = imageDa.data; | |
4071 | - var length = imageData.length; | |
4072 | - // set every fourth value to 50 | |
4073 | - for (var i = 3; i < length; i += 4) { | |
4074 | - //NIKITA | |
4075 | - if ($scope.voId == "9" || $scope.voId == "11") { | |
4076 | - | |
4077 | - if (imageData[i] == 0) { | |
4078 | - | |
4079 | - } | |
4080 | - else { | |
4081 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4082 | - } | |
4083 | - } | |
4084 | - else { | |
4085 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4086 | - } | |
4087 | - | |
4088 | - // imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4089 | 4103 | } |
4090 | - // after the manipulation, reset the data | |
4091 | - // imageDa.data = imageData; | |
4092 | - // and put the imagedata back to the canvas | |
4093 | - ctx.putImageData(imageDa, XforTransImage, YforTransImage); | |
4104 | + else | |
4105 | + YforTransImage = 0; | |
4106 | + } | |
4094 | 4107 | |
4095 | 4108 | |
4109 | + //0. get current layer number | |
4110 | + if ($scope.isResized) { | |
4111 | + //do nothing | |
4096 | 4112 | } |
4097 | - else { | |
4113 | + else if (isLayerChanged) { | |
4098 | 4114 | |
4099 | - //0. get current layer number | |
4100 | - if ($scope.isResized) { | |
4101 | - //do nothing | |
4102 | - } | |
4103 | - else if (isLayerChanged) { | |
4104 | 4115 | |
4105 | - // alert('isMousUp on isLayerChanged'); | |
4116 | + } | |
4117 | + else { | |
4106 | 4118 | |
4107 | - //$scope.layerNumber = parseInt($('#txtlayerNumber').val()); | |
4108 | 4119 | |
4109 | - } | |
4110 | - else { | |
4111 | - //var currentLayer = parseInt($('#txtlayerNumber').val()); | |
4120 | + var tranparencyLayer; | |
4112 | 4121 | |
4113 | - //var tranparencyLayer = currentLayer + 1; | |
4114 | - //$scope.layerNumber = tranparencyLayer; | |
4122 | + var currentLayer = $scope.layerNumberBeforeTrans; | |
4115 | 4123 | |
4116 | - var tranparencyLayer; | |
4124 | + if (currentLayer == $rootScope.totalLayers) { | |
4117 | 4125 | |
4118 | - //var currentLayer = parseInt($('#txtlayerNumber').val()); | |
4119 | - var currentLayer = $scope.layerNumberBeforeTrans; | |
4126 | + tranparencyLayer = currentLayer; | |
4120 | 4127 | |
4121 | - if (currentLayer == $rootScope.totalLayers) { | |
4128 | + } | |
4122 | 4129 | |
4123 | - tranparencyLayer = currentLayer; | |
4130 | + else { | |
4124 | 4131 | |
4125 | - } | |
4132 | + tranparencyLayer = currentLayer + 1; | |
4126 | 4133 | |
4127 | - else { | |
4134 | + } | |
4128 | 4135 | |
4129 | - tranparencyLayer = currentLayer + 1; | |
4136 | + $scope.layerNumber = tranparencyLayer; | |
4130 | 4137 | |
4131 | - } | |
4138 | + } | |
4132 | 4139 | |
4133 | - $scope.layerNumber = tranparencyLayer; | |
4140 | + $('#txtlayerNumber').val($scope.layerNumber); | |
4134 | 4141 | |
4135 | - } | |
4142 | + //dedebugger; | |
4143 | + var tranparencyImgSrc; | |
4144 | + var tranparencyMaskImgSrc; | |
4145 | + //for modesty image | |
4146 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg')))// == "2" || bodyRegionId == "3")) { | |
4147 | + { | |
4148 | + var modestyBodyRegionData = new jinqJs() | |
4149 | + .from($scope.modestyImageInfo) | |
4150 | + .where('bodyRegionId == ' + bodyRegionId) | |
4151 | + .select(); | |
4152 | + tranparencyImgSrc = modestyBodyRegionData[0].SRC; | |
4153 | + } | |
4136 | 4154 | |
4137 | - $('#txtlayerNumber').val($scope.layerNumber); | |
4155 | + //modesty end | |
4138 | 4156 | |
4139 | - //dedebugger; | |
4140 | 4157 | //1. get the image source |
4141 | - var tranparencyImgSrc; | |
4142 | 4158 | |
4159 | + else { | |
4143 | 4160 | tranparencyImgSrc = $scope.GetImageSource(bodyRegionId); |
4144 | - var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4145 | - // debugger; | |
4146 | - var oldCanvas; | |
4147 | - | |
4148 | - if (IsMirror == 'Yes') { | |
4149 | - oldCanvas = document.getElementById('transparencyTempCanvas_MR_' + bodyRegionId) | |
4150 | - } | |
4151 | - else { | |
4152 | - oldCanvas = document.getElementById('transparencyTempCanvas_' + bodyRegionId) | |
4161 | + tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4162 | + } | |
4163 | + // var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4164 | + // debugger; | |
4165 | + var oldCanvas; | |
4153 | 4166 | |
4154 | - } | |
4167 | + if (IsMirror == 'Yes') { | |
4168 | + oldCanvas = document.getElementById('transparencyTempCanvas_MR_' + bodyRegionId) | |
4169 | + } | |
4170 | + else { | |
4171 | + //if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4172 | + // oldCanvas = document.getElementById('modestyTransparencyTempCanvas_' + bodyRegionId); | |
4173 | + //} | |
4174 | + //else { | |
4175 | + oldCanvas = document.getElementById('transparencyTempCanvas_' + bodyRegionId) | |
4176 | + //} | |
4177 | + } | |
4155 | 4178 | |
4156 | - if (oldCanvas != null) { | |
4157 | - document.getElementById('canvasDiv').removeChild(oldCanvas); | |
4158 | - } | |
4179 | + if (oldCanvas != null) { | |
4180 | + document.getElementById('canvasDiv').removeChild(oldCanvas); | |
4181 | + } | |
4159 | 4182 | |
4160 | - //remove tempmask canvas | |
4161 | - var oldtempTransCanvasMask; | |
4162 | - if (IsMirror == 'Yes') { | |
4163 | - oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_MR_' + bodyRegionId + '_mci'); | |
4164 | - } | |
4165 | - else { | |
4166 | - oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_' + bodyRegionId + '_mci'); | |
4183 | + //remove tempmask canvas | |
4184 | + var oldtempTransCanvasMask; | |
4185 | + if (IsMirror == 'Yes') { | |
4186 | + oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_MR_' + bodyRegionId + '_mci'); | |
4187 | + } | |
4188 | + else { | |
4189 | + oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_' + bodyRegionId + '_mci'); | |
4167 | 4190 | |
4168 | - } | |
4169 | - if (oldtempTransCanvasMask != null) { | |
4170 | - document.getElementById('canvasDiv').removeChild(oldtempTransCanvasMask); | |
4171 | - } | |
4191 | + } | |
4192 | + if (oldtempTransCanvasMask != null) { | |
4193 | + document.getElementById('canvasDiv').removeChild(oldtempTransCanvasMask); | |
4194 | + } | |
4172 | 4195 | |
4173 | - transparencyTempCanvas = document.createElement('canvas'); | |
4174 | - var transparencyTempcanavsMask = document.createElement('canvas'); | |
4175 | - //if mirror then draw mask image for non mirrored body region for annotation | |
4176 | - if (IsMirror == 'Yes') { | |
4177 | - transparencyTempCanvas.id = 'transparencyTempCanvas_MR_' + bodyRegionId; | |
4178 | - transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_MR' + bodyRegionId + '_mci'; | |
4196 | + transparencyTempCanvas = document.createElement('canvas'); | |
4197 | + var transparencyTempcanavsMask = document.createElement('canvas'); | |
4198 | + //if mirror then draw mask image for non mirrored body region for annotation | |
4199 | + if (IsMirror == 'Yes') { | |
4200 | + transparencyTempCanvas.id = 'transparencyTempCanvas_MR_' + bodyRegionId; | |
4201 | + transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_MR' + bodyRegionId + '_mci'; | |
4202 | + } | |
4203 | + else { | |
4204 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4205 | + transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId; | |
4206 | + // transparencyTempCanvas.style.visibility = 'visible'; | |
4207 | + //transparencyTempCanvas.style.zIndex = '1000' | |
4179 | 4208 | } |
4180 | 4209 | else { |
4181 | 4210 | transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId; |
4182 | 4211 | transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci'; |
4183 | - | |
4184 | 4212 | } |
4185 | - transparencyTempCanvas.height = Height; | |
4186 | - transparencyTempCanvas.width = Width; | |
4187 | - transparencyTempCanvas.style.position = "absolute"; | |
4188 | - transparencyTempCanvas.style.left = X + 'px' // x + "px"; | |
4189 | - transparencyTempCanvas.style.top = Y + "px"//y + "px"; | |
4190 | - transparencyTempCanvas.style.visibility = 'hidden'; | |
4191 | - //transparencyTempCanvas.style.visibility = 'visible'; | |
4192 | - // transparencyCanvas.style.zIndex = 4000; | |
4193 | - document.getElementById('canvasDiv').appendChild(transparencyTempCanvas); | |
4194 | 4213 | |
4195 | - //create temp mask canvas | |
4214 | + } | |
4215 | + transparencyTempCanvas.height = Height; | |
4216 | + transparencyTempCanvas.width = Width; | |
4217 | + transparencyTempCanvas.style.position = "absolute"; | |
4218 | + transparencyTempCanvas.style.left = X + 'px' // x + "px"; | |
4219 | + transparencyTempCanvas.style.top = Y + "px"//y + "px"; | |
4220 | + //if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4221 | + // transparencyTempCanvas.style.visibility = 'visible'; | |
4222 | + //} | |
4223 | + //else { | |
4224 | + transparencyTempCanvas.style.visibility = 'hidden'; | |
4225 | + // } | |
4226 | + //transparencyTempCanvas.style.visibility = 'visible'; | |
4227 | + // transparencyCanvas.style.zIndex = 4000; | |
4228 | + document.getElementById('canvasDiv').appendChild(transparencyTempCanvas); | |
4229 | + | |
4230 | + //create temp mask canvas | |
4231 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { } | |
4232 | + else { | |
4196 | 4233 | transparencyTempcanavsMask.height = Height; |
4197 | 4234 | transparencyTempcanavsMask.width = Width; |
4198 | 4235 | transparencyTempcanavsMask.style.position = "absolute"; |
... | ... | @@ -4202,14 +4239,58 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4202 | 4239 | //transparencyTempCanvas.style.visibility = 'visible'; |
4203 | 4240 | // transparencyCanvas.style.border = "black 1px solid"; |
4204 | 4241 | document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask); |
4242 | + } | |
4205 | 4243 | |
4244 | + //for modesty canvas | |
4245 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4206 | 4246 | |
4247 | + var modestyTransTempCanvasId = 'tempCanvasModesty_' + bodyRegionId; | |
4248 | + var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId; | |
4249 | + if (document.getElementById(modestyTransTempCanvasId) != null) { | |
4250 | + document.getElementById(modestyTransTempCanvasId).parentNode.removeChild(document.getElementById(modestyTransTempCanvasId)); | |
4251 | + } | |
4252 | + | |
4253 | + if (document.getElementById(modestyTransTempCanvasId) == null || document.getElementById(modestyTransTempCanvasId) == undefined) { | |
4254 | + var tempCanvasModesty = document.createElement('canvas'); | |
4255 | + tempCanvasModesty.id = modestyTransTempCanvasId; | |
4256 | + // $scope.tempCanvas = transparencyCanvas.id; | |
4257 | + tempCanvasModesty.height = Height; | |
4258 | + tempCanvasModesty.width = Width; | |
4259 | + tempCanvasModesty.style.position = "absolute"; | |
4260 | + tempCanvasModesty.style.left = 10 + 'px'; | |
4261 | + tempCanvasModesty.style.top = 10 + 'px'; | |
4262 | + tempCanvasModesty.style.backgroundColor = "transparent"; | |
4263 | + tempCanvasModesty.style.visibility = 'hidden'; | |
4264 | + tempCanvasModesty.style.border = "black 1px solid"; | |
4265 | + document.getElementById('canvasDiv').appendChild(tempCanvasModesty); | |
4266 | + } | |
4267 | + if (document.getElementById(modestyTransCanvasId) != null) { | |
4268 | + document.getElementById(modestyTransCanvasId).parentNode.removeChild(document.getElementById(modestyTransCanvasId)); | |
4269 | + } | |
4270 | + | |
4271 | + if (document.getElementById(modestyTransCanvasId) == null || document.getElementById(modestyTransCanvasId) == undefined) { | |
4272 | + var canvasModesty = document.createElement('canvas'); | |
4273 | + canvasModesty.id = modestyTransCanvasId; | |
4274 | + // $scope.tempCanvas = transparencyCanvas.id; | |
4275 | + canvasModesty.height = Height; | |
4276 | + canvasModesty.width = Width; | |
4277 | + canvasModesty.style.position = "absolute"; | |
4278 | + canvasModesty.style.left = X + 'px'; | |
4279 | + canvasModesty.style.top = Y + 'px'; | |
4280 | + //canvasModesty.style.backgroundColor = "transparent"; | |
4281 | + canvasModesty.style.visibility = 'visible'; | |
4282 | + canvasModesty.style.zIndex = '10000' | |
4283 | + // tempcanvasModestyCanvasModesty.style.border = "black 1px solid"; | |
4284 | + document.getElementById('canvasDiv').appendChild(canvasModesty); | |
4285 | + } | |
4286 | + } | |
4287 | + | |
4288 | + if (tranparencyImgSrc != undefined) { | |
4207 | 4289 | var tempImg = new Image(); |
4208 | - tempImg.src = tranparencyImgSrc;//"http://localhost/AIA/" + tranparencyImgSrc; | |
4209 | 4290 | |
4210 | 4291 | |
4211 | 4292 | tempImg.onload = function () { |
4212 | - // debugger; | |
4293 | + debugger; | |
4213 | 4294 | var tempCtx = transparencyTempCanvas.getContext('2d'); |
4214 | 4295 | |
4215 | 4296 | if (IsMirror == 'Yes') { |
... | ... | @@ -4230,14 +4311,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4230 | 4311 | tempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; |
4231 | 4312 | } |
4232 | 4313 | else { |
4233 | - tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; | |
4314 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4315 | + tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId;//bodyRegionId; | |
4316 | + } | |
4317 | + else | |
4318 | + tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; | |
4234 | 4319 | } |
4235 | 4320 | |
4236 | 4321 | |
4237 | 4322 | //check if transparency is activated |
4238 | 4323 | |
4239 | 4324 | |
4240 | - var transNumber = $scope.transNumber;//txtTransparencyChange.value; | |
4325 | + var transNumber = 50;//$scope.transNumber;//txtTransparencyChange.value; | |
4241 | 4326 | // debugger; |
4242 | 4327 | //this changes the transparency when transparency is already activated and user resizes or chage the layer |
4243 | 4328 | |
... | ... | @@ -4248,11 +4333,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4248 | 4333 | |
4249 | 4334 | //keep the original image on temp canavs to use it in changing transparency |
4250 | 4335 | |
4251 | - if (document.getElementById('tempCanvas') != null) { | |
4252 | - var contx = document.getElementById('tempCanvas').getContext('2d'); | |
4253 | - var tbTempCanvas = document.getElementById(tempCanvasID) | |
4254 | - contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4255 | 4336 | |
4337 | + | |
4338 | + //if (document.getElementById(modestyTransTempCanvasId) != undefined || document.getElementById(modestyTransTempCanvasId) != null) { | |
4339 | + // var contxModesty = document.getElementById(modestyTransTempCanvasId).getContext('2d'); | |
4340 | + // var tbTempCanvas = document.getElementById(tempCanvasID) | |
4341 | + // contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4342 | + | |
4343 | + //} | |
4344 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4345 | + var modestyTempCanvasId = 'tempCanvasModesty_' + bodyRegionId; | |
4346 | + if (document.getElementById(modestyTempCanvasId) != undefined || document.getElementById(modestyTempCanvasId) != null) { | |
4347 | + var contxModesty = document.getElementById(modestyTempCanvasId).getContext('2d'); | |
4348 | + var tbTempCanvas = document.getElementById(tempCanvasID) | |
4349 | + contxModesty.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4350 | + | |
4351 | + } | |
4352 | + } | |
4353 | + else { | |
4354 | + | |
4355 | + if (document.getElementById('tempCanvas') != null && document.getElementById('tempCanvas') != undefined) { | |
4356 | + var contx = document.getElementById('tempCanvas').getContext('2d'); | |
4357 | + var tbTempCanvas = document.getElementById(tempCanvasID) | |
4358 | + contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4359 | + | |
4360 | + } | |
4256 | 4361 | } |
4257 | 4362 | |
4258 | 4363 | // get the image data values |
... | ... | @@ -4275,15 +4380,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4275 | 4380 | } |
4276 | 4381 | } |
4277 | 4382 | else { |
4278 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4383 | + if (imageData[i] == 0) { | |
4384 | + | |
4385 | + } | |
4386 | + else { | |
4387 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4388 | + } | |
4279 | 4389 | } |
4280 | 4390 | } |
4281 | 4391 | |
4282 | 4392 | |
4283 | 4393 | tempCtx.putImageData(imageD, 0, 0); |
4284 | 4394 | |
4285 | - | |
4286 | - var ctx = transparencyCanvas.getContext('2d'); | |
4395 | + var ctx; | |
4396 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4397 | + ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); | |
4398 | + } | |
4399 | + else | |
4400 | + ctx = transparencyCanvas.getContext('2d'); | |
4287 | 4401 | |
4288 | 4402 | |
4289 | 4403 | var TrtempCanvasID |
... | ... | @@ -4291,6 +4405,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4291 | 4405 | TrtempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; |
4292 | 4406 | } |
4293 | 4407 | else { |
4408 | + //if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4409 | + // TrtempCanvasID = 'modestyTransparencyTempCanvas_' + bodyRegionId; | |
4410 | + //} | |
4411 | + //else | |
4294 | 4412 | TrtempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; |
4295 | 4413 | } |
4296 | 4414 | |
... | ... | @@ -4310,47 +4428,105 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4310 | 4428 | PreviousBodyRegionHeight = 0; |
4311 | 4429 | |
4312 | 4430 | } |
4431 | + tempImg.src = tranparencyImgSrc;//"http://localhost/AIA/" + tranparencyImgSrc; | |
4313 | 4432 | |
4433 | + } | |
4314 | 4434 | |
4315 | - //mask image code | |
4316 | - //draw mask for annotation | |
4317 | - var tempMaskImg = new Image(); | |
4318 | - var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4319 | - tempMaskImg.src = tranparencyMaskImgSrc;//"http://localhost/AIA/" + tranparencyMaskImgSrc; | |
4320 | - tempMaskImg.onload = function () { | |
4321 | - // debugger; | |
4322 | - var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4323 | - | |
4324 | - if (IsMirror == 'Yes') { | |
4325 | - //debugger; | |
4326 | - tempmaskCtx.save(); | |
4327 | - tempmaskCtx.translate(Width, 0); | |
4328 | - tempmaskCtx.scale(-1, 1); | |
4329 | - tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4330 | - } | |
4331 | - else { | |
4332 | - tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4333 | 4435 | |
4334 | - } | |
4436 | + //mask image code | |
4437 | + //draw mask for annotation | |
4438 | + var tempMaskImg = new Image(); | |
4439 | + var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4440 | + tempMaskImg.src = tranparencyMaskImgSrc;//"http://localhost/AIA/" + tranparencyMaskImgSrc; | |
4441 | + tempMaskImg.onload = function () { | |
4442 | + // debugger; | |
4443 | + var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4335 | 4444 | |
4445 | + if (IsMirror == 'Yes') { | |
4446 | + //debugger; | |
4447 | + tempmaskCtx.save(); | |
4448 | + tempmaskCtx.translate(Width, 0); | |
4449 | + tempmaskCtx.scale(-1, 1); | |
4450 | + tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4451 | + } | |
4452 | + else { | |
4453 | + tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4336 | 4454 | |
4337 | 4455 | } |
4338 | 4456 | |
4339 | 4457 | |
4340 | - PreviousBodyRegionHeight = HeightforTransImage; | |
4341 | - PreviousBodyRegionY = YforTransImage; | |
4342 | - PreviousBodyRegionWidth = WidthforTransImage; | |
4343 | - PreviousBodyRegionX = XforTransImage; | |
4344 | - previousBodyRegionId = bodyRegionId; | |
4458 | + } | |
4345 | 4459 | |
4346 | - // $scope.layerNumber = parseInt($scope.layerNumber - 1); | |
4347 | 4460 | |
4348 | - } | |
4461 | + PreviousBodyRegionHeight = HeightforTransImage; | |
4462 | + PreviousBodyRegionY = YforTransImage; | |
4463 | + PreviousBodyRegionWidth = WidthforTransImage; | |
4464 | + PreviousBodyRegionX = XforTransImage; | |
4465 | + previousBodyRegionId = bodyRegionId; | |
4466 | + | |
4467 | + // $scope.layerNumber = parseInt($scope.layerNumber - 1); | |
4468 | + | |
4469 | + //} | |
4349 | 4470 | |
4350 | 4471 | } |
4351 | 4472 | |
4473 | + $scope.changeTransparency = function () { | |
4474 | + //this changes the transparency when user click on transparency scale(we have already set the original | |
4475 | + //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated) | |
4476 | + // if (isTransparencyChanged == true) { | |
4477 | + | |
4478 | + // var txtTransparencyChange = document.getElementById("txtTransparencyChange"); | |
4479 | + //var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
4480 | + //if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4481 | + // debugger | |
4482 | + // for (var j = 0; j < modestyTransCanvases.length; j++) { | |
4483 | + // var ctx = document.getElementById(modestyTransCanvases[j]).getContext('2d'); | |
4484 | + // var ImgData = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4485 | + // //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
4486 | + // } | |
4487 | + //} | |
4352 | 4488 | |
4489 | + var transNumber = $scope.transNumber; | |
4353 | 4490 | |
4491 | + var ctx = document.getElementById('transparencyCanvas').getContext('2d'); | |
4492 | + | |
4493 | + // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4494 | + var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); | |
4495 | + | |
4496 | + // get the image data values | |
4497 | + var imageData = imageDa.data; | |
4498 | + var length = imageData.length; | |
4499 | + // set every fourth value to 50 | |
4500 | + for (var i = 3; i < length; i += 4) { | |
4501 | + //NIKITA | |
4502 | + if ($scope.voId == "9" || $scope.voId == "11") { | |
4503 | + | |
4504 | + if (imageData[i] == 0) { | |
4505 | + | |
4506 | + } | |
4507 | + else { | |
4508 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4509 | + } | |
4510 | + } | |
4511 | + else { | |
4512 | + if (imageData[i] == 0) { | |
4513 | + | |
4514 | + } | |
4515 | + else | |
4516 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4517 | + } | |
4518 | + | |
4519 | + // imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4520 | + } | |
4521 | + // after the manipulation, reset the data | |
4522 | + // imageDa.data = imageData; | |
4523 | + // and put the imagedata back to the canvas | |
4524 | + //ctx.putImageData(imageDa, XforTransImage, YforTransImage); | |
4525 | + ctx.putImageData(imageDa, 0, 0); | |
4526 | + | |
4527 | + | |
4528 | + //} | |
4529 | + } | |
4354 | 4530 | |
4355 | 4531 | |
4356 | 4532 | |
... | ... | @@ -4380,6 +4556,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4380 | 4556 | } |
4381 | 4557 | |
4382 | 4558 | |
4559 | + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
4560 | + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4561 | + for (var j = 0; j < modestyTransCanvases.length; j++) { | |
4562 | + | |
4563 | + modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
4564 | + } | |
4565 | + } | |
4566 | + | |
4567 | + var modestyTempCanvases = $("canvas[id*='tempCanvasModesty_']"); | |
4568 | + if (modestyTempCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4569 | + for (var j = 0; j < modestyTempCanvases.length; j++) { | |
4570 | + | |
4571 | + modestyTempCanvases[j].parentNode.removeChild(modestyTempCanvases[j]); | |
4572 | + } | |
4573 | + } | |
4574 | + | |
4383 | 4575 | $scope.isResized = true; |
4384 | 4576 | |
4385 | 4577 | |
... | ... | @@ -4395,10 +4587,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4395 | 4587 | transparencyCanvas.style.left = tCanvas.style.left; // x + "px"; |
4396 | 4588 | transparencyCanvas.style.top = tCanvas.style.top//y + "px"; |
4397 | 4589 | transparencyCanvas.style.border = "black 1px solid"; |
4590 | + transparencyCanvas.style.zIndex = 200; | |
4591 | + | |
4592 | + | |
4398 | 4593 | document.getElementById('canvasDiv').appendChild(transparencyCanvas); |
4399 | 4594 | |
4400 | 4595 | $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } }); |
4596 | + $(".ui-wrapper").css("z-index", "600"); | |
4401 | 4597 | |
4598 | + //bind click listener | |
4599 | + transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4402 | 4600 | } |
4403 | 4601 | $scope.transparencyCanvasHeight = tCanvasHeight; |
4404 | 4602 | $scope.transparencyCanvasWidth = tCanvasWidth; |
... | ... | @@ -4449,17 +4647,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4449 | 4647 | |
4450 | 4648 | |
4451 | 4649 | }) |
4452 | - //bind click listener | |
4453 | - //bind click listener | |
4454 | - transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4650 | + | |
4651 | + | |
4652 | + //for modesty | |
4653 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
4654 | + $.each($scope.modestyImageInfo, function (index, value) { | |
4655 | + // alert(' $.each(BodyRegionDictionary1') | |
4656 | + | |
4657 | + | |
4658 | + var bodyRegionRight = parseInt(value.x) + parseInt(value.Width); | |
4659 | + var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height); | |
4660 | + var TBRight = parseInt((document.getElementById('transparencyCanvas').style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas').style.width).replace('px', '')); | |
4661 | + var TBBottom = parseInt((document.getElementById('transparencyCanvas').style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas').style.height).replace('px', '')); | |
4662 | + var TBStartX = parseInt((document.getElementById('transparencyCanvas').style.left).replace('px', '')); | |
4663 | + var TBStartY = parseInt((document.getElementById('transparencyCanvas').style.top).replace('px', '')); | |
4664 | + | |
4455 | 4665 | |
4456 | 4666 | |
4457 | 4667 | |
4668 | + if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) { | |
4669 | + | |
4670 | + | |
4671 | + $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); | |
4672 | + | |
4673 | + } | |
4674 | + }) | |
4675 | + } | |
4676 | + | |
4458 | 4677 | // }); |
4459 | - $(".ui-wrapper").css("z-index", "600"); | |
4678 | + //$(".ui-wrapper").css("z-index", "600"); | |
4460 | 4679 | $scope.isResized = false; |
4461 | 4680 | } |
4462 | 4681 | |
4682 | + | |
4463 | 4683 | function TransparencyCanvasClickListener(evt) { |
4464 | 4684 | //alert('tb clicked') |
4465 | 4685 | // debugger; |
... | ... | @@ -4841,9 +5061,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4841 | 5061 | |
4842 | 5062 | $scope.CloseTransparencyBox = function () { |
4843 | 5063 | |
4844 | - | |
5064 | + | |
4845 | 5065 | //To enable extract button |
4846 | - $scope.isTransparencyActivated = false; | |
5066 | + $scope.isTransparencyActivated = false; | |
4847 | 5067 | $("#btnExtract").removeClass("disabled"); |
4848 | 5068 | |
4849 | 5069 | //$('.com_anno').css('display', 'none'); |
... | ... | @@ -4887,7 +5107,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4887 | 5107 | //var scope = angular.element(document.getElementById("DAView")).scope(); |
4888 | 5108 | //scope.$apply(function () { |
4889 | 5109 | // $scope.layerNumber = 0; |
4890 | - // $scope.isTransparencyActivated = false; | |
5110 | + // $scope.isTransparencyActivated = false; | |
4891 | 5111 | //}) |
4892 | 5112 | |
4893 | 5113 | |
... | ... | @@ -4904,6 +5124,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4904 | 5124 | $scope.transNumber = 50; |
4905 | 5125 | $(".slider").slider({ value: 50 }) |
4906 | 5126 | } |
5127 | + | |
5128 | + | |
5129 | + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
5130 | + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
5131 | + for (var j = 0; j < modestyTransCanvases.length; j++) { | |
5132 | + | |
5133 | + modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
5134 | + } | |
5135 | + } | |
5136 | + | |
4907 | 5137 | $('#transparencyScale').css('visibility', 'hidden'); |
4908 | 5138 | |
4909 | 5139 | //$scope.isTransparencyActivated = false; |
... | ... | @@ -4960,6 +5190,48 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4960 | 5190 | }) |
4961 | 5191 | }; |
4962 | 5192 | |
5193 | + $scope.createSpeechBubbleOnTransparencyBox = function (event, text1, text2, x, y) { | |
5194 | + | |
5195 | + $('#canvasDiv').css('cursor', 'pointer'); | |
5196 | + $('<div id="speechBubbleTrns" class="BubbleDiv" style="display:visible; top:' + y + 'px; left:' + x + 'px;z-index:700"> <div class="">' | |
5197 | + + '<div class="Bubble">' | |
5198 | + + '<div class="BubbleCloseBtn"></div><div class="BubbleContent">' + text1 + '</div><div class="BubbleContent">' + text2 + '</div><div class="bottomLeftArrow"></div>' | |
5199 | + //+'<div class="bottomRightArrow"></div><div class="topLeftArrow"></div><div class="topRightArrow"></div> | |
5200 | + + '</div></div></div>').appendTo('#canvasDiv'); | |
5201 | + | |
5202 | + $('#speechBubbleTrns').on('click', '.BubbleCloseBtn', function (e) { | |
5203 | + $('#speechBubbleTrns').css('display', 'none'); | |
5204 | + }); | |
5205 | + | |
5206 | + $('#canvasDiv').attr("data-bubbleid", "speechBubble") | |
5207 | + | |
5208 | + | |
5209 | + }; | |
5210 | + | |
5211 | + | |
5212 | + function positionTooltip(event, x, y) { | |
5213 | + // alert('positionTooltip') | |
5214 | + x = 100, | |
5215 | + y = 200, | |
5216 | + | |
5217 | + $('div.speech-bubble').css({ | |
5218 | + 'position': 'absolute', 'top': x, 'left': y, 'background-color': '#f8f8f8', | |
5219 | + 'border': '2px solid #c8c8c8', 'width': '150px', 'height': '50px' | |
5220 | + }); | |
5221 | + | |
5222 | + | |
5223 | + $('.arrow').css({ | |
5224 | + 'border-style': 'solid', | |
5225 | + 'position': 'absolute' | |
5226 | + }); | |
5227 | + | |
5228 | + $('.bottom').css({ | |
5229 | + 'border-color': '#c8c8c8 transparent transparent transparent', | |
5230 | + 'border-width': ' 8px 8px 0px 8px', | |
5231 | + 'bottom': -'8px' | |
5232 | + }) | |
5233 | + }; | |
5234 | + | |
4963 | 5235 | |
4964 | 5236 | $scope.IdentityClick = function () { |
4965 | 5237 | ... | ... |