@realsee/dnalogel 2.0.0-alpha.34 → 2.0.0-alpha.35

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 (115) hide show
  1. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  2. package/dist/PanoSpatialTagPlugin/index.js +57 -48
  3. package/dist/index.es.js +57 -48
  4. package/dist/index.js +57 -48
  5. package/dist/index.umd.js +57 -48
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  10. package/docs/enums/CameraMovementEffect.html +2 -2
  11. package/docs/enums/DIRECTION.html +1 -1
  12. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  13. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  14. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  16. package/docs/enums/Rotation.html +2 -2
  17. package/docs/index.html +1 -1
  18. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  19. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  20. package/docs/interfaces/FloorplanBounding.html +4 -4
  21. package/docs/interfaces/FloorplanData.html +2 -2
  22. package/docs/interfaces/FloorplanEntrance.html +7 -7
  23. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  24. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  25. package/docs/interfaces/FloorplanFloorData.html +2 -2
  26. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  27. package/docs/interfaces/FloorplanObserver.html +2 -2
  28. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  29. package/docs/interfaces/FloorplanPosition.html +2 -2
  30. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  31. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  32. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  33. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  34. package/docs/interfaces/FloorplanServerData.html +2 -2
  35. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  36. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  37. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  38. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  39. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  40. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  41. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  42. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  43. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  44. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  45. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  46. package/docs/interfaces/LineJson.html +1 -1
  47. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  48. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  49. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  50. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  51. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  52. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  53. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  54. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  57. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  61. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  62. package/docs/interfaces/OpenParameter.html +2 -2
  63. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  64. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  65. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  66. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  67. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  68. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  69. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  70. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  72. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  73. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  74. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  75. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  81. package/docs/interfaces/Point.html +1 -1
  82. package/docs/interfaces/PointJson.html +1 -1
  83. package/docs/interfaces/Room.html +1 -1
  84. package/docs/interfaces/RoomInfo.html +1 -1
  85. package/docs/interfaces/RoomLabel.html +7 -7
  86. package/docs/interfaces/RoomRules.html +1 -1
  87. package/docs/interfaces/Rooms.html +1 -1
  88. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
  89. package/docs/modules.html +20 -20
  90. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  91. package/libs/ModelSimulationPlugin/index.js +166 -0
  92. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  93. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  94. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  95. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  96. package/libs/PanoSpatialTagPlugin/Components/tag.js +2 -2
  97. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  98. package/libs/PanoSpatialTagPlugin/Plugin.js +55 -46
  99. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  100. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  101. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  102. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  103. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  104. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  105. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  106. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  107. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  108. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  109. package/libs/shared-utils/five/useFivePlugin.d.ts +1 -0
  110. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  111. package/libs/shared-utils/useDebounce.d.ts +8 -0
  112. package/libs/shared-utils/useDebounce.js +22 -0
  113. package/libs/shared-utils/useThrottle.d.ts +8 -0
  114. package/libs/shared-utils/useThrottle.js +25 -0
  115. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -11980,7 +11980,7 @@
11980
11980
  div3 = internal.element("div");
11981
11981
  div2 = internal.element("div");
11982
11982
  internal.attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-eb8bdm");
11983
- internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
11983
+ internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px) scale(" + 1 / /*contentZoom*/ ctx[3] + ")");
11984
11984
  internal.attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-eb8bdm");
11985
11985
  internal.set_style(i0, "width", /*lineWidthZoom*/ ctx[4] + "rem");
11986
11986
  internal.attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-eb8bdm");
@@ -12020,7 +12020,7 @@
12020
12020
  },
12021
12021
  p(ctx, [dirty]) {
12022
12022
  if (dirty & /*contentWidth, contentZoom, contentHeight, upsideDown*/ 394) {
12023
- internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
12023
+ internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px) scale(" + 1 / /*contentZoom*/ ctx[3] + ")");
12024
12024
  }
12025
12025
 
12026
12026
  if (dirty & /*lineWidthZoom*/ 16) {
@@ -12442,22 +12442,22 @@
12442
12442
  }
12443
12443
 
12444
12444
  const MESH_SIZE = 0.001;
12445
- const RAY_ORIGIN_Y = 1.4;
12446
12445
  const RAY_TOLERANT_DISTANCE = 0.01;
12447
12446
  const BLUR_IMAGE_URL = 'https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png';
12448
- const MIN_DISTANCE = 1.2;
12449
- const MAX_DISTANCE = 3.5;
12450
12447
  /**
12451
12448
  * 空间游走标签插件
12452
12449
  */
