@realsee/dnalogel 2.1.0-alpha.16 → 2.1.0-alpha.17

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 (202) hide show
  1. package/dist/CSS3DRenderPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  2. package/dist/CameraMovementPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  3. package/dist/CruisePlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  4. package/dist/GuideLinePlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  5. package/dist/ItemLabelPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  6. package/dist/ModelChassisCompassPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  7. package/dist/ModelEntryDoorGuidePlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  8. package/dist/ModelItemLabelPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  9. package/dist/ModelRoomLabelPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  10. package/dist/ModelTVVideoPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  11. package/dist/ModelViewPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  12. package/dist/Object3DHelperPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  13. package/dist/PanoCompassPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  14. package/dist/PanoCursorRaycasterPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  15. package/dist/PanoDoorLabelPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  16. package/dist/PanoMeasurePlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  17. package/dist/PanoRulerPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  18. package/dist/PanoRulerProPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  19. package/dist/PanoSpatialTagPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  20. package/dist/PanoTagPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  21. package/dist/PanoTagPlugin/index.js +89 -84
  22. package/dist/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  23. package/dist/floorplan/MapviewFloorplanPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  24. package/dist/floorplan/ModelFloorplanPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  25. package/dist/floorplan/PanoFloorplanRadarPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  26. package/dist/floorplan/TopviewFloorplanPlugin/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  27. package/dist/index.es.js +89 -84
  28. package/dist/index.js +89 -84
  29. package/dist/index.umd.js +89 -84
  30. package/docs/classes/CruisePluginController.html +14 -14
  31. package/docs/classes/Magnifier.html +4 -4
  32. package/docs/classes/ModelRoomLabelController.html +4 -4
  33. package/docs/classes/Object3DHelperController.html +9 -9
  34. package/docs/classes/PanoTagPluginController.html +23 -23
  35. package/docs/enums/CameraMovementEffect.html +2 -2
  36. package/docs/enums/ContentType.html +7 -7
  37. package/docs/enums/DIRECTION.html +1 -1
  38. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  39. package/docs/enums/DimensionType.html +1 -1
  40. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  41. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  42. package/docs/enums/LinkType.html +1 -1
  43. package/docs/enums/PointType.html +1 -1
  44. package/docs/enums/Rotation.html +2 -2
  45. package/docs/index.html +1 -1
  46. package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
  47. package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
  48. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  49. package/docs/interfaces/FloorplanBounding.html +4 -4
  50. package/docs/interfaces/FloorplanData.html +2 -2
  51. package/docs/interfaces/FloorplanEntrance.html +7 -7
  52. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  53. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  54. package/docs/interfaces/FloorplanFloorData.html +2 -2
  55. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  56. package/docs/interfaces/FloorplanObserver.html +2 -2
  57. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  58. package/docs/interfaces/FloorplanPosition.html +2 -2
  59. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  60. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  61. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  62. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  63. package/docs/interfaces/FloorplanServerData.html +2 -2
  64. package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
  65. package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
  66. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  67. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  68. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  69. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  70. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  71. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  72. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  73. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  74. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  75. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  76. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  77. package/docs/interfaces/LineJson.html +1 -1
  78. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  79. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  80. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  81. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  82. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  83. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  84. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  85. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  86. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  87. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  88. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  89. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  90. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  91. package/docs/interfaces/Object3DHelperState.html +1 -1
  92. package/docs/interfaces/OpenParameter.html +2 -2
  93. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  94. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  95. package/docs/interfaces/PanoMeasureParameterType.html +2 -2
  96. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  97. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  98. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  99. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  100. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  101. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  102. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  103. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  104. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  105. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  106. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  107. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  108. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  109. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  110. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  111. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  112. package/docs/interfaces/Point.html +1 -1
  113. package/docs/interfaces/PointJson.html +1 -1
  114. package/docs/interfaces/Room.html +1 -1
  115. package/docs/interfaces/RoomInfo.html +1 -1
  116. package/docs/interfaces/RoomLabel.html +7 -7
  117. package/docs/interfaces/RoomRules.html +1 -1
  118. package/docs/interfaces/Rooms.html +1 -1
  119. package/docs/interfaces/Scissor.html +5 -5
  120. package/docs/interfaces/TagConfig.html +3 -3
  121. package/docs/interfaces/Tags.html +3 -3
  122. package/docs/modules.html +21 -21
  123. package/libs/ItemLabelPlugin/Plugin.js +1 -1
  124. package/libs/ItemLabelPlugin/typings.d.ts +1 -1
  125. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +1 -1
  126. package/libs/ModelItemLabelPlugin/typings.d.ts +1 -1
  127. package/libs/ModelRoomLabelPlugin/Controller.js +1 -1
  128. package/libs/PanoDoorLabelPlugin/Controller.js +1 -1
  129. package/libs/PanoRulerProPlugin/Controller.js +1 -1
  130. package/libs/PanoSpatialTagPlugin/Plugin.js +2 -2
  131. package/libs/PanoTagPlugin/Components/Common/MediaItem.js +6 -5
  132. package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +15 -13
  133. package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +6 -5
  134. package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +17 -15
  135. package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +9 -9
  136. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +17 -15
  137. package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +12 -18
  138. package/libs/PanoTagPlugin/Components/Tag/TextTag.js +4 -3
  139. package/libs/PanoTagPlugin/controller/index.js +6 -6
  140. package/libs/PanoTagPlugin/typings/controller.d.ts +1 -1
  141. package/libs/PanoTagPlugin/utils/nullishCoalescing.d.ts +2 -0
  142. package/libs/PanoTagPlugin/utils/nullishCoalescing.js +9 -0
  143. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +1 -1
  144. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -1
  145. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -1
  146. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -1
  147. package/package.json +1 -1
  148. package/libs/ItemLabelPlugin/ItemLabelComponent.svelte +0 -251
  149. package/libs/ItemLabelPlugin/ItemLabelItem.svelte +0 -183
  150. package/libs/ModelItemLabelPlugin/ItemLabelComponent.svelte +0 -155
  151. package/libs/ModelItemLabelPlugin/ItemLabelItem.svelte +0 -100
  152. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
  153. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -91
  154. package/libs/PanoDoorLabelPlugin/DoorLabelItem.svelte +0 -200
  155. package/libs/PanoRulerProPlugin/RulerItem.svelte +0 -166
  156. package/libs/PanoRulerProPlugin/RulerItems.svelte +0 -212
  157. package/libs/PanoSpatialTagPlugin/Components/origins.svelte +0 -58
  158. package/libs/PanoSpatialTagPlugin/Components/tag.svelte +0 -292
  159. package/libs/PanoTagPlugin/Components/Common/Arrow.svelte +0 -56
  160. package/libs/PanoTagPlugin/Components/Common/Audio.svelte +0 -82
  161. package/libs/PanoTagPlugin/Components/Common/Line/Polyline.svelte +0 -36
  162. package/libs/PanoTagPlugin/Components/Common/Line/Straight.svelte +0 -36
  163. package/libs/PanoTagPlugin/Components/Common/Media.svelte +0 -96
  164. package/libs/PanoTagPlugin/Components/Common/MediaItem.svelte +0 -49
  165. package/libs/PanoTagPlugin/Components/Common/MultiLineText.svelte +0 -56
  166. package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.svelte +0 -120
  167. package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.svelte +0 -81
  168. package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.svelte +0 -30
  169. package/libs/PanoTagPlugin/Components/Common/Shadow.svelte +0 -46
  170. package/libs/PanoTagPlugin/Components/Common/Text.svelte +0 -91
  171. package/libs/PanoTagPlugin/Components/Common/TextItem.svelte +0 -42
  172. package/libs/PanoTagPlugin/Components/PointTag.svelte +0 -55
  173. package/libs/PanoTagPlugin/Components/Tag/AudioTag.svelte +0 -105
  174. package/libs/PanoTagPlugin/Components/Tag/CustomTag.svelte +0 -33
  175. package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.svelte +0 -63
  176. package/libs/PanoTagPlugin/Components/Tag/LinkTag.svelte +0 -167
  177. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.svelte +0 -235
  178. package/libs/PanoTagPlugin/Components/Tag/MediaPlane.svelte +0 -32
  179. package/libs/PanoTagPlugin/Components/Tag/TextTag.svelte +0 -63
  180. package/libs/PanoTagPlugin/Components/Tag/index.svelte +0 -154
  181. package/libs/PanoTagPlugin/Components/TagWrapper.svelte +0 -64
  182. package/libs/floorplan/Components/BaseImage.svelte +0 -26
  183. package/libs/floorplan/Components/Camera.svelte +0 -46
  184. package/libs/floorplan/Components/Compass.svelte +0 -51
  185. package/libs/floorplan/Components/CurrentFloor.svelte +0 -57
  186. package/libs/floorplan/Components/Main.svelte +0 -55
  187. package/libs/floorplan/Components/Normalmage.svelte +0 -11
  188. package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -27
  189. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -29
  190. package/libs/floorplan/Components/RoomLabels/RoomLabel.svelte +0 -120
  191. package/libs/floorplan/Components/RoomLabels/RoomLabels.svelte +0 -45
  192. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -42
  193. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
  194. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -24
  195. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -33
  196. package/libs/floorplan/Components/RuleLabels/RuleItem.svelte +0 -175
  197. package/libs/floorplan/Components/RuleLabels/RuleLabels.svelte +0 -33
  198. package/libs/floorplan/Components/SvgImage.svelte +0 -28
  199. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -85
  200. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
  201. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
  202. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -64
