diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 9170813..47919e3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -904,8 +904,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } $rootScope.CIAnotationIdentifyModeOff = false; $rootScope.OnIdentifyClick = function () { - - + $("#OnIdentify").addClass("annotationtoolbartab"); $("#DrawMode").removeClass("annotationtoolbartab"); @@ -943,6 +942,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#aaDetailViewCanvas").css("z-index", a); } + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + + for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) { + + if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) { + + var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId; + var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId; + + $('#aaDetailViewCanvas').setLayer(pinName, { + visible: false // set to true instead to show the layer again + }).drawLayers(); + + $('#aaDetailViewCanvas').setLayer(pinArcName, { + visible: false // set to true instead to show the layer again + }).drawLayers(); + + } + } + } + } } @@ -1039,6 +1059,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.switchToAACanvas(); + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + + for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) { + + if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) { + + var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId; + var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId; + + $('#aaDetailViewCanvas').setLayer(pinName, { + visible: true // set to true instead to show the layer again + }).drawLayers(); + + $('#aaDetailViewCanvas').setLayer(pinArcName, { + visible: true // set to true instead to show the layer again + }).drawLayers(); + + } + } + } + } } @@ -1746,9 +1787,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - + $rootScope.jcanvasObjectArray = []; $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - if ($rootScope.isRectanglePreviewCompleted == true) { $rootScope.isRectanglePreviewCompleted = false; $(canvasId).addLayer({ @@ -1766,11 +1806,44 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic height: Math.abs(y - offsetY1), resizeFromCenter: false, - + add: function (layer) { + + if ($location.path() == "/module-item-view") { + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); + } + }, dblclick: function () { }, - + dragstop: function (layer) { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + }, + change: function (layer) { + + if ($location.path() == "/module-item-view") { + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + } + }, click: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { //jcanvas property @@ -1783,8 +1856,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); } @@ -1794,6 +1872,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } }, mouseout: function (layer) { + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { //jcanvas property layer.draggable = true; @@ -1805,7 +1884,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic strokeStyle: 'yellow', strokeWidth: 0, width: 0, height: 0, - cornerRadius: 0 + cornerRadius: 0, + } }).drawLayers(); @@ -1826,8 +1906,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } + } }).drawLayers(); } @@ -1864,6 +1950,41 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic // Place a handle at each side and each corner resizeFromCenter: false, handlePlacement: 'both', + add: function (layer) { + + if ($location.path() == "/module-item-view") { + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); + } + }, + dragstop: function (layer) { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + }, + change: function (layer) { + + if ($location.path() == "/module-item-view") { + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + } + }, click: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { //jcanvas property @@ -1876,7 +1997,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - radius: 3 + radius: 7, + click: function () { + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); } @@ -1919,7 +2045,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic strokeStyle: '#c33', strokeWidth: 2, // width: 5, height: 5, - radius: 3 + radius: 7, + click: function () { + if ($location.path() == "/module-item-view") { + + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); } @@ -2196,10 +2328,47 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.TextAreaRectID = layer.name; $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + + if ($location.path() == "/module-item-view") { + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); + } + + // $rootScope.CurrentWidth = layer.width; // $rootScope.CurrentHeight = layer.height; }, + + dragstop: function (layer) { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + }, + change: function (layer) { + + if ($location.path() == "/module-item-view") { + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + } + }, + click: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { //jcanvas property @@ -2212,8 +2381,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); } @@ -2296,8 +2470,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); @@ -2597,7 +2776,24 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var TextAreaLayerName = layer.name; var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_"); $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1]; + if ($location.path() == "/module-item-view") { + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); + } }, + dragstop: function (layer) { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + }, + click: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { @@ -2616,8 +2812,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 7, height: 7, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + debugger; + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } } }).drawLayers(); @@ -2804,10 +3006,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 7, height: 7, + width: 10, height: 10, cornerRadius: 3, click: function () { + debugger $rootScope.isTextAReaRectangleClicked = true; + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } } } @@ -2831,12 +3037,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic x: layer.x, y: layer.y }); - //} $rootScope.textXAxisAftrResize = layer.x; $rootScope.textYAxisAftrResize = layer.y; } } + + if ($location.path() == "/module-item-view") { + + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + debugger; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } + } } }).drawText({ @@ -2937,6 +3158,22 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var TextAreaLayerName = layer.name; var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_"); $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1]; + if ($location.path() == "/module-item-view") { + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); + } + }, + dragstop: function (layer) { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } + } }, click: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { @@ -2956,8 +3193,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 7, height: 7, - cornerRadius: 3 + width: 10, height: 10, + cornerRadius: 3, + click: function () { + debugger; + + if ($location.path() == "/module-item-view") { + $rootScope.isRectangleInAAClicked = true; + } + } + } }).drawLayers(); } @@ -3097,10 +3342,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic fillStyle: '#fff', strokeStyle: '#c33', strokeWidth: 2, - width: 7, height: 7, + width: 10, height: 10, cornerRadius: 3, click: function () { $rootScope.isTextAReaRectangleClickedAftrEdit = true; + if ($location.path() == "/module-item-view") { + debugger; + $rootScope.isRectangleInAAClicked = true; + } } } }).drawLayers(); @@ -3129,6 +3378,24 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic //} $rootScope.editTextXAxisAftrResize = layer.x; $rootScope.editTextYAxisAftrResize = layer.y; + + + } + } + + if ($location.path() == "/module-item-view") { + + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + debugger; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } } } } @@ -3205,14 +3472,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaRectangle).drawLayers(); $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaString).drawLayers(); $rootScope.shapeTypeText = ""; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + + if ($rootScope.canvasLayerNameCollection[0].textareaRectangle == $rootScope.jcanvasObjectArray[i].name) { + + $rootScope.jcanvasObjectArray.splice(i, 1); + + } + // console.log($rootScope.jcanvasObjectArray); + } } else { $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); - } + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.canvasLayerNameCollection == $rootScope.jcanvasObjectArray[i].name) { + $rootScope.jcanvasObjectArray.splice(i, 1); + } + } + } + } } }); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 294fa7b..10ae21c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -173,8 +173,8 @@
- - + +