@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
|
@@ -1,44 +1,462 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { omit } from '../../shared-utils/filter';
|
|
2
|
+
import { Subscribe } from '@realsee/five';
|
|
3
|
+
import { FloorplanErrorType, FIVE_CAMERA_DEFAULT_FOV, SHOW_ANIME_DURATION } from './utils/constant';
|
|
2
4
|
import to from '../../shared-utils/to';
|
|
5
|
+
import Main from '../Components/Main';
|
|
3
6
|
import formatData from '../utils/formatData';
|
|
4
7
|
import equal from '../../shared-utils/equal';
|
|
5
8
|
import getPxmm from '../../shared-utils/getPxmm';
|
|
6
9
|
import correctFiveState, { checkShowState } from './utils/correctFiveState';
|
|
7
10
|
import changeModelCanvasOpacity from '../../shared-utils/changeModelCanvasOpacity';
|
|
8
|
-
import { omit } from '../../shared-utils/filter';
|
|
9
|
-
import { Subscribe } from '@realsee/five';
|
|
10
|
-
import { FloorplanErrorType, FIVE_CAMERA_DEFAULT_FOV, SHOW_ANIME_DURATION } from './utils/constant';
|
|
11
11
|
export const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
|
|
12
12
|
export default class ModelFloorplanPluginController {
|
|
13
|
-
name = MODEL_FLOORPLAN_PLUGIN_NAME;
|
|
14
|
-
/** 用于绑定事件钩子 */
|
|
15
|
-
hooks;
|
|
16
|
-
/** 展示状态 */
|
|
17
|
-
visible = false;
|
|
18
|
-
/** 户型图大小 */
|
|
19
|
-
size = { width: 0, height: 0 };
|
|
20
|
-
app = undefined;
|
|
21
|
-
pxmm = 0;
|
|
22
|
-
five;
|
|
23
|
-
panoIndex = 0;
|
|
24
|
-
floorIndex = 0;
|
|
25
|
-
configs = {};
|
|
26
|
-
lastPanoramaLongitude = 0;
|
|
27
|
-
selector;
|
|
28
|
-
floorplanData;
|
|
29
|
-
wrapper;
|
|
30
|
-
container = document.createElement('div');
|
|
31
|
-
showState;
|
|
32
|
-
/** 记录上次 show 的参数,如果不一致,需要 reject 掉正在进行的 showPromise */
|
|
33
|
-
ModelFloorplanPluginsShowOpts;
|
|
34
|
-
showPromise;
|
|
35
|
-
showRejection;
|
|
36
13
|
constructor(five, params) {
|
|
14
|
+
var _a;
|
|
15
|
+
Object.defineProperty(this, "name", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: MODEL_FLOORPLAN_PLUGIN_NAME
|
|
20
|
+
});
|
|
21
|
+
/** 用于绑定事件钩子 */
|
|
22
|
+
Object.defineProperty(this, "hooks", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: void 0
|
|
27
|
+
});
|
|
28
|
+
/** 展示状态 */
|
|
29
|
+
Object.defineProperty(this, "visible", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: false
|
|
34
|
+
});
|
|
35
|
+
/** 户型图大小 */
|
|
36
|
+
Object.defineProperty(this, "size", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: { width: 0, height: 0 }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(this, "app", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: undefined
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(this, "pxmm", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: 0
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(this, "five", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(this, "panoIndex", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: 0
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(this, "floorIndex", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: 0
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(this, "configs", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: {}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(this, "lastPanoramaLongitude", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: 0
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(this, "selector", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: void 0
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(this, "floorplanData", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
configurable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
value: void 0
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(this, "wrapper", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true,
|
|
99
|
+
writable: true,
|
|
100
|
+
value: void 0
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(this, "container", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
value: document.createElement('div')
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(this, "showState", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
value: void 0
|
|
113
|
+
});
|
|
114
|
+
/** 记录上次 show 的参数,如果不一致,需要 reject 掉正在进行的 showPromise */
|
|
115
|
+
Object.defineProperty(this, "ModelFloorplanPluginsShowOpts", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
configurable: true,
|
|
118
|
+
writable: true,
|
|
119
|
+
value: void 0
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(this, "showPromise", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
configurable: true,
|
|
124
|
+
writable: true,
|
|
125
|
+
value: void 0
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(this, "showRejection", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
configurable: true,
|
|
130
|
+
writable: true,
|
|
131
|
+
value: void 0
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(this, "dispose", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
configurable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
value: () => {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
const five = this.five;
|
|
140
|
+
this.hide();
|
|
141
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
142
|
+
(_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
|
|
143
|
+
five.off('modelLoaded', this.handleModelLoaded);
|
|
144
|
+
five.off('modeChange', this.handleModeChange);
|
|
145
|
+
five.off('panGesture', this.handlePanGesture);
|
|
146
|
+
five.off('panoArrived', this.handlePanoArrived);
|
|
147
|
+
five.off('wantsChangeMode', this.handleWantsChangeMode);
|
|
148
|
+
five.off('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
149
|
+
five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
150
|
+
five.off('modelShownFloorChange', this.onModelShownFloorChange);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
/** 更新户型图大小 */
|
|
154
|
+
Object.defineProperty(this, "updateSize", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
configurable: true,
|
|
157
|
+
writable: true,
|
|
158
|
+
value: () => {
|
|
159
|
+
if (!this.floorplanData)
|
|
160
|
+
return;
|
|
161
|
+
if (!checkShowState(this.five, this.showState))
|
|
162
|
+
return;
|
|
163
|
+
if (!this.container || !this.wrapper)
|
|
164
|
+
return;
|
|
165
|
+
// 计算户型图展示大小
|
|
166
|
+
const { min, max } = this.floorplanData.bounding;
|
|
167
|
+
const width = max.x - min.x;
|
|
168
|
+
const height = max.y - min.y;
|
|
169
|
+
// 每毫米对应的 px 值
|
|
170
|
+
const options = this.configs.attachedTo ? { attachedTo: this.configs.attachedTo } : undefined;
|
|
171
|
+
const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
|
|
172
|
+
const _width = Math.ceil(width * pxmm);
|
|
173
|
+
const _height = Math.ceil(height * pxmm);
|
|
174
|
+
if (this.size.width === _width && this.size.height === _height)
|
|
175
|
+
return;
|
|
176
|
+
this.pxmm = pxmm;
|
|
177
|
+
this.size = { width: _width, height: _height };
|
|
178
|
+
this.container.style.width = _width + 'px';
|
|
179
|
+
this.container.style.height = _height + 'px';
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
/** 展示户型图
|
|
183
|
+
* 1. show 函数大部分情况下需要耗时
|
|
184
|
+
* 2. 如果当前已经在展示中,将不会触发任何事件
|
|
185
|
+
* 3. 如果展示过程被中断,将抛出错误
|
|
186
|
+
* 4. 多次调用 show 方法,只会触发一次 showAnimationEnded 事件,但是展示结果会取决于最后一次调用参数
|
|
187
|
+
* 5. 如果多次调用 show 方法,参数与上次参数不一致时,上次 show Promise 会被 reject
|
|
188
|
+
* @param opts.floorIndex 楼层
|
|
189
|
+
* @param opts.modelOpacity 模型透明度
|
|
190
|
+
* @param opts.immediately 是否立即展示
|
|
191
|
+
* @param opts.isAutoShow 是否是自动展示
|
|
192
|
+
*/
|
|
193
|
+
Object.defineProperty(this, "show", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
configurable: true,
|
|
196
|
+
writable: true,
|
|
197
|
+
value: async (opts) => {
|
|
198
|
+
var _a, _b;
|
|
199
|
+
// 已经在展示中了
|
|
200
|
+
if (!this.showPromise && this.visible)
|
|
201
|
+
return true;
|
|
202
|
+
if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
|
|
203
|
+
throw new Error(FloorplanErrorType.ModelNotLoaded);
|
|
204
|
+
if (!this.floorplanData)
|
|
205
|
+
throw new Error(FloorplanErrorType.DataNotLoaded);
|
|
206
|
+
this.visible = true;
|
|
207
|
+
if (this.showPromise) {
|
|
208
|
+
const sameWithLastOpts = equal(opts, this.ModelFloorplanPluginsShowOpts, { deep: false });
|
|
209
|
+
if (!!this.showPromise && sameWithLastOpts)
|
|
210
|
+
return this.showPromise;
|
|
211
|
+
if (!!this.showPromise && !sameWithLastOpts)
|
|
212
|
+
(_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
|
|
213
|
+
}
|
|
214
|
+
this.ModelFloorplanPluginsShowOpts = opts;
|
|
215
|
+
const getShowPromise = async () => {
|
|
216
|
+
var _a, _b;
|
|
217
|
+
let hasRejected = false;
|
|
218
|
+
let externalErrorMsg;
|
|
219
|
+
this.showRejection = (errorMsg) => {
|
|
220
|
+
hasRejected = true;
|
|
221
|
+
externalErrorMsg = errorMsg;
|
|
222
|
+
};
|
|
223
|
+
const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
|
|
224
|
+
if (correctError)
|
|
225
|
+
throw correctError;
|
|
226
|
+
// 异步结束要判断当前是不是被中断了,是不是调用了隐藏
|
|
227
|
+
if (hasRejected)
|
|
228
|
+
throw externalErrorMsg ? new Error(externalErrorMsg) : new Error(FloorplanErrorType.UnknownError);
|
|
229
|
+
if (!this.visible)
|
|
230
|
+
throw new Error(FloorplanErrorType.UnknownError);
|
|
231
|
+
// 更新户型图状态
|
|
232
|
+
this.visible = true;
|
|
233
|
+
// 更新户型图大小
|
|
234
|
+
this.updateSize();
|
|
235
|
+
// 高亮当前楼层,有两个目的
|
|
236
|
+
// 1. 点击模型时,可以跳转到当前楼层的点位上
|
|
237
|
+
// 2. 当前楼层比较小时,户型图也比较小,如果展示全部楼层,会展示户型图外有一圈模型
|
|
238
|
+
if (opts === null || opts === void 0 ? void 0 : opts.floorIndex)
|
|
239
|
+
this.floorIndex = opts.floorIndex;
|
|
240
|
+
this.five.model.show(this.floorIndex);
|
|
241
|
+
// 模型消失, 渲染户型图
|
|
242
|
+
const modelOpacity = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _a !== void 0 ? _a : this.configs.modelOpacity) !== null && _b !== void 0 ? _b : 1;
|
|
243
|
+
const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
|
|
244
|
+
changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
|
|
245
|
+
this.render(renderDuration);
|
|
246
|
+
// 展示之后的事件监听
|
|
247
|
+
this.five.on('wantsGesture', this.handleWantsGesture);
|
|
248
|
+
this.five.on('wantsTapGesture', this.handleWantsTapGesture);
|
|
249
|
+
return true;
|
|
250
|
+
};
|
|
251
|
+
const showPromise = getShowPromise()
|
|
252
|
+
.then(() => {
|
|
253
|
+
var _a;
|
|
254
|
+
this.hooks.emit('showAnimationEnded', { auto: !!(opts === null || opts === void 0 ? void 0 : opts.isAutoShow), userAction: (_a = opts === null || opts === void 0 ? void 0 : opts.userAction) !== null && _a !== void 0 ? _a : true });
|
|
255
|
+
return true;
|
|
256
|
+
})
|
|
257
|
+
.catch((error) => {
|
|
258
|
+
// 自动展示的报错内部处理
|
|
259
|
+
if (opts === null || opts === void 0 ? void 0 : opts.isAutoShow)
|
|
260
|
+
return false;
|
|
261
|
+
if (!(error instanceof Error))
|
|
262
|
+
return false;
|
|
263
|
+
// 非自动展示的报错继续向外抛出
|
|
264
|
+
throw error;
|
|
265
|
+
})
|
|
266
|
+
.finally(() => {
|
|
267
|
+
this.showPromise = undefined;
|
|
268
|
+
this.showRejection = undefined;
|
|
269
|
+
});
|
|
270
|
+
this.showPromise = showPromise;
|
|
271
|
+
return showPromise;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
/** 隐藏户型图 */
|
|
275
|
+
Object.defineProperty(this, "hide", {
|
|
276
|
+
enumerable: true,
|
|
277
|
+
configurable: true,
|
|
278
|
+
writable: true,
|
|
279
|
+
value: (options) => {
|
|
280
|
+
var _a, _b;
|
|
281
|
+
if (this.size.width === 0)
|
|
282
|
+
return true;
|
|
283
|
+
if (this.visible === false)
|
|
284
|
+
return true;
|
|
285
|
+
const isAutoHide = !!(options === null || options === void 0 ? void 0 : options.isAutoHide);
|
|
286
|
+
this.five.off('wantsGesture', this.handleWantsGesture);
|
|
287
|
+
this.five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
288
|
+
this.visible = false;
|
|
289
|
+
(_a = this.showRejection) === null || _a === void 0 ? void 0 : _a.call(this, FloorplanErrorType.BreakOffByHide);
|
|
290
|
+
changeModelCanvasOpacity(this.five, 1, 0);
|
|
291
|
+
this.render();
|
|
292
|
+
this.hooks.emit('hide', { auto: isAutoHide, userAction: (_b = options === null || options === void 0 ? void 0 : options.userAction) !== null && _b !== void 0 ? _b : true });
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
297
|
+
Object.defineProperty(this, "onModelShownFloorChange", {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
configurable: true,
|
|
300
|
+
writable: true,
|
|
301
|
+
value: (shownFloor) => {
|
|
302
|
+
if (this.floorIndex === shownFloor)
|
|
303
|
+
return;
|
|
304
|
+
if (shownFloor === null) {
|
|
305
|
+
const panoIndex = this.five.getCurrentState().panoIndex;
|
|
306
|
+
this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
this.floorIndex = shownFloor;
|
|
310
|
+
this.updateSize();
|
|
311
|
+
this.render();
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
Object.defineProperty(this, "handleModelLoaded", {
|
|
315
|
+
enumerable: true,
|
|
316
|
+
configurable: true,
|
|
317
|
+
writable: true,
|
|
318
|
+
value: () => {
|
|
319
|
+
if (this.wrapper)
|
|
320
|
+
return;
|
|
321
|
+
if (!this.selector)
|
|
322
|
+
return;
|
|
323
|
+
const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
|
|
324
|
+
if (!wrapper)
|
|
325
|
+
throw new Error('不正确的父容器选择器');
|
|
326
|
+
this.wrapper = wrapper;
|
|
327
|
+
wrapper.append(this.container);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(this, "handleClick", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
configurable: true,
|
|
333
|
+
writable: true,
|
|
334
|
+
value: () => {
|
|
335
|
+
if (!this.visible)
|
|
336
|
+
return;
|
|
337
|
+
const prevented = this.hooks.emit('click');
|
|
338
|
+
if (prevented)
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(this, "handleWantsTapGesture", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
configurable: true,
|
|
345
|
+
writable: true,
|
|
346
|
+
value: () => this.handleClick()
|
|
347
|
+
});
|
|
348
|
+
/** 从 Panorama 切换到其他模态时,记录当前的相机水平视角 */
|
|
349
|
+
Object.defineProperty(this, "handleWantsChangeMode", {
|
|
350
|
+
enumerable: true,
|
|
351
|
+
configurable: true,
|
|
352
|
+
writable: true,
|
|
353
|
+
value: (mode) => {
|
|
354
|
+
if (mode !== 'Panorama') {
|
|
355
|
+
this.lastPanoramaLongitude = this.five.getCurrentState().longitude;
|
|
356
|
+
}
|
|
357
|
+
if (mode !== 'Floorplan')
|
|
358
|
+
this.hide();
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
/** 监听模型态变化,只有在模型态才进行手势动作监听 */
|
|
362
|
+
Object.defineProperty(this, "handleModeChange", {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
configurable: true,
|
|
365
|
+
writable: true,
|
|
366
|
+
value: (mode) => {
|
|
367
|
+
if (mode === 'Floorplan') {
|
|
368
|
+
this.five.on('panGesture', this.handlePanGesture);
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
this.hide();
|
|
372
|
+
this.five.off('panGesture', this.handlePanGesture);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
/** panoIndex 改变时,更新 floorIndex */
|
|
377
|
+
Object.defineProperty(this, "handlePanoArrived", {
|
|
378
|
+
enumerable: true,
|
|
379
|
+
configurable: true,
|
|
380
|
+
writable: true,
|
|
381
|
+
value: (index) => {
|
|
382
|
+
var _a;
|
|
383
|
+
if (!((_a = this.five) === null || _a === void 0 ? void 0 : _a.work))
|
|
384
|
+
return;
|
|
385
|
+
this.panoIndex = index;
|
|
386
|
+
this.floorIndex = this.five.work.observers[index].floorIndex;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
/** 当户型图正在展示中的时候禁用惯性 */
|
|
390
|
+
Object.defineProperty(this, "handleWantsInteriaPan", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
configurable: true,
|
|
393
|
+
writable: true,
|
|
394
|
+
value: () => {
|
|
395
|
+
if (this.visible)
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
/** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
|
|
400
|
+
Object.defineProperty(this, "handleWantsGesture", {
|
|
401
|
+
enumerable: true,
|
|
402
|
+
configurable: true,
|
|
403
|
+
writable: true,
|
|
404
|
+
value: (type, pointers) => {
|
|
405
|
+
if (!this.visible)
|
|
406
|
+
return;
|
|
407
|
+
if (pointers.length > 1)
|
|
408
|
+
return false;
|
|
409
|
+
if (type === 'mouseWheel')
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
/** 监听三维模型滑动
|
|
414
|
+
* 1. 在三维模型转动结束时,如果达到设置的阈值,会自动切换到户型图
|
|
415
|
+
* 2. 如何户型图已经展示,滑动时关闭户型图
|
|
416
|
+
*/
|
|
417
|
+
Object.defineProperty(this, "handlePanGesture", {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
configurable: true,
|
|
420
|
+
writable: true,
|
|
421
|
+
value: async ({ latitude, longitude }, isFinal) => {
|
|
422
|
+
if (this.five.getCurrentState().mode !== 'Floorplan')
|
|
423
|
+
return;
|
|
424
|
+
if (this.configs.autoShowEnable === false)
|
|
425
|
+
return;
|
|
426
|
+
// 如果操作结束后,户型图还在展示中,初始化模型状态
|
|
427
|
+
if (isFinal && this.visible)
|
|
428
|
+
return this.five.setState(this.showState, true);
|
|
429
|
+
// 满足消失的条件:
|
|
430
|
+
// 水平旋转角大于正负 5 度 || 俯仰角度大于 5 度
|
|
431
|
+
const latitudeHide = Math.abs(latitude - Math.PI / 2) > (5 * Math.PI) / 180;
|
|
432
|
+
const longitudeHide = longitude > 5 * (Math.PI / 180) && longitude < 355 * (Math.PI / 180);
|
|
433
|
+
const canHide = latitudeHide || longitudeHide;
|
|
434
|
+
if (this.visible && canHide)
|
|
435
|
+
return this.hide({ isAutoHide: true });
|
|
436
|
+
if (this.five.camera.fov / FIVE_CAMERA_DEFAULT_FOV < 0.8)
|
|
437
|
+
return;
|
|
438
|
+
// 户型图展示条件:
|
|
439
|
+
// 水平旋转角正负 30 度 && 俯仰角度小于 10 度
|
|
440
|
+
const latitudeVisible = Math.abs(latitude - Math.PI / 2) < (10 * Math.PI) / 180;
|
|
441
|
+
const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
|
|
442
|
+
if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
|
|
443
|
+
// 当手指离开时需要等惯性结束之后在进行判断
|
|
444
|
+
const handleInteriaPan = async (any, isFinal) => {
|
|
445
|
+
if (!isFinal)
|
|
446
|
+
return;
|
|
447
|
+
this.five.off('interiaPan', handleInteriaPan);
|
|
448
|
+
await this.show({ isAutoShow: true });
|
|
449
|
+
};
|
|
450
|
+
this.five.on('interiaPan', handleInteriaPan);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
});
|
|
37
455
|
this.five = five;
|
|
38
456
|
this.hooks = new Subscribe();
|
|
39
457
|
this.selector = params.selector;
|
|
40
458
|
this.configs = omit(params, ['selector']);
|
|
41
|
-
this.showState = { longitude: 0, latitude: Math.PI / 2, fov: FIVE_CAMERA_DEFAULT_FOV / (params
|
|
459
|
+
this.showState = { longitude: 0, latitude: Math.PI / 2, fov: FIVE_CAMERA_DEFAULT_FOV / ((_a = params === null || params === void 0 ? void 0 : params.scale) !== null && _a !== void 0 ? _a : 1) };
|
|
42
460
|
// 设置 container 样式
|
|
43
461
|
this.container.classList.add('floorplan-plugin');
|
|
44
462
|
Object.assign(this.container.style, {
|
|
@@ -46,33 +464,18 @@ export default class ModelFloorplanPluginController {
|
|
|
46
464
|
left: '50%',
|
|
47
465
|
top: '50%',
|
|
48
466
|
transform: 'translate(-50%, -50%)',
|
|
49
|
-
pointerEvents: 'none',
|
|
50
467
|
zIndex: 10,
|
|
51
468
|
});
|
|
469
|
+
this.five.addExtraElement(this.container);
|
|
52
470
|
// 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
|
|
53
471
|
this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
|
|
54
472
|
five.once('dispose', this.dispose);
|
|
55
473
|
five.on('modeChange', this.handleModeChange);
|
|
56
|
-
five.on('panGesture', this.handlePanGesture);
|
|
57
474
|
five.on('panoArrived', this.handlePanoArrived);
|
|
58
475
|
five.on('wantsChangeMode', this.handleWantsChangeMode);
|
|
59
476
|
five.on('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
60
477
|
five.on('modelShownFloorChange', this.onModelShownFloorChange);
|
|
61
478
|
}
|
|
62
|
-
dispose = () => {
|
|
63
|
-
const five = this.five;
|
|
64
|
-
this.hide();
|
|
65
|
-
this.app?.$destroy();
|
|
66
|
-
this.container?.remove();
|
|
67
|
-
five.off('modelLoaded', this.handleModelLoaded);
|
|
68
|
-
five.off('modeChange', this.handleModeChange);
|
|
69
|
-
five.off('panGesture', this.handlePanGesture);
|
|
70
|
-
five.off('panoArrived', this.handlePanoArrived);
|
|
71
|
-
five.off('wantsChangeMode', this.handleWantsChangeMode);
|
|
72
|
-
five.off('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
73
|
-
five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
74
|
-
five.off('modelShownFloorChange', this.onModelShownFloorChange);
|
|
75
|
-
};
|
|
76
479
|
/** 加载户型图数据 */
|
|
77
480
|
async load(data) {
|
|
78
481
|
const copyData = JSON.parse(JSON.stringify(data));
|
|
@@ -85,134 +488,9 @@ export default class ModelFloorplanPluginController {
|
|
|
85
488
|
wrapper.appendChild(this.container);
|
|
86
489
|
return this;
|
|
87
490
|
}
|
|
88
|
-
/** 更新户型图大小 */
|
|
89
|
-
updateSize = () => {
|
|
90
|
-
if (!this.floorplanData)
|
|
91
|
-
return;
|
|
92
|
-
if (!checkShowState(this.five, this.showState))
|
|
93
|
-
return;
|
|
94
|
-
if (!this.container || !this.wrapper)
|
|
95
|
-
return;
|
|
96
|
-
// 计算户型图展示大小
|
|
97
|
-
const { min, max } = this.floorplanData.bounding;
|
|
98
|
-
const width = max.x - min.x;
|
|
99
|
-
const height = max.y - min.y;
|
|
100
|
-
// 每毫米对应的 px 值
|
|
101
|
-
const pxmm = getPxmm(this.five, this.wrapper);
|
|
102
|
-
const _width = Math.ceil(width * pxmm);
|
|
103
|
-
const _height = Math.ceil(height * pxmm);
|
|
104
|
-
if (this.size.width === _width && this.size.height === _height)
|
|
105
|
-
return;
|
|
106
|
-
this.pxmm = pxmm;
|
|
107
|
-
this.size = { width: _width, height: _height };
|
|
108
|
-
this.container.style.width = _width + 'px';
|
|
109
|
-
this.container.style.height = _height + 'px';
|
|
110
|
-
};
|
|
111
|
-
/** 展示户型图
|
|
112
|
-
* 1. show 函数大部分情况下需要耗时
|
|
113
|
-
* 2. 如果当前已经在展示中,将不会触发任何事件
|
|
114
|
-
* 3. 如果展示过程被中断,将抛出错误
|
|
115
|
-
* 4. 多次调用 show 方法,只会触发一次 showAnimationEnded 事件,但是展示结果会取决于最后一次调用参数
|
|
116
|
-
* 5. 如果多次调用 show 方法,参数与上次参数不一致时,上次 show Promise 会被 reject
|
|
117
|
-
* @param opts.floorIndex 楼层
|
|
118
|
-
* @param opts.modelOpacity 模型透明度
|
|
119
|
-
* @param opts.immediately 是否立即展示
|
|
120
|
-
* @param opts.isAutoShow 是否是自动展示
|
|
121
|
-
*/
|
|
122
|
-
show = async (opts) => {
|
|
123
|
-
// 已经在展示中了
|
|
124
|
-
if (!this.showPromise && this.visible)
|
|
125
|
-
return true;
|
|
126
|
-
if (!this.five.model?.loaded)
|
|
127
|
-
throw new Error(FloorplanErrorType.ModelNotLoaded);
|
|
128
|
-
if (!this.floorplanData)
|
|
129
|
-
throw new Error(FloorplanErrorType.DataNotLoaded);
|
|
130
|
-
this.visible = true;
|
|
131
|
-
if (this.showPromise) {
|
|
132
|
-
const sameWithLastOpts = equal(opts, this.ModelFloorplanPluginsShowOpts, { deep: false });
|
|
133
|
-
if (!!this.showPromise && sameWithLastOpts)
|
|
134
|
-
return this.showPromise;
|
|
135
|
-
if (!!this.showPromise && !sameWithLastOpts)
|
|
136
|
-
this.showRejection?.(FloorplanErrorType.DifferentShowParams);
|
|
137
|
-
}
|
|
138
|
-
this.ModelFloorplanPluginsShowOpts = opts;
|
|
139
|
-
const getShowPromise = async () => {
|
|
140
|
-
let hasRejected = false;
|
|
141
|
-
let externalErrorMsg;
|
|
142
|
-
this.showRejection = (errorMsg) => {
|
|
143
|
-
hasRejected = true;
|
|
144
|
-
externalErrorMsg = errorMsg;
|
|
145
|
-
};
|
|
146
|
-
const [correctError] = await to(correctFiveState(this.five, this.showState, opts?.userAction));
|
|
147
|
-
if (correctError)
|
|
148
|
-
throw correctError;
|
|
149
|
-
// 异步结束要判断当前是不是被中断了,是不是调用了隐藏
|
|
150
|
-
if (hasRejected)
|
|
151
|
-
throw externalErrorMsg ? new Error(externalErrorMsg) : new Error(FloorplanErrorType.UnknownError);
|
|
152
|
-
if (!this.visible)
|
|
153
|
-
throw new Error(FloorplanErrorType.UnknownError);
|
|
154
|
-
// 更新户型图状态
|
|
155
|
-
this.visible = true;
|
|
156
|
-
// 更新户型图大小
|
|
157
|
-
this.updateSize();
|
|
158
|
-
// 高亮当前楼层,有两个目的
|
|
159
|
-
// 1. 点击模型时,可以跳转到当前楼层的点位上
|
|
160
|
-
// 2. 当前楼层比较小时,户型图也比较小,如果展示全部楼层,会展示户型图外有一圈模型
|
|
161
|
-
if (opts?.floorIndex)
|
|
162
|
-
this.floorIndex = opts.floorIndex;
|
|
163
|
-
this.five.model.show(this.floorIndex);
|
|
164
|
-
// 模型消失, 渲染户型图
|
|
165
|
-
const modelOpacity = opts?.modelOpacity ?? this.configs.modelOpacity ?? 1;
|
|
166
|
-
const renderDuration = opts?.immediately ? 0 : SHOW_ANIME_DURATION;
|
|
167
|
-
changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
|
|
168
|
-
this.render(renderDuration);
|
|
169
|
-
// 展示之后的事件监听
|
|
170
|
-
this.five.on('wantsGesture', this.handleWantsGesture);
|
|
171
|
-
this.five.on('wantsTapGesture', this.handleWantsTapGesture);
|
|
172
|
-
return true;
|
|
173
|
-
};
|
|
174
|
-
const showPromise = getShowPromise()
|
|
175
|
-
.then(() => {
|
|
176
|
-
this.hooks.emit('showAnimationEnded', { auto: !!opts?.isAutoShow, userAction: opts?.userAction ?? true });
|
|
177
|
-
return true;
|
|
178
|
-
})
|
|
179
|
-
.catch((error) => {
|
|
180
|
-
// 自动展示的报错内部处理
|
|
181
|
-
if (opts?.isAutoShow)
|
|
182
|
-
return false;
|
|
183
|
-
if (!(error instanceof Error))
|
|
184
|
-
return false;
|
|
185
|
-
// 非自动展示的报错继续向外抛出
|
|
186
|
-
throw error;
|
|
187
|
-
})
|
|
188
|
-
.finally(() => {
|
|
189
|
-
this.showPromise = undefined;
|
|
190
|
-
this.showRejection = undefined;
|
|
191
|
-
});
|
|
192
|
-
this.showPromise = showPromise;
|
|
193
|
-
return showPromise;
|
|
194
|
-
};
|
|
195
|
-
/** 隐藏户型图 */
|
|
196
|
-
hide = (options) => {
|
|
197
|
-
if (this.size.width === 0)
|
|
198
|
-
return true;
|
|
199
|
-
if (this.visible === false)
|
|
200
|
-
return true;
|
|
201
|
-
const isAutoHide = !!options?.isAutoHide;
|
|
202
|
-
this.five.off('wantsGesture', this.handleWantsGesture);
|
|
203
|
-
this.five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
204
|
-
this.visible = false;
|
|
205
|
-
this.showRejection?.(FloorplanErrorType.BreakOffByHide);
|
|
206
|
-
changeModelCanvasOpacity(this.five, 1, 0);
|
|
207
|
-
this.render();
|
|
208
|
-
this.hooks.emit('hide', { auto: isAutoHide, userAction: options?.userAction ?? true });
|
|
209
|
-
return true;
|
|
210
|
-
};
|
|
211
491
|
/** 更改户型图楼层 */
|
|
212
492
|
changeFloor(floorIndex) {
|
|
213
493
|
this.five.model.show(floorIndex);
|
|
214
|
-
this.floorIndex = floorIndex;
|
|
215
|
-
this.render();
|
|
216
494
|
}
|
|
217
495
|
changeConfigs(params) {
|
|
218
496
|
Object.assign(this.configs, params);
|
|
@@ -220,128 +498,26 @@ export default class ModelFloorplanPluginController {
|
|
|
220
498
|
return;
|
|
221
499
|
this.render();
|
|
222
500
|
}
|
|
223
|
-
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
224
|
-
onModelShownFloorChange = (shownFloor) => {
|
|
225
|
-
if (shownFloor === null)
|
|
226
|
-
return;
|
|
227
|
-
this.floorIndex = shownFloor;
|
|
228
|
-
this.render();
|
|
229
|
-
};
|
|
230
|
-
handleModelLoaded = () => {
|
|
231
|
-
if (this.wrapper)
|
|
232
|
-
return;
|
|
233
|
-
if (!this.selector)
|
|
234
|
-
return;
|
|
235
|
-
const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
|
|
236
|
-
if (!wrapper)
|
|
237
|
-
throw new Error('不正确的父容器选择器');
|
|
238
|
-
this.wrapper = wrapper;
|
|
239
|
-
wrapper.append(this.container);
|
|
240
|
-
};
|
|
241
|
-
handleClick = () => {
|
|
242
|
-
if (!this.visible)
|
|
243
|
-
return;
|
|
244
|
-
const prevented = this.hooks.emit('click');
|
|
245
|
-
if (prevented)
|
|
246
|
-
return false;
|
|
247
|
-
};
|
|
248
|
-
handleWantsTapGesture = () => this.handleClick();
|
|
249
|
-
/** 从 Panorama 切换到其他模态时,记录当前的相机水平视角 */
|
|
250
|
-
handleWantsChangeMode = (mode) => {
|
|
251
|
-
if (mode !== 'Panorama') {
|
|
252
|
-
this.lastPanoramaLongitude = this.five.getCurrentState().longitude;
|
|
253
|
-
}
|
|
254
|
-
if (mode !== 'Floorplan')
|
|
255
|
-
this.hide();
|
|
256
|
-
};
|
|
257
|
-
/** 监听模型态变化,只有在模型态才进行手势动作监听 */
|
|
258
|
-
handleModeChange = (mode) => {
|
|
259
|
-
if (mode === 'Floorplan') {
|
|
260
|
-
this.five.on('panGesture', this.handlePanGesture);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
this.hide();
|
|
264
|
-
this.five.off('panGesture', this.handlePanGesture);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
/** panoIndex 改变时,更新 floorIndex */
|
|
268
|
-
handlePanoArrived = (index) => {
|
|
269
|
-
if (!this.five?.work)
|
|
270
|
-
return;
|
|
271
|
-
this.panoIndex = index;
|
|
272
|
-
this.floorIndex = this.five.work.observers[index].floorIndex;
|
|
273
|
-
};
|
|
274
|
-
/** 当户型图正在展示中的时候禁用惯性 */
|
|
275
|
-
handleWantsInteriaPan = () => {
|
|
276
|
-
if (this.visible)
|
|
277
|
-
return false;
|
|
278
|
-
};
|
|
279
|
-
/** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
|
|
280
|
-
handleWantsGesture = (type, pointers) => {
|
|
281
|
-
if (!this.visible)
|
|
282
|
-
return;
|
|
283
|
-
if (pointers.length > 1)
|
|
284
|
-
return false;
|
|
285
|
-
if (type === 'mouseWheel')
|
|
286
|
-
return false;
|
|
287
|
-
};
|
|
288
|
-
/** 监听三维模型滑动
|
|
289
|
-
* 1. 在三维模型转动结束时,如果达到设置的阈值,会自动切换到户型图
|
|
290
|
-
* 2. 如何户型图已经展示,滑动时关闭户型图
|
|
291
|
-
*/
|
|
292
|
-
handlePanGesture = async ({ latitude, longitude }, isFinal) => {
|
|
293
|
-
if (this.configs.autoShowEnable === false)
|
|
294
|
-
return;
|
|
295
|
-
// 如果操作结束后,户型图还在展示中,初始化模型状态
|
|
296
|
-
if (isFinal && this.visible)
|
|
297
|
-
return this.five.setState(this.showState, true);
|
|
298
|
-
// 满足消失的条件:
|
|
299
|
-
// 水平旋转角大于正负 5 度 || 俯仰角度大于 5 度
|
|
300
|
-
const latitudeHide = Math.abs(latitude - Math.PI / 2) > (5 * Math.PI) / 180;
|
|
301
|
-
const longitudeHide = longitude > 5 * (Math.PI / 180) && longitude < 355 * (Math.PI / 180);
|
|
302
|
-
const canHide = latitudeHide || longitudeHide;
|
|
303
|
-
if (this.visible && canHide)
|
|
304
|
-
return this.hide({ isAutoHide: true });
|
|
305
|
-
if (this.five.camera.fov / FIVE_CAMERA_DEFAULT_FOV < 0.8)
|
|
306
|
-
return;
|
|
307
|
-
// 户型图展示条件:
|
|
308
|
-
// 水平旋转角正负 30 度 && 俯仰角度小于 10 度
|
|
309
|
-
const latitudeVisible = Math.abs(latitude - Math.PI / 2) < (10 * Math.PI) / 180;
|
|
310
|
-
const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
|
|
311
|
-
if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
|
|
312
|
-
// 当手指离开时需要等惯性结束之后在进行判断
|
|
313
|
-
const handleInteriaPan = async (any, isFinal) => {
|
|
314
|
-
if (!isFinal)
|
|
315
|
-
return;
|
|
316
|
-
this.five.off('interiaPan', handleInteriaPan);
|
|
317
|
-
await this.show({ isAutoShow: true });
|
|
318
|
-
};
|
|
319
|
-
this.five.on('interiaPan', handleInteriaPan);
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
501
|
render(duration) {
|
|
324
502
|
if (!this.container || !this.floorplanData)
|
|
325
503
|
return;
|
|
326
504
|
if (this.size.width === 0)
|
|
327
505
|
return;
|
|
328
|
-
const { hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
|
|
506
|
+
const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
|
|
329
507
|
const props = {
|
|
330
|
-
five: this.five,
|
|
331
|
-
pxmm: this.pxmm,
|
|
332
508
|
cameraImageUrl,
|
|
509
|
+
getLabelElement,
|
|
510
|
+
northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
|
|
333
511
|
visible: this.visible,
|
|
334
|
-
duration: duration
|
|
512
|
+
duration: duration !== null && duration !== void 0 ? duration : 0,
|
|
335
513
|
panoIndex: this.panoIndex,
|
|
336
514
|
floorIndex: this.floorIndex,
|
|
337
515
|
floorplanData: this.floorplanData,
|
|
338
|
-
hoverEnable: hoverEnable
|
|
339
|
-
compassEnable: compassEnable
|
|
340
|
-
ruleLabelsEnable: ruleLabelsEnable
|
|
341
|
-
roomLabelsEnable: roomLabelsEnable
|
|
516
|
+
hoverEnable: hoverEnable !== null && hoverEnable !== void 0 ? hoverEnable : false,
|
|
517
|
+
compassEnable: compassEnable !== null && compassEnable !== void 0 ? compassEnable : true,
|
|
518
|
+
ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
|
|
519
|
+
roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
|
|
342
520
|
lastPanoramaLongitude: this.lastPanoramaLongitude,
|
|
343
|
-
getLabelElement,
|
|
344
|
-
onRoomHeightClick: this.handleClick,
|
|
345
521
|
};
|
|
346
522
|
if (!this.app) {
|
|
347
523
|
this.app = new Main({
|