@abi-software/scaffoldvuer 0.1.52-beta.0 → 0.1.52-beta.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.
@@ -8,6 +8,12 @@
8
8
  element-loading-background="rgba(0, 0, 0, 0.3)"
9
9
  >
10
10
  <map-svg-sprite-color />
11
+ <scaffold-tooltip
12
+ :label="tData.label"
13
+ :visible="tData.visible"
14
+ :x="tData.x"
15
+ :y="tData.y"
16
+ />
11
17
  <div
12
18
  id="organsDisplayArea"
13
19
  ref="display"
@@ -44,8 +50,8 @@
44
50
  trigger="manual"
45
51
  popper-class="scaffold-popper right-popper non-selectable"
46
52
  />
47
- <TraditionalControls
48
- ref="traditionalControl"
53
+ <tree-controls
54
+ ref="treeControl"
49
55
  v-popover:checkBoxPopover
50
56
  :help-mode="helpMode"
51
57
  :module="$module"
@@ -55,7 +61,7 @@
55
61
  @drawer-toggled="drawerToggled"
56
62
  />
57
63
  <div class="opacity-box">
58
- <OpacityControls ref="opacityControl" />
64
+ <opacity-controls ref="opacityControl" />
59
65
  </div>
60
66
  <el-popover
61
67
  v-if="sceneData.timeVarying"
@@ -240,7 +246,8 @@
240
246
  /* eslint-disable no-alert, no-console */
241
247
  import Vue from "vue";
242
248
  import OpacityControls from "./OpacityControls";
243
- import TraditionalControls from "./TraditionalControls";
249
+ import ScaffoldTooltip from "./ScaffoldTooltip";
250
+ import TreeControls from "./TreeControls";
244
251
  import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
245
252
 
