@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.22
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/CHANGELOG.md +78 -0
- package/README.md +93 -4
- package/TERMS.txt +56 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.js +143 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +201 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +668 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
- package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/dist/ModelRoomLabelPlugin/index.js +505 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +4 -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/index.d.ts +17 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +51 -0
- package/dist/PanoCompassPlugin/index.js +635 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/dist/PanoMeasurePlugin/index.d.ts +7 -0
- package/dist/PanoMeasurePlugin/index.js +5531 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.js +612 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/dist/PanoSpatialTagPlugin/index.js +1294 -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/floorplan/Assets/camera.d.ts +1 -0
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/Assets/compass.d.ts +0 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +105 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4034 -0
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1642 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +75 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3646 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/typings/floorplanData.d.ts +137 -0
- package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
- package/dist/floorplan/typings/utility.d.ts +2 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +15138 -0
- package/dist/index.js +15180 -0
- package/dist/index.umd.js +15173 -0
- package/dist/shared-utils/Preloader.d.ts +6 -0
- package/dist/shared-utils/Subscribe.d.ts +45 -0
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/dist/shared-utils/animationFrame/index.d.ts +15 -0
- package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
- package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/dist/shared-utils/createLine/index.d.ts +3 -0
- package/dist/shared-utils/debounce.d.ts +6 -0
- package/dist/shared-utils/equal.d.ts +11 -0
- package/dist/shared-utils/filter.d.ts +27 -0
- package/dist/shared-utils/five/changeMode.d.ts +2 -0
- package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +11 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/isNil.d.ts +10 -0
- package/dist/shared-utils/isTruelyObject.d.ts +18 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/planimetry.d.ts +116 -0
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
- package/dist/shared-utils/nearlyEqual.d.ts +7 -0
- package/dist/shared-utils/nextFrame.d.ts +1 -0
- package/dist/shared-utils/noop.d.ts +5 -0
- package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/dist/shared-utils/px2rem.d.ts +1 -0
- package/dist/shared-utils/removeArrayItem.d.ts +7 -0
- package/dist/shared-utils/tap.d.ts +8 -0
- package/dist/shared-utils/three/centerPoint.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/dist/shared-utils/three/getNormal.d.ts +2 -0
- package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
- package/dist/shared-utils/three/loadTexture.d.ts +2 -0
- package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
- package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/dist/shared-utils/throttle.d.ts +7 -0
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/to.d.ts +8 -0
- package/dist/shared-utils/useDebounce.d.ts +8 -0
- package/dist/shared-utils/useThrottle.d.ts +8 -0
- package/dist/shared-utils/uuid.d.ts +4 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/dist/typings/math.type.d.ts +44 -0
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/ModelRoomLabelController.html +20 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ModelFloorplanErrorType.html +1 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
- package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
- 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 -0
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -0
- package/docs/modules.html +28 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
- package/libs/CSS3DRenderPlugin/index.js +27 -26
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +2 -2
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +13 -9
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +120 -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 +67 -25
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +255 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/index.js +254 -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/index.js +6 -6
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
- package/libs/PanoCompassPlugin/index.d.ts +51 -0
- package/libs/PanoCompassPlugin/index.js +253 -0
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +124 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.js +329 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +64 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +305 -0
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +265 -0
- package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/libs/PanoMeasurePlugin/Model/index.js +139 -0
- package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/libs/PanoMeasurePlugin/Model/line.js +114 -0
- package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/point.js +48 -0
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/polyline.js +65 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +48 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +110 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +148 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +70 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +102 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +79 -0
- package/libs/PanoMeasurePlugin/index.d.ts +7 -0
- package/libs/PanoMeasurePlugin/index.js +5 -0
- package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/data.js +1 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +115 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
- package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/line.js +33 -0
- package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/math.js +44 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +22 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
- package/libs/PanoRulerPlugin/index.d.ts +31 -0
- package/libs/PanoRulerPlugin/index.js +400 -0
- package/libs/PanoRulerPlugin/style.d.ts +2 -0
- package/libs/PanoRulerPlugin/style.js +88 -0
- package/libs/PanoRulerPlugin/typings.d.ts +21 -0
- package/libs/PanoRulerPlugin/typings.js +1 -0
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/libs/PanoSpatialTagPlugin/index.js +413 -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/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +119 -0
- package/libs/floorplan/Components/CurrentFloor.js +456 -0
- package/libs/floorplan/Components/Main.js +464 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +68 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +199 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +173 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/Components/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +4 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +455 -279
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +89 -37
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +30 -14
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +269 -118
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
- package/libs/floorplan/constant.d.ts +5 -0
- package/libs/floorplan/constant.js +6 -0
- package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +22 -9
- package/libs/index.js +11 -3
- 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/getPxmm.d.ts +6 -1
- package/libs/shared-utils/getPxmm.js +26 -12
- package/libs/shared-utils/math/evenNumber.js +1 -1
- 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/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +26 -13
- package/dist/dnalogel.cjs.js +0 -2
- package/dist/dnalogel.es.js +0 -37145
- package/dist/dnalogel.umd.js +0 -2
- package/dist/style.css +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
- package/libs/floorplan/Components/BaseImage.svelte +0 -25
- package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
- package/libs/floorplan/Components/Normalmage.svelte +0 -11
- package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
- package/libs/floorplan/Components/SvgImage.svelte +0 -25
- package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
|
@@ -0,0 +1,1642 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var internal = require('svelte/internal');
|
|
6
|
+
var svelte = require('svelte');
|
|
7
|
+
|
|
8
|
+
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==';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 创建一个防抖动函数,该函数在高频调用时会每隔 wait 毫秒后调用 func 方法
|
|
12
|
+
* `throttle` 会在第一次调用时立刻调用一次
|
|
13
|
+
* @param func - 要防抖动的函数
|
|
14
|
+
* @param wait - 需要延迟的毫秒数
|
|
15
|
+
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
function throttle(func, wait = 200) {
|
|
18
|
+
let last;
|
|
19
|
+
return function (...args) {
|
|
20
|
+
if (last)
|
|
21
|
+
return;
|
|
22
|
+
func(...args);
|
|
23
|
+
last = setTimeout(function () {
|
|
24
|
+
last = null;
|
|
25
|
+
}, wait);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* src/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
|
|
30
|
+
|
|
31
|
+
function add_css$7(target) {
|
|
32
|
+
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%}");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function create_fragment$8(ctx) {
|
|
36
|
+
let div2;
|
|
37
|
+
let div1;
|
|
38
|
+
let div0;
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
c() {
|
|
42
|
+
div2 = internal.element("div");
|
|
43
|
+
div1 = internal.element("div");
|
|
44
|
+
div0 = internal.element("div");
|
|
45
|
+
internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-1ty3s4p");
|
|
46
|
+
internal.set_style(div0, "background-image", "url(" + (/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE) + ")");
|
|
47
|
+
internal.set_style(div0, "transform", /*rotateTransform*/ ctx[1], false);
|
|
48
|
+
internal.attr(div1, "class", "plugin-radar__camera-position svelte-1ty3s4p");
|
|
49
|
+
internal.set_style(div1, "transform", /*positionTransform*/ ctx[2], false);
|
|
50
|
+
internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-1ty3s4p");
|
|
51
|
+
},
|
|
52
|
+
m(target, anchor) {
|
|
53
|
+
internal.insert(target, div2, anchor);
|
|
54
|
+
internal.append(div2, div1);
|
|
55
|
+
internal.append(div1, div0);
|
|
56
|
+
},
|
|
57
|
+
p(ctx, [dirty]) {
|
|
58
|
+
if (dirty & /*cameraImageUrl*/ 1) {
|
|
59
|
+
internal.set_style(div0, "background-image", "url(" + (/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE) + ")");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (dirty & /*rotateTransform*/ 2) {
|
|
63
|
+
internal.set_style(div0, "transform", /*rotateTransform*/ ctx[1], false);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (dirty & /*positionTransform*/ 4) {
|
|
67
|
+
internal.set_style(div1, "transform", /*positionTransform*/ ctx[2], false);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
i: internal.noop,
|
|
71
|
+
o: internal.noop,
|
|
72
|
+
d(detaching) {
|
|
73
|
+
if (detaching) internal.detach(div2);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function instance$8($$self, $$props, $$invalidate) {
|
|
79
|
+
let { five } = $$props;
|
|
80
|
+
let { pxmm } = $$props;
|
|
81
|
+
let { floorplanData } = $$props;
|
|
82
|
+
let { cameraImageUrl } = $$props;
|
|
83
|
+
|
|
84
|
+
/** 获取相机在当前 Five 状态下的位移 */
|
|
85
|
+
function getCameraPositionTransform(panoIndex) {
|
|
86
|
+
const observer = floorplanData.observers[panoIndex];
|
|
87
|
+
const bounding = floorplanData.bounding;
|
|
88
|
+
const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
|
|
89
|
+
const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
|
|
90
|
+
if (!observer) return '';
|
|
91
|
+
const left = Math.floor(observer.positionInImage.x * clientWidth);
|
|
92
|
+
const top = Math.floor(observer.positionInImage.y * clientHeight);
|
|
93
|
+
return `translate(${left}px, ${top}px)`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** 获取相机在当前 Five 状态下的旋转 */
|
|
97
|
+
function getCameraRotationTransform() {
|
|
98
|
+
const { longitude } = five.getCurrentState();
|
|
99
|
+
|
|
100
|
+
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
101
|
+
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
102
|
+
|
|
103
|
+
return `rotate(${rotate}deg)`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const changePosition = panoIndex => {
|
|
107
|
+
$$invalidate(2, positionTransform = getCameraPositionTransform(panoIndex));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const changeRotate = throttle(
|
|
111
|
+
() => {
|
|
112
|
+
$$invalidate(1, rotateTransform = getCameraRotationTransform());
|
|
113
|
+
},
|
|
114
|
+
1000 / 60
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
118
|
+
let rotateTransform = getCameraRotationTransform();
|
|
119
|
+
|
|
120
|
+
let positionTransform = getCameraPositionTransform(five.getCurrentState().panoIndex);
|
|
121
|
+
|
|
122
|
+
svelte.onMount(() => {
|
|
123
|
+
five.on('panoWillArrive', changePosition);
|
|
124
|
+
five.on('cameraDirectionUpdate', changeRotate);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
svelte.onDestroy(() => {
|
|
128
|
+
five.off('panoWillArrive', changePosition);
|
|
129
|
+
five.off('cameraDirectionUpdate', changeRotate);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
$$self.$$set = $$props => {
|
|
133
|
+
if ('five' in $$props) $$invalidate(3, five = $$props.five);
|
|
134
|
+
if ('pxmm' in $$props) $$invalidate(4, pxmm = $$props.pxmm);
|
|
135
|
+
if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
|
|
136
|
+
if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return [cameraImageUrl, rotateTransform, positionTransform, five, pxmm, floorplanData];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
class Camera extends internal.SvelteComponent {
|
|
143
|
+
constructor(options) {
|
|
144
|
+
super();
|
|
145
|
+
|
|
146
|
+
internal.init(
|
|
147
|
+
this,
|
|
148
|
+
options,
|
|
149
|
+
instance$8,
|
|
150
|
+
create_fragment$8,
|
|
151
|
+
internal.safe_not_equal,
|
|
152
|
+
{
|
|
153
|
+
five: 3,
|
|
154
|
+
pxmm: 4,
|
|
155
|
+
floorplanData: 5,
|
|
156
|
+
cameraImageUrl: 0
|
|
157
|
+
},
|
|
158
|
+
add_css$7
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* src/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte generated by Svelte v3.47.0 */
|
|
164
|
+
|
|
165
|
+
function add_css$6(target) {
|
|
166
|
+
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%)}");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function get_each_context$1(ctx, list, i) {
|
|
170
|
+
const child_ctx = ctx.slice();
|
|
171
|
+
child_ctx[1] = list[i];
|
|
172
|
+
return child_ctx;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// (5:2) {#each extraObjects as extraObject (extraObject.id)}
|
|
176
|
+
function create_each_block$1(key_1, ctx) {
|
|
177
|
+
let div1;
|
|
178
|
+
let div0;
|
|
179
|
+
let style_width = `${/*extraObject*/ ctx[1].icon.width / 16}rem`;
|
|
180
|
+
let style_height = `${/*extraObject*/ ctx[1].icon.height / 16}rem`;
|
|
181
|
+
let t;
|
|
182
|
+
let style_top = `${/*extraObject*/ ctx[1].positionInImage.y * 100}%`;
|
|
183
|
+
let style_left = `${/*extraObject*/ ctx[1].positionInImage.x * 100}%`;
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
key: key_1,
|
|
187
|
+
first: null,
|
|
188
|
+
c() {
|
|
189
|
+
div1 = internal.element("div");
|
|
190
|
+
div0 = internal.element("div");
|
|
191
|
+
t = internal.space();
|
|
192
|
+
internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-1i87fz7");
|
|
193
|
+
internal.set_style(div0, "background-image", `url(${/*extraObject*/ ctx[1].icon.url})`);
|
|
194
|
+
internal.set_style(div0, "width", style_width, false);
|
|
195
|
+
internal.set_style(div0, "height", style_height, false);
|
|
196
|
+
internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7");
|
|
197
|
+
internal.set_style(div1, "top", style_top, false);
|
|
198
|
+
internal.set_style(div1, "left", style_left, false);
|
|
199
|
+
this.first = div1;
|
|
200
|
+
},
|
|
201
|
+
m(target, anchor) {
|
|
202
|
+
internal.insert(target, div1, anchor);
|
|
203
|
+
internal.append(div1, div0);
|
|
204
|
+
internal.append(div1, t);
|
|
205
|
+
},
|
|
206
|
+
p(new_ctx, dirty) {
|
|
207
|
+
ctx = new_ctx;
|
|
208
|
+
|
|
209
|
+
if (dirty & /*extraObjects*/ 1) {
|
|
210
|
+
internal.set_style(div0, "background-image", `url(${/*extraObject*/ ctx[1].icon.url})`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (dirty & /*extraObjects*/ 1 && style_width !== (style_width = `${/*extraObject*/ ctx[1].icon.width / 16}rem`)) {
|
|
214
|
+
internal.set_style(div0, "width", style_width, false);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (dirty & /*extraObjects*/ 1 && style_height !== (style_height = `${/*extraObject*/ ctx[1].icon.height / 16}rem`)) {
|
|
218
|
+
internal.set_style(div0, "height", style_height, false);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (dirty & /*extraObjects*/ 1 && style_top !== (style_top = `${/*extraObject*/ ctx[1].positionInImage.y * 100}%`)) {
|
|
222
|
+
internal.set_style(div1, "top", style_top, false);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (dirty & /*extraObjects*/ 1 && style_left !== (style_left = `${/*extraObject*/ ctx[1].positionInImage.x * 100}%`)) {
|
|
226
|
+
internal.set_style(div1, "left", style_left, false);
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
d(detaching) {
|
|
230
|
+
if (detaching) internal.detach(div1);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function create_fragment$7(ctx) {
|
|
236
|
+
let div;
|
|
237
|
+
let each_blocks = [];
|
|
238
|
+
let each_1_lookup = new Map();
|
|
239
|
+
let each_value = /*extraObjects*/ ctx[0];
|
|
240
|
+
const get_key = ctx => /*extraObject*/ ctx[1].id;
|
|
241
|
+
|
|
242
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
243
|
+
let child_ctx = get_each_context$1(ctx, each_value, i);
|
|
244
|
+
let key = get_key(child_ctx);
|
|
245
|
+
each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
c() {
|
|
250
|
+
div = internal.element("div");
|
|
251
|
+
|
|
252
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
253
|
+
each_blocks[i].c();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-1i87fz7");
|
|
257
|
+
},
|
|
258
|
+
m(target, anchor) {
|
|
259
|
+
internal.insert(target, div, anchor);
|
|
260
|
+
|
|
261
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
262
|
+
each_blocks[i].m(div, null);
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
p(ctx, [dirty]) {
|
|
266
|
+
if (dirty & /*extraObjects*/ 1) {
|
|
267
|
+
each_value = /*extraObjects*/ ctx[0];
|
|
268
|
+
each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.destroy_block, create_each_block$1, null, get_each_context$1);
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
i: internal.noop,
|
|
272
|
+
o: internal.noop,
|
|
273
|
+
d(detaching) {
|
|
274
|
+
if (detaching) internal.detach(div);
|
|
275
|
+
|
|
276
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
277
|
+
each_blocks[i].d();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function instance$7($$self, $$props, $$invalidate) {
|
|
284
|
+
let { extraObjects = [] } = $$props;
|
|
285
|
+
|
|
286
|
+
$$self.$$set = $$props => {
|
|
287
|
+
if ('extraObjects' in $$props) $$invalidate(0, extraObjects = $$props.extraObjects);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
return [extraObjects];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
class ExtraObjects extends internal.SvelteComponent {
|
|
294
|
+
constructor(options) {
|
|
295
|
+
super();
|
|
296
|
+
internal.init(this, options, instance$7, create_fragment$7, internal.safe_not_equal, { extraObjects: 0 }, add_css$6);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
|
|
301
|
+
|
|
302
|
+
function add_css$5(target) {
|
|
303
|
+
internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function create_fragment$6(ctx) {
|
|
307
|
+
let img;
|
|
308
|
+
let img_src_value;
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
c() {
|
|
312
|
+
img = internal.element("img");
|
|
313
|
+
if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
|
|
314
|
+
internal.attr(img, "alt", "floorplan iamge");
|
|
315
|
+
internal.attr(img, "class", "svelte-1gfoniz");
|
|
316
|
+
},
|
|
317
|
+
m(target, anchor) {
|
|
318
|
+
internal.insert(target, img, anchor);
|
|
319
|
+
},
|
|
320
|
+
p(ctx, [dirty]) {
|
|
321
|
+
if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
|
|
322
|
+
internal.attr(img, "src", img_src_value);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
i: internal.noop,
|
|
326
|
+
o: internal.noop,
|
|
327
|
+
d(detaching) {
|
|
328
|
+
if (detaching) internal.detach(img);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function instance$6($$self, $$props, $$invalidate) {
|
|
334
|
+
let { url } = $$props;
|
|
335
|
+
|
|
336
|
+
$$self.$$set = $$props => {
|
|
337
|
+
if ('url' in $$props) $$invalidate(0, url = $$props.url);
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
return [url];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
class Normalmage extends internal.SvelteComponent {
|
|
344
|
+
constructor(options) {
|
|
345
|
+
super();
|
|
346
|
+
internal.init(this, options, instance$6, create_fragment$6, internal.safe_not_equal, { url: 0 }, add_css$5);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
|
|
351
|
+
|
|
352
|
+
function add_css$4(target) {
|
|
353
|
+
internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function create_fragment$5(ctx) {
|
|
357
|
+
let div;
|
|
358
|
+
let html_tag;
|
|
359
|
+
let t;
|
|
360
|
+
let html_tag_1;
|
|
361
|
+
|
|
362
|
+
return {
|
|
363
|
+
c() {
|
|
364
|
+
div = internal.element("div");
|
|
365
|
+
html_tag = new internal.HtmlTag();
|
|
366
|
+
t = internal.space();
|
|
367
|
+
html_tag_1 = new internal.HtmlTag();
|
|
368
|
+
html_tag.a = t;
|
|
369
|
+
html_tag_1.a = null;
|
|
370
|
+
internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
|
|
371
|
+
},
|
|
372
|
+
m(target, anchor) {
|
|
373
|
+
internal.insert(target, div, anchor);
|
|
374
|
+
html_tag.m(/*svgStyle*/ ctx[1], div);
|
|
375
|
+
internal.append(div, t);
|
|
376
|
+
html_tag_1.m(/*content*/ ctx[0], div);
|
|
377
|
+
},
|
|
378
|
+
p(ctx, [dirty]) {
|
|
379
|
+
if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
|
|
380
|
+
},
|
|
381
|
+
i: internal.noop,
|
|
382
|
+
o: internal.noop,
|
|
383
|
+
d(detaching) {
|
|
384
|
+
if (detaching) internal.detach(div);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function instance$5($$self, $$props, $$invalidate) {
|
|
390
|
+
let { content } = $$props;
|
|
391
|
+
|
|
392
|
+
const svgStyle = `
|
|
393
|
+
<style>
|
|
394
|
+
svg [type='lineGroup'] path {
|
|
395
|
+
fill: #ffffff;
|
|
396
|
+
stroke: #ffffff;
|
|
397
|
+
}
|
|
398
|
+
svg [type='lineItemGroup'] g g g g {
|
|
399
|
+
stroke: #ffffff;
|
|
400
|
+
}</style>
|
|
401
|
+
`;
|
|
402
|
+
|
|
403
|
+
$$self.$$set = $$props => {
|
|
404
|
+
if ('content' in $$props) $$invalidate(0, content = $$props.content);
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
return [content, svgStyle];
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
class SvgImage extends internal.SvelteComponent {
|
|
411
|
+
constructor(options) {
|
|
412
|
+
super();
|
|
413
|
+
internal.init(this, options, instance$5, create_fragment$5, internal.safe_not_equal, { content: 0 }, add_css$4);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
|
|
418
|
+
|
|
419
|
+
function add_css$3(target) {
|
|
420
|
+
internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// (13:22)
|
|
424
|
+
function create_if_block_1(ctx) {
|
|
425
|
+
let normalimage;
|
|
426
|
+
let current;
|
|
427
|
+
normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
|
|
428
|
+
|
|
429
|
+
return {
|
|
430
|
+
c() {
|
|
431
|
+
internal.create_component(normalimage.$$.fragment);
|
|
432
|
+
},
|
|
433
|
+
m(target, anchor) {
|
|
434
|
+
internal.mount_component(normalimage, target, anchor);
|
|
435
|
+
current = true;
|
|
436
|
+
},
|
|
437
|
+
p(ctx, dirty) {
|
|
438
|
+
const normalimage_changes = {};
|
|
439
|
+
if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
|
|
440
|
+
normalimage.$set(normalimage_changes);
|
|
441
|
+
},
|
|
442
|
+
i(local) {
|
|
443
|
+
if (current) return;
|
|
444
|
+
internal.transition_in(normalimage.$$.fragment, local);
|
|
445
|
+
current = true;
|
|
446
|
+
},
|
|
447
|
+
o(local) {
|
|
448
|
+
internal.transition_out(normalimage.$$.fragment, local);
|
|
449
|
+
current = false;
|
|
450
|
+
},
|
|
451
|
+
d(detaching) {
|
|
452
|
+
internal.destroy_component(normalimage, detaching);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// (11:2) {#if svgContent}
|
|
458
|
+
function create_if_block$2(ctx) {
|
|
459
|
+
let svgimage;
|
|
460
|
+
let current;
|
|
461
|
+
|
|
462
|
+
svgimage = new SvgImage({
|
|
463
|
+
props: { content: /*svgContent*/ ctx[0] }
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
return {
|
|
467
|
+
c() {
|
|
468
|
+
internal.create_component(svgimage.$$.fragment);
|
|
469
|
+
},
|
|
470
|
+
m(target, anchor) {
|
|
471
|
+
internal.mount_component(svgimage, target, anchor);
|
|
472
|
+
current = true;
|
|
473
|
+
},
|
|
474
|
+
p(ctx, dirty) {
|
|
475
|
+
const svgimage_changes = {};
|
|
476
|
+
if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
|
|
477
|
+
svgimage.$set(svgimage_changes);
|
|
478
|
+
},
|
|
479
|
+
i(local) {
|
|
480
|
+
if (current) return;
|
|
481
|
+
internal.transition_in(svgimage.$$.fragment, local);
|
|
482
|
+
current = true;
|
|
483
|
+
},
|
|
484
|
+
o(local) {
|
|
485
|
+
internal.transition_out(svgimage.$$.fragment, local);
|
|
486
|
+
current = false;
|
|
487
|
+
},
|
|
488
|
+
d(detaching) {
|
|
489
|
+
internal.destroy_component(svgimage, detaching);
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function create_fragment$4(ctx) {
|
|
495
|
+
let div;
|
|
496
|
+
let current_block_type_index;
|
|
497
|
+
let if_block;
|
|
498
|
+
let current;
|
|
499
|
+
const if_block_creators = [create_if_block$2, create_if_block_1];
|
|
500
|
+
const if_blocks = [];
|
|
501
|
+
|
|
502
|
+
function select_block_type(ctx, dirty) {
|
|
503
|
+
if (/*svgContent*/ ctx[0]) return 0;
|
|
504
|
+
if (/*imageData*/ ctx[1]) return 1;
|
|
505
|
+
return -1;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (~(current_block_type_index = select_block_type(ctx))) {
|
|
509
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return {
|
|
513
|
+
c() {
|
|
514
|
+
div = internal.element("div");
|
|
515
|
+
if (if_block) if_block.c();
|
|
516
|
+
internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
|
|
517
|
+
},
|
|
518
|
+
m(target, anchor) {
|
|
519
|
+
internal.insert(target, div, anchor);
|
|
520
|
+
|
|
521
|
+
if (~current_block_type_index) {
|
|
522
|
+
if_blocks[current_block_type_index].m(div, null);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
current = true;
|
|
526
|
+
},
|
|
527
|
+
p(ctx, [dirty]) {
|
|
528
|
+
let previous_block_index = current_block_type_index;
|
|
529
|
+
current_block_type_index = select_block_type(ctx);
|
|
530
|
+
|
|
531
|
+
if (current_block_type_index === previous_block_index) {
|
|
532
|
+
if (~current_block_type_index) {
|
|
533
|
+
if_blocks[current_block_type_index].p(ctx, dirty);
|
|
534
|
+
}
|
|
535
|
+
} else {
|
|
536
|
+
if (if_block) {
|
|
537
|
+
internal.group_outros();
|
|
538
|
+
|
|
539
|
+
internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
540
|
+
if_blocks[previous_block_index] = null;
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
internal.check_outros();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (~current_block_type_index) {
|
|
547
|
+
if_block = if_blocks[current_block_type_index];
|
|
548
|
+
|
|
549
|
+
if (!if_block) {
|
|
550
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
551
|
+
if_block.c();
|
|
552
|
+
} else {
|
|
553
|
+
if_block.p(ctx, dirty);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
internal.transition_in(if_block, 1);
|
|
557
|
+
if_block.m(div, null);
|
|
558
|
+
} else {
|
|
559
|
+
if_block = null;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
i(local) {
|
|
564
|
+
if (current) return;
|
|
565
|
+
internal.transition_in(if_block);
|
|
566
|
+
current = true;
|
|
567
|
+
},
|
|
568
|
+
o(local) {
|
|
569
|
+
internal.transition_out(if_block);
|
|
570
|
+
current = false;
|
|
571
|
+
},
|
|
572
|
+
d(detaching) {
|
|
573
|
+
if (detaching) internal.detach(div);
|
|
574
|
+
|
|
575
|
+
if (~current_block_type_index) {
|
|
576
|
+
if_blocks[current_block_type_index].d();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
function instance$4($$self, $$props, $$invalidate) {
|
|
583
|
+
let imageData;
|
|
584
|
+
let svgContent;
|
|
585
|
+
var _a, _b;
|
|
586
|
+
let { floorIndex } = $$props;
|
|
587
|
+
let { floorplanData } = $$props;
|
|
588
|
+
|
|
589
|
+
$$self.$$set = $$props => {
|
|
590
|
+
if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
|
|
591
|
+
if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
$$self.$$.update = () => {
|
|
595
|
+
if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
|
|
596
|
+
$$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
|
|
600
|
+
$$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
|
|
601
|
+
? void 0
|
|
602
|
+
: _a[floorIndex]) === null || _b === void 0
|
|
603
|
+
? void 0
|
|
604
|
+
: _b.svgContent);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
class BaseImage extends internal.SvelteComponent {
|
|
612
|
+
constructor(options) {
|
|
613
|
+
super();
|
|
614
|
+
internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$3);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function pathD(points, options = {}) {
|
|
619
|
+
let d = '';
|
|
620
|
+
const { needZ, needA } = options;
|
|
621
|
+
const _points = needZ ? points.slice().concat(points[0]) : points.slice();
|
|
622
|
+
_points.forEach((_point, index) => {
|
|
623
|
+
const { x, y } = options.format ? options.format(_point) : _point;
|
|
624
|
+
const point = x + ',' + y;
|
|
625
|
+
if (index === 0) {
|
|
626
|
+
d += 'M' + point;
|
|
627
|
+
return d;
|
|
628
|
+
}
|
|
629
|
+
if (needA === null || needA === void 0 ? void 0 : needA[index]) {
|
|
630
|
+
d += 'A' + needA[index] + ',' + point;
|
|
631
|
+
return d;
|
|
632
|
+
}
|
|
633
|
+
d += 'L' + point;
|
|
634
|
+
return d;
|
|
635
|
+
});
|
|
636
|
+
return d + (needZ ? 'Z' : '');
|
|
637
|
+
}
|
|
638
|
+
/** 把户型图上点点位转换到 SVG 上的点位 */
|
|
639
|
+
function formatFloorplanPoint({ x, y }, bounding) {
|
|
640
|
+
const { max, min } = bounding;
|
|
641
|
+
return { x: x - min.x, y: max.y - y };
|
|
642
|
+
}
|
|
643
|
+
/** 模型坐标转户型图坐标 */
|
|
644
|
+
function modelPosition2FloorplanPosition(position, floorplanData) {
|
|
645
|
+
const x = position.x * 1000 + floorplanData.bounding.origin.x;
|
|
646
|
+
const y = -position.z * 1000 + floorplanData.bounding.origin.y;
|
|
647
|
+
return { x, y };
|
|
648
|
+
}
|
|
649
|
+
/** 户型图点位转在图片上的相对坐标 */
|
|
650
|
+
function floorplanPosition2ImagePosition(position, floorplanData) {
|
|
651
|
+
const bounding = floorplanData.bounding;
|
|
652
|
+
const boundingWidth = bounding.max.x - bounding.min.x;
|
|
653
|
+
const boundingHeight = bounding.max.y - bounding.min.y;
|
|
654
|
+
return {
|
|
655
|
+
x: (position.x - bounding.min.x) / boundingWidth,
|
|
656
|
+
y: (bounding.max.y - position.y) / boundingHeight,
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
/** 求三维坐标点所在的楼层 */
|
|
660
|
+
function getFloorIndexFromModelPosition(position, five) {
|
|
661
|
+
const floorIndex = Math.max(...five.work.observers.map((observer) => {
|
|
662
|
+
if (position.z >= observer.standingPosition.z)
|
|
663
|
+
return observer.floorIndex;
|
|
664
|
+
return 0;
|
|
665
|
+
}));
|
|
666
|
+
return floorIndex;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
|
|
670
|
+
|
|
671
|
+
function add_css$2(target) {
|
|
672
|
+
internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function create_fragment$3(ctx) {
|
|
676
|
+
let path;
|
|
677
|
+
|
|
678
|
+
return {
|
|
679
|
+
c() {
|
|
680
|
+
path = internal.svg_element("path");
|
|
681
|
+
internal.attr(path, "d", /*_pathD*/ ctx[0]);
|
|
682
|
+
internal.attr(path, "fill", `#fff`);
|
|
683
|
+
internal.attr(path, "class", "svelte-19uvvss");
|
|
684
|
+
},
|
|
685
|
+
m(target, anchor) {
|
|
686
|
+
internal.insert(target, path, anchor);
|
|
687
|
+
},
|
|
688
|
+
p: internal.noop,
|
|
689
|
+
i: internal.noop,
|
|
690
|
+
o: internal.noop,
|
|
691
|
+
d(detaching) {
|
|
692
|
+
if (detaching) internal.detach(path);
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
function instance$3($$self, $$props, $$invalidate) {
|
|
698
|
+
let { room } = $$props;
|
|
699
|
+
let { floorplanData } = $$props;
|
|
700
|
+
const { bounding } = floorplanData;
|
|
701
|
+
|
|
702
|
+
const _pathD = pathD(room.path, {
|
|
703
|
+
needZ: true,
|
|
704
|
+
format: vector => formatFloorplanPoint(vector, bounding)
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
$$self.$$set = $$props => {
|
|
708
|
+
if ('room' in $$props) $$invalidate(1, room = $$props.room);
|
|
709
|
+
if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
return [_pathD, room, floorplanData];
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
class Room extends internal.SvelteComponent {
|
|
716
|
+
constructor(options) {
|
|
717
|
+
super();
|
|
718
|
+
internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$2);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
|
|
723
|
+
|
|
724
|
+
function add_css$1(target) {
|
|
725
|
+
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}");
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function get_each_context(ctx, list, i) {
|
|
729
|
+
const child_ctx = ctx.slice();
|
|
730
|
+
child_ctx[4] = list[i];
|
|
731
|
+
return child_ctx;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
|
|
735
|
+
function create_each_block(key_1, ctx) {
|
|
736
|
+
let first;
|
|
737
|
+
let room;
|
|
738
|
+
let current;
|
|
739
|
+
|
|
740
|
+
const room_spread_levels = [
|
|
741
|
+
{
|
|
742
|
+
room: /*room*/ ctx[4],
|
|
743
|
+
floorplanData: /*floorplanData*/ ctx[1]
|
|
744
|
+
}
|
|
745
|
+
];
|
|
746
|
+
|
|
747
|
+
let room_props = {};
|
|
748
|
+
|
|
749
|
+
for (let i = 0; i < room_spread_levels.length; i += 1) {
|
|
750
|
+
room_props = internal.assign(room_props, room_spread_levels[i]);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
room = new Room({ props: room_props });
|
|
754
|
+
|
|
755
|
+
return {
|
|
756
|
+
key: key_1,
|
|
757
|
+
first: null,
|
|
758
|
+
c() {
|
|
759
|
+
first = internal.empty();
|
|
760
|
+
internal.create_component(room.$$.fragment);
|
|
761
|
+
this.first = first;
|
|
762
|
+
},
|
|
763
|
+
m(target, anchor) {
|
|
764
|
+
internal.insert(target, first, anchor);
|
|
765
|
+
internal.mount_component(room, target, anchor);
|
|
766
|
+
current = true;
|
|
767
|
+
},
|
|
768
|
+
p(new_ctx, dirty) {
|
|
769
|
+
ctx = new_ctx;
|
|
770
|
+
|
|
771
|
+
const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
|
|
772
|
+
? internal.get_spread_update(room_spread_levels, [
|
|
773
|
+
{
|
|
774
|
+
room: /*room*/ ctx[4],
|
|
775
|
+
floorplanData: /*floorplanData*/ ctx[1]
|
|
776
|
+
}
|
|
777
|
+
])
|
|
778
|
+
: {};
|
|
779
|
+
|
|
780
|
+
room.$set(room_changes);
|
|
781
|
+
},
|
|
782
|
+
i(local) {
|
|
783
|
+
if (current) return;
|
|
784
|
+
internal.transition_in(room.$$.fragment, local);
|
|
785
|
+
current = true;
|
|
786
|
+
},
|
|
787
|
+
o(local) {
|
|
788
|
+
internal.transition_out(room.$$.fragment, local);
|
|
789
|
+
current = false;
|
|
790
|
+
},
|
|
791
|
+
d(detaching) {
|
|
792
|
+
if (detaching) internal.detach(first);
|
|
793
|
+
internal.destroy_component(room, detaching);
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function create_fragment$2(ctx) {
|
|
799
|
+
let div;
|
|
800
|
+
let svg;
|
|
801
|
+
let each_blocks = [];
|
|
802
|
+
let each_1_lookup = new Map();
|
|
803
|
+
let current;
|
|
804
|
+
let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
805
|
+
const get_key = ctx => /*room*/ ctx[4].id;
|
|
806
|
+
|
|
807
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
808
|
+
let child_ctx = get_each_context(ctx, each_value, i);
|
|
809
|
+
let key = get_key(child_ctx);
|
|
810
|
+
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
return {
|
|
814
|
+
c() {
|
|
815
|
+
div = internal.element("div");
|
|
816
|
+
svg = internal.svg_element("svg");
|
|
817
|
+
|
|
818
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
819
|
+
each_blocks[i].c();
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
internal.attr(svg, "width", "100%");
|
|
823
|
+
internal.attr(svg, "height", "100%");
|
|
824
|
+
internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
|
|
825
|
+
internal.attr(svg, "class", "svelte-1kqo6e4");
|
|
826
|
+
internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
|
|
827
|
+
},
|
|
828
|
+
m(target, anchor) {
|
|
829
|
+
internal.insert(target, div, anchor);
|
|
830
|
+
internal.append(div, svg);
|
|
831
|
+
|
|
832
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
833
|
+
each_blocks[i].m(svg, null);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
current = true;
|
|
837
|
+
},
|
|
838
|
+
p(ctx, [dirty]) {
|
|
839
|
+
if (dirty & /*floorplanData, floorIndex*/ 3) {
|
|
840
|
+
each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
841
|
+
internal.group_outros();
|
|
842
|
+
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);
|
|
843
|
+
internal.check_outros();
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
i(local) {
|
|
847
|
+
if (current) return;
|
|
848
|
+
|
|
849
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
850
|
+
internal.transition_in(each_blocks[i]);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
current = true;
|
|
854
|
+
},
|
|
855
|
+
o(local) {
|
|
856
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
857
|
+
internal.transition_out(each_blocks[i]);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
current = false;
|
|
861
|
+
},
|
|
862
|
+
d(detaching) {
|
|
863
|
+
if (detaching) internal.detach(div);
|
|
864
|
+
|
|
865
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
866
|
+
each_blocks[i].d();
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
function instance$2($$self, $$props, $$invalidate) {
|
|
873
|
+
let { floorIndex } = $$props;
|
|
874
|
+
let { floorplanData } = $$props;
|
|
875
|
+
const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
|
|
876
|
+
const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
|
|
877
|
+
|
|
878
|
+
$$self.$$set = $$props => {
|
|
879
|
+
if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
|
|
880
|
+
if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
return [floorIndex, floorplanData, boundingWidth, boundingHeight];
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
class RoomHighlight extends internal.SvelteComponent {
|
|
887
|
+
constructor(options) {
|
|
888
|
+
super();
|
|
889
|
+
internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$1);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/* src/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
|
|
894
|
+
|
|
895
|
+
function create_if_block$1(ctx) {
|
|
896
|
+
let highlight;
|
|
897
|
+
let current;
|
|
898
|
+
|
|
899
|
+
const highlight_spread_levels = [
|
|
900
|
+
{
|
|
901
|
+
five: /*five*/ ctx[0],
|
|
902
|
+
pxmm: /*pxmm*/ ctx[1],
|
|
903
|
+
floorIndex: /*floorIndex*/ ctx[2],
|
|
904
|
+
floorplanData: /*floorplanData*/ ctx[4],
|
|
905
|
+
onRoomHeightClick: /*onRoomHeightClick*/ ctx[6]
|
|
906
|
+
}
|
|
907
|
+
];
|
|
908
|
+
|
|
909
|
+
let highlight_props = {};
|
|
910
|
+
|
|
911
|
+
for (let i = 0; i < highlight_spread_levels.length; i += 1) {
|
|
912
|
+
highlight_props = internal.assign(highlight_props, highlight_spread_levels[i]);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
highlight = new RoomHighlight({ props: highlight_props });
|
|
916
|
+
|
|
917
|
+
return {
|
|
918
|
+
c() {
|
|
919
|
+
internal.create_component(highlight.$$.fragment);
|
|
920
|
+
},
|
|
921
|
+
m(target, anchor) {
|
|
922
|
+
internal.mount_component(highlight, target, anchor);
|
|
923
|
+
current = true;
|
|
924
|
+
},
|
|
925
|
+
p(ctx, dirty) {
|
|
926
|
+
const highlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 87)
|
|
927
|
+
? internal.get_spread_update(highlight_spread_levels, [
|
|
928
|
+
{
|
|
929
|
+
five: /*five*/ ctx[0],
|
|
930
|
+
pxmm: /*pxmm*/ ctx[1],
|
|
931
|
+
floorIndex: /*floorIndex*/ ctx[2],
|
|
932
|
+
floorplanData: /*floorplanData*/ ctx[4],
|
|
933
|
+
onRoomHeightClick: /*onRoomHeightClick*/ ctx[6]
|
|
934
|
+
}
|
|
935
|
+
])
|
|
936
|
+
: {};
|
|
937
|
+
|
|
938
|
+
highlight.$set(highlight_changes);
|
|
939
|
+
},
|
|
940
|
+
i(local) {
|
|
941
|
+
if (current) return;
|
|
942
|
+
internal.transition_in(highlight.$$.fragment, local);
|
|
943
|
+
current = true;
|
|
944
|
+
},
|
|
945
|
+
o(local) {
|
|
946
|
+
internal.transition_out(highlight.$$.fragment, local);
|
|
947
|
+
current = false;
|
|
948
|
+
},
|
|
949
|
+
d(detaching) {
|
|
950
|
+
internal.destroy_component(highlight, detaching);
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
function create_fragment$1(ctx) {
|
|
956
|
+
let baseimage;
|
|
957
|
+
let t0;
|
|
958
|
+
let extraobjects;
|
|
959
|
+
let t1;
|
|
960
|
+
let if_block_anchor;
|
|
961
|
+
let current;
|
|
962
|
+
|
|
963
|
+
const baseimage_spread_levels = [
|
|
964
|
+
{
|
|
965
|
+
floorIndex: /*floorIndex*/ ctx[2],
|
|
966
|
+
floorplanData: /*floorplanData*/ ctx[4]
|
|
967
|
+
}
|
|
968
|
+
];
|
|
969
|
+
|
|
970
|
+
let baseimage_props = {};
|
|
971
|
+
|
|
972
|
+
for (let i = 0; i < baseimage_spread_levels.length; i += 1) {
|
|
973
|
+
baseimage_props = internal.assign(baseimage_props, baseimage_spread_levels[i]);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
baseimage = new BaseImage({ props: baseimage_props });
|
|
977
|
+
|
|
978
|
+
extraobjects = new ExtraObjects({
|
|
979
|
+
props: {
|
|
980
|
+
extraObjects: /*currentFloorExtraObjects*/ ctx[5]
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
let if_block = /*hoverEnable*/ ctx[3] && create_if_block$1(ctx);
|
|
985
|
+
|
|
986
|
+
return {
|
|
987
|
+
c() {
|
|
988
|
+
internal.create_component(baseimage.$$.fragment);
|
|
989
|
+
t0 = internal.space();
|
|
990
|
+
internal.create_component(extraobjects.$$.fragment);
|
|
991
|
+
t1 = internal.space();
|
|
992
|
+
if (if_block) if_block.c();
|
|
993
|
+
if_block_anchor = internal.empty();
|
|
994
|
+
},
|
|
995
|
+
m(target, anchor) {
|
|
996
|
+
internal.mount_component(baseimage, target, anchor);
|
|
997
|
+
internal.insert(target, t0, anchor);
|
|
998
|
+
internal.mount_component(extraobjects, target, anchor);
|
|
999
|
+
internal.insert(target, t1, anchor);
|
|
1000
|
+
if (if_block) if_block.m(target, anchor);
|
|
1001
|
+
internal.insert(target, if_block_anchor, anchor);
|
|
1002
|
+
current = true;
|
|
1003
|
+
},
|
|
1004
|
+
p(ctx, [dirty]) {
|
|
1005
|
+
const baseimage_changes = (dirty & /*floorIndex, floorplanData*/ 20)
|
|
1006
|
+
? internal.get_spread_update(baseimage_spread_levels, [
|
|
1007
|
+
{
|
|
1008
|
+
floorIndex: /*floorIndex*/ ctx[2],
|
|
1009
|
+
floorplanData: /*floorplanData*/ ctx[4]
|
|
1010
|
+
}
|
|
1011
|
+
])
|
|
1012
|
+
: {};
|
|
1013
|
+
|
|
1014
|
+
baseimage.$set(baseimage_changes);
|
|
1015
|
+
const extraobjects_changes = {};
|
|
1016
|
+
if (dirty & /*currentFloorExtraObjects*/ 32) extraobjects_changes.extraObjects = /*currentFloorExtraObjects*/ ctx[5];
|
|
1017
|
+
extraobjects.$set(extraobjects_changes);
|
|
1018
|
+
|
|
1019
|
+
if (/*hoverEnable*/ ctx[3]) {
|
|
1020
|
+
if (if_block) {
|
|
1021
|
+
if_block.p(ctx, dirty);
|
|
1022
|
+
|
|
1023
|
+
if (dirty & /*hoverEnable*/ 8) {
|
|
1024
|
+
internal.transition_in(if_block, 1);
|
|
1025
|
+
}
|
|
1026
|
+
} else {
|
|
1027
|
+
if_block = create_if_block$1(ctx);
|
|
1028
|
+
if_block.c();
|
|
1029
|
+
internal.transition_in(if_block, 1);
|
|
1030
|
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
1031
|
+
}
|
|
1032
|
+
} else if (if_block) {
|
|
1033
|
+
internal.group_outros();
|
|
1034
|
+
|
|
1035
|
+
internal.transition_out(if_block, 1, 1, () => {
|
|
1036
|
+
if_block = null;
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
internal.check_outros();
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
i(local) {
|
|
1043
|
+
if (current) return;
|
|
1044
|
+
internal.transition_in(baseimage.$$.fragment, local);
|
|
1045
|
+
internal.transition_in(extraobjects.$$.fragment, local);
|
|
1046
|
+
internal.transition_in(if_block);
|
|
1047
|
+
current = true;
|
|
1048
|
+
},
|
|
1049
|
+
o(local) {
|
|
1050
|
+
internal.transition_out(baseimage.$$.fragment, local);
|
|
1051
|
+
internal.transition_out(extraobjects.$$.fragment, local);
|
|
1052
|
+
internal.transition_out(if_block);
|
|
1053
|
+
current = false;
|
|
1054
|
+
},
|
|
1055
|
+
d(detaching) {
|
|
1056
|
+
internal.destroy_component(baseimage, detaching);
|
|
1057
|
+
if (detaching) internal.detach(t0);
|
|
1058
|
+
internal.destroy_component(extraobjects, detaching);
|
|
1059
|
+
if (detaching) internal.detach(t1);
|
|
1060
|
+
if (if_block) if_block.d(detaching);
|
|
1061
|
+
if (detaching) internal.detach(if_block_anchor);
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
function instance$1($$self, $$props, $$invalidate) {
|
|
1067
|
+
let currentFloorExtraObjects;
|
|
1068
|
+
let { five } = $$props;
|
|
1069
|
+
let { pxmm } = $$props;
|
|
1070
|
+
let { floorIndex } = $$props;
|
|
1071
|
+
let { hoverEnable } = $$props;
|
|
1072
|
+
let { floorplanData } = $$props;
|
|
1073
|
+
let { extraObjects = [] } = $$props;
|
|
1074
|
+
const onRoomHeightClick = undefined;
|
|
1075
|
+
|
|
1076
|
+
$$self.$$set = $$props => {
|
|
1077
|
+
if ('five' in $$props) $$invalidate(0, five = $$props.five);
|
|
1078
|
+
if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
|
|
1079
|
+
if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
|
|
1080
|
+
if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
|
|
1081
|
+
if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
|
|
1082
|
+
if ('extraObjects' in $$props) $$invalidate(7, extraObjects = $$props.extraObjects);
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
$$self.$$.update = () => {
|
|
1086
|
+
if ($$self.$$.dirty & /*extraObjects, floorIndex*/ 132) {
|
|
1087
|
+
$$invalidate(5, currentFloorExtraObjects = extraObjects === null || extraObjects === void 0
|
|
1088
|
+
? void 0
|
|
1089
|
+
: extraObjects.filter(object => object.floorIndex === floorIndex));
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
return [
|
|
1094
|
+
five,
|
|
1095
|
+
pxmm,
|
|
1096
|
+
floorIndex,
|
|
1097
|
+
hoverEnable,
|
|
1098
|
+
floorplanData,
|
|
1099
|
+
currentFloorExtraObjects,
|
|
1100
|
+
onRoomHeightClick,
|
|
1101
|
+
extraObjects
|
|
1102
|
+
];
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
class CurrentFloor extends internal.SvelteComponent {
|
|
1106
|
+
constructor(options) {
|
|
1107
|
+
super();
|
|
1108
|
+
|
|
1109
|
+
internal.init(this, options, instance$1, create_fragment$1, internal.safe_not_equal, {
|
|
1110
|
+
five: 0,
|
|
1111
|
+
pxmm: 1,
|
|
1112
|
+
floorIndex: 2,
|
|
1113
|
+
hoverEnable: 3,
|
|
1114
|
+
floorplanData: 4,
|
|
1115
|
+
extraObjects: 7
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/* src/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
|
|
1121
|
+
|
|
1122
|
+
function add_css(target) {
|
|
1123
|
+
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}");
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// (41:2) {#if clientWidth !== 0}
|
|
1127
|
+
function create_if_block(ctx) {
|
|
1128
|
+
let div;
|
|
1129
|
+
let currentfloor;
|
|
1130
|
+
let t;
|
|
1131
|
+
let camera;
|
|
1132
|
+
let style_width = `${/*contentWidth*/ ctx[7]}px`;
|
|
1133
|
+
let style_height = `${/*contentHeight*/ ctx[10]}px`;
|
|
1134
|
+
let current;
|
|
1135
|
+
|
|
1136
|
+
const currentfloor_spread_levels = [
|
|
1137
|
+
{
|
|
1138
|
+
five: /*five*/ ctx[0],
|
|
1139
|
+
pxmm: /*pxmm*/ ctx[8],
|
|
1140
|
+
floorIndex: /*floorIndex*/ ctx[9],
|
|
1141
|
+
floorplanData: /*floorplanData*/ ctx[2],
|
|
1142
|
+
hoverEnable: /*hoverEnable*/ ctx[1],
|
|
1143
|
+
extraObjects: /*extraObjects*/ ctx[4]
|
|
1144
|
+
}
|
|
1145
|
+
];
|
|
1146
|
+
|
|
1147
|
+
let currentfloor_props = {};
|
|
1148
|
+
|
|
1149
|
+
for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
|
|
1150
|
+
currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
currentfloor = new CurrentFloor({ props: currentfloor_props });
|
|
1154
|
+
|
|
1155
|
+
const camera_spread_levels = [
|
|
1156
|
+
{
|
|
1157
|
+
pxmm: /*pxmm*/ ctx[8],
|
|
1158
|
+
five: /*five*/ ctx[0],
|
|
1159
|
+
floorplanData: /*floorplanData*/ ctx[2],
|
|
1160
|
+
cameraImageUrl: /*cameraImageUrl*/ ctx[3]
|
|
1161
|
+
}
|
|
1162
|
+
];
|
|
1163
|
+
|
|
1164
|
+
let camera_props = {};
|
|
1165
|
+
|
|
1166
|
+
for (let i = 0; i < camera_spread_levels.length; i += 1) {
|
|
1167
|
+
camera_props = internal.assign(camera_props, camera_spread_levels[i]);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
camera = new Camera({ props: camera_props });
|
|
1171
|
+
|
|
1172
|
+
return {
|
|
1173
|
+
c() {
|
|
1174
|
+
div = internal.element("div");
|
|
1175
|
+
internal.create_component(currentfloor.$$.fragment);
|
|
1176
|
+
t = internal.space();
|
|
1177
|
+
internal.create_component(camera.$$.fragment);
|
|
1178
|
+
internal.attr(div, "class", "plugin-floorplan-radar-container svelte-1mvqyqq");
|
|
1179
|
+
internal.set_style(div, "width", style_width, false);
|
|
1180
|
+
internal.set_style(div, "height", style_height, false);
|
|
1181
|
+
},
|
|
1182
|
+
m(target, anchor) {
|
|
1183
|
+
internal.insert(target, div, anchor);
|
|
1184
|
+
internal.mount_component(currentfloor, div, null);
|
|
1185
|
+
internal.append(div, t);
|
|
1186
|
+
internal.mount_component(camera, div, null);
|
|
1187
|
+
current = true;
|
|
1188
|
+
},
|
|
1189
|
+
p(ctx, dirty) {
|
|
1190
|
+
const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, hoverEnable, extraObjects*/ 791)
|
|
1191
|
+
? internal.get_spread_update(currentfloor_spread_levels, [
|
|
1192
|
+
{
|
|
1193
|
+
five: /*five*/ ctx[0],
|
|
1194
|
+
pxmm: /*pxmm*/ ctx[8],
|
|
1195
|
+
floorIndex: /*floorIndex*/ ctx[9],
|
|
1196
|
+
floorplanData: /*floorplanData*/ ctx[2],
|
|
1197
|
+
hoverEnable: /*hoverEnable*/ ctx[1],
|
|
1198
|
+
extraObjects: /*extraObjects*/ ctx[4]
|
|
1199
|
+
}
|
|
1200
|
+
])
|
|
1201
|
+
: {};
|
|
1202
|
+
|
|
1203
|
+
currentfloor.$set(currentfloor_changes);
|
|
1204
|
+
|
|
1205
|
+
const camera_changes = (dirty & /*pxmm, five, floorplanData, cameraImageUrl*/ 269)
|
|
1206
|
+
? internal.get_spread_update(camera_spread_levels, [
|
|
1207
|
+
{
|
|
1208
|
+
pxmm: /*pxmm*/ ctx[8],
|
|
1209
|
+
five: /*five*/ ctx[0],
|
|
1210
|
+
floorplanData: /*floorplanData*/ ctx[2],
|
|
1211
|
+
cameraImageUrl: /*cameraImageUrl*/ ctx[3]
|
|
1212
|
+
}
|
|
1213
|
+
])
|
|
1214
|
+
: {};
|
|
1215
|
+
|
|
1216
|
+
camera.$set(camera_changes);
|
|
1217
|
+
|
|
1218
|
+
if (dirty & /*contentWidth*/ 128 && style_width !== (style_width = `${/*contentWidth*/ ctx[7]}px`)) {
|
|
1219
|
+
internal.set_style(div, "width", style_width, false);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
if (dirty & /*contentHeight*/ 1024 && style_height !== (style_height = `${/*contentHeight*/ ctx[10]}px`)) {
|
|
1223
|
+
internal.set_style(div, "height", style_height, false);
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
i(local) {
|
|
1227
|
+
if (current) return;
|
|
1228
|
+
internal.transition_in(currentfloor.$$.fragment, local);
|
|
1229
|
+
internal.transition_in(camera.$$.fragment, local);
|
|
1230
|
+
current = true;
|
|
1231
|
+
},
|
|
1232
|
+
o(local) {
|
|
1233
|
+
internal.transition_out(currentfloor.$$.fragment, local);
|
|
1234
|
+
internal.transition_out(camera.$$.fragment, local);
|
|
1235
|
+
current = false;
|
|
1236
|
+
},
|
|
1237
|
+
d(detaching) {
|
|
1238
|
+
if (detaching) internal.detach(div);
|
|
1239
|
+
internal.destroy_component(currentfloor);
|
|
1240
|
+
internal.destroy_component(camera);
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function create_fragment(ctx) {
|
|
1246
|
+
let div;
|
|
1247
|
+
let div_resize_listener;
|
|
1248
|
+
let current;
|
|
1249
|
+
let if_block = /*clientWidth*/ ctx[5] !== 0 && create_if_block(ctx);
|
|
1250
|
+
|
|
1251
|
+
return {
|
|
1252
|
+
c() {
|
|
1253
|
+
div = internal.element("div");
|
|
1254
|
+
if (if_block) if_block.c();
|
|
1255
|
+
internal.attr(div, "class", "plugin-floorplan-radar svelte-1mvqyqq");
|
|
1256
|
+
internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[11].call(div));
|
|
1257
|
+
},
|
|
1258
|
+
m(target, anchor) {
|
|
1259
|
+
internal.insert(target, div, anchor);
|
|
1260
|
+
if (if_block) if_block.m(div, null);
|
|
1261
|
+
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[11].bind(div));
|
|
1262
|
+
current = true;
|
|
1263
|
+
},
|
|
1264
|
+
p(ctx, [dirty]) {
|
|
1265
|
+
if (/*clientWidth*/ ctx[5] !== 0) {
|
|
1266
|
+
if (if_block) {
|
|
1267
|
+
if_block.p(ctx, dirty);
|
|
1268
|
+
|
|
1269
|
+
if (dirty & /*clientWidth*/ 32) {
|
|
1270
|
+
internal.transition_in(if_block, 1);
|
|
1271
|
+
}
|
|
1272
|
+
} else {
|
|
1273
|
+
if_block = create_if_block(ctx);
|
|
1274
|
+
if_block.c();
|
|
1275
|
+
internal.transition_in(if_block, 1);
|
|
1276
|
+
if_block.m(div, null);
|
|
1277
|
+
}
|
|
1278
|
+
} else if (if_block) {
|
|
1279
|
+
internal.group_outros();
|
|
1280
|
+
|
|
1281
|
+
internal.transition_out(if_block, 1, 1, () => {
|
|
1282
|
+
if_block = null;
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
internal.check_outros();
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
i(local) {
|
|
1289
|
+
if (current) return;
|
|
1290
|
+
internal.transition_in(if_block);
|
|
1291
|
+
current = true;
|
|
1292
|
+
},
|
|
1293
|
+
o(local) {
|
|
1294
|
+
internal.transition_out(if_block);
|
|
1295
|
+
current = false;
|
|
1296
|
+
},
|
|
1297
|
+
d(detaching) {
|
|
1298
|
+
if (detaching) internal.detach(div);
|
|
1299
|
+
if (if_block) if_block.d();
|
|
1300
|
+
div_resize_listener();
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
function instance($$self, $$props, $$invalidate) {
|
|
1306
|
+
let { five } = $$props;
|
|
1307
|
+
let { hoverEnable } = $$props;
|
|
1308
|
+
let { floorplanData } = $$props;
|
|
1309
|
+
let { cameraImageUrl } = $$props;
|
|
1310
|
+
let { extraObjects = [] } = $$props;
|
|
1311
|
+
let pxmm = 0;
|
|
1312
|
+
let floorIndex = 0;
|
|
1313
|
+
let clientWidth = 0;
|
|
1314
|
+
let clientHeight = 0;
|
|
1315
|
+
let contentWidth = 0;
|
|
1316
|
+
let contentHeight = 0;
|
|
1317
|
+
|
|
1318
|
+
function handlePanoArrived(panoIndex) {
|
|
1319
|
+
$$invalidate(9, floorIndex = five.work.observers[panoIndex].floorIndex);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
svelte.onMount(() => {
|
|
1323
|
+
five.on('panoArrived', handlePanoArrived);
|
|
1324
|
+
|
|
1325
|
+
return () => {
|
|
1326
|
+
five.off('panoArrived', handlePanoArrived);
|
|
1327
|
+
};
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
function div_elementresize_handler() {
|
|
1331
|
+
clientWidth = this.clientWidth;
|
|
1332
|
+
clientHeight = this.clientHeight;
|
|
1333
|
+
$$invalidate(5, clientWidth);
|
|
1334
|
+
$$invalidate(6, clientHeight);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
$$self.$$set = $$props => {
|
|
1338
|
+
if ('five' in $$props) $$invalidate(0, five = $$props.five);
|
|
1339
|
+
if ('hoverEnable' in $$props) $$invalidate(1, hoverEnable = $$props.hoverEnable);
|
|
1340
|
+
if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
|
|
1341
|
+
if ('cameraImageUrl' in $$props) $$invalidate(3, cameraImageUrl = $$props.cameraImageUrl);
|
|
1342
|
+
if ('extraObjects' in $$props) $$invalidate(4, extraObjects = $$props.extraObjects);
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
$$self.$$.update = () => {
|
|
1346
|
+
if ($$self.$$.dirty & /*clientWidth, clientHeight, floorplanData, contentWidth*/ 228) {
|
|
1347
|
+
{
|
|
1348
|
+
const size = Math.min(clientWidth, clientHeight);
|
|
1349
|
+
const { max, min } = floorplanData.bounding;
|
|
1350
|
+
const boundingWidth = max.x - min.x;
|
|
1351
|
+
const boundingHeight = max.y - min.y;
|
|
1352
|
+
|
|
1353
|
+
const contentSize = (function getSize() {
|
|
1354
|
+
if (boundingWidth > boundingHeight) return [size, size / boundingWidth * boundingHeight];
|
|
1355
|
+
return [size / boundingHeight * boundingWidth, size];
|
|
1356
|
+
})();
|
|
1357
|
+
|
|
1358
|
+
$$invalidate(7, contentWidth = contentSize[0]);
|
|
1359
|
+
$$invalidate(10, contentHeight = contentSize[1]);
|
|
1360
|
+
$$invalidate(8, pxmm = contentWidth / boundingWidth);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
return [
|
|
1366
|
+
five,
|
|
1367
|
+
hoverEnable,
|
|
1368
|
+
floorplanData,
|
|
1369
|
+
cameraImageUrl,
|
|
1370
|
+
extraObjects,
|
|
1371
|
+
clientWidth,
|
|
1372
|
+
clientHeight,
|
|
1373
|
+
contentWidth,
|
|
1374
|
+
pxmm,
|
|
1375
|
+
floorIndex,
|
|
1376
|
+
contentHeight,
|
|
1377
|
+
div_elementresize_handler
|
|
1378
|
+
];
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
class Main extends internal.SvelteComponent {
|
|
1382
|
+
constructor(options) {
|
|
1383
|
+
super();
|
|
1384
|
+
|
|
1385
|
+
internal.init(
|
|
1386
|
+
this,
|
|
1387
|
+
options,
|
|
1388
|
+
instance,
|
|
1389
|
+
create_fragment,
|
|
1390
|
+
internal.safe_not_equal,
|
|
1391
|
+
{
|
|
1392
|
+
five: 0,
|
|
1393
|
+
hoverEnable: 1,
|
|
1394
|
+
floorplanData: 2,
|
|
1395
|
+
cameraImageUrl: 3,
|
|
1396
|
+
extraObjects: 4
|
|
1397
|
+
},
|
|
1398
|
+
add_css
|
|
1399
|
+
);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
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';
|
|
1404
|
+
|
|
1405
|
+
async function formatOutlines(outlines) {
|
|
1406
|
+
const headers = new Headers({ 'Content-Type': 'text/plain' });
|
|
1407
|
+
const getOutlineItem = async function (item) {
|
|
1408
|
+
const outlineItem = {
|
|
1409
|
+
index: item.index,
|
|
1410
|
+
url: item.url,
|
|
1411
|
+
svgUrl: item.svg_url,
|
|
1412
|
+
};
|
|
1413
|
+
if (item.svg_url) {
|
|
1414
|
+
const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
|
|
1415
|
+
outlineItem.svgContent = svgContent;
|
|
1416
|
+
}
|
|
1417
|
+
return outlineItem;
|
|
1418
|
+
};
|
|
1419
|
+
const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
|
|
1420
|
+
return svgOutlineItems;
|
|
1421
|
+
}
|
|
1422
|
+
function formatRoom(data) {
|
|
1423
|
+
const floorplanRoomItem = {
|
|
1424
|
+
id: data.id,
|
|
1425
|
+
size: data.size,
|
|
1426
|
+
name: data.name,
|
|
1427
|
+
path: data.path,
|
|
1428
|
+
roomType: data.room_type,
|
|
1429
|
+
floorType: data.floor_type,
|
|
1430
|
+
roomLabel: {
|
|
1431
|
+
position: data.room_label.position,
|
|
1432
|
+
positionInImage: data.room_label.position_in_image,
|
|
1433
|
+
},
|
|
1434
|
+
observerIndexs: data.observer_indexs,
|
|
1435
|
+
};
|
|
1436
|
+
return floorplanRoomItem;
|
|
1437
|
+
}
|
|
1438
|
+
function formatFloorData(_data) {
|
|
1439
|
+
return {
|
|
1440
|
+
floorName: _data.floor_name,
|
|
1441
|
+
floorIndex: _data.floor_index,
|
|
1442
|
+
rooms: _data.rooms.map(formatRoom),
|
|
1443
|
+
rules: _data.rules,
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
function formateFloorplanObserver(data) {
|
|
1447
|
+
const floorplanObserver = {
|
|
1448
|
+
index: data.index,
|
|
1449
|
+
floorIndex: data.floor_index,
|
|
1450
|
+
position: data.position,
|
|
1451
|
+
positionInImage: data.position_in_image,
|
|
1452
|
+
};
|
|
1453
|
+
return floorplanObserver;
|
|
1454
|
+
}
|
|
1455
|
+
function formatFloorplanEntrance(data) {
|
|
1456
|
+
const floorplanEntrance = {
|
|
1457
|
+
rad: data.rad,
|
|
1458
|
+
position: data.position,
|
|
1459
|
+
positionInImage: data.position_in_image,
|
|
1460
|
+
northRad: data.north_rad,
|
|
1461
|
+
roomId: data.room_id,
|
|
1462
|
+
floorIndex: data.floor_index,
|
|
1463
|
+
};
|
|
1464
|
+
return floorplanEntrance;
|
|
1465
|
+
}
|
|
1466
|
+
async function formatData(data) {
|
|
1467
|
+
const outlines = await formatOutlines(data.outlines);
|
|
1468
|
+
const bounding = data.computed_data.bounding;
|
|
1469
|
+
const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
|
|
1470
|
+
const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
|
|
1471
|
+
const floorplanData = {
|
|
1472
|
+
outlines,
|
|
1473
|
+
entrance,
|
|
1474
|
+
bounding,
|
|
1475
|
+
floorDatas,
|
|
1476
|
+
observers: data.computed_data.observers.map(formateFloorplanObserver),
|
|
1477
|
+
};
|
|
1478
|
+
return floorplanData;
|
|
1479
|
+
}
|
|
1480
|
+
function formatExtraObjects(data, five, floorplanData) {
|
|
1481
|
+
const extraObjects = data.map((object) => {
|
|
1482
|
+
const position = object.position;
|
|
1483
|
+
const icon = object.icon
|
|
1484
|
+
? object.icon
|
|
1485
|
+
: {
|
|
1486
|
+
url: FLOORPLAN_EXTRA_OBJECT_IMAGE,
|
|
1487
|
+
width: 45,
|
|
1488
|
+
height: 48,
|
|
1489
|
+
};
|
|
1490
|
+
const floorIndex = getFloorIndexFromModelPosition(position, five);
|
|
1491
|
+
const floorplanPosition = modelPosition2FloorplanPosition(position, floorplanData);
|
|
1492
|
+
const floorplanImagePosition = floorplanPosition2ImagePosition(floorplanPosition, floorplanData);
|
|
1493
|
+
return { floorIndex, icon, id: object.id, position: floorplanPosition, positionInImage: floorplanImagePosition };
|
|
1494
|
+
});
|
|
1495
|
+
return extraObjects;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
class PanoFloorplanRadarPluginController {
|
|
1499
|
+
constructor(five, params) {
|
|
1500
|
+
Object.defineProperty(this, "app", {
|
|
1501
|
+
enumerable: true,
|
|
1502
|
+
configurable: true,
|
|
1503
|
+
writable: true,
|
|
1504
|
+
value: void 0
|
|
1505
|
+
});
|
|
1506
|
+
Object.defineProperty(this, "five", {
|
|
1507
|
+
enumerable: true,
|
|
1508
|
+
configurable: true,
|
|
1509
|
+
writable: true,
|
|
1510
|
+
value: void 0
|
|
1511
|
+
});
|
|
1512
|
+
Object.defineProperty(this, "wrapperSelector", {
|
|
1513
|
+
enumerable: true,
|
|
1514
|
+
configurable: true,
|
|
1515
|
+
writable: true,
|
|
1516
|
+
value: ''
|
|
1517
|
+
});
|
|
1518
|
+
Object.defineProperty(this, "data", {
|
|
1519
|
+
enumerable: true,
|
|
1520
|
+
configurable: true,
|
|
1521
|
+
writable: true,
|
|
1522
|
+
value: void 0
|
|
1523
|
+
});
|
|
1524
|
+
Object.defineProperty(this, "wrapper", {
|
|
1525
|
+
enumerable: true,
|
|
1526
|
+
configurable: true,
|
|
1527
|
+
writable: true,
|
|
1528
|
+
value: null
|
|
1529
|
+
});
|
|
1530
|
+
Object.defineProperty(this, "extraObjects", {
|
|
1531
|
+
enumerable: true,
|
|
1532
|
+
configurable: true,
|
|
1533
|
+
writable: true,
|
|
1534
|
+
value: void 0
|
|
1535
|
+
});
|
|
1536
|
+
Object.defineProperty(this, "originExtraObjects", {
|
|
1537
|
+
enumerable: true,
|
|
1538
|
+
configurable: true,
|
|
1539
|
+
writable: true,
|
|
1540
|
+
value: void 0
|
|
1541
|
+
});
|
|
1542
|
+
Object.defineProperty(this, "configs", {
|
|
1543
|
+
enumerable: true,
|
|
1544
|
+
configurable: true,
|
|
1545
|
+
writable: true,
|
|
1546
|
+
value: {}
|
|
1547
|
+
});
|
|
1548
|
+
Object.defineProperty(this, "dispose", {
|
|
1549
|
+
enumerable: true,
|
|
1550
|
+
configurable: true,
|
|
1551
|
+
writable: true,
|
|
1552
|
+
value: () => {
|
|
1553
|
+
var _a;
|
|
1554
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1557
|
+
Object.defineProperty(this, "load", {
|
|
1558
|
+
enumerable: true,
|
|
1559
|
+
configurable: true,
|
|
1560
|
+
writable: true,
|
|
1561
|
+
value: async (data) => {
|
|
1562
|
+
const copyData = JSON.parse(JSON.stringify(data));
|
|
1563
|
+
const floorplanData = await formatData(copyData);
|
|
1564
|
+
this.data = floorplanData;
|
|
1565
|
+
// const loadImage = async () => {
|
|
1566
|
+
// const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
|
|
1567
|
+
// // 当有 svgString 时,没有加载过程
|
|
1568
|
+
// if (floorplanData.outlines[floorIndex]?.svgContent) return
|
|
1569
|
+
// // 如果当前楼层图片不存在,不存在加载过程
|
|
1570
|
+
// const nowFloorImageSrc = floorplanData.outlines[floorIndex]?.url
|
|
1571
|
+
// if (!nowFloorImageSrc) return
|
|
1572
|
+
// // 图片加载完成时再 render
|
|
1573
|
+
// await new Promise<void>((resolve) => {
|
|
1574
|
+
// const nowFloorImage = new Image()
|
|
1575
|
+
// nowFloorImage.src = nowFloorImageSrc
|
|
1576
|
+
// nowFloorImage.onload = () => resolve()
|
|
1577
|
+
// })
|
|
1578
|
+
// }
|
|
1579
|
+
// await loadImage()
|
|
1580
|
+
this.render();
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1583
|
+
this.five = five;
|
|
1584
|
+
(params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
|
|
1585
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.wrapper) === 'string')
|
|
1586
|
+
this.wrapperSelector = params.wrapper;
|
|
1587
|
+
else if ((params === null || params === void 0 ? void 0 : params.wrapper) instanceof Element)
|
|
1588
|
+
this.wrapper = params.wrapper;
|
|
1589
|
+
five.once('dispose', this.dispose);
|
|
1590
|
+
}
|
|
1591
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
1592
|
+
appendTo(wrapper) {
|
|
1593
|
+
this.wrapper = wrapper;
|
|
1594
|
+
this.render();
|
|
1595
|
+
}
|
|
1596
|
+
changeConfigs(configs) {
|
|
1597
|
+
Object.assign(this.configs, configs);
|
|
1598
|
+
this.render();
|
|
1599
|
+
}
|
|
1600
|
+
setExtraObjectsWith3DPositions(data) {
|
|
1601
|
+
this.originExtraObjects = data;
|
|
1602
|
+
if (!this.data)
|
|
1603
|
+
return;
|
|
1604
|
+
this.extraObjects = formatExtraObjects(data, this.five, this.data);
|
|
1605
|
+
this.render();
|
|
1606
|
+
}
|
|
1607
|
+
render() {
|
|
1608
|
+
var _a;
|
|
1609
|
+
// 处理 wrapper
|
|
1610
|
+
if (!this.wrapper) {
|
|
1611
|
+
const _wrapper = document.querySelector(this.wrapperSelector);
|
|
1612
|
+
this.wrapper = _wrapper;
|
|
1613
|
+
}
|
|
1614
|
+
if (!this.data || !this.wrapper)
|
|
1615
|
+
return;
|
|
1616
|
+
if (!this.extraObjects && this.originExtraObjects) {
|
|
1617
|
+
this.extraObjects = formatExtraObjects(this.originExtraObjects, this.five, this.data);
|
|
1618
|
+
}
|
|
1619
|
+
const props = {
|
|
1620
|
+
five: this.five,
|
|
1621
|
+
floorplanData: this.data,
|
|
1622
|
+
extraObjects: this.extraObjects,
|
|
1623
|
+
cameraImageUrl: this.configs.cameraImageUrl,
|
|
1624
|
+
hoverEnable: (_a = this.configs.hoverEnable) !== null && _a !== void 0 ? _a : false,
|
|
1625
|
+
};
|
|
1626
|
+
if (!this.app) {
|
|
1627
|
+
this.app = new Main({
|
|
1628
|
+
target: this.wrapper,
|
|
1629
|
+
props,
|
|
1630
|
+
});
|
|
1631
|
+
return;
|
|
1632
|
+
}
|
|
1633
|
+
this.app.$set(props);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
const PanoFloorplanRadarPlugin = (five, params) => {
|
|
1638
|
+
return new PanoFloorplanRadarPluginController(five, params);
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
exports.PanoFloorplanRadarPlugin = PanoFloorplanRadarPlugin;
|
|
1642
|
+
exports["default"] = PanoFloorplanRadarPlugin;
|