@abi-software/scaffoldvuer 0.2.1 → 0.2.2-beta.1

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.
@@ -19,7 +19,7 @@
19
19
  id="organsDisplayArea"
20
20
  ref="display"
21
21
  tabindex="-1"
22
- style="height:100%;width:100%;"
22
+ style="height: 100%; width: 100%"
23
23
  @keydown.66="backgroundChangeCallback"
24
24
  />
25
25
  <div v-show="displayUI && !isTransitioning">
@@ -74,6 +74,7 @@
74
74
  ref="treeControls"
75
75
  v-popover:checkBoxPopover
76
76
  :help-mode="helpMode"
77
+ :isReady="isReady"
77
78
  :show-colour-picker="showColourPicker"
78
79
  @object-selected="objectSelected"
79
80
  @object-hovered="objectHovered"
@@ -96,7 +97,7 @@
96
97
  v-if="sceneData.timeVarying"
97
98
  v-popover:sliderPopover
98
99
  class="time-slider-container"
99
- :class="[ minimisedSlider ? 'minimised' : '', sliderPosition]"
100
+ :class="[minimisedSlider ? 'minimised' : '', sliderPosition]"
100
101
  >
101
102
  <el-tabs type="card">
102
103
  <el-tab-pane label="Animate scaffold">
@@ -116,7 +117,7 @@
116
117
  <el-slider
117
118
  :min="0"
118
119
  :max="timeMax"
119
- :value="sceneData.currentTime / 100 * timeMax"
120
+ :value="(sceneData.currentTime / 100) * timeMax"
120
121
  :step="0.1"
121
122
  tooltip-class="time-slider-tooltip"
122
123
  class="slider"
@@ -206,7 +207,7 @@
206
207
  >
207
208
  <div>
208
209
  Fit to
209
- <br>
210
+ <br />
210
211
  window
211
212
  </div>
212
213
  <map-svg-icon
@@ -219,6 +220,24 @@
219
220
  />
220
221
  </el-popover>
221
222
  </div>
223
+ <el-popover
224
+ ref="open-map-popover"
225
+ placement="top-start"
226
+ width="128"
227
+ :append-to-body="false"
228
+ trigger="click"
229
+ popper-class="open-map-popper"
230
+ >
231
+ <el-row v-for="item in openMapOptions" :key="item.key">
232
+ <el-button
233
+ type="primary"
234
+ plain
235
+ @click="$emit('open-map', item.key)"
236
+ >
237
+ {{item.display}}
238
+ </el-button>
239
+ </el-row>
240
+ </el-popover>
222
241
  <el-popover
223
242
  ref="backgroundPopover"
224
243
  placement="top-start"
@@ -227,36 +246,64 @@
227
246
  trigger="click"
228
247
  popper-class="background-popper non-selectable"
229
248
  >
230
- <el-row class="backgroundText">
231
- Change background
232
- </el-row>
249
+ <el-row class="backgroundText"> Change background </el-row>
233
250
  <el-row class="backgroundChooser">
234
251
  <div
235
252
  v-for="item in availableBackground"
236
253
  :key="item"
237
- :class="['backgroundChoice', item, item == currentBackground ? 'active' :'']"
254
+ :class="[
255
+ 'backgroundChoice',
256
+ item,
257
+ item == currentBackground ? 'active' : '',
258
+ ]"
238
259
  @click="backgroundChangeCallback(item)"
239
260
  />
240
261
  </el-row>
241
262
  </el-popover>
242
- <el-popover
243
- v-model="hoverVisibilities[3].value"
244
- content="Change background color"
245
- placement="right"
246
- :append-to-body="false"
247
- trigger="manual"
248
- popper-class="scaffold-popper right-popper non-selectable"
263
+ <div
264
+ class="settings-group"
265
+ :class="{ open: drawerOpen, close: !drawerOpen }"
249
266
  >
250
- <map-svg-icon
251
- slot="reference"
252
- v-popover:backgroundPopover
253
- icon="changeBckgd"
254
- class="icon-button background-colour"
255
- :class="{ open: drawerOpen, close: !drawerOpen }"
256
- @mouseover.native="showHelpText(3)"
257
- @mouseout.native="hideHelpText(3)"
258
- />
259
- </el-popover>
267
+ <el-row>
268
+ <el-popover
269
+ v-model="hoverVisibilities[8].value"
270
+ content="Open new map"
271
+ placement="right"
272
+ :append-to-body="false"
273
+ trigger="manual"
274
+ popper-class="scaffold-popper right-popper non-selectable"
275
+ >
276
+ <map-svg-icon
277
+ v-if="enableOpenMapUI && openMapOptions.lenght > 0"
278
+ slot="reference"
279
+ v-popover:open-map-popover
280
+ icon="openMap"
281
+ class="icon-button"
282
+ @mouseover.native="showHelpText(8)"
283
+ @mouseout.native="hideHelpText(8)"
284
+ />
285
+ </el-popover>
286
+ </el-row>
287
+ <el-row>
288
+ <el-popover
289
+ v-model="hoverVisibilities[3].value"
290
+ content="Change background color"
291
+ placement="right"
292
+ :append-to-body="false"
293
+ trigger="manual"
294
+ popper-class="scaffold-popper right-popper non-selectable"
295
+ >
296
+ <map-svg-icon
297
+ slot="reference"
298
+ v-popover:backgroundPopover
299
+ icon="changeBckgd"
300
+ class="icon-button"
301
+ @mouseover.native="showHelpText(3)"
302
+ @mouseout.native="hideHelpText(3)"
303
+ />
304
+ </el-popover>
305
+ </el-row>
306
+ </div>
260
307
  </div>
261
308
  </div>
262
309
  </template>
@@ -271,6 +318,7 @@ import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
271
318
  import { findObjectsWithNames, getAllObjects } from "../scripts/utilities.js";
272
319
  import { SearchIndex } from "../scripts/search.js";
