@realsee/dnalogel 2.0.0-alpha.9 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
- package/dist/CSS3DRenderPlugin/index.js +27 -26
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +4 -6
- package/dist/CameraMovementPlugin/index.js +12 -12
- package/dist/CameraMovementPlugin/typing.d.ts +1 -1
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/dist/ModelChassisCompassPlugin/index.js +8 -5
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/index.js +153 -73
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +3 -16
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/index.d.ts +4 -47
- package/dist/PanoCompassPlugin/index.js +242 -129
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +9 -6
- package/dist/PanoMeasurePlugin/index.js +2649 -3442
- package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +4 -30
- package/dist/PanoRulerPlugin/index.js +12 -12
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/index.d.ts +6 -0
- package/dist/floorplan/utils/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatPosition.d.ts +1 -1
- package/dist/index.d.ts +15 -24
- package/dist/index.es.js +10694 -7145
- package/dist/index.js +10432 -6869
- package/dist/index.umd.js +10435 -6875
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -0
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/math/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/index.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/dist/shared-utils/three/getNormal.d.ts +1 -1
- package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/uuid.d.ts +1 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +5 -8
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +78 -33
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +26 -18
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +13 -6
- package/CHANGELOG.md +0 -30
- package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
- package/dist/shared-utils/useDebounce.d.ts +0 -8
- package/dist/shared-utils/useThrottle.d.ts +0 -8
- package/docs/enums/ModelFloorplanErrorType.html +0 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { FLOOR_PLAN_ATTACHED_TO } from '../constant';
|
|
2
|
+
import type * as BasePlugin from '../../base/BasePluginWithData';
|
|
3
|
+
import type { FloorplanServerData } from '../typings/floorplanServerData';
|
|
4
|
+
import type { FloorplanData, FloorplanRoomItem } from '../typings/floorplanData';
|
|
5
|
+
export interface Config {
|
|
6
|
+
/** 指北针的显示文案,默认为 '北' */
|
|
7
|
+
northDesc: string;
|
|
8
|
+
/** 户型图展示时,模型的透明度,默认为 1 */
|
|
9
|
+
modelOpacity: number;
|
|
10
|
+
/** 鼠标放置在分间上时,是否要自动高亮分间,默认为 true */
|
|
11
|
+
hoverEnable: boolean;
|
|
12
|
+
/** 是否开启放大缩小和拖动功能,默认为 false */
|
|
13
|
+
gestureEnable: boolean;
|
|
14
|
+
/** 是否要启用指北针功能,默认为 true */
|
|
15
|
+
compassEnable: boolean;
|
|
16
|
+
/** Five 切换到 Topview Mode 时,是否自动展示户型图,默认为 true */
|
|
17
|
+
autoShowEnable: boolean;
|
|
18
|
+
/** 是否要启用户型图分间标尺功能,默认为 true */
|
|
19
|
+
ruleLabelsEnable: boolean;
|
|
20
|
+
/** 是否要启用户型图分间标签功能,默认为 true */
|
|
21
|
+
roomLabelsEnable: boolean;
|
|
22
|
+
/** 自定义「雷达」图标 */
|
|
23
|
+
cameraImageUrl: string;
|
|
24
|
+
/** 点击房间时,是否需要跳转到被点房间的全景态点位上,默认为 true */
|
|
25
|
+
preventRoomClick?: boolean;
|
|
26
|
+
/** 计算户型图大小时,以模型的哪个高度为依据,默认为 BOUNDING_CENTER
|
|
27
|
+
* - FLOOR_PLAN_ATTACHED_TO.FLOOR: 户型图大小与模型的地板进行贴合
|
|
28
|
+
* - FLOOR_PLAN_ATTACHED_TO.CEILING: 户型图大小与模型的天花板进行贴合
|
|
29
|
+
* - FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER: 户型图大小与模型的中心进行贴合
|
|
30
|
+
*/
|
|
31
|
+
attachedTo: FLOOR_PLAN_ATTACHED_TO;
|
|
32
|
+
/** 分间标签的自定义函数,通过返回自定义 DOM 替换对应分间的标签 */
|
|
33
|
+
getLabelElement: undefined | ((room: FloorplanRoomItem) => Element | null);
|
|
34
|
+
/** 是否支持房屋标签自适应展示,默认为 true
|
|
35
|
+
* @description
|
|
36
|
+
* * 标签边框超过房间边框时,自动隐藏;不超过时自动展示。
|
|
37
|
+
* * 鼠标 hover 时,自动展示。
|
|
38
|
+
* */
|
|
39
|
+
adaptiveRoomLabelVisibleEnable: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface State extends BasePlugin.State {
|
|
42
|
+
visible: boolean;
|
|
43
|
+
config: Config;
|
|
44
|
+
}
|
|
45
|
+
export interface EventMap extends BasePlugin.EventMap<State, FloorplanData> {
|
|
46
|
+
/** 展示结束的回调
|
|
47
|
+
* @param event.userAction 是否是用户操作
|
|
48
|
+
*/
|
|
49
|
+
showAnimationEnded: (event: {
|
|
50
|
+
userAction: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
/** visible 从 false 到 true 的回调
|
|
53
|
+
* @param event.userAction 是否是用户操作
|
|
54
|
+
*/
|
|
55
|
+
show: (event: {
|
|
56
|
+
userAction: boolean;
|
|
57
|
+
}) => void;
|
|
58
|
+
/** visible 从 true 到 false 的回调
|
|
59
|
+
* @param event.userAction 是否是用户操作
|
|
60
|
+
*/
|
|
61
|
+
hide: (event: {
|
|
62
|
+
userAction: boolean;
|
|
63
|
+
}) => void;
|
|
64
|
+
/** enabled 从 false 到 true 的回调
|
|
65
|
+
* @param event.userAction 是否是用户操作
|
|
66
|
+
*/
|
|
67
|
+
enable: (event: {
|
|
68
|
+
userAction: boolean;
|
|
69
|
+
}) => void;
|
|
70
|
+
/** enabled 从 true 到 false 的回调
|
|
71
|
+
* @param event.userAction 是否是用户操作
|
|
72
|
+
*/
|
|
73
|
+
disable: (event: {
|
|
74
|
+
userAction: boolean;
|
|
75
|
+
}) => void;
|
|
76
|
+
}
|
|
77
|
+
/** 插件初始化参数 */
|
|
78
|
+
export interface Parameters extends Partial<Config> {
|
|
79
|
+
selector?: string | Element;
|
|
80
|
+
scale?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface PluginServerData extends BasePlugin.ServerData {
|
|
83
|
+
version: number;
|
|
84
|
+
data: FloorplanServerData;
|
|
85
|
+
}
|
|
86
|
+
export { FloorplanData as PluginData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const enum FloorplanErrorType {
|
|
2
|
+
/** 意料之外的错误 */
|
|
3
|
+
UnknownError = "UnknownError",
|
|
4
|
+
/** 数据未加载 */
|
|
5
|
+
DataNotLoaded = "DataNotLoaded",
|
|
6
|
+
/** 展示过程被隐藏打断 */
|
|
7
|
+
BreakOffByHide = "BreakOffByHide",
|
|
8
|
+
/** 展示过程中插件被禁用 */
|
|
9
|
+
BreakOffByDisable = "BreakOffByDisable",
|
|
10
|
+
/** 模型未加载完成 */
|
|
11
|
+
ModelNotLoaded = "ModelNotLoaded",
|
|
12
|
+
/** Five changeMode 行为不符合预期 */
|
|
13
|
+
ChangeModeError = "ChangeModeError",
|
|
14
|
+
/** Five updateCamera 行为不符合预期 */
|
|
15
|
+
UpdateCameraError = "UpdateCameraError"
|
|
16
|
+
}
|
|
17
|
+
/** 户型图展示 & 模型消失的默认时间 */
|
|
18
|
+
export declare const SHOW_ANIME_DURATION = 500;
|
|
19
|
+
/** Five camera 默认 fov */
|
|
20
|
+
export declare const FIVE_CAMERA_DEFAULT_FOV = 80;
|
|
21
|
+
/** 展示户型图时,默认模型的透明度 */
|
|
22
|
+
export declare const DEFAULT_SHOW_MODEL_OPACITY = 0.01;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var FloorplanErrorType;
|
|
2
|
+
(function (FloorplanErrorType) {
|
|
3
|
+
/** 意料之外的错误 */
|
|
4
|
+
FloorplanErrorType["UnknownError"] = "UnknownError";
|
|
5
|
+
/** 数据未加载 */
|
|
6
|
+
FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
|
|
7
|
+
/** 展示过程被隐藏打断 */
|
|
8
|
+
FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
|
|
9
|
+
/** 展示过程中插件被禁用 */
|
|
10
|
+
FloorplanErrorType["BreakOffByDisable"] = "BreakOffByDisable";
|
|
11
|
+
/** 模型未加载完成 */
|
|
12
|
+
FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
|
|
13
|
+
/** Five changeMode 行为不符合预期 */
|
|
14
|
+
FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
|
|
15
|
+
/** Five updateCamera 行为不符合预期 */
|
|
16
|
+
FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
|
|
17
|
+
})(FloorplanErrorType || (FloorplanErrorType = {}));
|
|
18
|
+
/** 户型图展示 & 模型消失的默认时间 */
|
|
19
|
+
export const SHOW_ANIME_DURATION = 500;
|
|
20
|
+
/** Five camera 默认 fov */
|
|
21
|
+
export const FIVE_CAMERA_DEFAULT_FOV = 80;
|
|
22
|
+
/** 展示户型图时,默认模型的透明度 */
|
|
23
|
+
export const DEFAULT_SHOW_MODEL_OPACITY = 0.01;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Five, Mode } from '@realsee/five';
|
|
2
|
+
export interface ShowState {
|
|
3
|
+
latitude: number;
|
|
4
|
+
longitude: number;
|
|
5
|
+
fov: number;
|
|
6
|
+
mode: Mode;
|
|
7
|
+
}
|
|
8
|
+
/** 判断当前状态是否可以展示户型图 */
|
|
9
|
+
export declare function checkShowState(five: Five, showState: ShowState): boolean;
|
|
10
|
+
/** 更改 Five 状态到展示户型图的状态
|
|
11
|
+
* 1. 判断状态不符合时,会纠正到正确的状态
|
|
12
|
+
* 2. 内置了相应的动画时间计算
|
|
13
|
+
* 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
|
|
14
|
+
*/
|
|
15
|
+
export default function correctFiveState(five: Five, showState: ShowState, userAction?: boolean): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import to from '../../shared-utils/to';
|
|
2
|
+
import { FloorplanErrorType } from '../utils/constant';
|
|
3
|
+
import nearlyEqual from '../../shared-utils/nearlyEqual';
|
|
4
|
+
import changeMode from '../../shared-utils/five/changeMode';
|
|
5
|
+
/** 判断当前状态是否可以展示户型图 */
|
|
6
|
+
export function checkShowState(five, showState) {
|
|
7
|
+
if (five.currentMode !== showState.mode)
|
|
8
|
+
return false;
|
|
9
|
+
const { latitude, longitude, fov } = showState;
|
|
10
|
+
const { latitude: _latitude, longitude: _longitude } = five.getCurrentState();
|
|
11
|
+
const _fov = five.camera.fov;
|
|
12
|
+
if (!nearlyEqual(latitude, _latitude, 2))
|
|
13
|
+
return false;
|
|
14
|
+
if (!nearlyEqual(longitude, _longitude, 2))
|
|
15
|
+
return false;
|
|
16
|
+
if (fov !== _fov)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
/** 更改 Five 状态到展示户型图的状态
|
|
21
|
+
* 1. 判断状态不符合时,会纠正到正确的状态
|
|
22
|
+
* 2. 内置了相应的动画时间计算
|
|
23
|
+
* 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
|
|
24
|
+
*/
|
|
25
|
+
export default async function correctFiveState(five, showState, userAction = true) {
|
|
26
|
+
// 当前已满足状态,不需要变更
|
|
27
|
+
const result = checkShowState(five, showState);
|
|
28
|
+
if (result === true)
|
|
29
|
+
return;
|
|
30
|
+
const currentFiveState = five.getCurrentState();
|
|
31
|
+
// 纠正 mode
|
|
32
|
+
if (currentFiveState.mode !== showState.mode) {
|
|
33
|
+
const [changeModeError] = await to(changeMode(five, [showState.mode, showState, undefined, userAction]));
|
|
34
|
+
if (changeModeError)
|
|
35
|
+
throw new Error(FloorplanErrorType.ChangeModeError);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// 纠正相机状态
|
|
39
|
+
// 根据 latitude、longitude、fov 计算动画时间,最多 1s
|
|
40
|
+
const { latitude, longitude, fov } = currentFiveState;
|
|
41
|
+
const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
|
|
42
|
+
const [updateCameraError] = await to(five.updateCamera(showState, time, userAction));
|
|
43
|
+
if (updateCameraError)
|
|
44
|
+
throw new Error(FloorplanErrorType.UpdateCameraError);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
@@ -7,7 +7,7 @@ export declare function pathD(points: Vector2Position[], options?: {
|
|
|
7
7
|
format?: (vector: Vector2Position) => Vector2Position;
|
|
8
8
|
}): string;
|
|
9
9
|
/** 把户型图上点点位转换到 SVG 上的点位 */
|
|
10
|
-
export default function formatFloorplanPoint({ x, y }: Vector2Position,
|
|
10
|
+
export default function formatFloorplanPoint({ x, y }: Vector2Position, bounding: FloorplanBounding): {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
};
|
|
@@ -9,7 +9,7 @@ export function pathD(points, options = {}) {
|
|
|
9
9
|
d += 'M' + point;
|
|
10
10
|
return d;
|
|
11
11
|
}
|
|
12
|
-
if (needA
|
|
12
|
+
if (needA === null || needA === void 0 ? void 0 : needA[index]) {
|
|
13
13
|
d += 'A' + needA[index] + ',' + point;
|
|
14
14
|
return d;
|
|
15
15
|
}
|
|
@@ -19,9 +19,9 @@ export function pathD(points, options = {}) {
|
|
|
19
19
|
return d + (needZ ? 'Z' : '');
|
|
20
20
|
}
|
|
21
21
|
/** 把户型图上点点位转换到 SVG 上的点位 */
|
|
22
|
-
export default function formatFloorplanPoint({ x, y },
|
|
22
|
+
export default function formatFloorplanPoint({ x, y }, bounding) {
|
|
23
23
|
const { max, min } = bounding;
|
|
24
|
-
return { x:
|
|
24
|
+
return { x: x - min.x, y: max.y - y };
|
|
25
25
|
}
|
|
26
26
|
/** 模型坐标转户型图坐标 */
|
|
27
27
|
export function modelPosition2FloorplanPosition(position, floorplanData) {
|
package/libs/index.d.ts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export * from './
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export type { ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginData, ModelEntryDoorGuidePluginExportType, } from './ModelEntryDoorGuidePlugin';
|
|
17
|
-
export { default as ModelEntryDoorGuidePlugin } from './ModelEntryDoorGuidePlugin';
|
|
18
|
-
export { default as CameraMovementPlugin } from './CameraMovementPlugin';
|
|
19
|
-
export type { PanoRulerPluginParameterType, PanoRulerPluginExportType, PanoRulerPluginOptions, } from './PanoRulerPlugin';
|
|
20
|
-
export { default as PanoRulerPlugin } from './PanoRulerPlugin';
|
|
21
|
-
export type { PanoCompassPluginParameterType, PanoCompassPluginExportType, PanoCompassPluginData, } from './PanoCompassPlugin';
|
|
22
|
-
export { default as PanoCompassPlugin } from './PanoCompassPlugin';
|
|
23
|
-
export type { PluginReturns, PluginEvent, LineJson, PointJson } from './PanoMeasurePlugin';
|
|
24
|
-
export { default as PanoMeasurePlugin } from './PanoMeasurePlugin';
|
|
1
|
+
export * from './ModelViewPlugin';
|
|
2
|
+
export * from './CSS3DRenderPlugin';
|
|
3
|
+
export * from './PanoCursorRaycasterPlugin';
|
|
4
|
+
export * from './ModelRoomLabelPlugin';
|
|
5
|
+
export * from './floorplan';
|
|
6
|
+
export * from './ModelChassisCompassPlugin';
|
|
7
|
+
export * from './ModelEntryDoorGuidePlugin';
|
|
8
|
+
export * from './CameraMovementPlugin';
|
|
9
|
+
export * from './PanoRulerPlugin';
|
|
10
|
+
export * from './PanoCompassPlugin';
|
|
11
|
+
export * from './PanoMeasurePlugin';
|
|
12
|
+
export * from './PanoSpatialTagPlugin';
|
|
13
|
+
export * from './ModelItemLabelPlugin';
|
|
14
|
+
export * from './ModelTVVideoPlugin';
|
|
15
|
+
export * from './ItemLabelPlugin';
|
package/libs/index.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
export * from './ModelViewPlugin';
|
|
2
|
+
export * from './CSS3DRenderPlugin';
|
|
3
|
+
export * from './PanoCursorRaycasterPlugin';
|
|
4
|
+
// 模型房屋标签
|
|
5
|
+
export * from './ModelRoomLabelPlugin';
|
|
5
6
|
// floorplan
|
|
6
|
-
export * from './floorplan
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export
|
|
7
|
+
export * from './floorplan';
|
|
8
|
+
// 模型底盘
|
|
9
|
+
export * from './ModelChassisCompassPlugin';
|
|
10
|
+
// 模型入户门
|
|
11
|
+
export * from './ModelEntryDoorGuidePlugin';
|
|
12
|
+
export * from './CameraMovementPlugin';
|
|
13
|
+
// 全景标尺
|
|
14
|
+
export * from './PanoRulerPlugin';
|
|
15
|
+
// 全景指南针
|
|
16
|
+
export * from './PanoCompassPlugin';
|
|
17
|
+
// pc 全景测量工具
|
|
18
|
+
export * from './PanoMeasurePlugin';
|
|
19
|
+
// 空间三维标签
|
|
20
|
+
export * from './PanoSpatialTagPlugin';
|
|
21
|
+
// 模型物品标签插件
|
|
22
|
+
export * from './ModelItemLabelPlugin';
|
|
23
|
+
// 模型电视插件
|
|
24
|
+
export * from './ModelTVVideoPlugin';
|
|
25
|
+
// 物品标签
|
|
26
|
+
export * from './ItemLabelPlugin';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
3
|
const __EVENT__ = '__events__';
|
|
3
4
|
/**
|
|
@@ -5,8 +6,13 @@ const __EVENT__ = '__events__';
|
|
|
5
6
|
* 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
|
|
6
7
|
*/
|
|
7
8
|
export default class Subscribe {
|
|
8
|
-
[__EVENT__];
|
|
9
9
|
constructor() {
|
|
10
|
+
Object.defineProperty(this, _a, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
10
16
|
this[__EVENT__] = {};
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
@@ -99,3 +105,4 @@ export default class Subscribe {
|
|
|
99
105
|
return canceled;
|
|
100
106
|
}
|
|
101
107
|
}
|
|
108
|
+
_a = __EVENT__;
|
|
@@ -1,24 +1,53 @@
|
|
|
1
1
|
import TWEEN from '@tweenjs/tween.js';
|
|
2
2
|
import { requestAnimationFrameInterval } from './index';
|
|
3
3
|
export class BetterTween extends TWEEN.Tween {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
Object.defineProperty(this, "disposeMethods", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: []
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "animationFrameDisposer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "onDispose", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: (callback) => {
|
|
23
|
+
this.disposeMethods.push(callback);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "play", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: () => {
|
|
32
|
+
this.start(0);
|
|
33
|
+
this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "dispose", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: () => {
|
|
42
|
+
var _a;
|
|
43
|
+
this.stop();
|
|
44
|
+
(_a = this.animationFrameDisposer) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
45
|
+
this.disposeMethods.forEach((fn) => fn());
|
|
46
|
+
this.disposeMethods = [];
|
|
47
|
+
TWEEN.remove(this);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
22
51
|
}
|
|
23
52
|
export function tweenProgress(duration, easing = TWEEN.Easing.Linear.None) {
|
|
24
53
|
const tween = new BetterTween({ progress: 0 }).to({ progress: 1 });
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CanvasTexture } from 'three';
|
|
2
2
|
export default function createCanvasTextTexture(text, config) {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
var _a, _b, _c, _d, _e;
|
|
4
|
+
const size = (_a = config === null || config === void 0 ? void 0 : config.size) !== null && _a !== void 0 ? _a : 512;
|
|
5
|
+
const fontSize = (_b = config === null || config === void 0 ? void 0 : config.fontSize) !== null && _b !== void 0 ? _b : size * (35 / 256) * 1.2;
|
|
6
|
+
const backgroundColor = (_c = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _c !== void 0 ? _c : 'rgba(0,0,0,0)';
|
|
7
|
+
const fontColor = (_d = config === null || config === void 0 ? void 0 : config.fontColor) !== null && _d !== void 0 ? _d : '#fff';
|
|
8
|
+
const textAlign = (_e = config === null || config === void 0 ? void 0 : config.textAlign) !== null && _e !== void 0 ? _e : 'center';
|
|
8
9
|
const canvas = document.createElement('canvas');
|
|
9
10
|
canvas.setAttribute('width', size + '');
|
|
10
11
|
canvas.setAttribute('height', size + '');
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
|
-
|
|
2
|
+
/** 等待 five changeMode 结束
|
|
3
|
+
* @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
|
|
4
|
+
*/
|
|
5
|
+
export default function changeMode(five: Five, changeModeParams: Parameters<Five['changeMode']>): Promise<void>;
|
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
await new Promise((
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import nearlyEqual from '../nearlyEqual';
|
|
2
|
+
/** 等待 five changeMode 结束
|
|
3
|
+
* @description Promise 的状态只代表 mode 与预期是否一致,不保证参数的一致性
|
|
4
|
+
*/
|
|
5
|
+
export default async function changeMode(five, changeModeParams) {
|
|
6
|
+
await new Promise((resolve, reject) => {
|
|
7
|
+
// 虽然 changeMode 是异步函数,但不代表异步流程结束代表切换 Mode 动画结束
|
|
8
|
+
five.changeMode(...changeModeParams).catch((error) => reject(error));
|
|
9
|
+
five.once('initAnimationEnded', () => {
|
|
10
|
+
const fiveCurrentState = five.getCurrentState();
|
|
11
|
+
const correctMode = changeModeParams[0];
|
|
12
|
+
if (fiveCurrentState.mode !== correctMode)
|
|
13
|
+
reject(new Error('mode 与预期不符'));
|
|
14
|
+
/** 检测当前的 current pose 和传入的 pose 是否一致 */
|
|
15
|
+
const checkPose = () => {
|
|
16
|
+
const correctPose = changeModeParams[1];
|
|
17
|
+
if (!correctPose)
|
|
18
|
+
return true;
|
|
19
|
+
return Object.keys(correctPose).every((key) => {
|
|
20
|
+
const fivePoseItem = fiveCurrentState[key];
|
|
21
|
+
if (fivePoseItem === undefined)
|
|
22
|
+
return true;
|
|
23
|
+
const correctPoseItem = correctPose[key];
|
|
24
|
+
if (typeof fivePoseItem === 'number' && typeof correctPoseItem === 'number') {
|
|
25
|
+
return nearlyEqual(fivePoseItem, correctPoseItem, 2);
|
|
26
|
+
}
|
|
27
|
+
return fivePoseItem === correctPoseItem;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const checkPoseResult = checkPose();
|
|
31
|
+
if (!checkPoseResult)
|
|
32
|
+
reject(new Error('five pose 与预期不符'));
|
|
33
|
+
resolve();
|
|
34
|
+
});
|
|
14
35
|
});
|
|
15
36
|
}
|
|
@@ -3,6 +3,14 @@ import { FLOOR_PLAN_ATTACHED_TO } from '../floorplan/constant';
|
|
|
3
3
|
interface GetPxmmOption {
|
|
4
4
|
attachedTo: FLOOR_PLAN_ATTACHED_TO;
|
|
5
5
|
}
|
|
6
|
+
/** 获取当前楼层地面的 Y 值 */
|
|
7
|
+
export declare function getFloorY(five: Five, floorIndex: number): number;
|
|
8
|
+
/** 获取当前吸附类型的 Y 值
|
|
9
|
+
* * FLOOR_PLAN_ATTACHED_TO.FLOOR:当前楼层地板的 Y
|
|
10
|
+
* * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前模型中心的 Y
|
|
11
|
+
* * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前楼层天花板的 Y
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAttachedY(five: Five, floorIndex: number, attachedTo?: FLOOR_PLAN_ATTACHED_TO): number;
|
|
6
14
|
/**
|
|
7
15
|
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
8
16
|
* @param five five
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { FLOOR_PLAN_ATTACHED_TO } from '../floorplan/constant';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
+
/** 获取当前楼层地面的 Y 值 */
|
|
4
|
+
export function getFloorY(five, floorIndex) {
|
|
5
|
+
const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
|
|
6
|
+
return floorIndex > maxFloorIndex
|
|
7
|
+
? five.model.bounding.max.y
|
|
8
|
+
: Math.max(...five.work.observers
|
|
9
|
+
.filter((ob) => ob.floorIndex === floorIndex)
|
|
10
|
+
.map((ob) => ob.standingPosition.y));
|
|
11
|
+
}
|
|
12
|
+
/** 获取当前吸附类型的 Y 值
|
|
13
|
+
* * FLOOR_PLAN_ATTACHED_TO.FLOOR:当前楼层地板的 Y
|
|
14
|
+
* * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前模型中心的 Y
|
|
15
|
+
* * FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER:当前楼层天花板的 Y
|
|
16
|
+
*/
|
|
17
|
+
export function getAttachedY(five, floorIndex, attachedTo = FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER) {
|
|
18
|
+
const currentFloorY = getFloorY(five, floorIndex);
|
|
19
|
+
const nextFloorY = getFloorY(five, floorIndex + 1);
|
|
20
|
+
if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
|
|
21
|
+
return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
|
|
22
|
+
else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
|
|
23
|
+
return nextFloorY;
|
|
24
|
+
else
|
|
25
|
+
return currentFloorY;
|
|
26
|
+
}
|
|
3
27
|
/**
|
|
4
28
|
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
5
29
|
* @param five five
|
|
6
30
|
*/
|
|
7
31
|
export default function getPxmm(five, container, floorIndex, options) {
|
|
8
|
-
const
|
|
9
|
-
function getFloorY(floorIndex) {
|
|
10
|
-
return floorIndex > maxFloorIndex
|
|
11
|
-
? five.model.bounding.max.y
|
|
12
|
-
: Math.max(...five.work.observers
|
|
13
|
-
.filter((ob) => ob.floorIndex === floorIndex)
|
|
14
|
-
.map((ob) => ob.standingPosition.y));
|
|
15
|
-
}
|
|
16
|
-
function getY() {
|
|
17
|
-
const currentFloorY = getFloorY(floorIndex);
|
|
18
|
-
const nextFloorY = getFloorY(floorIndex + 1);
|
|
19
|
-
const attachedTo = options?.attachedTo || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
|
|
20
|
-
if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
|
|
21
|
-
return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
|
|
22
|
-
else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
|
|
23
|
-
return nextFloorY;
|
|
24
|
-
else
|
|
25
|
-
return currentFloorY;
|
|
26
|
-
}
|
|
27
|
-
const y = getY();
|
|
32
|
+
const y = getAttachedY(five, floorIndex, options === null || options === void 0 ? void 0 : options.attachedTo);
|
|
28
33
|
const originPosition = new THREE.Vector3(0, y, 0);
|
|
29
34
|
const originPositionXUnit = new THREE.Vector3(1, y, 0);
|
|
30
35
|
const mouse = originPosition.clone().project(five.camera);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './math';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './math';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 一维区间 */
|
|
2
|
+
declare class Interval {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
isInterval: boolean;
|
|
6
|
+
constructor(min?: number, max?: number);
|
|
7
|
+
fromArray(array: number[]): Interval;
|
|
8
|
+
/** 两个区间是否重叠 */
|
|
9
|
+
isOverlap(target: Interval): boolean;
|
|
10
|
+
/** 是否包含区间 */
|
|
11
|
+
contains(target: Interval): boolean;
|
|
12
|
+
}
|
|
13
|
+
export { Interval };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** 一维区间 */
|
|
2
|
+
class Interval {
|
|
3
|
+
constructor(min = 0, max = 0) {
|
|
4
|
+
Object.defineProperty(this, "min", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true,
|
|
8
|
+
value: void 0
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(this, "max", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "isInterval", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
this.min = min;
|
|
23
|
+
this.max = max;
|
|
24
|
+
}
|
|
25
|
+
fromArray(array) {
|
|
26
|
+
this.min = array[0];
|
|
27
|
+
this.max = array[1];
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/** 两个区间是否重叠 */
|
|
31
|
+
isOverlap(target) {
|
|
32
|
+
// 两个区间最大值中的最小值小于两个区间最小值中的最大值时,两个区间没有交集
|
|
33
|
+
return Math.min(this.max, target.max) < Math.max(this.min, target.min);
|
|
34
|
+
}
|
|
35
|
+
/** 是否包含区间 */
|
|
36
|
+
contains(target) {
|
|
37
|
+
return this.min < target.min && this.max > target.max;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { Interval };
|