@realsee/dnalogel 2.0.0-alpha.7 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +4 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +5 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +4 -0
- package/dist/ModelChassisCompassPlugin/index.js +145 -0
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +4 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/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 +541 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +4 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.js +636 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +39 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +26 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +70 -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 +25 -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 +59 -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/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +20 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +19 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +10 -0
- package/dist/PanoMeasurePlugin/index.js +3996 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +32 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +37 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -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/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.js +610 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/dist/floorplan/Assets/compass.d.ts +1 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +97 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4526 -0
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -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 +36 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +7 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +2008 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +67 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +4236 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/index.d.ts +6 -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/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.es.js +15436 -0
- package/dist/index.js +15488 -0
- package/dist/index.umd.js +15480 -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 +5 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +19 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/index.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/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/index.d.ts +2 -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/uuid.d.ts +5 -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/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +17 -0
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/LineJson.html +1 -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/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/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -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/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -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/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +34 -0
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -135
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +291 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +107 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +216 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +104 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +142 -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/Components/Camera.js +120 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -326
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +168 -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 +373 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +195 -43
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +29 -14
- package/CHANGELOG.md +0 -21
- package/dist/dnalogel.cjs.js +0 -7
- package/dist/dnalogel.es.js +0 -41280
- package/dist/dnalogel.umd.js +0 -7
- 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,190 +1,486 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import equal from '../../shared-utils/equal';
|
|
3
|
+
import Main from '../Components/Main';
|
|
2
4
|
import formatData from '../utils/formatData';
|
|
5
|
+
import { CAMERA_IMAGE } from '../Assets/camera';
|
|
3
6
|
import { omit } from '../../shared-utils/filter';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
7
|
+
import { FLOOR_PLAN_ATTACHED_TO } from '../constant';
|
|
8
|
+
import * as BasePlugin from '../../base/BasePluginWithData';
|
|
9
|
+
import changeMode from '../../shared-utils/five/changeMode';
|
|
10
|
+
import getPxmm, { getAttachedY } from '../../shared-utils/getPxmm';
|
|
6
11
|
import changeModelCanvasOpacity from '../../shared-utils/changeModelCanvasOpacity';
|
|
7
|
-
export class
|
|
8
|
-
size = { width: 0, height: 0 };
|
|
9
|
-
visible = false;
|
|
10
|
-
pxmm = 0;
|
|
11
|
-
app;
|
|
12
|
-
five;
|
|
13
|
-
panoIndex = 0;
|
|
14
|
-
floorIndex = 0;
|
|
15
|
-
configs = {};
|
|
16
|
-
lastPanoramaLongitude = 0;
|
|
17
|
-
selector;
|
|
18
|
-
floorplanData;
|
|
19
|
-
wrapper;
|
|
20
|
-
container = document.createElement('div');
|
|
12
|
+
export class Controller extends BasePlugin.Controller {
|
|
21
13
|
constructor(five, params) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
super(five);
|
|
15
|
+
// =============== public properties =================
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: 'topviewFloorplanPlugin'
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(this, "state", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: void 0
|
|
27
|
+
});
|
|
28
|
+
// =============== private properties =================
|
|
29
|
+
Object.defineProperty(this, "data", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "app", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: undefined
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "selector", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: void 0
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "panoIndex", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: 0
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "floorIndex", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: 0
|
|
58
|
+
});
|
|
59
|
+
/** 户型图父容器 */
|
|
60
|
+
Object.defineProperty(this, "wrapper", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: void 0
|
|
65
|
+
});
|
|
66
|
+
/** 户型图主容器 */
|
|
67
|
+
Object.defineProperty(this, "container", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: document.createElement('div')
|
|
72
|
+
});
|
|
73
|
+
/** 展示户型图图前,Five 的 Panorama Longitude */
|
|
74
|
+
Object.defineProperty(this, "lastPanoramaLongitude", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: 0
|
|
79
|
+
});
|
|
80
|
+
/** 户型图大小 */
|
|
81
|
+
Object.defineProperty(this, "size", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
configurable: true,
|
|
84
|
+
writable: true,
|
|
85
|
+
value: { width: 0, height: 0 }
|
|
86
|
+
});
|
|
87
|
+
/** 是否已经执行过事件监听 */
|
|
88
|
+
Object.defineProperty(this, "hasAddedEventListener", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
configurable: true,
|
|
91
|
+
writable: true,
|
|
92
|
+
value: false
|
|
93
|
+
});
|
|
94
|
+
/** 上一次隐藏是否是用户调用了 hide 导致的 */
|
|
95
|
+
Object.defineProperty(this, "isHiddenByHideFunc", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: false
|
|
100
|
+
});
|
|
101
|
+
/** 更新户型图大小 */
|
|
102
|
+
Object.defineProperty(this, "updateSize", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
value: () => {
|
|
107
|
+
if (!this.data)
|
|
108
|
+
return;
|
|
109
|
+
if (!this.container || !this.wrapper)
|
|
110
|
+
return;
|
|
111
|
+
if (this.five.getCurrentState().mode !== 'Topview')
|
|
112
|
+
return;
|
|
113
|
+
// 计算户型图展示大小
|
|
114
|
+
const { min, max } = this.data.bounding;
|
|
115
|
+
const width = max.x - min.x;
|
|
116
|
+
const height = max.y - min.y;
|
|
117
|
+
// 每毫米对应的 px 值
|
|
118
|
+
const options = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : undefined;
|
|
119
|
+
const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
|
|
120
|
+
const _width = Math.ceil(width * pxmm);
|
|
121
|
+
const _height = Math.ceil(height * pxmm);
|
|
122
|
+
if (this.size.width === _width && this.size.height === _height)
|
|
123
|
+
return;
|
|
124
|
+
this.container.style.width = _width + 'px';
|
|
125
|
+
this.container.style.height = _height + 'px';
|
|
126
|
+
this.size = { width: _width, height: _height };
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
/** 销毁插件 */
|
|
130
|
+
Object.defineProperty(this, "dispose", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
configurable: true,
|
|
133
|
+
writable: true,
|
|
134
|
+
value: () => {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
this.removeEventListener();
|
|
137
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
138
|
+
this.app = undefined;
|
|
139
|
+
(_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
|
|
140
|
+
this.data = undefined;
|
|
141
|
+
this.wrapper = undefined;
|
|
142
|
+
this.selector = undefined;
|
|
143
|
+
this.hooks.emit('dispose');
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(this, "_disable", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
configurable: true,
|
|
149
|
+
writable: true,
|
|
150
|
+
value: (options) => {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
const { userAction } = options;
|
|
153
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
154
|
+
this.app = undefined;
|
|
155
|
+
(_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
|
|
156
|
+
this.removeEventListener();
|
|
157
|
+
this.hooks.emit('disable', { userAction });
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
/** modelLoaded 之后自动执行 append container 操作 */
|
|
161
|
+
Object.defineProperty(this, "onFiveModelLoaded", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
configurable: true,
|
|
164
|
+
writable: true,
|
|
165
|
+
value: () => {
|
|
166
|
+
if (this.state.enabled === false)
|
|
167
|
+
return;
|
|
168
|
+
if (this.wrapper)
|
|
169
|
+
return;
|
|
170
|
+
if (!this.selector)
|
|
171
|
+
return;
|
|
172
|
+
const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
|
|
173
|
+
if (!wrapper)
|
|
174
|
+
throw new Error('不正确的父容器选择器');
|
|
175
|
+
this.wrapper = wrapper;
|
|
176
|
+
wrapper.append(this.container);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
/** 非 Topview 态隐藏户型图 */
|
|
180
|
+
Object.defineProperty(this, "onFiveModeChange", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
configurable: true,
|
|
183
|
+
writable: true,
|
|
184
|
+
value: (...[mode, , , , userAction]) => {
|
|
185
|
+
if (mode !== 'Topview' && this.state.visible) {
|
|
186
|
+
this.updateState({ visible: false }, userAction);
|
|
187
|
+
this._hide({ userAction });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
Object.defineProperty(this, "onFivePanoArrived", {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
configurable: true,
|
|
194
|
+
writable: true,
|
|
195
|
+
value: (index) => {
|
|
196
|
+
var _a;
|
|
197
|
+
if (!((_a = this.five) === null || _a === void 0 ? void 0 : _a.work))
|
|
198
|
+
return;
|
|
199
|
+
this.panoIndex = index;
|
|
200
|
+
this.floorIndex = this.five.work.observers[index].floorIndex;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
Object.defineProperty(this, "onFiveCameraUpdate", {
|
|
204
|
+
enumerable: true,
|
|
205
|
+
configurable: true,
|
|
206
|
+
writable: true,
|
|
207
|
+
value: (_, userAction) => {
|
|
208
|
+
if (!this.state.visible)
|
|
209
|
+
return;
|
|
210
|
+
this.updatePosition();
|
|
211
|
+
this.updateSize();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(this, "onFiveWantsGesture", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: (type) => {
|
|
219
|
+
if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
|
|
220
|
+
return;
|
|
221
|
+
if (this.state.visible && !this.state.config.gestureEnable)
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(this, "onFiveWantsMoveToPano", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
configurable: true,
|
|
228
|
+
writable: true,
|
|
229
|
+
value: () => {
|
|
230
|
+
if (this.state.visible && this.state.config.preventRoomClick)
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
/** 动画结束后是 Topview 态就展示户型图 */
|
|
235
|
+
Object.defineProperty(this, "onFiveInitAnimationEnded", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
configurable: true,
|
|
238
|
+
writable: true,
|
|
239
|
+
value: (...[, , userAction]) => {
|
|
240
|
+
const { mode } = this.five.getCurrentState();
|
|
241
|
+
if (mode === 'Topview' && !this.isHiddenByHideFunc && !this.state.visible && this.state.config.autoShowEnable) {
|
|
242
|
+
this.updateState({ visible: true }, userAction);
|
|
243
|
+
this._show({ userAction });
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(this, "onModelShownFloorChange", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
configurable: true,
|
|
250
|
+
writable: true,
|
|
251
|
+
value: (shownFloor) => {
|
|
252
|
+
if (this.floorIndex === shownFloor)
|
|
253
|
+
return;
|
|
254
|
+
if (shownFloor === null) {
|
|
255
|
+
const panoIndex = this.five.getCurrentState().panoIndex;
|
|
256
|
+
this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
// 模型楼层高亮改变时,自动进行楼层切换
|
|
260
|
+
this.floorIndex = shownFloor;
|
|
261
|
+
this.updateSize();
|
|
262
|
+
this.render();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
if (params === null || params === void 0 ? void 0 : params.selector) {
|
|
266
|
+
this.selector = params.selector;
|
|
267
|
+
console.warn('不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法');
|
|
268
|
+
}
|
|
269
|
+
// =============== init State ===============
|
|
270
|
+
const baseConfig = {
|
|
271
|
+
northDesc: '北',
|
|
272
|
+
modelOpacity: 1,
|
|
273
|
+
hoverEnable: true,
|
|
274
|
+
compassEnable: true,
|
|
275
|
+
gestureEnable: false,
|
|
276
|
+
autoShowEnable: true,
|
|
277
|
+
ruleLabelsEnable: true,
|
|
278
|
+
roomLabelsEnable: true,
|
|
279
|
+
cameraImageUrl: CAMERA_IMAGE,
|
|
280
|
+
attachedTo: FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER,
|
|
281
|
+
getLabelElement: undefined,
|
|
282
|
+
adaptiveRoomLabelVisibleEnable: true,
|
|
283
|
+
};
|
|
284
|
+
const paramsConfig = params ? omit(params, ['selector', 'scale']) : {};
|
|
285
|
+
const config = Object.assign(Object.assign({}, baseConfig), paramsConfig);
|
|
286
|
+
this.state = {
|
|
287
|
+
enabled: true,
|
|
288
|
+
visible: false,
|
|
289
|
+
config,
|
|
290
|
+
};
|
|
291
|
+
// =============== init Container ===============
|
|
292
|
+
this.initContainer();
|
|
293
|
+
// =============== init Listener ===============
|
|
294
|
+
// 注意插件声明周期内只监听一次的事件不放在 addEventListener 里面
|
|
28
295
|
// 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
296
|
+
five.model.loaded ? this.onFiveModelLoaded() : five.once('modelLoaded', this.onFiveModelLoaded);
|
|
297
|
+
five.once('dispose', this.dispose);
|
|
298
|
+
this.addEventListener();
|
|
299
|
+
}
|
|
300
|
+
async load(serverData, state, userAction = true) {
|
|
301
|
+
function isPluginServerData(serverData) {
|
|
302
|
+
return Object.prototype.hasOwnProperty.apply(serverData, ['version']);
|
|
303
|
+
}
|
|
304
|
+
const _data = serverData;
|
|
305
|
+
if (_data && !_data.version)
|
|
306
|
+
console.warn('传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数');
|
|
307
|
+
const copyData = JSON.parse(JSON.stringify(serverData));
|
|
308
|
+
const _serverData = isPluginServerData(copyData) ? copyData.data : copyData;
|
|
309
|
+
const prevData = this.data;
|
|
310
|
+
this.data = await formatData(_serverData);
|
|
311
|
+
this.hooks.emit('dataLoaded', this.data);
|
|
312
|
+
this.hooks.emit('dataChange', this.data, prevData);
|
|
313
|
+
if (state)
|
|
314
|
+
this.updateState(state, userAction);
|
|
40
315
|
this.render();
|
|
41
316
|
}
|
|
317
|
+
/** 更新户型图位置 */
|
|
318
|
+
updatePosition() {
|
|
319
|
+
var _a;
|
|
320
|
+
const y = getAttachedY(this.five, this.floorIndex, this.state.config.attachedTo);
|
|
321
|
+
const modelPosition = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE.Vector3()).setY(y);
|
|
322
|
+
if (!modelPosition)
|
|
323
|
+
return;
|
|
324
|
+
const ndcPosition = modelPosition.clone().project(this.five.camera);
|
|
325
|
+
const left = (ndcPosition.x + 1) / 2;
|
|
326
|
+
const top = -(ndcPosition.y - 1) / 2;
|
|
327
|
+
this.container.style.left = left * 100 + '%';
|
|
328
|
+
this.container.style.top = top * 100 + '%';
|
|
329
|
+
}
|
|
42
330
|
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
43
331
|
appendTo(wrapper) {
|
|
44
332
|
this.wrapper = wrapper;
|
|
333
|
+
// 插件 disabled 时,只是不执行副作用,但是 wrapper 还是要赋值的,不然 enable 的时候找不到父容器
|
|
334
|
+
if (!this.state.enabled)
|
|
335
|
+
return;
|
|
45
336
|
wrapper.appendChild(this.container);
|
|
337
|
+
this.render();
|
|
46
338
|
return this;
|
|
47
339
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.
|
|
51
|
-
this.app?.$destroy();
|
|
52
|
-
this.five.off('modeChange', this.handleModeChange);
|
|
53
|
-
this.five.off('panoArrived', this.handlePanoArrived);
|
|
54
|
-
this.five.off('modelLoaded', this.handleModelLoaded);
|
|
55
|
-
this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
|
|
56
|
-
this.five.off('wantsPanGesture', this.handleWantsPanGesture);
|
|
57
|
-
this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
|
|
58
|
-
this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
|
|
59
|
-
};
|
|
60
|
-
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
61
|
-
onModelShownFloorChange = (shownFloor) => {
|
|
62
|
-
if (shownFloor === null)
|
|
340
|
+
async show(options = {}) {
|
|
341
|
+
// 已经展示完成了,不做任何操作
|
|
342
|
+
if (this.state.visible)
|
|
63
343
|
return;
|
|
64
|
-
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!this.
|
|
71
|
-
return;
|
|
72
|
-
this.panoIndex = index;
|
|
73
|
-
this.floorIndex = this.five.work.observers[index].floorIndex;
|
|
74
|
-
};
|
|
75
|
-
/** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
|
|
76
|
-
handleWantsMoveToPano = () => {
|
|
77
|
-
if (!this.visible)
|
|
344
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
345
|
+
this.updateState({ visible: true }, userAction);
|
|
346
|
+
this._show({ userAction });
|
|
347
|
+
}
|
|
348
|
+
async hide(options = {}) {
|
|
349
|
+
this.isHiddenByHideFunc = true;
|
|
350
|
+
if (!this.state.visible)
|
|
78
351
|
return;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!this.visible)
|
|
352
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
353
|
+
this.updateState({ visible: false }, userAction);
|
|
354
|
+
this._hide({ userAction });
|
|
355
|
+
}
|
|
356
|
+
enable(options = {}) {
|
|
357
|
+
if (this.state.enabled)
|
|
86
358
|
return;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
359
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
360
|
+
this.updateState({ enabled: true }, options.userAction || userAction);
|
|
361
|
+
this._enable({ userAction });
|
|
362
|
+
}
|
|
363
|
+
disable(options = {}) {
|
|
364
|
+
if (!this.state.enabled)
|
|
91
365
|
return;
|
|
92
|
-
|
|
366
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
367
|
+
this.updateState({ enabled: false }, options.userAction || userAction);
|
|
368
|
+
this._disable({ userAction });
|
|
369
|
+
}
|
|
370
|
+
/** 更改插件 State */
|
|
371
|
+
setState(state, options = {}) {
|
|
372
|
+
const prevState = this.state;
|
|
373
|
+
const userAction = options.userAction !== undefined ? options.userAction : true;
|
|
374
|
+
this.updateState(state, userAction);
|
|
375
|
+
if (state.enabled !== undefined && prevState.enabled !== state.enabled) {
|
|
376
|
+
const options = { userAction };
|
|
377
|
+
state.enabled ? this._enable(options) : this._disable(options);
|
|
378
|
+
}
|
|
379
|
+
if (state.visible !== undefined && prevState.visible !== state.visible) {
|
|
380
|
+
const options = { userAction };
|
|
381
|
+
state.visible ? this._show(options) : this._hide(options);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
async formatData(serverData) {
|
|
385
|
+
return await formatData(serverData.data);
|
|
386
|
+
}
|
|
387
|
+
async _show(options) {
|
|
388
|
+
if (!this.state.enabled)
|
|
93
389
|
return;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/** 非 Topview 态隐藏户型图 */
|
|
101
|
-
handleModeChange = (mode) => {
|
|
102
|
-
if (mode !== 'Topview')
|
|
103
|
-
return this.hide();
|
|
104
|
-
};
|
|
105
|
-
/** 动画结束后是 Topview 态就展示户型图 */
|
|
106
|
-
handleInitAnimationEnded = () => {
|
|
107
|
-
const { mode } = this.five.getCurrentState();
|
|
108
|
-
if (mode === 'Topview')
|
|
109
|
-
this.show();
|
|
110
|
-
};
|
|
111
|
-
show() {
|
|
112
|
-
this.visible = true;
|
|
390
|
+
this.isHiddenByHideFunc = false;
|
|
391
|
+
const { userAction } = options;
|
|
392
|
+
this.hooks.emit('show', { userAction });
|
|
393
|
+
if (this.five.getCurrentState().mode !== 'Topview') {
|
|
394
|
+
await changeMode(this.five, ['Topview', undefined, undefined, userAction]);
|
|
395
|
+
}
|
|
113
396
|
this.five.model.show(this.floorIndex);
|
|
397
|
+
this.updatePosition();
|
|
114
398
|
this.updateSize();
|
|
115
399
|
const renderDuration = 500;
|
|
116
|
-
const modelOpacity = this.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.render(renderDuration);
|
|
121
|
-
this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
|
|
122
|
-
this.five.on('wantsPanGesture', this.handleWantsPanGesture);
|
|
400
|
+
const modelOpacity = this.state.config.modelOpacity;
|
|
401
|
+
changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
|
|
402
|
+
this.hooks.emit('showAnimationEnded', { userAction });
|
|
403
|
+
this.render();
|
|
123
404
|
}
|
|
124
|
-
|
|
405
|
+
async _hide(options) {
|
|
406
|
+
if (!this.state.enabled)
|
|
407
|
+
return;
|
|
408
|
+
const { userAction } = options;
|
|
409
|
+
this.hooks.emit('hide', { userAction });
|
|
125
410
|
const modelOpacity = 1;
|
|
126
411
|
const renderDuration = 0;
|
|
127
|
-
this.visible = false;
|
|
128
412
|
changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
|
|
129
413
|
this.render();
|
|
130
|
-
this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
|
|
131
|
-
this.five.on('wantsPanGesture', this.handleWantsPanGesture);
|
|
132
414
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
415
|
+
_enable(options) {
|
|
416
|
+
const { userAction } = options;
|
|
417
|
+
this.addEventListener();
|
|
418
|
+
if (this.wrapper)
|
|
419
|
+
this.wrapper.append(this.container);
|
|
420
|
+
this.hooks.emit('enable', { userAction });
|
|
421
|
+
if (this.state.visible)
|
|
422
|
+
this._show({ userAction });
|
|
423
|
+
}
|
|
424
|
+
updateState(state, userAction) {
|
|
425
|
+
const prevState = this.state;
|
|
426
|
+
this.state = Object.assign(Object.assign({}, this.state), state);
|
|
427
|
+
if (equal(this.state, prevState, { deep: true }))
|
|
136
428
|
return;
|
|
137
|
-
|
|
429
|
+
this.hooks.emit('stateChange', { state: this.state, prevState, userAction });
|
|
430
|
+
}
|
|
431
|
+
addEventListener() {
|
|
432
|
+
if (!this.state.enabled)
|
|
138
433
|
return;
|
|
139
|
-
if (this.
|
|
434
|
+
if (this.hasAddedEventListener)
|
|
140
435
|
return;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.
|
|
153
|
-
|
|
154
|
-
|
|
436
|
+
const five = this.five;
|
|
437
|
+
five.on('modeChange', this.onFiveModeChange);
|
|
438
|
+
five.on('panoArrived', this.onFivePanoArrived);
|
|
439
|
+
five.on('cameraUpdate', this.onFiveCameraUpdate);
|
|
440
|
+
five.on('wantsGesture', this.onFiveWantsGesture);
|
|
441
|
+
five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
|
|
442
|
+
five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
|
|
443
|
+
five.on('modelShownFloorChange', this.onModelShownFloorChange);
|
|
444
|
+
}
|
|
445
|
+
removeEventListener() {
|
|
446
|
+
const five = this.five;
|
|
447
|
+
this.hasAddedEventListener = false;
|
|
448
|
+
// 注意这里并没有消除 dispose 的监听
|
|
449
|
+
five.off('modeChange', this.onFiveModeChange);
|
|
450
|
+
five.off('panoArrived', this.onFivePanoArrived);
|
|
451
|
+
five.off('cameraUpdate', this.onFiveCameraUpdate);
|
|
452
|
+
five.off('wantsGesture', this.onFiveWantsGesture);
|
|
453
|
+
five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
|
|
454
|
+
five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
|
|
455
|
+
five.off('modelShownFloorChange', this.onModelShownFloorChange);
|
|
456
|
+
}
|
|
457
|
+
/** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
|
|
458
|
+
*
|
|
459
|
+
* - TODO: 等 selector 功能下掉之后删除这个逻辑
|
|
460
|
+
*/
|
|
461
|
+
initContainer() {
|
|
462
|
+
this.container.classList.add('floorplan-plugin');
|
|
463
|
+
Object.assign(this.container.style, {
|
|
464
|
+
position: 'absolute',
|
|
465
|
+
left: '50%',
|
|
466
|
+
top: '50%',
|
|
467
|
+
transform: 'translate3d(-50%, -50%, 10px)',
|
|
468
|
+
zIndex: 10,
|
|
469
|
+
pointerEvents: 'none',
|
|
470
|
+
'will-change': 'width, height',
|
|
471
|
+
});
|
|
472
|
+
this.five.addExtraElement(this.container);
|
|
473
|
+
}
|
|
155
474
|
render(duration) {
|
|
156
|
-
if (!this.
|
|
475
|
+
if (!this.state.enabled)
|
|
476
|
+
return;
|
|
477
|
+
if (!this.container || !this.data)
|
|
157
478
|
return;
|
|
158
479
|
if (this.size.width === 0)
|
|
159
480
|
return;
|
|
160
|
-
const {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
pxmm: this.pxmm,
|
|
165
|
-
cameraImageUrl,
|
|
166
|
-
visible: this.visible,
|
|
167
|
-
duration: duration ?? 0,
|
|
168
|
-
panoIndex: this.panoIndex,
|
|
169
|
-
floorIndex: this.floorIndex,
|
|
170
|
-
floorplanData: this.floorplanData,
|
|
171
|
-
hoverEnable: hoverEnable ?? false,
|
|
172
|
-
compassEnable: compassEnable ?? true,
|
|
173
|
-
ruleLabelsEnable: ruleLabelsEnable ?? true,
|
|
174
|
-
roomLabelsEnable: roomLabelsEnable ?? true,
|
|
175
|
-
lastPanoramaLongitude: this.lastPanoramaLongitude,
|
|
176
|
-
getLabelElement,
|
|
177
|
-
onRoomHeightClick: handleClick,
|
|
178
|
-
};
|
|
179
|
-
if (!this.app) {
|
|
180
|
-
this.app = new Main({
|
|
181
|
-
target: this.container,
|
|
182
|
-
intro: true,
|
|
183
|
-
props,
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
this.app.$set(props);
|
|
188
|
-
}
|
|
481
|
+
const props = Object.assign(Object.assign({}, this.state.config), { visible: this.state.visible, duration: duration !== null && duration !== void 0 ? duration : 0, panoIndex: this.panoIndex, floorIndex: this.floorIndex, floorplanData: this.data, lastPanoramaLongitude: this.lastPanoramaLongitude });
|
|
482
|
+
if (this.app)
|
|
483
|
+
return this.app.$set(props);
|
|
484
|
+
this.app = new Main({ target: this.container, intro: true, props });
|
|
189
485
|
}
|
|
190
486
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { Parameters } from './typing';
|
|
2
|
+
import type { FivePlugin } from '@realsee/five';
|
|
3
|
+
import { Controller } from './Controller';
|
|
4
|
+
export declare const TopviewFloorplanPlugin: FivePlugin<undefined | Parameters, Controller>;
|
|
5
|
+
export declare type TopviewFloorplanPluginParameterType = Parameters | undefined;
|
|
6
|
+
export declare type TopviewFloorplanPluginReturnType = InstanceType<typeof Controller>;
|
|
4
7
|
export default TopviewFloorplanPlugin;
|
|
5
|
-
export type { TopviewFloorplanPluginReturnType, TopviewFloorplanPluginParameterType } from './Controller';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Controller } from './Controller';
|
|
2
2
|
export const TopviewFloorplanPlugin = (five, params) => {
|
|
3
|
-
return new
|
|
3
|
+
return new Controller(five, params);
|
|
4
4
|
};
|
|
5
5
|
export default TopviewFloorplanPlugin;
|