@abi-software/scaffoldvuer 1.11.0-demo.1 → 1.11.0-demo.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.11.0-demo.1",
3
+ "version": "1.11.0-demo.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,7 +54,7 @@
54
54
  "vue": "^3.4.21",
55
55
  "vue-router": "^4.2.5",
56
56
  "vue3-component-svg-sprite": "^0.0.1",
57
- "zincjs": "^1.14.2"
57
+ "zincjs": "^1.14.3"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@vitejs/plugin-vue": "^4.6.2",
package/src/App.vue CHANGED
@@ -397,7 +397,7 @@ export default {
397
397
  },
398
398
  data: function () {
399
399
  return {
400
- consoleOn: true,
400
+ consoleOn: false,
401
401
  createLinesWithNormal: false,
402
402
  url: undefined,
403
403
  input: undefined,
@@ -290,7 +290,7 @@
290
290
  ref="backgroundPopover"
291
291
  :virtual-ref="backgroundIconRef"
292
292
  placement="top-start"
293
- width="128"
293
+ width="320"
294
294
  :teleported="false"
295
295
  trigger="click"
296
296
  popper-class="background-popper non-selectable h-auto"
@@ -864,6 +864,7 @@ export default {
864
864
  viewingMode: "Exploration",
865
865
  viewingModes: {
866
866
  "Exploration": "View and explore detailed visualization of 3D scaffolds",
867
+ "Neuron Connection": "Discover nerve connections by selecting a nerve and viewing its associated connections",
867
868
  "Annotation": ['View feature annotations', 'Add, comment on and view feature annotations'],
868
869
  },
869
870
  openMapRef: undefined,
@@ -1041,6 +1042,11 @@ export default {
1041
1042
  setCheckedRegions: function (data) {
1042
1043
  this.checkedRegions = data;
1043
1044
  },
1045
+ /**
1046
+ *
1047
+ * @param nerves array of nerve names, show all nerves if empty
1048
+ * @param processed boolean, whether unselect all checkboxes
1049
+ */
1044
1050
  zoomToNerves: function (nerves, processed = false) {
1045
1051
  if (this.$module.scene) {
1046
1052
  const idsList = [];
@@ -1050,29 +1056,35 @@ export default {
1050
1056
  if (processed) {
1051
1057
  region.hideAllPrimitives();
1052
1058
  if (regionName === 'Nerves') {
1053
- const ids = nerves.reduce((acc, nerve) => {
1054
- const primitive = this.findObjectsWithGroupName(nerve)
1055
- const ids = primitive.map((object) => {
1056
- object.setVisibility(true);
1057
- return `${object.region.uuid}/${object.uuid}`;
1058
- });
1059
- acc.push(...ids);
1060
- return acc;
1061
- }, []);
1062
- idsList.push(...ids)
1059
+ if (nerves.length) {
1060
+ const ids = nerves.reduce((acc, nerve) => {
1061
+ const primitive = this.findObjectsWithGroupName(nerve)
1062
+ const ids = primitive.map((object) => {
1063
+ object.setVisibility(true);
1064
+ return `${object.region.uuid}/${object.uuid}`;
1065
+ });
1066
+ acc.push(...ids);
1067
+ return acc;
1068
+ }, []);
1069
+ idsList.push(...ids)
1070
+ } else {
1071
+ region.showAllPrimitives();
1072
+ idsList.push(region.uuid)
1073
+ }
1063
1074
  }
1064
1075
  } else {
1065
1076
  // if the checkboxes are checked previously, restore them
1066
1077
  const isChecked = this.checkedRegions.find(item => item.label === regionName);
1067
1078
  if (isChecked) {
1068
1079
  region.showAllPrimitives();
1069
- const zincObjects = region.getAllObjects();
1070
- const ids = zincObjects.map(object => object.region.uuid);
1071
- idsList.push(...ids);
1080
+ idsList.push(region.uuid);
1072
1081
  }
1073
1082
  }
1074
1083
  });
1075
- this.$refs.scaffoldTreeControls.setCheckedKeys([...new Set(idsList)], processed);
1084
+ if (nerves.length) {
1085
+ this.fitWindow();
1086
+ }
1087
+ this.$refs.scaffoldTreeControls.setCheckedKeys(idsList, processed);
1076
1088
  }
1077
1089
  },
1078
1090
  enableAxisDisplay: function (enable, miniaxes) {
@@ -1119,7 +1131,7 @@ export default {
1119
1131
  if (groupName in nervesMap) {
1120
1132
  foundNerves++;
1121
1133
  zincObject.setAnatomicalId(nervesMap[groupName]);
1122
- console.log(groupName, zincObject.anatomicalId, zincObject.uuid)
1134
+ // console.log(groupName, zincObject.anatomicalId, zincObject.uuid)
1123
1135
  }
1124
1136
  } else {
1125
1137
  zincObject.userData.isNerves = false;
@@ -2180,6 +2192,7 @@ export default {
2180
2192
  if (this.$module) {
2181
2193
  if (modeName) {
2182
2194
  this.viewingMode = modeName;
2195
+ this.setIsPickable(true);
2183
2196
  }
2184
2197
  this.clearAnnotationFeature();
2185
2198
  if (this.viewingMode === "Annotation") {
@@ -2196,12 +2209,12 @@ export default {
2196
2209
  this.addAnnotationFeature();
2197
2210
  this.loading = false;
2198
2211
  });
2199
- } else {
2200
- if (this.viewingMode === "Exploration") {
2201
- this.activeDrawTool = undefined;
2202
- this.activeDrawMode = undefined;
2203
- this.createData.shape = "";
2204
- }
2212
+ } else if (this.viewingMode === "Exploration") {
2213
+ this.activeDrawTool = undefined;
2214
+ this.activeDrawMode = undefined;
2215
+ this.createData.shape = "";
2216
+ } else if (this.viewingMode === "Neuron Connection") {
2217
+ this.setIsPickable(false);
2205
2218
  }
2206
2219
  if ((this.viewingMode === "Exploration") ||
2207
2220
  (this.viewingMode === "Annotation") &&
@@ -2235,6 +2248,16 @@ export default {
2235
2248
  this.tData.visible = false;
2236
2249
  this.tData.region = undefined;
2237
2250
  },
2251
+ /**
2252
+ * Currently will only apply to non-nerve object
2253
+ * @param flag boolean to control whether objects pickable
2254
+ */
2255
+ setIsPickable: function (flag) {
2256
+ const objects = this.$module.scene.getRootRegion().getAllObjects(true);
2257
+ objects.forEach((zincObject) => {
2258
+ if (!zincObject.userData.isNerves) zincObject.setIsPickable(flag);
2259
+ });
2260
+ },
2238
2261
  /**
2239
2262
  *
2240
2263
  * @param flag boolean
@@ -2500,7 +2523,7 @@ export default {
2500
2523
  //this.$module.scene.createAxisDisplay(false);
2501
2524
  //this.$module.scene.enableAxisDisplay(true, true);
2502
2525
  this.isReady = true;
2503
- console.log(`Total ${totalNerves}, found ${foundNerves}`);
2526
+ // console.log(`Total ${totalNerves}, found ${foundNerves}`);
2504
2527
  this.$nextTick(() => {
2505
2528
  this.restoreSettings(options);
2506
2529
  this.$emit("on-ready");