@realsee/dnalogel 2.3.9-alpha.8 → 2.5.0

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 (305) hide show
  1. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
  2. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
  3. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +7 -9
  4. package/dist/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -10
  5. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
  6. package/dist/PanoMeasurePlugin/Controller/index.d.ts +27 -9
  7. package/dist/PanoMeasurePlugin/Model/index.d.ts +17 -17
  8. package/dist/PanoMeasurePlugin/Model/line.d.ts +6 -4
  9. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -4
  10. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
  11. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
  12. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +29 -16
  13. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
  14. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
  15. package/dist/PanoMeasurePlugin/index.d.ts +6 -2
  16. package/dist/PanoMeasurePlugin/typings/data.d.ts +6 -16
  17. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
  18. package/dist/PanoMeasurePlugin/typings/index.d.ts +4 -2
  19. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +5 -3
  20. package/dist/index.cjs.js +102 -102
  21. package/dist/index.js +3715 -3594
  22. package/dist/index.umd.js +91 -91
  23. package/docs/assets/search.js +1 -1
  24. package/docs/classes/CSS3DRender.html +31 -31
  25. package/docs/classes/CruisePluginController.html +24 -24
  26. package/docs/classes/Magnifier.html +90 -40
  27. package/docs/classes/ModelRoomLabelController.html +11 -11
  28. package/docs/classes/Object3DHelperController.html +24 -24
  29. package/docs/classes/PaintBrush.html +15 -15
  30. package/docs/classes/PanoMeasurePluginLine.html +318 -0
  31. package/docs/classes/PanoMeasurePluginModel.html +275 -0
  32. package/docs/classes/PanoMeasurePluginPoint.html +160 -0
  33. package/docs/classes/PanoMeasurePluginPolyline.html +306 -0
  34. package/docs/classes/PanoTagPluginController.html +41 -41
  35. package/docs/classes/Util.BetterTween.html +8 -8
  36. package/docs/classes/Util.FivePointSelector.html +12 -12
  37. package/docs/classes/Util.Interval.html +12 -12
  38. package/docs/classes/Util.Magnifier.html +17 -17
  39. package/docs/classes/Util.PointDomHelper.html +11 -11
  40. package/docs/classes/Util.PointHelper.html +11 -11
  41. package/docs/classes/Util.Rectangle.html +13 -13
  42. package/docs/enums/CameraMovementEffect.html +7 -7
  43. package/docs/enums/ContentType.html +16 -16
  44. package/docs/enums/DIRECTION.html +9 -9
  45. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  46. package/docs/enums/DimensionType.html +7 -7
  47. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  48. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  49. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  50. package/docs/enums/PointType.html +7 -7
  51. package/docs/enums/Rotation.html +8 -8
  52. package/docs/functions/CSS3DRenderPlugin.html +12 -7
  53. package/docs/functions/CameraMovementPlugin.html +12 -7
  54. package/docs/functions/CruisePlugin.html +12 -7
  55. package/docs/functions/GuideLinePlugin.html +13 -8
  56. package/docs/functions/ItemLabelPlugin.html +12 -7
  57. package/docs/functions/MapviewFloorplanPlugin.html +12 -7
  58. package/docs/functions/ModelChassisCompassPlugin.html +12 -7
  59. package/docs/functions/ModelEntryDoorGuidePlugin.html +12 -7
  60. package/docs/functions/ModelFloorplanPlugin.html +12 -7
  61. package/docs/functions/ModelItemLabelPlugin.html +12 -7
  62. package/docs/functions/ModelRoomLabelPlugin.html +12 -7
  63. package/docs/functions/ModelTVVideoPlugin.html +12 -7
  64. package/docs/functions/ModelViewPlugin.html +12 -7
  65. package/docs/functions/Object3DHelperPlugin.html +12 -7
  66. package/docs/functions/PanoCompassPlugin.html +12 -7
  67. package/docs/functions/PanoCursorRaycasterPlugin.html +12 -7
  68. package/docs/functions/PanoDoorLabelPlugin.html +12 -7
  69. package/docs/functions/PanoFloorplanRadarPlugin.html +12 -7
  70. package/docs/functions/PanoMeasurePlugin.html +12 -7
  71. package/docs/functions/PanoRulerPlugin.html +12 -7
  72. package/docs/functions/PanoRulerProPlugin.html +12 -7
  73. package/docs/functions/PanoSpatialTagPlugin.html +12 -7
  74. package/docs/functions/PanoTagPlugin.html +12 -7
  75. package/docs/functions/TopviewFloorplanPlugin.html +12 -7
  76. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  77. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  78. package/docs/functions/Util.getFrameTime.html +5 -5
  79. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  80. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  81. package/docs/functions/Util.isNil.html +5 -5
  82. package/docs/functions/Util.nextFrame.html +5 -5
  83. package/docs/functions/Util.notNil.html +5 -5
  84. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  85. package/docs/functions/Util.tweenProgress.html +5 -5
  86. package/docs/functions/pluginFlag.html +13 -8
  87. package/docs/index.html +12 -7
  88. package/docs/interfaces/AddTagConfig.html +6 -6
  89. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  90. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  91. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  92. package/docs/interfaces/EventMap.html +15 -15
  93. package/docs/interfaces/FloorplanBounding.html +8 -8
  94. package/docs/interfaces/FloorplanData.html +10 -10
  95. package/docs/interfaces/FloorplanEntrance.html +11 -11
  96. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  97. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  98. package/docs/interfaces/FloorplanFloorData.html +9 -9
  99. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  100. package/docs/interfaces/FloorplanObserver.html +9 -9
  101. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  102. package/docs/interfaces/FloorplanPosition.html +7 -7
  103. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  104. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  105. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  106. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  107. package/docs/interfaces/FloorplanServerData.html +7 -7
  108. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  109. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  110. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  111. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  112. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  113. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  114. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  115. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  116. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  117. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  118. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  119. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  120. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  121. package/docs/interfaces/MinMax.html +7 -7
  122. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  123. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  124. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  125. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  126. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  127. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  128. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  129. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  130. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  131. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  132. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  133. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  134. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  135. package/docs/interfaces/Object3DHelperState.html +8 -8
  136. package/docs/interfaces/PaintBrushAction.html +12 -12
  137. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  138. package/docs/interfaces/PaintBrushState.html +10 -10
  139. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  140. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +13 -8
  141. package/docs/interfaces/PanoMeasureParameterType.html +24 -14
  142. package/docs/interfaces/{PointJson.html → PanoMeasurePluginLineJson.html} +24 -24
  143. package/docs/interfaces/{OpenParameter.html → PanoMeasurePluginOpenParameter.html} +15 -15
  144. package/docs/interfaces/{LineJson.html → PanoMeasurePluginPointJson.html} +18 -18
  145. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +80 -0
  146. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  147. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  148. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  149. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  150. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  151. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  152. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  153. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +13 -8
  154. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +13 -8
  155. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  156. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  157. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  158. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  159. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  160. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  161. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  162. package/docs/interfaces/Point.html +8 -8
  163. package/docs/interfaces/Room.html +9 -9
  164. package/docs/interfaces/RoomInfo.html +7 -7
  165. package/docs/interfaces/RoomLabel.html +14 -14
  166. package/docs/interfaces/RoomRules.html +13 -8
  167. package/docs/interfaces/Rooms.html +13 -8
  168. package/docs/interfaces/Scissor.html +9 -9
  169. package/docs/interfaces/State.html +8 -8
  170. package/docs/interfaces/TagCache.html +10 -10
  171. package/docs/interfaces/TagConfig.html +10 -10
  172. package/docs/interfaces/TagIconUrl.html +9 -9
  173. package/docs/interfaces/Tags.html +9 -9
  174. package/docs/interfaces/TemporaryState.html +6 -6
  175. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  176. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  177. package/docs/modules/Util.html +5 -5
  178. package/docs/modules.html +20 -10
  179. package/docs/types/ArrayPosition.html +13 -8
  180. package/docs/types/AudioAppearance.html +13 -8
  181. package/docs/types/AudioTagTypeConfigKey.html +13 -8
  182. package/docs/types/CSS3DRenderExportType.html +13 -8
  183. package/docs/types/CSS3DRenderPluginExportType.html +13 -8
  184. package/docs/types/CSS3DRenderPluginParameterType.html +13 -8
  185. package/docs/types/Color.html +13 -8
  186. package/docs/types/ContentTypeConfigKey.html +13 -8
  187. package/docs/types/ContentTypeConfigKeySplit.html +13 -8
  188. package/docs/types/ContentTypeMap.html +13 -8
  189. package/docs/types/Create3DDomContainerReturnType.html +13 -8
  190. package/docs/types/Create3DElementReturnType.html +13 -8
  191. package/docs/types/CruisePluginExportType.html +13 -8
  192. package/docs/types/Direction-1.html +13 -8
  193. package/docs/types/Direction4.html +13 -8
  194. package/docs/types/FloorplanRuleLabels.html +13 -8
  195. package/docs/types/FloorplanServerRuleLabels.html +13 -8
  196. package/docs/types/GuideLinePluginExportType.html +13 -8
  197. package/docs/types/HelperEventMap.html +13 -8
  198. package/docs/types/LoadTagConfig.html +13 -8
  199. package/docs/types/MapviewFloorplanPluginParameterType.html +13 -8
  200. package/docs/types/MapviewFloorplanPluginReturnType.html +13 -8
  201. package/docs/types/MediaData.html +13 -8
  202. package/docs/types/MediaStore.html +13 -8
  203. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +13 -8
  204. package/docs/types/ModelFloorplanPluginParameterType.html +13 -8
  205. package/docs/types/ModelFloorplanPluginReturnType.html +13 -8
  206. package/docs/types/ModelRoomLabelPluginParameters.html +13 -8
  207. package/docs/types/ModelRoomLabelPluginReturnType.html +13 -8
  208. package/docs/types/MoveArgs.html +13 -8
  209. package/docs/types/MoveOpts.html +13 -8
  210. package/docs/types/Object3DHelperEventMap.html +13 -8
  211. package/docs/types/ObjectFit.html +13 -8
  212. package/docs/types/PaintBrushEventMap.html +13 -8
  213. package/docs/types/PanoCompassPluginData.html +13 -8
  214. package/docs/types/PanoCompassPluginExportType.html +13 -8
  215. package/docs/types/PanoCompassPluginParameterType.html +13 -8
  216. package/docs/types/PanoFloorplanRadarPluginParameterType.html +13 -8
  217. package/docs/types/PanoFloorplanRadarPluginReturnType.html +13 -8
  218. package/docs/types/PanoIndex.html +13 -8
  219. package/docs/types/PanoMeasurePluginEvent.html +13 -8
  220. package/docs/types/PanoMeasureReturnType.html +13 -8
  221. package/docs/types/PanoSpatialTagPluginId.html +13 -8
  222. package/docs/types/PanoTagPluginExportInterface.html +13 -8
  223. package/docs/types/PanoTagPluginParamsInterface.html +13 -8
  224. package/docs/types/PlaneTag.html +13 -8
  225. package/docs/types/PlaneTagElement.html +13 -8
  226. package/docs/types/Point2DElement.html +13 -8
  227. package/docs/types/Point2DTag.html +13 -8
  228. package/docs/types/Point3DElement.html +13 -8
  229. package/docs/types/Point3DTag.html +13 -8
  230. package/docs/types/PointTag.html +13 -8
  231. package/docs/types/PointTagElement.html +13 -8
  232. package/docs/types/Position.html +13 -8
  233. package/docs/types/RotateArgs.html +13 -8
  234. package/docs/types/RotateOpts.html +13 -8
  235. package/docs/types/RuleLabelsKey.html +13 -8
  236. package/docs/types/RuleLabelsValue.html +13 -8
  237. package/docs/types/StickType.html +13 -8
  238. package/docs/types/Tag.html +13 -8
  239. package/docs/types/Tag2D.html +13 -8
  240. package/docs/types/Tag3D.html +13 -8
  241. package/docs/types/TagContentType.html +13 -8
  242. package/docs/types/TagDimensionType.html +13 -8
  243. package/docs/types/TagElement.html +13 -8
  244. package/docs/types/TagEvents.html +13 -8
  245. package/docs/types/TagHooks.html +13 -8
  246. package/docs/types/TagIconSize.html +13 -8
  247. package/docs/types/TagId.html +13 -8
  248. package/docs/types/TagPointType.html +13 -8
  249. package/docs/types/TopviewFloorplanPluginParameterType.html +13 -8
  250. package/docs/types/TopviewFloorplanPluginReturnType.html +13 -8
  251. package/docs/types/WorkCode.html +13 -8
  252. package/docs/variables/FLOOR_TYPE_MAP.html +13 -8
  253. package/docs/variables/PLUGIN.html +13 -8
  254. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +13 -8
  255. package/docs/variables/ROOM_TYPE_MAP.html +13 -8
  256. package/docs/variables/VERSION.html +13 -8
  257. package/docs/variables/itemLabelPluginServerParams.html +13 -8
  258. package/docs/variables/modelItemLabelPluginServerParams.html +13 -8
  259. package/docs/variables/modelRoomLabelPluginServerParams.html +13 -8
  260. package/libs/PanoCompassPlugin/Controller.js +3 -8
  261. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
  262. package/libs/PanoMeasurePlugin/Controller/BaseController.js +17 -18
  263. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
  264. package/libs/PanoMeasurePlugin/Controller/EditController.js +59 -61
  265. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +7 -9
  266. package/libs/PanoMeasurePlugin/Controller/MixedController.js +54 -46
  267. package/libs/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -10
  268. package/libs/PanoMeasurePlugin/Controller/ViewController.js +47 -80
  269. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
  270. package/libs/PanoMeasurePlugin/Controller/WatchController.js +48 -54
  271. package/libs/PanoMeasurePlugin/Controller/index.d.ts +27 -9
  272. package/libs/PanoMeasurePlugin/Controller/index.js +126 -102
  273. package/libs/PanoMeasurePlugin/Model/index.d.ts +17 -17
  274. package/libs/PanoMeasurePlugin/Model/index.js +49 -72
  275. package/libs/PanoMeasurePlugin/Model/line.d.ts +6 -4
  276. package/libs/PanoMeasurePlugin/Model/line.js +28 -25
  277. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -4
  278. package/libs/PanoMeasurePlugin/Model/point.js +6 -6
  279. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
  280. package/libs/PanoMeasurePlugin/Model/polyline.js +97 -37
  281. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +1 -1
  282. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
  283. package/libs/PanoMeasurePlugin/Modules/GuideController.js +16 -11
  284. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +29 -16
  285. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +113 -62
  286. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +1 -1
  287. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +5 -4
  288. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
  289. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +21 -21
  290. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
  291. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +15 -14
  292. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +1 -1
  293. package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +5 -4
  294. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +5 -5
  295. package/libs/PanoMeasurePlugin/index.d.ts +6 -2
  296. package/libs/PanoMeasurePlugin/index.js +28 -24
  297. package/libs/PanoMeasurePlugin/typings/data.d.ts +6 -16
  298. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
  299. package/libs/PanoMeasurePlugin/typings/event.type.js +4 -1
  300. package/libs/PanoMeasurePlugin/typings/index.d.ts +4 -2
  301. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +5 -3
  302. package/libs/PanoMeasurePlugin/utils/distanceDom.js +65 -41
  303. package/libs/PanoTagPlugin/Components/Tag/TextTag/TextPlaneTag.js +83 -55
  304. package/libs/index.js +108 -104
  305. package/package.json +1 -1