246
253
  import {
@@ -275,15 +282,16 @@ const EventNotifier = require("../scripts/eventNotifier").EventNotifier;
275
282
  * A vue component of the scaffold viewer.
276
283
  *
277
284
  * @requires ./OpacityControls.vue
278
- * @requires ./TraditionalControls.vue
285
+ * @requires ./TreeControls.vue
279
286
  */
280
287
  export default {
281
288
  name: "ScaffoldVuer",
282
289
  components: {
283
- OpacityControls,
284
290
  MapSvgIcon,
285
291
  MapSvgSpriteColor,
286
- TraditionalControls
292
+ OpacityControls,
293
+ ScaffoldTooltip,
294
+ TreeControls,
287
295
  },
288
296
  props: {
289
297
  /**
@@ -458,7 +466,14 @@ export default {
458
466
  }
459
467
  ],
460
468
  currentSpeed: 1,
461
- timeStamps: {}
469
+ timeStamps: {},
470
+ defaultCheckedKeys: [],
471
+ tData: {
472
+ label: "",
473
+ visible: false,
474
+ x: 200,
475
+ y: 200
476
+ }
462
477
  };
463
478
  },
464
479
  watch: {
@@ -665,7 +680,11 @@ export default {
665
680
  let objects = this.$module.scene.findObjectsWithGroupName(name);
666
681
  let box = this.$module.scene.getBoundingBoxOfZincObjects(objects);
667
682
  if (box) {
668
- this.$module.scene.viewAllWithBoundingBox(box);
683
+ if (this.$module.isSyncControl()) {
684
+ this.$module.setSyncControlZoomToBox(box);
685
+ } else {
686
+ this.$module.scene.viewAllWithBoundingBox(box);
687
+ }
669
688
  }
670
689
  }
671
690
  },
@@ -719,39 +738,47 @@ export default {
719
738
  */
720
739
  eventNotifierCallback: function(event) {
721
740
  if (event.eventType == 1) {
722
- if (this.$refs.traditionalControl) {
741
+ if (this.$refs.treeControl) {
723
742
  if (event.identifiers[0]) {
724
743
  let id = event.identifiers[0].data.id
725
744
  ? event.identifiers[0].data.id
726
745
  : event.identifiers[0].data.group;
727
- this.$refs.traditionalControl.changeActiveByName(id, true);
746
+ let region = event.identifiers[0].data.region;
747
+ this.$refs.treeControl.changeActiveByName(id, region, true);
728
748
  } else {
729
- this.$refs.traditionalControl.removeActive(true);
749
+ this.$refs.treeControl.removeActive(true);
730
750
  }
731
751
  }
732
- /**
733
- * Triggers when an object has been selected
734
- *
735
- * @property {array} identifiers array of identifiers
736
- * of selected object.
737
- */
752
+ // Triggers when an object has been selected
738
753
  this.$emit("scaffold-selected", event.identifiers);
739
754
  } else if (event.eventType == 2) {
740
- if (this.$refs.traditionalControl) {
741
- if (event.identifiers[0]) {
742
- let id = event.identifiers[0].data.id
743
- ? event.identifiers[0].data.id
744
- : event.identifiers[0].data.group;
745
- this.$refs.traditionalControl.changeHoverByName(id, true);
746
- } else this.$refs.traditionalControl.removeHover(true);
755
+ this.tData.visible = false;
756
+ if (event.identifiers[0]) {
757
+ let id = event.identifiers[0].data.id
758
+ ? event.identifiers[0].data.id
759
+ : event.identifiers[0].data.group;
760
+ if (event.identifiers[0].coords) {
761
+ this.tData.visible = true;
762
+ this.tData.label = id;
763
+ this.tData.x = event.identifiers[0].coords.x;
764
+ this.tData.y =event.identifiers[0].coords.y;
765
+ }
766
+ if (this.$refs.treeControl) {
767
+ let region = event.identifiers[0].data.region;
768
+ this.$refs.treeControl.changeHoverByName(id, region, true);
769
+ } else {
770
+ this.$refs.treeControl.removeHover(true);
771
+ }
747
772
  }
748
- /**
749
- * Triggers when an object has been highlighted
750
- *
751
- * @property {array} identifiers array of identifiers
752
- * of highlighted object.
753
- */
773
+ // Triggers when an object has been highlighted
754
774
  this.$emit("scaffold-highlighted", event.identifiers);
775
+ } else if (event.eventType == 3) { //MOVE
776
+ if (event.identifiers[0]) {
777
+ if (event.identifiers[0].coords) {
778
+ this.tData.x = event.identifiers[0].coords.x;
779
+ this.tData.y = event.identifiers[0].coords.y;
780
+ }
781
+ }
755
782
  }
756
783
  },
757
784
  /**
@@ -792,8 +819,8 @@ export default {
792
819
  if (object !== this.selectedObject) {
793
820
  this.selectedObject = object;
794
821
  this.$refs.opacityControl.setObject(this.selectedObject);
795
- if (object) this.$module.setSelectedByZincObject(object, propagate);
796
- else this.$module.setSelectedByObjects([], propagate);
822
+ if (object) this.$module.setSelectedByZincObject(object, undefined, propagate);
823
+ else this.$module.setSelectedByObjects([], undefined, propagate);
797
824
  }
798
825
  },
799
826
  /**
@@ -804,31 +831,31 @@ export default {
804
831
  objectHovered: function(object, propagate) {
805
832
  if (object !== this.hoveredObject) {
806
833
  this.hoveredObject = object;
807
- if (object) this.$module.setHighlightedByZincObject(object, propagate);
808
- else this.$module.setHighlightedByObjects([], propagate);
834
+ if (object) this.$module.setHighlightedByZincObject(object, undefined, propagate);
835
+ else this.$module.setHighlightedByObjects([], undefined, propagate);
809
836
  }
810
837
  },
811
838
  /**
812
839
  * Set the selected by name.
813
840
  *
814
- * @param {name} name Name of the region
841
+ * @param {name} name Name of the group
815
842
  */
816
- changeActiveByName: function(name, propagate) {
843
+ changeActiveByName: function(name, region, propagate) {
817
844
  if (name === undefined)
818
- this.$refs.traditionalControl.removeActive(propagate);
845
+ this.$refs.treeControl.removeActive(propagate);
819
846
  else
820
- this.$refs.traditionalControl.changeActiveByName(name, propagate);
847
+ this.$refs.treeControl.changeActiveByName(name, region, propagate);
821
848
  },
822
849
  /**
823
850
  * Set the highlighted by name.
824
851
  *
825
- * @param {name} name Name of the region
852
+ * @param {name} name Name of the group
826
853
  */
827
- changeHighlightedByName: function(name, propagate) {
854
+ changeHighlightedByName: function(name, region, propagate) {
828
855
  if (name === undefined)
829
- this.$refs.traditionalControl.removeHover(propagate);
856
+ this.$refs.treeControl.removeHover(propagate);
830
857
  else
831
- this.$refs.traditionalControl.changeHoverByName(name, propagate);
858
+ this.$refs.treeControl.changeHoverByName(name, region, propagate);
832
859
  },
833
860
  /**
834
861
  * Start the animation.
@@ -915,7 +942,7 @@ export default {
915
942
  if (options.visibility) {
916
943
  // Some UIs may not be ready at this time.
917
944
  this.$nextTick(() => {
918
- this.$refs.traditionalControl.setState(options.visibility);
945
+ this.$refs.treeControl.setState(options.visibility);
919
946
  });
920
947
  }
921
948
  }
@@ -923,6 +950,7 @@ export default {
923
950
  this.$module.updateTime(0.01);
924
951
  this.$module.updateTime(0);
925
952
  this.$module.unsetFinishDownloadCallback();
953
+ this.$emit("on-ready");
926
954
  this.isReady = true;
927
955
  };
928
956
  },
@@ -938,8 +966,8 @@ export default {
938
966
  viewport: undefined,
939
967
  visibility: undefined
940
968
  };
941
- if (this.$refs.traditionalControl)
942
- state.visibility = this.$refs.traditionalControl.getState();
969
+ if (this.$refs.treeControl)
970
+ state.visibility = this.$refs.treeControl.getState();
943
971
  if (this.$module.scene) {
944
972
  let zincCameraControls = this.$module.scene.getZincCameraControls();
945
973
  state.viewport = zincCameraControls.getCurrentViewport();
@@ -967,7 +995,7 @@ export default {
967
995
  .getZincCameraControls()
968
996
  .setCurrentCameraSettings(state.viewport);
969
997
  if (state.visibility)
970
- this.$refs.traditionalControl.setState(state.visibility);
998
+ this.$refs.treeControl.setState(state.visibility);
971
999
  } else {
972
1000
  this.$module.setFinishDownloadCallback(
973
1001
  this.setURLFinishCallback({
@@ -996,8 +1024,8 @@ export default {
996
1024
  let visibility =
997
1025
  state && state.visibility ? state.visibility : undefined;
998
1026
  this._currentURL = newValue;
999
- if (this.$refs.traditionalControl)
1000
- this.$refs.traditionalControl.clear();
1027
+ if (this.$refs.treeControl)
1028
+ this.$refs.treeControl.clear();
1001
1029
  this.loading = true;
1002
1030
  this.isReady = false;
1003
1031
  this.$module.setFinishDownloadCallback(
@@ -1039,7 +1067,6 @@ export default {
1039
1067
  },
1040
1068
  /**
1041
1069
  * Callback using ResizeObserver.
1042
-
1043
1070
  */
1044
1071
  adjustLayout: function() {
1045
1072
  let width = this.$refs.scaffoldContainer.clientWidth;
@@ -1063,6 +1090,14 @@ export default {
1063
1090
  if (this.$module.zincRenderer) {
1064
1091
  this.$module.zincRenderer.onWindowResize();
1065
1092
  }
1093
+ },
1094
+ syncControlCallback: function() {
1095
+ const payload = this.$module.NDCCameraControl.getPanZoom();
1096
+ this.$emit("scaffold-navigated", payload);
1097
+ },
1098
+ toggleSyncControl: function(flag) {
1099
+ this.$module.toggleSyncControl(flag);
1100
+ this.$module.setSyncControlCallback(this.syncControlCallback);
1066
1101
  }
1067
1102
  }
1068
1103
  };