12453
12450
  const PanoSpatialTagPlugin = (five$1, params) => {
12454
- var _a, _b, _c, _d, _e, _f;
12451
+ var _a, _b, _c, _d, _e, _f, _g, _h;
12455
12452
  let wrapper = params === null || params === void 0 ? void 0 : params.container;
12453
+ let centerY = 1.4;
12456
12454
  const wait = (_a = params === null || params === void 0 ? void 0 : params.wait) !== null && _a !== void 0 ? _a : 200;
12457
12455
  const maxNumberOnScreen = (_b = params === null || params === void 0 ? void 0 : params.maxNumberOnScreen) !== null && _b !== void 0 ? _b : 3;
12458
12456
  const minRad = (_c = params === null || params === void 0 ? void 0 : params.minRad) !== null && _c !== void 0 ? _c : Math.PI / 4;
12459
12457
  const nearTolerance = (_d = params === null || params === void 0 ? void 0 : params.nearTolerance) !== null && _d !== void 0 ? _d : 100;
12460
12458
  const upsideHeight = (_e = params === null || params === void 0 ? void 0 : params.upsideHeight) !== null && _e !== void 0 ? _e : 1.6;
12459
+ const minDistance = (_f = params === null || params === void 0 ? void 0 : params.minDistance) !== null && _f !== void 0 ? _f : 1.2;
12460
+ const maxDistance = (_g = params === null || params === void 0 ? void 0 : params.maxDistance) !== null && _g !== void 0 ? _g : 3.5;
12461
12461
  // const foldPercent = params?.foldPercent ?? 20
12462
12462
  const css3DRender = CSS3DRenderPlugin(five$1);
12463
12463
  const container = document.createElement('div');
@@ -12511,8 +12511,8 @@
12511
12511
  projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
12512
12512
  frustum.setFromProjectionMatrix(projScreenMatrix);
12513
12513
  state.tags.forEach(tag => {
12514
- const distance = camera.position.clone().setY(RAY_ORIGIN_Y).distanceTo(tag.position);
12515
- if (distance < MIN_DISTANCE || distance > MAX_DISTANCE)
12514
+ const distance = camera.position.clone().setY(centerY).distanceTo(tag.position);
12515
+ if (distance < minDistance || distance > maxDistance)
12516
12516
  return tag.destroying = true;
12517
12517
  if (!frustum.containsPoint(tag.position))
12518
12518
  return tag.destroying = true;
@@ -12524,16 +12524,16 @@
12524
12524
  state.tags.forEach(tag => {
12525
12525
  if (tag.destroying) {
12526
12526
  tag.app.$set({
12527
- contentZoom: 0.1 + camera.position.distanceTo(tag.position) / MAX_DISTANCE,
12528
- lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / MAX_DISTANCE),
12527
+ contentZoom: 0.1 + camera.position.distanceTo(tag.position) / maxDistance,
12528
+ lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / maxDistance),
12529
12529
  destroying: tag.destroying,
12530
12530
  });
12531
12531
  }
12532
12532
  else {
12533
12533
  tag.app.$set({
12534
- lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / MAX_DISTANCE),
12535
- lineHeightZoom: 0.4 + (camera.position.distanceTo(tag.position) - MIN_DISTANCE) / MAX_DISTANCE * 0.6,
12536
- contentZoom: 0.1 + camera.position.distanceTo(tag.position) / MAX_DISTANCE,
12534
+ lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / maxDistance),
12535
+ lineHeightZoom: 0.4 + (camera.position.distanceTo(tag.position) - minDistance) / maxDistance * 0.6,
12536
+ contentZoom: 0.1 + camera.position.distanceTo(tag.position) / maxDistance,
12537
12537
  });
12538
12538
  }
12539
12539
  });
@@ -12606,8 +12606,8 @@
12606
12606
  const points = state.points.reduce((result, point) => {
12607
12607
  if (state.tags.find(tag => point.id === tag.id && !tag.destroying))
12608
12608
  return result;
12609
- const distance = camera.position.clone().setY(RAY_ORIGIN_Y).distanceTo(point.position);
12610
- if (distance < MIN_DISTANCE || distance > MAX_DISTANCE)
12609
+ const distance = camera.position.clone().setY(centerY).distanceTo(point.position);
12610
+ if (distance < minDistance || distance > maxDistance)
12611
12611
  return result;
12612
12612
  if (!frustum.containsPoint(point.position))
12613
12613
  return result;
@@ -12667,10 +12667,12 @@
12667
12667
  Math.pow((mouse.y - _mouse.y) / 2 * clientHeight, 2)) > nearTolerance;
12668
12668
  }))
12669
12669
  continue;
12670
- const raycaster = new THREE__namespace.Raycaster(camera.position.clone().setY(RAY_ORIGIN_Y), point.position.clone().sub(camera.position.clone().setY(RAY_ORIGIN_Y)).normalize(), 0, point.distance + RAY_TOLERANT_DISTANCE);
12671
- const [intersect] = five$1.model.bvhs.loaded ?
12672
- five$1.model.intersectRaycaster(raycaster) :
12673
- raycaster.intersectObjects(five$1.model.children, true);
12670
+ const raycaster = new THREE__namespace.Raycaster(camera.position.clone().setY(centerY), point.position.clone().sub(camera.position.clone().setY(centerY)).normalize(), 0, point.distance + RAY_TOLERANT_DISTANCE);
12671
+ const [intersect] = state.intersectObjects ?
12672
+ raycaster.intersectObjects(state.intersectObjects, true) :
12673
+ (five$1.model.bvhs.loaded ?
12674
+ five$1.model.intersectRaycaster(raycaster) :
12675
+ raycaster.intersectObjects(five$1.model.children, true));
12674
12676
  if (!intersect)
