@abi-software/scaffoldvuer 1.21.0 → 1.21.1-beta.2

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.21.0",
3
+ "version": "1.21.1-beta.2",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": "^24.20.0"
@@ -56,7 +56,7 @@
56
56
  "simple-dropzone": "^0.8.3",
57
57
  "vue": "^3.5.41",
58
58
  "vue-router": "^5.2.0",
59
- "zincjs": "^2.4.0"
59
+ "zincjs": "^2.4.1-beta.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@babel/eslint-parser": "^8.0.1",
package/src/App.vue CHANGED
@@ -731,7 +731,7 @@ export default {
731
731
  "https://mapcore-bucket1.s3.us-west-2.amazonaws.com/digital_twins/080626-demo/downsample_phase_3.nii.gz",
732
732
  "https://mapcore-bucket1.s3.us-west-2.amazonaws.com/digital_twins/080626-demo/downsample_phase_5.nii.gz"
733
733
  ]
734
- const newTexture = await this.$refs.scaffold.readNIFTIFromSource(urls, true, this.maskUrl, v1, options, true);
734
+ const newTexture = await this.$refs.scaffold.readNIFTIFromSource(urls, true, undefined, v1, options, true);
735
735
  newTexture.timeEnabled = true;
736
736
  newTexture.setIsPickable(false);
737
737
  const scene = this.$refs.scaffold.$module.scene;
@@ -771,9 +771,9 @@ export default {
771
771
  this.$refs.scaffold.search(term, true);
772
772
  },
773
773
  viewerMounted: function() {
774
- this.selectedCoordinates =
775
- this.$refs.scaffold.getDynamicSelectedCoordinates();
776
- this.rendererInfo = this.$refs.scaffold.getRendererInfo();
774
+ // this.selectedCoordinates =
775
+ // this.$refs.scaffold.getDynamicSelectedCoordinates();
776
+ // this.rendererInfo = this.$refs.scaffold.getRendererInfo();
777
777
  },
778
778
  PrintViewport: function() {
779
779
  const scene = this.$refs.scaffold.$module.scene;
@@ -466,14 +466,16 @@ export default {
466
466
  },
467
467
  //Set this right at the beginning.
468
468
  setModule: function (moduleIn) {
469
- this.module = markRaw(moduleIn);
470
- this.nodeNumbers = 0;
471
- const objects = this.module.scene.getRootRegion().getAllObjects(true);
472
- objects.forEach((zincObject) => {
473
- this.zincObjectAdded(zincObject);
474
- });
475
- this.module.addOrganPartAddedCallback(this.zincObjectAdded);
476
- this.module.addOrganPartRemovedCallback(this.zincObjectRemoved);
469
+ if (!this.module && moduleIn?.scene) {
470
+ this.module = markRaw(moduleIn);
471
+ this.nodeNumbers = 0;
472
+ const objects = this.module.scene.getRootRegion().getAllObjects(true);
473
+ objects.forEach((zincObject) => {
474
+ this.zincObjectAdded(zincObject);
475
+ });
476
+ this.module.addOrganPartAddedCallback(this.zincObjectAdded);
477
+ this.module.addOrganPartRemovedCallback(this.zincObjectRemoved);
478
+ }
477
479
  },
478
480
  setColourField: function (treeData, nodeData = undefined) {
479
481
  treeData
@@ -970,6 +970,11 @@ export default {
970
970
  isSearch: false,
971
971
  }),
972
972
  //checkedRegions: []
973
+ unwatchURL: null,
974
+ unwatchRegion: null,
975
+ unwatchState: null,
976
+ unwatchViewURL: null,
977
+ unwatchMarkerCluster: null,
973
978
  };
974
979
  },
975
980
  watch: {
@@ -979,6 +984,7 @@ export default {
979
984
  },
980
985
  immediate: true,
981
986
  },
