@realsee/dnalogel 2.0.0-alpha.9 → 2.0.0-beta.36

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 (485) hide show
  1. package/README.md +78 -28
  2. package/components/index.js +1450 -0
  3. package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
  5. package/dist/CSS3DRenderPlugin/index.js +27 -26
  6. package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/index.d.ts +4 -6
  8. package/dist/CameraMovementPlugin/index.js +12 -12
  9. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  10. package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
  11. package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
  12. package/dist/ItemLabelPlugin/index.d.ts +9 -0
  13. package/dist/ItemLabelPlugin/index.js +941 -0
  14. package/dist/ItemLabelPlugin/typings.d.ts +59 -0
  15. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  16. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  17. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  18. package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  19. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  20. package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  21. package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
  22. package/dist/ModelChassisCompassPlugin/index.js +8 -5
  23. package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  24. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  25. package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
  26. package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  27. package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
  28. package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
  29. package/dist/ModelItemLabelPlugin/index.js +674 -0
  30. package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
  31. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  32. package/dist/ModelRoomLabelPlugin/index.js +153 -73
  33. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  34. package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  35. package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
  36. package/dist/ModelTVVideoPlugin/index.js +301 -0
  37. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  38. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  39. package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
  40. package/dist/ModelViewPlugin/index.d.ts +3 -16
  41. package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
  42. package/dist/PanoCompassPlugin/index.d.ts +4 -47
  43. package/dist/PanoCompassPlugin/index.js +242 -129
  44. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  45. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  46. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  47. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  48. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  49. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  50. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  51. package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  52. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  53. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  54. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  55. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  56. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  57. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  58. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  59. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  60. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  61. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  62. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  63. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  64. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  65. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  66. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  67. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  68. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  69. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  70. package/dist/PanoMeasurePlugin/index.d.ts +9 -6
  71. package/dist/PanoMeasurePlugin/index.js +2649 -3442
  72. package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
  73. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  74. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  75. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  76. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  77. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  78. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  79. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  80. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  81. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  82. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  83. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  84. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  85. package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
  86. package/dist/PanoRulerPlugin/index.d.ts +4 -30
  87. package/dist/PanoRulerPlugin/index.js +12 -12
  88. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  89. package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
  90. package/dist/PanoSpatialTagPlugin/index.js +1307 -0
  91. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  92. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  93. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  94. package/dist/base/BasePlugin.d.ts +100 -0
  95. package/dist/base/BasePluginWithData.d.ts +34 -0
  96. package/dist/components/PaintBrush/Controller.d.ts +43 -0
  97. package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
  98. package/dist/components/PaintBrush/index.d.ts +27 -0
  99. package/dist/components/PaintBrush/style.d.ts +2 -0
  100. package/dist/components/PaintBrush/tween.d.ts +62 -0
  101. package/dist/components/PaintBrush/typings.d.ts +58 -0
  102. package/dist/components/PaintBrush/utils.d.ts +26 -0
  103. package/dist/components/index.d.ts +2 -0
  104. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  105. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  106. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  107. package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
  108. package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  109. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  110. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  111. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
  112. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  113. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  114. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  115. package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
  116. package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  117. package/dist/floorplan/index.d.ts +6 -0
  118. package/dist/floorplan/utils/constant.d.ts +22 -0
  119. package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
  120. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  121. package/dist/index.d.ts +15 -24
  122. package/dist/index.es.js +10694 -7145
  123. package/dist/index.js +10432 -6869
  124. package/dist/index.umd.js +10435 -6875
  125. package/dist/shared-utils/five/changeMode.d.ts +4 -1
  126. package/dist/shared-utils/getPxmm.d.ts +8 -0
  127. package/dist/shared-utils/index.d.ts +1 -0
  128. package/dist/shared-utils/math/Interval.d.ts +13 -0
  129. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  130. package/dist/shared-utils/math/index.d.ts +2 -0
  131. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  132. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  133. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  134. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  135. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  136. package/dist/shared-utils/uuid.d.ts +1 -0
  137. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  138. package/docs/assets/search.js +1 -1
  139. package/docs/classes/Magnifier.html +9 -0
  140. package/docs/classes/ModelRoomLabelController.html +5 -8
  141. package/docs/enums/CameraMovementEffect.html +3 -0
  142. package/docs/enums/DIRECTION.html +1 -0
  143. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
  144. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  145. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
  146. package/docs/enums/Rotation.html +3 -0
  147. package/docs/index.html +78 -33
  148. package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
  149. package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
  150. package/docs/interfaces/FloorplanBounding.html +10 -0
  151. package/docs/interfaces/FloorplanData.html +3 -0
  152. package/docs/interfaces/FloorplanEntrance.html +15 -0
  153. package/docs/interfaces/FloorplanExtraObject.html +7 -0
  154. package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
  155. package/docs/interfaces/FloorplanFloorData.html +3 -0
  156. package/docs/interfaces/FloorplanImagePosition.html +3 -0
  157. package/docs/interfaces/FloorplanObserver.html +5 -0
  158. package/docs/interfaces/FloorplanOutlineItem.html +3 -0
  159. package/docs/interfaces/FloorplanPosition.html +3 -0
  160. package/docs/interfaces/FloorplanRoomItem.html +17 -0
  161. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
  162. package/docs/interfaces/FloorplanServerBounding.html +10 -0
  163. package/docs/interfaces/FloorplanServerComputedData.html +1 -0
  164. package/docs/interfaces/FloorplanServerData.html +3 -0
  165. package/docs/interfaces/FloorplanServerEntrance.html +15 -0
  166. package/docs/interfaces/FloorplanServerFloorData.html +3 -0
  167. package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
  168. package/docs/interfaces/FloorplanServerObserver.html +5 -0
  169. package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
  170. package/docs/interfaces/FloorplanServerPosition.html +3 -0
  171. package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
  172. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
  173. package/docs/interfaces/ItemLabelPluginData.html +1 -0
  174. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
  175. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
  176. package/docs/interfaces/LineJson.html +1 -1
  177. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  178. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  179. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  180. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  181. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  182. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  183. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  184. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  185. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  186. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  187. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  188. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  189. package/docs/interfaces/ModelViewPluginExportType.html +1 -0
  190. package/docs/interfaces/OpenParameter.html +3 -0
  191. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  192. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  193. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  194. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
  195. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  196. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  197. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  198. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  199. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
  200. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
  201. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  202. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
  203. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  204. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
  205. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  206. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
  207. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
  208. package/docs/interfaces/Point.html +1 -0
  209. package/docs/interfaces/PointJson.html +1 -1
  210. package/docs/interfaces/Room.html +1 -0
  211. package/docs/interfaces/RoomInfo.html +1 -0
  212. package/docs/interfaces/RoomLabel.html +7 -7
  213. package/docs/interfaces/RoomRules.html +1 -0
  214. package/docs/interfaces/Rooms.html +1 -0
  215. package/docs/modules.html +26 -18
  216. package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  217. package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
  218. package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
  219. package/libs/CSS3DRenderPlugin/index.js +2 -180
  220. package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  221. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
  222. package/libs/CameraMovementPlugin/index.d.ts +4 -6
  223. package/libs/CameraMovementPlugin/index.js +3 -158
  224. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  225. package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
  226. package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
  227. package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
  228. package/libs/ItemLabelPlugin/Plugin.js +120 -0
  229. package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
  230. package/libs/ItemLabelPlugin/events.type.js +1 -0
  231. package/libs/ItemLabelPlugin/index.d.ts +9 -0
  232. package/libs/ItemLabelPlugin/index.js +8 -0
  233. package/libs/ItemLabelPlugin/typings.d.ts +59 -0
  234. package/libs/ItemLabelPlugin/typings.js +7 -0
  235. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  236. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  237. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  238. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  239. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  240. package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
  241. package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  242. package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
  243. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  244. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  245. package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  246. package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
  247. package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
  248. package/libs/ModelChassisCompassPlugin/index.js +2 -74
  249. package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  250. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
  251. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  252. package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
  253. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
  254. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  255. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  256. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
  257. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  258. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  259. package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
  260. package/libs/ModelItemLabelPlugin/index.js +8 -0
  261. package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
  262. package/libs/ModelItemLabelPlugin/typings.js +7 -0
  263. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  264. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  265. package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
  266. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
  267. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  268. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  269. package/libs/ModelSimulationPlugin/index.js +166 -0
  270. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  271. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  272. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  273. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  274. package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  275. package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
  276. package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
  277. package/libs/ModelTVVideoPlugin/index.js +4 -0
  278. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  279. package/libs/ModelTVVideoPlugin/typings.js +8 -0
  280. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  281. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  282. package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
  283. package/libs/ModelViewPlugin/Plugin.js +160 -0
  284. package/libs/ModelViewPlugin/index.d.ts +3 -16
  285. package/libs/ModelViewPlugin/index.js +2 -159
  286. package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
  287. package/libs/PanoCompassPlugin/Plugin.js +249 -0
  288. package/libs/PanoCompassPlugin/index.d.ts +4 -47
  289. package/libs/PanoCompassPlugin/index.js +3 -167
  290. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  291. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  292. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  293. package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
  294. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  295. package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
  296. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  297. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  298. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  299. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  300. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  301. package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
  302. package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  303. package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
  304. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  305. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  306. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  307. package/libs/PanoMeasurePlugin/Model/line.js +61 -11
  308. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  309. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  310. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  311. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  312. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  313. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  314. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  315. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  316. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  317. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
  318. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  319. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  320. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  321. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  322. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  323. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
  324. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  325. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
  326. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  327. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  328. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  329. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  330. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  331. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
  332. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  333. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  334. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  335. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
  336. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  337. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  338. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  339. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  340. package/libs/PanoMeasurePlugin/index.d.ts +9 -6
  341. package/libs/PanoMeasurePlugin/index.js +3 -1
  342. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  343. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  344. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  345. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  346. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  347. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  348. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  349. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  350. package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
  351. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  352. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  353. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  354. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  355. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  356. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  357. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  358. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  359. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
  360. package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
  361. package/libs/PanoRulerPlugin/Plugin.js +403 -0
  362. package/libs/PanoRulerPlugin/index.d.ts +4 -30
  363. package/libs/PanoRulerPlugin/index.js +2 -397
  364. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  365. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  366. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  367. package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
  368. package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
  369. package/libs/PanoSpatialTagPlugin/index.js +5 -0
  370. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  371. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  372. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  373. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  374. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  375. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  376. package/libs/base/BasePlugin.d.ts +100 -0
  377. package/libs/base/BasePlugin.js +31 -0
  378. package/libs/base/BasePluginWithData.d.ts +34 -0
  379. package/libs/base/BasePluginWithData.js +4 -0
  380. package/libs/components/PaintBrush/Controller.d.ts +43 -0
  381. package/libs/components/PaintBrush/Controller.js +575 -0
  382. package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
  383. package/libs/components/PaintBrush/Subscribe.js +121 -0
  384. package/libs/components/PaintBrush/index.d.ts +27 -0
  385. package/libs/components/PaintBrush/index.js +57 -0
  386. package/libs/components/PaintBrush/style.d.ts +2 -0
  387. package/libs/components/PaintBrush/style.js +102 -0
  388. package/libs/components/PaintBrush/tween.d.ts +62 -0
  389. package/libs/components/PaintBrush/tween.js +15 -0
  390. package/libs/components/PaintBrush/typings.d.ts +58 -0
  391. package/libs/components/PaintBrush/typings.js +6 -0
  392. package/libs/components/PaintBrush/utils.d.ts +26 -0
  393. package/libs/components/PaintBrush/utils.js +51 -0
  394. package/libs/components/index.d.ts +2 -0
  395. package/libs/components/index.js +3 -0
  396. package/libs/floorplan/Assets/compass.d.ts +1 -0
  397. package/libs/floorplan/Assets/compass.js +1 -0
  398. package/libs/floorplan/Components/BaseImage.js +10 -5
  399. package/libs/floorplan/Components/Camera.js +120 -0
  400. package/libs/floorplan/Components/Compass.js +120 -0
  401. package/libs/floorplan/Components/CurrentFloor.js +469 -0
  402. package/libs/floorplan/Components/Main.js +470 -0
  403. package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
  404. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
  405. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
  406. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
  407. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
  408. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
  409. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
  410. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  411. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
  412. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
  413. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
  414. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
  415. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
  416. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
  417. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
  418. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
  419. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  420. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
  421. package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  422. package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
  423. package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  424. package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
  425. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
  426. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  427. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
  428. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  429. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
  430. package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  431. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
  432. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  433. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
  434. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  435. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
  436. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  437. package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
  438. package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
  439. package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  440. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
  441. package/libs/floorplan/index.d.ts +6 -0
  442. package/libs/floorplan/index.js +7 -0
  443. package/libs/floorplan/utils/constant.d.ts +22 -0
  444. package/libs/floorplan/utils/constant.js +23 -0
  445. package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
  446. package/libs/floorplan/utils/correctFiveState.js +46 -0
  447. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  448. package/libs/floorplan/utils/formatPosition.js +3 -3
  449. package/libs/index.d.ts +15 -24
  450. package/libs/index.js +25 -14
  451. package/libs/shared-utils/Subscribe.js +8 -1
  452. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  453. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  454. package/libs/shared-utils/five/changeMode.d.ts +4 -1
  455. package/libs/shared-utils/five/changeMode.js +34 -13
  456. package/libs/shared-utils/getPxmm.d.ts +8 -0
  457. package/libs/shared-utils/getPxmm.js +25 -20
  458. package/libs/shared-utils/index.d.ts +1 -0
  459. package/libs/shared-utils/index.js +1 -0
  460. package/libs/shared-utils/math/Interval.d.ts +13 -0
  461. package/libs/shared-utils/math/Interval.js +40 -0
  462. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  463. package/libs/shared-utils/math/Rectangle.js +50 -0
  464. package/libs/shared-utils/math/evenNumber.js +1 -1
  465. package/libs/shared-utils/math/index.d.ts +2 -0
  466. package/libs/shared-utils/math/index.js +2 -0
  467. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  468. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  469. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  470. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  471. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  472. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  473. package/libs/shared-utils/tinyEJSrender.js +210 -0
  474. package/libs/shared-utils/uuid.d.ts +1 -0
  475. package/libs/shared-utils/uuid.js +1 -0
  476. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  477. package/package.json +13 -6
  478. package/CHANGELOG.md +0 -30
  479. package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
  480. package/dist/shared-utils/useDebounce.d.ts +0 -8
  481. package/dist/shared-utils/useThrottle.d.ts +0 -8
  482. package/docs/enums/ModelFloorplanErrorType.html +0 -1
  483. package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
  484. package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
  485. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