12675
12677
  continue;
12676
12678
  if (point.distance - intersect.distance < RAY_TOLERANT_DISTANCE) {
@@ -12690,9 +12692,9 @@
12690
12692
  props: {
12691
12693
  id,
12692
12694
  content: state.render(state.template, replacement),
12693
- lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(position) / MAX_DISTANCE),
12694
- lineHeightZoom: 0.4 + (camera.position.distanceTo(position) - MIN_DISTANCE) / MAX_DISTANCE * 0.6,
12695
- contentZoom: 0.1 + camera.position.distanceTo(position) / MAX_DISTANCE,
12695
+ lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(position) / maxDistance),
12696
+ lineHeightZoom: 0.4 + (camera.position.distanceTo(position) - minDistance) / maxDistance * 0.6,
12697
+ contentZoom: 0.1 + camera.position.distanceTo(position) / maxDistance,
12696
12698
  upsideDown: position.y > upsideHeight,
12697
12699
  folded: state.folded,
12698
12700
  events: state.events,
@@ -12737,6 +12739,13 @@
12737
12739
  if (data.folded === true)
12738
12740
  state.folded = data.folded;
12739
12741
  };
12742
+ /** 设置射线碰撞检测objects
12743
+ *
12744
+ */
12745
+ const setIntersectObjects = (objects) => {
12746
+ state.intersectObjects = objects;
12747
+ updateTags();
12748
+ };
12740
12749
  /** 标签启用
12741
12750
  * 启用插件并重新计算展示标签
12742
12751
  */
@@ -12796,6 +12805,22 @@
12796
12805
  tag.app.$set({ folded: true });
12797
12806
  });
12798
12807
  };
12808
+ const onResize = () => {
12809
+ five$1.once('renderFrame', updateOrigins);
12810
+ };
12811
+ const onModelLoaded = () => {
12812
+ if (!wrapper)
12813
+ wrapper = five$1.getElement().parentElement;
12814
+ if (wrapper)
12815
+ wrapper.appendChild(container);
12816
+ state.forbidden = false;
12817
+ centerY = five$1.model.bounding.getCenter(new THREE__namespace.Vector3()).y;
12818
+ updateTags();
12819
+ five$1.on('panoWillArrive', onPanoWillArrive);
12820
+ five$1.on('panoArrived', onPanoArrived);
12821
+ five$1.on('modeChange', onModeChange);
12822
+ five$1.on('cameraUpdate', onCameraUpdate);
12823
+ };
12799
12824
  const dispose = () => {
12800
12825
  blurImage = null;
12801
12826
  css3DRender.disposeAll();
@@ -12806,40 +12831,24 @@
12806
12831
  });
12807
12832
  state.origins = [];
12808
12833
  state.tags = [];
12834
+ five$1.off('modelLoaded', onModelLoaded);
12835
+ five$1.off('renderFrame', updateOrigins);
12809
12836
  five$1.off('panoWillArrive', onPanoWillArrive);
12810
12837
  five$1.off('panoArrived', onPanoArrived);
12811
12838
  five$1.off('modeChange', onModeChange);
12812
12839
  five$1.off('cameraUpdate', onCameraUpdate);
12840
+ five$1.off('dispose', dispose);
12841
+ window.removeEventListener('resize', onResize, false);
12813
12842
  };
12814
- if ((_f = five$1 === null || five$1 === void 0 ? void 0 : five$1.model) === null || _f === void 0 ? void 0 : _f.loaded) {
12815
- if (!wrapper)
12816
- wrapper = five$1.getElement().parentElement;
12817
- if (wrapper)
12818
- wrapper.appendChild(container);
12819
- state.forbidden = false;
12820
- updateTags();
12821
- five$1.on('panoWillArrive', onPanoWillArrive);
12822
- five$1.on('panoArrived', onPanoArrived);
12823
- five$1.on('modeChange', onModeChange);
12824
- five$1.on('cameraUpdate', onCameraUpdate);
12825
- }
12826
- else {
12827
- five$1.once('modelLoaded', () => {
12828
- if (!wrapper)
12829
- wrapper = five$1.getElement().parentElement;
12830
- if (wrapper)
12831
- wrapper.appendChild(container);
12832
- state.forbidden = false;
12833
- updateTags();
12834
- five$1.on('panoWillArrive', onPanoWillArrive);
12835
- five$1.on('panoArrived', onPanoArrived);
12836
- five$1.on('modeChange', onModeChange);
12837
- five$1.on('cameraUpdate', onCameraUpdate);
12838
- });
12839
- }
12843
+ window.addEventListener('resize', onResize, false);
12844
+ if ((_h = five$1 === null || five$1 === void 0 ? void 0 : five$1.model) === null || _h === void 0 ? void 0 : _h.loaded)
12845
+ onModelLoaded();
12846
+ else
12847
+ five$1.once('modelLoaded', onModelLoaded);
12840
12848
  five$1.on('dispose', dispose);
12841
12849
  return {
12842
12850
  load,
12851
+ setIntersectObjects,
12843
12852
  unfoldAll,
12844
12853
  foldAll,
12845
12854
  unfold,