@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/README.md +93 -4
- package/TERMS.txt +56 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.js +143 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +201 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +668 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
- package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/dist/ModelRoomLabelPlugin/index.js +505 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/index.d.ts +17 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +51 -0
- package/dist/PanoCompassPlugin/index.js +635 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/dist/PanoMeasurePlugin/index.d.ts +7 -0
- package/dist/PanoMeasurePlugin/index.js +5531 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.js +612 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/dist/PanoSpatialTagPlugin/index.js +1294 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/Assets/compass.d.ts +0 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +105 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4034 -0
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1642 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +75 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3646 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/typings/floorplanData.d.ts +137 -0
- package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
- package/dist/floorplan/typings/utility.d.ts +2 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +15138 -0
- package/dist/index.js +15180 -0
- package/dist/index.umd.js +15173 -0
- package/dist/shared-utils/Preloader.d.ts +6 -0
- package/dist/shared-utils/Subscribe.d.ts +45 -0
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/dist/shared-utils/animationFrame/index.d.ts +15 -0
- package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
- package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/dist/shared-utils/createLine/index.d.ts +3 -0
- package/dist/shared-utils/debounce.d.ts +6 -0
- package/dist/shared-utils/equal.d.ts +11 -0
- package/dist/shared-utils/filter.d.ts +27 -0
- package/dist/shared-utils/five/changeMode.d.ts +2 -0
- package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +11 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/isNil.d.ts +10 -0
- package/dist/shared-utils/isTruelyObject.d.ts +18 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/planimetry.d.ts +116 -0
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
- package/dist/shared-utils/nearlyEqual.d.ts +7 -0
- package/dist/shared-utils/nextFrame.d.ts +1 -0
- package/dist/shared-utils/noop.d.ts +5 -0
- package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/dist/shared-utils/px2rem.d.ts +1 -0
- package/dist/shared-utils/removeArrayItem.d.ts +7 -0
- package/dist/shared-utils/tap.d.ts +8 -0
- package/dist/shared-utils/three/centerPoint.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/dist/shared-utils/three/getNormal.d.ts +2 -0
- package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
- package/dist/shared-utils/three/loadTexture.d.ts +2 -0
- package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
- package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/dist/shared-utils/throttle.d.ts +7 -0
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/to.d.ts +8 -0
- package/dist/shared-utils/useDebounce.d.ts +8 -0
- package/dist/shared-utils/useThrottle.d.ts +8 -0
- package/dist/shared-utils/uuid.d.ts +4 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/dist/typings/math.type.d.ts +44 -0
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/ModelRoomLabelController.html +20 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ModelFloorplanErrorType.html +1 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
- package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -0
- package/docs/modules.html +28 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
- package/libs/CSS3DRenderPlugin/index.js +27 -26
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +2 -2
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +13 -9
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +120 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +255 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/index.js +254 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/index.js +6 -6
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
- package/libs/PanoCompassPlugin/index.d.ts +51 -0
- package/libs/PanoCompassPlugin/index.js +253 -0
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +124 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.js +329 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +64 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +305 -0
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +265 -0
- package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/libs/PanoMeasurePlugin/Model/index.js +139 -0
- package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/libs/PanoMeasurePlugin/Model/line.js +114 -0
- package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/point.js +48 -0
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/polyline.js +65 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +48 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +110 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +148 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +70 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +102 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +79 -0
- package/libs/PanoMeasurePlugin/index.d.ts +7 -0
- package/libs/PanoMeasurePlugin/index.js +5 -0
- package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/data.js +1 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +115 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
- package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/line.js +33 -0
- package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/math.js +44 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +22 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
- package/libs/PanoRulerPlugin/index.d.ts +31 -0
- package/libs/PanoRulerPlugin/index.js +400 -0
- package/libs/PanoRulerPlugin/style.d.ts +2 -0
- package/libs/PanoRulerPlugin/style.js +88 -0
- package/libs/PanoRulerPlugin/typings.d.ts +21 -0
- package/libs/PanoRulerPlugin/typings.js +1 -0
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/libs/PanoSpatialTagPlugin/index.js +413 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +119 -0
- package/libs/floorplan/Components/CurrentFloor.js +456 -0
- package/libs/floorplan/Components/Main.js +464 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +68 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +199 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +173 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/Components/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +4 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +455 -279
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +89 -37
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +30 -14
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +269 -118
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
- package/libs/floorplan/constant.d.ts +5 -0
- package/libs/floorplan/constant.js +6 -0
- package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +22 -9
- package/libs/index.js +11 -3
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/getPxmm.d.ts +6 -1
- package/libs/shared-utils/getPxmm.js +26 -12
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +26 -13
- package/dist/dnalogel.cjs.js +0 -2
- package/dist/dnalogel.es.js +0 -37145
- package/dist/dnalogel.umd.js +0 -2
- package/dist/style.css +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
- package/libs/floorplan/Components/BaseImage.svelte +0 -25
- package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
- package/libs/floorplan/Components/Normalmage.svelte +0 -11
- package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
- package/libs/floorplan/Components/SvgImage.svelte +0 -25
- package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import Hammer from 'hammerjs';
|
|
2
|
+
import DeleteDom from '../Modules/DeleteDom';
|
|
3
|
+
import isNDCPointInScreen from '../utils/isNDCPointInScreen';
|
|
4
|
+
import BaseController from './BaseController';
|
|
5
|
+
import { Raycaster, Vector2 } from 'three';
|
|
6
|
+
import { closestPointOnLine } from '../utils/math';
|
|
7
|
+
import { findClosestPoint } from '../utils/findClosestPoint';
|
|
8
|
+
import { findAssociatedLines } from '../utils/findAssociatedLines';
|
|
9
|
+
import { getPointFromHammerEvent } from '../utils/getPointFromHammerEvent';
|
|
10
|
+
export default class WatchController extends BaseController {
|
|
11
|
+
constructor(params) {
|
|
12
|
+
super(params);
|
|
13
|
+
Object.defineProperty(this, "type", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: 'watch'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(this, "deleteDom", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "highlightedLines", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: []
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "fiveElement", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "editPointState", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "hammer", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "onPanStart", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: (e) => {
|
|
54
|
+
var _a;
|
|
55
|
+
if (this.model.points.length === 0 || !this.fiveElement)
|
|
56
|
+
return;
|
|
57
|
+
const mouse = getPointFromHammerEvent(e).point;
|
|
58
|
+
const closestPoint = (_a = findClosestPoint(this.five, this.model.points, mouse, 20)) === null || _a === void 0 ? void 0 : _a.point;
|
|
59
|
+
if (!closestPoint) {
|
|
60
|
+
this.editPointState = undefined;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const editPointState = {
|
|
64
|
+
point: closestPoint,
|
|
65
|
+
associatedLines: findAssociatedLines(closestPoint.lines[0]),
|
|
66
|
+
};
|
|
67
|
+
const cancelDragLine = this.hook.emit('wantsDragLine', {
|
|
68
|
+
point: closestPoint.id,
|
|
69
|
+
lines: editPointState.associatedLines.map(({ id }) => id),
|
|
70
|
+
});
|
|
71
|
+
if (cancelDragLine)
|
|
72
|
+
return;
|
|
73
|
+
this.editPointState = editPointState;
|
|
74
|
+
this.magnifier.appendTo(this.container);
|
|
75
|
+
this.group.add(this.mouseGroup);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(this, "onPanEnd", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: () => {
|
|
83
|
+
if (!this.editPointState)
|
|
84
|
+
return;
|
|
85
|
+
// 把拖动的线从虚线转换为实线
|
|
86
|
+
this.editPointState.point.lines.forEach((line) => line.mesh.setMaterial({ dashed: false }));
|
|
87
|
+
// 还原选中态
|
|
88
|
+
this.highlightLines(this.editPointState.associatedLines);
|
|
89
|
+
this.editPointState = undefined;
|
|
90
|
+
this.magnifier.dispose();
|
|
91
|
+
this.group.remove(this.mouseGroup);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(this, "onPan", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
configurable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
value: (e) => {
|
|
99
|
+
if (!this.editPointState || !this.fiveElement)
|
|
100
|
+
return;
|
|
101
|
+
const mouse = getPointFromHammerEvent(e).ndcPoint;
|
|
102
|
+
const raycaster = new Raycaster();
|
|
103
|
+
raycaster.setFromCamera(mouse, this.five.camera);
|
|
104
|
+
const [intersection] = this.five.model.intersectRaycaster(raycaster);
|
|
105
|
+
if (!intersection)
|
|
106
|
+
return;
|
|
107
|
+
this.onIntersectionUpdate(intersection);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(this, "onIntersectionUpdate", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true,
|
|
113
|
+
writable: true,
|
|
114
|
+
value: (intersection, mesh) => {
|
|
115
|
+
if (!this.editPointState)
|
|
116
|
+
return;
|
|
117
|
+
// 拖动过程中清除选中态
|
|
118
|
+
this.clearHighlightLines();
|
|
119
|
+
// 把拖动点相关的线变成虚线 & 改变相关线的位置
|
|
120
|
+
this.editPointState.point.position.copy(intersection.point);
|
|
121
|
+
this.editPointState.point.lines.forEach((line) => {
|
|
122
|
+
line.mesh.setPoints(line.points[0].position.clone(), line.points[1].position.clone());
|
|
123
|
+
line.lightMesh.setPoints(line.points[0].position.clone(), line.points[1].position.clone());
|
|
124
|
+
line.mesh.setMaterial({ dashed: true });
|
|
125
|
+
});
|
|
126
|
+
this.updateDistanceUI();
|
|
127
|
+
this.magnifier.updateWithPoint(intersection.point);
|
|
128
|
+
this.mouseGroup.position.copy(intersection.point);
|
|
129
|
+
if (mesh) {
|
|
130
|
+
this.mouseGroup.quaternion.copy(mesh.quaternion);
|
|
131
|
+
}
|
|
132
|
+
else if (intersection.face) {
|
|
133
|
+
const face = intersection.face.normal;
|
|
134
|
+
const positionVector = face.clone().multiplyScalar(0.05);
|
|
135
|
+
const position = intersection.point.clone().add(positionVector);
|
|
136
|
+
const lookAtVector = position.clone().add(positionVector);
|
|
137
|
+
this.mouseGroup.lookAt(lookAtVector);
|
|
138
|
+
}
|
|
139
|
+
this.five.needsRender = true;
|
|
140
|
+
this.hook.emit('selectedChange', this.editPointState.associatedLines.map((line) => line.toCompletelyJson()));
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
Object.defineProperty(this, "wantsPanGesture", {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
configurable: true,
|
|
146
|
+
writable: true,
|
|
147
|
+
value: () => {
|
|
148
|
+
if (this.editPointState)
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(this, "wantsTapGesture", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
configurable: true,
|
|
155
|
+
writable: true,
|
|
156
|
+
value: (raycaster) => {
|
|
157
|
+
const [target] = this.five.model.intersectRaycaster(raycaster);
|
|
158
|
+
if (!target)
|
|
159
|
+
return;
|
|
160
|
+
const camera = this.five.camera;
|
|
161
|
+
const ndcTarget = target.point.clone().project(camera);
|
|
162
|
+
const screenWidth = this.container.clientWidth;
|
|
163
|
+
const screenHeight = this.container.clientHeight;
|
|
164
|
+
const targetScreenPosition = new Vector2(ndcTarget.x * screenWidth, ndcTarget.y * screenHeight);
|
|
165
|
+
// 把线的端点全部映射到屏幕上,过滤掉不在视野内的线,同时乘以屏幕宽 & 高
|
|
166
|
+
const screenLines = this.model.lines
|
|
167
|
+
.map((line) => {
|
|
168
|
+
const [startPoint, endPoint] = line.points;
|
|
169
|
+
const ndcStartPoint = startPoint.position.clone().project(camera);
|
|
170
|
+
const ndcEndPoint = endPoint.position.clone().project(camera);
|
|
171
|
+
if (!isNDCPointInScreen(ndcStartPoint) && !isNDCPointInScreen(ndcEndPoint))
|
|
172
|
+
return null;
|
|
173
|
+
const startScreenPosition = new Vector2(ndcStartPoint.x * screenWidth, ndcStartPoint.y * screenHeight);
|
|
174
|
+
const endScreenPosition = new Vector2(ndcEndPoint.x * screenWidth, ndcEndPoint.y * screenHeight);
|
|
175
|
+
return { id: line.id, points: [startScreenPosition, endScreenPosition] };
|
|
176
|
+
})
|
|
177
|
+
.filter((line) => !!line);
|
|
178
|
+
if (screenLines.length === 0)
|
|
179
|
+
return;
|
|
180
|
+
// 找这些线距离鼠标点击位置最近的线
|
|
181
|
+
const distanceLines = screenLines
|
|
182
|
+
.map((line) => {
|
|
183
|
+
const closestPoint = closestPointOnLine(targetScreenPosition, line.points);
|
|
184
|
+
return { id: line.id, distance: closestPoint.distanceTo(targetScreenPosition) };
|
|
185
|
+
})
|
|
186
|
+
.sort((a, b) => a.distance - b.distance);
|
|
187
|
+
const closestScreenLine = distanceLines[0];
|
|
188
|
+
if (closestScreenLine.distance > 20)
|
|
189
|
+
return;
|
|
190
|
+
const closestLine = this.model.lines.find(({ id }) => id === closestScreenLine.id);
|
|
191
|
+
if (!closestLine)
|
|
192
|
+
return;
|
|
193
|
+
this.chooseLine(closestLine);
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(this, "chooseLine", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
configurable: true,
|
|
200
|
+
writable: true,
|
|
201
|
+
value: (line) => {
|
|
202
|
+
const highlightLines = findAssociatedLines(line);
|
|
203
|
+
this.highlightLines(highlightLines);
|
|
204
|
+
this.five.needsRender = true;
|
|
205
|
+
this.hook.emit('selectedChange', highlightLines.map((line) => line.toCompletelyJson()));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(this, "lineRemoved", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: (line) => {
|
|
213
|
+
this.removeLine(line);
|
|
214
|
+
// TODO: 这个逻辑不太好,改进一下
|
|
215
|
+
this.hook.emit('selectedChange', this.model.lines.filter((line) => line.selected).map((line) => line.toCompletelyJson()));
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(this, "onCameraUpdate", {
|
|
219
|
+
enumerable: true,
|
|
220
|
+
configurable: true,
|
|
221
|
+
writable: true,
|
|
222
|
+
value: () => {
|
|
223
|
+
this.updateDistanceUI();
|
|
224
|
+
this.highlightedLines.length > 0 && this.deleteDom.updatePosition();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(this, "deleteDomClickCallback", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
configurable: true,
|
|
230
|
+
writable: true,
|
|
231
|
+
value: () => {
|
|
232
|
+
const firstLine = this.highlightedLines[0];
|
|
233
|
+
// TODO: 优化折线的删除逻辑
|
|
234
|
+
firstLine
|
|
235
|
+
.getPolyline()
|
|
236
|
+
.lines.slice()
|
|
237
|
+
.reverse()
|
|
238
|
+
.forEach((line) => this.model.removeLine(line));
|
|
239
|
+
this.highlightedLines = [];
|
|
240
|
+
// this.clearHighlightLines()
|
|
241
|
+
// this.highlightedLines.forEach((line) => this.model.removeLine(line))
|
|
242
|
+
this.deleteDom.setLines([]).hide();
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this.deleteDom = new DeleteDom(this.five, { onClick: this.deleteDomClickCallback }).appendTo(this.container);
|
|
246
|
+
this.model.lines.forEach((line) => {
|
|
247
|
+
line.distanceItem.appendTo(this.container);
|
|
248
|
+
line.distanceItem.update(this.five);
|
|
249
|
+
line.hook.on('selected', this.chooseLine);
|
|
250
|
+
this.group.add(line.mesh);
|
|
251
|
+
});
|
|
252
|
+
const fiveElement = this.five.getElement();
|
|
253
|
+
if (fiveElement) {
|
|
254
|
+
this.fiveElement = fiveElement;
|
|
255
|
+
const hammer = new Hammer(fiveElement);
|
|
256
|
+
this.hammer = hammer;
|
|
257
|
+
hammer.on('pan', this.onPan);
|
|
258
|
+
hammer.on('panstart', this.onPanStart);
|
|
259
|
+
hammer.on('panend', this.onPanEnd);
|
|
260
|
+
}
|
|
261
|
+
this.model.hook.on('lineRemoved', this.lineRemoved);
|
|
262
|
+
this.five.on('cameraUpdate', this.onCameraUpdate);
|
|
263
|
+
this.five.on('wantsTapGesture', this.wantsTapGesture);
|
|
264
|
+
this.five.on('wantsPanGesture', this.wantsPanGesture);
|
|
265
|
+
this.five.needsRender = true;
|
|
266
|
+
}
|
|
267
|
+
dispose() {
|
|
268
|
+
var _a;
|
|
269
|
+
super.dispose();
|
|
270
|
+
this.deleteDom.dispose();
|
|
271
|
+
this.model.hook.off('lineRemoved', this.lineRemoved);
|
|
272
|
+
this.five.off('cameraUpdate', this.onCameraUpdate);
|
|
273
|
+
this.five.off('wantsPanGesture', this.wantsPanGesture);
|
|
274
|
+
this.five.off('wantsTapGesture', this.wantsTapGesture);
|
|
275
|
+
this.five.needsRender = true;
|
|
276
|
+
this.hook.emit('selectedChange', []);
|
|
277
|
+
(_a = this.hammer) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
278
|
+
}
|
|
279
|
+
highlightLine(line) {
|
|
280
|
+
if (line.selected)
|
|
281
|
+
return;
|
|
282
|
+
line.selected = true;
|
|
283
|
+
this.group.add(line.lightMesh);
|
|
284
|
+
line.distanceItem.highlight();
|
|
285
|
+
this.five.needsRender = true;
|
|
286
|
+
}
|
|
287
|
+
clearHighlightLines() {
|
|
288
|
+
if (this.group.children.length === 0)
|
|
289
|
+
return;
|
|
290
|
+
this.deleteDom.setLines([]).hide();
|
|
291
|
+
this.model.lines.forEach((line) => {
|
|
292
|
+
line.selected = false;
|
|
293
|
+
line.distanceItem.unHighlight();
|
|
294
|
+
this.group.remove(line.lightMesh);
|
|
295
|
+
});
|
|
296
|
+
this.highlightedLines = [];
|
|
297
|
+
this.five.needsRender = true;
|
|
298
|
+
}
|
|
299
|
+
highlightLines(lines) {
|
|
300
|
+
this.clearHighlightLines();
|
|
301
|
+
this.highlightedLines = lines;
|
|
302
|
+
this.deleteDom.setLines(lines).updatePosition().show();
|
|
303
|
+
lines.forEach((line) => this.highlightLine(line));
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PluginData } from '../typings/data';
|
|
2
|
+
import type { PluginEvent } from '../typings/event.type';
|
|
3
|
+
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
4
|
+
import { Five, Subscribe } from '@realsee/five';
|
|
5
|
+
export declare type Mode = 'Watch' | 'Edit';
|
|
6
|
+
export interface MeasurePluginParameter {
|
|
7
|
+
useUIController?: boolean;
|
|
8
|
+
useGuideController?: boolean;
|
|
9
|
+
userDistanceItemCreator?: () => UserDistanceItem;
|
|
10
|
+
}
|
|
11
|
+
export default class MeasureController {
|
|
12
|
+
hasOpen: boolean;
|
|
13
|
+
hook: Subscribe<PluginEvent>;
|
|
14
|
+
private five;
|
|
15
|
+
private model;
|
|
16
|
+
private group;
|
|
17
|
+
private magnifier;
|
|
18
|
+
private fiveHelper;
|
|
19
|
+
private useUIController?;
|
|
20
|
+
private params;
|
|
21
|
+
private useGuideController?;
|
|
22
|
+
private container;
|
|
23
|
+
private shortcutKeyController?;
|
|
24
|
+
private controller;
|
|
25
|
+
private controllerParams;
|
|
26
|
+
constructor(five: Five, params: MeasurePluginParameter);
|
|
27
|
+
appendTo(parent: HTMLElement): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
/** 加载数据
|
|
30
|
+
* @description 数据加载时会覆盖当前已保存的数据
|
|
31
|
+
* @description 如果当前正在编辑中,会自动退出并保存编辑
|
|
32
|
+
*/
|
|
33
|
+
load(data: PluginData): void;
|
|
34
|
+
/** 插件功能入口
|
|
35
|
+
* @description 会隐藏鼠标的默认聚焦环
|
|
36
|
+
* @description 会隐藏当前 VR 内的点位展示
|
|
37
|
+
*/
|
|
38
|
+
enable(): void;
|
|
39
|
+
/** 关闭插件功能
|
|
40
|
+
* @description 清除标尺线条
|
|
41
|
+
* @description 还原点位展示和默认鼠标 UI
|
|
42
|
+
*/
|
|
43
|
+
disable(): void;
|
|
44
|
+
getCurrentMode: () => Mode | null;
|
|
45
|
+
/** 变更场景
|
|
46
|
+
* @description 如果从编辑场景改变到观看场景,不会自动保存,默认丢弃所有改动
|
|
47
|
+
*/
|
|
48
|
+
changeMode: (mode: Mode) => void;
|
|
49
|
+
/** 撤销编辑 */
|
|
50
|
+
revoke(): void;
|
|
51
|
+
removeLineByID(lineID: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* 高亮当前线段
|
|
54
|
+
*/
|
|
55
|
+
highlightLine(lineID: string): boolean;
|
|
56
|
+
clearHighlightLines(): boolean;
|
|
57
|
+
/** 保存编辑 */
|
|
58
|
+
save(): this;
|
|
59
|
+
/** 把当前以保存的数据转换成 JSON 对象 */
|
|
60
|
+
toJson(): PluginData;
|
|
61
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import Magnifier from '../Modules/Magnifier';
|
|
2
|
+
import FiveHelper from '../Modules/FiveHelper';
|
|
3
|
+
import EditController from './EditController';
|
|
4
|
+
import WatchController from './WatchController';
|
|
5
|
+
import { Group } from 'three';
|
|
6
|
+
import { Model } from '../Model';
|
|
7
|
+
import { Subscribe } from '@realsee/five';
|
|
8
|
+
import { getMouseGroup } from '../utils/mouseGroup';
|
|
9
|
+
import { UIController } from '../Modules/UIController';
|
|
10
|
+
import { GuideController } from '../Modules/GuideController';
|
|
11
|
+
import { ShortcutKeyController } from './ShortcutKeyController';
|
|
12
|
+
export default class MeasureController {
|
|
13
|
+
constructor(five, params) {
|
|
14
|
+
Object.defineProperty(this, "hasOpen", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: false
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(this, "hook", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: new Subscribe()
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "five", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: void 0
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(this, "model", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: void 0
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "group", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: void 0
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(this, "magnifier", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: void 0
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(this, "fiveHelper", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: void 0
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(this, "useUIController", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
value: void 0
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(this, "params", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
value: void 0
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(this, "useGuideController", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: true,
|
|
71
|
+
writable: true,
|
|
72
|
+
value: void 0
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(this, "container", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: document.createElement('div')
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(this, "shortcutKeyController", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
value: void 0
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(this, "controller", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: null
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(this, "controllerParams", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
configurable: true,
|
|
95
|
+
writable: true,
|
|
96
|
+
value: void 0
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(this, "getCurrentMode", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: () => {
|
|
103
|
+
if (this.controller instanceof EditController)
|
|
104
|
+
return 'Edit';
|
|
105
|
+
if (this.controller instanceof WatchController)
|
|
106
|
+
return 'Watch';
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
/** 变更场景
|
|
111
|
+
* @description 如果从编辑场景改变到观看场景,不会自动保存,默认丢弃所有改动
|
|
112
|
+
*/
|
|
113
|
+
Object.defineProperty(this, "changeMode", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
value: (mode) => {
|
|
118
|
+
var _a;
|
|
119
|
+
if (!this.hasOpen)
|
|
120
|
+
return;
|
|
121
|
+
if (this.getCurrentMode() === mode)
|
|
122
|
+
return;
|
|
123
|
+
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
124
|
+
const controllerMap = {
|
|
125
|
+
Watch: WatchController,
|
|
126
|
+
Edit: EditController,
|
|
127
|
+
};
|
|
128
|
+
if (!controllerMap[mode])
|
|
129
|
+
throw new Error('不存在的 Mode');
|
|
130
|
+
this.controller = new controllerMap[mode](this.controllerParams);
|
|
131
|
+
this.hook.emit('modeChange', mode);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
this.five = five;
|
|
135
|
+
this.params = params;
|
|
136
|
+
this.model = new Model({ userDistanceItemCreator: this.params.userDistanceItemCreator });
|
|
137
|
+
this.fiveHelper = new FiveHelper(five);
|
|
138
|
+
// magnifier
|
|
139
|
+
const magnifierSize = 190;
|
|
140
|
+
const magnifierScale = 2;
|
|
141
|
+
this.magnifier = new Magnifier(five, { scale: magnifierScale, width: magnifierSize, height: magnifierSize });
|
|
142
|
+
// ==================== Group ====================
|
|
143
|
+
this.group = new Group();
|
|
144
|
+
this.group.name = 'plugin-measure-group';
|
|
145
|
+
this.container.classList.add('five-plugin-measure-container');
|
|
146
|
+
this.container.style.position = 'relative';
|
|
147
|
+
this.container.style.pointerEvents = 'none';
|
|
148
|
+
this.container.style.width = '100%';
|
|
149
|
+
this.container.style.height = '100%';
|
|
150
|
+
this.container.style.opacity = '0';
|
|
151
|
+
this.container.style.background = 'rgba(0, 0, 0, 0.15)';
|
|
152
|
+
this.controllerParams = {
|
|
153
|
+
five: this.five,
|
|
154
|
+
hook: this.hook,
|
|
155
|
+
group: this.group,
|
|
156
|
+
model: this.model,
|
|
157
|
+
magnifier: this.magnifier,
|
|
158
|
+
container: this.container,
|
|
159
|
+
fiveHelper: this.fiveHelper,
|
|
160
|
+
mouseGroup: getMouseGroup(),
|
|
161
|
+
userDistanceItemCreator: this.params.userDistanceItemCreator,
|
|
162
|
+
};
|
|
163
|
+
if (this.params.useUIController !== false)
|
|
164
|
+
this.useUIController = new UIController(this, this.controllerParams);
|
|
165
|
+
if (this.params.useUIController !== false)
|
|
166
|
+
this.useGuideController = new GuideController(this, this.controllerParams);
|
|
167
|
+
}
|
|
168
|
+
appendTo(parent) {
|
|
169
|
+
parent.append(this.container);
|
|
170
|
+
}
|
|
171
|
+
dispose() {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
this.disable();
|
|
174
|
+
(_a = this.useUIController) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
175
|
+
(_b = this.magnifier) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
176
|
+
this.five.needsRender = true;
|
|
177
|
+
}
|
|
178
|
+
/** 加载数据
|
|
179
|
+
* @description 数据加载时会覆盖当前已保存的数据
|
|
180
|
+
* @description 如果当前正在编辑中,会自动退出并保存编辑
|
|
181
|
+
*/
|
|
182
|
+
load(data) {
|
|
183
|
+
this.model.parse(data);
|
|
184
|
+
this.save();
|
|
185
|
+
}
|
|
186
|
+
/** 插件功能入口
|
|
187
|
+
* @description 会隐藏鼠标的默认聚焦环
|
|
188
|
+
* @description 会隐藏当前 VR 内的点位展示
|
|
189
|
+
*/
|
|
190
|
+
enable() {
|
|
191
|
+
var _a, _b;
|
|
192
|
+
if (this.hasOpen)
|
|
193
|
+
return;
|
|
194
|
+
this.hasOpen = true;
|
|
195
|
+
this.five.scene.add(this.group);
|
|
196
|
+
// 修改透明度
|
|
197
|
+
this.container.style.opacity = '1';
|
|
198
|
+
// 隐藏点位和鼠标聚焦环
|
|
199
|
+
this.five.helperVisible = false;
|
|
200
|
+
this.controller = new WatchController(this.controllerParams);
|
|
201
|
+
(_a = this.useUIController) === null || _a === void 0 ? void 0 : _a.show();
|
|
202
|
+
(_b = this.useGuideController) === null || _b === void 0 ? void 0 : _b.show();
|
|
203
|
+
this.shortcutKeyController = new ShortcutKeyController(this, this.five);
|
|
204
|
+
this.hook.emit('enable', true);
|
|
205
|
+
}
|
|
206
|
+
/** 关闭插件功能
|
|
207
|
+
* @description 清除标尺线条
|
|
208
|
+
* @description 还原点位展示和默认鼠标 UI
|
|
209
|
+
*/
|
|
210
|
+
disable() {
|
|
211
|
+
var _a, _b, _c, _d;
|
|
212
|
+
this.hasOpen = false;
|
|
213
|
+
// 修改透明度
|
|
214
|
+
this.container.style.opacity = '0';
|
|
215
|
+
// 展示点位和鼠标聚焦环
|
|
216
|
+
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
217
|
+
(_b = this.useUIController) === null || _b === void 0 ? void 0 : _b.hide();
|
|
218
|
+
(_c = this.useGuideController) === null || _c === void 0 ? void 0 : _c.hide();
|
|
219
|
+
(_d = this.shortcutKeyController) === null || _d === void 0 ? void 0 : _d.dispose();
|
|
220
|
+
this.controller = null;
|
|
221
|
+
this.five.helperVisible = true;
|
|
222
|
+
this.five.scene.remove(this.group);
|
|
223
|
+
this.five.needsRender = true;
|
|
224
|
+
this.hook.emit('disable', true);
|
|
225
|
+
}
|
|
226
|
+
/** 撤销编辑 */
|
|
227
|
+
revoke() {
|
|
228
|
+
if (!(this.controller instanceof EditController))
|
|
229
|
+
return;
|
|
230
|
+
this.controller.revoke();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
removeLineByID(lineID) {
|
|
234
|
+
this.model.removeLineByID(lineID);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* 高亮当前线段
|
|
238
|
+
*/
|
|
239
|
+
highlightLine(lineID) {
|
|
240
|
+
if (this.getCurrentMode() !== 'Watch')
|
|
241
|
+
return false;
|
|
242
|
+
const line = this.model.getLineByID(lineID);
|
|
243
|
+
if (!line)
|
|
244
|
+
return false;
|
|
245
|
+
this.controller.highlightLine(line);
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
clearHighlightLines() {
|
|
249
|
+
if (this.getCurrentMode() !== 'Watch')
|
|
250
|
+
return false;
|
|
251
|
+
this.controller.clearHighlightLines();
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
/** 保存编辑 */
|
|
255
|
+
save() {
|
|
256
|
+
if (!(this.controller instanceof EditController))
|
|
257
|
+
return this;
|
|
258
|
+
this.model.mergeModel(this.controller.model);
|
|
259
|
+
return this;
|
|
260
|
+
}
|
|
261
|
+
/** 把当前以保存的数据转换成 JSON 对象 */
|
|
262
|
+
toJson() {
|
|
263
|
+
return this.model.toJson();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PluginData } from '../typings/data';
|
|
2
|
+
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
3
|
+
import Line from './line';
|
|
4
|
+
import Point from './point';
|
|
5
|
+
import { Subscribe, SubscribeEventMap } from '@realsee/five';
|
|
6
|
+
import { Polyline } from './polyline';
|
|
7
|
+
interface IModelEvent extends SubscribeEventMap {
|
|
8
|
+
/** 新增线条
|
|
9
|
+
* @param line 被创建的线条
|
|
10
|
+
*/
|
|
11
|
+
lineAdded: (line: Line) => void;
|
|
12
|
+
/** 删除线条
|
|
13
|
+
* @param lines 被删除的线条数组
|
|
14
|
+
*/
|
|
15
|
+
lineRemoved: (lines: Line) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ModelParams {
|
|
18
|
+
userDistanceItemCreator?: () => UserDistanceItem;
|
|
19
|
+
}
|
|
20
|
+
export declare class Model {
|
|
21
|
+
readonly lines: Line[];
|
|
22
|
+
readonly points: Point[];
|
|
23
|
+
readonly params: ModelParams;
|
|
24
|
+
readonly polylines: Polyline[];
|
|
25
|
+
readonly hook: Subscribe<IModelEvent>;
|
|
26
|
+
constructor(params: ModelParams);
|
|
27
|
+
addLine(line: Line): this;
|
|
28
|
+
removeLineByID(lineID: string): void;
|
|
29
|
+
removeLine(line: Line): this;
|
|
30
|
+
mergeModel(model: Model): void;
|
|
31
|
+
includes(item: Point | Line): boolean;
|
|
32
|
+
getPointByID(id: string): Point;
|
|
33
|
+
getLineByID(id: string): Line;
|
|
34
|
+
getClosestPoint(): void;
|
|
35
|
+
parse(data: PluginData): this;
|
|
36
|
+
toJson(): PluginData;
|
|
37
|
+
}
|
|
38
|
+
export {};
|