@realsee/dnalogel 2.0.0-alpha.42 → 2.0.0-alpha.43

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 (130) hide show
  1. package/dist/CSS3DRenderPlugin/PanoCompassPlugin/index.d.ts +1 -1
  2. package/dist/CameraMovementPlugin/PanoCompassPlugin/index.d.ts +1 -1
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/ItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  6. package/dist/ModelChassisCompassPlugin/index.js +5 -30
  7. package/dist/ModelEntryDoorGuidePlugin/PanoCompassPlugin/index.d.ts +1 -1
  8. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  9. package/dist/ModelItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  10. package/dist/ModelRoomLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  11. package/dist/ModelTVVideoPlugin/PanoCompassPlugin/index.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.js +3 -28
  13. package/dist/ModelViewPlugin/PanoCompassPlugin/index.d.ts +1 -1
  14. package/dist/PanoCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  15. package/dist/PanoCompassPlugin/index.d.ts +1 -1
  16. package/dist/PanoCompassPlugin/index.js +64 -99
  17. package/dist/PanoCursorRaycasterPlugin/PanoCompassPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/PanoCompassPlugin/index.d.ts +1 -1
  19. package/dist/PanoRulerPlugin/PanoCompassPlugin/index.d.ts +1 -1
  20. package/dist/PanoRulerPlugin/index.js +3 -28
  21. package/dist/PanoRulerProPlugin/PanoCompassPlugin/index.d.ts +1 -1
  22. package/dist/PanoRulerProPlugin/index.js +29 -58
  23. package/dist/PanoSpatialTagPlugin/PanoCompassPlugin/index.d.ts +1 -1
  24. package/dist/floorplan/ModelFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  25. package/dist/floorplan/ModelFloorplanPlugin/index.js +115 -156
  26. package/dist/floorplan/PanoFloorplanRadarPlugin/PanoCompassPlugin/index.d.ts +1 -1
  27. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +71 -110
  28. package/dist/floorplan/TopviewFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  29. package/dist/floorplan/TopviewFloorplanPlugin/index.js +114 -159
  30. package/dist/index.es.js +341 -416
  31. package/dist/index.js +341 -416
  32. package/dist/index.umd.js +341 -416
  33. package/docs/assets/search.js +1 -1
  34. package/docs/classes/Magnifier.html +4 -4
  35. package/docs/classes/ModelRoomLabelController.html +4 -4
  36. package/docs/enums/CameraMovementEffect.html +2 -2
  37. package/docs/enums/DIRECTION.html +1 -1
  38. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  39. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  40. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  41. package/docs/enums/Rotation.html +2 -2
  42. package/docs/index.html +2 -2
  43. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  44. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  45. package/docs/interfaces/FloorplanBounding.html +4 -4
  46. package/docs/interfaces/FloorplanData.html +2 -2
  47. package/docs/interfaces/FloorplanEntrance.html +7 -7
  48. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  49. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  50. package/docs/interfaces/FloorplanFloorData.html +2 -2
  51. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  52. package/docs/interfaces/FloorplanObserver.html +2 -2
  53. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  54. package/docs/interfaces/FloorplanPosition.html +2 -2
  55. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  56. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  57. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  58. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  59. package/docs/interfaces/FloorplanServerData.html +2 -2
  60. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  61. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  62. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  63. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  64. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  65. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  66. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  67. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  68. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  69. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  70. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  71. package/docs/interfaces/LineJson.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  74. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  76. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  78. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  80. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  84. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  85. package/docs/interfaces/OpenParameter.html +2 -2
  86. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  87. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  91. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  92. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  94. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  95. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  96. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  97. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  98. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  99. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  100. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  101. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  102. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  103. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  104. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  105. package/docs/interfaces/Point.html +1 -1
  106. package/docs/interfaces/PointJson.html +1 -1
  107. package/docs/interfaces/Room.html +1 -1
  108. package/docs/interfaces/RoomInfo.html +1 -1
  109. package/docs/interfaces/RoomLabel.html +7 -7
  110. package/docs/interfaces/RoomRules.html +1 -1
  111. package/docs/interfaces/Rooms.html +1 -1
  112. package/docs/modules.html +18 -18
  113. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +15 -24
  114. package/libs/ModelChassisCompassPlugin/Plugin.js +5 -14
  115. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +8 -17
  116. package/libs/ModelTVVideoPlugin/Plugin.js +3 -12
  117. package/libs/PanoCompassPlugin/controller.js +56 -73
  118. package/libs/PanoCompassPlugin/index.d.ts +1 -1
  119. package/libs/PanoRulerPlugin/Plugin.js +3 -12
  120. package/libs/PanoRulerProPlugin/Controller.js +29 -42
  121. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +29 -42
  122. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +43 -60
  123. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +58 -79
  124. package/libs/floorplan/utils/correctFiveState.js +20 -31
  125. package/libs/floorplan/utils/formatData.js +28 -43
  126. package/libs/shared-utils/five/changeMode.js +28 -39
  127. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  128. package/libs/shared-utils/three/loadTexture.js +6 -17
  129. package/libs/shared-utils/to.js +10 -21
  130. package/package.json +14 -14