@@ -1,114 +1,112 @@
1
1
  var d = Object.defineProperty;
2
- var m = (h, n, e) => n in h ? d(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
3
- var s = (h, n, e) => (m(h, typeof n != "symbol" ? n + "" : n, e), e);
4
- import u from "hammerjs";
5
- import { Model as f } from "../Model/index.js";
6
- import l from "../Model/line.js";
2
+ var l = (h, n, e) => n in h ? d(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
3
+ var i = (h, n, e) => (l(h, typeof n != "symbol" ? n + "" : n, e), e);
4
+ import m from "hammerjs";
5
+ import { Model as u } from "../Model/index.js";
6
+ import f from "../Model/line.js";
7
7
  import p from "../Model/point.js";
8
8
  import { throttle as v } from "../../shared-utils/throttle.js";
9
9
  import c from "./BaseController.js";
10
10
  import { getIntersectionFromEvent as r } from "../utils/getIntersectionFromEvent.js";
11
+ import { Polyline as P } from "../Model/polyline.js";
12
+ import "three";
13
+ import "@realsee/five/line";
14
+ import "../utils/constants.js";
11
15
  import "@realsee/five";
12
- import "../../shared-utils/removeArrayItem.js";
13
- import "../Model/polyline.js";
14
16
  import "../../shared-utils/uuid.js";
15
17
  import "../utils/line.js";
16
- import "@realsee/five/line";
17
- import "../utils/constants.js";
18
- import "three";
19
18
  import "../utils/distanceDom.js";
20
19
  import "../utils/isNDCPointInScreen.js";
20
+ import "../../shared-utils/removeArrayItem.js";
21
21
  import "../utils/ironbox.js";
22
22
  import "../utils/getPointFromHammerEvent.js";
23
- class q extends c {
23
+ class V extends c {
24
24
  constructor(e) {
25
- var i;
25
+ var s;
26
26
  super(e);
27
- s(this, "type", "edit");
28
- s(this, "pressPoint");
29
- s(this, "hasAppendDashed", !1);
30
- s(this, "hasAppendMouseGroup", !1);
31
- s(this, "fiveElement");
32
- s(this, "lastPoint", null);
33
- s(this, "hammer");
34
- s(this, "onIntersectionUpdate", v((e, t) => {
27
+ i(this, "type", "edit");
28
+ i(this, "polyline");
29
+ i(this, "pressPoint");
30
+ i(this, "hasAppendDashed", !1);
31
+ i(this, "hasAppendMouseGroup", !1);
32
+ i(this, "fiveElement");
33
+ i(this, "lastPoint", null);
34
+ i(this, "hammer");
35
+ i(this, "onIntersectionUpdate", v((e, t) => {
35
36
  var o;
36
- this.hasAppendMouseGroup === !1 && (this.group.add(this.mouseGroup), this.magnifier.appendTo(this.container), this.hasAppendMouseGroup = !0);
37
- const i = this.updateMouseGroup(e, t).position;
38
- (o = this.pressPoint) == null || o.position.copy(i), this.updateDashed(), requestAnimationFrame(() => this.magnifier.renderWithPoint(this.mouseGroup.position)), this.five.needsRender = !0;
37
+ this.hasAppendMouseGroup === !1 && (this.group.add(this.mouseGroup), this.magnifier.appendTo(this.container), this.magnifier.enable(), this.hasAppendMouseGroup = !0);
38
+ const s = this.updateMouseGroup(e, t).position;
39
+ (o = this.pressPoint) == null || o.position.copy(s), this.updateDashed(), requestAnimationFrame(() => this.magnifier.renderWithPoint(this.mouseGroup.position)), this.five.needsRender = !0;
39
40
  }, 20));
40
- s(this, "revoke", () => {
41
- if (this.model.lines.length === 0 && this.lastPoint) {
42
- this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.distanceItem.remove(), this.group.remove(this.dashed.mesh), this.hook.emit("anchorChange", null), this.five.needsRender = !0;
41
+ i(this, "revoke", () => {
42
+ if (this.polyline.lines.length === 0 && this.lastPoint) {
43
+ this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.distanceItem.remove(), this.group.remove(this.dashed.mesh), this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.needsRender = !0;
43
44
  return;
44
45
  }
45
- if (this.model.lines.length === 0 && !this.lastPoint || !this.lastPoint)
46
+ if (this.polyline.lines.length === 0 && !this.lastPoint || !this.lastPoint)
46
47
  return;
47
- const e = this.model.lines[this.model.lines.length - 1], t = e.findAnotherPoint(this.lastPoint);
48
- !t || (this.lastPoint = t, this.hook.emit("anchorChange", t.position), this.group.remove(e.mesh), this.model.removeLine(e), this.hasAppendMouseGroup = !1, this.mouseGroup.position.copy(this.lastPoint.position), this.group.remove(this.mouseGroup), e.distanceItem.remove(), this.updateDashed(), this.magnifier.remove(), this.five.needsRender = !0);
48
+ const e = this.polyline.lines[this.polyline.lines.length - 1], t = e.findAnotherPoint(this.lastPoint);
49
+ !t || (this.lastPoint = t, this.hook.emit("anchorChange", t.position), this.group.remove(e.mesh), this.polyline.removeLine(e), this.hasAppendMouseGroup = !1, this.mouseGroup.position.copy(this.lastPoint.position), this.group.remove(this.mouseGroup), e.distanceItem.remove(), this.updateDashed(), this.magnifier.disable(), this.five.needsRender = !0);
49
50
  });
50
- s(this, "onMouseLeave", () => {
51
- this.magnifier.remove(), this.group.remove(this.mouseGroup), this.hasAppendMouseGroup = !1, this.lastPoint && (this.mouseGroup.position.copy(this.lastPoint.position), this.updateDashed());
51
+ i(this, "onMouseLeave", () => {
52
+ this.magnifier.disable(), this.group.remove(this.mouseGroup), this.hasAppendMouseGroup = !1, this.lastPoint && (this.mouseGroup.position.copy(this.lastPoint.position), this.updateDashed());
52
53
  });
53
- s(this, "onLineChanged", () => {
54
- this.hook.emit(
55
- "editedLineChange",
56
- this.model.lines.map((e) => e.toCompletelyJson())
57
- );
54
+ i(this, "onLineChanged", () => {
55
+ this.hook.emit("editedPolylineChange", this.polyline);
58
56
  });
59
- s(this, "onPress", (e) => {
57
+ i(this, "onPress", (e) => {
60
58
  const [t] = r(this.five, e);
61
- if (!t || !t.face)
59
+ if (!(t != null && t.face))
62
60
  return;
63
- const i = new p(t.point);
64
- this.pressPoint = i, this.onIntersectionUpdate(t);
61
+ const s = new p(t.point);
62
+ this.pressPoint = s, this.onIntersectionUpdate(t);
65
63
  });
66
- s(this, "onPan", (e) => {
64
+ i(this, "onPan", (e) => {
67
65
  if (!this.pressPoint)
68
66
  return;
69
67
  const [t] = r(this.five, e);
70
- !t || !t.face || this.onIntersectionUpdate(t);
68
+ !(t != null && t.face) || this.onIntersectionUpdate(t);
71
69
  });
72
- s(this, "onPanEnd", (e) => {
70
+ i(this, "onPanEnd", (e) => {
73
71
  !this.pressPoint || this.onTap(e);
74
72
  });
75
- s(this, "onTap", (e) => {
73
+ i(this, "onTap", (e) => {
76
74
  this.hasAppendDashed || (this.dashed.distanceItem.appendTo(this.container), this.group.add(this.dashed.mesh)), this.hasAppendDashed = !0;
77
75
  const [t] = r(this.five, e);
78
76
  this.updateMouseGroup(t);
79
- const i = new p(this.mouseGroup.position), o = this.lastPoint;
80
- if (i && (this.lastPoint = i), i && o) {
81
- const a = new l(o, i, this.model);
82
- a.distanceItem.appendTo(this.container), this.model.addLine(a), this.group.add(a.mesh), a.distanceItem.update(this.five);
77
+ const s = new p(this.mouseGroup.position), o = this.lastPoint;
78
+ if (s && (this.lastPoint = s), s && o) {
79
+ const a = new f(o, s, this.model);
80
+ a.distanceItem.setItemSelectable(!1), a.distanceItem.appendTo(this.container), this.polyline.addLine(a), this.group.add(a.mesh), a.distanceItem.update(this.five);
83
81
  }
84
- this.pressPoint = void 0, this.hasAppendMouseGroup = !1, this.magnifier.remove(), this.group.remove(this.mouseGroup), this.updateDashed(), this.five.needsRender = !0, this.hook.emit("anchorChange", i.position);
82
+ this.pressPoint = void 0, this.hasAppendMouseGroup = !1, this.magnifier.disable(), this.group.remove(this.mouseGroup), this.updateDashed(), this.five.needsRender = !0, this.hook.emit("anchorChange", s.position);
85
83
  });
86
- s(this, "onWantsTapGesture", () => !1);
87
- s(this, "onWantsToMoveToPano", () => !1);
88
- s(this, "onWantsPanGesture", () => this.pressPoint ? !1 : void 0);
89
- s(this, "onCameraUpdate", () => {
84
+ i(this, "onWantsTapGesture", () => !1);
85
+ i(this, "onWantsToMoveToPano", () => !1);
86
+ i(this, "onWantsPanGesture", () => this.pressPoint ? !1 : void 0);
87
+ i(this, "onCameraUpdate", () => {
90
88
  this.updateDistanceUI(), this.dashed.distanceItem.update(this.five);
91
89
  });
92
- s(this, "updateDashed", () => {
93
- !this.lastPoint || (this.dashed.points[0].position.copy(this.lastPoint.position), this.dashed.points[1].position.copy(this.mouseGroup.position), this.dashed.mesh.setPoints(this.lastPoint.position, this.mouseGroup.position), this.dashed.distanceItem.update(this.five));
90
+ i(this, "updateDashed", () => {
91
+ !this.lastPoint || (this.dashed.points[0].position.copy(this.lastPoint.position), this.dashed.points[1].position.copy(this.mouseGroup.position), this.dashed.mesh.setPoints(this.lastPoint.position, this.mouseGroup.position), this.dashed.distanceItem.update(this.five), this.hook.emit("editedDashedLineChange", this.dashed));
94
92
  });
95
- this.model = new f(this.config), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsPanGesture", this.onWantsPanGesture), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.on("intersectionOnModelUpdate", this.onIntersectionUpdate), this.model.hook.on("lineAdded", this.onLineChanged), this.model.hook.on("lineRemoved", this.onLineChanged);
93
+ this.model = new u(this.config), this.polyline = new P({ model: this.model }), this.model.addPolyline(this.polyline), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsPanGesture", this.onWantsPanGesture), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.on("intersectionOnModelUpdate", this.onIntersectionUpdate), this.polyline.hook.on("lineAdded", this.onLineChanged), this.polyline.hook.on("lineRemoved", this.onLineChanged);
96
94
  const t = this.five.getElement();
97
95
  if (t) {
98
96
  this.fiveElement = t;
99
- const o = new u(t);
97
+ const o = new m(t);
100
98
  this.hammer = o, o.on("tap", this.onTap), o.on("pan", this.onPan), o.on("press", this.onPress), o.on("panend", this.onPanEnd);
101
99
  }
102
- (i = this.fiveElement) == null || i.addEventListener("mouseleave", this.onMouseLeave), this.hook.emit("anchorChange", null), this.five.refresh();
100
+ this.five.helperVisible = !1, (s = this.fiveElement) == null || s.addEventListener("mouseleave", this.onMouseLeave), this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.refresh();
103
101
  }
104
102
  dispose() {
105
103
  var e, t;
106
- super.dispose(), this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.onWantsPanGesture), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.off("intersectionOnModelUpdate", this.onIntersectionUpdate), this.model.hook.off("lineAdded", this.onLineChanged), this.model.hook.off("lineRemoved", this.onLineChanged), (e = this.hammer) == null || e.destroy(), (t = this.fiveElement) == null || t.removeEventListener("mouseleave", this.onMouseLeave), this.magnifier.dispose(), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
104
+ super.dispose(), this.five.helperVisible = !0, this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.onWantsPanGesture), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.off("intersectionOnModelUpdate", this.onIntersectionUpdate), this.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.hook.off("lineRemoved", this.onLineChanged), (e = this.hammer) == null || e.destroy(), (t = this.fiveElement) == null || t.removeEventListener("mouseleave", this.onMouseLeave), this.magnifier.dispose(), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
107
105
  }
108
106
  getEditingLines() {
109
- return this.model.lines;
107
+ return this.polyline.lines;
110
108
  }
111
109
  }
112
110
  export {
113
- q as default
111
+ V as default
114
112
  };
@@ -1,25 +1,23 @@
1
- import type { LineJson } from '../typings/data';
2
- import { Model } from '../Model';
3
1
  import Line from '../Model/line';
4
- import BaseController, { IControllerParams } from './BaseController';
2
+ import BaseController, { ControllerParams } from './BaseController';
3
+ import { Polyline } from '../Model/polyline';
5
4
  export declare type State = 'watching' | 'editing';
6
- export interface EditEvent {
7
- editedLineChange: (lines: LineJson[]) => void;
8
- }
9
5
  export default class MixedController extends BaseController {
10
6
  state: State;
11
- model: Model;
7
+ polyline: Polyline;
12
8
  private hasAppendDashed;
13
- private fiveElement?;
14
9
  private mobileStartPoint;
15
10
  private mobileNowPoint;
16
11
  private highlightedLines;
17
12
  private deleteDom;
18
- constructor(params: IControllerParams);
13
+ private rangePieceController;
14
+ private disposers;
15
+ constructor(params: ControllerParams);
19
16
  dispose(): void;
20
17
  highlightLine(line: Line): void;
21
18
  clearHighlightLines(): void;
22
19
  getEditingLines(): Line[];
20
+ addStartPoint(): void;
23
21
  /** 编辑线条发生改变时通知外部 */
24
22
  private onLineChanged;
25
23
  private onWantsTapGesture;
@@ -1,66 +1,72 @@
1
1
  var b = Object.defineProperty;
2
- var k = (h, n, e) => n in h ? b(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
3
- var t = (h, n, e) => (k(h, typeof n != "symbol" ? n + "" : n, e), e);
2
+ var k = (h, s, e) => s in h ? b(h, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[s] = e;
3
+ var t = (h, s, e) => (k(h, typeof s != "symbol" ? s + "" : s, e), e);
4
4
  import { Model as S } from "../Model/index.js";
5
- import T from "../Model/line.js";
5
+ import y from "../Model/line.js";
6
6
  import D from "./BaseController.js";
7
- import M from "../Modules/DeleteDom/index.js";
8
- import { findAssociatedLines as G } from "../utils/findAssociatedLines.js";
9
- import { Vector2 as m } from "three";
10
- import v from "../utils/isNDCPointInScreen.js";
11
- import { closestPointOnLine as N } from "../utils/math.js";
12
- import "../Model/point.js";
13
- import "../../shared-utils/uuid.js";
14
- import "../../shared-utils/removeArrayItem.js";
15
- import "@realsee/five";
16
- import "../Model/polyline.js";
17
- import "../utils/line.js";
7
+ import T from "../Modules/DeleteDom/index.js";
8
+ import { findAssociatedLines as M } from "../utils/findAssociatedLines.js";
9
+ import { Vector2 as p } from "three";
10
+ import C from "../utils/isNDCPointInScreen.js";
11
+ import { closestPointOnLine as G } from "../utils/math.js";
12
+ import { Polyline as W } from "../Model/polyline.js";
13
+ import N from "../Modules/rangePiece/index.js";
18
14
  import "@realsee/five/line";
19
15
  import "../utils/constants.js";
16
+ import "@realsee/five";
17
+ import "../../shared-utils/uuid.js";
18
+ import "../utils/line.js";
20
19
  import "../utils/distanceDom.js";
20
+ import "../Model/point.js";
21
+ import "../../shared-utils/removeArrayItem.js";
21
22
  import "../utils/ironbox.js";
22
23
  import "../Modules/DeleteDom/_Assets/delete.svg.js";
23
24
  import "../Modules/DeleteDom/_Assets/delete_bg.png.js";
24
25
  import "../Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
25
- class $ extends D {
26
+ import "@tweenjs/tween.js";
27
+ import "../Modules/rangePiece/html.js";
28
+ import "../../shared-utils/animationFrame/index.js";
29
+ import "../../shared-utils/animationFrame/BetterTween.js";
30
+ import "../../shared-utils/noop.js";
31
+ import "../utils/calculateThreeMouse.js";
32
+ import "../utils/mouseGroup.js";
33
+ class le extends D {
26
34
  constructor(e) {
27
35
  super(e);
28
36
  t(this, "state", "watching");
29
- t(this, "model", new S(this.config));
37
+ t(this, "polyline");
30
38
  t(this, "hasAppendDashed", !1);
31
- t(this, "fiveElement");
32
39
  t(this, "mobileStartPoint", null);
33
40
  t(this, "mobileNowPoint", null);
34
41
  t(this, "highlightedLines", []);
35
42
  t(this, "deleteDom");
43
+ t(this, "rangePieceController");
44
+ t(this, "disposers", []);
36
45
  t(this, "onLineChanged", () => {
37
- this.hook.emit(
38
- "editedLineChange",
39
- this.model.lines.map((e) => e.toCompletelyJson())
40
- );
46
+ this.hook.emit("editedPolylineChange", this.polyline);
41
47
  });
42
48
  t(this, "onWantsTapGesture", (e) => {
43
- if (this.state === "editing")
49
+ if (console.log("\u{1F436} ~ onWantsTapGesture"), this.state === "editing")
44
50
  return !1;
45
51
  const [i] = this.five.model.intersectRaycaster(e);
46
52
  if (!i)
47
53
  return;
48
- const o = this.five.camera, p = i.point.clone().project(o), r = this.container.clientWidth, d = this.container.clientHeight, f = new m(p.x * r, p.y * d), g = this.model.lines.map((s) => {
49
- const [a, L] = s.points, l = a.position.clone().project(o), c = L.position.clone().project(o);
50
- if (!v(l) && !v(c))
54
+ const o = this.five.camera, m = i.point.clone().project(o), r = this.container.clientWidth, l = this.container.clientHeight, f = new p(m.x * r, m.y * l), g = this.polyline.lines.map((n) => {
55
+ const [a, L] = n.points, d = a.position.clone().project(o), c = L.position.clone().project(o);
56
+ if (!C(d) && !C(c))
51
57
  return null;
52
- const C = new m(l.x * r, l.y * d), w = new m(c.x * r, c.y * d);
53
- return { id: s.id, points: [C, w] };
54
- }).filter((s) => !!s);
58
+ const v = new p(d.x * r, d.y * l), w = new p(c.x * r, c.y * l);
59
+ return { id: n.id, points: [v, w] };
60
+ }).filter((n) => !!n);
55
61
  if (g.length === 0)
56
62
  return;
57
- const u = g.map((s) => {
58
- const a = N(f, s.points);
59
- return { id: s.id, distance: a.distanceTo(f) };
60
- }).sort((s, a) => s.distance - a.distance)[0];
63
+ const u = g.map((n) => {
64
+ const a = G(f, n.points);
65
+ return { id: n.id, distance: a.distanceTo(f) };
66
+ }).sort((n, a) => n.distance - a.distance)[0];
61
67
  if (u.distance > 20)
62
68
  return;
63
- const P = this.model.lines.find(({ id: s }) => s === u.id);
69
+ const P = this.polyline.lines.find(({ id: n }) => n === u.id);
64
70
  if (!!P)
65
71
  return this.chooseLine(P), !1;
66
72
  });
@@ -69,10 +75,10 @@ class $ extends D {
69
75
  this.updateDistanceUI(), this.dashed.distanceItem.update(this.five);
70
76
  });
71
77
  t(this, "updateMobileDashed", () => {
72
- !this.mobileStartPoint || !this.mobileNowPoint || (this.dashed.points[0].position.copy(this.mobileStartPoint.position), this.dashed.points[1].position.copy(this.mobileNowPoint.position), this.dashed.mesh.setPoints(this.mobileStartPoint.position, this.mobileNowPoint.position), this.dashed.distanceItem.update(this.five));
78
+ !this.mobileStartPoint || !this.mobileNowPoint || (this.dashed.points[0].position.copy(this.mobileStartPoint.position), this.dashed.points[1].position.copy(this.mobileNowPoint.position), this.dashed.mesh.setPoints(this.mobileStartPoint.position, this.mobileNowPoint.position), this.dashed.distanceItem.update(this.five), this.hook.emit("editedDashedLineChange", this.dashed));
73
79
  });
74
80
  t(this, "updateMagnifier", (e) => {
75
- this.magnifier.visible === !1 && this.magnifier.appendTo(this.container), requestAnimationFrame(() => this.magnifier.renderWithPoint(e.position)), this.five.needsRender = !0;
81
+ this.magnifier.containerDom !== this.container && this.magnifier.appendTo(this.container), this.magnifier.getCurrentState().enabled || this.magnifier.enable(), requestAnimationFrame(() => this.magnifier.renderWithPoint(e.position)), this.five.needsRender = !0;
76
82
  });
77
83
  t(this, "onGetStartPoint", (e) => {
78
84
  this.mobileStartPoint = e;
@@ -80,8 +86,8 @@ class $ extends D {
80
86
  t(this, "onGetEndPoint", (e) => {
81
87
  const i = this.mobileNowPoint;
82
88
  if (this.removeLine(this.dashed), this.hasAppendDashed = !1, this.mobileStartPoint && i) {
83
- const o = new T(this.mobileStartPoint, i, this.model);
84
- o.distanceItem.appendTo(this.container), o.distanceItem.update(this.five), o.hook.on("selected", this.chooseLine), this.group.add(o.mesh), this.model.addLine(o);
89
+ const o = new y(this.mobileStartPoint, i, this.model);
90
+ o.distanceItem.appendTo(this.container), o.distanceItem.update(this.five), o.hook.on("selected", this.chooseLine), this.disposers.push(() => o.hook.off("selected", this.chooseLine)), this.group.add(o.mesh), this.polyline.addLine(o);
85
91
  }
86
92
  this.mobileStartPoint = null, this.mobileNowPoint = null, this.five.needsRender = !0;
87
93
  });
@@ -96,43 +102,45 @@ class $ extends D {
96
102
  this.state = i, this.state === "watching" ? this.five.helperVisible = !0 : this.five.helperVisible = !1;
97
103
  });
98
104
  t(this, "chooseLine", (e) => {
99
- const i = G(e);
105
+ const i = M(e);
100
106
  this.highlightLines(i), this.five.needsRender = !0, this.hook.emit(
101
107
  "selectedChange",
102
- i.map((o) => o.toCompletelyJson())
108
+ i.map((o) => o)
103
109
  );
104
110
  });
105
111
  t(this, "deleteDomClickCallback", () => {
106
112
  this.highlightedLines.forEach((e) => {
107
- this.removeLine(e), this.model.removeLine(e);
113
+ this.removeLine(e), this.polyline.removeLine(e);
108
114
  }), this.highlightedLines = [], this.deleteDom.setLines([]).hide();
109
115
  });
110
116
  t(this, "cancelDeleteClickCallback", () => {
111
117
  this.clearHighlightLines();
112
118
  });
113
- this.deleteDom = new M(this.five, {
119
+ this.model = new S(this.config), this.polyline = new W({ model: this.model }), this.model.addPolyline(this.polyline), this.rangePieceController = new N(e), this.deleteDom = new T(this.five, {
114
120
  onClick: this.deleteDomClickCallback,
115
121
  cancelDelete: this.cancelDeleteClickCallback
116
- }).appendTo(this.container), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.model.hook.on("lineAdded", this.onLineChanged), this.model.hook.on("lineRemoved", this.onLineChanged), this.hook.on("getStartPoint", this.onGetStartPoint), this.hook.on("getEndPoint", this.onGetEndPoint), this.hook.on("nowPointChange", this.onNowPointChange), this.hook.on("willChangeState", this.onWillChangeState), this.five.refresh();
122
+ }).appendTo(this.container), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.polyline.hook.on("lineAdded", this.onLineChanged), this.polyline.hook.on("lineRemoved", this.onLineChanged), this.five.helperVisible = !1, this.hook.emit("editedDashedLineChange", null), this.hook.on("getStartPoint", this.onGetStartPoint), this.hook.on("getEndPoint", this.onGetEndPoint), this.hook.on("nowPointChange", this.onNowPointChange), this.hook.on("willChangeState", this.onWillChangeState), this.five.refresh();
117
123
  }
118
124
  dispose() {
119
- super.dispose(), this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.model.hook.off("lineAdded", this.onLineChanged), this.model.hook.off("lineRemoved", this.onLineChanged), this.hook.off("getStartPoint", this.onGetStartPoint), this.hook.off("getEndPoint", this.onGetEndPoint), this.hook.off("nowPointChange", this.onNowPointChange), this.hook.off("willChangeState", this.onWillChangeState), this.hook.emit("selectedChange", []), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
125
+ super.dispose(), this.disposers.forEach((e) => e()), this.five.helperVisible = !0, this.rangePieceController.dispose(), this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.hook.off("lineRemoved", this.onLineChanged), this.hook.off("getStartPoint", this.onGetStartPoint), this.hook.off("getEndPoint", this.onGetEndPoint), this.hook.off("nowPointChange", this.onNowPointChange), this.hook.off("willChangeState", this.onWillChangeState), this.hook.emit("selectedChange", []), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
120
126
  }
121
127
  highlightLine(e) {
122
128
  e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
123
129
  }
124
130
  clearHighlightLines() {
125
- this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.model.lines.forEach((e) => {
131
+ this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.polyline.lines.forEach((e) => {
126
132
  e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
127
133
  }), this.highlightedLines = [], this.five.needsRender = !0);
128
134
  }
129
135
  getEditingLines() {
130
- return this.model.lines;
136
+ return this.polyline.lines;
137
+ }
138
+ addStartPoint() {
131
139
  }
132
140
  highlightLines(e) {
133
141
  this.clearHighlightLines(), this.highlightedLines = e, this.deleteDom.setLines(e).updatePosition().show(), e.forEach((i) => this.highlightLine(i));
134
142
  }
135
143
  }
136
144
  export {
137
- $ as default
145
+ le as default
138
146
  };
@@ -1,16 +1,12 @@
1
- import type Line from '../Model/line';
2
- import BaseController, { IControllerParams } from './BaseController';
1
+ import BaseController, { ControllerParams } from './BaseController';
3
2
  export default class ViewController extends BaseController {
4
3
  type: string;
5
- private highlightedLines;
6
4
  private hammer?;
7
- constructor(params: IControllerParams);
5
+ constructor(params: ControllerParams);
8
6
  dispose(): void;
9
- highlightLine(line: Line): void;
10
- clearHighlightLines(): void;
11
- private wantsTapGesture;
12
- private chooseLine;
13
- private highlightLines;
14
- private lineRemoved;
7
+ private polylineRemoved;
8
+ private polylineAdded;
15
9
  private onCameraUpdate;
10
+ private onFivePanoWillArrive;
11
+ private onFivePanoArrived;
16
12
  }
@@ -1,101 +1,68 @@
1
- var P = Object.defineProperty;
2
- var y = (h, n, e) => n in h ? P(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
3
- var o = (h, n, e) => (y(h, typeof n != "symbol" ? n + "" : n, e), e);
4
- import T from "hammerjs";
5
- import { Vector2 as p } from "three";
6
- import { closestPointOnLine as H } from "../utils/math.js";
7
- import L from "../utils/isNDCPointInScreen.js";
8
- import { findAssociatedLines as k } from "../utils/findAssociatedLines.js";
9
- import E from "./BaseController.js";
10
- import "../Model/line.js";
11
- import "../../shared-utils/uuid.js";
12
- import "../Model/polyline.js";
13
- import "../utils/line.js";
1
+ var d = Object.defineProperty;
2
+ var n = (r, o, i) => o in r ? d(r, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[o] = i;
3
+ var s = (r, o, i) => (n(r, typeof o != "symbol" ? o + "" : o, i), i);
4
+ import a from "hammerjs";
5
+ import "three";
14
6
  import "@realsee/five/line";
15
7
  import "../utils/constants.js";
16
8
  import "@realsee/five";
9
+ import h from "./BaseController.js";
10
+ import "../Model/line.js";
11
+ import "../../shared-utils/uuid.js";
12
+ import "../utils/line.js";
17
13
  import "../utils/distanceDom.js";
14
+ import "../utils/isNDCPointInScreen.js";
18
15
  import "../Model/point.js";
19
16
  import "../../shared-utils/removeArrayItem.js";
20
17
  import "../utils/ironbox.js";
21
- class K extends E {
22
- constructor(e) {
23
- super(e);
24
- o(this, "type", "view");
25
- o(this, "highlightedLines", []);
26
- o(this, "hammer");
27
- o(this, "wantsTapGesture", (e) => {
28
- if (this.model.lines.length === 0)
29
- return;
30
- const [t] = this.five.model.intersectRaycaster(e);
31
- if (!t)
32
- return;
33
- const i = this.five.camera, g = t.point.clone().project(i), c = this.container.clientWidth, a = this.container.clientHeight, f = new p(g.x * c, g.y * a), u = this.model.lines.map((s) => {
34
- const [r, w] = s.points, m = r.position.clone().project(i), l = w.position.clone().project(i);
35
- if (!L(m) && !L(l))
36
- return null;
37
- const C = new p(
38
- m.x * c,
39
- m.y * a
40
- ), R = new p(
41
- l.x * c,
42
- l.y * a
43
- );
44
- return { id: s.id, points: [C, R] };
45
- }).filter((s) => !!s);
46
- if (u.length === 0)
47
- return;
48
- const v = u.map((s) => {
49
- const r = H(f, s.points);
50
- return { id: s.id, distance: r.distanceTo(f) };
51
- }).sort((s, r) => s.distance - r.distance)[0], d = v.distance > 20 ? void 0 : this.model.lines.find(({ id: s }) => s === v.id);
52
- if (this.highlightedLines.length > 0 && !d)
53
- return this.clearHighlightLines(), !1;
54
- if (d)
55
- return this.chooseLine(d), !1;
56
- });
57
- o(this, "chooseLine", (e) => {
58
- const t = k(e);
59
- this.highlightLines(t), this.five.needsRender = !0, this.hook.emit(
18
+ class U extends h {
19
+ constructor(i) {
20
+ super(i);
21
+ s(this, "type", "view");
22
+ s(this, "hammer");
23
+ s(this, "polylineRemoved", (i) => {
24
+ i.lines.forEach((e) => this.removeLine(e)), this.hook.emit(
60
25
  "selectedChange",
61
- t.map((i) => i.toCompletelyJson())
26
+ this.model.getAllLines().filter((e) => e.selected).map((e) => e)
62
27
  );
63
28
  });
64
- o(this, "lineRemoved", (e) => {
65
- this.removeLine(e), this.hook.emit(
66
- "selectedChange",
67
- this.model.lines.filter((t) => t.selected).map((t) => t.toCompletelyJson())
68
- );
29
+ s(this, "polylineAdded", (i) => {
30
+ i.lines.forEach((e) => {
31
+ e.distanceItem.appendTo(this.container), e.distanceItem.update(this.five), this.group.add(e.mesh);
32
+ });
69
33
  });
70
- o(this, "onCameraUpdate", () => {
34
+ s(this, "onCameraUpdate", () => {
71
35
  this.updateDistanceUI();
72
36
  });
73
- this.model.lines.forEach((i) => {
74
- i.distanceItem.appendTo(this.container), i.distanceItem.update(this.five), i.hook.on("selected", this.chooseLine), this.group.add(i.mesh);
37
+ s(this, "onFivePanoWillArrive", (i) => {
38
+ this.model.polylines.forEach((e) => {
39
+ !e.visiblePanoIndexes || e.visiblePanoIndexes.includes(i) || e.lines.forEach((t) => {
40
+ t.mesh.visible = !1, t.distanceItem.update(this.five);
41
+ });
42
+ });
43
+ });
44
+ s(this, "onFivePanoArrived", (i) => {
45
+ this.model.polylines.forEach((e) => {
46
+ !e.visiblePanoIndexes || e.visiblePanoIndexes.includes(i) && e.lines.forEach((t) => {
47
+ t.mesh.visible = !0, t.distanceItem.update(this.five);
48
+ });
49
+ });
50
+ });
51
+ this.model.getAllLines().forEach((t) => {
52
+ t.distanceItem.appendTo(this.container), t.distanceItem.update(this.five), this.group.add(t.mesh);
75
53
  });
76
- const t = this.five.getElement();
77
- if (t) {
78
- const i = new T(t);
79
- this.hammer = i;
54
+ const e = this.five.getElement();
55
+ if (e) {
56
+ const t = new a(e);
57
+ this.hammer = t;
80
58
  }
81
- this.model.hook.on("lineRemoved", this.lineRemoved), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.needsRender = !0;
59
+ this.updateDistanceUI(), this.five.needsRender = !0, this.model.hook.on("polylineAdded", this.polylineAdded), this.model.hook.on("polylineRemoved", this.polylineRemoved), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("panoArrived", this.onFivePanoArrived), this.five.on("panoWillArrive", this.onFivePanoWillArrive);
82
60
  }
83
61
  dispose() {
84
- var e;
85
- super.dispose(), this.model.hook.off("lineRemoved", this.lineRemoved), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (e = this.hammer) == null || e.destroy();
86
- }
87
- highlightLine(e) {
88
- e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
89
- }
90
- clearHighlightLines() {
91
- this.group.children.length !== 0 && (this.model.lines.forEach((e) => {
92
- e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
93
- }), this.highlightedLines = [], this.five.needsRender = !0);
94
- }
95
- highlightLines(e) {
96
- this.clearHighlightLines(), this.highlightedLines = e, e.forEach((t) => this.highlightLine(t));
62
+ var i;
63
+ super.dispose(), this.model.hook.off("polylineAdded", this.polylineAdded), this.model.hook.off("polylineRemoved", this.polylineRemoved), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("panoWillArrive", this.onFivePanoWillArrive), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (i = this.hammer) == null || i.destroy();
97
64
  }
98
65
  }
99
66
  export {
100
- K as default
67
+ U as default
101
68
  };
@@ -1,5 +1,5 @@
1
1
  import type Line from '../Model/line';
2
- import BaseController, { IControllerParams } from './BaseController';
2
+ import BaseController, { ControllerParams } from './BaseController';
3
3
  export default class WatchController extends BaseController {
4
4
  type: string;
5
5
  private deleteDom;
@@ -7,7 +7,7 @@ export default class WatchController extends BaseController {
7
7
  private fiveElement?;
8
8
  private editPointState?;
9
9
  private hammer?;
10
- constructor(params: IControllerParams);
10
+ constructor(params: ControllerParams);
11
11
  dispose(): void;
12
12
  highlightLine(line: Line): void;
13
13
  clearHighlightLines(): void;
@@ -19,7 +19,7 @@ export default class WatchController extends BaseController {
19
19
  private wantsTapGesture;
20
20
  private chooseLine;
21
21
  private highlightLines;
22
- private lineRemoved;
22
+ private polylineRemoved;
23
23
  private onCameraUpdate;
24
24
  private deleteDomClickCallback;
25
25
  private cancelDeleteClickCallback;