Commit 9e2be78c58e52363bd09f07af605fbe9a1b9fffd

Authored by Amrita Vishnoi
2 parents 8cb4e826 50a0f797

Merge branch 'ReplicatedCodeForAnnotation' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -525,7 +525,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
525 525  
526 526  
527 527 $scope.loadSearchDataForBodyView = function () {
528   -
  528 +
529 529 console.log('loadSearchDataForBodyView');
530 530  
531 531 var currentBodyViewId = localStorage.getItem("currentBodyViewId");
... ... @@ -724,6 +724,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
724 724 //calculate coordinates for body region images
725 725 $scope.CalculateImageCordinates = function (viewOrientationId) {
726 726  
  727 + // annotation toolbar canvas
  728 + if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
  729 +
  730 + $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
  731 + $scope.CanvasDrawingListner();
  732 + // $rootScope.FreeStylePaint();
  733 +
  734 + }
  735 +
727 736 $scope.terminateCurrentlyRunningWPs();
728 737  
729 738 var drawnBodyRegionCount = [];
... ... @@ -1197,11 +1206,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1197 1206 FlipedImgCanvas.style.left = x + "px";
1198 1207 FlipedImgCanvas.style.top = y + "px";
1199 1208  
1200   -
  1209 +
1201 1210  
1202 1211 if (isMaskImage == 'Y') {
  1212 +
1203 1213 FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci';
1204   - FlipedImgCanvas.style.visibility = 'hidden'
  1214 + FlipedImgCanvas.style.visibility = 'hidden';
  1215 +
1205 1216  
1206 1217 }
1207 1218 else {
... ... @@ -1222,6 +1233,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1222 1233  
1223 1234 FlipedImgCanvas.addEventListener('click', function (evt) {
1224 1235  
  1236 +
1225 1237 //to get correct data on multihighlight highlight
1226 1238 if ($scope.isLayerChange == true) {
1227 1239 $scope.isLayerChange = false;
... ... @@ -1430,8 +1442,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1430 1442 context.scale(-1, 1);
1431 1443 context.drawImage(img, 0, 0);
1432 1444 context.restore();
1433   -
1434   -
  1445 +
  1446 +
1435 1447 if (isMaskImage == 'N') {
1436 1448  
1437 1449  
... ... @@ -1501,9 +1513,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1501 1513 );
1502 1514 }
1503 1515 };
1504   -
  1516 +
  1517 +
1505 1518 if (document.getElementById('canvasDiv') != null)
1506 1519 document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
  1520 +
  1521 +
1507 1522  
1508 1523  
1509 1524  
... ... @@ -1755,9 +1770,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1755 1770  
1756 1771  
1757 1772 function start() {
1758   - //debugger;
  1773 +
1759 1774 context.drawImage(img, 0, 0);
1760 1775  
  1776 +
  1777 +
1761 1778 if (isMaskImage == 'N') {
1762 1779 if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') {
1763 1780 //do nothing
... ... @@ -1985,7 +2002,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1985 2002  
1986 2003  
1987 2004 var canvasId = (e.data.canvasId).replace('_mci', '');
1988   - //debugger;
  2005 +
1989 2006 //for (var i = 1; i <= updatedData.length; i++) {
1990 2007 var grayCanvasID = canvasId;
1991 2008  
... ... @@ -2021,7 +2038,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2021 2038  
2022 2039  
2023 2040 if ($rootScope.multiAnnotationIsON == true) {
2024   - //debugger;
  2041 +
2025 2042 if (canvasId.match('_MR'))
2026 2043 $rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
2027 2044 else
... ... @@ -2223,7 +2240,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2223 2240  
2224 2241 var bodyRegionId = e.data.bodyRegionId;
2225 2242 var canvasId = (e.data.canvasId).replace('_mci', '');
2226   - //debugger;
  2243 +
2227 2244 //for (var i = 1; i <= updatedData.length; i++) {
2228 2245 var grayCanvasID = canvasId;
2229 2246  
... ... @@ -2243,7 +2260,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2243 2260  
2244 2261 }
2245 2262  
2246   - //debugger;
  2263 +
2247 2264  
2248 2265 if (canvasId.match('_MR')) {
2249 2266 $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData;
... ... @@ -2275,7 +2292,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2275 2292 }
2276 2293  
2277 2294 if ($scope.doAligneCanvasWithTerm == true) {
2278   - //debugger;
  2295 +
2279 2296 if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
2280 2297  
2281 2298 $rootScope.isLoading = false;
... ... @@ -2306,9 +2323,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2306 2323  
2307 2324 var multiTermList = [];
2308 2325 angular.forEach($rootScope.previousHighlightList, function (value, key) {
2309   -
2310   - //debugger;
2311   -
2312 2326 var ActualTermNo = $scope.getActualTermNumber(value);
2313 2327 if (ActualTermNo != null) {
2314 2328 var TermList = $scope.getTermNumberList(ActualTermNo);
... ... @@ -2369,8 +2383,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2369 2383  
2370 2384 //get annotation from term number
2371 2385 $scope.GetAnnotationText = function (termNumber) {
2372   - //debugger;
2373   -
  2386 +
2374 2387 var annotationText;
2375 2388 //0
2376 2389 var figLeafTermNo = 5868; // to do declare constant for this
... ... @@ -2405,8 +2418,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2405 2418 }
2406 2419  
2407 2420 $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) {
2408   - // debugger;
2409   -
  2421 +
2410 2422 var Annotation;
2411 2423 $scope.ActualTermNo = actualTermNo;
2412 2424 if ($rootScope.VocabTermData != null || $rootScope.VocabTermData != undefined) {
... ... @@ -2453,11 +2465,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2453 2465 $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
2454 2466 $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft;
2455 2467  
2456   - // debugger;
2457 2468 // $('#daLoaderLabel').css('visibility', 'visible');
2458 2469  
2459 2470  
2460   -
2461 2471 if ($scope.isTransparencyActivated) {
2462 2472  
2463 2473 //crete temp canavs to store the original data which will be used to chnange the transparency
... ... @@ -2481,7 +2491,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2481 2491 if (document.getElementById('canvasDiv') != null)
2482 2492 document.getElementById('canvasDiv').appendChild(tempCanvas);
2483 2493  
2484   - // //debugger;
  2494 +
2485 2495  
2486 2496 var tCanvas = document.getElementById('transparencyCanvas');
2487 2497 var tCanvasContext = tCanvas.getContext('2d');
... ... @@ -2560,6 +2570,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2560 2570 $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
2561 2571 $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)
2562 2572  
  2573 +
2563 2574 if ($rootScope.isHighlightBodyByBodySystem) {
2564 2575 $timeout(function () { $scope.DisableProgressBar() }, 20000);
2565 2576 }
... ... @@ -5790,7 +5801,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5790 5801  
5791 5802 $scope.OnViewChange = function (event) {
5792 5803  
5793   -
  5804 +
5794 5805 $("#btnExtract").removeClass("disabled");
5795 5806 $("#btnTranparency").removeClass("disabled");
5796 5807 $rootScope.isTransparencyBoxActivated = false;
... ... @@ -5981,7 +5992,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5981 5992  
5982 5993  
5983 5994 $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
5984   -
  5995 +
5985 5996 //$rootScope.voId = currentBodyViewId;
5986 5997  
5987 5998 //$scope.skinTone = $rootScope.globalSetting.ethnicity;
... ... @@ -6039,7 +6050,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6039 6050 $("#canvas").css("display", "block");
6040 6051 $("#canvasPaint").css("display", "block");
6041 6052  
6042   - $scope.doClick();
  6053 + $scope.CanvasDrawingListner();
6043 6054 $rootScope.FreeStylePaint();
6044 6055 });
6045 6056 $scope.mousePs;
... ... @@ -6055,7 +6066,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6055 6066 $scope.offsetY1 = 0;
6056 6067 $scope.x = 0;
6057 6068 $scope.y = 0;
6058   - $scope.doClick = function (event) {
  6069 + $scope.CanvasDrawingListner = function (event) {
6059 6070  
6060 6071 $scope.clicked = true;
6061 6072 // OnPaintCanvasMouseDown(event);
... ... @@ -6100,6 +6111,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6100 6111 $rootScope.resetText = 0;
6101 6112 $rootScope.resetTextSave = 0;
6102 6113 $rootScope.ObjectIndexSave = 0;
  6114 +
6103 6115 var arrayRect = {};
6104 6116  
6105 6117  
... ... @@ -6147,7 +6159,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6147 6159 break;
6148 6160  
6149 6161 case "Line":
6150   -
  6162 +
6151 6163 $rootScope.resetLine = $rootScope.ObjectIndex++;
6152 6164 $('#canvas').addLayer({
6153 6165 name: 'Line_' + $rootScope.resetLine,
... ... @@ -6159,7 +6171,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6159 6171 rounded: true,
6160 6172 x1: $scope.offsetX1, y1: $scope.offsetY1,
6161 6173 x2: $scope.x, y2: $scope.y,
6162   -
  6174 +
6163 6175 click: function (layer) {
6164 6176 $rootScope.canvasLayerNameCollection = [];
6165 6177 $rootScope.canvasLayerNameCollection.push(layer.name);
... ... @@ -6308,7 +6320,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6308 6320  
6309 6321  
6310 6322 click: function (layer) {
6311   - // alert(layer.name);
  6323 +
6312 6324 $rootScope.canvasLayerNameCollection = [];
6313 6325 $rootScope.canvasLayerNameCollection.push(layer.name);
6314 6326 $('#canvas').setLayer(layer.name, {
... ... @@ -6636,6 +6648,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6636 6648  
6637 6649 }
6638 6650  
  6651 +
  6652 +
6639 6653 //-- TextArea functionality of Annotation toolbar
6640 6654  
6641 6655 $rootScope.fontSizes;
... ... @@ -6990,7 +7004,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6990 7004  
6991 7005 $(document).keydown(function (event) {
6992 7006  
6993   -
  7007 + // predefined function for detecting keyboard key
6994 7008 if (event.which == 46) {
6995 7009  
6996 7010 if ($rootScope.shapeTypePin == "Pin") {
... ... @@ -7510,7 +7524,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7510 7524 var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>';
7511 7525 $("#totalTerms").empty();
7512 7526 $('#totalTerms').append(termsTotal);
7513   -
  7527 +
7514 7528  
7515 7529 }
7516 7530 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -89,15 +89,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
89 89 }
90 90 }
91 91  
92   - $rootScope.DrawLine = function () {
  92 + // $rootScope.DrawLine = function () {
93 93 //$rootScope.isIdetifyClicked = false;
94 94 //$rootScope.isDrawingToolSelected = true;
95 95 //$rootScope.isLineDrawSelecyed = true;
96   - $rootScope.shapeType = "Line";
  96 + // $rootScope.shapeType = "Line";
97 97 // alert($rootScope.shapeType);
98 98  
99 99  
100   - }
  100 + // }
101 101  
102 102 $rootScope.ClearIframe = function () {
103 103 if ($('#daImagePanel') != null)
... ... @@ -159,20 +159,26 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
159 159  
160 160 //----Annotation Toolbar: Jcanvas-----
161 161  
162   - $rootScope.DrawLine = function (e) {
  162 + $rootScope.DrLine = function (e) {
  163 +
  164 + $("#canvasPaint").css("display", "block");
  165 + $("#canvas").css("display", "block");
  166 +
163 167 $rootScope.switchCanvas();
164 168 $rootScope.shapeType = "Line";
165   -
166   -
  169 +
167 170 $('.btnCursor').removeClass('activebtncolor');
168   - $(".btn-annotation").removeClass("activebtncolor");
169   - $(".btn-annotation-line").addClass("activebtncolor");
170   -
  171 + $(".btn-annotation").removeClass("activebtncolor");
  172 + $(".btn-annotation-line").addClass("activebtncolor");
171 173  
172 174 }
173 175  
174 176  
175   - $rootScope.DrawPin = function (e) {
  177 + $rootScope.DrPin = function (e) {
  178 + $("#canvasPaint").css("display", "block");
  179 + $("#canvas").css("display", "block");
  180 +
  181 + $rootScope.switchCanvas();
176 182 $rootScope.switchCanvas();
177 183 $rootScope.shapeType = "Pin";
178 184  
... ... @@ -191,6 +197,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
191 197 }
192 198  
193 199 $rootScope.DrawRectangle = function (e) {
  200 +
194 201 $("#canvasPaint").css("display", "block");
195 202 $("#canvas").css("display", "block");
196 203 $rootScope.switchCanvas();
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -309,7 +309,7 @@
309 309 <div class="row">
310 310 <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center">
311 311 <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="2277" height="3248" class="canvas-annotationStyle1"></canvas>
312   - <canvas id="canvas" ng-click="doClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>
  312 + <canvas id="canvas" ng-click="CanvasDrawingListner($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>
313 313 </div>
314 314 <!--<div id="canvasDiv" style=" width: 95% !important;top:0px;overflow:scroll;background-color:white;">-->
315 315 <!--<div id="daLoaderLabel">Loading....</div>-->
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -431,12 +431,12 @@
431 431 <div class="" role="" aria-label="...">
432 432 <div class="" role="group" align="center">
433 433 <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btnCursor" data-toggle="tooltip" data-placement="top" title="Select Shapes(S)" ng-click="Cursor()"><img src="content/images/icon-identity.png" alt="" title=""></button>
434   - <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-pin" data-toggle="tooltip" data-placement="top" title="Draw Pin" ng-click="DrawPin($event)"><img src="content/images/draw-pin.png" alt="" title=""></button>
  434 + <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-pin" data-toggle="tooltip" data-placement="top" title="Draw Pin" ng-click="DrPin($event)"><img src="content/images/draw-pin.png" alt="" title=""></button>
435 435 <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-arrow" data-toggle="tooltip" data-placement="top" title="Draw Arrow" ng-click="DrawArrow($event)"><img src="content/images/draw-arrow.png" alt="" title=""></button>
436 436 <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-Text" data-toggle="tooltip" data-placement="top" title="Draw Text" ng-click="DrawText($event)"><img src="content/images/draw-text.png" alt="" title=""></button>
437 437 </div>
438 438 <div class="" role="group" align="center">
439   - <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-line" data-toggle="tooltip" data-placement="top" title="Draw Line" ng-click="DrawLine($event)"><img src="content/images/draw-line.png" alt="" title=""></button>
  439 + <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-line" data-toggle="tooltip" data-placement="top" title="Draw Line" ng-click="DrLine($event)"><img src="content/images/draw-line.png" alt="" title=""></button>
440 440 <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-rectangle" data-toggle="tooltip" data-placement="top" title="Draw Rectangle" ng-click="DrawRectangle($event)"><img src="content/images/draw-rec.png" alt="" title=""></button>
441 441 <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-circle" data-toggle="tooltip" data-placement="top" title="Draw Circle" ng-click="DrawCircle($event)"><img src="content/images/draw-cir.png" alt="" title=""></button>
442 442 <button type="button" class="btn btn-black-annotation btn-xs btn-annotation" data-toggle="tooltip" data-placement="top" title="Draw Polygon" ng-click="DrawPolygon($event)"><img src="content/images/draw-poly.png" alt="" title=""></button>
... ...