@@ -6,31 +6,6 @@ var internal = require('svelte/internal');
6
6
  var svelte = require('svelte');
7
7
  var five = require('@realsee/five');
8
8
 
9
- /******************************************************************************
10
- Copyright (c) Microsoft Corporation.
11
-
12
- Permission to use, copy, modify, and/or distribute this software for any
13
- purpose with or without fee is hereby granted.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
- PERFORMANCE OF THIS SOFTWARE.
22
- ***************************************************************************** */
23
-
24
- function __awaiter(thisArg, _arguments, P, generator) {
25
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
- return new (P || (P = Promise))(function (resolve, reject) {
27
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31
- });
32
- }
33
-
34
9
  const CAMERA_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v////+Vy//w9//k8/+B1f/v9/+D0/+UyP/u9v+D0v/i8f+F0v/g7/+G0P+KzP+Hz/////+Lx//s8/+Puf/h7P+Mxv/w9f7q8v/q8f2RwP/r8f6JrP/t8v6RvP/l6f7////j6P6VvP/f5/7q8P7a4P/U2f6au/+ZuP+ewf+auP+iu//n6f2Fn//j6P/h4fn9/v/4/P/3/P/o9v/l9P+F1P+B1f/i8v+UyP+J0f+E0f/h7//r8v6Izf/g7v/q8v6Pv//f7P7f7f/g7f+Lxf+MyP+Mw//k7v6Ow/+Ov//v8/2Pu//t8f+Tvv/p8P6Uu//q7v/i6P2Xvf+WuP/L1vypu//Az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R7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==';
35
10
 