@@ -1,45 +0,0 @@
1
- <script>import RoomLabel from './RoomLabel.svelte';
2
- export let floorIndex;
3
- export let floorplanData;
4
- export let hoveredRoom;
5
- export let getRoomAreaText;
6
- export let getLabelElement;
7
- export let adaptiveRoomLabelVisibleEnable;
8
- $: rooms = floorplanData.floorDatas[floorIndex].rooms;
9
- let clientWidth = 0;
10
- let pxmm = 0;
11
- $: {
12
- const { max, min } = floorplanData.bounding;
13
- const boundingWidth = max.x - min.x;
14
- pxmm = clientWidth / boundingWidth;
15
- }
16
- </script>
17
-
18
- {#if rooms}
19
- <div class="floorplan-plugin__room-labels" bind:clientWidth>
20
- {#each rooms as room (room.id)}
21
- <RoomLabel
22
- {...{
23
- pxmm,
24
- room,
25
- getLabelElement,
26
- getRoomAreaText,
27
- hoveredRoom,
28
- adaptiveRoomLabelVisibleEnable,
29
- }}
30
- />
31
- {/each}
32
- </div>
33
- {/if}
34
-
35
- <style>
36
- .floorplan-plugin__room-labels {
37
- width: 100%;
38
- height: 100%;
39
- position: absolute;
40
- left: 0;
41
- top: 0;
42
- z-index: 20;
43
- pointer-events: none;
44
- }
45
- </style>
@@ -1,42 +0,0 @@
1
- <script>import formatFloorplanPoint from '../../utils/formatPosition';
2
- import RoomMaterial_0 from './RoomMaterial_0.svelte';
3
- import RoomMaterial_1 from './RoomMaterial_1.svelte';
4
- import RoomMaterial_2 from './RoomMaterial_2.svelte';
5
- export let floorIndex;
6
- export let floorplanData;
7
- const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
8
- const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
9
- $: rooms = floorplanData.floorDatas[floorIndex].rooms.map((room) => (Object.assign(Object.assign({}, room), { path: room.path.map((p) => formatFloorplanPoint(p, floorplanData.bounding)) })));
10
- </script>
11
-
12
- <div class="floorplan-plugin__room-material">
13
- {#each rooms as room}
14
- <svg width="100%" height="100%" viewBox={`0 0 ${boundingWidth} ${boundingHeight}`}>
15
- {#if room.floorType === 1}
16
- <RoomMaterial_0 path={room.path} />
17
- {:else if room.floorType === 0}
18
- <RoomMaterial_2 path={room.path} />
19
- {:else}
20
- <RoomMaterial_1 path={room.path} />
21
- {/if}
22
- </svg>
23
- {/each}
24
- </div>
25
-
26
- <style>
27
- .floorplan-plugin__room-material {
28
- position: absolute;
29
- left: 0;
30
- top: 0;
31
- width: 100%;
32
- height: 100%;
33
- }
34
- svg {
35
- position: absolute;
36
- left: 0;
37
- top: 0;
38
- width: 100%;
39
- height: 100%;
40
- overflow: visible;
41
- }
42
- </style>
@@ -1,7 +0,0 @@
1
- <script>import { pathD } from '../../utils/formatPosition';
2
- export let path;
3
- $: d = pathD(path, { needZ: true });
4
- </script>
5
-
6
- <!-- 纯色背景 -->
7
- <path {d} fill="#2F313A" />
@@ -1,24 +0,0 @@
1
- <script>import { pathD } from '../../utils/formatPosition';
2
- export let path;
3
- $: d = pathD(path, { needZ: true });
4
- const halfWidth = 6;
5
- const width = halfWidth * 2;
6
- const patternPathD = `M0 ${halfWidth} h ${width} M${halfWidth} 0 v ${width}`;
7
- </script>
8
-
9
- <!-- 瓷砖地板, 偏蓝的格格 -->
10
- <defs>
11
- <pattern
12
- id="fpm-room-pattern-0"
13
- x="0"
14
- y="0"
15
- {width}
16
- height={width}
17
- patternUnits="userSpaceOnUse"
18
- patternTransform="scale(50 50)"
19
- >
20
- <rect x="0" y="0" {width} height={width} fill="#323747" />
21
- <path d={patternPathD} stroke="#ffffff" stroke-opacity="0.06" stroke-width="0.5" fill="none" />
22
- </pattern>
23
- </defs>
24
- <path {d} fill="url(#fpm-room-pattern-0)" />
@@ -1,33 +0,0 @@
1
- <script>import { pathD } from '../../utils/formatPosition';
2
- export let path;
3
- $: d = pathD(path, { needZ: true });
4
- </script>
5
-
6
- <!-- 木地板,偏灰的格格 -->
7
- <defs>
8
- <pattern
9
- id="room-material-pattern-1"
10
- x="0"
11
- y="0"
12
- width="12"
13
- height="50"
14
- patternUnits="userSpaceOnUse"
15
- patternTransform="scale(50 50)"
16
- >
17
- <rect x="0" y="0" width="6" height="50" fill="none" stroke="#4B4B57" stroke-width="0.5" />
18
- </pattern>
19
- <pattern
20
- id="room-material-pattern-2"
21
- x="6"
22
- y="25"
23
- width="12"
24
- height="50"
25
- patternUnits="userSpaceOnUse"
26
- patternTransform="scale(50 50)"
27
- >
28
- <rect x="0" y="0" width="6" height="50" fill="none" stroke="#4B4B57" stroke-width="0.5" />
29
- </pattern>
30
- </defs>
31
- <path {d} fill="#43434D" />
32
- <path {d} fill="url(#room-material-pattern-1)" />
33
- <path {d} fill="url(#room-material-pattern-2)" />
@@ -1,175 +0,0 @@
1
- <script>export let type;
2
- export let data;
3
- export let bounding;
4
- export let getRuleDistanceText;
5
- const isRow = type === 'top' || type === 'bottom';
6
- const padding = 1000;
7
- const exteriorWallOffset = 180;
8
- const contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2;
9
- const contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2;
10
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
11
- const rulerPoints = data
12
- .map(([start, end]) => (isRow ? [start.x, end.x] : [start.y, end.y]))
13
- .flat()
14
- .sort()
15
- .filter((x, index, arr) => {
16
- // 筛除重复数据
17
- if (index === 0)
18
- return true;
19
- return x !== arr[index - 1];
20
- });
21
- const rulerLabels = rulerPoints.map((num) => {
22
- const left = isRow ? (num - bounding.min.x - padding + exteriorWallOffset) / contentWidth : 0;
23
- const bottom = !isRow ? (num - bounding.min.y - padding + exteriorWallOffset) / contentHeight : 0;
24
- return { left, bottom };
25
- });
26
- rulerLabels.unshift({ left: 0, bottom: 0 });
27
- rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
28
- const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
29
- const rulerTexts = rulerPoints
30
- .map((num, index, arr) => {
31
- const distance = index === 0 ? 0 : num - arr[index - 1];
32
- const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
33
- const left = isRow ? (positionNum - bounding.min.x - padding + exteriorWallOffset) / contentWidth : 0;
34
- const bottom = !isRow ? (positionNum - bounding.min.y - padding + exteriorWallOffset) / contentHeight : 0;
35
- return { left, bottom, distance };
36
- })
37
- .filter(({ distance }) => distance / length > 0.1);
38
- </script>
39
-
40
- <div
41
- class="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--{type}"
42
- class:is-row={isRow}
43
- style:width={isRow ? '100%' : 1 / 16 + 'rem'}
44
- style:height={!isRow ? '100%' : 1 / 16 + 'rem'}
45
- >
46
- <div class="floorplan-plugin__rule-line" />
47
- <div class="floorplan-plugin__rule-scale-wrapper" class:is-row={isRow}>
48
- {#each rulerLabels as rulerLabel}
49
- <div
50
- class="floorplan-plugin__rule-scale"
51
- style:left={rulerLabel.left * 100 + '%'}
52
- style:bottom={rulerLabel.bottom * 100 + '%'}
53
- />
54
- {/each}
55
- </div>
56
- <div class="floorplan-plugin__rule-text-wrapper">
57
- {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
58
- <div
59
- class="floorplan-plugin__rule-text-item"
60
- style:left={textItem.left * 100 + '%'}
61
- style:bottom={textItem.bottom * 100 + '%'}
62
- >
63
- <div class="floorplan-plugin__rule-text" class:is-row={isRow}>
64
- {getRuleDistanceText(textItem.distance)}
65
- </div>
66
- </div>
67
- {/each}
68
- </div>
69
- </div>
70
-
71
- <style>
72
- .floorplan-plugin__rule-labels {
73
- position: absolute;
74
- display: flex;
75
- }
76
- .floorplan-plugin__rule-labels--top {
77
- left: 0;
78
- top: -1.25rem;
79
- }
80
- .floorplan-plugin__rule-labels--bottom {
81
- left: 0;
82
- bottom: -1.25rem;
83
- }
84
- .floorplan-plugin__rule-labels--left {
85
- top: 0;
86
- left: -1.25rem;
87
- }
88
- .floorplan-plugin__rule-labels--right {
89
- top: 0;
90
- right: -1.25rem;
91
- }
92
-
93
- .floorplan-plugin__rule-line {
94
- background: #fff;
95
- opacity: 0.05;
96
- width: 100%;
97
- height: 100%;
98
- }
99
-
100
- .floorplan-plugin__rule-scale-wrapper {
101
- position: absolute;
102
- /* 5px */
103
- width: 0.3125rem;
104
- height: 100%;
105
- left: 50%;
106
- top: 0;
107
- transform: translateX(-50%);
108
- }
109
- .floorplan-plugin__rule-labels.is-row .floorplan-plugin__rule-scale-wrapper {
110
- width: 100%;
111
- /* 5px */
112
- height: 0.3125rem;
113
- top: 50%;
114
- left: 0;
115
- transform: translateY(-50%);
116
- }
117
- .floorplan-plugin__rule-scale {
118
- position: absolute;
119
- background: #fff;
120
- opacity: 0.05;
121
- width: 100%;
122
- /* 1px */
123
- height: 0.0625rem;
124
- }
125
- .floorplan-plugin__rule-labels.is-row .floorplan-plugin__rule-scale {
126
- /* 1px */
127
- width: 0.0625rem;
128
- height: 100%;
129
- }
130
-
131
- .floorplan-plugin__rule-text-wrapper {
132
- position: absolute;
133
- }
134
- .floorplan-plugin__rule-labels--top .floorplan-plugin__rule-text-wrapper {
135
- width: 100%;
136
- height: 0;
137
- /* 10px */
138
- top: 0.625rem;
139
- }
140
- .floorplan-plugin__rule-labels--bottom .floorplan-plugin__rule-text-wrapper {
141
- width: 100%;
142
- height: 0;
143
- /* 10px */
144
- bottom: 0.625rem;
145
- }
146
- .floorplan-plugin__rule-labels--left .floorplan-plugin__rule-text-wrapper {
147
- width: 0;
148
- height: 100%;
149
- /* 10px */
150
- left: 0.625rem;
151
- }
152
- .floorplan-plugin__rule-labels--right .floorplan-plugin__rule-text-wrapper {
153
- width: 0;
154
- height: 100%;
155
- /* 10px */
156
- right: 0.625rem;
157
- }
158
- .floorplan-plugin__rule-text-item {
159
- width: 0;
160
- height: 0;
161
- position: absolute;
162
- transform: rotate(90deg);
163
- }
164
- .floorplan-plugin__rule-labels.is-row .floorplan-plugin__rule-text-item {
165
- transform: rotate(0);
166
- }
167
- .floorplan-plugin__rule-text {
168
- width: max-content;
169
- transform: translate(-50%, -50%);
170
- /* 10px */
171
- font-size: 0.625rem;
172
- color: #fff;
173
- opacity: 0.2;
174
- }
175
- </style>
@@ -1,33 +0,0 @@
1
- <script>import RuleItem from './RuleItem.svelte';
2
- export let floorIndex;
3
- export let floorplanData;
4
- export let getRuleDistanceText;
5
- const padding = 1000;
6
- const exteriorWallOffset = 180;
7
- $: bounding = floorplanData.bounding;
8
- $: ruleLabelData = floorplanData.floorDatas[floorIndex].rules;
9
- $: ruleLabelDataKeys = Object.keys(ruleLabelData);
10
- $: ruleLabelArray = ruleLabelDataKeys.map((key) => [key, ruleLabelData[key]]);
11
- $: boundingWidth = bounding.max.x - bounding.min.x;
12
- $: boundingHeight = bounding.max.y - bounding.min.y;
13
- $: contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2;
14
- $: contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2;
15
- $: width = (contentWidth / boundingWidth) * 100 + '%';
16
- $: height = (contentHeight / boundingHeight) * 100 + '%';
17
- </script>
18
-
19
- <div class="floorplan-plugin__rule-labels-wrapper" style:width style:height>
20
- {#each ruleLabelArray as [type, data] (type)}
21
- <RuleItem {...{ type, data, bounding, getRuleDistanceText }} />
22
- {/each}
23
- </div>
24
-
25
- <style>
26
- .floorplan-plugin__rule-labels-wrapper {
27
- position: absolute;
28
- top: 50%;
29
- left: 50%;
30
- transform: translate(-50%, -50%);
31
- pointer-events: none;
32
- }
33
- </style>
@@ -1,28 +0,0 @@
1
- <script>export let content;
2
- const svgStyle = `
3
- <style>
4
- svg [type='lineGroup'] path {
5
- fill: #ffffff;
6
- stroke: #ffffff;
7
- }
8
- svg [type='lineItemGroup'] g g g g {
9
- stroke: #ffffff;
10
- }
11
- </style>
12
- `;
13
- </script>
14
-
15
- <div class="floorplan-plugin__base-image">
16
- <!-- TODO: @html 是一个很不好的语法,但是目前没有好的方式去配置 User DOM -->
17
- <!-- TODO: 看一下能不能改成在 reactive segment 里动态插入 DOM -->
18
- <!-- eslint-disable svelte/no-at-html-tags -->
19
- {@html svgStyle}
20
- {@html content}
21
- </div>
22
-
23
- <style>
24
- .floorplan-plugin__base-image {
25
- width: 100%;
26
- height: 100%;
27
- }
28
- </style>
@@ -1,85 +0,0 @@
1
- <script>import { onMount } from 'svelte';
2
- import { CAMERA_IMAGE } from '../../Assets/camera';
3
- import throttle from '../../../shared-utils/throttle';
4
- export let five;
5
- export let pxmm;
6
- export let floorplanData;
7
- export let cameraImageUrl;
8
- let panoIndex = five.getCurrentState().panoIndex;
9
- let longitude = five.getCurrentState().longitude;
10
- // 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
11
- $: positionTransform = getCameraPositionTransform(floorplanData, panoIndex);
12
- $: rotateTransform = getCameraRotateTransform(longitude);
13
- /** 获取相机在当前 Five 状态下的位移 */
14
- function getCameraPositionTransform(floorplanData, panoIndex) {
15
- const bounding = floorplanData.bounding;
16
- const floorplanObserver = floorplanData.observers[panoIndex];
17
- if (!floorplanObserver)
18
- return '';
19
- const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
20
- const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
21
- const left = Math.floor(floorplanObserver.positionInImage.x * clientWidth);
22
- const top = Math.floor(floorplanObserver.positionInImage.y * clientHeight);
23
- return `translate(${left}px, ${top}px)`;
24
- }
25
- /** 获取相机在当前 Five 状态下的旋转 */
26
- function getCameraRotateTransform(longitude) {
27
- // 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
28
- const rotate = Math.floor((longitude / Math.PI) * 180) * -1 + 45;
29
- return `rotate(${rotate}deg)`;
30
- }
31
- function onFivePanoWillArrive(_panoIndex) {
32
- panoIndex = _panoIndex;
33
- }
34
- const onFiveCameraDirectionUpdate = throttle((pose) => {
35
- longitude = pose.longitude;
36
- }, 1000 / 60);
37
- onMount(() => {
38
- five.on('panoWillArrive', onFivePanoWillArrive);
39
- five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
40
- return function dispose() {
41
- five.off('panoWillArrive', onFivePanoWillArrive);
42
- five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
43
- };
44
- });
45
- </script>
46
-
47
- <div class="plugin-radar__camera-wrapper">
48
- <div class="plugin-radar__camera-position" style:transform={positionTransform}>
49
- <div
50
- class="plugin-radar__camera-rotate"
51
- style:transform={rotateTransform}
52
- style="background-image: url({cameraImageUrl || CAMERA_IMAGE})"
53
- />
54
- </div>
55
- </div>
56
-
57
- <style>
58
- .plugin-radar__camera-wrapper {
59
- width: 100%;
60
- height: 100%;
61
- position: absolute;
62
- pointer-events: none;
63
- }
64
- .plugin-radar__camera-position {
65
- position: absolute;
66
- left: 0;
67
- top: 0;
68
- width: 0;
69
- height: 0;
70
- transform: none;
71
- pointer-events: none;
72
- transition: transform 1s linear;
73
- }
74
- .plugin-radar__camera-rotate {
75
- position: absolute;
76
- left: -15px;
77
- top: -15px;
78
- width: 17px;
79
- height: 17px;
80
- transform-origin: 15px 15px;
81
- transform: rotate(45deg);
82
- background-repeat: no-repeat;
83
- background-size: 100%;
84
- }
85
- </style>
@@ -1,18 +0,0 @@
1
- <script>import ExtraObjects from './ExtraObjects.svelte';
2
- import BaseImage from '../../../Components/BaseImage.svelte';
3
- import Highlight from '../../../Components/RoomHighlight/RoomHighlight.svelte';
4
- export let five;
5
- export let pxmm;
6
- export let floorIndex;
7
- export let hoverEnable;
8
- export let floorplanData;
9
- export let extraObjects = [];
10
- $: currentFloorExtraObjects = extraObjects === null || extraObjects === void 0 ? void 0 : extraObjects.filter((object) => object.floorIndex === floorIndex);
11
- const onRoomHeightClick = undefined;
12
- </script>
13
-
14
- <BaseImage {...{ floorIndex, floorplanData }} />
15
- <ExtraObjects extraObjects={currentFloorExtraObjects} />
16
- {#if hoverEnable}
17
- <Highlight {...{ five, pxmm, floorIndex, floorplanData, onRoomHeightClick }} />
18
- {/if}
@@ -1,40 +0,0 @@
1
- <script>export let extraObjects = [];
2
- </script>
3
-
4
- <div class="plugin-pano-floorplan__extra-objects">
5
- {#each extraObjects as extraObject (extraObject.id)}
6
- <div
7
- class="plugin-pano-floorplan__extra-object-item--position"
8
- style:top="{extraObject.positionInImage.y * 100}%"
9
- style:left="{extraObject.positionInImage.x * 100}%"
10
- >
11
- <div
12
- class="plugin-pano-floorplan__extra-object-item"
13
- style:width="{extraObject.icon.width / 16}rem"
14
- style:height="{extraObject.icon.height / 16}rem"
15
- style="background-image: {`url(${extraObject.icon.url})`}"
16
- />
17
- </div>
18
- {/each}
19
- </div>
20
-
21
- <style>
22
- .plugin-pano-floorplan__extra-objects {
23
- position: absolute;
24
- top: 0;
25
- left: 0;
26
- width: 100%;
27
- height: 100%;
28
- pointer-events: none;
29
- }
30
-
31
- .plugin-pano-floorplan__extra-object-item--position {
32
- position: absolute;
33
- width: 0;
34
- height: 0;
35
- }
36
-
37
- .plugin-pano-floorplan__extra-object-item {
38
- transform: translate(-50%, -50%);
39
- }
40
- </style>
@@ -1,64 +0,0 @@
1
- <script>import { onMount } from 'svelte';
2
- import Camera from './Camera.svelte';
3
- import CurrentFloor from './CurrentFloor/CurrentFloor.svelte';
4
- export let five;
5
- export let visible;
6
- export let hoverEnable;
7
- export let floorplanData;
8
- export let cameraImageUrl;
9
- export let extraObjects = [];
10
- let pxmm = 0;
11
- let floorIndex = 0;
12
- let clientWidth = 0;
13
- let clientHeight = 0;
14
- let contentWidth = 0;
15
- let contentHeight = 0;
16
- $: {
17
- const size = Math.min(clientWidth, clientHeight);
18
- const { max, min } = floorplanData.bounding;
19
- const boundingWidth = max.x - min.x;
20
- const boundingHeight = max.y - min.y;
21
- const contentSize = (function getSize() {
22
- if (boundingWidth > boundingHeight)
23
- return [size, (size / boundingWidth) * boundingHeight];
24
- return [(size / boundingHeight) * boundingWidth, size];
25
- })();
26
- contentWidth = contentSize[0];
27
- contentHeight = contentSize[1];
28
- pxmm = contentWidth / boundingWidth;
29
- }
30
- function handlePanoArrived(panoIndex) {
31
- floorIndex = five.work.observers[panoIndex].floorIndex;
32
- }
33
- onMount(() => {
34
- five.on('panoArrived', handlePanoArrived);
35
- return () => {
36
- five.off('panoArrived', handlePanoArrived);
37
- };
38
- });
39
- </script>
40
-
41
- {#if visible}
42
- <div class="plugin-floorplan-radar" bind:clientWidth bind:clientHeight>
43
- {#if clientWidth !== 0}
44
- <div class="plugin-floorplan-radar-container" style:width="{contentWidth}px" style:height="{contentHeight}px">
45
- <CurrentFloor {...{ five, pxmm, floorIndex, floorplanData, hoverEnable, extraObjects }} />
46
- <Camera {...{ pxmm, five, floorplanData, cameraImageUrl }} />
47
- </div>
48
- {/if}
49
- </div>
50
- {/if}
51
-
52
- <style>
53
- .plugin-floorplan-radar {
54
- width: 100%;
55
- height: 100%;
56
- display: flex;
57
- justify-content: center;
58
- align-items: center;
59
- }
60
-
61
- .plugin-floorplan-radar-container {
62
- position: relative;
63
- }
64
- </style>