@realsee/dnalogel 2.0.0-alpha.7 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +4 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +5 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +4 -0
- package/dist/ModelChassisCompassPlugin/index.js +145 -0
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +4 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
- package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/dist/ModelRoomLabelPlugin/index.js +541 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +4 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.js +636 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +39 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +26 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +70 -0
- package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +25 -0
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +59 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +20 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +19 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +10 -0
- package/dist/PanoMeasurePlugin/index.js +3996 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +32 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +37 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.js +610 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/dist/floorplan/Assets/compass.d.ts +1 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +97 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4526 -0
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +36 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +7 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +2008 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +67 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +4236 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/index.d.ts +6 -0
- package/dist/floorplan/typings/floorplanData.d.ts +137 -0
- package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
- package/dist/floorplan/typings/utility.d.ts +2 -0
- package/dist/floorplan/utils/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.es.js +15436 -0
- package/dist/index.js +15488 -0
- package/dist/index.umd.js +15480 -0
- package/dist/shared-utils/Preloader.d.ts +6 -0
- package/dist/shared-utils/Subscribe.d.ts +45 -0
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/dist/shared-utils/animationFrame/index.d.ts +15 -0
- package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
- package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/dist/shared-utils/createLine/index.d.ts +3 -0
- package/dist/shared-utils/debounce.d.ts +6 -0
- package/dist/shared-utils/equal.d.ts +11 -0
- package/dist/shared-utils/filter.d.ts +27 -0
- package/dist/shared-utils/five/changeMode.d.ts +5 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +19 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/isNil.d.ts +10 -0
- package/dist/shared-utils/isTruelyObject.d.ts +18 -0
- package/dist/shared-utils/math/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/index.d.ts +2 -0
- package/dist/shared-utils/math/planimetry.d.ts +116 -0
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
- package/dist/shared-utils/nearlyEqual.d.ts +7 -0
- package/dist/shared-utils/nextFrame.d.ts +1 -0
- package/dist/shared-utils/noop.d.ts +5 -0
- package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/dist/shared-utils/px2rem.d.ts +1 -0
- package/dist/shared-utils/removeArrayItem.d.ts +7 -0
- package/dist/shared-utils/tap.d.ts +8 -0
- package/dist/shared-utils/three/centerPoint.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/dist/shared-utils/three/getNormal.d.ts +2 -0
- package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
- package/dist/shared-utils/three/loadTexture.d.ts +2 -0
- package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
- package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/dist/shared-utils/throttle.d.ts +7 -0
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/to.d.ts +8 -0
- package/dist/shared-utils/uuid.d.ts +5 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/dist/typings/math.type.d.ts +44 -0
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +17 -0
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +34 -0
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -135
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +291 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +107 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +216 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +104 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +142 -0
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/Components/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -326
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +168 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +373 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +195 -43
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +29 -14
- package/CHANGELOG.md +0 -21
- package/dist/dnalogel.cjs.js +0 -7
- package/dist/dnalogel.es.js +0 -41280
- package/dist/dnalogel.umd.js +0 -7
- package/dist/style.css +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
- package/libs/floorplan/Components/BaseImage.svelte +0 -25
- package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
- package/libs/floorplan/Components/Normalmage.svelte +0 -11
- package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
- package/libs/floorplan/Components/SvgImage.svelte +0 -25
- package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
|
@@ -1,103 +1,278 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Hammer from 'hammerjs';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import '../../shared-utils';
|
|
4
|
+
import { Subscribe } from '@realsee/five';
|
|
2
5
|
/** 交换数组元素 */
|
|
3
6
|
function exchange(array, index1, index2) {
|
|
4
7
|
const value = array[index1];
|
|
5
8
|
array[index1] = array[index2];
|
|
6
9
|
array[index2] = value;
|
|
7
10
|
}
|
|
11
|
+
/** 翻转 ArrayBuffer(RGBA像素) 的 Y 轴 */
|
|
12
|
+
function flipPixelsY(pixels, width, height) {
|
|
13
|
+
const flipYLength = height / 2;
|
|
14
|
+
for (let currentHeight = 1; currentHeight <= flipYLength; currentHeight++) {
|
|
15
|
+
const targetHeight = height - (currentHeight - 1);
|
|
16
|
+
for (let currentWidth = 1; currentWidth <= width; currentWidth++) {
|
|
17
|
+
const pixelIndex = (currentHeight - 1) * width + currentWidth - 1;
|
|
18
|
+
const targetPixelIndex = (targetHeight - 1) * width + currentWidth - 1;
|
|
19
|
+
exchange(pixels, pixelIndex * 4 + 0, targetPixelIndex * 4 + 0);
|
|
20
|
+
exchange(pixels, pixelIndex * 4 + 1, targetPixelIndex * 4 + 1);
|
|
21
|
+
exchange(pixels, pixelIndex * 4 + 2, targetPixelIndex * 4 + 2);
|
|
22
|
+
exchange(pixels, pixelIndex * 4 + 3, targetPixelIndex * 4 + 3);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
8
26
|
export default class Magnifier {
|
|
9
|
-
five;
|
|
10
|
-
scale;
|
|
11
|
-
width;
|
|
12
|
-
height;
|
|
13
|
-
pixelRatio;
|
|
14
|
-
originWidth;
|
|
15
|
-
originHeight;
|
|
16
|
-
context;
|
|
17
|
-
canvas = document.createElement('canvas');
|
|
18
|
-
container;
|
|
19
27
|
constructor(five, options) {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
Object.defineProperty(this, "width", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "height", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: void 0
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "visible", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: false
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "hooks", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: new Subscribe()
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "contentDom", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: document.createElement('canvas')
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(this, "five", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: void 0
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(this, "scale", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: void 0
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(this, "wrapper", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: void 0
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(this, "config", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
value: void 0
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(this, "offset", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
configurable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
value: { x: 0, y: 0 }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(this, "canvas", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
value: this.contentDom
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(this, "context", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: void 0
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(this, "renderCenter", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
configurable: true,
|
|
104
|
+
writable: true,
|
|
105
|
+
value: new THREE.Vector3()
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(this, "lastPanEvent", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
configurable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
value: void 0
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(this, "hammer", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
value: void 0
|
|
118
|
+
});
|
|
119
|
+
Object.defineProperty(this, "onPan", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true,
|
|
122
|
+
writable: true,
|
|
123
|
+
value: (event) => {
|
|
124
|
+
var _a, _b, _c, _d;
|
|
125
|
+
if (!this.wrapper)
|
|
126
|
+
return;
|
|
127
|
+
const lastDeltaX = (_b = (_a = this.lastPanEvent) === null || _a === void 0 ? void 0 : _a.deltaX) !== null && _b !== void 0 ? _b : 0;
|
|
128
|
+
const lastDeltaY = (_d = (_c = this.lastPanEvent) === null || _c === void 0 ? void 0 : _c.deltaY) !== null && _d !== void 0 ? _d : 0;
|
|
129
|
+
const deltaX = event.deltaX - lastDeltaX;
|
|
130
|
+
const deltaY = event.deltaY - lastDeltaY;
|
|
131
|
+
this.lastPanEvent = event;
|
|
132
|
+
const prevented = this.hooks.emit('wantsPanGesture', { srcEvent: event, deltaX, deltaY });
|
|
133
|
+
if (prevented)
|
|
134
|
+
return;
|
|
135
|
+
const translateX = this.offset.x + deltaX;
|
|
136
|
+
const translateY = this.offset.y + deltaY;
|
|
137
|
+
this.contentDom.style.boxShadow = '0 2px 30px 0 rgba(0,0,0,0.20)';
|
|
138
|
+
this.canvas.style.transform = `translate3d(${translateX}px, ${translateY}px, 100px)`;
|
|
139
|
+
this.offset = { x: translateX, y: translateY };
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(this, "onPanEnd", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
configurable: true,
|
|
145
|
+
writable: true,
|
|
146
|
+
value: (event) => {
|
|
147
|
+
this.lastPanEvent = undefined;
|
|
148
|
+
this.contentDom.style.boxShadow = 'none';
|
|
149
|
+
}
|
|
150
|
+
});
|
|
20
151
|
if (!five.renderer)
|
|
21
152
|
throw new Error('Five Render 未初始化');
|
|
22
153
|
this.five = five;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
154
|
+
this.scale = (_a = options === null || options === void 0 ? void 0 : options.scale) !== null && _a !== void 0 ? _a : 2;
|
|
155
|
+
this.width = (_b = options === null || options === void 0 ? void 0 : options.width) !== null && _b !== void 0 ? _b : 190;
|
|
156
|
+
this.height = (_c = options === null || options === void 0 ? void 0 : options.height) !== null && _c !== void 0 ? _c : 190;
|
|
157
|
+
this.config = {
|
|
158
|
+
dragEnabled: (options === null || options === void 0 ? void 0 : options.dragEnabled) || false,
|
|
159
|
+
autoFixPCPosition: (options === null || options === void 0 ? void 0 : options.autoFixPCPosition) || false,
|
|
160
|
+
initialPosition: (options === null || options === void 0 ? void 0 : options.initialPosition) || { left: '0', top: '0' },
|
|
161
|
+
};
|
|
30
162
|
const context = this.canvas.getContext('2d');
|
|
31
163
|
if (!context)
|
|
32
164
|
throw new Error('CANNOT CREATE CONTEXT2D');
|
|
33
|
-
this.scale = scale;
|
|
34
165
|
this.context = context;
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
magnifier.style.position = 'absolute';
|
|
42
|
-
magnifier.style.pointerEvents = 'none';
|
|
43
|
-
magnifier.style.borderRadius = '50%';
|
|
44
|
-
magnifier.style.left = -width / 2 + 'px';
|
|
45
|
-
magnifier.style.top = -height - 90 + 'px';
|
|
46
|
-
magnifier.setAttribute('width', width.toString());
|
|
47
|
-
magnifier.setAttribute('height', height.toString());
|
|
48
|
-
this.canvas.style.width = originWidth + 'px';
|
|
49
|
-
this.canvas.style.height = originHeight + 'px';
|
|
166
|
+
if (this.config.dragEnabled) {
|
|
167
|
+
this.hammer = new Hammer(this.canvas);
|
|
168
|
+
this.hammer.on('pan', this.onPan);
|
|
169
|
+
this.hammer.on('panend', this.onPanEnd);
|
|
170
|
+
// this.hooks.on('wantsPanGesture', this.onMagnifierWantsPanGesture)
|
|
171
|
+
}
|
|
50
172
|
}
|
|
51
173
|
dispose() {
|
|
174
|
+
var _a;
|
|
52
175
|
this.clear();
|
|
176
|
+
this.remove();
|
|
177
|
+
(_a = this.hammer) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
178
|
+
}
|
|
179
|
+
/** 移除放大镜 DOM */
|
|
180
|
+
remove() {
|
|
53
181
|
this.canvas.remove();
|
|
182
|
+
this.visible = false;
|
|
54
183
|
}
|
|
184
|
+
/** 清除放大镜渲染内容 */
|
|
55
185
|
clear() {
|
|
56
186
|
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
57
187
|
}
|
|
188
|
+
/** 把放大镜放到某一个容器中 */
|
|
58
189
|
appendTo(element) {
|
|
59
|
-
this.
|
|
190
|
+
this.wrapper = element;
|
|
191
|
+
this.initStyle();
|
|
60
192
|
element.append(this.canvas);
|
|
193
|
+
this.visible = true;
|
|
194
|
+
}
|
|
195
|
+
/** 放大传入点位周围的内容 */
|
|
196
|
+
renderWithPoint(point) {
|
|
197
|
+
if (!this.wrapper)
|
|
198
|
+
return;
|
|
199
|
+
this.renderCenter = point;
|
|
200
|
+
this.render();
|
|
201
|
+
if (this.config.autoFixPCPosition)
|
|
202
|
+
this.autoFixPCPosition();
|
|
61
203
|
}
|
|
62
|
-
|
|
63
|
-
if (!this.
|
|
204
|
+
autoFixPCPosition() {
|
|
205
|
+
if (!this.wrapper)
|
|
64
206
|
return;
|
|
65
|
-
const {
|
|
66
|
-
const position2d =
|
|
67
|
-
const left = ((position2d.x + 1) / 2) * this.
|
|
68
|
-
const right = (-(position2d.x - 1) / 2) * this.
|
|
69
|
-
const top = (-(position2d.y - 1) / 2) * this.
|
|
207
|
+
const { width, height } = this;
|
|
208
|
+
const position2d = this.renderCenter.clone().project(this.five.camera);
|
|
209
|
+
const left = ((position2d.x + 1) / 2) * this.wrapper.clientWidth;
|
|
210
|
+
const right = (-(position2d.x - 1) / 2) * this.wrapper.clientWidth;
|
|
211
|
+
const top = (-(position2d.y - 1) / 2) * this.wrapper.clientHeight;
|
|
70
212
|
if (left < 183) {
|
|
71
|
-
this.canvas.style.top = -
|
|
213
|
+
this.canvas.style.top = -height / 2 + 'px';
|
|
72
214
|
this.canvas.style.left = 90 + 'px';
|
|
73
215
|
}
|
|
74
216
|
else if (top < 183) {
|
|
75
217
|
this.canvas.style.top = 90 + 'px';
|
|
76
|
-
this.canvas.style.left = -
|
|
218
|
+
this.canvas.style.left = -width / 2 + 'px';
|
|
77
219
|
}
|
|
78
220
|
else if (right < 183) {
|
|
79
|
-
this.canvas.style.top = -
|
|
80
|
-
this.canvas.style.left = -
|
|
221
|
+
this.canvas.style.top = -height / 2 + 'px';
|
|
222
|
+
this.canvas.style.left = -width - 90 + 'px';
|
|
81
223
|
}
|
|
82
224
|
else {
|
|
83
|
-
this.canvas.style.left = -
|
|
84
|
-
this.canvas.style.top = -
|
|
225
|
+
this.canvas.style.left = -width / 2 + 'px';
|
|
226
|
+
this.canvas.style.top = -height - 90 + 'px';
|
|
85
227
|
}
|
|
86
228
|
this.canvas.style.transform = `translate3d(${left}px, ${top}px, 10px)`;
|
|
87
|
-
|
|
229
|
+
this.offset = { x: left, y: top };
|
|
230
|
+
}
|
|
231
|
+
render() {
|
|
232
|
+
if (!this.five.renderer || !this.wrapper)
|
|
233
|
+
return;
|
|
234
|
+
const { scale, context, width, height } = this;
|
|
235
|
+
const position2d = this.renderCenter.clone().project(this.five.camera);
|
|
236
|
+
const renderSize = this.five.renderer.getSize(new THREE.Vector2());
|
|
237
|
+
// const pixelRatio = this.five.renderer.getPixelRatio()
|
|
238
|
+
// 安卓机型和ios部分机型在app里读不到像素,固定为1降低清晰度可以读到
|
|
239
|
+
const pixelRatio = 1;
|
|
240
|
+
// 从 renderTarget 读取区域的大小
|
|
241
|
+
const readPixelsWidth = width / scale;
|
|
242
|
+
const readPixelsHeight = height / scale;
|
|
243
|
+
// 一个像素重复多少倍,pixelRatio 是兼容屏幕像素比,scale 是真实重复倍数
|
|
244
|
+
const readPixelsRadio = pixelRatio * scale;
|
|
88
245
|
const x = ((position2d.x + 1) / 2) * renderSize.x;
|
|
89
246
|
const y = ((position2d.y + 1) / 2) * renderSize.y;
|
|
90
|
-
const pixels = this.five.getPixels(x -
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
const imageData = context.createImageData(width, height);
|
|
247
|
+
const pixels = this.five.getPixels(x - readPixelsWidth / 2, y - readPixelsWidth / 2, readPixelsWidth, readPixelsHeight, readPixelsRadio);
|
|
248
|
+
// 最后生成的图像大小是 [width * pixelRatio, height * pixelRatio]
|
|
249
|
+
// 绘制在[width, height]的区域上
|
|
250
|
+
const imageWidth = Math.floor(width * pixelRatio);
|
|
251
|
+
const imageHeight = Math.floor(height * pixelRatio);
|
|
252
|
+
// 因为 Canvas 与 THREE Renderer Y 坐标相反,所以需要 Y 轴翻转
|
|
253
|
+
flipPixelsY(pixels, imageWidth, imageHeight);
|
|
254
|
+
const imageData = new ImageData(imageWidth, imageHeight);
|
|
100
255
|
imageData.data.set(pixels);
|
|
101
256
|
context.putImageData(imageData, 0, 0);
|
|
102
257
|
}
|
|
258
|
+
initStyle() {
|
|
259
|
+
const canvas = this.canvas;
|
|
260
|
+
canvas.classList.add('five-plugin__magnifier');
|
|
261
|
+
canvas.style.position = 'absolute';
|
|
262
|
+
canvas.style.pointerEvents = 'all';
|
|
263
|
+
canvas.style.borderRadius = '50%';
|
|
264
|
+
canvas.style.zIndex = '99';
|
|
265
|
+
const pixelRatio = 1;
|
|
266
|
+
canvas.setAttribute('width', (this.width * pixelRatio).toString());
|
|
267
|
+
canvas.setAttribute('height', (this.height * pixelRatio).toString());
|
|
268
|
+
canvas.style.border = '2px solid rgba(255,255,255,0.20)';
|
|
269
|
+
canvas.style.width = this.width + 'px';
|
|
270
|
+
canvas.style.height = this.height + 'px';
|
|
271
|
+
canvas.style.top = this.config.initialPosition.top;
|
|
272
|
+
canvas.style.left = this.config.initialPosition.left;
|
|
273
|
+
canvas.style.transform = 'translate(0,0,100px)';
|
|
274
|
+
if (this.config.dragEnabled) {
|
|
275
|
+
this.canvas.style.cursor = 'pointer';
|
|
276
|
+
}
|
|
277
|
+
}
|
|
103
278
|
}
|
|
@@ -1,13 +1,86 @@
|
|
|
1
1
|
import TWEEN from '@tweenjs/tween.js';
|
|
2
|
-
import { mainIconStyle
|
|
2
|
+
import { mainIconStyle, mainItemStyle } from './style';
|
|
3
3
|
import { tweenProgress } from '../../../shared-utils/animationFrame/BetterTween';
|
|
4
4
|
import { MAIN_NORMAL_PATH, MAIN_DONE_PATH, MAIN_MOUSE_ENTER_FILL, MAIN_MOUSE_LEAVE_FILL } from './HTML';
|
|
5
5
|
export class MainBtnController {
|
|
6
|
-
container;
|
|
7
|
-
measureController;
|
|
8
|
-
mainIconMaskTween;
|
|
9
|
-
mainElement;
|
|
10
6
|
constructor(measureController, container) {
|
|
7
|
+
Object.defineProperty(this, "container", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: void 0
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(this, "measureController", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: void 0
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(this, "mainIconMaskTween", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "mainElement", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
/* 鼠标移入时变成蓝色 */
|
|
32
|
+
Object.defineProperty(this, "onMouseEnter", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: () => {
|
|
37
|
+
const { mainItem, pathDom } = this.mainElement;
|
|
38
|
+
mainItem.style.opacity = '1';
|
|
39
|
+
pathDom.setAttribute('fill', MAIN_MOUSE_ENTER_FILL);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
/* 鼠标移出时变成灰色 */
|
|
43
|
+
Object.defineProperty(this, "onMouseLeave", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: () => {
|
|
48
|
+
const { mainItem, pathDom } = this.mainElement;
|
|
49
|
+
mainItem.style.opacity = '0.7';
|
|
50
|
+
pathDom.setAttribute('fill', MAIN_MOUSE_LEAVE_FILL);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "onClick", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: () => {
|
|
58
|
+
const mode = this.measureController.getCurrentMode();
|
|
59
|
+
mode === 'Watch' ? this.measureController.changeMode('Edit') : this.measureController.save().changeMode('Watch');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(this, "editedLineChangeHandler", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
value: (lines) => {
|
|
67
|
+
// 线的数量大于 1 时,没有状态的变化
|
|
68
|
+
if (lines.length > 1)
|
|
69
|
+
return;
|
|
70
|
+
// 因为撤销导致的状态变更 -> 取消
|
|
71
|
+
if (lines.length === 0)
|
|
72
|
+
return this.change2Cancel(false);
|
|
73
|
+
this.change2Done();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(this, "modeChangeHandler", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true,
|
|
79
|
+
writable: true,
|
|
80
|
+
value: (mode) => {
|
|
81
|
+
mode === 'Watch' ? this.change2Add() : this.change2Cancel();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
11
84
|
this.measureController = measureController;
|
|
12
85
|
this.container = container;
|
|
13
86
|
this.mainElement = this.getMainElement();
|
|
@@ -30,8 +103,8 @@ export class MainBtnController {
|
|
|
30
103
|
const mainTextDom = this.container.querySelector('.fpm__main-text');
|
|
31
104
|
const mainItem = this.container.querySelector('.fpm__main');
|
|
32
105
|
const mainIcon = this.container.querySelector('.fpm__main-icon');
|
|
33
|
-
const pathDom = mainItem
|
|
34
|
-
const maskWhiteRect = mainIcon
|
|
106
|
+
const pathDom = mainItem === null || mainItem === void 0 ? void 0 : mainItem.querySelector('.fpm__main-icon-path');
|
|
107
|
+
const maskWhiteRect = mainIcon === null || mainIcon === void 0 ? void 0 : mainIcon.querySelector('#fpm__main-icon-mask-white');
|
|
35
108
|
if (!mainItem || !mainTextDom || !mainIcon || !pathDom || !maskWhiteRect)
|
|
36
109
|
throw new Error('cannot find dom');
|
|
37
110
|
return { mainTextDom, mainItem, mainIcon, pathDom, maskWhiteRect };
|
|
@@ -42,7 +115,7 @@ export class MainBtnController {
|
|
|
42
115
|
mainIcon.style.transition = mainTextDom.innerText === '完成' ? 'none' : 'transform 300ms ease-in-out';
|
|
43
116
|
mainIcon.style.transform = 'rotate(0deg)';
|
|
44
117
|
mainTextDom.innerText = '添加';
|
|
45
|
-
pathDom
|
|
118
|
+
pathDom === null || pathDom === void 0 ? void 0 : pathDom.setAttribute('d', MAIN_NORMAL_PATH);
|
|
46
119
|
}
|
|
47
120
|
change2Cancel(withAnime = true) {
|
|
48
121
|
const { mainIcon, mainTextDom, pathDom } = this.mainElement;
|
|
@@ -54,6 +127,7 @@ export class MainBtnController {
|
|
|
54
127
|
this.measureController.hook.on('editedLineChange', this.editedLineChangeHandler);
|
|
55
128
|
}
|
|
56
129
|
change2Done() {
|
|
130
|
+
var _a;
|
|
57
131
|
const { mainTextDom, mainIcon, pathDom, maskWhiteRect } = this.getMainElement();
|
|
58
132
|
if (mainTextDom.innerText === '完成')
|
|
59
133
|
return;
|
|
@@ -62,41 +136,13 @@ export class MainBtnController {
|
|
|
62
136
|
mainTextDom.innerText = '完成';
|
|
63
137
|
pathDom.setAttribute('d', MAIN_DONE_PATH);
|
|
64
138
|
pathDom.setAttribute('mask', `url(#fpm__main-icon-mask)`);
|
|
65
|
-
this.mainIconMaskTween
|
|
139
|
+
(_a = this.mainIconMaskTween) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
66
140
|
this.mainIconMaskTween = tweenProgress()
|
|
67
141
|
.easing(TWEEN.Easing.Quartic.InOut)
|
|
68
142
|
.onUpdate(({ progress }) => {
|
|
69
143
|
maskWhiteRect.setAttribute('width', (progress * 30).toString());
|
|
70
144
|
})
|
|
71
|
-
.onComplete(() => this.mainIconMaskTween
|
|
145
|
+
.onComplete(() => { var _a; return (_a = this.mainIconMaskTween) === null || _a === void 0 ? void 0 : _a.dispose(); })
|
|
72
146
|
.play();
|
|
73
147
|
}
|
|
74
|
-
/* 鼠标移入时变成蓝色 */
|
|
75
|
-
onMouseEnter = () => {
|
|
76
|
-
const { mainItem, pathDom } = this.mainElement;
|
|
77
|
-
mainItem.style.opacity = '1';
|
|
78
|
-
pathDom.setAttribute('fill', MAIN_MOUSE_ENTER_FILL);
|
|
79
|
-
};
|
|
80
|
-
/* 鼠标移出时变成灰色 */
|
|
81
|
-
onMouseLeave = () => {
|
|
82
|
-
const { mainItem, pathDom } = this.mainElement;
|
|
83
|
-
mainItem.style.opacity = '0.7';
|
|
84
|
-
pathDom.setAttribute('fill', MAIN_MOUSE_LEAVE_FILL);
|
|
85
|
-
};
|
|
86
|
-
onClick = () => {
|
|
87
|
-
const mode = this.measureController.getCurrentMode();
|
|
88
|
-
mode === 'Watch' ? this.measureController.changeMode('Edit') : this.measureController.save().changeMode('Watch');
|
|
89
|
-
};
|
|
90
|
-
editedLineChangeHandler = (lines) => {
|
|
91
|
-
// 线的数量大于 1 时,没有状态的变化
|
|
92
|
-
if (lines.length > 1)
|
|
93
|
-
return;
|
|
94
|
-
// 因为撤销导致的状态变更 -> 取消
|
|
95
|
-
if (lines.length === 0)
|
|
96
|
-
return this.change2Cancel(false);
|
|
97
|
-
this.change2Done();
|
|
98
|
-
};
|
|
99
|
-
modeChangeHandler = (mode) => {
|
|
100
|
-
mode === 'Watch' ? this.change2Add() : this.change2Cancel();
|
|
101
|
-
};
|
|
102
148
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type MeasureController from '../../Controller';
|
|
2
|
+
export declare class NewMainBtnController {
|
|
3
|
+
private container;
|
|
4
|
+
private measureController;
|
|
5
|
+
private mainElement;
|
|
6
|
+
constructor(measureController: MeasureController, container: Element);
|
|
7
|
+
dispose(): void;
|
|
8
|
+
private getMainElement;
|
|
9
|
+
private change2Add;
|
|
10
|
+
private change2Done;
|
|
11
|
+
private onClick;
|
|
12
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { newMainIconStyle, newMainItemStyle } from './style';
|
|
2
|
+
export class NewMainBtnController {
|
|
3
|
+
constructor(measureController, container) {
|
|
4
|
+
Object.defineProperty(this, "container", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true,
|
|
8
|
+
value: void 0
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(this, "measureController", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "mainElement", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: void 0
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(this, "onClick", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: () => {
|
|
27
|
+
if (this.mainElement.mainTextDom.innerText === '开始') {
|
|
28
|
+
this.measureController.hook.emit('willChangeState', 'watching', 'editing');
|
|
29
|
+
this.change2Done();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.measureController.hook.emit('willChangeState', 'editing', 'watching');
|
|
33
|
+
this.change2Add();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
this.measureController = measureController;
|
|
38
|
+
this.container = container;
|
|
39
|
+
this.mainElement = this.getMainElement();
|
|
40
|
+
Object.assign(this.mainElement.mainIcon.style, newMainIconStyle);
|
|
41
|
+
Object.assign(this.mainElement.mainItem.style, newMainItemStyle);
|
|
42
|
+
this.change2Add();
|
|
43
|
+
this.mainElement.mainItem.addEventListener('click', this.onClick);
|
|
44
|
+
}
|
|
45
|
+
dispose() {
|
|
46
|
+
this.mainElement.mainItem.removeEventListener('click', this.onClick);
|
|
47
|
+
}
|
|
48
|
+
getMainElement() {
|
|
49
|
+
const mainTextDom = this.container.querySelector('.fpm__main-text');
|
|
50
|
+
const mainItem = this.container.querySelector('.fpm__main');
|
|
51
|
+
const mainIcon = this.container.querySelector('.fpm__main-icon');
|
|
52
|
+
if (!mainItem || !mainTextDom || !mainIcon)
|
|
53
|
+
throw new Error('cannot find dom');
|
|
54
|
+
return { mainTextDom, mainItem, mainIcon };
|
|
55
|
+
}
|
|
56
|
+
change2Add() {
|
|
57
|
+
const { mainIcon, mainTextDom } = this.mainElement;
|
|
58
|
+
if (mainIcon.className.includes('fpm__main__start'))
|
|
59
|
+
return;
|
|
60
|
+
if (mainIcon.className.includes('fpm__main__end')) {
|
|
61
|
+
mainIcon.style.transform = `scale(0.8)`;
|
|
62
|
+
if (mainTextDom.className.includes('fpm__main-text__show')) {
|
|
63
|
+
mainTextDom.classList.replace('fpm__main-text__show', 'fpm__main-text__hide');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
mainTextDom.classList.add('fpm__main-text__hide');
|
|
67
|
+
}
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
mainIcon.classList.replace('fpm__main__end', 'fpm__main__start');
|
|
70
|
+
mainIcon.style.transform = 'scale(1)';
|
|
71
|
+
mainTextDom.innerText = '开始';
|
|
72
|
+
mainTextDom.classList.replace('fpm__main-text__hide', 'fpm__main-text__show');
|
|
73
|
+
}, 200);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
change2Done() {
|
|
77
|
+
const { mainTextDom, mainIcon } = this.mainElement;
|
|
78
|
+
if (mainTextDom.innerText === '结束')
|
|
79
|
+
return;
|
|
80
|
+
if (mainIcon.className.includes('fpm__main__end'))
|
|
81
|
+
return;
|
|
82
|
+
if (mainIcon.className.includes('fpm__main__start')) {
|
|
83
|
+
mainIcon.style.transform = `scale(0.8)`;
|
|
84
|
+
if (mainTextDom.className.includes('fpm__main-text__show')) {
|
|
85
|
+
mainTextDom.classList.replace('fpm__main-text__show', 'fpm__main-text__hide');
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
mainTextDom.classList.add('fpm__main-text__hide');
|
|
89
|
+
}
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
mainIcon.classList.replace('fpm__main__start', 'fpm__main__end');
|
|
92
|
+
mainIcon.style.transform = 'scale(1)';
|
|
93
|
+
mainTextDom.innerText = '结束';
|
|
94
|
+
mainTextDom.classList.replace('fpm__main-text__hide', 'fpm__main-text__show');
|
|
95
|
+
}, 200);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|