36
11
  /**
@@ -1696,26 +1671,22 @@ class Controller$1 extends Controller$2 {
1696
1671
 
1697
1672
  const FLOORPLAN_EXTRA_OBJECT_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC';
1698
1673
 
1699
- function formatOutlines(outlines) {
1700
- return __awaiter(this, void 0, void 0, function* () {
1701
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1702
- const getOutlineItem = function (item) {
1703
- return __awaiter(this, void 0, void 0, function* () {
1704
- const outlineItem = {
1705
- index: item.index,
1706
- url: item.url,
1707
- svgUrl: item.svg_url,
1708
- };
1709
- if (item.svg_url) {
1710
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1711
- outlineItem.svgContent = svgContent;
1712
- }
1713
- return outlineItem;
1714
- });
1674
+ async function formatOutlines(outlines) {
1675
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1676
+ const getOutlineItem = async function (item) {
1677
+ const outlineItem = {
1678
+ index: item.index,
1679
+ url: item.url,
1680
+ svgUrl: item.svg_url,
1715
1681
  };
1716
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1717
- return svgOutlineItems;
1718
- });
1682
+ if (item.svg_url) {
1683
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1684
+ outlineItem.svgContent = svgContent;
1685
+ }
1686
+ return outlineItem;
1687
+ };
1688
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1689
+ return svgOutlineItems;
1719
1690
  }
1720
1691
  function formatRoom(data) {
1721
1692
  const floorplanRoomItem = {
@@ -1761,21 +1732,19 @@ function formatFloorplanEntrance(data) {
1761
1732
  };
1762
1733
  return floorplanEntrance;
1763
1734
  }
1764
- function formatData(data) {
1765
- return __awaiter(this, void 0, void 0, function* () {
1766
- const outlines = yield formatOutlines(data.outlines);
1767
- const bounding = data.computed_data.bounding;
1768
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1769
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1770
- const floorplanData = {
1771
- outlines,
1772
- entrance,
1773
- bounding,
1774
- floorDatas,
1775
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1776
- };
1777
- return floorplanData;
1778
- });
1735
+ async function formatData(data) {
1736
+ const outlines = await formatOutlines(data.outlines);
1737
+ const bounding = data.computed_data.bounding;
1738
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1739
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1740
+ const floorplanData = {
1741
+ outlines,
1742
+ entrance,
1743
+ bounding,
1744
+ floorDatas,
1745
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1746
+ };
1747
+ return floorplanData;
1779
1748
  }
1780
1749
  function formatExtraObjects(data, five, floorplanData) {
1781
1750
  const extraObjects = data.map((object) => {
@@ -1893,55 +1862,49 @@ class Controller extends Controller$1 {
1893
1862
  // =============== init Listener ===============
1894
1863
  five.once('dispose', this.dispose);
1895
1864
  }
1896
- load(serverData, state, userAction = true) {
1897
- return __awaiter(this, void 0, void 0, function* () {
1898
- // const loadImage = async () => {
1899
- // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
1900
- // // 当有 svgString 时,没有加载过程
1901
- // if (floorplanData.outlines[floorIndex]?.svgContent) return
1902
- // // 如果当前楼层图片不存在,不存在加载过程
1903
- // const nowFloorImageSrc = floorplanData.outlines[floorIndex]?.url
1904
- // if (!nowFloorImageSrc) return
1905
- // // 图片加载完成时再 render
1906
- // await new Promise<void>((resolve) => {
1907
- // const nowFloorImage = new Image()
1908
- // nowFloorImage.src = nowFloorImageSrc
1909
- // nowFloorImage.onload = () => resolve()
1910
- // })
1911
- // }
1912
- // await loadImage()
1913
- function isPluginServerData(serverData) {
1914
- return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
1915
- }
1916
- const copyData = JSON.parse(JSON.stringify(serverData));
1917
- const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
1918
- const prevData = this.data;
1919
- this.data = yield formatData(_serverData);
1920
- this.hooks.emit('dataLoaded', this.data);
1921
- this.hooks.emit('dataChange', this.data, prevData);
1922
- if (state)
1923
- this.updateState(state, userAction);
1924
- this.render();
1925
- });
1865
+ async load(serverData, state, userAction = true) {
1866
+ // const loadImage = async () => {
1867
+ // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
1868
+ // // 当有 svgString 时,没有加载过程
1869
+ // if (floorplanData.outlines[floorIndex]?.svgContent) return
1870
+ // // 如果当前楼层图片不存在,不存在加载过程
1871
+ // const nowFloorImageSrc = floorplanData.outlines[floorIndex]?.url
1872
+ // if (!nowFloorImageSrc) return
1873
+ // // 图片加载完成时再 render
1874
+ // await new Promise<void>((resolve) => {
1875
+ // const nowFloorImage = new Image()
1876
+ // nowFloorImage.src = nowFloorImageSrc
1877
+ // nowFloorImage.onload = () => resolve()
1878
+ // })
1879
+ // }
1880
+ // await loadImage()
1881
+ function isPluginServerData(serverData) {
1882
+ return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
1883
+ }
1884
+ const copyData = JSON.parse(JSON.stringify(serverData));
1885
+ const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
1886
+ const prevData = this.data;
1887
+ this.data = await formatData(_serverData);
1888
+ this.hooks.emit('dataLoaded', this.data);
1889
+ this.hooks.emit('dataChange', this.data, prevData);
1890
+ if (state)
1891
+ this.updateState(state, userAction);
1892
+ this.render();
1926
1893
  }
1927
- show(options = {}) {
1928
- return __awaiter(this, void 0, void 0, function* () {
1929
- // 已经展示完成了,不做任何操作
1930
- if (this.state.visible)
1931
- return;
1932
- const userAction = options.userAction !== undefined ? options.userAction : true;
1933
- this.updateState({ visible: true }, userAction);
1934
- this._show({ userAction });
1935
- });
1894
+ async show(options = {}) {
1895
+ // 已经展示完成了,不做任何操作
1896
+ if (this.state.visible)
1897
+ return;
1898
+ const userAction = options.userAction !== undefined ? options.userAction : true;
1899
+ this.updateState({ visible: true }, userAction);
1900
+ this._show({ userAction });
1936
1901
  }
1937
- hide(options = {}) {
1938
- return __awaiter(this, void 0, void 0, function* () {
1939
- if (!this.state.visible)
1940
- return;
1941
- const userAction = options.userAction !== undefined ? options.userAction : true;
1942
- this.updateState({ visible: false }, userAction);
1943
- this._hide({ userAction });
1944
- });
1902
+ async hide(options = {}) {
1903
+ if (!this.state.visible)
1904
+ return;
1905
+ const userAction = options.userAction !== undefined ? options.userAction : true;
1906
+ this.updateState({ visible: false }, userAction);
1907
+ this._hide({ userAction });
1945
1908
  }
1946
1909
  enable(options = {}) {
1947
1910
  if (this.state.enabled)
@@ -1986,10 +1949,8 @@ class Controller extends Controller$1 {
1986
1949
  this.extraObjects = formatExtraObjects(data, this.five, this.data);
1987
1950
  this.render();
1988
1951
  }
1989
- formatData(serverData) {
1990
- return __awaiter(this, void 0, void 0, function* () {
1991
- return yield formatData(serverData.data);
1992
- });
1952
+ async formatData(serverData) {
1953
+ return await formatData(serverData.data);
1993
1954
  }
1994
1955
  _enable(options) {
1995
1956
  const { userAction } = options;
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -30,31 +30,6 @@ function _interopNamespace(e) {
30
30
 
31
31
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
32
32
 
33
- /******************************************************************************
34
- Copyright (c) Microsoft Corporation.
35
-
36
- Permission to use, copy, modify, and/or distribute this software for any
37
- purpose with or without fee is hereby granted.
38
-
39
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
40
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
42
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
43
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
- PERFORMANCE OF THIS SOFTWARE.
46
- ***************************************************************************** */
47
-
48
- function __awaiter(thisArg, _arguments, P, generator) {
49
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
- return new (P || (P = Promise))(function (resolve, reject) {
51
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
53
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54
- step((generator = generator.apply(thisArg, _arguments || [])).next());
55
- });
56
- }
57
-
58
33
  /**
59
34
  * 检查一个值是否是狭义上的对象
60
35
  * @param {any} value 要检查的值
@@ -3531,26 +3506,22 @@ class Main extends internal.SvelteComponent {
3531
3506
  }
3532
3507
  }
3533
3508
 
3534
- function formatOutlines(outlines) {
3535
- return __awaiter(this, void 0, void 0, function* () {
3536
- const headers = new Headers({ 'Content-Type': 'text/plain' });
3537
- const getOutlineItem = function (item) {
3538
- return __awaiter(this, void 0, void 0, function* () {
3539
- const outlineItem = {
3540
- index: item.index,
3541
- url: item.url,
3542
- svgUrl: item.svg_url,
3543
- };
3544
- if (item.svg_url) {
3545
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
3546
- outlineItem.svgContent = svgContent;
3547
- }
3548
- return outlineItem;
3549
- });
3509
+ async function formatOutlines(outlines) {
3510
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
3511
+ const getOutlineItem = async function (item) {
3512
+ const outlineItem = {
3513
+ index: item.index,
3514
+ url: item.url,
3515
+ svgUrl: item.svg_url,
3550
3516
  };
3551
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
3552
- return svgOutlineItems;
3553
- });
3517
+ if (item.svg_url) {
3518
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
3519
+ outlineItem.svgContent = svgContent;
3520
+ }
3521
+ return outlineItem;
3522
+ };
3523
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
3524
+ return svgOutlineItems;
3554
3525
  }
3555
3526
  function formatRoom(data) {
3556
3527
  const floorplanRoomItem = {
@@ -3596,21 +3567,19 @@ function formatFloorplanEntrance(data) {
3596
3567
  };
3597
3568
  return floorplanEntrance;
3598
3569
  }
3599
- function formatData(data) {
3600
- return __awaiter(this, void 0, void 0, function* () {
3601
- const outlines = yield formatOutlines(data.outlines);
3602
- const bounding = data.computed_data.bounding;
3603
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3604
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3605
- const floorplanData = {
3606
- outlines,
3607
- entrance,
3608
- bounding,
3609
- floorDatas,
3610
- observers: data.computed_data.observers.map(formateFloorplanObserver),
3611
- };
3612
- return floorplanData;
3613
- });
3570
+ async function formatData(data) {
3571
+ const outlines = await formatOutlines(data.outlines);
3572
+ const bounding = data.computed_data.bounding;
3573
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
3574
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
3575
+ const floorplanData = {
3576
+ outlines,
3577
+ entrance,
3578
+ bounding,
3579
+ floorDatas,
3580
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
3581
+ };
3582
+ return floorplanData;
3614
3583
  }
3615
3584
 
3616
3585
  /**
@@ -3695,37 +3664,35 @@ function nearlyEqual(num1, num2, accuracy = 4) {
3695
3664
  /** 等待 five changeMode 结束
3696
3665
  * @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
3697
3666
  */