273
320
  import {
321
+ Button,
274
322
  Col,
275
323
  Loading,
276
324
  Option,
@@ -279,12 +327,13 @@ import {
279
327
  Select,
280
328
  Slider,
281
329
  TabPane,
282
- Tabs
330
+ Tabs,
283
331
  } from "element-ui";
284
332
  import lang from "element-ui/lib/locale/lang/en";
285
333
  import locale from "element-ui/lib/locale";
286
334
 
287
335
  locale.use(lang);
336
+ Vue.use(Button);
288
337
  Vue.use(Col);
289
338
  Vue.use(Loading.directive);
290
339
  Vue.use(Option);
@@ -322,21 +371,21 @@ export default {
322
371
  */
323
372
  url: {
324
373
  type: String,
325
- default: ""
374
+ default: "",
326
375
  },
327
376
  /**
328
377
  * Show the colour control of set to true.
329
378
  */
330
379
  showColourPicker: {
331
380
  type: Boolean,
332
- default: false
381
+ default: false,
333
382
  },
334
383
  /**
335
384
  * Flag to show/hide the UI.
336
385
  */
337
386
  displayUI: {
338
387
  type: Boolean,
339
- default: true
388
+ default: true,
340
389
  },
341
390
  /**
342
391
  * Display all graphics at start.
@@ -345,21 +394,21 @@ export default {
345
394
  */
346
395
  displayAtStartUp: {
347
396
  type: Boolean,
348
- default: true
397
+ default: true,
349
398
  },
350
399
  /**
351
400
  * Use for toggling the help tooltips.
352
401
  */
353
402
  helpMode: {
354
403
  type: Boolean,
355
- default: false
404
+ default: false,
356
405
  },
357
406
  /**
358
407
  * Use for show/display beta warning icon.
359
408
  */
360
409
  displayWarning: {
361
410
  type: Boolean,
362
- default: true
411
+ default: true,
363
412
  },
364
413
  /**
365
414
  * Warning message for the hovered over text
@@ -367,7 +416,7 @@ export default {
367
416
  */
368
417
  warningMessage: {
369
418
  type: String,
370
- default: "Beta feature - under active development"
419
+ default: "Beta feature - under active development",
371
420
  },
372
421
  displayLatestChanges: {
373
422
  type: Boolean,
@@ -382,43 +431,70 @@ export default {
382
431
  */
383
432
  displayMarkers: {
384
433
  type: Boolean,
385
- default: false
434
+ default: false,
386
435
  },
387
436
  /**
388
437
  * Show/hide minimap.
389
438
  */
390
439
  displayMinimap: {
391
440
  type: Boolean,
392
- default: false
441
+ default: false,
393
442
  },
394
443
  /**
395
444
  * Format of the input URL
396
445
  */
397
446
  format: {
398
447
  type: String,
399
- default: "metadata"
448
+ default: "metadata",
400
449
  },
401
450
  /**
402
451
  * Settings for minimap position, size and alignment.
403
452
  */
404
453
  minimapSettings: {
405
454
  type: Object,
406
- default: function() {
455
+ default: function () {
407
456
  return {
408
457
  x_offset: 16,
409
458
  y_offset: 16,
410
459
  width: 128,
411
460
  height: 128,
412
- align: "top-right"
461
+ align: "top-right",
413
462
  };
414
- }
463
+ },
464
+ },
465
+ /**
466
+ * Flag to determine rather open map UI should be
467
+ * presented or not.
468
+ */
469
+ enableOpenMapUI: {
470
+ type: Boolean,
471
+ default: false,
472
+ },
473
+ openMapOptions: {
474
+ type: Array,
475
+ default: function () {
476
+ return [
477
+ {
478
+ display: "Open AC Map",
479
+ key: "AC"
480
+ },
481
+ {
482
+ display: "Open FC Map",
483
+ key: "FC"
484
+ },
485
+ {
486
+ display: "Open 3D Human Map",
487
+ key: "3D"
488
+ },
489
+ ]
490
+ },
415
491
  },
416
492
  /**
417
493
  * State containing state of the scaffold.
418
494
  */
419
495
  state: {
420
496
  type: Object,
421
- default: undefined
497
+ default: undefined,
422
498
  },
423
499
  /**
424
500
  * Optional prop for the name of the region to focus on,
@@ -426,7 +502,7 @@ export default {
426
502
  */
427
503
  region: {
428
504
  type: String,
429
- default: ""
505
+ default: "",
430
506
  },
431
507
  /**
432
508
  * Optional prop for an URL of containing information of a viewport.
@@ -435,20 +511,21 @@ export default {
435
511
  */
436
512
  viewURL: {
437
513
  type: String,
438
- default: ""
514
+ default: "",
439
515
  },
440
516
  /**
441
517
  * Settings for turning on/off rendering
442
518
  */
443
519
  render: {
444
520
  type: Boolean,
445
- default: true
446
- }
521
+ default: true,
522
+ },
447
523
  },
448
- data: function() {
524
+ data: function () {
449
525
  return {
450
526
  sceneData: this.$module.sceneData,
451
527
  isPlaying: false,
528
+ isReady: false,
452
529
  /**
453
530
  * This is set when scene is transitioning.
454
531
  */
@@ -463,6 +540,7 @@ export default {
463
540
  { value: false },
464
541
  { value: false },
465
542
  { value: false },
543
+ { value: false },
466
544
  ],
467
545
  inHelp: false,
468
546
  loading: false,
@@ -478,28 +556,28 @@ export default {
478
556
  playSpeed: [
479
557
  {
480
558
  value: 0.1,
481
- label: "0.1x"
559
+ label: "0.1x",
482
560
  },
483
561
  {
484
562
  value: 0.5,
485
- label: "0.5x"
563
+ label: "0.5x",
486
564
  },
487
565
  {
488
566
  value: 1,
489
- label: "1x"
567
+ label: "1x",
490
568
  },
491
569
  {
492
570
  value: 2,
493
- label: "2x"
571
+ label: "2x",
494
572
  },
495
573
  {
496
574
  value: 5,
497
- label: "5x"
575
+ label: "5x",
498
576
  },
499
577
  {
500
578
  value: 10,
501
- label: "10x"
502
- }
579
+ label: "10x",
580
+ },
503
581
  ],
504
582
  currentSpeed: 1,
505
583
  timeStamps: {},
@@ -511,54 +589,54 @@ export default {
511
589
  x: 200,
512
590
  y: 200,
513
591
  },
514
- fileFormat: "metadata"
592
+ fileFormat: "metadata",
515
593
  };
516
594
  },
517
595
  watch: {
518
596
  format: {
519
- handler: function(value) {
597
+ handler: function (value) {
520
598
  this.fileFormat = value;
521
599
  },
522
- immediate: true
600
+ immediate: true,
523
601
  },
524
602
  url: {
525
- handler: function(newValue) {
603
+ handler: function (newValue) {
526
604
  if (this.state === undefined || this.state.url === undefined)
527
605
  this.setURL(newValue);
528
606
  },
529
- immediate: true
607
+ immediate: true,
530
608
  },
531
609
  region: {
532
- handler: function(region) {
610
+ handler: function (region) {
533
611
  if (!(this.state || this.viewURL)) this.setFocusedRegion(region);
534
612
  },
535
- immediate: true
613
+ immediate: true,
536
614
  },
537
615
  state: {
538
- handler: function(state) {
616
+ handler: function (state) {
539
617
  this.setState(state);
540
618
  },
541
619
  immediate: true,
542
- deep: true
620
+ deep: true,
543
621
  },
544
622
  viewURL: {
545
- handler: function(viewURL) {
623
+ handler: function (viewURL) {
546
624
  this.updateViewURL(viewURL);
547
625
  },
548
- immediate: true
626
+ immediate: true,
549
627
  },
550
- helpMode: function(val) {
628
+ helpMode: function (val) {
551
629
  this.setHelpMode(val);
552
630
  },
553
- displayMarkers: function(val) {
631
+ displayMarkers: function (val) {
554
632
  this.$module.scene.displayMarkers = val;
555
633
  //Update pickable objects
556
634
  this.$module.scene.forcePickableObjectsUpdate = true;
557
635
  },
558
- displayMinimap: function(val) {
636
+ displayMinimap: function (val) {
559
637
  this.$module.scene.displayMinimap = val;
560
638
  },
561
- "sceneData.currentTime": function() {
639
+ "sceneData.currentTime": function () {
562
640
  /**
563
641
  * Triggers when scene time changes.
564
642
  *
@@ -567,29 +645,28 @@ export default {
567
645
  */
568
646
  this.$emit("timeChanged", this.sceneData.currentTime);
569
647
  },
570
- duration: function() {
648
+ duration: function () {
571
649
  this.$module.scene.setDuration(this.duration);
572
650
  },
573
651
  minimapSettings: {
574
652
  deep: true,
575
- handler: "updateMinimapScissor"
653
+ handler: "updateMinimapScissor",
576
654
  },
577
- render: function(val) {
655
+ render: function (val) {
578
656
  this.toggleRendering(val);
579
- }
657
+ },
580
658
  },
581
- beforeCreate: function() {
659
+ beforeCreate: function () {
582
660
  this.$module = new OrgansViewer();
583
- this.isReady = false;
584
661
  this.selectedObjects = [];
585
662
  this.hoveredObjects = [];
586
663
  this.currentBackground = "white";
587
664
  this._currentURL = undefined;
588
665
  this.availableBackground = ["white", "black", "lightskyblue"];
589
- this.$_searchIndex = new SearchIndex();;
666
+ this.$_searchIndex = new SearchIndex();
590
667
  this.$_tempId = 1;
591
668
  },
592
- mounted: function() {
669
+ mounted: function () {
593
670
  this.$refs.treeControls.setModule(this.$module);
594
671
  let eventNotifier = new EventNotifier();
595
672
  eventNotifier.subscribe(this, this.eventNotifierCallback);
@@ -602,7 +679,7 @@ export default {
602
679
  );
603
680
  this.defaultRate = this.$module.getPlayRate();
604
681
  },
605
- beforeDestroy: function() {
682
+ beforeDestroy: function () {
606
683
  if (this.ro) this.ro.disconnect();
607
684
  this.$module.destroy();
608
685
  this.$module = undefined;
@@ -611,7 +688,7 @@ export default {
611
688
  /**
612
689
  * This is called when a new zinc object is read into the scene.
613
690
  */
614
- zincObjectAdded: function(zincObject) {
691
+ zincObjectAdded: function (zincObject) {
615
692
  this.loading = false;
616
693
  zincObject.searchIndexId = ++this.$_tempId;
617
694
  this.$_searchIndex.addZincObject(zincObject, zincObject.searchIndexId);
@@ -623,7 +700,7 @@ export default {
623
700
  * to one of the three preset colour: white, black and
624
701
  * lightskyblue.
625
702
  */
626
- backgroundChangeCallback: function(colour) {
703
+ backgroundChangeCallback: function (colour) {
627
704
  this.currentBackground = colour;
628
705
  this.$module.zincRenderer
629
706
  .getThreeJSRenderer()
@@ -633,7 +710,7 @@ export default {
633
710
  * This is called by captueeScreenshot and after the last render
634
711
  * loop, it download a screenshot of the current scene with no UI.
635
712
  */
636
- captureScreenshotCallback: function() {
713
+ captureScreenshotCallback: function () {
637
714
  //Remove the callback, only needs to happen once
638
715
  this.$module.zincRenderer.removePostRenderCallbackFunction(
639
716
  this.captureID
@@ -656,7 +733,7 @@ export default {
656
733
  *
657
734
  * @public
658
735
  */
659
- captureScreenshot: function(filename) {
736
+ captureScreenshot: function (filename) {
660
737
  this.captureFilename = filename;
661
738
  this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction(
662
739
  this.captureScreenshotCallback
@@ -678,7 +755,7 @@ export default {
678
755
  *
679
756
  * @public
680
757
  */
681
- fitWindow: function() {
758
+ fitWindow: function () {
682
759
  if (this.$module.scene) {
683
760
  this.$module.scene.viewAll();
684
761
  }
@@ -689,7 +766,7 @@ export default {
689
766
  *
690
767
  * @public
691
768
  */
692
- zoomIn: function() {
769
+ zoomIn: function () {
693
770
  if (this.$module.scene) {
694
771
  this.$module.scene.changeZoomByScrollRateUnit(-1);
695
772
  }
@@ -700,7 +777,7 @@ export default {
700
777
  *
701
778
  * @public
702
779
  */
703
- zoomOut: function() {
780
+ zoomOut: function () {
704
781
  if (this.$module.scene) {
705
782
  this.$module.scene.changeZoomByScrollRateUnit(1);
706
783
  }
@@ -710,7 +787,7 @@ export default {
710
787
  *
711
788
  * @public
712
789
  */
713
- speedChanged: function(speed) {
790
+ speedChanged: function (speed) {
714
791
  this.currentSpeed = speed;
715
792
  this.$module.setPlayRate(this.defaultRate * this.currentSpeed);
716
793
  },
@@ -719,12 +796,12 @@ export default {
719
796
  *
720
797
  * @public
721
798
  */
722
- stopFreeSpin: function() {
799
+ stopFreeSpin: function () {
723
800
  let cameracontrol = this.$module.scene.getZincCameraControls();
724
801
  cameracontrol.stopAutoTumble();
725
802
  this.isTransitioning = false;
726
803
  },
727
- findObjectsWithGroupName: function(name) {
804
+ findObjectsWithGroupName: function (name) {
728
805
  let objects = [];
729
806
  if (name && name != "" && this.$module.scene) {
730
807
  objects = this.$module.scene.findObjectsWithGroupName(name);
@@ -734,7 +811,7 @@ export default {
734
811
  /**
735
812
  * Focus on named region
736
813
  */
737
- viewRegion: function(names) {
814
+ viewRegion: function (names) {
738
815
  const rootRegion = this.$module.scene.getRootRegion();
739
816
  const groups = Array.isArray(names) ? names : [names];
740
817
  const objects = findObjectsWithNames(rootRegion, groups, "", true);
@@ -743,7 +820,8 @@ export default {
743
820
  if (this.$module.isSyncControl()) {
744
821
  this.$module.setSyncControlZoomToBox(box);
745
822
  } else {
746
- const dist = this.$module.scene.camera.far - this.$module.scene.camera.near;
823
+ const dist =
824
+ this.$module.scene.camera.far - this.$module.scene.camera.near;
747
825
  this.$module.scene.viewAllWithBoundingBox(box);
748
826
  this.$module.scene.camera.far = this.$module.scene.camera.near + dist;
749
827
  this.$module.scene.camera.updateProjectionMatrix();
@@ -752,7 +830,7 @@ export default {
752
830
  }
753
831
  return false;
754
832
  },
755
- setFocusedRegion: function(name) {
833
+ setFocusedRegion: function (name) {
756
834
  if (name) {
757
835
  if (this.isReady) {
758
836
  this.viewRegion(name);
@@ -763,7 +841,7 @@ export default {
763
841
  }
764
842
  }
765
843
  },
766
- updateViewURL: function(viewURL) {
844
+ updateViewURL: function (viewURL) {
767
845
  if (viewURL) {
768
846
  if (this.isReady) {
769
847
  const url = new URL(viewURL, this.url);
@@ -775,7 +853,7 @@ export default {
775
853
  }
776
854
  }
777
855
  },
778
- getRendererInfo: function() {
856
+ getRendererInfo: function () {
779
857
  if (this.$module.zincRenderer) {
780
858
  return this.$module.zincRenderer.getThreeJSRenderer().info;
781
859
  }
@@ -787,7 +865,7 @@ export default {
787
865
  *
788
866
  * @public
789
867
  */
790
- freeSpin: function() {
868
+ freeSpin: function () {
791
869
  if (this.$module.scene) {
792
870
  let cameracontrol = this.$module.scene.getZincCameraControls();
793
871
  this.isTransitioning = true;
@@ -799,14 +877,14 @@ export default {
799
877
  /**
800
878
  * Callback when a region is selected/highlighted.
801
879
  * It will also update other controls.
802
- *
880
+ *
803
881
  */
804
- eventNotifierCallback: function(event) {
882
+ eventNotifierCallback: function (event) {
805
883
  const names = [];
806
884
  let zincObjects = [];
807
885
  const region = undefined;
808
886
  if (event.eventType == 1 || event.eventType == 2) {
809
- event.identifiers.forEach(identifier => {
887
+ event.identifiers.forEach((identifier) => {
810
888
  if (identifier) {
811
889
  let id = identifier.data.id
812
890
  ? identifier.data.id
@@ -836,7 +914,7 @@ export default {
836
914
  } else if (event.eventType == 2) {
837
915
  if (this.selectedObjects.length === 0) {
838
916
  this.hideRegionTooltip();
839
- // const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
917
+ // const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
840
918
  if (this.$refs.treeControls) {
841
919
  if (names.length > 0) {
842
920
  //this.$refs.treeControls.changeHoverByNames(names, region, false);
@@ -845,7 +923,7 @@ export default {
845
923
  this.$refs.treeControls.removeHover(true);
846
924
  }
847
925
  }
848
- if ((event.identifiers.length > 0) && event.identifiers[0]) {
926
+ if (event.identifiers.length > 0 && event.identifiers[0]) {
849
927
  let id = event.identifiers[0].data.id
850
928
  ? event.identifiers[0].data.id
851
929
  : event.identifiers[0].data.group;
@@ -854,19 +932,20 @@ export default {
854
932
  this.tData.label = id;
855
933
  if (event.identifiers[0].data.region)
856
934
  this.tData.region = event.identifiers[0].data.region;
857
- else
858
- this.tData.region = "Root";
935
+ else this.tData.region = "Root";
859
936
  this.tData.x = event.identifiers[0].coords.x;
860
- this.tData.y = event.identifiers[0].coords.y;
937
+ this.tData.y = event.identifiers[0].coords.y;
861
938
  }
862
939
  }
863
940
  // Triggers when an object has been highlighted
864
941
  this.$emit("scaffold-highlighted", event.identifiers);
865
942
  }
866
- } else if (event.eventType == 3) { //MOVE
867
- if ((event.identifiers.length > 0) && event.identifiers[0]) {
943
+ } else if (event.eventType == 3) {
944
+ //MOVE
945
+ if (event.identifiers.length > 0 && event.identifiers[0]) {
868
946
  if (event.identifiers[0].coords) {
869
- const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
947
+ const offsets =
948
+ this.$refs.scaffoldContainer.getBoundingClientRect();
870
949
  this.tData.x = event.identifiers[0].coords.x - offsets.left;
871
950
  this.tData.y = event.identifiers[0].coords.y - offsets.top;
872
951
  }
@@ -878,7 +957,7 @@ export default {
878
957
  *
879
958
  * @public
880
959
  */
881
- getCoordinatesOfSelected: function() {
960
+ getCoordinatesOfSelected: function () {
882
961
  if (this.selectedObjects && this.selectedObjects.length > 0) {
883
962
  return this.$module.scene.getObjectsScreenXY(this.selectedObjects);
884
963
  }
@@ -891,13 +970,13 @@ export default {
891
970
  *
892
971
  * @public
893
972
  */
894
- getDynamicSelectedCoordinates: function() {
973
+ getDynamicSelectedCoordinates: function () {
895
974
  return this.$module.selectedScreenCoordinates;
896
975
  },
897
976
  /**
898
977
  * Callback when time is changed through the UI.
899
978
  */
900
- timeChange: function(event) {
979
+ timeChange: function (event) {
901
980
  let normalizedTime = (event / this.timeMax) * 100;
902
981
  if (normalizedTime != this.sceneData.currentTime)
903
982
  this.$module.updateTime(normalizedTime);
@@ -907,7 +986,7 @@ export default {
907
986
  *
908
987
  * @param {object} object Zinc object
909
988
  */
910
- objectSelected: function(objects, propagate) {
989
+ objectSelected: function (objects, propagate) {
911
990
  this.selectedObjects = objects;
912
991
  if (this.selectedObjects && this.selectedObjects.length > 0)
913
992
  this.$refs.opacityControl.setObject(this.selectedObjects[0]);
@@ -918,7 +997,7 @@ export default {
918
997
  *
919
998
  * @param {object} object Zinc object
920
999
  */
921
- objectHovered: function(objects, propagate) {
1000
+ objectHovered: function (objects, propagate) {
922
1001
  this.hoveredObjects = objects;
923
1002
  this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
924
1003
  },
@@ -927,14 +1006,13 @@ export default {
927
1006
  *
928
1007
  * @param {} name Name of the group
929
1008
  */
930
- changeActiveByName: function(names, region, propagate) {
1009
+ changeActiveByName: function (names, region, propagate) {
931
1010
  const isArray = Array.isArray(names);
932
1011
  if (names === undefined || (isArray && names.length === 0)) {
933
1012
  this.$refs.treeControls.removeActive(propagate);
934
1013
  } else {
935
1014
  let array = names;
936
- if (!isArray)
937
- array = [array];
1015
+ if (!isArray) array = [array];
938
1016
  this.$refs.treeControls.changeActiveByNames(array, region, propagate);
939
1017
  }
940
1018
  },
@@ -943,14 +1021,13 @@ export default {
943
1021
  *
944
1022
  * @param {name} name Name of the group
945
1023
  */
946
- changeHighlightedByName: function(names, region, propagate) {
1024
+ changeHighlightedByName: function (names, region, propagate) {
947
1025
  const isArray = Array.isArray(names);
948
1026
  if (names === undefined || (isArray && names.length === 0)) {
949
1027
  this.$refs.treeControls.removeHover(propagate);
950
1028
  } else {
951
1029
  let array = names;
952
- if (!isArray)
953
- array = [array];
1030
+ if (!isArray) array = [array];
954
1031
  this.$refs.treeControls.changeHoverByNames(array, region, propagate);
955
1032
  }
956
1033
  },
@@ -959,7 +1036,7 @@ export default {
959
1036
  *
960
1037
  * @param {object} object Zinc object
961
1038
  */
962
- play: function(flag) {
1039
+ play: function (flag) {
963
1040
  this.$module.playAnimation(flag);
964
1041
  this.isPlaying = flag;
965
1042
  //Hide tooltip as location may
@@ -968,15 +1045,15 @@ export default {
968
1045
  /**
969
1046
  * Function to toggle on/off overlay help.
970
1047
  */
971
- setHelpMode: function(helpMode) {
1048
+ setHelpMode: function (helpMode) {
972
1049
  if (helpMode) {
973
1050
  this.inHelp = true;
974
- this.hoverVisibilities.forEach(item => {
1051
+ this.hoverVisibilities.forEach((item) => {
975
1052
  item.value = true;
976
1053
  });
977
1054
  } else {
978
1055
  this.inHelp = false;
979
- this.hoverVisibilities.forEach(item => {
1056
+ this.hoverVisibilities.forEach((item) => {
980
1057
  item.value = false;
981
1058
  });
982
1059
  }
@@ -985,23 +1062,32 @@ export default {
985
1062
  * Callback function used by showRegionTooltip in the case when the tooltip
986
1063
  * is out of view.
987
1064
  */
988
- displayTooltipOfObjectsCallback: function(name, objects, resetView, liveUpdates) {
1065
+ displayTooltipOfObjectsCallback: function (
1066
+ name,
1067
+ objects,
1068
+ resetView,
1069
+ liveUpdates
1070
+ ) {
989
1071
  const instance = this;
990
- return function() {
991
- instance.$module.zincRenderer.removePostRenderCallbackFunction(instance.$_regionTooltipCallback);
1072
+ return function () {
1073
+ instance.$module.zincRenderer.removePostRenderCallbackFunction(
1074
+ instance.$_regionTooltipCallback
1075
+ );
992
1076
  instance.$_regionTooltipCallback = undefined;
993
1077
  instance.displayTooltipOfObjects(name, objects, resetView, liveUpdates);
994
- }
1078
+ };
995
1079
  },
996
- liveUpdateTooltipPosition: function() {
1080
+ liveUpdateTooltipPosition: function () {
997
1081
  if (this.$module.selectedCenter) {
998
1082
  this.tData.x = this.$module.selectedScreenCoordinates.x;
999
1083
  this.tData.y = this.$module.selectedScreenCoordinates.y;
1000
1084
  }
1001
1085
  },
1002
- displayTooltipOfObjects: function(name, objects, resetView, liveUpdates) {
1086
+ displayTooltipOfObjects: function (name, objects, resetView, liveUpdates) {
1003
1087
  if (objects.length > 0) {
1004
- let coords = objects[0].getClosestVertexDOMElementCoords(this.$module.scene);
1088
+ let coords = objects[0].getClosestVertexDOMElementCoords(
1089
+ this.$module.scene
1090
+ );
1005
1091
  if (coords) {
1006
1092
  //The coords is not in view, view all if resetView flag is true
1007
1093
  if (!coords.inView) {
@@ -1011,11 +1097,18 @@ export default {
1011
1097
  //Use the post render callback to make sure the scene has been updated
1012
1098
  //before getting the position of the tooltip.
1013
1099
  if (this.$_regionTooltipCallback) {
1014
- this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback);
1100
+ this.$module.zincRenderer.removePostRenderCallbackFunction(
1101
+ this.$_regionTooltipCallback
1102
+ );
1015
1103
  }
1016
- this.$_regionTooltipCallback =
1104
+ this.$_regionTooltipCallback =
1017
1105
  this.$module.zincRenderer.addPostRenderCallbackFunction(
1018
- this.displayTooltipOfObjectsCallback(name, objects, resetView, liveUpdates)
1106
+ this.displayTooltipOfObjectsCallback(
1107
+ name,
1108
+ objects,
1109
+ resetView,
1110
+ liveUpdates
1111
+ )
1019
1112
  );
1020
1113
  }
1021
1114
  } else {
@@ -1024,18 +1117,19 @@ export default {
1024
1117
  this.tData.x = coords.position.x;
1025
1118
  this.tData.y = coords.position.y;
1026
1119
  const regionPath = objects[0].getRegion().getFullPath();
1027
- if (regionPath)
1028
- this.tData.region = regionPath;
1029
- else
1030
- this.tData.region = "Root";
1120
+ if (regionPath) this.tData.region = regionPath;
1121
+ else this.tData.region = "Root";
1031
1122
  if (liveUpdates) {
1032
1123
  this.$module.setupLiveCoordinates(objects);
1033
1124
  if (this.$_liveCoordinatesUpdated) {
1034
- this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated);
1125
+ this.$module.zincRenderer.removePostRenderCallbackFunction(
1126
+ this.$_liveCoordinatesUpdated
1127
+ );
1035
1128
  }
1036
- this.$_liveCoordinatesUpdated =
1129
+ this.$_liveCoordinatesUpdated =
1037
1130
  this.$module.zincRenderer.addPostRenderCallbackFunction(
1038
- this.liveUpdateTooltipPosition);
1131
+ this.liveUpdateTooltipPosition
1132
+ );
1039
1133
  }
1040
1134
  }
1041
1135
  return true;
@@ -1045,24 +1139,31 @@ export default {
1045
1139
  return false;
1046
1140
  },
1047
1141
  /**
1048
- * Display the tooltip. When resetView is set to true, it will
1142
+ * Display the tooltip. When resetView is set to true, it will
1049
1143
  * reset view if the tooltip is not in view.
1050
- * Setting liveUpdates to true will update the tooltip location
1144
+ * Setting liveUpdates to true will update the tooltip location
1051
1145
  * at every rendering loop.
1052
1146
  */
1053
- showRegionTooltip: function(name, resetView, liveUpdates) {
1147
+ showRegionTooltip: function (name, resetView, liveUpdates) {
1054
1148
  if (name && this.$module.scene) {
1055
1149
  const rootRegion = this.$module.scene.getRootRegion();
1056
1150
  const groups = [name];
1057
1151
  const objects = findObjectsWithNames(rootRegion, groups, "", true);
1058
- return this.displayTooltipOfObjects(name, objects, resetView, liveUpdates);
1152
+ return this.displayTooltipOfObjects(
1153
+ name,
1154
+ objects,
1155
+ resetView,
1156
+ liveUpdates
1157
+ );
1059
1158
  }
1060
1159
  this.hideRegionTooltip();
1061
1160
  return false;
1062
1161
  },
1063
- hideRegionTooltip: function() {
1162
+ hideRegionTooltip: function () {
1064
1163
  if (this.$_liveCoordinatesUpdated) {
1065
- this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated);
1164
+ this.$module.zincRenderer.removePostRenderCallbackFunction(
1165
+ this.$_liveCoordinatesUpdated
1166
+ );
1066
1167
  //Unset the tracking
1067
1168
  this.$module.setupLiveCoordinates(undefined);
1068
1169
  }
@@ -1073,7 +1174,7 @@ export default {
1073
1174
  * This is called when mouse cursor enters supported elements
1074
1175
  * with help tootltips.
1075
1176
  */
1076
- showHelpText: function(helpTextNumber) {
1177
+ showHelpText: function (helpTextNumber) {
1077
1178
  if (!this.inHelp) {
1078
1179
  this.helpTextWait = setTimeout(() => {
1079
1180
  this.hoverVisibilities[helpTextNumber].value = true;
@@ -1083,13 +1184,13 @@ export default {
1083
1184
  /**
1084
1185
  * This is called when mouse cursor exits supported element..
1085
1186
  */
1086
- hideHelpText: function(helpTextNumber) {
1187
+ hideHelpText: function (helpTextNumber) {
1087
1188
  if (!this.inHelp) {
1088
1189
  this.hoverVisibilities[helpTextNumber].value = false;
1089
1190
  clearTimeout(this.helpTextWait);
1090
1191
  }
1091
1192
  },
1092
- search: function(text, displayLabel) {
1193
+ search: function (text, displayLabel) {
1093
1194
  if (this.$_searchIndex) {
1094
1195
  if (text === undefined || text === "") {
1095
1196
  this.objectSelected([], true);
@@ -1101,7 +1202,11 @@ export default {
1101
1202
  if (displayLabel) {
1102
1203
  for (let i = 0; i < zincObjectResults.length; i++) {
1103
1204
  if (zincObjectResults[i] && zincObjectResults[i].groupName) {
1104
- this.showRegionTooltip(zincObjectResults[i].groupName, true, true)
1205
+ this.showRegionTooltip(
1206
+ zincObjectResults[i].groupName,
1207
+ true,
1208
+ true
1209
+ );
1105
1210
  }
1106
1211
  }
1107
1212
  }
@@ -1116,27 +1221,25 @@ export default {
1116
1221
  /**
1117
1222
  * Get the list of suggested terms
1118
1223
  */
1119
- fetchSuggestions: function(term) {
1120
- if(this.$_searchIndex === undefined)
1121
- return [];
1224
+ fetchSuggestions: function (term) {
1225
+ if (this.$_searchIndex === undefined) return [];
1122
1226
  return this.$_searchIndex.auto_suggest(term);
1123
1227
  },
1124
1228
  /**
1125
1229
  * Called when minimap settings has changed. Pass the
1126
1230
  * parameters to ZincJS and marked it for update.
1127
1231
  */
1128
- updateMinimapScissor: function() {
1129
- Object.keys(this.minimapSettings).forEach(key => {
1232
+ updateMinimapScissor: function () {
1233
+ Object.keys(this.minimapSettings).forEach((key) => {
1130
1234
  this.$module.scene.minimapScissor[key] = this.minimapSettings[key];
1131
1235
  });
1132
1236
  this.$module.scene.minimapScissor.updateRequired = true;
1133
1237
  },
1134
- updateSettingsfromScene: function() {
1238
+ updateSettingsfromScene: function () {
1135
1239
  this.currentSpeed = 1;
1136
1240
  this.$module.setPlayRate(this.defaultRate);
1137
- this.orginalDuration = this.$module.scene.getMetadataTag(
1138
- "OriginalDuration"
1139
- );
1241
+ this.orginalDuration =
1242
+ this.$module.scene.getMetadataTag("OriginalDuration");
1140
1243
  this.animateDuration = this.$module.scene.getMetadataTag("Duration");
1141
1244
  let timeStamps = this.$module.scene.getMetadataTag("TimeStamps");
1142
1245
  this.timeStamps = {};
@@ -1145,7 +1248,7 @@ export default {
1145
1248
  }
1146
1249
  this.timeMax = this.$module.scene.getDuration();
1147
1250
  },
1148
- setURLFinishCallback: function(options) {
1251
+ setURLFinishCallback: function (options) {
1149
1252
  return () => {
1150
1253
  if (options) {
1151
1254
  if (options.viewport) {
@@ -1179,7 +1282,7 @@ export default {
1179
1282
  *
1180
1283
  * @public
1181
1284
  */
1182
- getState: function() {
1285
+ getState: function () {
1183
1286
  let state = {
1184
1287
  format: this.fileFormat,
1185
1288
  url: this._currentURL,
@@ -1200,13 +1303,13 @@ export default {
1200
1303
  *
1201
1304
  * @public
1202
1305
  */
1203
- setState: function(state) {
1306
+ setState: function (state) {
1204
1307
  if (state) {
1205
1308
  if (state.url && state.url !== this._currentURL) {
1206
1309
  this.setURLAndState(state.url, {
1207
1310
  fileFormat: state.fileFormat,
1208
1311
  viewport: state.viewport,
1209
- visibility: state.visibility
1312
+ visibility: state.visibility,
1210
1313
  });
1211
1314
  } else {
1212
1315
  if (state.viewport || state.visibility) {
@@ -1221,7 +1324,7 @@ export default {
1221
1324
  this.$module.setFinishDownloadCallback(
1222
1325
  this.setURLFinishCallback({
1223
1326
  viewport: state.viewport,
1224
- visibility: state.visibility
1327
+ visibility: state.visibility,
1225
1328
  })
1226
1329
  );
1227
1330
  }
@@ -1229,7 +1332,7 @@ export default {
1229
1332
  }
1230
1333
  }
1231
1334
  },
1232
- exportGLTF: function(binary) {
1335
+ exportGLTF: function (binary) {
1233
1336
  return this.$module.scene.exportGLTF(binary);
1234
1337
  },
1235
1338
  /**
@@ -1239,15 +1342,14 @@ export default {
1239
1342
  *
1240
1343
  * @public
1241
1344
  */
1242
- setURLAndState: function(newValue, state) {
1345
+ setURLAndState: function (newValue, state) {
1243
1346
  if (newValue != this._currentURL) {
1244
1347
  if (state && state.format) this.fileFormat = state.format;
1245
1348
  let viewport = state && state.viewport ? state.viewport : undefined;
1246
1349
  let visibility =
1247
1350
  state && state.visibility ? state.visibility : undefined;
1248
1351
  this._currentURL = newValue;
1249
- if (this.$refs.treeControls)
1250
- this.$refs.treeControls.clear();
1352
+ if (this.$refs.treeControls) this.$refs.treeControls.clear();
1251
1353
  this.loading = true;
1252
1354
  this.isReady = false;
1253
1355
  this.$module.setFinishDownloadCallback(
@@ -1255,7 +1357,7 @@ export default {
1255
1357
  viewport: viewport,
1256
1358
  region: this.region,
1257
1359
  viewURL: this.viewURL,
1258
- visibility: visibility
1360
+ visibility: visibility,
1259
1361
  })
1260
1362
  );
1261
1363
  if (this.fileFormat === "gltf") {
@@ -1285,20 +1387,20 @@ export default {
1285
1387
  *
1286
1388
  * @public
1287
1389
  */
1288
- setURL: function(newValue) {
1390
+ setURL: function (newValue) {
1289
1391
  this.setURLAndState(newValue, undefined);
1290
1392
  },
1291
1393
  /**
1292
1394
  * Callback when drawer is toggled.
1293
1395
  */
1294
- drawerToggled: function(flag) {
1396
+ drawerToggled: function (flag) {
1295
1397
  this.drawerOpen = flag;
1296
1398
  this.adjustLayout();
1297
1399
  },
1298
1400
  /**
1299
1401
  * Callback using ResizeObserver.
1300
1402
  */
1301
- adjustLayout: function() {
1403
+ adjustLayout: function () {
1302
1404
  let width = this.$refs.scaffoldContainer.clientWidth;
1303
1405
  this.minimisedSlider = width < 812;
1304
1406
  if (this.minimisedSlider) {
@@ -1307,7 +1409,7 @@ export default {
1307
1409
  this.sliderPosition = "";
1308
1410
  }
1309
1411
  },
1310
- toggleRendering: function(flag) {
1412
+ toggleRendering: function (flag) {
1311
1413
  if (this.$module.zincRenderer) {
1312
1414
  if (flag) {
1313
1415
  this.$module.zincRenderer.animate();
@@ -1316,32 +1418,33 @@ export default {
1316
1418
  }
1317
1419
  }
1318
1420
  },
1319
- forceResize: function() {
1421
+ forceResize: function () {
1320
1422
  if (this.$module.zincRenderer) {
1321
1423
  this.$module.zincRenderer.onWindowResize();
1322
1424
  }
1323
1425
  },
1324
- syncControlCallback: function() {
1426
+ syncControlCallback: function () {
1325
1427
  const payload = this.$module.NDCCameraControl.getPanZoom();
1326
1428
  if (this.tData.visible) {
1327
1429
  this.showRegionTooltip(this.tData.label);
1328
1430
  }
1329
1431
  this.$emit("scaffold-navigated", payload);
1330
1432
  },
1331
- /**
1433
+ /**
1332
1434
  * Rotate mode - "none", "horizontal", "vertical", "free" but
1333
1435
  * it will be ignored if flag is set to false.
1334
1436
  */
1335
- toggleSyncControl: function(flag, rotateMode) {
1437
+ toggleSyncControl: function (flag, rotateMode) {
1336
1438
  this.$module.toggleSyncControl(flag, rotateMode);
1337
1439
  this.$module.setSyncControlCallback(this.syncControlCallback);
1338
- }
1339
- }
1440
+ },
1441
+ },
1340
1442
  };
1341
1443
  </script>
1342
1444
 
1343
1445
  <!-- Add "scoped" attribute to limit CSS to this component only -->
1344
1446
  <style scoped lang="scss">
1447
+ @import "~element-ui/packages/theme-chalk/src/button";
1345
1448
  @import "~element-ui/packages/theme-chalk/src/col";
1346
1449
  @import "~element-ui/packages/theme-chalk/src/loading";
1347
1450
  @import "~element-ui/packages/theme-chalk/src/option";
@@ -1352,7 +1455,6 @@ export default {
1352
1455
  @import "~element-ui/packages/theme-chalk/src/tabs";
1353
1456
  @import "~element-ui/packages/theme-chalk/src/tab-pane";
1354
1457
 
1355
-
1356
1458
  .message-icon {
1357
1459
  position: absolute;
1358
1460
  top: 15px;
@@ -1514,7 +1616,35 @@ export default {
1514
1616
  }
1515
1617
  }
1516
1618
 
1517
- .background-colour {
1619
+ ::v-deep .open-map-popper {
1620
+ padding-top: 5px;
1621
+ padding-bottom: 5px;
1622
+ background-color: #ffffff;
1623
+ border: 1px solid $app-primary-color;
1624
+ box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1625
+ width: 178px;
1626
+ min-width: 178px;
1627
+
1628
+ .el-row ~ .el-row {
1629
+ margin-top: 8px;
1630
+ }
1631
+
1632
+ .el-button {
1633
+ padding-top:5px;
1634
+ padding-bottom:5px;
1635
+ }
1636
+
1637
+ &.el-popper[x-placement^="top"] {
1638
+ .popper__arrow {
1639
+ border-top-color: $app-primary-color !important;
1640
+ &:after {
1641
+ border-top-color: #fff !important;
1642
+ }
1643
+ }
1644
+ }
1645
+ }
1646
+
1647
+ .settings-group {
1518
1648
  bottom: 16px;
1519
1649
  position: absolute;
1520
1650
  transition: all 1s ease;
@@ -1683,7 +1813,8 @@ export default {
1683
1813
  }
1684
1814
 
1685
1815
  ::v-deep .el-loading-spinner {
1686
- i, .el-loading-text {
1816
+ i,
1817
+ .el-loading-text {
1687
1818
  color: $app-primary-color;
1688
1819
  }
1689
1820
  }
@@ -1742,7 +1873,7 @@ export default {
1742
1873
 
1743
1874
  .opacity-box {
1744
1875
  right: 0px;
1745
- bottom:200px;
1746
- position:absolute;
1876
+ bottom: 200px;
1877
+ position: absolute;
1747
1878
  }
1748
1879
  </style>