Commit 1b778f0ae9635f5ea2d504fdc9a1d36d66fbcf45

Authored by Nikita Kulshreshtha
1 parent 7699e517

fixed for layer change and normal TB draw.

need fix in resize
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -2874,10 +2874,30 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2874 2874  
2875 2875 var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
2876 2876  
  2877 + $scope.transparencyDrawnRegions = [];
  2878 + $scope.canThirdBRDrawn = false;
  2879 +
  2880 +
2877 2881 $.each(BodyRegionDictionary, function (index, value) {
2878 2882 //debugger;
2879 2883 // alert(' $.each(BodyRegionDictionary1')
2880 2884  
  2885 + if (value.bodyRegionId == '3') {
  2886 +
  2887 + var BR6 = new jinqJs()
  2888 + .from($scope.transparencyDrawnRegions)
  2889 + .where('BRID == 6')
  2890 + .select();
  2891 +
  2892 + if (BR6 != null && BR6 != undefined && BR6.length > 0) {
  2893 +
  2894 + $scope.canThirdBRDrawn = true;
  2895 +
  2896 + }
  2897 +
  2898 +
  2899 + }
  2900 +
2881 2901 var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
2882 2902 var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
2883 2903  
... ... @@ -2888,8 +2908,58 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2888 2908 // debugger;
2889 2909 $scope.layerNumber = parseInt(txtlayerNumber.value);
2890 2910  
  2911 + if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
  2912 +
  2913 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  2914 + }
  2915 +
  2916 + else {
  2917 +
  2918 + if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
2891 2919  
2892   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
  2920 + //1. draw 6th
  2921 + var BRSixData = new jinqJs()
  2922 + .from(BodyRegionDictionary)
  2923 + .where('bodyRegionId == 6')
  2924 + .select();
  2925 + var isMirror = BRSixData[0].IsMirror;
  2926 + if (isMirror == 'Yes') {
  2927 + $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, true, false);
  2928 + $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, true, false);
  2929 + $timeout(function () {
  2930 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false);
  2931 +
  2932 + },200)// $scope.transparencyDrawnRegions.push({'BRID':'6'});
  2933 + }
  2934 + else {
  2935 + $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, true, false);
  2936 + $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, true, false);
  2937 + $timeout(function () {
  2938 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false);
  2939 + }, 200)// $scope.transparencyDrawnRegions.push({ 'BRID': '6' });
  2940 + }
  2941 + //$timeout(function () {
  2942 +
  2943 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  2944 +
  2945 + // }, 500);
  2946 +
  2947 + //2. draw 3rd
  2948 +
  2949 + }
  2950 + else {
  2951 + var BR6 = new jinqJs()
  2952 + .from($scope.transparencyDrawnRegions)
  2953 + .where('BRID == 6')
  2954 + .select();
  2955 + if (value.bodyRegionId == "6" && BR6 != undefined && BR6 != null && BR6.length>0) { }
  2956 + else
  2957 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false);
  2958 + }
  2959 + }
  2960 +
  2961 +
  2962 + //$scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
2893 2963 }
2894 2964  
2895 2965  
... ... @@ -4117,6 +4187,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4117 4187  
4118 4188 $scope.IncludedBodyRegions = [];
4119 4189 $scope.transparencyDrawnRegions = [];
  4190 + $scope.canThirdBRDrawn = false;
4120 4191  
4121 4192 $.each(BodyRegionDictionary, function (index, value) {
4122 4193  
... ... @@ -4162,19 +4233,81 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4162 4233  
4163 4234 $scope.isTBDrawnOnBodyRegion = true;
4164 4235  
  4236 + if (value.bodyRegionId == '3') {
  4237 +
  4238 + var BR6 = new jinqJs()
  4239 + .from($scope.transparencyDrawnRegions)
  4240 + .where('BRID == 6')
  4241 + .select();
  4242 +
  4243 + if (BR6 != null && BR6 != undefined && BR6.length > 0) {
  4244 +
  4245 + $scope.canThirdBRDrawn = true;
  4246 +
  4247 + }
  4248 +
  4249 +
  4250 + }
  4251 +
4165 4252 if (($rootScope.voId == "9" || $rootScope.voId == "11")) {
4166 4253 if (value.bodyRegionId == "6") {
4167 4254 $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
4168 4255 }
4169 4256 else {
4170   -
  4257 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
4171 4258 }
4172 4259 }
4173 4260 else {
4174   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4261 + if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
  4262 +
  4263 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4264 + }
  4265 +
  4266 + else {
4175 4267  
4176   - }
4177   - }
  4268 + if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
  4269 +
  4270 + //1. draw 6th
  4271 + var BRSixData = new jinqJs()
  4272 + .from(BodyRegionDictionary)
  4273 + .where('bodyRegionId == 6')
  4274 + .select();
  4275 + var isMirror = BRSixData[0].IsMirror;
  4276 + if (isMirror == 'Yes') {
  4277 + $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);
  4278 + $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);
  4279 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4280 + // $scope.transparencyDrawnRegions.push({'BRID':'6'});
  4281 + }
  4282 + else {
  4283 + $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);
  4284 + $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);
  4285 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4286 + // $scope.transparencyDrawnRegions.push({ 'BRID': '6' });
  4287 + }
  4288 + //$timeout(function () {
  4289 +
  4290 + // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4291 +
  4292 + // }, 500);
  4293 +
  4294 + //2. draw 3rd
  4295 +
  4296 + }
  4297 + else {
  4298 + var BR6 = new jinqJs()
  4299 + .from($scope.transparencyDrawnRegions)
  4300 + .where('BRID == 6')
  4301 + .select();
  4302 + if (value.bodyRegionId == "6" && BR6 != undefined && BR6 != null && BR6.length>0) { }
  4303 + else
  4304 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false);
  4305 + }
  4306 + }
  4307 +
  4308 + }
  4309 +
  4310 + }
4178 4311 })
4179 4312  
4180 4313 //for modesty
... ... @@ -4870,8 +5003,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4870 5003 // var ctx = transparencyCanvas.getContext('2d');
4871 5004 ctx.drawImage(tmpCanvasContext, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage)
4872 5005  
4873   - $scope.transparencyDrawnRegions.push(bodyRegionId);
4874   -
  5006 + // $scope.transparencyDrawnRegions.push(bodyRegionId);
  5007 + $scope.transparencyDrawnRegions.push({'BRID': bodyRegionId});
4875 5008  
4876 5009 $rootScope.isLoading = false;
4877 5010 $('#spinner').css('visibility', 'hidden');
... ...