@abi-software/scaffoldvuer 0.1.52-beta.1 → 0.1.52-beta.4

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,49 @@ 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
+ const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
757
+ if (event.identifiers[0]) {
758
+ let id = event.identifiers[0].data.id
759
+ ? event.identifiers[0].data.id
760
+ : event.identifiers[0].data.group;
761
+ if (event.identifiers[0].coords) {
762
+ this.tData.visible = true;
763
+ this.tData.label = id;
764
+ this.tData.x = event.identifiers[0].coords.x - offsets.left;
765
+ this.tData.y = event.identifiers[0].coords.y - offsets.top;
766
+ }
767
+ if (this.$refs.treeControl) {
768
+ let region = event.identifiers[0].data.region;
769
+ this.$refs.treeControl.changeHoverByName(id, region, true);
770
+ } else {
771
+ this.$refs.treeControl.removeHover(true);
772
+ }
747
773
  }
748
- /**
749
- * Triggers when an object has been highlighted
750
- *
751
- * @property {array} identifiers array of identifiers
752
- * of highlighted object.
753
- */
774
+ // Triggers when an object has been highlighted
754
775
  this.$emit("scaffold-highlighted", event.identifiers);
776
+ } else if (event.eventType == 3) { //MOVE
777
+ if (event.identifiers[0]) {
778
+ if (event.identifiers[0].coords) {
779
+ const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
780
+ this.tData.x = event.identifiers[0].coords.x - offsets.left;
781
+ this.tData.y = event.identifiers[0].coords.y - offsets.top;
782
+ }
783
+ }
755
784
  }
756
785
  },
757
786
  /**
@@ -792,8 +821,8 @@ export default {
792
821
  if (object !== this.selectedObject) {
793
822
  this.selectedObject = object;
794
823
  this.$refs.opacityControl.setObject(this.selectedObject);
795
- if (object) this.$module.setSelectedByZincObject(object, propagate);
796
- else this.$module.setSelectedByObjects([], propagate);
824
+ if (object) this.$module.setSelectedByZincObject(object, undefined, propagate);
825
+ else this.$module.setSelectedByObjects([], undefined, propagate);
797
826
  }
798
827
  },
799
828
  /**
@@ -804,31 +833,31 @@ export default {
804
833
  objectHovered: function(object, propagate) {
805
834
  if (object !== this.hoveredObject) {
806
835
  this.hoveredObject = object;
807
- if (object) this.$module.setHighlightedByZincObject(object, propagate);
808
- else this.$module.setHighlightedByObjects([], propagate);
836
+ if (object) this.$module.setHighlightedByZincObject(object, undefined, propagate);
837
+ else this.$module.setHighlightedByObjects([], undefined, propagate);
809
838
  }
810
839
  },
811
840
  /**
812
841
  * Set the selected by name.
813
842
  *
814
- * @param {name} name Name of the region
843
+ * @param {name} name Name of the group
815
844
  */
816
- changeActiveByName: function(name, propagate) {
845
+ changeActiveByName: function(name, region, propagate) {
817
846
  if (name === undefined)
818
- this.$refs.traditionalControl.removeActive(propagate);
847
+ this.$refs.treeControl.removeActive(propagate);
819
848
  else
820
- this.$refs.traditionalControl.changeActiveByName(name, propagate);
849
+ this.$refs.treeControl.changeActiveByName(name, region, propagate);
821
850
  },
822
851
  /**
823
852
  * Set the highlighted by name.
824
853
  *
825
- * @param {name} name Name of the region
854
+ * @param {name} name Name of the group
826
855
  */
827
- changeHighlightedByName: function(name, propagate) {
856
+ changeHighlightedByName: function(name, region, propagate) {
828
857
  if (name === undefined)
829
- this.$refs.traditionalControl.removeHover(propagate);
858
+ this.$refs.treeControl.removeHover(propagate);
830
859
  else
831
- this.$refs.traditionalControl.changeHoverByName(name, propagate);
860
+ this.$refs.treeControl.changeHoverByName(name, region, propagate);
832
861
  },
833
862
  /**
834
863
  * Start the animation.
@@ -915,7 +944,7 @@ export default {
915
944
  if (options.visibility) {
916
945
  // Some UIs may not be ready at this time.
917
946
  this.$nextTick(() => {
918
- this.$refs.traditionalControl.setState(options.visibility);
947
+ this.$refs.treeControl.setState(options.visibility);
919
948
  });
920
949
  }
921
950
  }
@@ -923,6 +952,7 @@ export default {
923
952
  this.$module.updateTime(0.01);
924
953
  this.$module.updateTime(0);
925
954
  this.$module.unsetFinishDownloadCallback();
955
+ this.$emit("on-ready");
926
956
  this.isReady = true;
927
957
  };
928
958
  },
@@ -938,8 +968,8 @@ export default {
938
968
  viewport: undefined,
939
969
  visibility: undefined
940
970
  };
941
- if (this.$refs.traditionalControl)
942
- state.visibility = this.$refs.traditionalControl.getState();
971
+ if (this.$refs.treeControl)
972
+ state.visibility = this.$refs.treeControl.getState();
943
973
  if (this.$module.scene) {
944
974
  let zincCameraControls = this.$module.scene.getZincCameraControls();
945
975
  state.viewport = zincCameraControls.getCurrentViewport();
@@ -967,7 +997,7 @@ export default {
967
997
  .getZincCameraControls()
968
998
  .setCurrentCameraSettings(state.viewport);
969
999
  if (state.visibility)
970
- this.$refs.traditionalControl.setState(state.visibility);
1000
+ this.$refs.treeControl.setState(state.visibility);
971
1001
  } else {
972
1002
  this.$module.setFinishDownloadCallback(
973
1003
  this.setURLFinishCallback({
@@ -996,8 +1026,8 @@ export default {
996
1026
  let visibility =
997
1027
  state && state.visibility ? state.visibility : undefined;
998
1028
  this._currentURL = newValue;
999
- if (this.$refs.traditionalControl)
1000
- this.$refs.traditionalControl.clear();
1029
+ if (this.$refs.treeControl)
1030
+ this.$refs.treeControl.clear();
1001
1031
  this.loading = true;
1002
1032
  this.isReady = false;
1003
1033
  this.$module.setFinishDownloadCallback(