@@ -1,398 +1,3 @@
1
- import { Five } from '@realsee/five';
2
- import { Raycaster, Vector3 } from 'three';
3
- import { intersectionOfLine } from '../shared-utils/math/planimetry';
4
- import { nextFrame } from '../shared-utils/nextFrame';
5
- import throttle from '../shared-utils/throttle';
6
- import PanoRulerStyle from './style';
7
- const getDistance = (p1, p2) => {
8
- return Math.sqrt(Math.pow(p1.z - p2.z, 2) + Math.pow(p1.x - p2.x, 2));
9
- };
10
- const getRoomHeightInfo = (roomInfo, five) => {
11
- const roomHeightInfo = {};
12
- const raycaster = new Raycaster();
13
- const work = five.work;
14
- if (!work)
15
- return roomHeightInfo;
16
- const observers = roomInfo.observers;
17
- work.observers.forEach((observer, index) => {
18
- const { standingPosition: position } = observer;
19
- const point = new Vector3(position.x, position.y, position.z);
20
- raycaster.set(point, new Vector3(0, 1, 0));
21
- const [intersection] = five.model.intersectRaycaster(raycaster);
22
- // 虚景 VR 没有天花板碰撞射线无相交,默认固定层高2.7m
23
- const verticalY = intersection ? intersection.point.y : 2.7;
24
- const id = observers[index];
25
- if (!id)
26
- return roomHeightInfo;
27
- const observerRoomName = roomInfo.rooms[id].name;
28
- if (roomHeightInfo[observerRoomName] === undefined) {
29
- roomHeightInfo[observerRoomName] = {
30
- __roof: [verticalY],
31
- __floor: [point.y],
32
- };
33
- }
34
- else {
35
- roomHeightInfo[observerRoomName].__roof.push(verticalY);
36
- roomHeightInfo[observerRoomName].__floor.push(point.y);
37
- }
38
- });
39
- // 地板高度求中位数,屋顶高度取最高
40
- for (const roomName in roomHeightInfo) {
41
- const room = roomHeightInfo[roomName];
42
- room.__roof.sort();
43
- room.__floor.sort();
44
- room.floor = room.__floor[~~(room.__floor.length / 2)];
45
- room.roof = room.__roof[room.__roof.length - 1];
46
- }
47
- return roomHeightInfo;
48
- };
49
- /**
50
- * 全景标尺插件
51
- */
52
- export const PanoRulerPlugin = (five, params) => {
53
- const state = {
54
- enable: false,
55
- loaded: false,
56
- options: params.options || {
57
- distanceText: (distance) => `${distance.toFixed(1)}m`,
58
- },
59
- };
60
- const tpl = (name, distance) => {
61
- const domStr = `
62
- <div class="PanoRulerPlugin-rule-line">
63
- <em></em>
64
- <div class="PanoRulerPlugin-rule-label">
65
- <div class="PanoRulerPlugin-rule-label-name">${state.options.distanceText(distance)}</div>
66
- </div>
67
- </div>
68
- `;
69
- const res = document.createElement('div');
70
- res.setAttribute('class', 'PanoRulerPlugin-rule');
71
- res.setAttribute('data-name', name);
72
- res.setAttribute('style', 'display: none');
73
- res.innerHTML = domStr;
74
- return res;
75
- };
76
- const $rule = document.createElement('div');
77
- $rule.setAttribute('style', `position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;`);
78
- // 添加标尺样式
79
- const style = document.createElement('div');
80
- style.innerHTML = PanoRulerStyle;
81
- $rule.appendChild(style);
82
- const __rule = {};
83
- const _load = (roomInfo, roomRules) => {
84
- if (state.loaded) {
85
- throw new Error('标尺被重复初始化!');
86
- }
87
- const roomHeightInfo = getRoomHeightInfo(roomInfo, five);
88
- const work = five.work;
89
- if (!work)
90
- return false;
91
- for (const obKey in roomRules) {
92
- const points = roomRules[obKey];
93
- const { standingPosition: defaultPosition } = work.observers[0];
94
- const roomPoints = points.map(({ x, z, observers }) => {
95
- const pointRoomName = observers.length > 0 ? roomInfo.rooms[roomInfo.observers[observers[0]]].name : '';
96
- const medianFloorHeight = roomHeightInfo[pointRoomName] ? roomHeightInfo[pointRoomName].floor : null;
97
- let minDistance = Infinity;
98
- let nearestPoint = {
99
- index: 0,
100
- x: defaultPosition.x,
101
- y: defaultPosition.y,
102
- z: defaultPosition.z,
103
- };
104
- observers.forEach((index) => {
105
- if (!work.observers[index])
106
- return;
107
- const { standingPosition: position } = work.observers[index];
108
- const observerPoint = {
109
- index,
110
- x: position.x,
111
- y: position.y,
112
- z: position.z,
113
- };
114
- const distance = getDistance({ x, z }, observerPoint);
115
- if (medianFloorHeight) {
116
- // 取最近点时排除高度与房间平均高度差大于0.3米的点
117
- if (distance < minDistance && Math.abs(observerPoint.y - medianFloorHeight) < 0.3) {
118
- minDistance = distance;
119
- nearestPoint = observerPoint;
120
- }
121
- }
122
- else {
123
- if (distance < minDistance) {
124
- minDistance = distance;
125
- nearestPoint = observerPoint;
126
- }
127
- }
128
- });
129
- const _origin = new Vector3(x, nearestPoint.y, z);
130
- Object.assign(_origin, { observers });
131
- const verticalY = roomHeightInfo[pointRoomName] ? roomHeightInfo[pointRoomName].roof : null;
132
- const _vertical = !verticalY ? null : new Vector3(x, verticalY, z);
133
- if (_vertical)
134
- Object.assign(_vertical, { observers });
135
- const origin = _origin;
136
- const vertical = _vertical;
137
- return { origin, vertical };
138
- });
139
- __rule[obKey] = {
140
- origins: roomPoints.map((roomPoint) => roomPoint.origin),
141
- rules: [],
142
- };
143
- for (const { origin, vertical } of roomPoints) {
144
- if (!vertical)
145
- continue;
146
- const $element = tpl(obKey, origin.distanceTo(vertical));
147
- $rule.append($element);
148
- __rule[obKey].rules.push({ vertical: true, rule: [origin, vertical], $element });
149
- }
150
- for (let index = 0; index < roomPoints.length; index++) {
151
- let nextIndex = index + 1;
152
- if (nextIndex >= roomPoints.length)
153
- nextIndex = 0;
154
- const { origin } = roomPoints[index];
155
- const { origin: next } = roomPoints[nextIndex];
156
- const $element = tpl(obKey, origin.distanceTo(next));
157
- $rule.append($element);
158
- __rule[obKey].rules.push({ vertical: false, rule: [origin, next], $element });
159
- }
160
- }
161
- state.loaded = true;
162
- return true;
163
- };
164
- const load = async (_roomInfo, _roomRules, options) => {
165
- const roomInfo = _roomInfo || params.roomInfo;
166
- const roomRules = _roomRules || params.roomRules;
167
- if (!roomInfo || !roomRules) {
168
- throw new Error('标尺数据依赖不齐全!');
169
- }
170
- state.options = Object.assign({}, state.options, options || {});
171
- if (five.model.loaded) {
172
- return _load(roomInfo, roomRules);
173
- }
174
- else {
175
- return await new Promise((resolve) => five.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
176
- }
177
- };
178
- if (params.roomInfo && params.roomRules) {
179
- load(params.roomInfo, params.roomRules);
180
- }
181
- const getRuleScreenIntr = (startPoint, endPoint, canvasWidth, canvasHeight) => {
182
- const screenLines = [
183
- [
184
- { x: 0, y: 0 },
185
- { x: canvasWidth, y: 0 },
186
- ],
187
- [
188
- { x: 0, y: 0 },
189
- { x: 0, y: canvasHeight },
190
- ],
191
- [
192
- { x: canvasWidth, y: 0 },
193
- { x: canvasWidth, y: canvasHeight },
194
- ],
195
- [
196
- { x: 0, y: canvasHeight },
197
- { x: canvasWidth, y: canvasHeight },
198
- ],
199
- ];
200
- const intr = [];
201
- for (let i = 0; i < screenLines.length; i++) {
202
- const result = intersectionOfLine([startPoint, endPoint], [screenLines[i][0], screenLines[i][1]], true);
203
- if (result)
204
- intr.push(result);
205
- }
206
- if (intr.length === 0)
207
- return false;
208
- else {
209
- return intr;
210
- }
211
- };
212
- const freshRule = () => {
213
- const element = five.getElement()?.parentElement;
214
- if (!element)
215
- return;
216
- if (!state.loaded)
217
- return;
218
- if (Object.keys(__rule).length <= 0)
219
- return;
220
- const { panoIndex, camera, currentMode } = five;
221
- if (panoIndex === undefined)
222
- return;
223
- let name;
224
- for (const _name in __rule) {
225
- if (_name.split(',').indexOf(panoIndex.toString()) >= 0)
226
- name = _name;
227
- }
228
- if (!name)
229
- return;
230
- const cameraPosition = camera.position;
231
- const cameraDirection = camera.getWorldDirection(new Vector3());
232
- const width = element.clientWidth;
233
- const height = element.clientHeight;
234
- // 非全景模式下隐藏所有标尺
235
- if (currentMode !== Five.Mode.Panorama) {
236
- for (const _name in __rule) {
237
- for (const { $element } of __rule[_name].rules) {
238
- $element.style.display = 'none';
239
- }
240
- }
241
- return;
242
- }
243
- // 隐藏非当前点位的标尺
244
- for (const _name in __rule) {
245
- for (const { $element } of __rule[_name].rules) {
246
- $element.style.display = _name === name ? 'block' : 'none';
247
- }
248
- }
249
- const verticalLines = [];
250
- // 可以看到的角度最小的拐点
251
- const [visibleOrigin] = __rule[name].origins
252
- .slice()
253
- .filter((point) => point.observers.indexOf(panoIndex) >= 0)
254
- .sort((pointA, pointB) => {
255
- const angleA = pointA.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
256
- const angleB = pointB.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
257
- return angleA - angleB;
258
- });
259
- const shownNotVerticalRules = [];
260
- for (const { rule, vertical, $element } of __rule[name].rules) {
261
- const [start, end] = rule;
262
- const $line = $element.querySelector('.PanoRulerPlugin-rule-line');
263
- if (!$line)
264
- return;
265
- if (!visibleOrigin) {
266
- $element.style.display = 'none';
267
- continue;
268
- }
269
- if (start !== visibleOrigin && end !== visibleOrigin) {
270
- $element.style.display = 'none';
271
- continue;
272
- }
273
- if (start.distanceTo(end) < 0.5) {
274
- $element.style.display = 'none';
275
- continue;
276
- }
277
- if (start.observers.indexOf(panoIndex) === -1 || end.observers.indexOf(panoIndex) === -1) {
278
- $element.style.display = 'none';
279
- continue;
280
- }
281
- const startAngle = start.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
282
- if (startAngle > Math.PI / 2) {
283
- $element.style.display = 'none';
284
- continue;
285
- }
286
- const endAngle = end.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
287
- if (endAngle > Math.PI / 2) {
288
- $element.style.display = 'none';
289
- continue;
290
- }
291
- const ruleLength = start.distanceTo(end);
292
- const midPoint = end.clone().sub(end.clone().sub(start).divide(new Vector3(2, 2, 2)));
293
- const disFromCameraToMid = midPoint.distanceTo(cameraPosition);
294
- if (disFromCameraToMid / ruleLength > 8) {
295
- $element.style.display = 'none';
296
- continue;
297
- }
298
- if (!vertical)
299
- shownNotVerticalRules.push(rule);
300
- if (vertical)
301
- verticalLines.push({ $element, startAngle });
302
- const mouseStart = start.clone().project(camera);
303
- const startLeft = ((mouseStart.x + 1) / 2) * width;
304
- const startTop = ((-mouseStart.y + 1) / 2) * height;
305
- const mouseEnd = end.clone().project(camera);
306
- const endLeft = ((mouseEnd.x + 1) / 2) * width;
307
- const endTop = ((-mouseEnd.y + 1) / 2) * height;
308
- const distance = Math.sqrt(Math.pow(endLeft - startLeft, 2) + Math.pow(endTop - startTop, 2));
309
- let visibleLength = distance;
310
- let labelOffset = 50;
311
- const intr = getRuleScreenIntr({ x: ~~startLeft, y: ~~startTop }, {
312
- x: ~~endLeft,
313
- y: ~~endTop
314
- }, width, height);
315
- if (intr && intr.length === 1) {
316
- if (visibleOrigin === start) {
317
- visibleLength = Math.sqrt(Math.pow(intr[0].x - startLeft, 2) + Math.pow(intr[0].y - startTop, 2));
318
- labelOffset = (visibleLength / distance) * 50;
319
- }
320
- else if (visibleOrigin === end) {
321
- visibleLength = Math.sqrt(Math.pow(intr[0].x - endLeft, 2) + Math.pow(intr[0].y - endTop, 2));
322
- labelOffset = 100 - (visibleLength / distance) * 50;
323
- }
324
- }
325
- if (intr && intr.length === 2) {
326
- const middlePoint = {
327
- x: (intr[0].x + intr[1].x) / 2,
328
- y: (intr[0].y + intr[1].y) / 2,
329
- };
330
- const distanceFromStart = Math.sqrt(Math.pow(middlePoint.x - startLeft, 2) + Math.pow(middlePoint.y - startTop, 2));
331
- labelOffset = (distanceFromStart / distance) * 100;
332
- }
333
- const rad = Math.PI / 2 - Math.atan2(endLeft - startLeft, startTop - endTop);
334
- const deg = (rad / Math.PI) * 180;
335
- const $label = $line.querySelector('.PanoRulerPlugin-rule-label');
336
- // 线的长度小于标签时或者标签与线两端点重合时隐藏,
337
- const labelWidth = $label.children[0].clientWidth;
338
- if (labelWidth >= distance ||
339
- labelWidth / 2 >= (labelOffset / 100) * distance ||
340
- labelWidth / 2 >= (1 - labelOffset / 100) * distance) {
341
- $line.style.display = 'none';
342
- }
343
- else {
344
- $line.style.display = 'block';
345
- $line.style.width = distance + 'px';
346
- $line.style.left = startLeft + 'px';
347
- $line.style.top = startTop + 'px';
348
- $line.style.transform = `rotate(${-deg}deg)`;
349
- $label.style.left = `${labelOffset}%`;
350
- }
351
- }
352
- };
353
- const nextFrameFreshRule = () => nextFrame(freshRule);
354
- const throttleFreshRule = throttle(freshRule, 80);
355
- const enable = () => {
356
- if (!state.loaded)
357
- return false;
358
- if (state.enable)
359
- return true;
360
- $rule.setAttribute('class', 'PanoRulerPlugin' + (state.options.className ? ' ' + state.options.className : ''));
361
- five.getElement()?.parentElement?.append($rule);
362
- freshRule();
363
- five.on('panoArrived', freshRule);
364
- five.on('modeChange', freshRule);
365
- five.on('cameraDirectionUpdate', nextFrameFreshRule);
366
- five.on('movingToPano', nextFrameFreshRule);
367
- five.on('mouseWheel', throttleFreshRule);
368
- five.on('pinchGesture', throttleFreshRule);
369
- state.enable = true;
370
- return true;
371
- };
372
- const disable = () => {
373
- if (!state.enable)
374
- return true;
375
- five.off('panoArrived', freshRule);
376
- five.off('modeChange', freshRule);
377
- five.off('cameraDirectionUpdate', nextFrameFreshRule);
378
- five.off('movingToPano', nextFrameFreshRule);
379
- five.off('mouseWheel', throttleFreshRule);
380
- five.off('pinchGesture', throttleFreshRule);
381
- if ($rule) {
382
- $rule.remove();
383
- }
384
- state.enable = false;
385
- return true;
386
- };
387
- return {
388
- enable,
389
- disable,
390
- load,
391
- state,
392
- };
393
- };
394
- export const panoRulerPluginServerParams = {
395
- name: 'PanoRulerPlugin',
396
- version: 0,
397
- };
1
+ import PanoRulerPlugin from './Plugin';
2
+ export { PanoRulerPlugin };
398
3
  export default PanoRulerPlugin;
@@ -0,0 +1,168 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ append_styles,
5
+ attr,
6
+ destroy_each,
7
+ detach,
8
+ element,
9
+ empty,
10
+ init,
11
+ insert,
12
+ listen,
13
+ noop,
14
+ safe_not_equal,
15
+ set_style,
16
+ toggle_class
17
+ } from "svelte/internal";
18
+
19
+ import { currentTarget } from '../store';
20
+
21
+ function add_css(target) {
22
+ append_styles(target, "svelte-scnx9u", ".PanoSpatialTagPlugin__tag-origin.svelte-scnx9u{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-scnx9u:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-scnx9u{transform:translate(-50%, -50%) scale(0.6);animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}");
23
+ }
24
+
25
+ function get_each_context(ctx, list, i) {
26
+ const child_ctx = ctx.slice();
27
+ child_ctx[3] = list[i];
28
+ return child_ctx;
29
+ }
30
+
31
+ // (8:0) {#each origins as origin}
32
+ function create_each_block(ctx) {
33
+ let i;
34
+ let style_top = `${/*origin*/ ctx[3].top}%`;
35
+ let style_left = `${/*origin*/ ctx[3].left}%`;
36
+ let mounted;
37
+ let dispose;
38
+
39
+ function click_handler() {
40
+ return /*click_handler*/ ctx[2](/*origin*/ ctx[3]);
41
+ }
42
+
43
+ return {
44
+ c() {
45
+ i = element("i");
46
+ attr(i, "class", "svelte-scnx9u");
47
+ toggle_class(i, "PanoSpatialTagPlugin__tag-origin", true);
48
+ toggle_class(i, "PanoSpatialTagPlugin__tag-origin-destroy", /*origin*/ ctx[3].destroying);
49
+ set_style(i, "top", style_top, false);
50
+ set_style(i, "left", style_left, false);
51
+ set_style(i, "visibility", /*origin*/ ctx[3].front ? 'visible' : 'hidden', false);
52
+ },
53
+ m(target, anchor) {
54
+ insert(target, i, anchor);
55
+
56
+ if (!mounted) {
57
+ dispose = listen(i, "click", click_handler);
58
+ mounted = true;
59
+ }
60
+ },
61
+ p(new_ctx, dirty) {
62
+ ctx = new_ctx;
63
+
64
+ if (dirty & /*origins*/ 1) {
65
+ toggle_class(i, "PanoSpatialTagPlugin__tag-origin-destroy", /*origin*/ ctx[3].destroying);
66
+ }
67
+
68
+ if (dirty & /*origins*/ 1 && style_top !== (style_top = `${/*origin*/ ctx[3].top}%`)) {
69
+ set_style(i, "top", style_top, false);
70
+ }
71
+
72
+ if (dirty & /*origins*/ 1 && style_left !== (style_left = `${/*origin*/ ctx[3].left}%`)) {
73
+ set_style(i, "left", style_left, false);
74
+ }
75
+
76
+ if (dirty & /*origins*/ 1) {
77
+ set_style(i, "visibility", /*origin*/ ctx[3].front ? 'visible' : 'hidden', false);
78
+ }
79
+ },
80
+ d(detaching) {
81
+ if (detaching) detach(i);
82
+ mounted = false;
83
+ dispose();
84
+ }
85
+ };
86
+ }
87
+
88
+ function create_fragment(ctx) {
89
+ let each_1_anchor;
90
+ let each_value = /*origins*/ ctx[0];
91
+ let each_blocks = [];
92
+
93
+ for (let i = 0; i < each_value.length; i += 1) {
94
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
95
+ }
96
+
97
+ return {
98
+ c() {
99
+ for (let i = 0; i < each_blocks.length; i += 1) {
100
+ each_blocks[i].c();
101
+ }
102
+
103
+ each_1_anchor = empty();
104
+ },
105
+ m(target, anchor) {
106
+ for (let i = 0; i < each_blocks.length; i += 1) {
107
+ each_blocks[i].m(target, anchor);
108
+ }
109
+
110
+ insert(target, each_1_anchor, anchor);
111
+ },
112
+ p(ctx, [dirty]) {
113
+ if (dirty & /*origins, handleClick*/ 3) {
114
+ each_value = /*origins*/ ctx[0];
115
+ let i;
116
+
117
+ for (i = 0; i < each_value.length; i += 1) {
118
+ const child_ctx = get_each_context(ctx, each_value, i);
119
+
120
+ if (each_blocks[i]) {
121
+ each_blocks[i].p(child_ctx, dirty);
122
+ } else {
123
+ each_blocks[i] = create_each_block(child_ctx);
124
+ each_blocks[i].c();
125
+ each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
126
+ }
127
+ }
128
+
129
+ for (; i < each_blocks.length; i += 1) {
130
+ each_blocks[i].d(1);
131
+ }
132
+
133
+ each_blocks.length = each_value.length;
134
+ }
135
+ },
136
+ i: noop,
137
+ o: noop,
138
+ d(detaching) {
139
+ destroy_each(each_blocks, detaching);
140
+ if (detaching) detach(each_1_anchor);
141
+ }
142
+ };
143
+ }
144
+
145
+ function instance($$self, $$props, $$invalidate) {
146
+ let { origins } = $$props;
147
+
148
+ const handleClick = id => {
149
+ currentTarget.update(() => `${id}-PanoSpatialTagPlugin-${Date.now()}`);
150
+ };
151
+
152
+ const click_handler = origin => handleClick(origin.id);
153
+
154
+ $$self.$$set = $$props => {
155
+ if ('origins' in $$props) $$invalidate(0, origins = $$props.origins);
156
+ };
157
+
158
+ return [origins, handleClick, click_handler];
159
+ }
160
+
161
+ class Component extends SvelteComponent {
162
+ constructor(options) {
163
+ super();
164
+ init(this, options, instance, create_fragment, safe_not_equal, { origins: 0 }, add_css);
165
+ }
166
+ }
167
+
168
+ export default Component;