').appendTo('#bodyViewList');
- $rootScope.currentBodyViewId = $event.currentTarget.id;
- $rootScope.ViewTitle = $event.currentTarget.textContent;
- localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent);
- localStorage.setItem("currentViewTitle", $event.currentTarget.textContent);
- localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
+ $compile($el)($scope);
+ $(".sidebar").mCustomScrollbar({
+ autoHideScrollbar: true,
+ //theme:"rounded"
+ });
- var u = $location.url();
- $location.url('/da-body-view');
+ });
+ }
- var view_list = angular.element($event.currentTarget);
- var view_list_male_female = view_list.attr('title');
+ };
- if (($event.currentTarget.textContent == "Female Anterior" || $event.currentTarget.textContent == "Male Anterior")) {
- $rootScope.AnteriorView = "active";
- $rootScope.LateralView = "";
- $rootScope.MedialView = "";
- $rootScope.PosteriorView = "";
- $rootScope.LateralArmView = "";
- $rootScope.MedialArmView = "";
+ $scope.DisableUI = function () {
+ var daImagePanelConetent = document.getElementsByClassName("jsPanel-content");
+ for (var i = 0; i < daImagePanelConetent.length; i++) {
+ daImagePanelConetent[i].style.pointerEvents = "none";
+ daImagePanelConetent[i].style.opacity = "0.5";
+
+ }
+ //to disbale layer change slider
+ $('.ui-slider').slider('disable');
}
- if (($event.currentTarget.textContent == "Female Lateral" || $event.currentTarget.textContent == "Male Lateral")) {
- $rootScope.AnteriorView = "";
- $rootScope.LateralView = "active";
- $rootScope.MedialView = "";
- $rootScope.PosteriorView = "";
- $rootScope.LateralArmView = "";
- $rootScope.MedialArmView = "";
+ $scope.EnableUI = function () {
- }
- if (($event.currentTarget.textContent == "Female Medial" || $event.currentTarget.textContent == "Male Medial")) {
- $rootScope.AnteriorView = "";
- $rootScope.LateralView = "";
- $rootScope.MedialView = "active";
- $rootScope.PosteriorView = "";
- $rootScope.LateralArmView = "";
- $rootScope.MedialArmView = "";
-
+ var daImagePanelConetent = document.getElementsByClassName("jsPanel-content");
+ for (var i = 0; i < daImagePanelConetent.length; i++) {
+ daImagePanelConetent[i].style.pointerEvents = "auto";
+ daImagePanelConetent[i].style.opacity = "1";
+ }
+ //to enable layer change slider
+ $('.ui-slider').slider('enable');
}
- if (($event.currentTarget.textContent == "Female Posterior" || $event.currentTarget.textContent == "Male Posterior")) {
- $rootScope.AnteriorView = "";
- $rootScope.LateralView = "";
- $rootScope.MedialView = "";
- $rootScope.PosteriorView = "active";
- $rootScope.LateralArmView = "";
- $rootScope.MedialArmView = "";
- }
- if (($event.currentTarget.textContent == "Female Lateral Arm" || $event.currentTarget.textContent == "Male Lateral Arm")) {
- $rootScope.AnteriorView = "";
- $rootScope.LateralView = "";
- $rootScope.MedialView = "";
- $rootScope.PosteriorView = "";
- $rootScope.LateralArmView = "active";
- $rootScope.MedialArmView = "";
+ $scope.openView = function ($event) {
+ $scope.DisableUI();
+ $rootScope.disableAnnotationTB = false;
+ $rootScope.MenuModuleName = "DA";
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- }
- if (($event.currentTarget.textContent == "Female Medial Arm" || $event.currentTarget.textContent == "Male Medial Arm")) {
- $rootScope.AnteriorView = "";
- $rootScope.LateralView = "";
- $rootScope.MedialView = "";
- $rootScope.PosteriorView = "";
- $rootScope.LateralArmView = "";
- $rootScope.MedialArmView = "active";
+ $rootScope.currentBodyViewId = $event.currentTarget.id;
+ $rootScope.ViewTitle = $event.currentTarget.textContent;
+ localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent);
+ localStorage.setItem("currentViewTitle", $event.currentTarget.textContent);
+ localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
- }
+ var u = $location.url();
+ $location.url('/da-body-view');
- //$rootScope.Normal = "LeftButtonsDefaultState";
+ var view_list = angular.element($event.currentTarget);
+ var view_list_male_female = view_list.attr('title');
- if (view_list_male_female == "Male") {
+ if (($event.currentTarget.textContent == "Female Anterior" || $event.currentTarget.textContent == "Male Anterior")) {
+ $rootScope.AnteriorView = "active";
+ $rootScope.LateralView = "";
+ $rootScope.MedialView = "";
+ $rootScope.PosteriorView = "";
+ $rootScope.LateralArmView = "";
+ $rootScope.MedialArmView = "";
+ }
+ if (($event.currentTarget.textContent == "Female Lateral" || $event.currentTarget.textContent == "Male Lateral")) {
+ $rootScope.AnteriorView = "";
+ $rootScope.LateralView = "active";
+ $rootScope.MedialView = "";
+ $rootScope.PosteriorView = "";
+ $rootScope.LateralArmView = "";
+ $rootScope.MedialArmView = "";
- $rootScope.male = "active";
- $rootScope.female = "";
- }
- else {
- $rootScope.male = "";
- $rootScope.female = "active";
- }
+ }
+ if (($event.currentTarget.textContent == "Female Medial" || $event.currentTarget.textContent == "Male Medial")) {
+ $rootScope.AnteriorView = "";
+ $rootScope.LateralView = "";
+ $rootScope.MedialView = "active";
+ $rootScope.PosteriorView = "";
+ $rootScope.LateralArmView = "";
+ $rootScope.MedialArmView = "";
- }
+ }
+ if (($event.currentTarget.textContent == "Female Posterior" || $event.currentTarget.textContent == "Male Posterior")) {
+ $rootScope.AnteriorView = "";
+ $rootScope.LateralView = "";
+ $rootScope.MedialView = "";
+ $rootScope.PosteriorView = "active";
+ $rootScope.LateralArmView = "";
+ $rootScope.MedialArmView = "";
+ }
+ if (($event.currentTarget.textContent == "Female Lateral Arm" || $event.currentTarget.textContent == "Male Lateral Arm")) {
+ $rootScope.AnteriorView = "";
+ $rootScope.LateralView = "";
+ $rootScope.MedialView = "";
+ $rootScope.PosteriorView = "";
+ $rootScope.LateralArmView = "active";
+ $rootScope.MedialArmView = "";
- //load json data for body view
- $scope.loadDissectibleAnatomyData = function () {
- if ($rootScope.refreshcheck == null) {
- $location.path('/');
- }
- //get current path
- var currentURL = $location.path();
- var selectedModuleName = '';
- angular.forEach($rootScope.userModules, function (value, key) {
- if (value.slug === currentURL.replace('/', '')) {
- selectedModuleName = value.name;
- $rootScope.currentActiveModuleTitle = selectedModuleName;
}
- })
+ if (($event.currentTarget.textContent == "Female Medial Arm" || $event.currentTarget.textContent == "Male Medial Arm")) {
+ $rootScope.AnteriorView = "";
+ $rootScope.LateralView = "";
+ $rootScope.MedialView = "";
+ $rootScope.PosteriorView = "";
+ $rootScope.LateralArmView = "";
+ $rootScope.MedialArmView = "active";
- $rootScope.ClearIframe();
+ }
- //load common data
- var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
+ //$rootScope.Normal = "LeftButtonsDefaultState";
- DataService.getAnotherJson(commondataJsonPath)
- .then(
- function (result) {
+ if (view_list_male_female == "Male") {
- $rootScope.CommonData = result;
- $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) {
+ $rootScope.male = "active";
+ $rootScope.female = "";
+ }
+ else {
- $scope.BodyViewData = data;
+ $rootScope.male = "";
+ $rootScope.female = "active";
+ }
- $scope.getDAViewList();
- })
- .error(function (data, status, headers, config) {
- console.log(data);
- });
+ }
- },
- function (error) {
- console.log(error.statusText)
- }
- )
- //load body-views data
+ //load json data for body view
+ $scope.loadDissectibleAnatomyData = function () {
+ if ($rootScope.refreshcheck == null) {
+ $location.path('/');
+ }
+ //get current path
+ var currentURL = $location.path();
+ var selectedModuleName = '';
+ angular.forEach($rootScope.userModules, function (value, key) {
+ if (value.slug === currentURL.replace('/', '')) {
+ selectedModuleName = value.name;
+ $rootScope.currentActiveModuleTitle = selectedModuleName;
+ }
+ })
- // $('#daLoaderLabel').css('visibility', 'hidden')
- $rootScope.isLoading = false;
+ $rootScope.ClearIframe();
+ //load common data
+ var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
- //push the details of open module in array $rootScope.openModules
- $rootScope.openModules.push({ "ModuleId": 1 });
+ DataService.getAnotherJson(commondataJsonPath)
+ .then(
+ function (result) {
+ $rootScope.CommonData = result;
+ $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) {
- }
+ $scope.BodyViewData = data;
+ $scope.getDAViewList();
- //da-body-views functions
+ })
+ .error(function (data, status, headers, config) {
+ console.log(data);
+ });
- $scope.openBodyView = function () {
- //Check if browser 'REFRESHED' or 'RELOADED'
- if ($rootScope.CommonData != null) {
- //0. we will initially append container to load body
- //check if localstorage has any settings
- var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity");
- if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) {
- $rootScope.globalSetting.ethnicity = curentEthnicity;
+ },
+ function (error) {
+ console.log(error.statusText)
}
+ )
+ //load body-views data
- var curentmodesty = $rootScope.getLocalStorageValue("globalModesty");
- if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) {
- $rootScope.globalSetting.modesty = curentmodesty
- }
- //0.1
+ // $('#daLoaderLabel').css('visibility', 'hidden')
+ $rootScope.isLoading = false;
- var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
- if (currentBodyViewId == null || currentBodyViewId == undefined) {
- // document.location = '/';
- document.location = '/';
- $rootScope.isVisibleLogin = true;
- }
- else {
- $rootScope.isVisibleLogin = false;
- $rootScope.loadSearchData();
+ //push the details of open module in array $rootScope.openModules
+ $rootScope.openModules.push({ "ModuleId": 1 });
- console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId);
- var openViews;
- if ($rootScope.openViews != null || $rootScope.openViews != undefined) {
- if ($rootScope.openViews.length > 0) {
- openViews = new jinqJs()
- .from($rootScope.openViews)
- .where("BodyViewId == " + currentBodyViewId)
- .select();
- }
- }
+ }
- // 0.2 getting corresponding body view title
- //var counter = 1;
- var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson");
- localStorage.setItem("currentViewTitle", tittle);
- //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD
- //if (openViews != null && openViews != undefined) {
- // angular.forEach(openViews, function (value, key) {
+ //da-body-views functions
- // if (value.bodyView == tittle) {
- // tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson") + counter++;
- // $rootScope.currentActiveViewTitle = tittle;
- // localStorage.setItem("currentViewTitle", tittle);
- // }
+ $scope.openBodyView = function () {
+ //Check if browser 'REFRESHED' or 'RELOADED'
+ if ($rootScope.CommonData != null) {
+ //0. we will initially append container to load body
- // });
- //}
- //else {
- // localStorage.setItem("currentViewTitle", tittle);
- //}
+ //check if localstorage has any settings
+ var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity");
+ if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) {
+ $rootScope.globalSetting.ethnicity = curentEthnicity;
+ }
+
+ var curentmodesty = $rootScope.getLocalStorageValue("globalModesty");
+ if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) {
+ $rootScope.globalSetting.modesty = curentmodesty
+ }
- //0.3
+ //0.1
- $.jsPanel({
- id: 'daImagePanel',
- selector: '.daBodyView',
- theme: 'success',
- currentController: 'DAController',
- parentSlug: 'da-view-list',
- ajax: {
- url: 'app/views/da/da-view.html'
- },
- title: $rootScope.getLocalStorageValue("currentViewTitle"),
+ var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
+ if (currentBodyViewId == null || currentBodyViewId == undefined) {
+ // document.location = '/';
+ document.location = '/';
+ $rootScope.isVisibleLogin = true;
- position: {
- top: 70,
- left: 1,
- },
+ }
+ else {
+ $rootScope.isVisibleLogin = false;
- size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 },
+ $rootScope.loadSearchData();
- });
+ console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId);
- console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel'))
- //0.1
- $rootScope.currentSlug = 'da-body-view';
+ var openViews;
+ if ($rootScope.openViews != null || $rootScope.openViews != undefined) {
+ if ($rootScope.openViews.length > 0) {
+ openViews = new jinqJs()
+ .from($rootScope.openViews)
+ .where("BodyViewId == " + currentBodyViewId)
+ .select();
+ }
+ }
- //0.2
- $rootScope.openViews.push(
- {
- "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
- "slug": $rootScope.currentSlug
- }
- );
+ // 0.2 getting corresponding body view title
+ //var counter = 1;
+ var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson");
+ localStorage.setItem("currentViewTitle", tittle);
+
+ //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD
+ //if (openViews != null && openViews != undefined) {
+ // angular.forEach(openViews, function (value, key) {
+
+ // if (value.bodyView == tittle) {
+ // tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson") + counter++;
+ // $rootScope.currentActiveViewTitle = tittle;
+ // localStorage.setItem("currentViewTitle", tittle);
+ // }
+
+ // });
+ //}
+ //else {
+ // localStorage.setItem("currentViewTitle", tittle);
+ //}
+
+ //0.3
+
+ $.jsPanel({
+ id: 'daImagePanel',
+ selector: '.daBodyView',
+ theme: 'success',
+ currentController: 'DAController',
+ parentSlug: 'da-view-list',
+ ajax: {
+ url: 'app/views/da/da-view.html'
+ },
+ title: $rootScope.getLocalStorageValue("currentViewTitle"),
+
+ position: {
+ top: 70,
+ left: 1,
+ },
+
+ size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 },
+
+ });
+
+ console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel'))
+ //0.1
+ $rootScope.currentSlug = 'da-body-view';
+
+ //0.2
+ $rootScope.openViews.push(
+ {
+ "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
+ "slug": $rootScope.currentSlug
+ }
+ );
- //0.3
- var daBodyviewElement = angular.element(document.getElementById("daBodyview"));
+ //0.3
+ var daBodyviewElement = angular.element(document.getElementById("daBodyview"));
- $timeout(function () {
- $compile(daBodyviewElement.contents())($scope);
+ $timeout(function () {
+ $compile(daBodyviewElement.contents())($scope);
- console.log('html is compiled' + document.getElementById('daView'))
- if (document.getElementById('daView') != null) {
+ console.log('html is compiled' + document.getElementById('daView'))
+ if (document.getElementById('daView') != null) {
- //0.4 added some stylesheets
- $('#daBodyview').css("height", (parseInt($(window).outerHeight())-62-20));
+ //0.4 added some stylesheets
+ $('#daBodyview').css("height", (parseInt($(window).outerHeight())-62-20));
- $('#daBodyview').css("width", $(window).outerWidth());
+ $('#daBodyview').css("width", $(window).outerWidth());
- //1. load navigator man first
- console.log('before LoadBodyViewNavigatorImage call')
- $scope.LoadBodyViewNavigatorImage();
+ //1. load navigator man first
+ console.log('before LoadBodyViewNavigatorImage call')
+ $scope.LoadBodyViewNavigatorImage();
- //$rootScope.loadSearchData();
+ //$rootScope.loadSearchData();
- $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle");
+ $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle");
- $scope.layerNumber = 0;
+ $scope.layerNumber = 0;
- //2.
+ //2.
- console.log('currentBodyViewId just before sending: ' + currentBodyViewId);
- $scope.loadBodyViewData(currentBodyViewId);
+ console.log('currentBodyViewId just before sending: ' + currentBodyViewId);
+ $scope.loadBodyViewData(currentBodyViewId);
- //2. load bodyRegion data
- $rootScope.isLoading = true;
- $rootScope.voId = $rootScope.getLocalStorageValue("currentBodyViewId");
- }
- //$('#daBodyview').css("height", $(window).outerHeight());
+ //2. load bodyRegion data
+ $rootScope.isLoading = true;
+ $rootScope.voId = $rootScope.getLocalStorageValue("currentBodyViewId");
+ }
+ //$('#daBodyview').css("height", $(window).outerHeight());
- //$('#daBodyview').css("width", $(window).outerWidth());
+ //$('#daBodyview').css("width", $(window).outerWidth());
- if ($('#daImagePanel').offset().top == 0)
- $('#daImagePanel').css("top", '70px');
+ if ($('#daImagePanel').offset().top == 0)
+ $('#daImagePanel').css("top", '70px');
- if ($('#daImagePanel').offset().left == 0)
- $('#daImagePanel').css("left", '1px');
+ if ($('#daImagePanel').offset().left == 0)
+ $('#daImagePanel').css("left", '1px');
- }, 350);
+ }, 350);
+ }
}
- }
- else {
- //for now we are redirecting user to index page on page refresh because on refresh we lost the rootscope data and some of application
- //features stopped working which were depenedent of rootscope data like List manager, annotation toolbar, settings, usermodule list, etc.
-
- $location.path('/');
+ else {
+ //for now we are redirecting user to index page on page refresh because on refresh we lost the rootscope data and some of application
+ //features stopped working which were depenedent of rootscope data like List manager, annotation toolbar, settings, usermodule list, etc.
- /*relaoding unavailable data for resolving refesh issue*/
- /* console.log('Reloading json data for body view => BROWSER REFRESH ISSUE...');
- $scope.loadDissectibleAnatomyData();
+ $location.path('/');
- if ((typeof($rootScope.MenuModuleName) == "undefined") || $rootScope.MenuModuleName == null) {
- $rootScope.MenuModuleName = "DA";
- }*/
+ /*relaoding unavailable data for resolving refesh issue*/
+ /* console.log('Reloading json data for body view => BROWSER REFRESH ISSUE...');
+ $scope.loadDissectibleAnatomyData();
+
+ if ((typeof($rootScope.MenuModuleName) == "undefined") || $rootScope.MenuModuleName == null) {
+ $rootScope.MenuModuleName = "DA";
+ }*/
+ }
}
- }
- angular.element(document).ready(function (e) {
+ angular.element(document).ready(function (e) {
- $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () {
- $rootScope.selectedBodySystemName = 'All';
- $rootScope.selectedBodySystemId = 0;
- $rootScope.searchSelectedText = '';
- });
- $("#layerChangeSlider").slider({
- orientation: "vertical",
- range: "max",
- min: 0,
- value: 0,
- slide: function (event, ui)
- {
- var layerNum;
- var daViewScope = angular.element(document.getElementById("daView")).scope();
- layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber);
- var sliderVal = layerNum - ui.value;
- $("#txtlayerNumber").val(sliderVal);
- },
-
- stop: function (event, ui) {
+ $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () {
+ $rootScope.selectedBodySystemName = 'All';
+ $rootScope.selectedBodySystemId = 0;
+ $rootScope.searchSelectedText = '';
+ });
+ $("#layerChangeSlider").slider({
+ orientation: "vertical",
+ range: "max",
+ min: 0,
+ value: 0,
+ slide: function (event, ui)
+ {
+ var layerNum;
+ var daViewScope = angular.element(document.getElementById("daView")).scope();
+ layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber);
+ var sliderVal = layerNum - ui.value;
+ $("#txtlayerNumber").val(sliderVal);
+ },
+
+ stop: function (event, ui) {
- var la;
- var rootScope = angular.element(document.getElementById("bo")).scope();
- rootScope.$apply(function () {
- rootScope.isLoading = true;
- })
- var scope = angular.element(document.getElementById("daView")).scope();
- scope.$apply(function () {
- if (scope.isTransparencyActivated) {
- rootScope.isLoading = false;
- }
- la = parseInt(scope.totalLayers) //- parseInt(scope.layerNumber);
- var slideVal = la - ui.value;
- $("#txtlayerNumber").val(slideVal);
- scope.layerNumber = slideVal;
- scope.LayerChange();
- $("#annotationpaintbrushsize").removeClass("activebtncolor");
- $("#annotationpainteraser").removeClass("activebtncolor");
- });
- },
+ var la;
+ var rootScope = angular.element(document.getElementById("bo")).scope();
+ rootScope.$apply(function () {
+ rootScope.isLoading = true;
+ })
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ if (scope.isTransparencyActivated) {
+ rootScope.isLoading = false;
+ }
+ la = parseInt(scope.totalLayers) //- parseInt(scope.layerNumber);
+ var slideVal = la - ui.value;
+ $("#txtlayerNumber").val(slideVal);
+ scope.layerNumber = slideVal;
+ scope.LayerChange();
+ $("#annotationpaintbrushsize").removeClass("activebtncolor");
+ $("#annotationpainteraser").removeClass("activebtncolor");
+ });
+ },
- });
+ });
- $("#daImagePanel").resize(function () {
- $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
- $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
- });
+ $("#daImagePanel").resize(function () {
+ $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
+ $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
+ });
- $(document).on("mouseover", "#termList option", function (e) {
- $('#termList option[selected="selected"]').attr("selected", false);
- $(this).attr("selected", true);
- });
+ $(document).on("mouseover", "#termList option", function (e) {
+ $('#termList option[selected="selected"]').attr("selected", false);
+ $(this).attr("selected", true);
+ });
- $(document).keypress(function (e) {
- if ($('#termList option[selected="selected"]').attr("id") == "undefined") {
- return false;
- }
- else {
- var originator = e.keyCode || e.which;
- // alert($('#termList option[selected="selected"]').attr("id"));
- if ($('#termList option[selected="selected"]').attr("id")) {
- if (e.keyCode == 13) {
- onListManagerTermSelection($('#termList option[selected="selected"]').attr("id"));
+ $(document).keypress(function (e) {
+ if ($('#termList option[selected="selected"]').attr("id") == "undefined") {
+ return false;
+ }
+ else {
+ var originator = e.keyCode || e.which;
+ // alert($('#termList option[selected="selected"]').attr("id"));
+ if ($('#termList option[selected="selected"]').attr("id")) {
+ if (e.keyCode == 13) {
+ onListManagerTermSelection($('#termList option[selected="selected"]').attr("id"));
+ }
}
}
- }
- });
+ });
- })
- // $rootScope.languageArray = [];
- $rootScope.loadSearchData = function () {
- var primaryLexiconIndex;
- var languageArray = [];
- $rootScope.vocabTermDataArray = [];
- var languageArray = $rootScope.lexiconLanguageArray;
+ })
+ // $rootScope.languageArray = [];
+ $rootScope.loadSearchData = function () {
+ var primaryLexiconIndex;
+ var languageArray = [];
+ $rootScope.vocabTermDataArray = [];
+ var languageArray = $rootScope.lexiconLanguageArray;
- console.log(languageArray.length);
- console.log('loadSearchDataForBodyView');
+ console.log(languageArray.length);
+ console.log('loadSearchDataForBodyView');
- var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
+ var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
- for (var i = 0; i <= languageArray.length - 1; i++) {
- var searchWorker = new Worker('search-wp.js');
+ for (var i = 0; i <= languageArray.length - 1; i++) {
+ var searchWorker = new Worker('search-wp.js');
- //push workers in array to further used the refernece to delete the workers
- $scope.runningSearchWorkers.push({ 'workerName': searchWorker })
+ //push workers in array to further used the refernece to delete the workers
+ $scope.runningSearchWorkers.push({ 'workerName': searchWorker })
- //console.log('for bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
+ //console.log('for bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
- searchWorker.postMessage({
+ searchWorker.postMessage({
- 'currentBodyViewId': currentBodyViewId,
- 'languageName': languageArray[i].language,
- 'languageID': languageArray[i].id
- })
+ 'currentBodyViewId': currentBodyViewId,
+ 'languageName': languageArray[i].language,
+ 'languageID': languageArray[i].id
+ })
- searchWorker.onmessage = function (e) {
+ searchWorker.onmessage = function (e) {
- //console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
- $rootScope.TermNumberData = e.data.TermNumberData;
- console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length);
- $rootScope.VocabTermData = e.data.VocabTermData,//same
- $scope.vocabTermTxt = e.data.vocabTermTxt,
- $scope.vocabLanguage = e.data.language,
- $rootScope.vocabTermDataArray.push({ "language": $scope.vocabLanguage, "VocabTermData": $rootScope.VocabTermData, "vocabTermTxt": $scope.vocabTermTxt });
+ //console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
+ $rootScope.TermNumberData = e.data.TermNumberData;
+ console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length);
+ $rootScope.VocabTermData = e.data.VocabTermData,//same
+ $scope.vocabTermTxt = e.data.vocabTermTxt,
+ $scope.vocabLanguage = e.data.language,
+ $rootScope.vocabTermDataArray.push({ "language": $scope.vocabLanguage, "VocabTermData": $rootScope.VocabTermData, "vocabTermTxt": $scope.vocabTermTxt });
- for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) {
+ for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) {
- $rootScope.vocabTermDataArray[i].vocabTermTxt = new jinqJs()
- .from($rootScope.vocabTermDataArray[i].vocabTermTxt)
- .distinct('_TermText', '_ActualTermNumber')
- .orderBy([{ field: '_TermText', sort: 'asc' }])
- .select('_ActualTermNumber', '_TermText', '_cdId');
+ $rootScope.vocabTermDataArray[i].vocabTermTxt = new jinqJs()
+ .from($rootScope.vocabTermDataArray[i].vocabTermTxt)
+ .distinct('_TermText', '_ActualTermNumber')
+ .orderBy([{ field: '_TermText', sort: 'asc' }])
+ .select('_ActualTermNumber', '_TermText', '_cdId');
- // console.log("Language= " + $rootScope.lexiconLanguageArray[i].language + ", vocabTermTxt= " + $rootScope.vocabTermDataArray[i].vocabTermTxt[0]._TermText);
+ // console.log("Language= " + $rootScope.lexiconLanguageArray[i].language + ", vocabTermTxt= " + $rootScope.vocabTermDataArray[i].vocabTermTxt[0]._TermText);
- }
+ }
- if ($rootScope.vocabTermDataArray.length == $rootScope.lexiconLanguageArray.length) {
- $("#setting-spinner").css("display", "none");
+ if ($rootScope.vocabTermDataArray.length == $rootScope.lexiconLanguageArray.length) {
+ $("#setting-spinner").css("display", "none");
- for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) {
- if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
- primaryLexiconIndex = i;
+ for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) {
+ if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
+ primaryLexiconIndex = i;
+ }
+ }
+ //alert(primaryLexiconIndex);
+ if ($rootScope.isListManagerMenuSelected) {
+ $scope.loadListManger();
+ }
}
- }
- //alert(primaryLexiconIndex);
- if ($rootScope.isListManagerMenuSelected) {
- $scope.loadListManger();
- }
- }
- console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
+ console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
- if ($scope.runningSearchWorkers != null || $scope.runningSearchWorkers != undefined) {
+ if ($scope.runningSearchWorkers != null || $scope.runningSearchWorkers != undefined) {
- var workerCount = $scope.runningSearchWorkers.length;
- if (workerCount > 0) {
- for (var i = workerCount - 1; i >= 0; i--) {
+ var workerCount = $scope.runningSearchWorkers.length;
+ if (workerCount > 0) {
+ for (var i = workerCount - 1; i >= 0; i--) {
- var runningWorker = $scope.runningSearchWorkers[i].workerName;
- runningWorker.terminate();
- $scope.runningSearchWorkers.splice(i, 1);
- // workerCount--;
+ var runningWorker = $scope.runningSearchWorkers[i].workerName;
+ runningWorker.terminate();
+ $scope.runningSearchWorkers.splice(i, 1);
+ // workerCount--;
+ }
}
}
}
- }
- //console.log("s" + $rootScope.vocabTermDataArray);
- //call watch on '$scope.VocabTermTxt and compile
and append to
on first time load
- //$scope.$watch('$rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt', function (newValue, oldValue, scope) {
+ //console.log("s" + $rootScope.vocabTermDataArray);
+ //call watch on '$scope.VocabTermTxt and compile
and append to
on first time load
+ //$scope.$watch('$rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt', function (newValue, oldValue, scope) {
- //}, true);
+ //}, true);
+
+ }
}
- }
+ $scope.loadBodyViewData = function (currentVoid) {
+ console.log('caller of worker sending currentVoid: ' + currentVoid);
- $scope.loadBodyViewData = function (currentVoid) {
- console.log('caller of worker sending currentVoid: ' + currentVoid);
+ var bodyViewWorker = new Worker('body-view-wp.js');
- var bodyViewWorker = new Worker('body-view-wp.js');
+ //push workers in array to further used the refernece to delete the workers
+ $scope.runningBodyViewWorkers.push({ 'workerName': bodyViewWorker })
- //push workers in array to further used the refernece to delete the workers
- $scope.runningBodyViewWorkers.push({ 'workerName': bodyViewWorker })
+ bodyViewWorker.postMessage({
- bodyViewWorker.postMessage({
+ 'currentViewId': currentVoid
- 'currentViewId': currentVoid
+ });
- });
+ bodyViewWorker.onmessage = function (e) {
+ //console.log('callback in extr');
- bodyViewWorker.onmessage = function (e) {
- //console.log('callback in extr');
+ $rootScope.BodyRegionData = e.data.bodyRegionData;
+ $rootScope.bgartData = e.data.bodyArtData;
+ $rootScope.BodyLayerData = e.data.bodyLayerData;
- $rootScope.BodyRegionData = e.data.bodyRegionData;
- $rootScope.bgartData = e.data.bodyArtData;
- $rootScope.BodyLayerData = e.data.bodyLayerData;
+ var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
- var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
+ //set max for LayerNumber input
+ $rootScope.totalLayers = dataLength - 1;
- //set max for LayerNumber input
- $rootScope.totalLayers = dataLength - 1;
+ $('#txtLayerNumber').attr('max', $rootScope.totalLayers);
+ $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers);
- $('#txtLayerNumber').attr('max', $rootScope.totalLayers);
- $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers);
+ $scope.isBodylayerdataLoaded = true;
- $scope.isBodylayerdataLoaded = true;
+ $scope.LoadDefaultLayerImage();
+ }
- $scope.LoadDefaultLayerImage();
+ bodyViewWorker.onerror = function (e) {
+ alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
+ };
}
- bodyViewWorker.onerror = function (e) {
- alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
- };
- }
+ //Code for displaying NavigatorImage for BodyView
+ $scope.LoadBodyViewNavigatorImage = function () {
- //Code for displaying NavigatorImage for BodyView
- $scope.LoadBodyViewNavigatorImage = function () {
+ if ($rootScope.currentBodyViewId == undefined || $rootScope.currentBodyViewId == null) {
+ $rootScope.currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
+ }
+ console.log('insideLoadBodyViewNavigatorImage')
+ var NavigatorManJsonPath = '~/../content/data/json/da/da_dat_orient_image.json';
- if ($rootScope.currentBodyViewId == undefined || $rootScope.currentBodyViewId == null) {
- $rootScope.currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId");
- }
- console.log('insideLoadBodyViewNavigatorImage')
- var NavigatorManJsonPath = '~/../content/data/json/da/da_dat_orient_image.json';
+ $http({ method: 'GET', url: NavigatorManJsonPath })
+ .success(function (data) {
+ $rootScope.NavigatorData = data;
- $http({ method: 'GET', url: NavigatorManJsonPath })
- .success(function (data) {
- $rootScope.NavigatorData = data;
+ $scope.skinTone = $rootScope.globalSetting.ethnicity;
- $scope.skinTone = $rootScope.globalSetting.ethnicity;
+ var navigatorManData = new jinqJs()
+ .from($rootScope.NavigatorData.Navigtor.ViewOrientation)
+ .where("_ViewOrientationId == " + $rootScope.currentBodyViewId)
+ .select();
+
+ if ((navigatorManData != null || navigatorManData != undefined) && (navigatorManData.length > 0)) {
- var navigatorManData = new jinqJs()
- .from($rootScope.NavigatorData.Navigtor.ViewOrientation)
- .where("_ViewOrientationId == " + $rootScope.currentBodyViewId)
- .select();
- if ((navigatorManData != null || navigatorManData != undefined) && (navigatorManData.length > 0)) {
+ var imageInfoForNavigator = new jinqJs()
+ .from(navigatorManData[0].ImageInfo)
+ .where("_Ethnicity == " + $scope.skinTone)
+ .select();
+ }
+ else {
+ console.log('NAVIGATOR.DATA.NOT.FOUND FOR BODY VIEW: ' + $rootScope.currentBodyViewId);
+ }
+ if (imageInfoForNavigator != null || imageInfoForNavigator != undefined) {
+ $scope.navigatorImage = imageInfoForNavigator;
- var imageInfoForNavigator = new jinqJs()
- .from(navigatorManData[0].ImageInfo)
- .where("_Ethnicity == " + $scope.skinTone)
- .select();
- }
- else {
- console.log('NAVIGATOR.DATA.NOT.FOUND FOR BODY VIEW: ' + $rootScope.currentBodyViewId);
- }
- if (imageInfoForNavigator != null || imageInfoForNavigator != undefined) {
- $scope.navigatorImage = imageInfoForNavigator;
+ var navImageModesty;
+
+ if (($scope.navigatorImage != null || $scope.navigatorImage != undefined) && ($scope.navigatorImage.length > 0)) {
+ angular.forEach($scope.navigatorImage, function (value, key) {
+ if (value._HaveModesty === $rootScope.globalSetting.modesty) {
+ navImageModesty = value._ImageName;
+ }
+ })
+ }
+ if (typeof (navImageModesty) === "undefined" || navImageModesty === null) {
- var navImageModesty;
+ navImageModesty = $scope.navigatorImage[0]._ImageName;
+ }
- if (($scope.navigatorImage != null || $scope.navigatorImage != undefined) && ($scope.navigatorImage.length > 0)) {
- angular.forEach($scope.navigatorImage, function (value, key) {
+ // $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty;
+ document.getElementById('navimg').src = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty;
- if (value._HaveModesty === $rootScope.globalSetting.modesty) {
- navImageModesty = value._ImageName;
- }
- })
+ $('#navigatorDiv').css('visibility', 'visible');
+
+ $('#containment - wrapper').css('visibility', 'visible');
}
- if (typeof (navImageModesty) === "undefined" || navImageModesty === null) {
- navImageModesty = $scope.navigatorImage[0]._ImageName;
+ else {
+ console.log('NAVIGATOR.IMAGE.NOT.FOUND FOR BODY VIEW: ' + $rootScope.currentBodyViewId);
}
+ })
- // $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty;
- document.getElementById('navimg').src = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty;
+ .error(function (data, status, headers, config) {
+ //1.
+ console.log('DATA.NOT.LOADED FOR:' + NavigatorManJsonPath + ', ERROR: ' + data);
+ //2.
+ // $scope.LoadBodyViewNavigatorImage()
+ });
+ }
- $('#navigatorDiv').css('visibility', 'visible');
- $('#containment - wrapper').css('visibility', 'visible');
- }
+ $scope.LoadDefaultLayerImage = function () {
+ console.log('inside LoadDefaultLayerImage')
+ $rootScope.isNormalMode = true;
- else {
- console.log('NAVIGATOR.IMAGE.NOT.FOUND FOR BODY VIEW: ' + $rootScope.currentBodyViewId);
+ $scope.layerNumber = 0;
+ $scope.skinTone = $rootScope.globalSetting.ethnicity;
+
+ //viewOrientationId is to pic coordinates of view and void is to pic iamge name from resopective json
+ $rootScope.viewOrientationId = $rootScope.voId;
+ if ($rootScope.voId == 5) {
+ $rootScope.viewOrientationId = 1;
+ }
+ else if ($rootScope.voId == 6) {
+ $rootScope.viewOrientationId = 2;
+ }
+ else if ($rootScope.voId == 7) {
+ $rootScope.viewOrientationId = 3;
+ }
+ else if ($rootScope.voId == 8) {
+ $rootScope.viewOrientationId = 4;
+ }
+ else if ($rootScope.voId == 9) {
+ $rootScope.viewOrientationId = 5;
+ }
+ else if ($rootScope.voId == 10) {
+ $rootScope.viewOrientationId = 6;
+ }
+ else if ($rootScope.voId == 11) {
+ $rootScope.viewOrientationId = 5;
+ }
+ else if ($rootScope.voId == 12) {
+ $rootScope.viewOrientationId = 6;
}
- })
- .error(function (data, status, headers, config) {
- //1.
- console.log('DATA.NOT.LOADED FOR:' + NavigatorManJsonPath + ', ERROR: ' + data);
- //2.
- // $scope.LoadBodyViewNavigatorImage()
- });
- }
+ $scope.CalculateImageCordinates($rootScope.viewOrientationId);
- $scope.LoadDefaultLayerImage = function () {
- console.log('inside LoadDefaultLayerImage')
- $rootScope.isNormalMode = true;
+ };
- $scope.layerNumber = 0;
- $scope.skinTone = $rootScope.globalSetting.ethnicity;
-
- //viewOrientationId is to pic coordinates of view and void is to pic iamge name from resopective json
- $rootScope.viewOrientationId = $rootScope.voId;
- if ($rootScope.voId == 5) {
- $rootScope.viewOrientationId = 1;
- }
- else if ($rootScope.voId == 6) {
- $rootScope.viewOrientationId = 2;
- }
- else if ($rootScope.voId == 7) {
- $rootScope.viewOrientationId = 3;
- }
- else if ($rootScope.voId == 8) {
- $rootScope.viewOrientationId = 4;
- }
- else if ($rootScope.voId == 9) {
- $rootScope.viewOrientationId = 5;
- }
- else if ($rootScope.voId == 10) {
- $rootScope.viewOrientationId = 6;
- }
- else if ($rootScope.voId == 11) {
- $rootScope.viewOrientationId = 5;
- }
- else if ($rootScope.voId == 12) {
- $rootScope.viewOrientationId = 6;
- }
-
- $scope.CalculateImageCordinates($rootScope.viewOrientationId);
-
-
- };
+ //calculate coordinates for body region images
+ $scope.CalculateImageCordinates = function (viewOrientationId) {
+ $scope.layerInfoForModesty = [];
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ $scope.modestyImageInfo = [];
+ // annotation toolbar canvas
- //calculate coordinates for body region images
- $scope.CalculateImageCordinates = function (viewOrientationId) {
- $scope.layerInfoForModesty = [];
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
- $scope.modestyImageInfo = [];
- // annotation toolbar canvas
+ $scope.terminateCurrentlyRunningWPs();
- $scope.terminateCurrentlyRunningWPs();
+ var drawnBodyRegionCount = [];
- var drawnBodyRegionCount = [];
+ if ($rootScope.MaskCanvasData != null || $rootScope.MaskCanvasData != undefined) {
+ var n = $rootScope.MaskCanvasData.length;
- if ($rootScope.MaskCanvasData != null || $rootScope.MaskCanvasData != undefined) {
- var n = $rootScope.MaskCanvasData.length;
+ if (n > 0) {
+ for (var i = n - 1; i >= 0; i--) {
- if (n > 0) {
- for (var i = n - 1; i >= 0; i--) {
+ $rootScope.MaskCanvasData.splice(i, 1);
+ // workerCount--;
+ }
- $rootScope.MaskCanvasData.splice(i, 1);
- // workerCount--;
+ $rootScope.MaskCanvasData = null;
+ $rootScope.MaskCanvasData = [];
}
-
- $rootScope.MaskCanvasData = null;
- $rootScope.MaskCanvasData = [];
}
- }
- //set height of canvas div and left tool bar as per window size
- $rootScope.BodyRegionCordinatesData = []; // create an empty array
+ //set height of canvas div and left tool bar as per window size
+ $rootScope.BodyRegionCordinatesData = []; // create an empty array
+
+ $('#daBodyview').css('width', '100%');
+ var canvasDIvHeight = parseInt($('#daImagePanel').outerHeight()) - 104;
+ $('#canvasDiv').css('height', canvasDIvHeight);
+ $('#leftToolBar').css('height', $('#daImagePanel').outerHeight())
- $('#daBodyview').css('width', '100%');
- var canvasDIvHeight = parseInt($('#daImagePanel').outerHeight()) - 104;
- $('#canvasDiv').css('height', canvasDIvHeight);
- $('#leftToolBar').css('height', $('#daImagePanel').outerHeight())
+ //calculate image coordinates and draw image
+ var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews;
+ // var viewOrientationId = String($rootScope.voId);
- //calculate image coordinates and draw image
- var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews;
- // var viewOrientationId = String($rootScope.voId);
+ $scope.bodyRegionCoordinates = new jinqJs()
+ .from($rootScope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
+ .where('_ViewOrientationId == ' + viewOrientationId)
+ .select();
- $scope.bodyRegionCoordinates = new jinqJs()
- .from($rootScope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
- .where('_ViewOrientationId == ' + viewOrientationId)
- .select();
+ console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + $scope.bodyRegionCoordinates.length)
+ // if ($rootScope.voId == 9 || $rootScope.voId == 11) {
- console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + $scope.bodyRegionCoordinates.length)
- // if ($rootScope.voId == 9 || $rootScope.voId == 11) {
+ $scope.bagartDetails = new jinqJs()
+ .from($rootScope.bgartData.BackgroundArts.BackgroundArtDetail)
+ .where('_ViewOrientationId == ' + viewOrientationId)
+ .select();
- $scope.bagartDetails = new jinqJs()
- .from($rootScope.bgartData.BackgroundArts.BackgroundArtDetail)
- .where('_ViewOrientationId == ' + viewOrientationId)
- .select();
+ //remove existing body view
+ var canDiv = document.getElementById('canvasDiv');
+ var canDivChildCount = canDiv.childElementCount;
+ if (canDivChildCount > 0) {
- //remove existing body view
- var canDiv = document.getElementById('canvasDiv');
- var canDivChildCount = canDiv.childElementCount;
- if (canDivChildCount > 0) {
+ if ($rootScope.isTransparencyActivated) {
+ $scope.flushCanvas();
+ $('#transparencyScale').css('visibility', 'visible');
+ }
+ else {
+ canDiv.innerHTML = '';
+ //remove transparency scale
+ $('#transparencyScale').css('visibility', 'hidden');
+ }
+
+ }
- if ($rootScope.isTransparencyActivated) {
- $scope.flushCanvas();
- $('#transparencyScale').css('visibility', 'visible');
+ if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) {
+ $scope.ColoredImageSRC = null;
+ $scope.ColoredImageSRC = [];
+ console.log('COLOREDIMAGESRC length = ' + $scope.ColoredImageSRC.length);
+ // $scope.flushCanvas();
}
else {
- canDiv.innerHTML = '';
- //remove transparency scale
- $('#transparencyScale').css('visibility', 'hidden');
+ $scope.ColoredImageSRC = [];
}
-
- }
-
- if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) {
- $scope.ColoredImageSRC = null;
- $scope.ColoredImageSRC = [];
- console.log('COLOREDIMAGESRC length = ' + $scope.ColoredImageSRC.length);
- // $scope.flushCanvas();
- }
- else {
- $scope.ColoredImageSRC = [];
- }
- if ($rootScope.updatedGrayDataList != null && $rootScope.updatedGrayDataList != undefined) {
- $rootScope.updatedGrayDataList = [];
- }
- if ($rootScope.updatedGrayMRDataList != null && $rootScope.updatedGrayMRDataList != undefined) {
- $rootScope.updatedGrayMRDataList = [];
- }
- if ($rootScope.grayImageDataList != null && $rootScope.grayImageDataList != undefined) {
- $rootScope.grayImageDataList = [];
- }
- if ($rootScope.grayImageMRDataList != null && $rootScope.grayImageMRDataList != undefined) {
- $rootScope.grayImageMRDataList = [];
- }
- //history code
+ if ($rootScope.updatedGrayDataList != null && $rootScope.updatedGrayDataList != undefined) {
+ $rootScope.updatedGrayDataList = [];
+ }
+ if ($rootScope.updatedGrayMRDataList != null && $rootScope.updatedGrayMRDataList != undefined) {
+ $rootScope.updatedGrayMRDataList = [];
+ }
+ if ($rootScope.grayImageDataList != null && $rootScope.grayImageDataList != undefined) {
+ $rootScope.grayImageDataList = [];
+ }
+ if ($rootScope.grayImageMRDataList != null && $rootScope.grayImageMRDataList != undefined) {
+ $rootScope.grayImageMRDataList = [];
+ }
+ //history code
- if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
- var ATBarHtml = $("#canvasDiv").append('');
- $compile(ATBarHtml)($scope);
- $scope.onDrawingCanvasClick();
- // $rootScope.FreeStylePaint();
+ if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
+ var ATBarHtml = $("#canvasDiv").append('');
+ $compile(ATBarHtml)($scope);
+ $scope.onDrawingCanvasClick();
+ // $rootScope.FreeStylePaint();
- }
+ }
- if ($rootScope.getLocalStorageValue("zoomInOutValue") != undefined)
- $rootScope.zoomInOut = $rootScope.getLocalStorageValue("zoomInOutValue");
+ if ($rootScope.getLocalStorageValue("zoomInOutValue") != undefined)
+ $rootScope.zoomInOut = $rootScope.getLocalStorageValue("zoomInOutValue");
- if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) {
- angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
+ if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) {
+ angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
- if (value._HaveMirrorImage == 'Y') {
+ if (value._HaveMirrorImage == 'Y') {
- //DrawMirroredImage
+ //DrawMirroredImage
- //0. Scaling as per default zoom
- var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
+ //0. Scaling as per default zoom
+ var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
- //1.Get image source
- var src = $scope.GetImageSource(value._BodyRegionId);
+ //1.Get image source
+ var src = $scope.GetImageSource(value._BodyRegionId);
- $scope.imageSource = src;
+ $scope.imageSource = src;
- //2.Draw mirror image
- $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
+ //2.Draw mirror image
+ $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
- $rootScope.BodyRegionCordinatesData.push(
- {
- "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
- "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'Yes'
- }
- );
-
- //3.GetMaskImageSource
- var maskImageSrc = $scope.GetMaskImageSource($scope.imageSource);
+ $rootScope.BodyRegionCordinatesData.push(
+ {
+ "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
+ "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'Yes'
+ }
+ );
+
+ //3.GetMaskImageSource
+ var maskImageSrc = $scope.GetMaskImageSource($scope.imageSource);
- //4 Draw Mask Mirror Image
- $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y');
-
+ //4 Draw Mask Mirror Image
+ $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y');
- //Draw Normal Image
- //0. Scaling as per default zoom
- var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, 0);
+ //Draw Normal Image
+ //0. Scaling as per default zoom
+ var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, 0);
- //1.Draw body region which have mirror image
- $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
- $scope.BodyRegionCordinatesData.push(
- {
- "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
- "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No'
- }
- );
-
- //2.Draw body region for mask image
- $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y');
+ //1.Draw body region which have mirror image
+ $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
+ $scope.BodyRegionCordinatesData.push(
+ {
+ "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
+ "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No'
+ }
+ );
- }
- else {
+ //2.Draw body region for mask image
+ $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y');
- //0.Scaling as per default zoom
- var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
- //1.Get image source
- if (value._IsPrimary == 'N') {
- var src = $scope.GetBackgroundImgSource(value._BodyRegionId);
- $scope.imageSource = src;
}
else {
- var src = $scope.GetImageSource(value._BodyRegionId);
- $scope.imageSource = src;
- }
- //2.Draw body region which don't have mirror image
- $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
+ //0.Scaling as per default zoom
+ var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
- $scope.BodyRegionCordinatesData.push(
- {
- "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
- "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No'
- }
- );
+ //1.Get image source
+ if (value._IsPrimary == 'N') {
+ var src = $scope.GetBackgroundImgSource(value._BodyRegionId);
+ $scope.imageSource = src;
+ }
+ else {
+ var src = $scope.GetImageSource(value._BodyRegionId);
+ $scope.imageSource = src;
+ }
- //3.GetMaskImageSource
- var maskSRC = $scope.GetMaskImageSource($scope.imageSource);
+ //2.Draw body region which don't have mirror image
+ $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
- //4.Draw body region for mask image
- $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y');
+ $scope.BodyRegionCordinatesData.push(
+ {
+ "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
+ "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No'
+ }
+ );
+ //3.GetMaskImageSource
+ var maskSRC = $scope.GetMaskImageSource($scope.imageSource);
- //draw figLeaf for modesty
+ //4.Draw body region for mask image
+ $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y');
- $scope.figLaefImageName;
- $scope.figLaefX;
- $scope.figLaefY;
- var gender;
- if ($rootScope.getLocalStorageValue("genderId") == 'Female') {
- gender = 'F';
- }
- else {
- gender = 'M';
- }
- if ((($rootScope.getLocalStorageValue("genderId") == 'Female') && (value._BodyRegionId == 2)) || (value._BodyRegionId == 3)) {
+ //draw figLeaf for modesty
- if ($scope.bagartDetails != null || $scope.bagartDetails != undefined) {
- var dtlOfBr = new jinqJs()
- .from($scope.bagartDetails)
- .where('_BodyRegionId == ' + value._BodyRegionId)
- .select();
- if (dtlOfBr != null || dtlOfBr != undefined) {
+ $scope.figLaefImageName;
+ $scope.figLaefX;
+ $scope.figLaefY;
+ var gender;
+ if ($rootScope.getLocalStorageValue("genderId") == 'Female') {
+ gender = 'F';
- var dtlOfGender = new jinqJs()
- .from(dtlOfBr)
- .where('_Gender == ' + gender)
- .select();
- if (dtlOfGender != null || dtlOfGender != undefined) {
+ }
+ else {
+ gender = 'M';
+ }
+ if ((($rootScope.getLocalStorageValue("genderId") == 'Female') && (value._BodyRegionId == 2)) || (value._BodyRegionId == 3)) {
- var dtlOfSktn = new jinqJs()
- .from(dtlOfGender)
- .where('_Skintone == +')
- .select();
+ if ($scope.bagartDetails != null || $scope.bagartDetails != undefined) {
+ var dtlOfBr = new jinqJs()
+ .from($scope.bagartDetails)
+ .where('_BodyRegionId == ' + value._BodyRegionId)
+ .select();
+ if (dtlOfBr != null || dtlOfBr != undefined) {
- //multiple conditions are not working in where clause of JinQ so need multiple filtered variables
+ var dtlOfGender = new jinqJs()
+ .from(dtlOfBr)
+ .where('_Gender == ' + gender)
+ .select();
+ if (dtlOfGender != null || dtlOfGender != undefined) {
+ var dtlOfSktn = new jinqJs()
+ .from(dtlOfGender)
+ .where('_Skintone == +')
+ .select();
- if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) {
+ //multiple conditions are not working in where clause of JinQ so need multiple filtered variables
- if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
- $scope.figLaefImageName = dtlOfSktn[0]._ImageId;
+ if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) {
+ if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
- $scope.lowerlayerNumberForModesty = dtlOfSktn[0]._lns;
- $scope.HigherlayerNumberForModesty = dtlOfSktn[0]._lne;
- $scope.layerInfoForModesty.push({ "bodyRegionId": value._BodyRegionId, "lowerlayerNumberForModesty": $scope.lowerlayerNumberForModesty, "HigherlayerNumberForModesty": $scope.HigherlayerNumberForModesty })
+ $scope.figLaefImageName = dtlOfSktn[0]._ImageId;
- var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
+ $scope.lowerlayerNumberForModesty = dtlOfSktn[0]._lns;
+ $scope.HigherlayerNumberForModesty = dtlOfSktn[0]._lne;
+ $scope.layerInfoForModesty.push({ "bodyRegionId": value._BodyRegionId, "lowerlayerNumberForModesty": $scope.lowerlayerNumberForModesty, "HigherlayerNumberForModesty": $scope.HigherlayerNumberForModesty })
- var src = "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName;
+ var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
- $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N')
+ var src = "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName;
+
+ $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N')
+
+ }
}
}
}
- }
- }
+ }
+ }
}
- }
- });
+ });
- //$rootScope.isLoading = false;
- //$('#spinner').css('visibility', 'hidden');
- }
+ //$rootScope.isLoading = false;
+ //$('#spinner').css('visibility', 'hidden');
+ }
- if (($rootScope.globalSetting.modesty == 'Y')) {
- if ($('.modestyImg') != null) {
- $('.modestyImg').css('visibility', 'visible');
+ if (($rootScope.globalSetting.modesty == 'Y')) {
+ if ($('.modestyImg') != null) {
+ $('.modestyImg').css('visibility', 'visible');
+ }
}
- }
- //set scrollbars on canvas and hide loading label
+ //set scrollbars on canvas and hide loading label
- // var isiOSSafari = (navigator.userAgent.match(/like Mac OS X/i)) ? true : false;
- var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false;
+ // var isiOSSafari = (navigator.userAgent.match(/like Mac OS X/i)) ? true : false;
+ var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false;
- //set scrollbars on canvas and hide loading label
- $('#daLoaderLabel').css('visibility', 'hidden')
+ //set scrollbars on canvas and hide loading label
+ $('#daLoaderLabel').css('visibility', 'hidden')
- $('#canvasDiv').css('overflow', 'scroll')
- if (isiOSSafari) {
- $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150)
+ $('#canvasDiv').css('overflow', 'scroll')
+ if (isiOSSafari) {
+ $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150)
- }
- else {
- $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
- }
+ }
+ else {
+ $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
+ }
- // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
- $('#canvasDiv').scrollTop(50)
- var abc = $rootScope.BodyRegionCordinatesData;
+ // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
+ $('#canvasDiv').scrollTop(50)
+ var abc = $rootScope.BodyRegionCordinatesData;
- $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
- // $('#spinner').css('visibility', 'hidden');
- $rootScope.isLoading = false;
- //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top.
- // #4976 :While changing gender male to female scroll bar is going on top.
- var canvasDiv = document.getElementById('canvasDiv');
- if (canvasDiv != null || canvasDiv != undefined) {
- canvasDiv.scrollTop = 0;
+ $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
+ // $('#spinner').css('visibility', 'hidden');
+ $rootScope.isLoading = false;
+ //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top.
+ // #4976 :While changing gender male to female scroll bar is going on top.
+ var canvasDiv = document.getElementById('canvasDiv');
+ if (canvasDiv != null || canvasDiv != undefined) {
+ canvasDiv.scrollTop = 0;
- //Navigator Code for dynamically calculating the height and width of Dragable Div on Navigator Image
+ //Navigator Code for dynamically calculating the height and width of Dragable Div on Navigator Image
- var dragdivh = Math.floor(($('#canvasDiv').height() / $('#canvasDiv')[0].scrollHeight) * 119) //119px is the height of the image
+ var dragdivh = Math.floor(($('#canvasDiv').height() / $('#canvasDiv')[0].scrollHeight) * 119) //119px is the height of the image
- if ($('#canvasDiv')[0].scrollWidth > $('#canvasDiv')[0].clientWidth) {
+ if ($('#canvasDiv')[0].scrollWidth > $('#canvasDiv')[0].clientWidth) {
- var dragdivw = 42
- $scope.dragdivleft = 21;
- $scope.dragdivtop = 0;
- }
- else {
- var dragdivw = 83;
+ var dragdivw = 42
+ $scope.dragdivleft = 21;
+ $scope.dragdivtop = 0;
+ }
+ else {
+ var dragdivw = 83;
- $scope.dragdivleft = 0;
- $scope.dragdivtop = 0;
+ $scope.dragdivleft = 0;
+ $scope.dragdivtop = 0;
+ }
}
- }
- $(".dragdivposition").css("left", $scope.dragdivleft);
- $(".dragdivposition").css("top", $scope.dragdivtop);
+ $(".dragdivposition").css("left", $scope.dragdivleft);
+ $(".dragdivposition").css("top", $scope.dragdivtop);
- $('#draggable').css('width', dragdivw);
- $('#draggable').css('height', dragdivh)
+ $('#draggable').css('width', dragdivw);
+ $('#draggable').css('height', dragdivh)
- }
+ }
- function scaleRectangle(x, y, height, width, mirrorValue) {
- var nzoom = $rootScope.zoomInOut;
- var existingZoon = 100;
+ function scaleRectangle(x, y, height, width, mirrorValue) {
+ var nzoom = $rootScope.zoomInOut;
+ var existingZoon = 100;
- var X = 0;
- var scaledY = 0;
- var scaledHeight = 0;
- var scaledWidth = 0;
+ var X = 0;
+ var scaledY = 0;
+ var scaledHeight = 0;
+ var scaledWidth = 0;
- if (mirrorValue != 0) {
- var mirroredX = parseInt(mirrorValue) + parseInt(x);
- var newX = (mirroredX * nzoom);
- mirroredX = (newX / existingZoon);
- X = mirroredX;
- }
- else {
- var newX = (x * nzoom);
- X = (newX / existingZoon);
- }
+ if (mirrorValue != 0) {
+ var mirroredX = parseInt(mirrorValue) + parseInt(x);
+ var newX = (mirroredX * nzoom);
+ mirroredX = (newX / existingZoon);
+ X = mirroredX;
+ }
+ else {
+ var newX = (x * nzoom);
+ X = (newX / existingZoon);
+ }
- var newY = (y * nzoom);
- var Y = (newY / existingZoon);
+ var newY = (y * nzoom);
+ var Y = (newY / existingZoon);
- var newHeight = (height * nzoom);
- var ht = (newHeight / existingZoon);
+ var newHeight = (height * nzoom);
+ var ht = (newHeight / existingZoon);
- var newWidth = (width * nzoom);
- var wt = (newWidth / existingZoon);
+ var newWidth = (width * nzoom);
+ var wt = (newWidth / existingZoon);
- return {
- scaledX: X,
- scaledY: Y,
- scaledHeight: ht,
- scaledWidth: wt
+ return {
+ scaledX: X,
+ scaledY: Y,
+ scaledHeight: ht,
+ scaledWidth: wt
+ }
}
- }
- $scope.GetMaskImageSource = function (src) {
+ $scope.GetMaskImageSource = function (src) {
+
+ if (src != null || src != undefined) {
+ if (src.match('.png')) {
+ var mciImage = src.replace('.png', '_mci.png')
+ }
+ else {
+ var mciImage = src.replace('.jpg', '_mci.png')
+ }
+ return mciImage;
- if (src != null || src != undefined) {
- if (src.match('.png')) {
- var mciImage = src.replace('.png', '_mci.png')
}
else {
- var mciImage = src.replace('.jpg', '_mci.png')
+ console.log('IMAGE.SOURCE.NOLT.FOUND');
}
- return mciImage;
-
- }
- else {
- console.log('IMAGE.SOURCE.NOLT.FOUND');
}
- }
-
+
- $scope.GetImageSource = function (bodyRegionId) {
+ $scope.GetImageSource = function (bodyRegionId) {
- var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
+ var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
- // $('#layerChangeSlider').slider("option", "value",parseInt($rootScope.totalLayers)-parseInt($scope.layerNumber));
+ // $('#layerChangeSlider').slider("option", "value",parseInt($rootScope.totalLayers)-parseInt($scope.layerNumber));
- $scope.one = 1;
+ $scope.one = 1;
- if ($rootScope.isListManagerSelected == true) {
- $scope.layerNumber = $('#txtlayerNumber').val();
- }
+ if ($rootScope.isListManagerSelected == true) {
+ $scope.layerNumber = $('#txtlayerNumber').val();
+ }
- $scope.userInput = parseInt($scope.layerNumber);
+ $scope.userInput = parseInt($scope.layerNumber);
- $scope.skinTone = $rootScope.globalSetting.ethnicity;
+ $scope.skinTone = $rootScope.globalSetting.ethnicity;
- var SelectedLayerData = [];
- //as the data statrs with zero index and we have layer 331 on 0 index in json so we get the
- //desired layer data by using below line of code.
- SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
- if ((SelectedLayerData != null || SelectedLayerData != undefined))
+ var SelectedLayerData = [];
+ //as the data statrs with zero index and we have layer 331 on 0 index in json so we get the
+ //desired layer data by using below line of code.
+ SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
+ if ((SelectedLayerData != null || SelectedLayerData != undefined))
- if ($scope.layerNumber == 0) {
- console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length);
+ if ($scope.layerNumber == 0) {
+ console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length);
- if (SelectedLayerData.BodyRegion.length > 0) {
- for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) {
+ if (SelectedLayerData.BodyRegion.length > 0) {
+ for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) {
- var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
- var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone;
+ var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
+ var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone;
- if ($rootScope.viewOrientationId == 3 && bodyRegionId == 1) {
- console.log('$rootScope.voId: ' + $rootScope.voId);
- if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') {
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ if ($rootScope.viewOrientationId == 3 && bodyRegionId == 1) {
+ console.log('$rootScope.voId: ' + $rootScope.voId);
+ if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') {
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ }
}
- }
- else {
+ else {
- if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
+ if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ }
}
}
}
}
- }
- else {
- //below 4 bodyviews have only single body region
- if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) {
- var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId;
+ else {
+ //below 4 bodyviews have only single body region
+ if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) {
+ var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId;
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
- }
- else // it is for other body view which have multiple body regions and layer no > 0
- {
- if (SelectedLayerData.BodyRegion.length > 0) {
- for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) {
- var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
- if (bodyRegion == bodyRegionId) {
+ }
+ else // it is for other body view which have multiple body regions and layer no > 0
+ {
+ if (SelectedLayerData.BodyRegion.length > 0) {
+ for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) {
+ var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
+ if (bodyRegion == bodyRegionId) {
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
+ }
}
}
}
}
- }
- }
+ }
- $scope.GetBackgroundImgSource = function (bodyRegionId) {
+ $scope.GetBackgroundImgSource = function (bodyRegionId) {
- var selectedGender;
- if ($rootScope.getLocalStorageValue("genderId") == "Male") {
- selectedGender = 'M';
- }
- else {
- selectedGender = 'F';
+ var selectedGender;
+ if ($rootScope.getLocalStorageValue("genderId") == "Male") {
+ selectedGender = 'M';
+ }
+ else {
+ selectedGender = 'F';
- }
- //filter data based on bodyRegion
- $scope.bagartBodyRegionDetails = new jinqJs()
- .from($scope.bagartDetails)
- .where('_BodyRegionId == ' + bodyRegionId)
- .select();
- if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) {
-
- //filter bodyRegion data basd on skintone
- $scope.skinTone = $rootScope.globalSetting.ethnicity
- $scope.bagartDetailsOnSktn = new jinqJs()
- .from($scope.bagartBodyRegionDetails)
- .where('_Skintone == ' + $scope.skinTone)
- .select();
+ }
+ //filter data based on bodyRegion
+ $scope.bagartBodyRegionDetails = new jinqJs()
+ .from($scope.bagartDetails)
+ .where('_BodyRegionId == ' + bodyRegionId)
+ .select();
+ if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) {
- if ($scope.bagartDetailsOnSktn != null || $scope.bagartDetailsOnSktn != undefined) {
- //only brid=2 is having different male,female image, other bodr region have common images for male, female
- if (bodyRegionId == 2) {
- for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) {
- var gender = $scope.bagartDetailsOnSktn[z]._Gender;
- if (gender == selectedGender) {
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
+ //filter bodyRegion data basd on skintone
+ $scope.skinTone = $rootScope.globalSetting.ethnicity
+ $scope.bagartDetailsOnSktn = new jinqJs()
+ .from($scope.bagartBodyRegionDetails)
+ .where('_Skintone == ' + $scope.skinTone)
+ .select();
+
+ if ($scope.bagartDetailsOnSktn != null || $scope.bagartDetailsOnSktn != undefined) {
+ //only brid=2 is having different male,female image, other bodr region have common images for male, female
+ if (bodyRegionId == 2) {
+ for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) {
+ var gender = $scope.bagartDetailsOnSktn[z]._Gender;
+ if (gender == selectedGender) {
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
+ }
}
}
- }
- else {
- return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId;
+ else {
+ return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId;
+ }
}
}
}
- }
-
- $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
-
- var FlipedImgCanvas = document.createElement('canvas');
- FlipedImgCanvas.height = h;
- FlipedImgCanvas.width = w;
- FlipedImgCanvas.setAttribute("data-IsMirrored", "Y")
- FlipedImgCanvas.style.position = "absolute";
- FlipedImgCanvas.style.left = x + "px";
- FlipedImgCanvas.style.top = y + "px";
+ $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ var FlipedImgCanvas = document.createElement('canvas');
+ FlipedImgCanvas.height = h;
+ FlipedImgCanvas.width = w;
+ FlipedImgCanvas.setAttribute("data-IsMirrored", "Y")
+ FlipedImgCanvas.style.position = "absolute";
+ FlipedImgCanvas.style.left = x + "px";
+ FlipedImgCanvas.style.top = y + "px";
- if (isMaskImage == 'Y') {
- FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci';
- FlipedImgCanvas.style.visibility = 'hidden';
+ if (isMaskImage == 'Y') {
- }
- else {
- FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR';
+ FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci';
+ FlipedImgCanvas.style.visibility = 'hidden';
- if ($rootScope.isExtract == true) {
- FlipedImgCanvas.style.visibility = 'visible'
}
else {
- //if ($rootScope.isHighLight == true && $rootScope.isZoomed == false) {
- // FlipedImgCanvas.style.visibility = 'hidden';
- //}
+ FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR';
+
+
+ if ($rootScope.isExtract == true) {
+ FlipedImgCanvas.style.visibility = 'visible'
+ }
+ else {
+ //if ($rootScope.isHighLight == true && $rootScope.isZoomed == false) {
+ // FlipedImgCanvas.style.visibility = 'hidden';
+ //}
+ }
}
- }
- FlipedImgCanvas.addEventListener('click', function (evt) {
+ FlipedImgCanvas.addEventListener('click', function (evt) {
- var canvasDiv = document.getElementById('canvasDiv');
- $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
- //to get correct data on multihighlight highlight
- if ($scope.isLayerChange == true) {
- $scope.isLayerChange = false;
- }
+ var canvasDiv = document.getElementById('canvasDiv');
+ $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
+ //to get correct data on multihighlight highlight
+ if ($scope.isLayerChange == true) {
+ $scope.isLayerChange = false;
+ }
- if (evt.ctrlKey) {
- $rootScope.multiAnnotationIsON = true;
+ if (evt.ctrlKey) {
+ $rootScope.multiAnnotationIsON = true;
- //document.getElementById("btnZoom").setAttribute('disabled', 'disabled');
- }
- else {
- if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
- $rootScope.previousHighlightList = [];
+ //document.getElementById("btnZoom").setAttribute('disabled', 'disabled');
}
+ else {
+ if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
+ $rootScope.previousHighlightList = [];
+ }
- $rootScope.multiAnnotationIsON = false;
+ $rootScope.multiAnnotationIsON = false;
- // document.getElementById("btnZoom").disabled = false;
- }
+ // document.getElementById("btnZoom").disabled = false;
+ }
- //get mouse coordinate of mirror image click
- var mousePos = $scope.getMousePos(evt);
+ //get mouse coordinate of mirror image click
+ var mousePos = $scope.getMousePos(evt);
- var context = FlipedImgCanvas.getContext("2d");
- var canvasId = context.canvas.getAttribute('id');
+ var context = FlipedImgCanvas.getContext("2d");
+ var canvasId = context.canvas.getAttribute('id');
- var mirrorCanvasX = context.canvas.offsetLeft;
- var mirrorCanvasWidth = context.canvas.clientWidth;
+ var mirrorCanvasX = context.canvas.offsetLeft;
+ var mirrorCanvasWidth = context.canvas.clientWidth;
- var maskCanvasId = (canvasId.replace('_MR', '')) + '_mci';
- var maskCanvas = document.getElementById(maskCanvasId);
- var maskCanvasContext = maskCanvas.getContext("2d");
+ var maskCanvasId = (canvasId.replace('_MR', '')) + '_mci';
+ var maskCanvas = document.getElementById(maskCanvasId);
+ var maskCanvasContext = maskCanvas.getContext("2d");
- var canvasDiv = document.getElementById('canvasDiv');
- var verticalScrollPosition = canvasDiv.scrollTop;
- var horizontlScrollPosition = canvasDiv.scrollLeft;
+ var canvasDiv = document.getElementById('canvasDiv');
+ var verticalScrollPosition = canvasDiv.scrollTop;
+ var horizontlScrollPosition = canvasDiv.scrollLeft;
- var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
+ var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
- var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
+ var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
- var actulalX = mirrorXOnNormalImage
- var actualY = mousePos.y + verticalScrollPosition
+ var actulalX = mirrorXOnNormalImage
+ var actualY = mousePos.y + verticalScrollPosition
- var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - y), 1, 1);
+ var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - y), 1, 1);
- pixelData.data[0] = pixelData.data[0] - 9;
- pixelData.data[1] = pixelData.data[1] - 9;
- pixelData.data[2] = pixelData.data[2] - 9
+ pixelData.data[0] = pixelData.data[0] - 9;
+ pixelData.data[1] = pixelData.data[1] - 9;
+ pixelData.data[2] = pixelData.data[2] - 9
- var Red;
- var Green;
- var Blue;
- var zero = "0";
+ var Red;
+ var Green;
+ var Blue;
+ var zero = "0";
- if ((pixelData.data[0]).toString().length != 2) {
- Red = zero.concat((pixelData.data[0]).toString())
- }
- else {
- Red = (pixelData.data[0]).toString()
- }
- if ((pixelData.data[1]).toString().length != 2) {
- Green = zero.concat((pixelData.data[1]).toString())
- }
- else {
- Green = (pixelData.data[1]).toString()
+ if ((pixelData.data[0]).toString().length != 2) {
+ Red = zero.concat((pixelData.data[0]).toString())
+ }
+ else {
+ Red = (pixelData.data[0]).toString()
+ }
+ if ((pixelData.data[1]).toString().length != 2) {
+ Green = zero.concat((pixelData.data[1]).toString())
+ }
+ else {
+ Green = (pixelData.data[1]).toString()
- }
- if ((pixelData.data[2]).toString().length != 2) {
- Blue = zero.concat((pixelData.data[2]).toString())
- }
- else {
- Blue = (pixelData.data[2]).toString()
+ }
+ if ((pixelData.data[2]).toString().length != 2) {
+ Blue = zero.concat((pixelData.data[2]).toString())
+ }
+ else {
+ Blue = (pixelData.data[2]).toString()
- }
- var RGBColor = (Red + Green + Blue);
+ }
+ var RGBColor = (Red + Green + Blue);
- $rootScope.previousHighlightList.push(RGBColor);
+ $rootScope.previousHighlightList.push(RGBColor);
- if ($rootScope.isHighLight) {
+ if ($rootScope.isHighLight) {
- if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
- if ($scope.machedIcolorInBodyRegion.length > 0) {
- if ($rootScope.multiAnnotationIsON == false) {
- for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
- var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
+ if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
+ if ($scope.machedIcolorInBodyRegion.length > 0) {
+ if ($rootScope.multiAnnotationIsON == false) {
+ for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
+ var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
- var grayCanvasID = 'imageCanvas' + bodyRegionId;
- var grayCanvas = document.getElementById(grayCanvasID);
+ var grayCanvasID = 'imageCanvas' + bodyRegionId;
+ var grayCanvas = document.getElementById(grayCanvasID);
- var grayCanvasContext = grayCanvas.getContext("2d");
+ var grayCanvasContext = grayCanvas.getContext("2d");
- if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
- var grayImageData = $rootScope.grayImageDataList[bodyRegionId - 1];
- grayCanvasContext.putImageData(grayImageData, 0, 0);
- }
+ if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
+ var grayImageData = $rootScope.grayImageDataList[bodyRegionId - 1];
+ grayCanvasContext.putImageData(grayImageData, 0, 0);
+ }
- // for mirrored canvas
+ // for mirrored canvas
- if ($rootScope.voId == "1" || $rootScope.voId == "4" || $rootScope.voId == "5" || $rootScope.voId == "8") {
- if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
- var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
- var grayCanvasMR = document.getElementById(grayCanvasID);
+ if ($rootScope.voId == "1" || $rootScope.voId == "4" || $rootScope.voId == "5" || $rootScope.voId == "8") {
+ if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
+ var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
+ var grayCanvasMR = document.getElementById(grayCanvasID);
- var grayCanvasContextMR = grayCanvasMR.getContext("2d");
- if ($rootScope.grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
- var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId];
+ var grayCanvasContextMR = grayCanvasMR.getContext("2d");
+ if ($rootScope.grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
+ var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId];
- grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
+ grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
+ }
}
}
}
}
}
}
- }
-
- // $rootScope.previousHighlightList.push(RGBColor);
- $scope.isClickedOnBodyForHighlight = true;
- $scope.highLightBodyBasedOnIcolor(RGBColor);
- }
-
-
- //extarct clicked body part is extarct button is already enabled.
- if ($rootScope.isExtract == true) {
- if ($rootScope.multiAnnotationIsON == false) {
- $rootScope.isListManagerSelected = false;
+ // $rootScope.previousHighlightList.push(RGBColor);
+ $scope.isClickedOnBodyForHighlight = true;
+ $scope.highLightBodyBasedOnIcolor(RGBColor);
}
- $scope.enableExtract(false);
- }
-
- var annotationText
- if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
-
- annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
- else {
- $scope.loadSearchData();
- annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
-
- if ($('#speechBubbleTrns').length > 0)
- $('#speechBubbleTrns').remove();
- if ($rootScope.multiAnnotationIsON == true) {
- // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
+ //extarct clicked body part is extarct button is already enabled.
- $scope.MultiLanguageAnnationArray = [];
- for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
-
- $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ if ($rootScope.isExtract == true) {
+ if ($rootScope.multiAnnotationIsON == false) {
+ $rootScope.isListManagerSelected = false;
+ }
+ $scope.enableExtract(false);
}
- $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
- }
- else {
+ var annotationText
+ if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
- if ($('#dot').length > 0) {
- $('#dot').remove();
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
+ else {
+ $scope.loadSearchData();
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
}
- if ($('#sppeachBubble').length > 0) {
- $('#sppeachBubble').remove();
+ if ($('#speechBubbleTrns').length > 0)
+ $('#speechBubbleTrns').remove();
+ if ($rootScope.multiAnnotationIsON == true) {
+
+ // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
- // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
- // alert(annotationText);
$scope.MultiLanguageAnnationArray = [];
for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
-
+
$scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
}
-
$scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
}
else {
- // alert(annotationText);
- // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
- $scope.MultiLanguageAnnationArray = [];
- for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
-
- $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+
+ if ($('#dot').length > 0) {
+ $('#dot').remove();
}
+ if ($('#sppeachBubble').length > 0) {
+ $('#sppeachBubble').remove();
+
- $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
- }
+ // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
+ // alert(annotationText);
+ $scope.MultiLanguageAnnationArray = [];
+ for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
+
+ $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ }
- }
- }, false);
+ $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ }
+ else {
+ // alert(annotationText);
+ // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
+ $scope.MultiLanguageAnnationArray = [];
+ for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
+
+ $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ }
+
+
+ $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ }
+
+
+ }
+ }, false);
- FlipedImgCanvas.addEventListener('mousedown', function (evt) {
+ FlipedImgCanvas.addEventListener('mousedown', function (evt) {
- //alert('mousedown')
- }, false);
+ //alert('mousedown')
+ }, false);
- FlipedImgCanvas.addEventListener('mouseup', function (evt) {
- //alert('mouseup')
+ FlipedImgCanvas.addEventListener('mouseup', function (evt) {
+ //alert('mouseup')
- }, false);
+ }, false);
- var context = FlipedImgCanvas.getContext("2d");
+ var context = FlipedImgCanvas.getContext("2d");
- var PI = Math.PI;
- var PI2 = PI * 2;
- var cw, ch, imgW, imgH, mouseX, mouseY;
- var scaleFactor = 1.00;
+ var PI = Math.PI;
+ var PI2 = PI * 2;
+ var cw, ch, imgW, imgH, mouseX, mouseY;
+ var scaleFactor = 1.00;
- //$scaler = $("#scaler");
- //$scaler.val(scaleFactor);
- //$scaler.hide();
+ //$scaler = $("#scaler");
+ //$scaler.val(scaleFactor);
+ //$scaler.hide();
- var img = new Image();
- img.onload = start;
+ var img = new Image();
+ img.onload = start;
- // img.src = "~/../content/images/" + src;;
- img.src = src;
+ // img.src = "~/../content/images/" + src;;
+ img.src = src;
- function start() {
+ function start() {
- context.save();
- context.translate(w, 0);
- context.scale(-1, 1);
- context.drawImage(img, 0, 0);
- context.restore();
+ context.save();
+ context.translate(w, 0);
+ context.scale(-1, 1);
+ context.drawImage(img, 0, 0);
+ context.restore();
- if (isMaskImage == 'N') {
- var totalCanvas;
- if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
- totalCanvas = 9;
+ if (isMaskImage == 'N') {
+ var totalCanvas;
+ if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
+ totalCanvas = 9;
- }
- else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) {
- totalCanvas = 5;
+ }
+ else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) {
+ totalCanvas = 5;
- }
- else if (($rootScope.viewOrientationId == '5')) {
- totalCanvas = 4;
+ }
+ else if (($rootScope.viewOrientationId == '5')) {
+ totalCanvas = 4;
- }
- else if (($rootScope.viewOrientationId == '6')) {
- totalCanvas = 1;
+ }
+ else if (($rootScope.viewOrientationId == '6')) {
+ totalCanvas = 1;
- }
+ }
- if ($scope.ColoredImageSRC.length < totalCanvas) {
- $scope.ColoredImageSRC.push(
- {
- "bodyRegionId": bodyRegionId, "SRC": src,
- "Height": h,
- "Width": w,
- "x": x,
- "y": y,
- "haveMirror": 'true'
- }
- );
- }
- //else if ($scope.ColoredImageSRC.length == totalCanvas)
- //{
- // // dispatch event for enabling rest UI
- // alert('all canvas drawn');
- // $scope.EnableUI();
- //}
+ if ($scope.ColoredImageSRC.length < totalCanvas) {
+ $scope.ColoredImageSRC.push(
+ {
+ "bodyRegionId": bodyRegionId, "SRC": src,
+ "Height": h,
+ "Width": w,
+ "x": x,
+ "y": y,
+ "haveMirror": 'true'
+ }
+ );
+ }
+ //else if ($scope.ColoredImageSRC.length == totalCanvas)
+ //{
+ // // dispatch event for enabling rest UI
+ // alert('all canvas drawn');
+ // $scope.EnableUI();
+ //}
- //-NIKI-for solving extarct issue 8286
+ //-NIKI-for solving extarct issue 8286
- var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR');
+ var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR');
- if (imageCanvas != null || imageCanvas != undefined) {
- var width = imageCanvas.width;
- var ht = imageCanvas.height;
+ if (imageCanvas != null || imageCanvas != undefined) {
+ var width = imageCanvas.width;
+ var ht = imageCanvas.height;
- var coloredCanvasContext = imageCanvas.getContext("2d");
- var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
- var coloredImageDataVar = coloredImageData;
+ var coloredCanvasContext = imageCanvas.getContext("2d");
+ var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
+ var coloredImageDataVar = coloredImageData;
- $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar;
- }
+ $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar;
+ }
- //
+ //
- // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
+ // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
- if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
+ if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
- $scope.isEligibleForHighlight = true;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
- $scope.isEligibleForHighlight = true;
- }
- else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
- $scope.isEligibleForHighlight = true;
- }
- else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
- $scope.isEligibleForHighlight = true;
- }
- else {
- $scope.isEligibleForHighlight = false;
- }
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else {
+ $scope.isEligibleForHighlight = false;
+ }
- if ($scope.isEligibleForHighlight == true) {
+ if ($scope.isEligibleForHighlight == true) {
- if ($scope.isSearchDataLoaded) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
+ if ($scope.isSearchDataLoaded) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
- if ($scope.isExtract == true) {
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
- $scope.DisableUI();
- $scope.highLightBody();
- }
- else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
- || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $rootScope.isHighlightBodyByBodySystem == true) {
+ if ($scope.isExtract == true) {
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ $scope.DisableUI();
+ $scope.highLightBody();
+ }
+ else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
+ || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $rootScope.isHighlightBodyByBodySystem == true) {
- console.log('1. $rootScope.isHighLight= ' + $rootScope.isHighLight)
+ console.log('1. $rootScope.isHighLight= ' + $rootScope.isHighLight)
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
- $rootScope.isHighLight = true;
- $scope.DisableUI();
- $scope.highLightBody();
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ $rootScope.isHighLight = true;
+ $scope.DisableUI();
+ $scope.highLightBody();
+ }
+ }
+ else {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ $scope.EnableUI();
}
}
- else {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- $scope.EnableUI();
- }
- }
-
- console.log('DrawMirroredImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
- }
-
- if (FlipedImgCanvas.id.match('_mci')) {
- var maskImgData = context.getImageData(0, 0, w, h);
+ console.log('DrawMirroredImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
+ }
- $rootScope.MaskCanvasData.push(
- {
- "bodyRegionId": bodyRegionId,
- "canvasId": FlipedImgCanvas.id,
- "maskData": maskImgData,
+ if (FlipedImgCanvas.id.match('_mci')) {
- }
- );
- }
- };
+ var maskImgData = context.getImageData(0, 0, w, h);
+ $rootScope.MaskCanvasData.push(
+ {
+ "bodyRegionId": bodyRegionId,
+ "canvasId": FlipedImgCanvas.id,
+ "maskData": maskImgData,
- if (document.getElementById('canvasDiv') != null)
- document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
+ }
+ );
+ }
+ };
+ if (document.getElementById('canvasDiv') != null)
+ document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
- }
- $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
+ }
- var imgCanvas = document.createElement('canvas');
+ $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
- imgCanvas.height = h;
- imgCanvas.width = w;
- imgCanvas.setAttribute("data-IsMirrored", "N")
- imgCanvas.style.position = "absolute";
- imgCanvas.style.left = x + "px";
- imgCanvas.style.top = y + "px";
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- if (isMaskImage == 'Y') {
- imgCanvas.style.visibility = 'hidden'
- imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci';
+ var imgCanvas = document.createElement('canvas');
- }
- else {
- imgCanvas.id = 'imageCanvas' + bodyRegionId;
+ imgCanvas.height = h;
+ imgCanvas.width = w;
+ imgCanvas.setAttribute("data-IsMirrored", "N")
+ imgCanvas.style.position = "absolute";
+ imgCanvas.style.left = x + "px";
+ imgCanvas.style.top = y + "px";
- if (bodyRegionId == 3) {
- //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs.
- imgCanvas.style.zIndex = "100";
- }
- if (bodyRegionId.match('modestyImg')) {
- //added class to further access this canavs to show and hide leaf as per modesty seting
- imgCanvas.className = 'modestyImg'
+ if (isMaskImage == 'Y') {
imgCanvas.style.visibility = 'hidden'
- //set z index to make leaf canvas on top of hip canavs
- imgCanvas.style.zIndex = "200";
- }
- if (($rootScope.voId == 11 || $rootScope.voId == 9) && bodyRegionId == 6) {
- imgCanvas.style.zIndex = "500";
- }
+ imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci';
- if ($rootScope.isExtract == true) {
- imgCanvas.style.visibility = 'visible'
}
else {
+ imgCanvas.id = 'imageCanvas' + bodyRegionId;
- //if ($rootScope.isHighLight == true && $rootScope.isZoomed == false) {
- // imgCanvas.style.visibility = 'hidden';
- //}
- }
+ if (bodyRegionId == 3) {
+ //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs.
+ imgCanvas.style.zIndex = "100";
+ }
+ if (bodyRegionId.match('modestyImg')) {
+ //added class to further access this canavs to show and hide leaf as per modesty seting
+ imgCanvas.className = 'modestyImg'
+ imgCanvas.style.visibility = 'hidden'
+ //set z index to make leaf canvas on top of hip canavs
+ imgCanvas.style.zIndex = "200";
+ }
+ if (($rootScope.voId == 11 || $rootScope.voId == 9) && bodyRegionId == 6) {
+ imgCanvas.style.zIndex = "500";
+ }
- }
+ if ($rootScope.isExtract == true) {
+ imgCanvas.style.visibility = 'visible'
+ }
+ else {
+
+ //if ($rootScope.isHighLight == true && $rootScope.isZoomed == false) {
+ // imgCanvas.style.visibility = 'hidden';
+ //}
+ }
- imgCanvas.addEventListener('click', function (evt) {
- var canvasDiv = document.getElementById('canvasDiv');
- $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
- if ($scope.isLayerChange == true) {
- $scope.isLayerChange = false;
}
- if (evt.ctrlKey) {
- $rootScope.multiAnnotationIsON = true;
+ imgCanvas.addEventListener('click', function (evt) {
+ var canvasDiv = document.getElementById('canvasDiv');
+ $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
+ if ($scope.isLayerChange == true) {
+ $scope.isLayerChange = false;
+ }
- //$("#btnZoom").addClass('disabled');
- // document.getElementById("btnZoom").setAttribute('disabled', 'disabled');
- //$('#btnZoom').click(function (event) { event.preventDefault(); });
+ if (evt.ctrlKey) {
+ $rootScope.multiAnnotationIsON = true;
- console.log('CTRL ON')
- }
- else {
- if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
- $rootScope.previousHighlightList = [];
+ //$("#btnZoom").addClass('disabled');
+ // document.getElementById("btnZoom").setAttribute('disabled', 'disabled');
+ //$('#btnZoom').click(function (event) { event.preventDefault(); });
+
+ console.log('CTRL ON')
}
- $rootScope.multiAnnotationIsON = false;
+ else {
+ if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
+ $rootScope.previousHighlightList = [];
+ }
+ $rootScope.multiAnnotationIsON = false;
- console.log('multiAnnotationIsON: ' + $rootScope.multiAnnotationIsON);
- // document.getElementById("btnZoom").setAttribute('enabled', 'enabled');
+ console.log('multiAnnotationIsON: ' + $rootScope.multiAnnotationIsON);
+ // document.getElementById("btnZoom").setAttribute('enabled', 'enabled');
- // document.getElementById("btnZoom").disabled = false;
- }
+ // document.getElementById("btnZoom").disabled = false;
+ }
- var annotationText;
- var context = imgCanvas.getContext("2d");
+ var annotationText;
+ var context = imgCanvas.getContext("2d");
- var canvasId = context.canvas.getAttribute('id');
- var maskCanvasId;
- //for leaf canvas
- if (canvasId.match('modestyImg')) {
- maskCanvasId = canvasId;
- }
- else {
- maskCanvasId = canvasId + '_mci';
- }
- var maskCanvas = document.getElementById(maskCanvasId);
- var maskCanvasContext = maskCanvas.getContext("2d");
+ var canvasId = context.canvas.getAttribute('id');
+ var maskCanvasId;
+ //for leaf canvas
+ if (canvasId.match('modestyImg')) {
+ maskCanvasId = canvasId;
+ }
+ else {
+ maskCanvasId = canvasId + '_mci';
+ }
+ var maskCanvas = document.getElementById(maskCanvasId);
+ var maskCanvasContext = maskCanvas.getContext("2d");
- var mousePos = $scope.getMousePos(evt);
- // alert(mousePos.x + ',' + mousePos.y);
+ var mousePos = $scope.getMousePos(evt);
+ // alert(mousePos.x + ',' + mousePos.y);
- var canvasDiv = document.getElementById('canvasDiv');
- var verticalScrollPosition = canvasDiv.scrollTop;
- var horizontlScrollPosition = canvasDiv.scrollLeft;
+ var canvasDiv = document.getElementById('canvasDiv');
+ var verticalScrollPosition = canvasDiv.scrollTop;
+ var horizontlScrollPosition = canvasDiv.scrollLeft;
- //We substracted 135, as the difference between flex and html coordinates for same organ is 135
- var actulalX = mousePos.x + horizontlScrollPosition;
- var actualY = mousePos.y + verticalScrollPosition;
- var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
+ //We substracted 135, as the difference between flex and html coordinates for same organ is 135
+ var actulalX = mousePos.x + horizontlScrollPosition;
+ var actualY = mousePos.y + verticalScrollPosition;
+ var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
- //Modesty ON
- if (maskCanvasId.match('modestyImg') && RGBColor != '000000') {
- RGBColor = DA[0].figLeafTermId;
- annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor);
- }
- //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
- //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
- //
- else if (maskCanvasId.match('modestyImg') && RGBColor == '000000') {
+ //Modesty ON
+ if (maskCanvasId.match('modestyImg') && RGBColor != '000000') {
+ RGBColor = DA[0].figLeafTermId;
+ annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor);
+ }
+ //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
+ //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
+ //
+ else if (maskCanvasId.match('modestyImg') && RGBColor == '000000') {
- bodyRegionId = maskCanvasId.slice(-1);
- maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
+ bodyRegionId = maskCanvasId.slice(-1);
+ maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
- var maskCanvas = document.getElementById(maskCanvasId);
- var maskCanvasContext = maskCanvas.getContext("2d");
- RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
- // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
- else {
- RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
- // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ var maskCanvas = document.getElementById(maskCanvasId);
+ var maskCanvasContext = maskCanvas.getContext("2d");
+ RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
+ // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
+ else {
+ RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
+ // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
- if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
- annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
+ if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
- else {
- $scope.loadSearchData();
- annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
+ else {
+ $scope.loadSearchData();
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
- }
- $rootScope.previousHighlightList.push(RGBColor);
+ }
+ $rootScope.previousHighlightList.push(RGBColor);
- if ($rootScope.isHighLight == true) {
- if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
- if ($scope.machedIcolorInBodyRegion.length > 0) {
- if ($rootScope.multiAnnotationIsON == false) {
- for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
- var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
+ if ($rootScope.isHighLight == true) {
+ if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
+ if ($scope.machedIcolorInBodyRegion.length > 0) {
+ if ($rootScope.multiAnnotationIsON == false) {
+ for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
+ var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
- var grayCanvasID = 'imageCanvas' + bodyRegionId;
- var grayCanvas = document.getElementById(grayCanvasID);
+ var grayCanvasID = 'imageCanvas' + bodyRegionId;
+ var grayCanvas = document.getElementById(grayCanvasID);
- var grayCanvasContext = grayCanvas.getContext("2d");
- if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
- var grayImageData = $rootScope.grayImageDataList[bodyRegionId - 1];
- grayCanvasContext.putImageData(grayImageData, 0, 0);
- }
+ var grayCanvasContext = grayCanvas.getContext("2d");
+ if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
+ var grayImageData = $rootScope.grayImageDataList[bodyRegionId - 1];
+ grayCanvasContext.putImageData(grayImageData, 0, 0);
+ }
- // for unhighlight the mirrored body region
- if ($rootScope.voId == "1" || $rootScope.voId == "4" || $rootScope.voId == "5" || $rootScope.voId == "8") {
- if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
- var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
- var grayCanvasMR = document.getElementById(grayCanvasID);
+ // for unhighlight the mirrored body region
+ if ($rootScope.voId == "1" || $rootScope.voId == "4" || $rootScope.voId == "5" || $rootScope.voId == "8") {
+ if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
+ var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
+ var grayCanvasMR = document.getElementById(grayCanvasID);
- var grayCanvasContextMR = grayCanvasMR.getContext("2d");
+ var grayCanvasContextMR = grayCanvasMR.getContext("2d");
- if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
+ if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
- var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId];
+ var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId];
- grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
+ grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
+ }
}
}
- }
+ }
}
}
}
- }
- // $rootScope.previousHighlightList.push(RGBColor);
+ // $rootScope.previousHighlightList.push(RGBColor);
- if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
- else
- {
- $scope.isClickedOnBodyForHighlight = true;
- $scope.highLightBodyBasedOnIcolor(RGBColor);
- }
+ if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
+ else
+ {
+ $scope.isClickedOnBodyForHighlight = true;
+ $scope.highLightBodyBasedOnIcolor(RGBColor);
+ }
- }
+ }
- //extarct clisked body part is extarct button is already enabled.
- if ($rootScope.isExtract == true) {
- if ($rootScope.multiAnnotationIsON == false) {
- $rootScope.isListManagerSelected = false;
+ //extarct clisked body part is extarct button is already enabled.
+ if ($rootScope.isExtract == true) {
+ if ($rootScope.multiAnnotationIsON == false) {
+ $rootScope.isListManagerSelected = false;
+ }
+ $scope.enableExtract(false);
}
- $scope.enableExtract(false);
- }
- if ($('#speechBubbleTrns').length > 0)
- $('#speechBubbleTrns').remove();
+ if ($('#speechBubbleTrns').length > 0)
+ $('#speechBubbleTrns').remove();
- if ($rootScope.multiAnnotationIsON == true) {
+ if ($rootScope.multiAnnotationIsON == true) {
- // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
- // alert(annotationText);
- $scope.MultiLanguageAnnationArray = [];
- for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
+ // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
+ // alert(annotationText);
+ $scope.MultiLanguageAnnationArray = [];
+ for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
- $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
- }
+ $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ }
- $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
- }
- else {
+ $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ }
+ else {
- $scope.MultiLanguageAnnationArray = [];
+ $scope.MultiLanguageAnnationArray = [];
- console.log('1. annotationText: ' + annotationText);
+ console.log('1. annotationText: ' + annotationText);
- if ($('#dot').length > 0) {
- $('#dot').remove();
+ if ($('#dot').length > 0) {
+ $('#dot').remove();
- if ($('#sppeachBubble').length > 0) {
- $('#sppeachBubble').remove();
- }
+ if ($('#sppeachBubble').length > 0) {
+ $('#sppeachBubble').remove();
+ }
- // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
+ // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
- for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
+ for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
- $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
- }
+ $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ }
- console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
+ console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
- $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
- }
- else {
- $scope.MultiLanguageAnnationArray = [];
- for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
-
- $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
}
+ else {
+ $scope.MultiLanguageAnnationArray = [];
+ for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) {
+
+ $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]);
+ }
- console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
+ console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
- $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
- }
+ $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ }
- }
- }, false);
+ }
+ }, false);
- var PI = Math.PI;
- var PI2 = PI * 2;
- var cw, ch, imgW, imgH, mouseX, mouseY;
- var scaleFactor = 1.00;
+ var PI = Math.PI;
+ var PI2 = PI * 2;
+ var cw, ch, imgW, imgH, mouseX, mouseY;
+ var scaleFactor = 1.00;
- var context = imgCanvas.getContext('2d');
- var img = new Image();
- img.onload = start;
+ var context = imgCanvas.getContext('2d');
+ var img = new Image();
+ img.onload = start;
- img.src = src;
+ img.src = src;
- function start() {
+ function start() {
- context.drawImage(img, 0, 0);
+ context.drawImage(img, 0, 0);
- if (isMaskImage == 'N') {
- if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') {
- $scope.modestyImageInfo.push(
+ if (isMaskImage == 'N') {
+ if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') {
+ $scope.modestyImageInfo.push(
- {
- "bodyRegionId": bodyRegionId, "SRC": src,
- "Height": h,
- "Width": w,
- "x": x,
- "y": y,
- "haveMirror": 'false'
- }
+ {
+ "bodyRegionId": bodyRegionId, "SRC": src,
+ "Height": h,
+ "Width": w,
+ "x": x,
+ "y": y,
+ "haveMirror": 'false'
+ }
- );
- }
- else {
+ );
+ }
+ else {
- var totalCanvas;
- if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
- totalCanvas = 9;
+ var totalCanvas;
+ if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
+ totalCanvas = 9;
- }
- else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) {
- totalCanvas = 5;
+ }
+ else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) {
+ totalCanvas = 5;
- }
- else if (($rootScope.viewOrientationId == '5')) {
- totalCanvas = 4;
+ }
+ else if (($rootScope.viewOrientationId == '5')) {
+ totalCanvas = 4;
- }
- else if (($rootScope.viewOrientationId == '6')) {
- totalCanvas = 1;
- }
+ }
+ else if (($rootScope.viewOrientationId == '6')) {
+ totalCanvas = 1;
+ }
if ($scope.ColoredImageSRC.length < totalCanvas) {
- $scope.ColoredImageSRC.push(
- {
- "bodyRegionId": bodyRegionId, "SRC": src,
- "Height": h,
- "Width": w,
- "x": x,
- "y": y,
- "haveMirror": 'false'
- }
+ $scope.ColoredImageSRC.push(
+ {
+ "bodyRegionId": bodyRegionId, "SRC": src,
+ "Height": h,
+ "Width": w,
+ "x": x,
+ "y": y,
+ "haveMirror": 'false'
+ }
- );
- }
+ );
+ }
- //-NIKI-for solving extarct issue 8286
+ //-NIKI-for solving extarct issue 8286
- var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId);
+ var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId);
- if (imageCanvas != null || imageCanvas != undefined) {
- var width = imageCanvas.width;
- var ht = imageCanvas.height;
+ if (imageCanvas != null || imageCanvas != undefined) {
+ var width = imageCanvas.width;
+ var ht = imageCanvas.height;
- var coloredCanvasContext = imageCanvas.getContext("2d");
- var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
- var coloredImageDataVar = coloredImageData;
+ var coloredCanvasContext = imageCanvas.getContext("2d");
+ var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
+ var coloredImageDataVar = coloredImageData;
- $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar;
- }
- //
+ $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar;
+ }
+ //
- if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
+ if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
- $scope.isEligibleForHighlight = true;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
- $scope.isEligibleForHighlight = true;
- }
- else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
- $scope.isEligibleForHighlight = true;
- }
- else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
- $scope.isEligibleForHighlight = true;
- }
- else {
- $scope.isEligibleForHighlight = false;
- }
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
+ $scope.isEligibleForHighlight = true;
+ }
+ else {
+ $scope.isEligibleForHighlight = false;
+ }
- if ($scope.isEligibleForHighlight == true) {
+ if ($scope.isEligibleForHighlight == true) {
- if ($scope.isSearchDataLoaded) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
+ if ($scope.isSearchDataLoaded) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
- if ($scope.isExtract == true) {
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
- $scope.DisableUI();
- $scope.highLightBody();
- }
- else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
- || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) {
+ if ($scope.isExtract == true) {
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ $scope.DisableUI();
+ $scope.highLightBody();
+ }
+ else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
+ || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) {
- console.log('2. $rootScope.isHighLight= ' + $rootScope.isHighLight)
+ console.log('2. $rootScope.isHighLight= ' + $rootScope.isHighLight)
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
- $rootScope.isHighLight = true;
+ console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
+ $rootScope.isHighLight = true;
- console.log('just before highLightBody call');
- $scope.DisableUI();
- $scope.highLightBody();
+ console.log('just before highLightBody call');
+ $scope.DisableUI();
+ $scope.highLightBody();
- console.log('just after highLightBody call');
+ console.log('just after highLightBody call');
+ }
+ else {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ $scope.EnableUI();
+ }
}
else {
$rootScope.isLoading = false;
@@ -2265,450 +2272,444 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.EnableUI();
}
}
- else {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- $scope.EnableUI();
- }
- }
- console.log('DrawImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
+ console.log('DrawImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
+ }
}
- }
- if (imgCanvas.id.match('_mci')) {
- var maskImgData = context.getImageData(0, 0, w, h);
- $rootScope.MaskCanvasData.push(
- {
- "bodyRegionId": bodyRegionId,
- "canvasId": imgCanvas.id,
- "maskData": maskImgData,
+ if (imgCanvas.id.match('_mci')) {
+ var maskImgData = context.getImageData(0, 0, w, h);
+ $rootScope.MaskCanvasData.push(
+ {
+ "bodyRegionId": bodyRegionId,
+ "canvasId": imgCanvas.id,
+ "maskData": maskImgData,
- }
- );
- }
+ }
+ );
+ }
- };
+ };
- if (document.getElementById('canvasDiv') != null)
- document.getElementById('canvasDiv').appendChild(imgCanvas);
- }
+ if (document.getElementById('canvasDiv') != null)
+ document.getElementById('canvasDiv').appendChild(imgCanvas);
+ }
- $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
+ $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
- //2. Find Actul Term No Based on Icolor.
- var ActualTermNo = $scope.getActualTermNumber(RGBColor);
+ //2. Find Actul Term No Based on Icolor.
+ var ActualTermNo = $scope.getActualTermNumber(RGBColor);
- if (ActualTermNo != null) {
+ if (ActualTermNo != null) {
- //3. Find Term No List Based on ActualTermNo
- var TermList = $scope.getTermNumberList(ActualTermNo);
- if (TermList != null) {
+ //3. Find Term No List Based on ActualTermNo
+ var TermList = $scope.getTermNumberList(ActualTermNo);
+ if (TermList != null) {
- //4.
- $scope.HighlightBodyByTermList(TermList);
+ //4.
+ $scope.HighlightBodyByTermList(TermList);
+ }
}
- }
- }
+ }
- $scope.HighlightBodyOnExtract = function () {
- console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
+ $scope.HighlightBodyOnExtract = function () {
+ console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
- $("#btnExtract").removeClass("btn-black");
- $("#btnExtract").addClass("btn-primary");
+ $("#btnExtract").removeClass("btn-black");
+ $("#btnExtract").addClass("btn-primary");
- if ($("#btnNormalMode").hasClass("btn-primary")) {
- $("#btnNormalMode").removeClass("btn-primary");
- $("#btnNormalMode").addClass("btn-black");
- }
+ if ($("#btnNormalMode").hasClass("btn-primary")) {
+ $("#btnNormalMode").removeClass("btn-primary");
+ $("#btnNormalMode").addClass("btn-black");
+ }
- if ($("#btnHighLight").hasClass("btn-primary")) {
- $("#btnHighLight").removeClass("btn-primary");
- $("#btnHighLight").addClass("btn-black");
- }
+ if ($("#btnHighLight").hasClass("btn-primary")) {
+ $("#btnHighLight").removeClass("btn-primary");
+ $("#btnHighLight").addClass("btn-black");
+ }
- //terminate previous running workers to create space for new workers
- $scope.layerNumber = $('#txtlayerNumber').val();
- $scope.terminateCurrentlyRunningWPs();
+ //terminate previous running workers to create space for new workers
+ $scope.layerNumber = $('#txtlayerNumber').val();
+ $scope.terminateCurrentlyRunningWPs();
- var multiTermList = [];
- var CallBackBodyRegion = [];
- var selectedAnnotation;
+ var multiTermList = [];
+ var CallBackBodyRegion = [];
+ var selectedAnnotation;
- if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)
- && $rootScope.isListManagerSelected && $rootScope.multiAnnotationIsON == true) {
+ if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)
+ && $rootScope.isListManagerSelected && $rootScope.multiAnnotationIsON == true) {
- multiTermList = $scope.AllTerms;
- angular.forEach($rootScope.previousHighlightList, function (value, key) {
+ multiTermList = $scope.AllTerms;
+ angular.forEach($rootScope.previousHighlightList, function (value, key) {
- var ActualTermNo = $scope.getActualTermNumber(value);
- selectedAnnotation = ActualTermNo;
- if (ActualTermNo != null) {
- var TermList = $scope.getTermNumberList(ActualTermNo);
- if (TermList != null) {
- for (var i = 0; i < TermList.length; i++) {
- multiTermList.push(TermList[i]);
+ var ActualTermNo = $scope.getActualTermNumber(value);
+ selectedAnnotation = ActualTermNo;
+ if (ActualTermNo != null) {
+ var TermList = $scope.getTermNumberList(ActualTermNo);
+ if (TermList != null) {
+ for (var i = 0; i < TermList.length; i++) {
+ multiTermList.push(TermList[i]);
+ }
}
}
- }
- // to do
- });
- }
+ // to do
+ });
+ }
- if ($rootScope.isListManagerSelected) {
+ if ($rootScope.isListManagerSelected) {
- multiTermList = $scope.AllTerms;
- selectedAnnotation = $rootScope.actualTermNumber;
+ multiTermList = $scope.AllTerms;
+ selectedAnnotation = $rootScope.actualTermNumber;
- }
- else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
- angular.forEach($rootScope.previousHighlightList, function (value, key) {
+ }
+ else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
+ angular.forEach($rootScope.previousHighlightList, function (value, key) {
- var ActualTermNo = $scope.getActualTermNumber(value);
- selectedAnnotation = ActualTermNo;
- if (ActualTermNo != null) {
- var TermList = $scope.getTermNumberList(ActualTermNo);
- if (TermList != null) {
- for (var i = 0; i < TermList.length; i++) {
- multiTermList.push(TermList[i]);
+ var ActualTermNo = $scope.getActualTermNumber(value);
+ selectedAnnotation = ActualTermNo;
+ if (ActualTermNo != null) {
+ var TermList = $scope.getTermNumberList(ActualTermNo);
+ if (TermList != null) {
+ for (var i = 0; i < TermList.length; i++) {
+ multiTermList.push(TermList[i]);
+ }
}
}
- }
- // to do
- });
- }
+ // to do
+ });
+ }
- //get term list to get term coordinates
- $scope.TermList = $scope.getTermNumberList(selectedAnnotation);
+ //get term list to get term coordinates
+ $scope.TermList = $scope.getTermNumberList(selectedAnnotation);
- $scope.termCoordinate = $scope.getTermCoordinate(selectedAnnotation);
+ $scope.termCoordinate = $scope.getTermCoordinate(selectedAnnotation);
- $timeout(function () {
+ $timeout(function () {
- var loopLength = 0;
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
- loopLength = 9;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
- loopLength = 5;
- }
- else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
- loopLength = 4;
- }
- else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
- loopLength = 1;
- }
+ var loopLength = 0;
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
+ loopLength = 9;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
+ loopLength = 5;
+ }
+ else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
+ loopLength = 4;
+ }
+ else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
+ loopLength = 1;
+ }
- if (loopLength !== 0) {
- for (var x = 0; x < loopLength; x++) {
- if ($rootScope.MaskCanvasData[x] != null || $rootScope.MaskCanvasData[x] != undefined) {
- var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId;
- var canvasId = $rootScope.MaskCanvasData[x].canvasId;
- var maskData = null;
- maskData = $rootScope.MaskCanvasData[x].maskData;
+ if (loopLength !== 0) {
+ for (var x = 0; x < loopLength; x++) {
+ if ($rootScope.MaskCanvasData[x] != null || $rootScope.MaskCanvasData[x] != undefined) {
+ var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId;
+ var canvasId = $rootScope.MaskCanvasData[x].canvasId;
+ var maskData = null;
+ maskData = $rootScope.MaskCanvasData[x].maskData;
- var coloredImageDataVar = null;
- var grayImageDataVar = null;
+ var coloredImageDataVar = null;
+ var grayImageDataVar = null;
- var white = null;
- if (canvasId.match('_MR')) {
- if ($rootScope.coloredImageMRCanvasList[bodyRegionId] != null || $rootScope.coloredImageMRCanvasList[bodyRegionId] != undefined) {
+ var white = null;
+ if (canvasId.match('_MR')) {
+ if ($rootScope.coloredImageMRCanvasList[bodyRegionId] != null || $rootScope.coloredImageMRCanvasList[bodyRegionId] != undefined) {
- coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
+ coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
- }
+ }
+
+ if ($rootScope.whiteImageMRDataList[bodyRegionId] != null || $rootScope.whiteImageMRDataList[bodyRegionId] != undefined) {
+ white = $rootScope.whiteImageMRDataList[bodyRegionId];
+ }
- if ($rootScope.whiteImageMRDataList[bodyRegionId] != null || $rootScope.whiteImageMRDataList[bodyRegionId] != undefined) {
- white = $rootScope.whiteImageMRDataList[bodyRegionId];
}
- }
+ else {
- else {
+ if ($rootScope.coloredImageCanvasList[bodyRegionId - 1] != null || $rootScope.coloredImageCanvasList[bodyRegionId - 1] != undefined) {
+ coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
+ }
+ if ($rootScope.whiteImageDataList[bodyRegionId - 1] != null || $rootScope.whiteImageDataList[bodyRegionId - 1] != undefined) {
+ white = $rootScope.whiteImageDataList[bodyRegionId - 1];
- if ($rootScope.coloredImageCanvasList[bodyRegionId - 1] != null || $rootScope.coloredImageCanvasList[bodyRegionId - 1] != undefined) {
- coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
+ }
}
- if ($rootScope.whiteImageDataList[bodyRegionId - 1] != null || $rootScope.whiteImageDataList[bodyRegionId - 1] != undefined) {
- white = $rootScope.whiteImageDataList[bodyRegionId - 1];
- }
- }
+ var worker = new Worker('extract-wp.js');
- var worker = new Worker('extract-wp.js');
+ //push workers in array to further used the refernece to delete the workers
+ $scope.runningWorkers.push({ 'workerName': worker })
- //push workers in array to further used the refernece to delete the workers
- $scope.runningWorkers.push({ 'workerName': worker })
+ console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white)
- console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white)
+ if (coloredImageDataVar != null && maskData != null && white != null) {
+ worker.postMessage({
- if (coloredImageDataVar != null && maskData != null && white != null) {
- worker.postMessage({
+ 'termList': multiTermList,
+ 'maskCanvasData': maskData,
+ 'coloredImageData': coloredImageDataVar,
+ 'grayImageData': white,
+ 'bodyRegionId': bodyRegionId,
+ 'canvasId': canvasId
- 'termList': multiTermList,
- 'maskCanvasData': maskData,
- 'coloredImageData': coloredImageDataVar,
- 'grayImageData': white,
- 'bodyRegionId': bodyRegionId,
- 'canvasId': canvasId
+ });
+ }
- });
- }
+ //}
- //}
+ worker.onmessage = function (e) {
+ console.log('callback in extract for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
- worker.onmessage = function (e) {
- console.log('callback in extract for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
+ var updatedData = e.data.value;
- var updatedData = e.data.value;
+ var bodyRegionId = e.data.bodyRegionId;
- var bodyRegionId = e.data.bodyRegionId;
+ var canvasId = (e.data.canvasId).replace('_mci', '');
- var canvasId = (e.data.canvasId).replace('_mci', '');
+ //for (var i = 1; i <= updatedData.length; i++) {
+ var grayCanvasID = canvasId;
- //for (var i = 1; i <= updatedData.length; i++) {
- var grayCanvasID = canvasId;
+ // var grayCanvasID = 'imageCanvas' + bodyRegionId;
+ var grayCanvas = document.getElementById(grayCanvasID);
+ var grayCanvasContext = grayCanvas.getContext("2d");
- // var grayCanvasID = 'imageCanvas' + bodyRegionId;
- var grayCanvas = document.getElementById(grayCanvasID);
- var grayCanvasContext = grayCanvas.getContext("2d");
+ grayCanvasContext.putImageData(updatedData, 0, 0);
- grayCanvasContext.putImageData(updatedData, 0, 0);
+ //to resolve lateral arm black issue in highlight mode
- //to resolve lateral arm black issue in highlight mode
+ if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) {
- if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) {
+ var canavsWidth = parseInt(grayCanvas.width);
+ var canavsHeight = parseInt(grayCanvas.height);
- var canavsWidth = parseInt(grayCanvas.width);
- var canavsHeight = parseInt(grayCanvas.height);
+ console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight)
- console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight)
+ var imgData = grayCanvasContext.getImageData(0, 0, canavsWidth, canavsHeight);
+ var data = imgData.data;
+ var c = 0;
+ for (var i = 0; i < data.length; i += 4) {
+ if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
+ data[i + 3] = 0;
+ }
- var imgData = grayCanvasContext.getImageData(0, 0, canavsWidth, canavsHeight);
- var data = imgData.data;
- var c = 0;
- for (var i = 0; i < data.length; i += 4) {
- if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
- data[i + 3] = 0;
}
-
+ grayCanvasContext.putImageData(imgData, 0, 0);
}
- grayCanvasContext.putImageData(imgData, 0, 0);
- }
- CallBackBodyRegion.push(bodyRegionId);
-
- $scope.doAligneCanvasWithTerm = false;
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && (CallBackBodyRegion.length == 9)) {
- $scope.doAligneCanvasWithTerm = true;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && (CallBackBodyRegion.length == 5)) {
- $scope.doAligneCanvasWithTerm = true;
- }
- else if ((($rootScope.viewOrientationId == '5')) && (CallBackBodyRegion.length == 1)) {
- $scope.doAligneCanvasWithTerm = true;
- }
- else if ((($rootScope.viewOrientationId == '6')) && (CallBackBodyRegion.length == 1)) {
- $scope.doAligneCanvasWithTerm = true;
- }
+ CallBackBodyRegion.push(bodyRegionId);
+ $scope.doAligneCanvasWithTerm = false;
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && (CallBackBodyRegion.length == 9)) {
+ $scope.doAligneCanvasWithTerm = true;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && (CallBackBodyRegion.length == 5)) {
+ $scope.doAligneCanvasWithTerm = true;
+ }
+ else if ((($rootScope.viewOrientationId == '5')) && (CallBackBodyRegion.length == 1)) {
+ $scope.doAligneCanvasWithTerm = true;
+ }
+ else if ((($rootScope.viewOrientationId == '6')) && (CallBackBodyRegion.length == 1)) {
+ $scope.doAligneCanvasWithTerm = true;
+ }
- if ($rootScope.multiAnnotationIsON == true) {
- if (canvasId.match('_MR'))
- $rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
- else
- $rootScope.updatedWhiteImageDataList[bodyRegionId - 1] = updatedData;
+ if ($rootScope.multiAnnotationIsON == true) {
+ if (canvasId.match('_MR'))
+ $rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
+ else
+ $rootScope.updatedWhiteImageDataList[bodyRegionId - 1] = updatedData;
- }
- else {
- if (canvasId.match('_MR'))
- $rootScope.whiteImageMRDataList[bodyRegionId] = e.data.value;
+ }
else {
- if ($rootScope.whiteImageDataList[bodyRegionId - 1] != null || $rootScope.whiteImageDataList[bodyRegionId - 1] != undefined)
- $rootScope.whiteImageDataList[bodyRegionId - 1] = e.data.value;
+
+ if (canvasId.match('_MR'))
+ $rootScope.whiteImageMRDataList[bodyRegionId] = e.data.value;
+ else {
+ if ($rootScope.whiteImageDataList[bodyRegionId - 1] != null || $rootScope.whiteImageDataList[bodyRegionId - 1] != undefined)
+ $rootScope.whiteImageDataList[bodyRegionId - 1] = e.data.value;
+ }
}
- }
- //if ((CallBackBodyRegion != null || CallBackBodyRegion[i] != undefined) && (CallBackBodyRegion.length > 0)) {
- // if (CallBackBodyRegion.length == 6) {
- // $rootScope.isLoading = false;
- // $('#spinner').css('visibility', 'hidden');
- // }
- //}
+ //if ((CallBackBodyRegion != null || CallBackBodyRegion[i] != undefined) && (CallBackBodyRegion.length > 0)) {
+ // if (CallBackBodyRegion.length == 6) {
+ // $rootScope.isLoading = false;
+ // $('#spinner').css('visibility', 'hidden');
+ // }
+ //}
- if ($scope.doAligneCanvasWithTerm == true) {
- $scope.aligneCanvasWithTerm();
+ if ($scope.doAligneCanvasWithTerm == true) {
+ $scope.aligneCanvasWithTerm();
- $scope.EnableUI();
- }
+ $scope.EnableUI();
+ }
- // $timeout(function () { $scope.DisableProgressBar() }, 1000);
+ // $timeout(function () { $scope.DisableProgressBar() }, 1000);
- };
- worker.onerror = function (e) {
- alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
- };
+ };
+ worker.onerror = function (e) {
+ alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
+ };
+ }
}
}
- }
- }, 500)
-
- }
-
- $scope.HighlightBodyByTermList = function (TermList) {
-
- // $("#btnTranparency").attr('disabled', 'disabled');
- $rootScope.currentLayerNumber = $scope.layerNumber;
+ }, 500)
- $scope.layerNumber = $('#txtlayerNumber').val();
-
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
-
-
- if ($rootScope.isHighLight == true) {
- false;
}
- console.log('HighlightBodyByTermList is called');
+ $scope.HighlightBodyByTermList = function (TermList) {
- $scope.highlightedBR = [];
+ // $("#btnTranparency").attr('disabled', 'disabled');
+ $rootScope.currentLayerNumber = $scope.layerNumber;
- $scope.terminateCurrentlyRunningWPs();
+ $scope.layerNumber = $('#txtlayerNumber').val();
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- $timeout(function () {
- var loopLength = 0;
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
- loopLength = 9;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
- loopLength = 5;
- }
- else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
- loopLength = 4;
- }
- else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
- loopLength = 1;
+ if ($rootScope.isHighLight == true) {
+ false;
}
- for (var x = 0; x < loopLength; x++) {
+ console.log('HighlightBodyByTermList is called');
- console.log('x value= ' + x);
- if ($rootScope.MaskCanvasData[x] != null || $rootScope.MaskCanvasData[x] != undefined) {
+ $scope.highlightedBR = [];
- var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId;
- var canvasId = $rootScope.MaskCanvasData[x].canvasId;
- var maskData = null;
- maskData = $rootScope.MaskCanvasData[x].maskData;
+ $scope.terminateCurrentlyRunningWPs();
- var coloredImageDataVar = null;
- var grayImageDataVar = null;
- var white;
- if (canvasId.match('_MR')) {
- if ($rootScope.coloredImageMRCanvasList[bodyRegionId] != null || $rootScope.coloredImageMRCanvasList[bodyRegionId] != undefined) {
- coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
- }
+ $timeout(function () {
+ var loopLength = 0;
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
+ loopLength = 9;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
+ loopLength = 5;
+ }
+ else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
+ loopLength = 4;
+ }
+ else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
+ loopLength = 1;
+ }
- if ($rootScope.multiAnnotationIsON == true) {
- //on layer change we need the fresh data not the updated one
- if ($scope.isLayerChange == true) {
- if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
- grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
- }
+ for (var x = 0; x < loopLength; x++) {
+
+ console.log('x value= ' + x);
+ if ($rootScope.MaskCanvasData[x] != null || $rootScope.MaskCanvasData[x] != undefined) {
+
+ var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId;
+ var canvasId = $rootScope.MaskCanvasData[x].canvasId;
+ var maskData = null;
+ maskData = $rootScope.MaskCanvasData[x].maskData;
+
+ var coloredImageDataVar = null;
+ var grayImageDataVar = null;
+
+ var white;
+ if (canvasId.match('_MR')) {
+ if ($rootScope.coloredImageMRCanvasList[bodyRegionId] != null || $rootScope.coloredImageMRCanvasList[bodyRegionId] != undefined) {
+ coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
}
- else {
- if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) {
+
+ if ($rootScope.multiAnnotationIsON == true) {
+ //on layer change we need the fresh data not the updated one
+ if ($scope.isLayerChange == true) {
if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
}
}
else {
- if ($rootScope.updatedGrayMRDataList[bodyRegionId] != null || $rootScope.updatedGrayMRDataList[bodyRegionId] != undefined) {
- grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId]
+ if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) {
+
+ if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
+ grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
+ }
+ }
+ else {
+ if ($rootScope.updatedGrayMRDataList[bodyRegionId] != null || $rootScope.updatedGrayMRDataList[bodyRegionId] != undefined) {
+ grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId]
+ }
}
}
}
- }
- else {
- if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
- grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
+ else {
+ if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
+ grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
+ }
}
- }
-
-
- }
- else {
- if ($rootScope.coloredImageCanvasList[bodyRegionId - 1] != null || $rootScope.coloredImageCanvasList[bodyRegionId - 1] != undefined) {
- coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
}
+ else {
+ if ($rootScope.coloredImageCanvasList[bodyRegionId - 1] != null || $rootScope.coloredImageCanvasList[bodyRegionId - 1] != undefined) {
+ coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
+ }
- if ($rootScope.multiAnnotationIsON == true) {
-
- //on layer change we need the fresh data not the updated one
- if ($scope.isLayerChange == true) {
- if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
- grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
- }
- } else {
- // this code is for the case where user first click on normal mode then extract then again highlight then we need to call highlight body in gray mode
- //and then highlight the previously selected body regions at the time of normal mode.
- if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) {
+ if ($rootScope.multiAnnotationIsON == true) {
+ //on layer change we need the fresh data not the updated one
+ if ($scope.isLayerChange == true) {
if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
+
}
- }
- else {
- if ($rootScope.updatedGrayDataList[bodyRegionId - 1] != null || $rootScope.updatedGrayDataList[bodyRegionId - 1] != undefined) {
- // for normal case means without interdepency button case.
- grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1];
+ } else {
+ // this code is for the case where user first click on normal mode then extract then again highlight then we need to call highlight body in gray mode
+ //and then highlight the previously selected body regions at the time of normal mode.
+ if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) {
+
+ if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
+ grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
+ }
+
+ }
+ else {
+ if ($rootScope.updatedGrayDataList[bodyRegionId - 1] != null || $rootScope.updatedGrayDataList[bodyRegionId - 1] != undefined) {
+ // for normal case means without interdepency button case.
+ grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1];
+ }
}
}
}
- }
- else
- if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
- grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
- }
+ else
+ if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
+ grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
+ }
- }
+ }
var worker = new Worker('term-number-wp.js');
@@ -2860,43 +2861,43 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
};
+ }
}
- }
- }, 100)
- }
+ }, 100)
+ }
- $scope.HighlightBodyByTermListForBodySystem = function (TermList) {
+ $scope.HighlightBodyByTermListForBodySystem = function (TermList) {
- $scope.isScrolledToHighlightedBR = false;
- //disable the background till the system gets highlighted.
- document.getElementById("daView").style.pointerEvents="none";
- $('.ui-slider').slider('disable');
- $("#btnTranparency").attr('disabled', 'disabled');
- $rootScope.currentLayerNumber = $scope.layerNumber;
+ $scope.isScrolledToHighlightedBR = false;
+ //disable the background till the system gets highlighted.
+ document.getElementById("daView").style.pointerEvents="none";
+ $('.ui-slider').slider('disable');
+ $("#btnTranparency").attr('disabled', 'disabled');
+ $rootScope.currentLayerNumber = $scope.layerNumber;
- $scope.layerNumber = $('#txtlayerNumber').val();
+ $scope.layerNumber = $('#txtlayerNumber').val();
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- if ($rootScope.isHighLight == true) {
- $rootScope.isHighLight = false;
- $scope.CloseTransparencyBox();
- }
+ if ($rootScope.isHighLight == true) {
+ $rootScope.isHighLight = false;
+ $scope.CloseTransparencyBox();
+ }
- console.log('HighlightBodyByTermListForBodySystem is called');
+ console.log('HighlightBodyByTermListForBodySystem is called');
- $scope.highlightedBR = [];
+ $scope.highlightedBR = [];
- // if ($scope.layerNumber == 224) {
+ // if ($scope.layerNumber == 224) {
var matchedTermListPath = '~/../content/data/json/da/body-views/1/BodySystem_' + $rootScope.systemNumber + '.json';
var grayImageDataVar = null;
- // DataService.getJson(matchedTermListPath)
+ // DataService.getJson(matchedTermListPath)
TermService.getTermData($scope.layerNumber, $rootScope.voId, $rootScope.systemNumber, $rootScope.zoomInOut)
.then(
@@ -3152,2828 +3153,3017 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
});
- // }
- }
-
+ // }
+ }
- $scope.scrollToHighlightedBodyRegion = function(TermExistInBodyRegionId){
- if ($scope.isScrolledToHighlightedBR == false) {
+
+ $scope.scrollToHighlightedBodyRegion = function(TermExistInBodyRegionId){
+ if ($scope.isScrolledToHighlightedBR == false) {
- $scope.bodyRegionCoordinates = new jinqJs()
- .from($rootScope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
- .where('_ViewOrientationId == ' + $rootScope.viewOrientationId)
- .select();
+ $scope.bodyRegionCoordinates = new jinqJs()
+ .from($rootScope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
+ .where('_ViewOrientationId == ' + $rootScope.viewOrientationId)
+ .select();
- $scope.TermExistInBodyRegionData = new jinqJs()
- .from($scope.bodyRegionCoordinates)
- .where('_BodyRegionId == ' + TermExistInBodyRegionId)
- .select();
+ $scope.TermExistInBodyRegionData = new jinqJs()
+ .from($scope.bodyRegionCoordinates)
+ .where('_BodyRegionId == ' + TermExistInBodyRegionId)
+ .select();
- var rectangle = scaleRectangle($scope.TermExistInBodyRegionData[0]._X, $scope.TermExistInBodyRegionData[0]._Y, $scope.TermExistInBodyRegionData[0]._Height, $scope.TermExistInBodyRegionData[0]._Width, $scope.TermExistInBodyRegionData[0]._MirrorValue);
+ var rectangle = scaleRectangle($scope.TermExistInBodyRegionData[0]._X, $scope.TermExistInBodyRegionData[0]._Y, $scope.TermExistInBodyRegionData[0]._Height, $scope.TermExistInBodyRegionData[0]._Width, $scope.TermExistInBodyRegionData[0]._MirrorValue);
- $('#canvasDiv').scrollTop(rectangle.scaledY);
- $scope.isScrolledToHighlightedBR = true;
+ $('#canvasDiv').scrollTop(rectangle.scaledY);
+ $scope.isScrolledToHighlightedBR = true;
+ }
}
- }
- $scope.createTermListByPreviousTermsAndHighlight = function () {
+ $scope.createTermListByPreviousTermsAndHighlight = function () {
- var multiTermList = [];
+ var multiTermList = [];
- angular.forEach($rootScope.previousHighlightList, function (value, key) {
- var ActualTermNo = $scope.getActualTermNumber(value);
- if (ActualTermNo != null && ActualTermNo != undefined) {
- var TermList = $scope.getTermNumberList(ActualTermNo);
- if (TermList != null) {
- for (var i = 0; i < TermList.length; i++) {
+ angular.forEach($rootScope.previousHighlightList, function (value, key) {
+ var ActualTermNo = $scope.getActualTermNumber(value);
+ if (ActualTermNo != null && ActualTermNo != undefined) {
+ var TermList = $scope.getTermNumberList(ActualTermNo);
+ if (TermList != null) {
+ for (var i = 0; i < TermList.length; i++) {
- multiTermList.push(TermList[i]);
+ multiTermList.push(TermList[i]);
+ }
}
}
- }
- });
+ });
- console.log('createTermListByPreviousTermsAndHighlight is called');
+ console.log('createTermListByPreviousTermsAndHighlight is called');
- if ((multiTermList != undefined && multiTermList != null) && multiTermList.length > 0) {
+ if ((multiTermList != undefined && multiTermList != null) && multiTermList.length > 0) {
- $timeout(function () { $scope.HighlightBodyByTermList(multiTermList); }, 50);
- }
- else {
- $rootScope.isLoading = false;
+ $timeout(function () { $scope.HighlightBodyByTermList(multiTermList); }, 50);
+ }
+ else {
+ $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
+ $('#spinner').css('visibility', 'hidden');
+ }
}
- }
- $scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) {
- var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1);
+ $scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) {
+ var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1);
- pixelData.data[0] = pixelData.data[0] - 9;
- pixelData.data[1] = pixelData.data[1] - 9;
- pixelData.data[2] = pixelData.data[2] - 9;
- var Red;
- var Green;
- var Blue;
- var zero = "0";
+ pixelData.data[0] = pixelData.data[0] - 9;
+ pixelData.data[1] = pixelData.data[1] - 9;
+ pixelData.data[2] = pixelData.data[2] - 9;
+ var Red;
+ var Green;
+ var Blue;
+ var zero = "0";
- if ((pixelData.data[0]).toString().length != 2) {
- Red = zero.concat((pixelData.data[0]).toString())
- }
- else {
- Red = (pixelData.data[0]).toString()
- }
- if ((pixelData.data[1]).toString().length != 2) {
- Green = zero.concat((pixelData.data[1]).toString())
- }
- else {
- Green = (pixelData.data[1]).toString()
+ if ((pixelData.data[0]).toString().length != 2) {
+ Red = zero.concat((pixelData.data[0]).toString())
+ }
+ else {
+ Red = (pixelData.data[0]).toString()
+ }
+ if ((pixelData.data[1]).toString().length != 2) {
+ Green = zero.concat((pixelData.data[1]).toString())
+ }
+ else {
+ Green = (pixelData.data[1]).toString()
- }
- if ((pixelData.data[2]).toString().length != 2) {
- Blue = zero.concat((pixelData.data[2]).toString())
- }
- else {
- Blue = (pixelData.data[2]).toString()
+ }
+ if ((pixelData.data[2]).toString().length != 2) {
+ Blue = zero.concat((pixelData.data[2]).toString())
+ }
+ else {
+ Blue = (pixelData.data[2]).toString()
+ }
+ var RGBColor = (Red + Green + Blue);
+ return RGBColor;
}
- var RGBColor = (Red + Green + Blue);
- return RGBColor;
- }
- //get annotation from term number
- $scope.GetAnnotationText = function (termNumber) {
+ //get annotation from term number
+ $scope.GetAnnotationText = function (termNumber) {
- $rootScope.annotationText = [];
- var annotationText;
- var annotation = [];
- //0
- var figLeafTermNo = 5868; // to do declare constant for this
-
- if (parseInt(termNumber) != parseInt(figLeafTermNo)) {
- $scope.TermNumber = termNumber;
- for (var j = 0; j <= $rootScope.lexiconLanguageArray.length - 1; j++) {
- if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined)
- {
- $scope.matchedTermNoData = new jinqJs()
- .from($rootScope.TermNumberData.TermData.Term)
- .where('_TermNumber == ' + termNumber)
- .select();
-
- if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) {
- //1.
- var actualTermNo = 0;
- for (var z = 0; z < $scope.matchedTermNoData.length; z++) {
- //send actual term no to get the term text.
- actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber;
- annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo, $rootScope.lexiconLanguageArray[j].language);
- annotation.push(annotationText);
- $rootScope.annotationText.push(annotationText);
- $rootScope.actualTermNumber = actualTermNo;
- break;
- };
+ $rootScope.annotationText = [];
+ var annotationText;
+ var annotation = [];
+ //0
+ var figLeafTermNo = 5868; // to do declare constant for this
+
+ if (parseInt(termNumber) != parseInt(figLeafTermNo)) {
+ $scope.TermNumber = termNumber;
+ for (var j = 0; j <= $rootScope.lexiconLanguageArray.length - 1; j++) {
+ if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined)
+ {
+ $scope.matchedTermNoData = new jinqJs()
+ .from($rootScope.TermNumberData.TermData.Term)
+ .where('_TermNumber == ' + termNumber)
+ .select();
- //2.
+ if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) {
+ //1.
+ var actualTermNo = 0;
+ for (var z = 0; z < $scope.matchedTermNoData.length; z++) {
+ //send actual term no to get the term text.
+ actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber;
+ annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo, $rootScope.lexiconLanguageArray[j].language);
+ annotation.push(annotationText);
+ $rootScope.annotationText.push(annotationText);
+ $rootScope.actualTermNumber = actualTermNo;
+ break;
+ };
+
+ //2.
+ }
+ else {
+ // send term no to vocab json data to get the text
+ }
}
else {
- // send term no to vocab json data to get the text
+ var currentBodyViewId = $rootScope.voId;
+ var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
+ DataService.getAnotherJson(termJsonPath)
+ .then(
+ function (result) {
+ $rootScope.TermNumberData = result;
+ $scope.GetAnnotationText(termNumber);
+ })
}
}
- else {
- var currentBodyViewId = $rootScope.voId;
- var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
- DataService.getAnotherJson(termJsonPath)
- .then(
- function (result) {
- $rootScope.TermNumberData = result;
- $scope.GetAnnotationText(termNumber);
- })
- }
}
+
+ return annotation;
}
- return annotation;
- }
+ $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) {
- $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) {
+ var Annotation;
+ $scope.ActualTermNo = actualTermNo;
+ for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) {
- var Annotation;
- $scope.ActualTermNo = actualTermNo;
- for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) {
+ if ($rootScope.vocabTermDataArray[j].language == language) {
- if ($rootScope.vocabTermDataArray[j].language == language) {
+ if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) {
+ $scope.matchedActualTermData = new jinqJs()
+ .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term)
+ .where('_ActualTermNumber == ' + actualTermNo)
+ .select();
- if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) {
- $scope.matchedActualTermData = new jinqJs()
- .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term)
- .where('_ActualTermNumber == ' + actualTermNo)
- .select();
+ if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) {
+ for (var z = 0; z <= $scope.matchedActualTermData.length; z++) {
+ //send actual term no to get the term text.
+ Annotation = $scope.matchedActualTermData[0]._TermText;
+ // alert("Annotation : " + Annotation);
+ break;
+ };
+ }
+ return Annotation;
+ }
- if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) {
- for (var z = 0; z <= $scope.matchedActualTermData.length; z++) {
- //send actual term no to get the term text.
- Annotation = $scope.matchedActualTermData[0]._TermText;
- // alert("Annotation : " + Annotation);
- break;
- };
+ else {
+ return null;
}
- return Annotation;
- }
- else {
- return null;
}
-
}
- }
-
- }
-
-
- //layer change function
- $scope.LayerChange = function () {
- $scope.DisableUI();
-
- //if listanager is visisble then close it
- // $rootScope.isListManagerSelected = false;
-
- $rootScope.CloseListManager();
- $scope.isLayerChange = true;
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
-
- //1.
- $scope.terminateCurrentlyRunningWPs();
+ }
- var canvasDiv = document.getElementById('canvasDiv');
- $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
- $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft;
- // $('#daLoaderLabel').css('visibility', 'visible');
+ //layer change function
+ $scope.LayerChange = function () {
+ $scope.DisableUI();
- if ($rootScope.isTransparencyActivated) {
+ //if listanager is visisble then close it
+ // $rootScope.isListManagerSelected = false;
- //crete temp canavs to store the original data which will be used to chnange the transparency
- if (document.getElementById('tempCanvas') != null) {
- $('#tempCanvas').remove();
- }
+ $rootScope.CloseListManager();
+ $scope.isLayerChange = true;
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- if ($('#speechBubbleTrns').length > 0) {
- $('#speechBubbleTrns').remove();
- }
- var tempCanvas = document.createElement('canvas');
- tempCanvas.id = 'tempCanvas';
- $scope.tempCanvas = tempCanvas.id;
- tempCanvas.height = $scope.transparencyCanvasHeight;
- tempCanvas.width = $scope.transparencyCanvasWidth;
- tempCanvas.style.position = "absolute";
- tempCanvas.style.left = 200 + 'px';
- tempCanvas.style.backgroundColor = "transparent";
- tempCanvas.style.visibility = 'hidden';
+ //1.
+ $scope.terminateCurrentlyRunningWPs();
- if (document.getElementById('canvasDiv') != null)
- document.getElementById('canvasDiv').appendChild(tempCanvas);
+ var canvasDiv = document.getElementById('canvasDiv');
+ $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
+ $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft;
+ // $('#daLoaderLabel').css('visibility', 'visible');
- var tCanvas = document.getElementById('transparencyCanvas');
+ if ($rootScope.isTransparencyActivated) {
- var tCanvasContext = tCanvas.getContext('2d');
+ //crete temp canavs to store the original data which will be used to chnange the transparency
+ if (document.getElementById('tempCanvas') != null) {
+ $('#tempCanvas').remove();
+ }
- var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', ''));
+ if ($('#speechBubbleTrns').length > 0) {
+ $('#speechBubbleTrns').remove();
+ }
+ var tempCanvas = document.createElement('canvas');
+ tempCanvas.id = 'tempCanvas';
+ $scope.tempCanvas = tempCanvas.id;
+ tempCanvas.height = $scope.transparencyCanvasHeight;
+ tempCanvas.width = $scope.transparencyCanvasWidth;
+ tempCanvas.style.position = "absolute";
+ tempCanvas.style.left = 200 + 'px';
+ tempCanvas.style.backgroundColor = "transparent";
+ tempCanvas.style.visibility = 'hidden';
- var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', ''));
+ if (document.getElementById('canvasDiv') != null)
+ document.getElementById('canvasDiv').appendChild(tempCanvas);
- // var tCanvas = document.getElementById('transparencyCanvas');
- if (tCanvas != null) {
- clearTransCanvas();
- }
- var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', ''));
- var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', '')));
- var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', ''));
- var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', ''));
- var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight);
- var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth);
- var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
+ var tCanvas = document.getElementById('transparencyCanvas');
- $scope.transparencyDrawnRegions = [];
- $scope.canThirdBRDrawn = false;
+ var tCanvasContext = tCanvas.getContext('2d');
+ var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', ''));
- $.each(BodyRegionDictionary, function (index, value) {
+ var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', ''));
- if (value.bodyRegionId == '3') {
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
+ // var tCanvas = document.getElementById('transparencyCanvas');
+ if (tCanvas != null) {
+ clearTransCanvas();
+ }
+ var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', ''));
+ var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', '')));
+ var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', ''));
+ var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', ''));
+ var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight);
+ var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth);
- if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
+ var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
- $scope.canThirdBRDrawn = true;
+ $scope.transparencyDrawnRegions = [];
+ $scope.canThirdBRDrawn = false;
- }
+ $.each(BodyRegionDictionary, function (index, value) {
- }
+ if (value.bodyRegionId == '3') {
- var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
- var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
+ var BR_SixTBData = new jinqJs()
+ .from($scope.transparencyDrawnRegions)
+ .where('BRID == 6')
+ .select();
+ if (BR_SixTBData != null && BR_SixTBData != undefined && BR_SixTBData.length > 0) {
- // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
- if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
- //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
+ $scope.canThirdBRDrawn = true;
- $scope.layerNumber = parseInt(txtlayerNumber.value);
- if (($rootScope.voId == "9" || $rootScope.voId == "11" || $rootScope.voId == "2" || $rootScope.voId == "3" || $rootScope.voId == "6" || $rootScope.voId == "7")) {
- if (value.bodyRegionId == "6") {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, true, false, false);
- }
- else {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, true, false, false);
}
- }
- else {
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+
}
- else {
+ var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
+ var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
- if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
- //1. draw 6th
- var BRSixData = new jinqJs()
- .from(BodyRegionDictionary)
- .where('bodyRegionId == 6')
- .select();
- var isMirror = BRSixData[0].IsMirror;
- if (isMirror == 'Yes') {
- //draw mirror arm
- $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- //draw non mirror arm
- $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- //draw 3rd BR
- $timeout(function () {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- }, 200);
+ // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
+ if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
+ //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
+ $scope.layerNumber = parseInt(txtlayerNumber.value);
+ if (($rootScope.voId == "9" || $rootScope.voId == "11" || $rootScope.voId == "2" || $rootScope.voId == "3" || $rootScope.voId == "6" || $rootScope.voId == "7")) {
+ if (value.bodyRegionId == "6") {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, true, false, false);
}
else {
- //draw mirror arm
- $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- //draw non mirror arm
- $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- //draw 3rd BR
- $timeout(function () {
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- }, 200);
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, true, false, false);
}
-
}
else {
- var BR_SixTBData = new jinqJs()
- .from($scope.transparencyDrawnRegions)
- .where('BRID == 6')
- .select();
- if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) { }
- else
- $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
- }
- }
- }
-
- }
-
-
- })
-
- }
+ if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) {
- else {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ }
+ else {
- //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box.
- var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
- if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
- $('#txtlayerNumber').val(dataLength - 1);
- $rootScope.currentLayerNumber = parseInt(dataLength - 1);
- $scope.layerNumber = parseInt(dataLength - 1);
- }
- else
- $rootScope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
+ if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == false) {
- //$scope.isMousUp();
+ //1. draw 6th
+ var BRSixData = new jinqJs()
+ .from(BodyRegionDictionary)
+ .where('bodyRegionId == 6')
+ .select();
+ var isMirror = BRSixData[0].IsMirror;
+ if (isMirror == 'Yes') {
+ //draw mirror arm
+ $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ //draw non mirror arm
+ $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ //draw 3rd BR
+ $timeout(function () {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ }, 200);
-
+ }
+ else {
+ //draw mirror arm
+ $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ //draw non mirror arm
+ $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ //draw 3rd BR
+ $timeout(function () {
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ }, 200);
+ }
+
+ }
+ else {
+ var BR_SixTBData = new jinqJs()
+ .from($scope.transparencyDrawnRegions)
+ .where('BRID == 6')
+ .select();
+ if (value.bodyRegionId == "6" && BR_SixTBData != undefined && BR_SixTBData != null && BR_SixTBData.length > 0) { }
+ else
+ $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false);
+ }
+ }
+ }
+
+ }
+
+
+ })
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
- var canDiv = document.getElementById('canvasDiv');
- var canDivChildCount = canDiv.childElementCount;
- if (canDivChildCount > 0) {
- canDiv.innerHTML = '';
}
+ else {
- //2.
- $scope.CalculateImageCordinates($rootScope.viewOrientationId);
+ //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box.
+ var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
+ if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
+ $('#txtlayerNumber').val(dataLength - 1);
+ $rootScope.currentLayerNumber = parseInt(dataLength - 1);
+ $scope.layerNumber = parseInt(dataLength - 1);
+ }
+ else
+ $rootScope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
- //3.
- $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
- $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)
+ //$scope.isMousUp();
+
- if ($rootScope.isHighlightBodyByBodySystem) {
- $timeout(function () { $scope.DisableProgressBar() }, 20000);
- }
- else {
- $timeout(function () { $scope.DisableProgressBar() }, 2000);
- }
- }
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+ var canDiv = document.getElementById('canvasDiv');
+ var canDivChildCount = canDiv.childElementCount;
+ if (canDivChildCount > 0) {
+ canDiv.innerHTML = '';
+ }
- $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
- // Annotations Closing Code
- $('.com_anno').remove();
+ //2.
+ $scope.CalculateImageCordinates($rootScope.viewOrientationId);
- $('#sppeachBubble_annotation').remove();
- $('#dot_annotation').remove();
- $('#bord_annotation').remove();
+ //3.
+ $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
+ $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)
- $('#dot').remove();
- $('#sppeachBubble').remove();
- $(".com").remove();
- $("#bord").remove();
- if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
- if ($rootScope.isAnnotatiomToolBarPopupActive == false) {
- if ($("#transparencyScale").css("display") == "block") {
- $rootScope.switchToTransparencycanvas();
+ if ($rootScope.isHighlightBodyByBodySystem) {
+ $timeout(function () { $scope.DisableProgressBar() }, 20000);
+ }
+ else {
+ $timeout(function () { $scope.DisableProgressBar() }, 2000);
}
}
- else {
- if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
- $rootScope.switchToTransparencycanvas();
+
+ $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
+
+ // Annotations Closing Code
+
+ $('.com_anno').remove();
+
+ $('#sppeachBubble_annotation').remove();
+ $('#dot_annotation').remove();
+ $('#bord_annotation').remove();
+
+ $('#dot').remove();
+ $('#sppeachBubble').remove();
+ $(".com").remove();
+ $("#bord").remove();
+
+ if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
+ if ($rootScope.isAnnotatiomToolBarPopupActive == false) {
+ if ($("#transparencyScale").css("display") == "block") {
+ $rootScope.switchToTransparencycanvas();
+ }
}
else {
- $('.btnCursor').addClass('activebtncolor');
- $rootScope.switchCanvas();
+ if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
+ $rootScope.switchToTransparencycanvas();
+ }
+ else {
+ $('.btnCursor').addClass('activebtncolor');
+ $rootScope.switchCanvas();
+ }
}
}
- }
- else {
- if ($rootScope.isAnnotatiomToolBarPopupActive == true) {
- $rootScope.CloseAnnotationTool();
+ else {
+ if ($rootScope.isAnnotatiomToolBarPopupActive == true) {
+ $rootScope.CloseAnnotationTool();
+ }
}
}
- }
- $rootScope.PreviouslayerNumbr = 0;
+ $rootScope.PreviouslayerNumbr = 0;
+ $scope.DisableProgressBar = function () {
- $scope.DisableProgressBar = function () {
+ if ($rootScope.isHighLight) {
- if ($rootScope.isHighLight) {
-
- $("#btnHighLight").addClass("btn-primary");
- $("#btnHighLight").removeClass("btn-black");
+ $("#btnHighLight").addClass("btn-primary");
+ $("#btnHighLight").removeClass("btn-black");
- if (!$("#btnNormalMode").hasClass("btn-black")) {
- $("#btnNormalMode").addClass("btn-black");
- }
+ if (!$("#btnNormalMode").hasClass("btn-black")) {
+ $("#btnNormalMode").addClass("btn-black");
+ }
- if (!$("#btnExtract").hasClass("btn-black")) {
- $("#btnExtract").addClass("btn-black");
- }
+ if (!$("#btnExtract").hasClass("btn-black")) {
+ $("#btnExtract").addClass("btn-black");
+ }
- if ($("#btnExtract").hasClass("btn-primary")) {
- $("#btnExtract").removeClass("btn-primary");
- }
+ if ($("#btnExtract").hasClass("btn-primary")) {
+ $("#btnExtract").removeClass("btn-primary");
+ }
- if ($("#btnNormalMode").hasClass("btn-primary")) {
- $("#btnNormalMode").removeClass("btn-primary");
- }
+ if ($("#btnNormalMode").hasClass("btn-primary")) {
+ $("#btnNormalMode").removeClass("btn-primary");
+ }
- console.log('highLightBody call from DisableProgressBar')
+ console.log('highLightBody call from DisableProgressBar')
- // $scope.highLightBody();
+ // $scope.highLightBody();
- }
+ }
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
- }
+ }
- $scope.changeLayer = function () {
- //console.log('changeLayer');
- // alert('slide')
- }
+ $scope.changeLayer = function () {
+ //console.log('changeLayer');
+ // alert('slide')
+ }
- $('layerChangeSlider').slider().on('slideStop', function (ev) {
+ $('layerChangeSlider').slider().on('slideStop', function (ev) {
- var newVal = $('.span2').data('slider').getValue();
- if (originalVal != newVal) {
+ var newVal = $('.span2').data('slider').getValue();
+ if (originalVal != newVal) {
- }
- });
+ }
+ });
- $scope.getMousePos = function (evt) {
+ $scope.getMousePos = function (evt) {
- return {
- x: Math.round(evt.pageX - $('#canvasDiv').offset().left),
- y: Math.round(evt.pageY - $('#canvasDiv').offset().top)
+ return {
+ x: Math.round(evt.pageX - $('#canvasDiv').offset().left),
+ y: Math.round(evt.pageY - $('#canvasDiv').offset().top)
+ }
}
- }
- $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox) {
- if (isAnnotationNotForTBox == true) {
- if ($scope.MultiLanguageAnnationArray.length > 1) {
- $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
+ $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox) {
+ if (isAnnotationNotForTBox == true) {
+ if ($scope.MultiLanguageAnnationArray.length > 1) {
+ $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
- }
- else {
- $scope.longestAnnotation = $scope.MultiLanguageAnnationArray[0];
- }
- //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that
- // we decide the size of speech bubble
- //2.
+ }
+ else {
+ $scope.longestAnnotation = $scope.MultiLanguageAnnationArray[0];
+ }
+ //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that
+ // we decide the size of speech bubble
+ //2.
- if (event.ctrlKey) {
- console.log('ctrl pressed');
- $scope.multiAnnotationIsON = true;
- //2.1 create unique speech bubbles
- $scope.speechBubbleCounter = $scope.speechBubbleCounter + 1;
- var id = "speechBubble" + $scope.speechBubbleCounter;
- //2.2 Get clicked locationa and find if it is already clicked earlier too on same location
- var pointClicked = parseInt(x) + parseInt(y);
- var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length;
- console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint);
- // if user has not clciked on smae point then create speech bubble otherwise not
- if (isClickedOnSamePoint == 0) {
- console.log('not clicked on same point')
- $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id);
- $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id });
- }
- $('.appendDragg').draggable({
- drag: function (evt) {
- $(this).prev('div').css("display", "none");
- var bor_id = $(this).next('div').attr('id');
- var sub_id1 = $(this).attr('id');
- var verticalScrollPosition = canvasDiv.scrollTop;
- var horizontlScrollPosition = canvasDiv.scrollLeft;
- if ($scope.speechbubbleList != null || $scope.speechbubbleList != undefined) {
- for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) {
- if ($scope.speechbubbleList[m].ids == sub_id1) {
- $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id);
- break;
+ if (event.ctrlKey) {
+ console.log('ctrl pressed');
+ $scope.multiAnnotationIsON = true;
+ //2.1 create unique speech bubbles
+ $scope.speechBubbleCounter = $scope.speechBubbleCounter + 1;
+ var id = "speechBubble" + $scope.speechBubbleCounter;
+ //2.2 Get clicked locationa and find if it is already clicked earlier too on same location
+ var pointClicked = parseInt(x) + parseInt(y);
+ var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length;
+ console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint);
+ // if user has not clciked on smae point then create speech bubble otherwise not
+ if (isClickedOnSamePoint == 0) {
+ console.log('not clicked on same point')
+ $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id);
+ $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id });
+ }
+ $('.appendDragg').draggable({
+ drag: function (evt) {
+ $(this).prev('div').css("display", "none");
+ var bor_id = $(this).next('div').attr('id');
+ var sub_id1 = $(this).attr('id');
+ var verticalScrollPosition = canvasDiv.scrollTop;
+ var horizontlScrollPosition = canvasDiv.scrollLeft;
+ if ($scope.speechbubbleList != null || $scope.speechbubbleList != undefined) {
+ for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) {
+ if ($scope.speechbubbleList[m].ids == sub_id1) {
+ $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id);
+ break;
+ }
}
}
- }
- },
- });
- $('.dynCross').on('click', function (evt) {
- //$(this).parent().parent().parent().css('display', 'none');
- $(this).parent().parent().parent().remove();
- });
+ },
+ });
+ $('.dynCross').on('click', function (evt) {
+ //$(this).parent().parent().parent().css('display', 'none');
+ $(this).parent().parent().parent().remove();
+ });
+ }
+ else {
+ $scope.multiAnnotationIsON = false;
+ //history maintained issue
+ if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
+ $("#sppeachBubble").remove();
+ $("#dot").remove();
+ }
+ $(".com").remove();
+ $("#bord").remove();
+ $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y);
+ //history maintained issue
+ if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; }
+ $('#sppeachBubble').draggable(
+ {
+ drag: function (evt) {
+ $("#dot").css("visibility", "hidden");
+ var verticalScrollPosition = canvasDiv.scrollTop;
+ var horizontlScrollPosition = canvasDiv.scrollLeft;
+ $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ },
+ });
+ $('.crossDiv_temp').on('click', function (evt) {
+ $('#sppeachBubble').remove();
+ $("#bord").remove();
+ $("#dot").remove();
+ });
+ }
}
else {
- $scope.multiAnnotationIsON = false;
- //history maintained issue
- if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
- $("#sppeachBubble").remove();
- $("#dot").remove();
- }
- $(".com").remove();
- $("#bord").remove();
- $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y);
- //history maintained issue
- if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; }
- $('#sppeachBubble').draggable(
+ $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; });
+ $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; });
+ if (event.ctrlKey) {
+ $scope.j = $scope.j + 1;
+ var sub_id_annotation = "black_annotation" + $scope.j;
+ var pointClicked_annotation = parseInt(x) + parseInt(y);
+ var Exists_annotation = $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").length;
+ $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation);
+ $scope.speachBubbleArrayAnnotation.push({ xaxis: x, yaxis: y, ids: sub_id_annotation });
+ $('.appendDragg_annotation').draggable({
+ drag: function (evt) {
+ $(this).prev('div').css("display", "none");
+ var bor_id_anno = $(this).next('div').attr('id');
+ var sub_id1_anno = $(this).attr('id');
+ var verticalScrollPosition = canvasDiv.scrollTop;
+ var horizontlScrollPosition = canvasDiv.scrollLeft;
+ if ($scope.speachBubbleArrayAnnotation != null || $scope.speachBubbleArrayAnnotation != undefined) {
+ for (var m = 0; m <= $scope.speachBubbleArrayAnnotation.length - 1; m++) {
+ if ($scope.speachBubbleArrayAnnotation[m].ids == sub_id1_anno) {
+ $scope.angle1($scope.speachBubbleArrayAnnotation[m].xaxis, $scope.speachBubbleArrayAnnotation[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id_anno);
+ break;
+ }
+ }
+ }
+ },
+ });
+ $('.dynCross_anno').on('click', function (evt) {
+ $(this).parent().parent().parent().remove();
+ });
+ }
+ else {
+ $scope.multiAnnotationIsON = false;
+ $(".com_annotation").css("display", "none");
+ $("#bord_annotation").css({ "width": "0px", "display": "none" });
+ $('.dynCross_anno').parent().parent().parent().remove();
+ $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl(x, y);
+ $('#sppeachBubble_annotation').draggable(
{
drag: function (evt) {
- $("#dot").css("visibility", "hidden");
+ $("#dot_annotation").remove();
var verticalScrollPosition = canvasDiv.scrollTop;
var horizontlScrollPosition = canvasDiv.scrollLeft;
- $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
+ $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
},
});
- $('.crossDiv_temp').on('click', function (evt) {
- $('#sppeachBubble').remove();
- $("#bord").remove();
- $("#dot").remove();
- });
+ $('.crossDiv_temp_annotation').on('click', function (evt) {
+ $('#sppeachBubble_annotation').remove();
+ $("#bord_annotation").remove();
+ $("#dot_annotation").remove();
+ });
+ }
}
- }
- else {
- $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; });
- $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; });
- if (event.ctrlKey) {
- $scope.j = $scope.j + 1;
- var sub_id_annotation = "black_annotation" + $scope.j;
- var pointClicked_annotation = parseInt(x) + parseInt(y);
- var Exists_annotation = $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").length;
- $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation);
- $scope.speachBubbleArrayAnnotation.push({ xaxis: x, yaxis: y, ids: sub_id_annotation });
- $('.appendDragg_annotation').draggable({
- drag: function (evt) {
- $(this).prev('div').css("display", "none");
- var bor_id_anno = $(this).next('div').attr('id');
- var sub_id1_anno = $(this).attr('id');
- var verticalScrollPosition = canvasDiv.scrollTop;
- var horizontlScrollPosition = canvasDiv.scrollLeft;
- if ($scope.speachBubbleArrayAnnotation != null || $scope.speachBubbleArrayAnnotation != undefined) {
- for (var m = 0; m <= $scope.speachBubbleArrayAnnotation.length - 1; m++) {
- if ($scope.speachBubbleArrayAnnotation[m].ids == sub_id1_anno) {
- $scope.angle1($scope.speachBubbleArrayAnnotation[m].xaxis, $scope.speachBubbleArrayAnnotation[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id_anno);
- break;
- }
- }
- }
- },
- });
- $('.dynCross_anno').on('click', function (evt) {
- $(this).parent().parent().parent().remove();
- });
+
+ if (document.getElementById("btnStrutureBox").name == "showAnnotationStructure") {
+ $scope.showAnnotation()
}
else {
- $scope.multiAnnotationIsON = false;
- $(".com_annotation").css("display", "none");
- $("#bord_annotation").css({ "width": "0px", "display": "none" });
- $('.dynCross_anno').parent().parent().parent().remove();
- $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl(x, y);
- $('#sppeachBubble_annotation').draggable(
- {
- drag: function (evt) {
- $("#dot_annotation").remove();
- var verticalScrollPosition = canvasDiv.scrollTop;
- var horizontlScrollPosition = canvasDiv.scrollLeft;
- $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
- },
- });
- $('.crossDiv_temp_annotation').on('click', function (evt) {
- $('#sppeachBubble_annotation').remove();
- $("#bord_annotation").remove();
- $("#dot_annotation").remove();
- });
+ $scope.hideAnnotation()
}
- }
-
- if (document.getElementById("btnStrutureBox").name == "showAnnotationStructure") {
- $scope.showAnnotation()
- }
- else {
- $scope.hideAnnotation()
- }
- if ($rootScope.isTBCompleted == true) {
- $('#sppeachBubble').remove();
- $('#dot').remove();
- $('#bord').remove();
- $('.com').remove();
- $rootScope.isTBCompleted = false;
- }
- }
-
- $scope.showAnnotation = function () {
- $(".com").show();
- $('#dot').show();
- $('#bord').show();
- $('#sppeachBubble').show();
- $('#sppeachBubble_annotation').show();
-
- $("#bord_annotation").show();
- $("#dot_annotation").show();
- $(".dynCross_anno").parent().parent().parent().show();
- }
-
- $scope.hideAnnotation = function () {
- $(".com").hide();
- $('#dot').hide();
- $('#bord').hide();
- $('#sppeachBubble').hide();
- $('#sppeachBubble_annotation').hide();
- $("#bord_annotation").hide();
- $("#dot_annotation").hide();
- $(".dynCross_anno").parent().parent().parent().hide();
- }
-
- $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) {
- var sppechBubbleHTML = "
";
- //Issue #7286 :Undefined annotation should not appear
- for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
- var annotation = $scope.MultiLanguageAnnationArray[i];
+ if ($rootScope.isTBCompleted == true) {
+ $('#sppeachBubble').remove();
+ $('#dot').remove();
+ $('#bord').remove();
+ $('.com').remove();
+ $rootScope.isTBCompleted = false;
+ }
}
- if (annotation == undefined) {
- console.log("No text found");
- } else {
+ $scope.showAnnotation = function () {
+ $(".com").show();
+ $('#dot').show();
+ $('#bord').show();
+ $('#sppeachBubble').show();
+ $('#sppeachBubble_annotation').show();
+
+ $("#bord_annotation").show();
+ $("#dot_annotation").show();
+ $(".dynCross_anno").parent().parent().parent().show();
+ }
- $("#canvasDiv").append(sppechBubbleHTML);
+ $scope.hideAnnotation = function () {
+ $(".com").hide();
+ $('#dot').hide();
+ $('#bord').hide();
+ $('#sppeachBubble').hide();
+ $('#sppeachBubble_annotation').hide();
+ $("#bord_annotation").hide();
+ $("#dot_annotation").hide();
+ $(".dynCross_anno").parent().parent().parent().hide();
+ }
+ $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) {
+ var sppechBubbleHTML = "
";
+ //Issue #7286 :Undefined annotation should not appear
for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
var annotation = $scope.MultiLanguageAnnationArray[i];
-
- $("#" + id).append("