@realsee/dnalogel 2.0.0-alpha.36 → 2.0.0-alpha.39

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.
Files changed (118) hide show
  1. package/dist/ItemLabelPlugin/index.js +60 -36
  2. package/dist/ItemLabelPlugin/typings.d.ts +4 -0
  3. package/dist/ModelViewPlugin/Plugin.d.ts +4 -4
  4. package/dist/ModelViewPlugin/index.js +2 -3
  5. package/dist/PanoRulerProPlugin/Controller.d.ts +15 -0
  6. package/dist/PanoRulerProPlugin/index.d.ts +8 -0
  7. package/dist/PanoRulerProPlugin/index.js +1006 -0
  8. package/dist/PanoRulerProPlugin/typings.d.ts +46 -0
  9. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  10. package/dist/floorplan/ModelFloorplanPlugin/index.js +8 -1
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.es.js +1036 -243
  13. package/dist/index.js +1037 -242
  14. package/dist/index.umd.js +1037 -242
  15. package/dist/shared-utils/logger.d.ts +16 -0
  16. package/docs/assets/search.js +1 -1
  17. package/docs/classes/Magnifier.html +4 -4
  18. package/docs/classes/ModelRoomLabelController.html +4 -4
  19. package/docs/enums/CameraMovementEffect.html +2 -2
  20. package/docs/enums/DIRECTION.html +1 -1
  21. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  22. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  23. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  24. package/docs/enums/Rotation.html +2 -2
  25. package/docs/index.html +2 -2
  26. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  27. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  28. package/docs/interfaces/FloorplanBounding.html +4 -4
  29. package/docs/interfaces/FloorplanData.html +2 -2
  30. package/docs/interfaces/FloorplanEntrance.html +7 -7
  31. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  32. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  33. package/docs/interfaces/FloorplanFloorData.html +2 -2
  34. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  35. package/docs/interfaces/FloorplanObserver.html +2 -2
  36. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  37. package/docs/interfaces/FloorplanPosition.html +2 -2
  38. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  39. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  40. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  41. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  42. package/docs/interfaces/FloorplanServerData.html +2 -2
  43. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  44. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  45. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  46. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  47. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  48. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  49. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  50. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  51. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  52. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  53. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  54. package/docs/interfaces/LineJson.html +1 -1
  55. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  56. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  57. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  58. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  59. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  60. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  61. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  62. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  63. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  64. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  65. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  66. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  67. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  68. package/docs/interfaces/OpenParameter.html +2 -2
  69. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  70. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  72. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  73. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  74. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  75. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  76. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  77. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -0
  78. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -0
  79. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -0
  80. package/docs/interfaces/PanoRulerProPluginState.html +1 -0
  81. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  82. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  83. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  85. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  87. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  90. package/docs/interfaces/Point.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/Room.html +1 -1
  93. package/docs/interfaces/RoomInfo.html +1 -1
  94. package/docs/interfaces/RoomLabel.html +7 -7
  95. package/docs/interfaces/RoomRules.html +1 -1
  96. package/docs/interfaces/Rooms.html +1 -1
  97. package/docs/modules.html +19 -17
  98. package/libs/ItemLabelPlugin/ItemLabelComponent.js +34 -21
  99. package/libs/ItemLabelPlugin/Plugin.js +16 -10
  100. package/libs/ItemLabelPlugin/typings.d.ts +4 -0
  101. package/libs/ItemLabelPlugin/utils/parseData.js +1 -1
  102. package/libs/ModelViewPlugin/Plugin.d.ts +4 -4
  103. package/libs/ModelViewPlugin/Plugin.js +2 -3
  104. package/libs/PanoRulerProPlugin/Controller.d.ts +15 -0
  105. package/libs/PanoRulerProPlugin/Controller.js +110 -0
  106. package/libs/PanoRulerProPlugin/RulerItem.js +314 -0
  107. package/libs/PanoRulerProPlugin/RulerItems.js +377 -0
  108. package/libs/PanoRulerProPlugin/index.d.ts +8 -0
  109. package/libs/PanoRulerProPlugin/index.js +8 -0
  110. package/libs/PanoRulerProPlugin/typings.d.ts +46 -0
  111. package/libs/PanoRulerProPlugin/typings.js +1 -0
  112. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  113. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +8 -1
  114. package/libs/index.d.ts +2 -0
  115. package/libs/index.js +3 -0
  116. package/libs/shared-utils/logger.d.ts +16 -0
  117. package/libs/shared-utils/logger.js +47 -0
  118. package/package.json +1 -1
