@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.
- package/README.md +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
- package/dist/CSS3DRenderPlugin/index.js +27 -26
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +4 -6
- package/dist/CameraMovementPlugin/index.js +12 -12
- package/dist/CameraMovementPlugin/typing.d.ts +1 -1
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/dist/ModelChassisCompassPlugin/index.js +8 -5
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/index.js +153 -73
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +3 -16
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/index.d.ts +4 -47
- package/dist/PanoCompassPlugin/index.js +242 -129
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +9 -6
- package/dist/PanoMeasurePlugin/index.js +2649 -3442
- package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +4 -30
- package/dist/PanoRulerPlugin/index.js +12 -12
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/index.d.ts +6 -0
- package/dist/floorplan/utils/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatPosition.d.ts +1 -1
- package/dist/index.d.ts +15 -24
- package/dist/index.es.js +10694 -7145
- package/dist/index.js +10432 -6869
- package/dist/index.umd.js +10435 -6875
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -0
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/math/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/index.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/dist/shared-utils/three/getNormal.d.ts +1 -1
- package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/uuid.d.ts +1 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +5 -8
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +78 -33
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +26 -18
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +13 -6
- package/CHANGELOG.md +0 -30
- package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
- package/dist/shared-utils/useDebounce.d.ts +0 -8
- package/dist/shared-utils/useThrottle.d.ts +0 -8
- package/docs/enums/ModelFloorplanErrorType.html +0 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var internal = require('svelte/internal');
|
|
6
6
|
var svelte = require('svelte');
|
|
7
|
-
var
|
|
7
|
+
var five = require('@realsee/five');
|
|
8
8
|
|
|
9
9
|
const CAMERA_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v////+Vy//w9//k8/+B1f/v9/+D0/+UyP/u9v+D0v/i8f+F0v/g7/+G0P+KzP+Hz/////+Lx//s8/+Puf/h7P+Mxv/w9f7q8v/q8f2RwP/r8f6JrP/t8v6RvP/l6f7////j6P6VvP/f5/7q8P7a4P/U2f6au/+ZuP+ewf+auP+iu//n6f2Fn//j6P/h4fn9/v/4/P/3/P/o9v/l9P+F1P+B1f/i8v+UyP+J0f+E0f/h7//r8v6Izf/g7v/q8v6Pv//f7P7f7f/g7f+Lxf+MyP+Mw//k7v6Ow/+Ov//v8/2Pu//t8f+Tvv/p8P6Uu//q7v/i6P2Xvf+WuP/L1vypu//Azv7K0/zy8v/l8v/A4P/o9f/x+f+I0f/j8v+J0P/s9v/h8P+I0P/t9v/r9P6Lyv+Lyf/s9P/g7P+Myv/s8/7j7v+Jrv/q8P2Uwf+Epf+TuP/a3vzh5f3w8P/a4P20v//Nzfzx8f/Pz/Cg0P/f7//u9f/q8v7o8v7s8/7s8v3w9f+Sv/+TuP+Gp//s8fr///8/HFXHAAAA8nRSTlMANUQ/Z2JJXXaKTjCPmVMre3E6gFiylLxsxoVYnk5JwaOFU8utOjrV0KieQS2icWwzMC4Dt7aTQvjfrHprXD0zMyvpvUxGNjH+2sK9raeYkoiAcF5TUi0rKCYY2cy3pIJ/eGpEQDcxLx0S/Pv19PPu7Ovr5+Tk4eDe3NXU09DIsq2opKCViYN9e3V1cmZlXllVTk1GQDs2NTMwJw0K/vn28u/u5+Pj3tjNycjGw8DAua2pqJ6SjYyMf3BvaWNgWk5NSTc3MxT79PHw6efl2trY19PHurWysqWZe2xkXVlUPjo6OSskCO7Qzs6+vKCedmhdN1av0hoAAAV1SURBVEjHjZT3P9RxHMe1nCjcObo4cjpX5w53l7pUbnBGkr2TPZJKmiqVEQlJhGjvvfcm2nvvvXf5C3q/P98bkuR1D7+9n16v1/vzvtPrnAade/ty6anHJfFHOjkfXbe07PGxkuL4oqIjCzoDjHtxurzsRHmFStokjBDG/59JrwurOF2hkkUoIyKEQmFqatG3/xDnXlSGPZcKI5VKiVgsli+vrakpfNAx8UoVlpRWH6mUeMsVcm8vhah6WfXB3A6IlSlVKoE4KjxcgtNGRl1Ayzw9H+Z20DypMVkZZWKiUIi6oHj2PAbPs6Eh/+6/kBUpVUliIEQKGGcwGPbdiBpCQ/O//AMZJ218XW9igoHsGTwY7kopdMmSvTvbz/VGmiyhCARwWJ/Ss5CQ9pl3zVJZJCEwEszb6BtaGxrCn3XIyZP3trW3rybBWTCB1jy0sNGHeWM7+BgzrX4kJu752E57mWA5mIjsMRVxgGkrJpPpRvtJSywt3X2rPUSMuUgqIIzx37vRaLQeqNKEhN03/womg/bYhDJBBzdqvjsqYeHCHdfa1k9BF0QoEyuwoOadWc4sFutoXNzWGW2W3Axd8E3AxAZ6WNGeEoDl7EwPho/T0cDAtswb2Bi6kFx2VkwaDYgRI5zo9EUGRIGHD82e+ufrJ8uo+l31oQogYMJiOdFh2BQ03NTscEDAn8wKgQCeUsRTI8QEMhkYDDc1NTMLMuNwLAP8/a9Pbl0mJQlXhvVtrO2YNLce3Uew6IvAAsYtLS17gvwLCrKR0d3la0DsgdG3NiZVMBZacMh8L9CB2NjsS61eRiCtB4YH/Q21CMQKAgLnh1hYWAyJ3b9/40Qd09woppJhFytAnIPpBmBCCBjvjdrn59eKSU+SRWkZphu40IMBgRpAAMBmO7DZbL/786+s0TIpKqXOhgqGCKcnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==';
|
|
10
10
|
|
|
@@ -30,7 +30,7 @@ function throttle(func, wait = 200) {
|
|
|
30
30
|
/* src/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
|
|
31
31
|
|
|
32
32
|
function add_css$7(target) {
|
|
33
|
-
internal.append_styles(target, "svelte-
|
|
33
|
+
internal.append_styles(target, "svelte-1ty3s4p", ".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function create_fragment$8(ctx) {
|
|
@@ -43,12 +43,12 @@ function create_fragment$8(ctx) {
|
|
|
43
43
|
div2 = internal.element("div");
|
|
44
44
|
div1 = internal.element("div");
|
|
45
45
|
div0 = internal.element("div");
|
|
46
|
-
internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-
|
|
46
|
+
internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-1ty3s4p");
|
|
47
47
|
internal.set_style(div0, "background-image", "url(" + (/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE) + ")");
|
|
48
48
|
internal.set_style(div0, "transform", /*rotateTransform*/ ctx[1], false);
|
|
49
|
-
internal.attr(div1, "class", "plugin-radar__camera-position svelte-
|
|
49
|
+
internal.attr(div1, "class", "plugin-radar__camera-position svelte-1ty3s4p");
|
|
50
50
|
internal.set_style(div1, "transform", /*positionTransform*/ ctx[2], false);
|
|
51
|
-
internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-
|
|
51
|
+
internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-1ty3s4p");
|
|
52
52
|
},
|
|
53
53
|
m(target, anchor) {
|
|
54
54
|
internal.insert(target, div2, anchor);
|
|
@@ -76,58 +76,54 @@ function create_fragment$8(ctx) {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
function getCameraRotateTransform(longitude) {
|
|
80
|
+
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
81
|
+
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
82
|
+
|
|
83
|
+
return `rotate(${rotate}deg)`;
|
|
84
|
+
}
|
|
85
|
+
|
|
79
86
|
function instance$8($$self, $$props, $$invalidate) {
|
|
87
|
+
let positionTransform;
|
|
88
|
+
let rotateTransform;
|
|
80
89
|
let { five } = $$props;
|
|
81
90
|
let { pxmm } = $$props;
|
|
82
91
|
let { floorplanData } = $$props;
|
|
83
92
|
let { cameraImageUrl } = $$props;
|
|
93
|
+
let panoIndex = five.getCurrentState().panoIndex;
|
|
94
|
+
let longitude = five.getCurrentState().longitude;
|
|
84
95
|
|
|
85
96
|
/** 获取相机在当前 Five 状态下的位移 */
|
|
86
|
-
function getCameraPositionTransform(panoIndex) {
|
|
87
|
-
const observer = floorplanData.observers[panoIndex];
|
|
97
|
+
function getCameraPositionTransform(floorplanData, panoIndex) {
|
|
88
98
|
const bounding = floorplanData.bounding;
|
|
99
|
+
const floorplanObserver = floorplanData.observers[panoIndex];
|
|
100
|
+
if (!floorplanObserver) return '';
|
|
89
101
|
const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
|
|
90
102
|
const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
const top = Math.floor(observer.positionInImage.y * clientHeight);
|
|
103
|
+
const left = Math.floor(floorplanObserver.positionInImage.x * clientWidth);
|
|
104
|
+
const top = Math.floor(floorplanObserver.positionInImage.y * clientHeight);
|
|
94
105
|
return `translate(${left}px, ${top}px)`;
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const { longitude } = five.getCurrentState();
|
|
100
|
-
|
|
101
|
-
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
102
|
-
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
103
|
-
|
|
104
|
-
return `rotate(${rotate}deg)`;
|
|
108
|
+
function onFivePanoWillArrive(_panoIndex) {
|
|
109
|
+
$$invalidate(6, panoIndex = _panoIndex);
|
|
105
110
|
}
|
|
106
111
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const changeRotate = throttle(
|
|
112
|
-
() => {
|
|
113
|
-
$$invalidate(1, rotateTransform = getCameraRotationTransform());
|
|
112
|
+
const onFiveCameraDirectionUpdate = throttle(
|
|
113
|
+
pose => {
|
|
114
|
+
$$invalidate(7, longitude = pose.longitude);
|
|
114
115
|
},
|
|
115
116
|
1000 / 60
|
|
116
117
|
);
|
|
117
118
|
|
|
118
|
-
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
119
|
-
let rotateTransform = getCameraRotationTransform();
|
|
120
|
-
|
|
121
|
-
let positionTransform = getCameraPositionTransform(five.getCurrentState().panoIndex);
|
|
122
|
-
|
|
123
119
|
svelte.onMount(() => {
|
|
124
|
-
five.on('panoWillArrive',
|
|
125
|
-
five.on('cameraDirectionUpdate',
|
|
126
|
-
});
|
|
120
|
+
five.on('panoWillArrive', onFivePanoWillArrive);
|
|
121
|
+
five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
return function dispose() {
|
|
124
|
+
five.off('panoWillArrive', onFivePanoWillArrive);
|
|
125
|
+
five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
126
|
+
};
|
|
131
127
|
});
|
|
132
128
|
|
|
133
129
|
$$self.$$set = $$props => {
|
|
@@ -137,7 +133,27 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
137
133
|
if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
|
|
138
134
|
};
|
|
139
135
|
|
|
140
|
-
|
|
136
|
+
$$self.$$.update = () => {
|
|
137
|
+
if ($$self.$$.dirty & /*floorplanData, panoIndex*/ 96) {
|
|
138
|
+
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
139
|
+
$$invalidate(2, positionTransform = getCameraPositionTransform(floorplanData, panoIndex));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if ($$self.$$.dirty & /*longitude*/ 128) {
|
|
143
|
+
$$invalidate(1, rotateTransform = getCameraRotateTransform(longitude));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
return [
|
|
148
|
+
cameraImageUrl,
|
|
149
|
+
rotateTransform,
|
|
150
|
+
positionTransform,
|
|
151
|
+
five,
|
|
152
|
+
pxmm,
|
|
153
|
+
floorplanData,
|
|
154
|
+
panoIndex,
|
|
155
|
+
longitude
|
|
156
|
+
];
|
|
141
157
|
}
|
|
142
158
|
|
|
143
159
|
class Camera extends internal.SvelteComponent {
|
|
@@ -164,7 +180,7 @@ class Camera extends internal.SvelteComponent {
|
|
|
164
180
|
/* src/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte generated by Svelte v3.47.0 */
|
|
165
181
|
|
|
166
182
|
function add_css$6(target) {
|
|
167
|
-
internal.append_styles(target, "svelte-
|
|
183
|
+
internal.append_styles(target, "svelte-1i87fz7", ".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}");
|
|
168
184
|
}
|
|
169
185
|
|
|
170
186
|
function get_each_context$1(ctx, list, i) {
|
|
@@ -190,11 +206,11 @@ function create_each_block$1(key_1, ctx) {
|
|
|
190
206
|
div1 = internal.element("div");
|
|
191
207
|
div0 = internal.element("div");
|
|
192
208
|
t = internal.space();
|
|
193
|
-
internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-
|
|
209
|
+
internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-1i87fz7");
|
|
194
210
|
internal.set_style(div0, "background-image", `url(${/*extraObject*/ ctx[1].icon.url})`);
|
|
195
211
|
internal.set_style(div0, "width", style_width, false);
|
|
196
212
|
internal.set_style(div0, "height", style_height, false);
|
|
197
|
-
internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-
|
|
213
|
+
internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7");
|
|
198
214
|
internal.set_style(div1, "top", style_top, false);
|
|
199
215
|
internal.set_style(div1, "left", style_left, false);
|
|
200
216
|
this.first = div1;
|
|
@@ -254,7 +270,7 @@ function create_fragment$7(ctx) {
|
|
|
254
270
|
each_blocks[i].c();
|
|
255
271
|
}
|
|
256
272
|
|
|
257
|
-
internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-
|
|
273
|
+
internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-1i87fz7");
|
|
258
274
|
},
|
|
259
275
|
m(target, anchor) {
|
|
260
276
|
internal.insert(target, div, anchor);
|
|
@@ -301,7 +317,7 @@ class ExtraObjects extends internal.SvelteComponent {
|
|
|
301
317
|
/* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
|
|
302
318
|
|
|
303
319
|
function add_css$5(target) {
|
|
304
|
-
internal.append_styles(target, "svelte-
|
|
320
|
+
internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
|
|
305
321
|
}
|
|
306
322
|
|
|
307
323
|
function create_fragment$6(ctx) {
|
|
@@ -313,7 +329,7 @@ function create_fragment$6(ctx) {
|
|
|
313
329
|
img = internal.element("img");
|
|
314
330
|
if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
|
|
315
331
|
internal.attr(img, "alt", "floorplan iamge");
|
|
316
|
-
internal.attr(img, "class", "svelte-
|
|
332
|
+
internal.attr(img, "class", "svelte-1gfoniz");
|
|
317
333
|
},
|
|
318
334
|
m(target, anchor) {
|
|
319
335
|
internal.insert(target, img, anchor);
|
|
@@ -351,7 +367,7 @@ class Normalmage extends internal.SvelteComponent {
|
|
|
351
367
|
/* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
|
|
352
368
|
|
|
353
369
|
function add_css$4(target) {
|
|
354
|
-
internal.append_styles(target, "svelte-
|
|
370
|
+
internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
|
|
355
371
|
}
|
|
356
372
|
|
|
357
373
|
function create_fragment$5(ctx) {
|
|
@@ -368,7 +384,7 @@ function create_fragment$5(ctx) {
|
|
|
368
384
|
html_tag_1 = new internal.HtmlTag();
|
|
369
385
|
html_tag.a = t;
|
|
370
386
|
html_tag_1.a = null;
|
|
371
|
-
internal.attr(div, "class", "floorplan-plugin__base-image svelte-
|
|
387
|
+
internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
|
|
372
388
|
},
|
|
373
389
|
m(target, anchor) {
|
|
374
390
|
internal.insert(target, div, anchor);
|
|
@@ -398,8 +414,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
398
414
|
}
|
|
399
415
|
svg [type='lineItemGroup'] g g g g {
|
|
400
416
|
stroke: #ffffff;
|
|
401
|
-
}
|
|
402
|
-
</style>
|
|
417
|
+
}</style>
|
|
403
418
|
`;
|
|
404
419
|
|
|
405
420
|
$$self.$$set = $$props => {
|
|
@@ -419,11 +434,11 @@ class SvgImage extends internal.SvelteComponent {
|
|
|
419
434
|
/* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
|
|
420
435
|
|
|
421
436
|
function add_css$3(target) {
|
|
422
|
-
internal.append_styles(target, "svelte-
|
|
437
|
+
internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
|
|
423
438
|
}
|
|
424
439
|
|
|
425
|
-
// (
|
|
426
|
-
function create_if_block_1(ctx) {
|
|
440
|
+
// (13:22)
|
|
441
|
+
function create_if_block_1$1(ctx) {
|
|
427
442
|
let normalimage;
|
|
428
443
|
let current;
|
|
429
444
|
normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
|
|
@@ -456,7 +471,7 @@ function create_if_block_1(ctx) {
|
|
|
456
471
|
};
|
|
457
472
|
}
|
|
458
473
|
|
|
459
|
-
// (
|
|
474
|
+
// (11:2) {#if svgContent}
|
|
460
475
|
function create_if_block$2(ctx) {
|
|
461
476
|
let svgimage;
|
|
462
477
|
let current;
|
|
@@ -498,7 +513,7 @@ function create_fragment$4(ctx) {
|
|
|
498
513
|
let current_block_type_index;
|
|
499
514
|
let if_block;
|
|
500
515
|
let current;
|
|
501
|
-
const if_block_creators = [create_if_block$2, create_if_block_1];
|
|
516
|
+
const if_block_creators = [create_if_block$2, create_if_block_1$1];
|
|
502
517
|
const if_blocks = [];
|
|
503
518
|
|
|
504
519
|
function select_block_type(ctx, dirty) {
|
|
@@ -515,7 +530,7 @@ function create_fragment$4(ctx) {
|
|
|
515
530
|
c() {
|
|
516
531
|
div = internal.element("div");
|
|
517
532
|
if (if_block) if_block.c();
|
|
518
|
-
internal.attr(div, "class", "floorplan-plugin__base-image svelte-
|
|
533
|
+
internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
|
|
519
534
|
},
|
|
520
535
|
m(target, anchor) {
|
|
521
536
|
internal.insert(target, div, anchor);
|
|
@@ -584,6 +599,7 @@ function create_fragment$4(ctx) {
|
|
|
584
599
|
function instance$4($$self, $$props, $$invalidate) {
|
|
585
600
|
let imageData;
|
|
586
601
|
let svgContent;
|
|
602
|
+
var _a, _b;
|
|
587
603
|
let { floorIndex } = $$props;
|
|
588
604
|
let { floorplanData } = $$props;
|
|
589
605
|
|
|
@@ -597,12 +613,16 @@ function instance$4($$self, $$props, $$invalidate) {
|
|
|
597
613
|
$$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
|
|
598
614
|
}
|
|
599
615
|
|
|
600
|
-
if ($$self.$$.dirty & /*floorplanData, floorIndex*/
|
|
601
|
-
$$invalidate(0, svgContent = floorplanData.outlines
|
|
616
|
+
if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
|
|
617
|
+
$$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
|
|
618
|
+
? void 0
|
|
619
|
+
: _a[floorIndex]) === null || _b === void 0
|
|
620
|
+
? void 0
|
|
621
|
+
: _b.svgContent);
|
|
602
622
|
}
|
|
603
623
|
};
|
|
604
624
|
|
|
605
|
-
return [svgContent, imageData, floorIndex, floorplanData];
|
|
625
|
+
return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
|
|
606
626
|
}
|
|
607
627
|
|
|
608
628
|
class BaseImage extends internal.SvelteComponent {
|
|
@@ -623,7 +643,7 @@ function pathD(points, options = {}) {
|
|
|
623
643
|
d += 'M' + point;
|
|
624
644
|
return d;
|
|
625
645
|
}
|
|
626
|
-
if (needA
|
|
646
|
+
if (needA === null || needA === void 0 ? void 0 : needA[index]) {
|
|
627
647
|
d += 'A' + needA[index] + ',' + point;
|
|
628
648
|
return d;
|
|
629
649
|
}
|
|
@@ -633,9 +653,9 @@ function pathD(points, options = {}) {
|
|
|
633
653
|
return d + (needZ ? 'Z' : '');
|
|
634
654
|
}
|
|
635
655
|
/** 把户型图上点点位转换到 SVG 上的点位 */
|
|
636
|
-
function formatFloorplanPoint({ x, y },
|
|
656
|
+
function formatFloorplanPoint({ x, y }, bounding) {
|
|
637
657
|
const { max, min } = bounding;
|
|
638
|
-
return { x:
|
|
658
|
+
return { x: x - min.x, y: max.y - y };
|
|
639
659
|
}
|
|
640
660
|
/** 模型坐标转户型图坐标 */
|
|
641
661
|
function modelPosition2FloorplanPosition(position, floorplanData) {
|
|
@@ -666,71 +686,106 @@ function getFloorIndexFromModelPosition(position, five) {
|
|
|
666
686
|
/* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
|
|
667
687
|
|
|
668
688
|
function add_css$2(target) {
|
|
669
|
-
internal.append_styles(target, "svelte-
|
|
689
|
+
internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
|
|
670
690
|
}
|
|
671
691
|
|
|
672
692
|
function create_fragment$3(ctx) {
|
|
673
693
|
let path;
|
|
694
|
+
let mounted;
|
|
695
|
+
let dispose;
|
|
674
696
|
|
|
675
697
|
return {
|
|
676
698
|
c() {
|
|
677
699
|
path = internal.svg_element("path");
|
|
678
|
-
internal.attr(path, "d", /*_pathD*/ ctx[
|
|
700
|
+
internal.attr(path, "d", /*_pathD*/ ctx[2]);
|
|
679
701
|
internal.attr(path, "fill", `#fff`);
|
|
680
|
-
internal.attr(path, "class", "svelte-
|
|
702
|
+
internal.attr(path, "class", "svelte-19uvvss");
|
|
681
703
|
},
|
|
682
704
|
m(target, anchor) {
|
|
683
705
|
internal.insert(target, path, anchor);
|
|
706
|
+
|
|
707
|
+
if (!mounted) {
|
|
708
|
+
dispose = [
|
|
709
|
+
internal.listen(path, "mouseenter", /*onMouseEnter*/ ctx[0]),
|
|
710
|
+
internal.listen(path, "mouseleave", /*onMouseLeave*/ ctx[1])
|
|
711
|
+
];
|
|
712
|
+
|
|
713
|
+
mounted = true;
|
|
714
|
+
}
|
|
684
715
|
},
|
|
685
716
|
p: internal.noop,
|
|
686
717
|
i: internal.noop,
|
|
687
718
|
o: internal.noop,
|
|
688
719
|
d(detaching) {
|
|
689
720
|
if (detaching) internal.detach(path);
|
|
721
|
+
mounted = false;
|
|
722
|
+
internal.run_all(dispose);
|
|
690
723
|
}
|
|
691
724
|
};
|
|
692
725
|
}
|
|
693
726
|
|
|
694
727
|
function instance$3($$self, $$props, $$invalidate) {
|
|
695
|
-
let { pxmm } = $$props;
|
|
696
728
|
let { room } = $$props;
|
|
697
729
|
let { floorplanData } = $$props;
|
|
730
|
+
let { hoveredRoom } = $$props;
|
|
731
|
+
|
|
732
|
+
function onMouseEnter() {
|
|
733
|
+
hoveredRoom.set(room);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
function onMouseLeave() {
|
|
737
|
+
hoveredRoom.set(undefined);
|
|
738
|
+
}
|
|
739
|
+
|
|
698
740
|
const { bounding } = floorplanData;
|
|
699
741
|
|
|
700
742
|
const _pathD = pathD(room.path, {
|
|
701
743
|
needZ: true,
|
|
702
|
-
format: vector => formatFloorplanPoint(vector,
|
|
744
|
+
format: vector => formatFloorplanPoint(vector, bounding)
|
|
703
745
|
});
|
|
704
746
|
|
|
705
747
|
$$self.$$set = $$props => {
|
|
706
|
-
if ('
|
|
707
|
-
if ('
|
|
708
|
-
if ('
|
|
748
|
+
if ('room' in $$props) $$invalidate(3, room = $$props.room);
|
|
749
|
+
if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
|
|
750
|
+
if ('hoveredRoom' in $$props) $$invalidate(5, hoveredRoom = $$props.hoveredRoom);
|
|
709
751
|
};
|
|
710
752
|
|
|
711
|
-
return [
|
|
753
|
+
return [onMouseEnter, onMouseLeave, _pathD, room, floorplanData, hoveredRoom];
|
|
712
754
|
}
|
|
713
755
|
|
|
714
756
|
class Room extends internal.SvelteComponent {
|
|
715
757
|
constructor(options) {
|
|
716
758
|
super();
|
|
717
|
-
|
|
759
|
+
|
|
760
|
+
internal.init(
|
|
761
|
+
this,
|
|
762
|
+
options,
|
|
763
|
+
instance$3,
|
|
764
|
+
create_fragment$3,
|
|
765
|
+
internal.safe_not_equal,
|
|
766
|
+
{
|
|
767
|
+
room: 3,
|
|
768
|
+
floorplanData: 4,
|
|
769
|
+
hoveredRoom: 5
|
|
770
|
+
},
|
|
771
|
+
add_css$2
|
|
772
|
+
);
|
|
718
773
|
}
|
|
719
774
|
}
|
|
720
775
|
|
|
721
776
|
/* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
|
|
722
777
|
|
|
723
778
|
function add_css$1(target) {
|
|
724
|
-
internal.append_styles(target, "svelte-
|
|
779
|
+
internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
|
|
725
780
|
}
|
|
726
781
|
|
|
727
782
|
function get_each_context(ctx, list, i) {
|
|
728
783
|
const child_ctx = ctx.slice();
|
|
729
|
-
child_ctx[
|
|
784
|
+
child_ctx[5] = list[i];
|
|
730
785
|
return child_ctx;
|
|
731
786
|
}
|
|
732
787
|
|
|
733
|
-
// (
|
|
788
|
+
// (11:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
|
|
734
789
|
function create_each_block(key_1, ctx) {
|
|
735
790
|
let first;
|
|
736
791
|
let room;
|
|
@@ -738,9 +793,9 @@ function create_each_block(key_1, ctx) {
|
|
|
738
793
|
|
|
739
794
|
const room_spread_levels = [
|
|
740
795
|
{
|
|
741
|
-
room: /*room*/ ctx[
|
|
742
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
743
|
-
|
|
796
|
+
room: /*room*/ ctx[5],
|
|
797
|
+
floorplanData: /*floorplanData*/ ctx[1],
|
|
798
|
+
hoveredRoom: /*hoveredRoom*/ ctx[2]
|
|
744
799
|
}
|
|
745
800
|
];
|
|
746
801
|
|
|
@@ -768,12 +823,12 @@ function create_each_block(key_1, ctx) {
|
|
|
768
823
|
p(new_ctx, dirty) {
|
|
769
824
|
ctx = new_ctx;
|
|
770
825
|
|
|
771
|
-
const room_changes = (dirty & /*floorplanData, floorIndex,
|
|
826
|
+
const room_changes = (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7)
|
|
772
827
|
? internal.get_spread_update(room_spread_levels, [
|
|
773
828
|
{
|
|
774
|
-
room: /*room*/ ctx[
|
|
775
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
776
|
-
|
|
829
|
+
room: /*room*/ ctx[5],
|
|
830
|
+
floorplanData: /*floorplanData*/ ctx[1],
|
|
831
|
+
hoveredRoom: /*hoveredRoom*/ ctx[2]
|
|
777
832
|
}
|
|
778
833
|
])
|
|
779
834
|
: {};
|
|
@@ -801,12 +856,9 @@ function create_fragment$2(ctx) {
|
|
|
801
856
|
let svg;
|
|
802
857
|
let each_blocks = [];
|
|
803
858
|
let each_1_lookup = new Map();
|
|
804
|
-
let div_resize_listener;
|
|
805
859
|
let current;
|
|
806
|
-
let
|
|
807
|
-
|
|
808
|
-
let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
|
|
809
|
-
const get_key = ctx => /*room*/ ctx[12].id;
|
|
860
|
+
let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
861
|
+
const get_key = ctx => /*room*/ ctx[5].id;
|
|
810
862
|
|
|
811
863
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
812
864
|
let child_ctx = get_each_context(ctx, each_value, i);
|
|
@@ -823,9 +875,11 @@ function create_fragment$2(ctx) {
|
|
|
823
875
|
each_blocks[i].c();
|
|
824
876
|
}
|
|
825
877
|
|
|
826
|
-
internal.attr(svg, "
|
|
827
|
-
internal.attr(
|
|
828
|
-
internal.
|
|
878
|
+
internal.attr(svg, "width", "100%");
|
|
879
|
+
internal.attr(svg, "height", "100%");
|
|
880
|
+
internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[3]} ${/*boundingHeight*/ ctx[4]}`);
|
|
881
|
+
internal.attr(svg, "class", "svelte-1kqo6e4");
|
|
882
|
+
internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
|
|
829
883
|
},
|
|
830
884
|
m(target, anchor) {
|
|
831
885
|
internal.insert(target, div, anchor);
|
|
@@ -835,18 +889,11 @@ function create_fragment$2(ctx) {
|
|
|
835
889
|
each_blocks[i].m(svg, null);
|
|
836
890
|
}
|
|
837
891
|
|
|
838
|
-
/*div_binding*/ ctx[9](div);
|
|
839
|
-
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
|
|
840
892
|
current = true;
|
|
841
|
-
|
|
842
|
-
if (!mounted) {
|
|
843
|
-
dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
|
|
844
|
-
mounted = true;
|
|
845
|
-
}
|
|
846
893
|
},
|
|
847
894
|
p(ctx, [dirty]) {
|
|
848
|
-
if (dirty & /*floorplanData, floorIndex,
|
|
849
|
-
each_value = /*floorplanData*/ ctx[
|
|
895
|
+
if (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7) {
|
|
896
|
+
each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
850
897
|
internal.group_outros();
|
|
851
898
|
each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block, null, get_each_context);
|
|
852
899
|
internal.check_outros();
|
|
@@ -874,83 +921,24 @@ function create_fragment$2(ctx) {
|
|
|
874
921
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
875
922
|
each_blocks[i].d();
|
|
876
923
|
}
|
|
877
|
-
|
|
878
|
-
/*div_binding*/ ctx[9](null);
|
|
879
|
-
div_resize_listener();
|
|
880
|
-
mounted = false;
|
|
881
|
-
dispose();
|
|
882
924
|
}
|
|
883
925
|
};
|
|
884
926
|
}
|
|
885
927
|
|
|
886
928
|
function instance$2($$self, $$props, $$invalidate) {
|
|
887
|
-
let { five } = $$props;
|
|
888
|
-
let { pxmm } = $$props;
|
|
889
929
|
let { floorIndex } = $$props;
|
|
890
930
|
let { floorplanData } = $$props;
|
|
891
|
-
let {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
let highlightContainerDom;
|
|
895
|
-
const { observers: floorplan_observers } = floorplanData;
|
|
896
|
-
|
|
897
|
-
const handleClick = function (e) {
|
|
898
|
-
if (onRoomHeightClick?.(e) === false) return;
|
|
899
|
-
|
|
900
|
-
// 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
|
|
901
|
-
const boundingClientRect = highlightContainerDom.getBoundingClientRect();
|
|
902
|
-
|
|
903
|
-
const mouseClientVector = new three.Vector2(e.clientX, e.clientY);
|
|
904
|
-
const domTopLeftVector = new three.Vector2(boundingClientRect.left, boundingClientRect.top);
|
|
905
|
-
const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
|
|
906
|
-
|
|
907
|
-
// px 转换为 百分比
|
|
908
|
-
const mouseOffsetRelativeVector = new three.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
|
|
909
|
-
|
|
910
|
-
const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
|
|
911
|
-
const position1 = new three.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
|
|
912
|
-
const position2 = new three.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
|
|
913
|
-
return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
|
|
914
|
-
})[0];
|
|
915
|
-
|
|
916
|
-
five.moveToPano(closestPoint.index);
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
function div_binding($$value) {
|
|
920
|
-
internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
921
|
-
highlightContainerDom = $$value;
|
|
922
|
-
$$invalidate(5, highlightContainerDom);
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
function div_elementresize_handler() {
|
|
927
|
-
clientWidth = this.clientWidth;
|
|
928
|
-
clientHeight = this.clientHeight;
|
|
929
|
-
$$invalidate(3, clientWidth);
|
|
930
|
-
$$invalidate(4, clientHeight);
|
|
931
|
-
}
|
|
931
|
+
let { hoveredRoom } = $$props;
|
|
932
|
+
const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
|
|
933
|
+
const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
|
|
932
934
|
|
|
933
935
|
$$self.$$set = $$props => {
|
|
934
|
-
if ('
|
|
935
|
-
if ('
|
|
936
|
-
if ('
|
|
937
|
-
if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
|
|
938
|
-
if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
|
|
936
|
+
if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
|
|
937
|
+
if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
|
|
938
|
+
if ('hoveredRoom' in $$props) $$invalidate(2, hoveredRoom = $$props.hoveredRoom);
|
|
939
939
|
};
|
|
940
940
|
|
|
941
|
-
return [
|
|
942
|
-
pxmm,
|
|
943
|
-
floorIndex,
|
|
944
|
-
floorplanData,
|
|
945
|
-
clientWidth,
|
|
946
|
-
clientHeight,
|
|
947
|
-
highlightContainerDom,
|
|
948
|
-
handleClick,
|
|
949
|
-
five,
|
|
950
|
-
onRoomHeightClick,
|
|
951
|
-
div_binding,
|
|
952
|
-
div_elementresize_handler
|
|
953
|
-
];
|
|
941
|
+
return [floorIndex, floorplanData, hoveredRoom, boundingWidth, boundingHeight];
|
|
954
942
|
}
|
|
955
943
|
|
|
956
944
|
class RoomHighlight extends internal.SvelteComponent {
|
|
@@ -964,11 +952,9 @@ class RoomHighlight extends internal.SvelteComponent {
|
|
|
964
952
|
create_fragment$2,
|
|
965
953
|
internal.safe_not_equal,
|
|
966
954
|
{
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
floorplanData: 2,
|
|
971
|
-
onRoomHeightClick: 8
|
|
955
|
+
floorIndex: 0,
|
|
956
|
+
floorplanData: 1,
|
|
957
|
+
hoveredRoom: 2
|
|
972
958
|
},
|
|
973
959
|
add_css$1
|
|
974
960
|
);
|
|
@@ -1169,7 +1155,9 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
1169
1155
|
|
|
1170
1156
|
$$self.$$.update = () => {
|
|
1171
1157
|
if ($$self.$$.dirty & /*extraObjects, floorIndex*/ 132) {
|
|
1172
|
-
$$invalidate(5, currentFloorExtraObjects = extraObjects
|
|
1158
|
+
$$invalidate(5, currentFloorExtraObjects = extraObjects === null || extraObjects === void 0
|
|
1159
|
+
? void 0
|
|
1160
|
+
: extraObjects.filter(object => object.floorIndex === floorIndex));
|
|
1173
1161
|
}
|
|
1174
1162
|
};
|
|
1175
1163
|
|
|
@@ -1203,27 +1191,88 @@ class CurrentFloor extends internal.SvelteComponent {
|
|
|
1203
1191
|
/* src/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
|
|
1204
1192
|
|
|
1205
1193
|
function add_css(target) {
|
|
1206
|
-
internal.append_styles(target, "svelte-
|
|
1194
|
+
internal.append_styles(target, "svelte-1mvqyqq", ".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}");
|
|
1207
1195
|
}
|
|
1208
1196
|
|
|
1209
|
-
// (41:
|
|
1197
|
+
// (41:0) {#if visible}
|
|
1210
1198
|
function create_if_block(ctx) {
|
|
1199
|
+
let div;
|
|
1200
|
+
let div_resize_listener;
|
|
1201
|
+
let current;
|
|
1202
|
+
let if_block = /*clientWidth*/ ctx[6] !== 0 && create_if_block_1(ctx);
|
|
1203
|
+
|
|
1204
|
+
return {
|
|
1205
|
+
c() {
|
|
1206
|
+
div = internal.element("div");
|
|
1207
|
+
if (if_block) if_block.c();
|
|
1208
|
+
internal.attr(div, "class", "plugin-floorplan-radar svelte-1mvqyqq");
|
|
1209
|
+
internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[12].call(div));
|
|
1210
|
+
},
|
|
1211
|
+
m(target, anchor) {
|
|
1212
|
+
internal.insert(target, div, anchor);
|
|
1213
|
+
if (if_block) if_block.m(div, null);
|
|
1214
|
+
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[12].bind(div));
|
|
1215
|
+
current = true;
|
|
1216
|
+
},
|
|
1217
|
+
p(ctx, dirty) {
|
|
1218
|
+
if (/*clientWidth*/ ctx[6] !== 0) {
|
|
1219
|
+
if (if_block) {
|
|
1220
|
+
if_block.p(ctx, dirty);
|
|
1221
|
+
|
|
1222
|
+
if (dirty & /*clientWidth*/ 64) {
|
|
1223
|
+
internal.transition_in(if_block, 1);
|
|
1224
|
+
}
|
|
1225
|
+
} else {
|
|
1226
|
+
if_block = create_if_block_1(ctx);
|
|
1227
|
+
if_block.c();
|
|
1228
|
+
internal.transition_in(if_block, 1);
|
|
1229
|
+
if_block.m(div, null);
|
|
1230
|
+
}
|
|
1231
|
+
} else if (if_block) {
|
|
1232
|
+
internal.group_outros();
|
|
1233
|
+
|
|
1234
|
+
internal.transition_out(if_block, 1, 1, () => {
|
|
1235
|
+
if_block = null;
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1238
|
+
internal.check_outros();
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
i(local) {
|
|
1242
|
+
if (current) return;
|
|
1243
|
+
internal.transition_in(if_block);
|
|
1244
|
+
current = true;
|
|
1245
|
+
},
|
|
1246
|
+
o(local) {
|
|
1247
|
+
internal.transition_out(if_block);
|
|
1248
|
+
current = false;
|
|
1249
|
+
},
|
|
1250
|
+
d(detaching) {
|
|
1251
|
+
if (detaching) internal.detach(div);
|
|
1252
|
+
if (if_block) if_block.d();
|
|
1253
|
+
div_resize_listener();
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
// (43:4) {#if clientWidth !== 0}
|
|
1259
|
+
function create_if_block_1(ctx) {
|
|
1211
1260
|
let div;
|
|
1212
1261
|
let currentfloor;
|
|
1213
1262
|
let t;
|
|
1214
1263
|
let camera;
|
|
1215
|
-
let style_width = `${/*contentWidth*/ ctx[
|
|
1216
|
-
let style_height = `${/*contentHeight*/ ctx[
|
|
1264
|
+
let style_width = `${/*contentWidth*/ ctx[8]}px`;
|
|
1265
|
+
let style_height = `${/*contentHeight*/ ctx[11]}px`;
|
|
1217
1266
|
let current;
|
|
1218
1267
|
|
|
1219
1268
|
const currentfloor_spread_levels = [
|
|
1220
1269
|
{
|
|
1221
1270
|
five: /*five*/ ctx[0],
|
|
1222
|
-
pxmm: /*pxmm*/ ctx[
|
|
1223
|
-
floorIndex: /*floorIndex*/ ctx[
|
|
1224
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
1225
|
-
hoverEnable: /*hoverEnable*/ ctx[
|
|
1226
|
-
extraObjects: /*extraObjects*/ ctx[
|
|
1271
|
+
pxmm: /*pxmm*/ ctx[9],
|
|
1272
|
+
floorIndex: /*floorIndex*/ ctx[10],
|
|
1273
|
+
floorplanData: /*floorplanData*/ ctx[3],
|
|
1274
|
+
hoverEnable: /*hoverEnable*/ ctx[2],
|
|
1275
|
+
extraObjects: /*extraObjects*/ ctx[5]
|
|
1227
1276
|
}
|
|
1228
1277
|
];
|
|
1229
1278
|
|
|
@@ -1237,10 +1286,10 @@ function create_if_block(ctx) {
|
|
|
1237
1286
|
|
|
1238
1287
|
const camera_spread_levels = [
|
|
1239
1288
|
{
|
|
1240
|
-
pxmm: /*pxmm*/ ctx[
|
|
1289
|
+
pxmm: /*pxmm*/ ctx[9],
|
|
1241
1290
|
five: /*five*/ ctx[0],
|
|
1242
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
1243
|
-
cameraImageUrl: /*cameraImageUrl*/ ctx[
|
|
1291
|
+
floorplanData: /*floorplanData*/ ctx[3],
|
|
1292
|
+
cameraImageUrl: /*cameraImageUrl*/ ctx[4]
|
|
1244
1293
|
}
|
|
1245
1294
|
];
|
|
1246
1295
|
|
|
@@ -1258,7 +1307,7 @@ function create_if_block(ctx) {
|
|
|
1258
1307
|
internal.create_component(currentfloor.$$.fragment);
|
|
1259
1308
|
t = internal.space();
|
|
1260
1309
|
internal.create_component(camera.$$.fragment);
|
|
1261
|
-
internal.attr(div, "class", "plugin-floorplan-radar-container svelte-
|
|
1310
|
+
internal.attr(div, "class", "plugin-floorplan-radar-container svelte-1mvqyqq");
|
|
1262
1311
|
internal.set_style(div, "width", style_width, false);
|
|
1263
1312
|
internal.set_style(div, "height", style_height, false);
|
|
1264
1313
|
},
|
|
@@ -1270,39 +1319,39 @@ function create_if_block(ctx) {
|
|
|
1270
1319
|
current = true;
|
|
1271
1320
|
},
|
|
1272
1321
|
p(ctx, dirty) {
|
|
1273
|
-
const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, hoverEnable, extraObjects*/
|
|
1322
|
+
const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, hoverEnable, extraObjects*/ 1581)
|
|
1274
1323
|
? internal.get_spread_update(currentfloor_spread_levels, [
|
|
1275
1324
|
{
|
|
1276
1325
|
five: /*five*/ ctx[0],
|
|
1277
|
-
pxmm: /*pxmm*/ ctx[
|
|
1278
|
-
floorIndex: /*floorIndex*/ ctx[
|
|
1279
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
1280
|
-
hoverEnable: /*hoverEnable*/ ctx[
|
|
1281
|
-
extraObjects: /*extraObjects*/ ctx[
|
|
1326
|
+
pxmm: /*pxmm*/ ctx[9],
|
|
1327
|
+
floorIndex: /*floorIndex*/ ctx[10],
|
|
1328
|
+
floorplanData: /*floorplanData*/ ctx[3],
|
|
1329
|
+
hoverEnable: /*hoverEnable*/ ctx[2],
|
|
1330
|
+
extraObjects: /*extraObjects*/ ctx[5]
|
|
1282
1331
|
}
|
|
1283
1332
|
])
|
|
1284
1333
|
: {};
|
|
1285
1334
|
|
|
1286
1335
|
currentfloor.$set(currentfloor_changes);
|
|
1287
1336
|
|
|
1288
|
-
const camera_changes = (dirty & /*pxmm, five, floorplanData, cameraImageUrl*/
|
|
1337
|
+
const camera_changes = (dirty & /*pxmm, five, floorplanData, cameraImageUrl*/ 537)
|
|
1289
1338
|
? internal.get_spread_update(camera_spread_levels, [
|
|
1290
1339
|
{
|
|
1291
|
-
pxmm: /*pxmm*/ ctx[
|
|
1340
|
+
pxmm: /*pxmm*/ ctx[9],
|
|
1292
1341
|
five: /*five*/ ctx[0],
|
|
1293
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
1294
|
-
cameraImageUrl: /*cameraImageUrl*/ ctx[
|
|
1342
|
+
floorplanData: /*floorplanData*/ ctx[3],
|
|
1343
|
+
cameraImageUrl: /*cameraImageUrl*/ ctx[4]
|
|
1295
1344
|
}
|
|
1296
1345
|
])
|
|
1297
1346
|
: {};
|
|
1298
1347
|
|
|
1299
1348
|
camera.$set(camera_changes);
|
|
1300
1349
|
|
|
1301
|
-
if (dirty & /*contentWidth*/
|
|
1350
|
+
if (dirty & /*contentWidth*/ 256 && style_width !== (style_width = `${/*contentWidth*/ ctx[8]}px`)) {
|
|
1302
1351
|
internal.set_style(div, "width", style_width, false);
|
|
1303
1352
|
}
|
|
1304
1353
|
|
|
1305
|
-
if (dirty & /*contentHeight*/
|
|
1354
|
+
if (dirty & /*contentHeight*/ 2048 && style_height !== (style_height = `${/*contentHeight*/ ctx[11]}px`)) {
|
|
1306
1355
|
internal.set_style(div, "height", style_height, false);
|
|
1307
1356
|
}
|
|
1308
1357
|
},
|
|
@@ -1326,37 +1375,33 @@ function create_if_block(ctx) {
|
|
|
1326
1375
|
}
|
|
1327
1376
|
|
|
1328
1377
|
function create_fragment(ctx) {
|
|
1329
|
-
let
|
|
1330
|
-
let div_resize_listener;
|
|
1378
|
+
let if_block_anchor;
|
|
1331
1379
|
let current;
|
|
1332
|
-
let if_block = /*
|
|
1380
|
+
let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
|
|
1333
1381
|
|
|
1334
1382
|
return {
|
|
1335
1383
|
c() {
|
|
1336
|
-
div = internal.element("div");
|
|
1337
1384
|
if (if_block) if_block.c();
|
|
1338
|
-
internal.
|
|
1339
|
-
internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[11].call(div));
|
|
1385
|
+
if_block_anchor = internal.empty();
|
|
1340
1386
|
},
|
|
1341
1387
|
m(target, anchor) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[11].bind(div));
|
|
1388
|
+
if (if_block) if_block.m(target, anchor);
|
|
1389
|
+
internal.insert(target, if_block_anchor, anchor);
|
|
1345
1390
|
current = true;
|
|
1346
1391
|
},
|
|
1347
1392
|
p(ctx, [dirty]) {
|
|
1348
|
-
if (/*
|
|
1393
|
+
if (/*visible*/ ctx[1]) {
|
|
1349
1394
|
if (if_block) {
|
|
1350
1395
|
if_block.p(ctx, dirty);
|
|
1351
1396
|
|
|
1352
|
-
if (dirty & /*
|
|
1397
|
+
if (dirty & /*visible*/ 2) {
|
|
1353
1398
|
internal.transition_in(if_block, 1);
|
|
1354
1399
|
}
|
|
1355
1400
|
} else {
|
|
1356
1401
|
if_block = create_if_block(ctx);
|
|
1357
1402
|
if_block.c();
|
|
1358
1403
|
internal.transition_in(if_block, 1);
|
|
1359
|
-
if_block.m(
|
|
1404
|
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
1360
1405
|
}
|
|
1361
1406
|
} else if (if_block) {
|
|
1362
1407
|
internal.group_outros();
|
|
@@ -1378,15 +1423,15 @@ function create_fragment(ctx) {
|
|
|
1378
1423
|
current = false;
|
|
1379
1424
|
},
|
|
1380
1425
|
d(detaching) {
|
|
1381
|
-
if (
|
|
1382
|
-
if (
|
|
1383
|
-
div_resize_listener();
|
|
1426
|
+
if (if_block) if_block.d(detaching);
|
|
1427
|
+
if (detaching) internal.detach(if_block_anchor);
|
|
1384
1428
|
}
|
|
1385
1429
|
};
|
|
1386
1430
|
}
|
|
1387
1431
|
|
|
1388
1432
|
function instance($$self, $$props, $$invalidate) {
|
|
1389
1433
|
let { five } = $$props;
|
|
1434
|
+
let { visible } = $$props;
|
|
1390
1435
|
let { hoverEnable } = $$props;
|
|
1391
1436
|
let { floorplanData } = $$props;
|
|
1392
1437
|
let { cameraImageUrl } = $$props;
|
|
@@ -1399,7 +1444,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1399
1444
|
let contentHeight = 0;
|
|
1400
1445
|
|
|
1401
1446
|
function handlePanoArrived(panoIndex) {
|
|
1402
|
-
$$invalidate(
|
|
1447
|
+
$$invalidate(10, floorIndex = five.work.observers[panoIndex].floorIndex);
|
|
1403
1448
|
}
|
|
1404
1449
|
|
|
1405
1450
|
svelte.onMount(() => {
|
|
@@ -1413,20 +1458,21 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1413
1458
|
function div_elementresize_handler() {
|
|
1414
1459
|
clientWidth = this.clientWidth;
|
|
1415
1460
|
clientHeight = this.clientHeight;
|
|
1416
|
-
$$invalidate(
|
|
1417
|
-
$$invalidate(
|
|
1461
|
+
$$invalidate(6, clientWidth);
|
|
1462
|
+
$$invalidate(7, clientHeight);
|
|
1418
1463
|
}
|
|
1419
1464
|
|
|
1420
1465
|
$$self.$$set = $$props => {
|
|
1421
1466
|
if ('five' in $$props) $$invalidate(0, five = $$props.five);
|
|
1422
|
-
if ('
|
|
1423
|
-
if ('
|
|
1424
|
-
if ('
|
|
1425
|
-
if ('
|
|
1467
|
+
if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
|
|
1468
|
+
if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
|
|
1469
|
+
if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
|
|
1470
|
+
if ('cameraImageUrl' in $$props) $$invalidate(4, cameraImageUrl = $$props.cameraImageUrl);
|
|
1471
|
+
if ('extraObjects' in $$props) $$invalidate(5, extraObjects = $$props.extraObjects);
|
|
1426
1472
|
};
|
|
1427
1473
|
|
|
1428
1474
|
$$self.$$.update = () => {
|
|
1429
|
-
if ($$self.$$.dirty & /*clientWidth, clientHeight, floorplanData, contentWidth*/
|
|
1475
|
+
if ($$self.$$.dirty & /*clientWidth, clientHeight, floorplanData, contentWidth*/ 456) {
|
|
1430
1476
|
{
|
|
1431
1477
|
const size = Math.min(clientWidth, clientHeight);
|
|
1432
1478
|
const { max, min } = floorplanData.bounding;
|
|
@@ -1438,15 +1484,16 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1438
1484
|
return [size / boundingHeight * boundingWidth, size];
|
|
1439
1485
|
})();
|
|
1440
1486
|
|
|
1441
|
-
$$invalidate(
|
|
1442
|
-
$$invalidate(
|
|
1443
|
-
$$invalidate(
|
|
1487
|
+
$$invalidate(8, contentWidth = contentSize[0]);
|
|
1488
|
+
$$invalidate(11, contentHeight = contentSize[1]);
|
|
1489
|
+
$$invalidate(9, pxmm = contentWidth / boundingWidth);
|
|
1444
1490
|
}
|
|
1445
1491
|
}
|
|
1446
1492
|
};
|
|
1447
1493
|
|
|
1448
1494
|
return [
|
|
1449
1495
|
five,
|
|
1496
|
+
visible,
|
|
1450
1497
|
hoverEnable,
|
|
1451
1498
|
floorplanData,
|
|
1452
1499
|
cameraImageUrl,
|
|
@@ -1473,16 +1520,155 @@ class Main extends internal.SvelteComponent {
|
|
|
1473
1520
|
internal.safe_not_equal,
|
|
1474
1521
|
{
|
|
1475
1522
|
five: 0,
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1523
|
+
visible: 1,
|
|
1524
|
+
hoverEnable: 2,
|
|
1525
|
+
floorplanData: 3,
|
|
1526
|
+
cameraImageUrl: 4,
|
|
1527
|
+
extraObjects: 5
|
|
1480
1528
|
},
|
|
1481
1529
|
add_css
|
|
1482
1530
|
);
|
|
1483
1531
|
}
|
|
1484
1532
|
}
|
|
1485
1533
|
|
|
1534
|
+
/**
|
|
1535
|
+
* 检查一个值是否是狭义上的对象
|
|
1536
|
+
* @param {any} value 要检查的值
|
|
1537
|
+
*
|
|
1538
|
+
* isTruelyObject({})
|
|
1539
|
+
* // => true
|
|
1540
|
+
*
|
|
1541
|
+
* isObjectLike([1, 2, 3])
|
|
1542
|
+
* // => false
|
|
1543
|
+
*
|
|
1544
|
+
* isObjectLike(Function)
|
|
1545
|
+
* // => false
|
|
1546
|
+
*
|
|
1547
|
+
* isObjectLike(null)
|
|
1548
|
+
* // => false
|
|
1549
|
+
*
|
|
1550
|
+
*/
|
|
1551
|
+
function isTruelyObject(value) {
|
|
1552
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
1556
|
+
function baseIsEqual(value, other) {
|
|
1557
|
+
if (value === other)
|
|
1558
|
+
return true;
|
|
1559
|
+
if (typeof value !== typeof other)
|
|
1560
|
+
return false;
|
|
1561
|
+
if (Number.isNaN(value) && Number.isNaN(other))
|
|
1562
|
+
return true;
|
|
1563
|
+
return false;
|
|
1564
|
+
}
|
|
1565
|
+
function objEqualShallow(value, other) {
|
|
1566
|
+
const valueProps = Object.getOwnPropertyNames(value);
|
|
1567
|
+
const otherProps = Object.getOwnPropertyNames(other);
|
|
1568
|
+
if (valueProps.length !== otherProps.length)
|
|
1569
|
+
return false;
|
|
1570
|
+
for (let i = 0, len = valueProps.length; i < len; i++) {
|
|
1571
|
+
const propName = valueProps[i];
|
|
1572
|
+
if (!baseIsEqual(value[propName], other[propName]))
|
|
1573
|
+
return false;
|
|
1574
|
+
}
|
|
1575
|
+
return true;
|
|
1576
|
+
}
|
|
1577
|
+
function arrayEqualShallow(value, other) {
|
|
1578
|
+
if (value.length !== other.length)
|
|
1579
|
+
return false;
|
|
1580
|
+
for (let i = 0, len = value.length; i < len; i++) {
|
|
1581
|
+
if (!baseIsEqual(value[i], other[i]))
|
|
1582
|
+
return false;
|
|
1583
|
+
}
|
|
1584
|
+
return true;
|
|
1585
|
+
}
|
|
1586
|
+
function isShallowEqual(value, other) {
|
|
1587
|
+
if (baseIsEqual(value, other))
|
|
1588
|
+
return true;
|
|
1589
|
+
if (isTruelyObject(value) && isTruelyObject(other))
|
|
1590
|
+
return objEqualShallow(value, other);
|
|
1591
|
+
if (Array.isArray(value) && Array.isArray(other))
|
|
1592
|
+
return arrayEqualShallow(value, other);
|
|
1593
|
+
return false;
|
|
1594
|
+
}
|
|
1595
|
+
function isDeepEqual(value, other) {
|
|
1596
|
+
if (baseIsEqual(value, other))
|
|
1597
|
+
return true;
|
|
1598
|
+
if (isTruelyObject(value) && isTruelyObject(other))
|
|
1599
|
+
return objEqualDeep(value, other);
|
|
1600
|
+
if (Array.isArray(value) && Array.isArray(other))
|
|
1601
|
+
return arrayEqualDeep(value, other);
|
|
1602
|
+
return false;
|
|
1603
|
+
}
|
|
1604
|
+
function arrayEqualDeep(value, other) {
|
|
1605
|
+
if (value.length !== other.length)
|
|
1606
|
+
return false;
|
|
1607
|
+
for (let i = 0, len = value.length; i < len; i++) {
|
|
1608
|
+
if (!isDeepEqual(value[i], other[i]))
|
|
1609
|
+
return false;
|
|
1610
|
+
}
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
function objEqualDeep(value, other) {
|
|
1614
|
+
const valueProps = Object.getOwnPropertyNames(value);
|
|
1615
|
+
const otherProps = Object.getOwnPropertyNames(other);
|
|
1616
|
+
if (valueProps.length !== otherProps.length)
|
|
1617
|
+
return false;
|
|
1618
|
+
for (let i = 0, len = valueProps.length; i < len; i++) {
|
|
1619
|
+
const propName = valueProps[i];
|
|
1620
|
+
if (!isDeepEqual(value[propName], other[propName]))
|
|
1621
|
+
return false;
|
|
1622
|
+
}
|
|
1623
|
+
return true;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* 对象比较
|
|
1627
|
+
* @param {*} value 第一个比较的值
|
|
1628
|
+
* @param {*} other 第二个比较的值
|
|
1629
|
+
* @param {Object} options 可选参数,可选项包括:<br />
|
|
1630
|
+
* deep {Boolean} 是否深比较<br />
|
|
1631
|
+
* @returns {boolean} 是否相等
|
|
1632
|
+
*/
|
|
1633
|
+
function equal(value, other, opt = { deep: false }) {
|
|
1634
|
+
if (!opt.deep)
|
|
1635
|
+
return isShallowEqual(value, other);
|
|
1636
|
+
return isDeepEqual(value, other);
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* plugin 的基本控制器
|
|
1641
|
+
*/
|
|
1642
|
+
class Controller$2 {
|
|
1643
|
+
constructor(five$1) {
|
|
1644
|
+
Object.defineProperty(this, "five", {
|
|
1645
|
+
enumerable: true,
|
|
1646
|
+
configurable: true,
|
|
1647
|
+
writable: true,
|
|
1648
|
+
value: void 0
|
|
1649
|
+
});
|
|
1650
|
+
/**
|
|
1651
|
+
* 插件事件钩子
|
|
1652
|
+
*/
|
|
1653
|
+
Object.defineProperty(this, "hooks", {
|
|
1654
|
+
enumerable: true,
|
|
1655
|
+
configurable: true,
|
|
1656
|
+
writable: true,
|
|
1657
|
+
value: new five.Subscribe()
|
|
1658
|
+
});
|
|
1659
|
+
this.five = five$1;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态
|
|
1663
|
+
*/
|
|
1664
|
+
getCurrentState() {
|
|
1665
|
+
return this.state;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
class Controller$1 extends Controller$2 {
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1486
1672
|
const FLOORPLAN_EXTRA_OBJECT_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC';
|
|
1487
1673
|
|
|
1488
1674
|
async function formatOutlines(outlines) {
|
|
@@ -1578,31 +1764,105 @@ function formatExtraObjects(data, five, floorplanData) {
|
|
|
1578
1764
|
return extraObjects;
|
|
1579
1765
|
}
|
|
1580
1766
|
|
|
1581
|
-
class
|
|
1582
|
-
app;
|
|
1583
|
-
five;
|
|
1584
|
-
wrapperSelector = '';
|
|
1585
|
-
data;
|
|
1586
|
-
wrapper = null;
|
|
1587
|
-
extraObjects;
|
|
1588
|
-
originExtraObjects;
|
|
1589
|
-
configs = {};
|
|
1767
|
+
class Controller extends Controller$1 {
|
|
1590
1768
|
constructor(five, params) {
|
|
1769
|
+
super(five);
|
|
1770
|
+
// =============== public properties =================
|
|
1771
|
+
Object.defineProperty(this, "name", {
|
|
1772
|
+
enumerable: true,
|
|
1773
|
+
configurable: true,
|
|
1774
|
+
writable: true,
|
|
1775
|
+
value: 'panoFloorplanRadarPlugin'
|
|
1776
|
+
});
|
|
1777
|
+
Object.defineProperty(this, "state", {
|
|
1778
|
+
enumerable: true,
|
|
1779
|
+
configurable: true,
|
|
1780
|
+
writable: true,
|
|
1781
|
+
value: void 0
|
|
1782
|
+
});
|
|
1783
|
+
// =============== protected properties =================
|
|
1784
|
+
Object.defineProperty(this, "data", {
|
|
1785
|
+
enumerable: true,
|
|
1786
|
+
configurable: true,
|
|
1787
|
+
writable: true,
|
|
1788
|
+
value: void 0
|
|
1789
|
+
});
|
|
1790
|
+
// =============== private properties =================
|
|
1791
|
+
Object.defineProperty(this, "app", {
|
|
1792
|
+
enumerable: true,
|
|
1793
|
+
configurable: true,
|
|
1794
|
+
writable: true,
|
|
1795
|
+
value: void 0
|
|
1796
|
+
});
|
|
1797
|
+
Object.defineProperty(this, "wrapperSelector", {
|
|
1798
|
+
enumerable: true,
|
|
1799
|
+
configurable: true,
|
|
1800
|
+
writable: true,
|
|
1801
|
+
value: ''
|
|
1802
|
+
});
|
|
1803
|
+
Object.defineProperty(this, "wrapper", {
|
|
1804
|
+
enumerable: true,
|
|
1805
|
+
configurable: true,
|
|
1806
|
+
writable: true,
|
|
1807
|
+
value: null
|
|
1808
|
+
});
|
|
1809
|
+
Object.defineProperty(this, "disposed", {
|
|
1810
|
+
enumerable: true,
|
|
1811
|
+
configurable: true,
|
|
1812
|
+
writable: true,
|
|
1813
|
+
value: false
|
|
1814
|
+
});
|
|
1815
|
+
Object.defineProperty(this, "extraObjects", {
|
|
1816
|
+
enumerable: true,
|
|
1817
|
+
configurable: true,
|
|
1818
|
+
writable: true,
|
|
1819
|
+
value: []
|
|
1820
|
+
});
|
|
1821
|
+
Object.defineProperty(this, "dispose", {
|
|
1822
|
+
enumerable: true,
|
|
1823
|
+
configurable: true,
|
|
1824
|
+
writable: true,
|
|
1825
|
+
value: () => {
|
|
1826
|
+
var _a;
|
|
1827
|
+
this.disposed = true;
|
|
1828
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
1829
|
+
this.wrapper = null;
|
|
1830
|
+
this.wrapperSelector = '';
|
|
1831
|
+
this.hooks.emit('dispose');
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
Object.defineProperty(this, "_disable", {
|
|
1835
|
+
enumerable: true,
|
|
1836
|
+
configurable: true,
|
|
1837
|
+
writable: true,
|
|
1838
|
+
value: (options) => {
|
|
1839
|
+
var _a;
|
|
1840
|
+
const { userAction } = options;
|
|
1841
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
1842
|
+
this.app = undefined;
|
|
1843
|
+
this.hooks.emit('disable', { userAction });
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1591
1846
|
this.five = five;
|
|
1592
|
-
|
|
1593
|
-
|
|
1847
|
+
// =============== init State ===============
|
|
1848
|
+
const baseConfig = {
|
|
1849
|
+
hoverEnable: false,
|
|
1850
|
+
cameraImageUrl: CAMERA_IMAGE,
|
|
1851
|
+
};
|
|
1852
|
+
const paramsConfig = (params === null || params === void 0 ? void 0 : params.configs) ? params.configs : {};
|
|
1853
|
+
const config = Object.assign(Object.assign({}, baseConfig), paramsConfig);
|
|
1854
|
+
this.state = { enabled: true, visible: true, config };
|
|
1855
|
+
// =============== init wrapper ===============
|
|
1856
|
+
if (params === null || params === void 0 ? void 0 : params.wrapper)
|
|
1857
|
+
console.warn('不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法');
|
|
1858
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.wrapper) === 'string')
|
|
1594
1859
|
this.wrapperSelector = params.wrapper;
|
|
1595
|
-
else if (params
|
|
1860
|
+
else if ((params === null || params === void 0 ? void 0 : params.wrapper) instanceof Element)
|
|
1596
1861
|
this.wrapper = params.wrapper;
|
|
1862
|
+
// =============== init Listener ===============
|
|
1597
1863
|
five.once('dispose', this.dispose);
|
|
1598
1864
|
}
|
|
1599
|
-
|
|
1600
|
-
this.app?.$destroy();
|
|
1601
|
-
};
|
|
1602
|
-
load = async (data) => {
|
|
1603
|
-
const copyData = JSON.parse(JSON.stringify(data));
|
|
1604
|
-
const floorplanData = await formatData(copyData);
|
|
1605
|
-
this.data = floorplanData;
|
|
1865
|
+
async load(serverData, state, userAction = true) {
|
|
1606
1866
|
// const loadImage = async () => {
|
|
1607
1867
|
// const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
|
|
1608
1868
|
// // 当有 svgString 时,没有加载过程
|
|
@@ -1618,55 +1878,130 @@ class PanoFloorplanRadarPluginController {
|
|
|
1618
1878
|
// })
|
|
1619
1879
|
// }
|
|
1620
1880
|
// await loadImage()
|
|
1881
|
+
function isPluginServerData(serverData) {
|
|
1882
|
+
return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
|
|
1883
|
+
}
|
|
1884
|
+
const copyData = JSON.parse(JSON.stringify(serverData));
|
|
1885
|
+
const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
|
|
1886
|
+
const prevData = this.data;
|
|
1887
|
+
this.data = await formatData(_serverData);
|
|
1888
|
+
this.hooks.emit('dataLoaded', this.data);
|
|
1889
|
+
this.hooks.emit('dataChange', this.data, prevData);
|
|
1890
|
+
if (state)
|
|
1891
|
+
this.updateState(state, userAction);
|
|
1621
1892
|
this.render();
|
|
1622
|
-
}
|
|
1893
|
+
}
|
|
1894
|
+
async show(options = {}) {
|
|
1895
|
+
// 已经展示完成了,不做任何操作
|
|
1896
|
+
if (this.state.visible)
|
|
1897
|
+
return;
|
|
1898
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
1899
|
+
this.updateState({ visible: true }, userAction);
|
|
1900
|
+
this._show({ userAction });
|
|
1901
|
+
}
|
|
1902
|
+
async hide(options = {}) {
|
|
1903
|
+
if (!this.state.visible)
|
|
1904
|
+
return;
|
|
1905
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
1906
|
+
this.updateState({ visible: false }, userAction);
|
|
1907
|
+
this._hide({ userAction });
|
|
1908
|
+
}
|
|
1909
|
+
enable(options = {}) {
|
|
1910
|
+
if (this.state.enabled)
|
|
1911
|
+
return;
|
|
1912
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
1913
|
+
this.updateState({ enabled: true }, options.userAction || userAction);
|
|
1914
|
+
this._enable({ userAction });
|
|
1915
|
+
}
|
|
1916
|
+
disable(options = {}) {
|
|
1917
|
+
if (!this.state.enabled)
|
|
1918
|
+
return;
|
|
1919
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
1920
|
+
this.updateState({ enabled: false }, options.userAction || userAction);
|
|
1921
|
+
this._disable({ userAction });
|
|
1922
|
+
}
|
|
1923
|
+
/** 更改插件 State */
|
|
1924
|
+
setState(state, options = {}) {
|
|
1925
|
+
const prevState = this.state;
|
|
1926
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
1927
|
+
this.updateState(state, userAction);
|
|
1928
|
+
if (state.enabled !== undefined && prevState.enabled !== state.enabled) {
|
|
1929
|
+
const options = { userAction };
|
|
1930
|
+
state.enabled ? this._enable(options) : this._disable(options);
|
|
1931
|
+
}
|
|
1932
|
+
if (state.visible !== undefined && prevState.visible !== state.visible) {
|
|
1933
|
+
const options = { userAction };
|
|
1934
|
+
state.visible ? this._show(options) : this._hide(options);
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1623
1937
|
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
1624
1938
|
appendTo(wrapper) {
|
|
1625
1939
|
this.wrapper = wrapper;
|
|
1626
1940
|
this.render();
|
|
1627
1941
|
}
|
|
1628
|
-
changeConfigs(
|
|
1629
|
-
|
|
1942
|
+
changeConfigs(config, userAction = true) {
|
|
1943
|
+
this.setState({ config }, { userAction });
|
|
1630
1944
|
this.render();
|
|
1631
1945
|
}
|
|
1632
1946
|
setExtraObjectsWith3DPositions(data) {
|
|
1633
|
-
this.originExtraObjects = data;
|
|
1634
1947
|
if (!this.data)
|
|
1635
1948
|
return;
|
|
1636
1949
|
this.extraObjects = formatExtraObjects(data, this.five, this.data);
|
|
1637
1950
|
this.render();
|
|
1638
1951
|
}
|
|
1952
|
+
async formatData(serverData) {
|
|
1953
|
+
return await formatData(serverData.data);
|
|
1954
|
+
}
|
|
1955
|
+
_enable(options) {
|
|
1956
|
+
const { userAction } = options;
|
|
1957
|
+
this.hooks.emit('enable', { userAction });
|
|
1958
|
+
if (this.state.visible)
|
|
1959
|
+
this._show({ userAction });
|
|
1960
|
+
}
|
|
1961
|
+
_show(options) {
|
|
1962
|
+
if (this.disposed)
|
|
1963
|
+
return;
|
|
1964
|
+
if (!this.state.enabled)
|
|
1965
|
+
return;
|
|
1966
|
+
const { userAction } = options;
|
|
1967
|
+
this.hooks.emit('show', { userAction });
|
|
1968
|
+
this.render();
|
|
1969
|
+
}
|
|
1970
|
+
_hide(options) {
|
|
1971
|
+
if (this.disposed)
|
|
1972
|
+
return;
|
|
1973
|
+
if (!this.state.enabled)
|
|
1974
|
+
return;
|
|
1975
|
+
const { userAction } = options;
|
|
1976
|
+
this.hooks.emit('hide', { userAction });
|
|
1977
|
+
this.render();
|
|
1978
|
+
}
|
|
1979
|
+
updateState(state, userAction) {
|
|
1980
|
+
const prevState = this.state;
|
|
1981
|
+
this.state = Object.assign(Object.assign({}, this.state), state);
|
|
1982
|
+
if (equal(this.state, prevState, { deep: true }))
|
|
1983
|
+
return;
|
|
1984
|
+
this.hooks.emit('stateChange', { state: this.state, prevState, userAction });
|
|
1985
|
+
}
|
|
1639
1986
|
render() {
|
|
1987
|
+
if (this.disposed)
|
|
1988
|
+
return;
|
|
1989
|
+
if (!this.state.enabled)
|
|
1990
|
+
return;
|
|
1640
1991
|
// 处理 wrapper
|
|
1641
|
-
if (!this.wrapper) {
|
|
1992
|
+
if (!this.wrapper && this.wrapperSelector) {
|
|
1642
1993
|
const _wrapper = document.querySelector(this.wrapperSelector);
|
|
1643
1994
|
this.wrapper = _wrapper;
|
|
1644
1995
|
}
|
|
1645
1996
|
if (!this.data || !this.wrapper)
|
|
1646
1997
|
return;
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
}
|
|
1650
|
-
const props = {
|
|
1651
|
-
five: this.five,
|
|
1652
|
-
floorplanData: this.data,
|
|
1653
|
-
extraObjects: this.extraObjects,
|
|
1654
|
-
cameraImageUrl: this.configs.cameraImageUrl,
|
|
1655
|
-
hoverEnable: this.configs.hoverEnable ?? false,
|
|
1656
|
-
};
|
|
1657
|
-
if (!this.app) {
|
|
1658
|
-
this.app = new Main({
|
|
1659
|
-
target: this.wrapper,
|
|
1660
|
-
props,
|
|
1661
|
-
});
|
|
1662
|
-
return;
|
|
1663
|
-
}
|
|
1664
|
-
this.app.$set(props);
|
|
1998
|
+
const props = Object.assign(Object.assign({}, this.state.config), { five: this.five, floorplanData: this.data, visible: this.state.visible, extraObjects: this.extraObjects });
|
|
1999
|
+
this.app ? this.app.$set(props) : (this.app = new Main({ target: this.wrapper, props }));
|
|
1665
2000
|
}
|
|
1666
2001
|
}
|
|
1667
2002
|
|
|
1668
2003
|
const PanoFloorplanRadarPlugin = (five, params) => {
|
|
1669
|
-
return new
|
|
2004
|
+
return new Controller(five, params);
|
|
1670
2005
|
};
|
|
1671
2006
|
|
|
1672
2007
|
exports.PanoFloorplanRadarPlugin = PanoFloorplanRadarPlugin;
|