3698
- function changeMode(five, changeModeParams) {
3699
- return __awaiter(this, void 0, void 0, function* () {
3700
- yield new Promise((resolve, reject) => {
3701
- // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
3702
- five.changeMode(...changeModeParams).catch((error) => reject(error));
3703
- five.once('initAnimationEnded', () => {
3704
- const fiveCurrentState = five.getCurrentState();
3705
- const correctMode = changeModeParams[0];
3706
- if (fiveCurrentState.mode !== correctMode)
3707
- reject(new Error('mode 与预期不符'));
3708
- /** 检测当前的 current pose 和传入的 pose 是否一致 */
3709
- const checkPose = () => {
3710
- const correctPose = changeModeParams[1];
3711
- if (!correctPose)
3667
+ async function changeMode(five, changeModeParams) {
3668
+ await new Promise((resolve, reject) => {
3669
+ // 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
3670
+ five.changeMode(...changeModeParams).catch((error) => reject(error));
3671
+ five.once('initAnimationEnded', () => {
3672
+ const fiveCurrentState = five.getCurrentState();
3673
+ const correctMode = changeModeParams[0];
3674
+ if (fiveCurrentState.mode !== correctMode)
3675
+ reject(new Error('mode 与预期不符'));
3676
+ /** 检测当前的 current pose 和传入的 pose 是否一致 */
3677
+ const checkPose = () => {
3678
+ const correctPose = changeModeParams[1];
3679
+ if (!correctPose)
3680
+ return true;
3681
+ return Object.keys(correctPose).every((key) => {
3682
+ const fivePoseItem = fiveCurrentState[key];
3683
+ if (fivePoseItem === undefined)
3712
3684
  return true;
3713
- return Object.keys(correctPose).every((key) => {
3714
- const fivePoseItem = fiveCurrentState[key];
3715
- if (fivePoseItem === undefined)
3716
- return true;
3717
- const correctPoseItem = correctPose[key];
3718
- if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
3719
- return nearlyEqual(fivePoseItem, correctPoseItem, 2);
3720
- }
3721
- return fivePoseItem === correctPoseItem;
3722
- });
3723
- };
3724
- const checkPoseResult = checkPose();
3725
- if (!checkPoseResult)
3726
- reject(new Error('five pose 与预期不符'));
3727
- resolve();
3728
- });
3685
+ const correctPoseItem = correctPose[key];
3686
+ if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
3687
+ return nearlyEqual(fivePoseItem, correctPoseItem, 2);
3688
+ }
3689
+ return fivePoseItem === correctPoseItem;
3690
+ });
3691
+ };
3692
+ const checkPoseResult = checkPose();
3693
+ if (!checkPoseResult)
3694
+ reject(new Error('five pose 与预期不符'));
3695
+ resolve();
3729
3696
  });
3730
3697
  });
3731
3698
  }
@@ -4072,24 +4039,22 @@ class Controller extends Controller$1 {
4072
4039
  five.once('dispose', this.dispose);
4073
4040
  this.addEventListener();
4074
4041
  }
4075
- load(serverData, state, userAction = true) {
4076
- return __awaiter(this, void 0, void 0, function* () {
4077
- function isPluginServerData(serverData) {
4078
- return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
4079
- }
4080
- const _data = serverData;
4081
- if (_data && !_data.version)
4082
- console.warn('传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数');
4083
- const copyData = JSON.parse(JSON.stringify(serverData));
4084
- const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
4085
- const prevData = this.data;
4086
- this.data = yield formatData(_serverData);
4087
- this.hooks.emit('dataLoaded', this.data);
4088
- this.hooks.emit('dataChange', this.data, prevData);
4089
- if (state)
4090
- this.updateState(state, userAction);
4091
- this.render();
4092
- });
4042
+ async load(serverData, state, userAction = true) {
4043
+ function isPluginServerData(serverData) {
4044
+ return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
4045
+ }
4046
+ const _data = serverData;
4047
+ if (_data && !_data.version)
4048
+ console.warn('传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数');
4049
+ const copyData = JSON.parse(JSON.stringify(serverData));
4050
+ const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
4051
+ const prevData = this.data;
4052
+ this.data = await formatData(_serverData);
4053
+ this.hooks.emit('dataLoaded', this.data);
4054
+ this.hooks.emit('dataChange', this.data, prevData);
4055
+ if (state)
4056
+ this.updateState(state, userAction);
4057
+ this.render();
4093
4058
  }
4094
4059
  /** 更新户型图位置 */
4095
4060
  updatePosition() {
@@ -4114,25 +4079,21 @@ class Controller extends Controller$1 {
4114
4079
  this.render();
4115
4080
  return this;
4116
4081
  }
4117
- show(options = {}) {
4118
- return __awaiter(this, void 0, void 0, function* () {
4119
- // 已经展示完成了,不做任何操作
4120
- if (this.state.visible)
4121
- return;
4122
- const userAction = options.userAction !== undefined ? options.userAction : true;
4123
- this.updateState({ visible: true }, userAction);
4124
- this._show({ userAction });
4125
- });
4082
+ async show(options = {}) {
4083
+ // 已经展示完成了,不做任何操作
4084
+ if (this.state.visible)
4085
+ return;
4086
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4087
+ this.updateState({ visible: true }, userAction);
4088
+ this._show({ userAction });
4126
4089
  }
4127
- hide(options = {}) {
4128
- return __awaiter(this, void 0, void 0, function* () {
4129
- this.isHiddenByHideFunc = true;
4130
- if (!this.state.visible)
4131
- return;
4132
- const userAction = options.userAction !== undefined ? options.userAction : true;
4133
- this.updateState({ visible: false }, userAction);
4134
- this._hide({ userAction });
4135
- });
4090
+ async hide(options = {}) {
4091
+ this.isHiddenByHideFunc = true;
4092
+ if (!this.state.visible)
4093
+ return;
4094
+ const userAction = options.userAction !== undefined ? options.userAction : true;
4095
+ this.updateState({ visible: false }, userAction);
4096
+ this._hide({ userAction });
4136
4097
  }
4137
4098
  enable(options = {}) {
4138
4099
  if (this.state.enabled)
@@ -4162,42 +4123,36 @@ class Controller extends Controller$1 {
4162
4123
  state.visible ? this._show(options) : this._hide(options);
4163
4124
  }
4164
4125
  }
4165
- formatData(serverData) {
4166
- return __awaiter(this, void 0, void 0, function* () {
4167
- return yield formatData(serverData.data);
4168
- });
4126
+ async formatData(serverData) {
4127
+ return await formatData(serverData.data);
4169
4128
  }
4170
- _show(options) {
4171
- return __awaiter(this, void 0, void 0, function* () {
4172
- if (!this.state.enabled)
4173
- return;
4174
- this.isHiddenByHideFunc = false;
4175
- const { userAction } = options;
4176
- this.hooks.emit('show', { userAction });
4177
- if (this.five.getCurrentState().mode !== 'Topview') {
4178
- yield changeMode(this.five, ['Topview', undefined, undefined, userAction]);
4179
- }
4180
- this.five.model.show(this.floorIndex);
4181
- this.updatePosition();
4182
- this.updateSize();
4183
- const renderDuration = 500;
4184
- const modelOpacity = this.state.config.modelOpacity;
4185
- changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4186
- this.hooks.emit('showAnimationEnded', { userAction });
4187
- this.render();
4188
- });
4129
+ async _show(options) {
4130
+ if (!this.state.enabled)
4131
+ return;
4132
+ this.isHiddenByHideFunc = false;
4133
+ const { userAction } = options;
4134
+ this.hooks.emit('show', { userAction });
4135
+ if (this.five.getCurrentState().mode !== 'Topview') {
4136
+ await changeMode(this.five, ['Topview', undefined, undefined, userAction]);
4137
+ }
4138
+ this.five.model.show(this.floorIndex);
4139
+ this.updatePosition();
4140
+ this.updateSize();
4141
+ const renderDuration = 500;
4142
+ const modelOpacity = this.state.config.modelOpacity;
4143
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4144
+ this.hooks.emit('showAnimationEnded', { userAction });
4145
+ this.render();
4189
4146
  }
4190
- _hide(options) {
4191
- return __awaiter(this, void 0, void 0, function* () {
4192
- if (!this.state.enabled)
4193
- return;
4194
- const { userAction } = options;
4195
- this.hooks.emit('hide', { userAction });
4196
- const modelOpacity = 1;
4197
- const renderDuration = 0;
4198
- changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4199
- this.render();
4200
- });
4147
+ async _hide(options) {
4148
+ if (!this.state.enabled)
4149
+ return;
4150
+ const { userAction } = options;
4151
+ this.hooks.emit('hide', { userAction });
4152
+ const modelOpacity = 1;
4153
+ const renderDuration = 0;
4154
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4155
+ this.render();
4201
4156
  }
4202
4157
  _enable(options) {
4203
4158
  const { userAction } = options;