987
+ /*
982
988
  url: {
983
989
  handler: function (newValue) {
984
990
  if (this.state === undefined || this.state.url === undefined)
@@ -1005,6 +1011,13 @@ export default {
1005
1011
  },
1006
1012
  immediate: true,
1007
1013
  },
1014
+ markerCluster: {
1015
+ handler: function (val) {
1016
+ this.$module.scene.enableMarkerCluster(val);
1017
+ },
1018
+ immediate: true,
1019
+ },
1020
+ */
1008
1021
  helpMode: function (newVal, oldVal) {
1009
1022
  if (newVal !== oldVal) {
1010
1023
  this.setHelpMode(newVal)
@@ -1045,12 +1058,6 @@ export default {
1045
1058
  render: function (val) {
1046
1059
  this.toggleRendering(val);
1047
1060
  },
1048
- markerCluster: {
1049
- handler: function (val) {
1050
- this.$module.scene.enableMarkerCluster(val);
1051
- },
1052
- immediate: true,
1053
- },
1054
1061
  markerLabels: function(labels) {
1055
1062
  for (const [key, value] of Object.entries(this.previousMarkerLabels)) {
1056
1063
  this.setMarkerModeForObjectsWithName(key, value, "off");
@@ -1070,16 +1077,15 @@ export default {
1070
1077
  this.availableBackground = ["white", "black", "lightskyblue"];
1071
1078
  this.$_searchIndex = new SearchIndex();
1072
1079
  },
1073
- mounted: function () {
1080
+ mounted: async function () {
1074
1081
  this.openMapRef = shallowRef(this.$refs.openMapRef);
1075
1082
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
1076
- this.$refs.scaffoldTreeControls.setModule(this.$module);
1077
1083
  let eventNotifier = new EventNotifier();
1078
1084
  eventNotifier.subscribe(this, this.eventNotifierCallback);
1079
1085
  this.$module.addNotifier(eventNotifier);
1080
1086
  this.$module.addOrganPartAddedCallback(this.zincObjectAdded);
1081
1087
  this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved);
1082
- this.$module.initialiseRenderer(this.$refs.display);
1088
+ await this.$module.initialise(this.$refs.display);
1083
1089
  this.toggleRendering(this.render);
1084
1090
  this.clientHeight = this.$refs.scaffoldContainer.$el.clientHeight;
1085
1091
  this.ro = new ResizeObserver(this.adjustLayout).observe(
@@ -1094,8 +1100,62 @@ export default {
1094
1100
  this.$module.zincRenderer.addContextRestoredCallbackFunction(() => {
1095
1101
  this.backgroundChangeCallback(this.currentBackground);
1096
1102
  })
1103
+ //Setup some watchers that depend on threejs init()
1104
+ this.unwatchURL = this.$watch(
1105
+ 'url',
1106
+ (newVal) => {
1107
+ if (this.state === undefined || this.state.url === undefined) {
1108
+ this.setURL(newVal);
1109
+ }
1110
+ },
1111
+ { immediate: true } // Runs immediately after creation, if desired
1112
+ );
1113
+ this.unwatchRegion = this.$watch(
1114
+ 'region',
1115
+ (region) => {
1116
+ if (!(this.state || this.viewURL)) {
1117
+ this.setFocusedRegion(region);
1118
+ }
1119
+ },
1120
+ { immediate: true }
1121
+ );
1122
+ this.unwatchState = this.$watch(
1123
+ 'state',
1124
+ (state) => {
1125
+ this.setState(state);
1126
+ },
1127
+ { deep: true, immediate: true }
1128
+ );
1129
+ this.unwatchViewURL = this.$watch(
1130
+ 'viewURL',
1131
+ (viewURL) => {
1132
+ this.updateViewURL(viewURL);
1133
+ },
1134
+ { immediate: true }
1135
+ );
1136
+ this.unwatchURL = this.$watch(
1137
+ 'url',
1138
+ (newValue) => {
1139
+ if (this.state === undefined || this.state.url === undefined) {
1140
+ this.setURL(newValue);
1141
+ }
1142
+ },
1143
+ { immediate: true }
1144
+ );
1145
+ this.unwatchMarkerCluster = this.$watch(
1146
+ 'markerCluster',
1147
+ (val) => {
1148
+ this.$module.scene.enableMarkerCluster(val);
1149
+ },
1150
+ { immediate: true }
1151
+ );
1097
1152
  },
1098
1153
  beforeUnmount: function () {
1154
+ if (this.unwatchURL) this.unwatchURL();
1155
+ if (this.unwatchRegion) this.unwatchRegion();
1156
+ if (this.unwatchState) this.unwatchState();
1157
+ if (this.unwatchViewURL) this.unwatchViewURL();
1158
+ if (this.unwatchMarkerCluster) this.unwatchMarkerCluster();
1099
1159
  if (this.ro) this.ro.disconnect();
1100
1160
  this.$module.destroy();
1101
1161
  this.$module = undefined;
@@ -1791,9 +1851,12 @@ export default {
1791
1851
  this.tData.x = 50;
1792
1852
  this.tData.y = 200;
1793
1853
  if (this._tempPoint) {
1794
- const positionAttribute = this._tempPoint.geometry.getAttribute( 'position' );
1854
+ const positionAttribute = this._tempPoint.geometry.getAttribute( 'instancePosition' );
1795
1855
  positionAttribute.setXYZ(0, worldCoords[0], worldCoords[1], worldCoords[2]);
1796
1856
  positionAttribute.needsUpdate = true;
1857
+ this._tempPoint.pointPositions[0] = worldCoords[0];
1858
+ this._tempPoint.pointPositions[1] = worldCoords[1];
1859
+ this._tempPoint.pointPositions[2] = worldCoords[2];
1797
1860
  } else {
1798
1861
  this._tempPoint = this.$module.scene.addTemporaryPoints(
1799
1862
  [worldCoords], 0x00ffff);
@@ -3075,6 +3138,7 @@ export default {
3075
3138
  );
3076
3139
  }
3077
3140
  if (this.$module && this.$module.scene) {
3141
+ this.$refs.scaffoldTreeControls.setModule(this.$module);
3078
3142
  this.$module.scene.displayMarkers = this.displayMarkers;
3079
3143
  this.$module.scene.forcePickableObjectsUpdate = true;
3080
3144
  this.$module.scene.displayMinimap = this.displayMinimap;
@@ -25,21 +25,6 @@ BaseModule.prototype.settingsChanged = function() {
25
25
  }
26
26
  }
27
27
 
28
- BaseModule.prototype.exportSettings = function() {
29
- const settings = {};
30
- settings.dialog = this.typeName;
31
- settings.name = this.instanceName;
32
- return settings;
33
- }
34
-
35
- BaseModule.prototype.importSettings = function(settings) {
36
- if (settings.dialog == this.typeName) {
37
- this.setName(settings.name);
38
- return true;
39
- }
40
- return false;
41
- }
42
-
43
28
  BaseModule.prototype.publishChanges = function(annotations, eventType, zincObjects) {
44
29
  for (let i = 0; i < this.eventNotifiers.length; i++) {
45
30
  this.eventNotifiers[i].publish(this, eventType, annotations, zincObjects);
@@ -58,7 +43,7 @@ BaseModule.prototype.destroy = function() {
58
43
  }
59
44
 
60
45
  delete this;
61
- }
46
+ }
62
47
 
63
48
  BaseModule.prototype.addChangedCallback = function(callback) {
64
49
  if (this.onChangedCallbacks.includes(callback) == false)
@@ -70,7 +55,7 @@ BaseModule.prototype.removeChangedCallback = function(callback) {
70
55
  if (index > -1) {
71
56
  this.onChangedCallbacks.splice(index, 1);
72
57
  }
73
- }
58
+ }
74
59
 
75
60
  BaseModule.prototype.addNotifier = function(eventNotifier) {
76
61
  this.eventNotifiers.push(eventNotifier);