@@ -304,18 +304,18 @@ function add_css(target) {
304
304
 
305
305
  function get_each_context(ctx, list, i) {
306
306
  const child_ctx = ctx.slice();
307
- child_ctx[30] = list[i];
307
+ child_ctx[31] = list[i];
308
308
  return child_ctx;
309
309
  }
310
310
 
311
- // (229:2) {#if itemLabelItem.visible}
311
+ // (235:2) {#if itemLabelItem.visible}
312
312
  function create_if_block(ctx) {
313
313
  let itemlabelitem;
314
314
  let current;
315
315
 
316
316
  itemlabelitem = new ItemLabelItem({
317
317
  props: {
318
- itemLabel: /*itemLabelItem*/ ctx[30],
318
+ itemLabel: /*itemLabelItem*/ ctx[31],
319
319
  hooks: /*hooks*/ ctx[0],
320
320
  anchorEnabled: /*anchorEnabled*/ ctx[2],
321
321
  onIconClick: /*onIconClick*/ ctx[6]
@@ -332,7 +332,7 @@ function create_if_block(ctx) {
332
332
  },
333
333
  p(ctx, dirty) {
334
334
  const itemlabelitem_changes = {};
335
- if (dirty[0] & /*renderItemLabels*/ 2) itemlabelitem_changes.itemLabel = /*itemLabelItem*/ ctx[30];
335
+ if (dirty[0] & /*renderItemLabels*/ 2) itemlabelitem_changes.itemLabel = /*itemLabelItem*/ ctx[31];
336
336
  if (dirty[0] & /*hooks*/ 1) itemlabelitem_changes.hooks = /*hooks*/ ctx[0];
337
337
  if (dirty[0] & /*anchorEnabled*/ 4) itemlabelitem_changes.anchorEnabled = /*anchorEnabled*/ ctx[2];
338
338
  itemlabelitem.$set(itemlabelitem_changes);
@@ -352,12 +352,12 @@ function create_if_block(ctx) {
352
352
  };
353
353
  }
354
354
 
355
- // (228:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
355
+ // (234:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
356
356
  function create_each_block(key_1, ctx) {
357
357
  let first;
358
358
  let if_block_anchor;
359
359
  let current;
360
- let if_block = /*itemLabelItem*/ ctx[30].visible && create_if_block(ctx);
360
+ let if_block = /*itemLabelItem*/ ctx[31].visible && create_if_block(ctx);
361
361
 
362
362
  return {
363
363
  key: key_1,
@@ -377,7 +377,7 @@ function create_each_block(key_1, ctx) {
377
377
  p(new_ctx, dirty) {
378
378
  ctx = new_ctx;
379
379
 
380
- if (/*itemLabelItem*/ ctx[30].visible) {
380
+ if (/*itemLabelItem*/ ctx[31].visible) {
381
381
  if (if_block) {
382
382
  if_block.p(ctx, dirty);
383
383
 
@@ -424,7 +424,7 @@ function create_fragment(ctx) {
424
424
  let div_resize_listener;
425
425
  let current;
426
426
  let each_value = /*renderItemLabels*/ ctx[1];
427
- const get_key = ctx => /*itemLabelItem*/ ctx[30].id;
427
+ const get_key = ctx => /*itemLabelItem*/ ctx[31].id;
428
428
 
429
429
  for (let i = 0; i < each_value.length; i += 1) {
430
430
  let child_ctx = get_each_context(ctx, each_value, i);
@@ -441,7 +441,7 @@ function create_fragment(ctx) {
441
441
  }
442
442
 
443
443
  internal.attr(div, "class", "item-labels-container svelte-gk8s47");
444
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[12].call(div));
444
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[13].call(div));
445
445
  internal.set_style(div, "opacity", /*itemsVisible*/ ctx[5] ? 1 : 0, false);
446
446
  },
447
447
  m(target, anchor) {
@@ -451,7 +451,7 @@ function create_fragment(ctx) {
451
451
  each_blocks[i].m(div, null);
452
452
  }
453
453
 
454
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[12].bind(div));
454
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[13].bind(div));
455
455
  current = true;
456
456
  },
457
457
  p(ctx, dirty) {
@@ -499,6 +499,7 @@ function instance($$self, $$props, $$invalidate) {
499
499
  const { Raycaster, Vector3 } = THREE__namespace;
500
500
  let { five: five$1 } = $$props;
501
501
  let { modelOcclusionEnable } = $$props;
502
+ let { onlyVisibleInPanorama } = $$props;
502
503
  let { itemLabels } = $$props;
503
504
  let { hooks } = $$props;
504
505
  let { displayStrategyType } = $$props;
@@ -550,7 +551,10 @@ function instance($$self, $$props, $$invalidate) {
550
551
  const ratioFromTop = (2 - (offsetYFromCenter + 1)) / 2;
551
552
  const isFront = Math.abs(offsetZFromCenter) < 1;
552
553
  const cssOffset = [ratioFromLeft, ratioFromTop];
554
+
555
+ // 只计算在前面就行
553
556
  const isInViewport = isFront && cssOffset.every(ratio => ratio < 1 && ratio >= 0);
557
+
554
558
  return Boolean(isInViewport);
555
559
  };
556
560
 
@@ -571,8 +575,15 @@ function instance($$self, $$props, $$invalidate) {
571
575
  };
572
576
 
573
577
  const getFormatedItemLabels = (five$1, labels) => {
578
+ console.log(labels);
579
+
574
580
  // 计算位置 & 可见性
575
581
  const newLabels = labels.map(label => {
582
+ // 不在绑定点位则直接不可见
583
+ if (five$1.state.panoIndex !== label.panoIndex) {
584
+ return Object.assign(Object.assign({}, label), { visible: false });
585
+ }
586
+
576
587
  const cssOffset = getLabelCssOffset(five$1, label);
577
588
  label.name.length * basicWidth;
578
589
  const strokeLength = getStrokeLength(label.modelPosition[1], displayStrategyType);
@@ -625,16 +636,6 @@ function instance($$self, $$props, $$invalidate) {
625
636
  handleCameraUpdate();
626
637
  };
627
638
 
628
- const onFiveModeChange = mode => {
629
- $$invalidate(5, itemsVisible = false);
630
-
631
- five$1.once('initAnimationEnded', (panoIndex, pose, userAction) => {
632
- $$invalidate(2, anchorEnabled = mode === five.Five.Mode.Panorama);
633
- $$invalidate(5, itemsVisible = true);
634
- if (!userAction) return; else onItemLabelUpdate();
635
- });
636
- };
637
-
638
639
  const handleCameraUpdate = debounce(
639
640
  () => {
640
641
  $$invalidate(5, itemsVisible = true);
@@ -692,11 +693,10 @@ function instance($$self, $$props, $$invalidate) {
692
693
  const onIconClick = itemLabel => {
693
694
  if (five$1.state.mode === five.Five.Mode.Panorama) return;
694
695
  const observers = five$1.work.observers;
695
- const fromPositionVector = new Vector3(itemLabel.position[0], itemLabel.position[1], itemLabel.position[2]);
696
+ const fromPositionVector = new Vector3().fromArray(itemLabel.position);
696
697
  const observer = getNearObserverPano(fromPositionVector, observers);
697
698
 
698
699
  if (observer) {
699
- console.log('--has observer--');
700
700
  itemLabel.observerIndex = observer.panoIndex;
701
701
  }
702
702
 
@@ -739,12 +739,12 @@ function instance($$self, $$props, $$invalidate) {
739
739
  onItemLabelUpdate();
740
740
  addResizeListener();
741
741
  five$1.on('cameraUpdate', handleCameraUpdateCallback);
742
- five$1.on('modeChange', onFiveModeChange);
743
- });
742
+ }); // five.on('modeChange', onFiveModeChange)
744
743
 
745
744
  svelte.onDestroy(() => {
746
745
  five$1.off('cameraUpdate', handleCameraUpdateCallback);
747
- five$1.off('modeChange', onFiveModeChange);
746
+
747
+ // five.off('modeChange', onFiveModeChange)
748
748
  window.removeEventListener('resize', onResize, false);
749
749
  });
750
750
 
@@ -758,10 +758,11 @@ function instance($$self, $$props, $$invalidate) {
758
758
  $$self.$$set = $$props => {
759
759
  if ('five' in $$props) $$invalidate(7, five$1 = $$props.five);
760
760
  if ('modelOcclusionEnable' in $$props) $$invalidate(8, modelOcclusionEnable = $$props.modelOcclusionEnable);
761
- if ('itemLabels' in $$props) $$invalidate(9, itemLabels = $$props.itemLabels);
761
+ if ('onlyVisibleInPanorama' in $$props) $$invalidate(9, onlyVisibleInPanorama = $$props.onlyVisibleInPanorama);
762
+ if ('itemLabels' in $$props) $$invalidate(10, itemLabels = $$props.itemLabels);
762
763
  if ('hooks' in $$props) $$invalidate(0, hooks = $$props.hooks);
763
- if ('displayStrategyType' in $$props) $$invalidate(10, displayStrategyType = $$props.displayStrategyType);
764
- if ('maxVisibleDistance' in $$props) $$invalidate(11, maxVisibleDistance = $$props.maxVisibleDistance);
764
+ if ('displayStrategyType' in $$props) $$invalidate(11, displayStrategyType = $$props.displayStrategyType);
765
+ if ('maxVisibleDistance' in $$props) $$invalidate(12, maxVisibleDistance = $$props.maxVisibleDistance);
765
766
  };
766
767
 
767
768
  return [
@@ -774,6 +775,7 @@ function instance($$self, $$props, $$invalidate) {
774
775
  onIconClick,
775
776
  five$1,
776
777
  modelOcclusionEnable,
778
+ onlyVisibleInPanorama,
777
779
  itemLabels,
778
780
  displayStrategyType,
779
781
  maxVisibleDistance,
@@ -794,10 +796,11 @@ class ItemLabelComponent extends internal.SvelteComponent {
794
796
  {
795
797
  five: 7,
796
798
  modelOcclusionEnable: 8,
797
- itemLabels: 9,
799
+ onlyVisibleInPanorama: 9,
800
+ itemLabels: 10,
798
801
  hooks: 0,
799
- displayStrategyType: 10,
800
- maxVisibleDistance: 11
802
+ displayStrategyType: 11,
803
+ maxVisibleDistance: 12
801
804
  },
802
805
  add_css,
803
806
  [-1, -1]
@@ -807,12 +810,12 @@ class ItemLabelComponent extends internal.SvelteComponent {
807
810
 
808
811
  /** @description 转成内部所需数据 */
809
812
  function parseItemLabelPluginData(data) {
810
- return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined }, label)));
813
+ return data.item_labels.map(label => (Object.assign(Object.assign({}, label), { modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined })));
811
814
  }
812
815
 
813
816
  const defaultMaxVisibleDistance = undefined;
814
817
  const Plugin = (five$1, params) => {
815
- var _a, _b, _c;
818
+ var _a, _b, _c, _d;
816
819
  const pluginState = {
817
820
  container: document.createElement('div'),
818
821
  data: null,
@@ -823,8 +826,9 @@ const Plugin = (five$1, params) => {
823
826
  app: undefined,
824
827
  hooks: new five.Subscribe(),
825
828
  modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
826
- displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL,
827
- maxVisibleDistance: (_c = params === null || params === void 0 ? void 0 : params.maxVisibleDistance) !== null && _c !== void 0 ? _c : defaultMaxVisibleDistance,
829
+ onlyVisibleInPanorama: (_b = params === null || params === void 0 ? void 0 : params.onlyVisibleInPanorama) !== null && _b !== void 0 ? _b : true,
830
+ displayStrategyType: (_c = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _c !== void 0 ? _c : exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL,
831
+ maxVisibleDistance: (_d = params === null || params === void 0 ? void 0 : params.maxVisibleDistance) !== null && _d !== void 0 ? _d : defaultMaxVisibleDistance,
828
832
  };
829
833
  pluginState.container.setAttribute('class', 'item-label-plugin-container');
830
834
  pluginState.container.style.cssText = `
@@ -861,6 +865,7 @@ const Plugin = (five$1, params) => {
861
865
  return true;
862
866
  };
863
867
  const dispose = () => {
868
+ removeListener4Five();
864
869
  pluginState.container.remove();
865
870
  };
866
871
  const render = () => {
@@ -880,6 +885,7 @@ const Plugin = (five$1, params) => {
880
885
  props: {
881
886
  five: five$1,
882
887
  modelOcclusionEnable: pluginState.modelOcclusionEnable,
888
+ onlyVisibleInPanorama: pluginState.onlyVisibleInPanorama,
883
889
  itemLabels: pluginState.itemLabels,
884
890
  wrapper: pluginState.wrapper,
885
891
  hooks: pluginState.hooks,
@@ -897,9 +903,27 @@ const Plugin = (five$1, params) => {
897
903
  };
898
904
  // 添加 five 监听
899
905
  const addListener4Five = () => {
900
- // five.on('modeChange', onFiveModeChange)
906
+ five$1.on('modeChange', onFiveModeChange);
901
907
  five$1.once('dispose', dispose);
902
908
  };
909
+ // 取消 five 监听
910
+ const removeListener4Five = () => {
911
+ five$1.off('modeChange', onFiveModeChange);
912
+ };
913
+ const onFiveModeChange = (mode) => {
914
+ // if (!pluginState.enabled) return
915
+ if (mode !== five.Five.Mode.Panorama) {
916
+ pluginState.fiveModeEnabled = false;
917
+ disable();
918
+ return;
919
+ }
920
+ // pluginState.fiveModeEnabled = false
921
+ // render()
922
+ five$1.once('initAnimationEnded', () => {
923
+ pluginState.fiveModeEnabled = true;
924
+ enable();
925
+ });
926
+ };
903
927
  addListener4Five();
904
928
  return {
905
929
  appendTo,
@@ -10,10 +10,12 @@ export declare enum ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE {
10
10
  export interface ItemLabelPluginParametersType {
11
11
  maxVisibleDistance?: number;
12
12
  modelOcclusionEnable?: boolean;
13
+ onlyVisibleInPanorama?: boolean;
13
14
  displayStrategyType?: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
14
15
  }
15
16
  export interface ItemLabelPluginData {
16
17
  item_labels: Readonly<{
18
+ panoIndex: number;
17
19
  id: string;
18
20
  code: string;
19
21
  name: string;
@@ -24,6 +26,7 @@ export interface ItemLabelPluginData {
24
26
  }>[];
25
27
  }
26
28
  export interface ItemLabel {
29
+ panoIndex: number;
27
30
  id: string;
28
31
  code: string;
29
32
  name: string;
@@ -54,6 +57,7 @@ export interface ItemLabelPluginState {
54
57
  app?: ItemLabelComponent | undefined;
55
58
  hooks: Subscribe<PluginEvent>;
56
59
  modelOcclusionEnable: boolean;
60
+ onlyVisibleInPanorama: boolean;
57
61
  displayStrategyType: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
58
62
  maxVisibleDistance: number | undefined;
59
63
  }
@@ -1,13 +1,13 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
2
  export interface ModelViewPluginExportType {
3
- appendTo(element: HTMLElement, size?: {
3
+ appendTo: (element: HTMLElement, size?: {
4
4
  width?: number;
5
5
  height?: number;
6
- }): void;
7
- refresh(size?: {
6
+ }) => void;
7
+ refresh: (size?: {
8
8
  width?: number;
9
9
  height?: number;
10
- }): void;
10
+ }) => void;
11
11
  }
12
12
  /**
13
13
  * Five 模型插件
@@ -74,8 +74,7 @@ const ModelViewPlugin = (five) => {
74
74
  };
75
75
  const handleModelLoaded = () => {
76
76
  function cloneMaterial(material) {
77
- material = material.clone();
78
- material.uniforms.modelAlpha.value = 1;
77
+ material.clone().uniforms.modelAlpha.value = 1;
79
78
  if (material.uniforms.map.value) {
80
79
  material.uniforms.map.value.needsUpdate = true;
81
80
  }
@@ -123,7 +122,7 @@ const ModelViewPlugin = (five) => {
123
122
  return;
124
123
  const element = renderer.domElement;
125
124
  const container = element.parentNode;
126
- if (container && container.nodeName) {
125
+ if (container === null || container === void 0 ? void 0 : container.nodeName) {
127
126
  const { width = container.offsetWidth, height = container.offsetHeight } = size;
128
127
  renderer.setSize(width, height);
129
128
  // 修改摄像机 aspect 比值
@@ -0,0 +1,15 @@
1
+ import type { Five } from '@realsee/five';
2
+ import type { PanoRulerProPluginDatas, PanoRulerProPluginParameterType, PanoRulerProPluginState } from './typings';
3
+ export default class Controller {
4
+ private five;
5
+ private container;
6
+ private panoRulerProData;
7
+ private rulerItems;
8
+ state: PanoRulerProPluginState;
9
+ constructor(five: Five, params: PanoRulerProPluginParameterType);
10
+ load(serverData: PanoRulerProPluginDatas): Promise<void>;
11
+ enable(): boolean;
12
+ disable(): boolean;
13
+ private render;
14
+ private dispose;
15
+ }
@@ -0,0 +1,8 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType } from './typings';
3
+ /**
4
+ * 全景标尺插件
5
+ */
6
+ export declare const PanoRulerProPlugin: FivePlugin<PanoRulerProPluginParameterType, PanoRulerProPluginExportType>;
7
+ export default PanoRulerProPlugin;
8
+ export type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType, PanoRulerProPluginOptions, PanoRulerProPluginState, } from './typings';