@labelbee/lb-components 1.23.0-alpha.14 → 1.23.0-alpha.140
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/dist/App.js +1 -1
- package/dist/_virtual/2DViewWorker.js +1 -0
- package/dist/_virtual/highlightSegmentWorker.js +1 -1
- package/dist/assets/annotation/icon_link.svg.js +1 -0
- package/dist/assets/annotation/icon_unlink.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/dist/assets/icons/ad33251.svg +26 -0
- package/dist/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/DynamicResizer/DynamicResizer.js +1 -0
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/assets/divider.svg.js +1 -0
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/dist/components/DynamicResizer/index.js +1 -0
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/dist/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/dist/components/audioPlayer/zoomSlider/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/markdownView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
- package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/dist/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/dist/components/pointCloudView/utils/map.js +1 -0
- package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/dist/components/predictTracking/previewResult/index.js +1 -1
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/hooks/useToolStyle.js +1 -0
- package/dist/index.css +205 -16
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/LLMMultiWheel/index.js +1 -0
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -1
- package/dist/store/toolConfig/baseToolConfig.js +1 -0
- package/dist/store/toolConfig/index.js +1 -0
- package/dist/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/dist/types/App.d.ts +6 -1
- package/dist/types/components/AnnotationView/hooks/useFilterAnnotations.d.ts +2 -0
- package/dist/types/components/AnnotationView/index.d.ts +10 -0
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +5 -0
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +23 -0
- package/dist/types/components/DynamicResizer/index.d.ts +2 -0
- package/dist/types/components/DynamicResizer/types/interface.d.ts +17 -0
- package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +15 -0
- package/dist/types/components/LLMMultiWheelView/index.d.ts +21 -0
- package/dist/types/components/LLMMultiWheelView/sidebar/index.d.ts +8 -0
- package/dist/types/components/LLMMultiWheelView/types.d.ts +62 -0
- package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +15 -0
- package/dist/types/components/LLMToolView/questionView/index.d.ts +7 -0
- package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +3 -0
- package/dist/types/components/LLMToolView/sidebar/components/modelAnswerSort/index.d.ts +30 -0
- package/dist/types/components/LLMToolView/sidebar/components/textInputBox/index.d.ts +2 -2
- package/dist/types/components/LLMToolView/sidebar/index.d.ts +10 -0
- package/dist/types/components/LLMToolView/types.d.ts +6 -2
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -0
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
- package/dist/types/components/audioPlayer/clipRegion/index.d.ts +1 -0
- package/dist/types/components/audioPlayer/index.d.ts +28 -21
- package/dist/types/components/audioPlayer/zoomSlider/index.d.ts +1 -0
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
- package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
- package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +23 -4
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
- package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +5 -3
- package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +31 -1
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
- package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useUpdatePointCloudColor.d.ts +4 -0
- package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
- package/dist/types/components/pointCloudView/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
- package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
- package/dist/types/components/subAttributeList/index.d.ts +10 -0
- package/dist/types/components/videoAnnotate/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/data/enums/ToolType.d.ts +2 -1
- package/dist/types/hooks/useToolStyle.d.ts +30 -0
- package/dist/types/index.d.ts +9 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/LLMMultiWheel/index.d.ts +15 -0
- package/dist/types/store/annotatedBox/index.d.ts +2 -0
- package/dist/types/store/annotation/actionCreators.d.ts +4 -3
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/store/ctx.d.ts +7 -0
- package/dist/types/store/toolConfig/baseToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/index.d.ts +3 -0
- package/dist/types/store/toolConfig/pointCloudToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/types.d.ts +10 -0
- package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +24 -0
- package/dist/types/utils/data.d.ts +0 -2
- package/dist/types/utils/index.d.ts +27 -0
- package/dist/types/views/MainView/LLMMultiWheelLayout/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +1 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/dist/utils/data.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/dist/views/MainView/toolHeader/index.js +1 -1
- package/es/App.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -0
- package/es/_virtual/highlightSegmentWorker.js +1 -1
- package/es/assets/annotation/icon_link.svg.js +1 -0
- package/es/assets/annotation/icon_unlink.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/es/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/DynamicResizer/DynamicResizer.js +1 -0
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/es/components/DynamicResizer/assets/divider.svg.js +1 -0
- package/es/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/es/components/DynamicResizer/index.js +1 -0
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/es/components/LLMMultiWheelView/index.js +1 -0
- package/es/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/attributeList/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/es/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/es/components/audioPlayer/zoomSlider/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/markdownView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/es/components/pointCloud2DRectOperationView/util.js +1 -0
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudInfos.js +1 -1
- package/es/components/pointCloudView/PointCloudLayout.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/es/components/pointCloudView/hooks/useRotate.js +1 -1
- package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/es/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/es/components/pointCloudView/utils/map.js +1 -0
- package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/es/components/predictTracking/previewResult/index.js +1 -1
- package/es/components/subAttributeList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/data/enums/ToolType.js +1 -1
- package/es/hooks/useToolStyle.js +1 -0
- package/es/index.css +205 -16
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/LLMMultiWheel/index.js +1 -0
- package/es/store/annotatedBox/index.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/ctx.js +1 -1
- package/es/store/toolConfig/baseToolConfig.js +1 -0
- package/es/store/toolConfig/index.js +1 -0
- package/es/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/es/utils/data.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/es/views/MainView/toolHeader/index.js +1 -1
- package/package.json +7 -4
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,n,i)=>n in o?__defProp(o,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[n]=i,__spreadValues=(o,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(o,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(o,i,n[i]);return o},__spreadProps=(o,n)=>__defProps(o,__getOwnPropDescs(n)),__async=(o,n,i)=>new Promise((b,y)=>{var L=c=>{try{I(i.next(c))}catch(S){y(S)}},x=c=>{try{I(i.throw(c))}catch(S){y(S)}},I=c=>c.done?b(c.value):Promise.resolve(c.value).then(L,x);I((i=i.apply(o,n)).next())});const pickRectObject=o=>___default.default.pick(o,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:o=>{},imageSizes:{},cacheImageNodeSize:()=>{}}),PointCloudProvider=({children:o})=>{const[n,i]=React.useState([]),[b,y]=React.useState([]),[L,x]=React.useState([]),[I,c]=React.useState([]),[S,et]=React.useState([]),[v,V]=React.useState([]),[w,R]=React.useState([]),[N,nt]=React.useState(!0),[q,ot]=React.useState(!0),[z,it]=React.useState(1),[r,M]=React.useState(),[G,T]=React.useState(),[F,k]=React.useState(),[s,Z]=React.useState(),[U,st]=React.useState(""),[B,lt]=React.useState(lbAnnotation.EToolName.Rect),rt=React.useRef(new lbAnnotation.ActionsHistory).current,[d,O]=React.useState([]),[J,at]=React.useState(""),[H,ut]=React.useState(lbUtils.EPointCloudPattern.Detection),[C,K]=React.useState(void 0),[E,ct]=React.useState([]),[j,dt]=React.useState([]),p=index(),[Q,pt]=React.useState({}),vt=ctx.useDispatch(),ft=l=>{const{imgNode:a,path:u}=l;u&&a&&pt(P=>__spreadProps(__spreadValues({},P),{[u]:{width:a.width,height:a.height}}))},W=React.useMemo(()=>v.length===1?v[0]:"",[v]),A=React.useMemo(()=>{const l=n.find(t=>t.id===W),a=t=>{const e=n.concat(t);return i(e),e},u=t=>{const e=b.concat(t);return y(e),e},P=t=>{nt(t!==!1)},f=t=>{t===void 0&&V([]),typeof t=="string"&&V([t]),Array.isArray(t)&&V(Array.from(new Set(t)))},Pt=t=>{v.includes(t)?f(v.filter(e=>e!==t)):f([...v,t])},ht=t=>{const e=pickRectObject(t);c(g=>[...g,e])},St=t=>{const e=pickRectObject(t);c(g=>g.map(h=>h.id===t.id?e:h))},bt=t=>{c(e=>e.filter(g=>!t.find(h=>h.id===g.id)))},It=t=>{w.includes(t)?R([]):R([t])},Ct=()=>{if(B===lbAnnotation.EToolName.Rect){const t=n.map(e=>e.id);f(t),r==null||r.pointCloud2dOperation.setSelectedIDs(t)}},mt=t=>{f(n.filter(e=>e.attribute===t).map(e=>e.id))},X=n.filter(t=>!d.includes(t.attribute)),Y=b.filter(t=>!d.includes(t.attribute)),$=S.filter(t=>t.attribute&&!d.includes(t.attribute)),yt=t=>{if(d.includes(t))O(d.filter(e=>e!==t));else{const e=d.concat(t);O(e)}},Lt=(t=X,e=L,g=Y,h=$,D=E)=>{var m;s==null||s.clearAllBox(),s==null||s.clearAllSphere(),r==null||r.updatePolygonList(t,e),r==null||r.updatePointList(g),r==null||r.updateLineList(h),s==null||s.generateBoxes(t),s==null||s.generateSpheres(g),(m=C==null?void 0:C.store)==null||m.updateCurrentSegment(D),tt(t)},wt=()=>{M(void 0),T(void 0),k(void 0),Z(void 0)},tt=(t,e)=>__async(void 0,null,function*(){var g;if(!s)return;const h=s.pointCloudObject;if(!!h)try{const D=yield s.getHighlightIndexByMappingImgList({mappingImgList:e!=null?e:j,points:h.geometry.attributes.position.array}),m=yield s==null?void 0:s.highlightOriginPointCloud(t,D);return m&&((g=r==null?void 0:r.pointCloudInstance)==null||g.updateColor(m)),m}catch(D){console.error(D)}});return{selectedID:W,pointCloudBoxList:n,pointCloudSphereList:b,displayPointCloudList:X,displaySphereList:Y,displayLineList:$,selectedIDs:v,setPointCloudResult:i,setSelectedIDs:f,addPointCloudBox:a,addPointCloudSphere:u,setPointCloudSphereList:y,valid:N,selectedPointCloudBox:l,setPointCloudValid:P,addSelectedID:Pt,addHighlightID:It,selectedAllBoxes:Ct,topViewInstance:r,setTopViewInstance:M,sideViewInstance:G,setSideViewInstance:T,backViewInstance:F,setBackViewInstance:k,mainViewInstance:s,setMainViewInstance:Z,polygonList:L,setPolygonList:x,rectList:I,setRectList:c,addRectIn2DView:ht,removeRectIn2DView:bt,updateRectIn2DView:St,lineList:S,setLineList:et,zoom:z,setZoom:it,history:rt,toggleAttributesVisible:yt,hideAttributes:d,setHideAttributes:O,reRender:Lt,attrPanelLayout:J,setAttrPanelLayout:at,syncAllViewPointCloudColor:tt,defaultAttribute:U,setDefaultAttribute:st,pointCloudPattern:B,setPointCloudPattern:lt,selectSpecAttr:mt,globalPattern:H,setGlobalPattern:t=>{H!==t&&(vt(actionCreators.ChangeSave),ut(t),t===lbUtils.EPointCloudPattern.Detection&&K(void 0))},ptSegmentInstance:C,setPtSegmentInstance:K,segmentation:E,setSegmentation:ct,clearAllDetectionInstance:wt,highlight2DDataList:j,setHighlight2DDataList:dt,cuboidBoxIn2DView:q,setCuboidBoxIn2DView:ot,imageSizes:Q,cacheImageNodeSize:ft,highlightIDs:w,setHighlightIDs:R}},[N,v,n,b,L,S,I,r,G,F,s,z,d,J,U,B,H,C,E,j,q,Q,w]);React.useEffect(()=>{var l,a,u;(l=p==null?void 0:p.setPointCloudBoxList)==null||l.call(p,n),(a=p==null?void 0:p.setHighlightIDs)==null||a.call(p,w),(u=p==null?void 0:p.setSelectedIDs)==null||u.call(p,v)},[n,v,w]),React.useEffect(()=>{var l;(l=p==null?void 0:p.setPtCtx)==null||l.call(p,A)},[A]);const gt=()=>{const l=n.filter(f=>d.includes(f.attribute)),{setSelectedIDs:a,reRender:u}=A,P=l.map(f=>f.id);P.length>0&&a(v.filter(f=>!P.includes(f))),u()};return React.useEffect(()=>{var l,a,u,P;gt(),(a=(l=r==null?void 0:r.toolInstance)==null?void 0:l.setHiddenAttributes)==null||a.call(l,d),(P=(u=C==null?void 0:C.store)==null?void 0:u.setHiddenAttributes)==null||P.call(u,d)},[d]),React__default.default.createElement(PointCloudContext.Provider,{value:A},o)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash"),map=require("./utils/map.js"),useTimeoutFunc=require("./hooks/useTimeoutFunc.js"),useWindowKeydownListener=require("./hooks/useWindowKeydownListener.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,i,d)=>i in r?__defProp(r,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[i]=d,__spreadValues=(r,i)=>{for(var d in i||(i={}))__hasOwnProp.call(i,d)&&__defNormalProp(r,d,i[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(i))__propIsEnum.call(i,d)&&__defNormalProp(r,d,i[d]);return r},__spreadProps=(r,i)=>__defProps(r,__getOwnPropDescs(i)),__async=(r,i,d)=>new Promise((x,D)=>{var A=u=>{try{I(d.next(u))}catch(R){D(R)}},O=u=>{try{I(d.throw(u))}catch(R){D(R)}},I=u=>u.done?x(u.value):Promise.resolve(u.value).then(A,O);I((d=d.apply(r,i)).next())});const pickRectObject=r=>___default.default.pick(r,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:r=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:r=>!1,removeRectBySpecifyId:(r,i,d)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener()}),PointCloudProvider=({children:r})=>{const[i,d]=React.useState([]),[x,D]=React.useState([]),[A,O]=React.useState([]),[I,u]=React.useState([]),[R,Re]=React.useState([]),[v,N]=React.useState([]),[B,j]=React.useState([]),[U,xe]=React.useState(!0),[Z,Le]=React.useState(2),[J,De]=React.useState(!0),[Q,Ae]=React.useState(1),[f,X]=React.useState(),[Y,$]=React.useState(),[ee,te]=React.useState(),[g,oe]=React.useState(),[ne,Be]=React.useState(""),[F,_e]=React.useState(lbAnnotation.EToolName.Rect),q=React.useRef(new lbAnnotation.ActionsHistory).current,[p,T]=React.useState([]),[ie,Ve]=React.useState(""),[z,Ne]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,se]=React.useState(void 0),[W,He]=React.useState([]),[G,Me]=React.useState([]),[re,ke]=React.useState(!1),h=index(),[le,Ee]=React.useState({}),Oe=ctx.useDispatch(),je=o=>{const{imgNode:n,path:t}=o;t&&n&&Ee(a=>__spreadProps(__spreadValues({},a),{[t]:{width:n.width,height:n.height}}))},ae=React.useMemo(()=>v.length===1?v[0]:"",[v]),de=useWindowKeydownListener.default(),H=React.useCallback((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return u(c=>{let S=!1;const P=c.filter(k=>{const K=k[a],E=l.has(K)?k.imageName!==o:!0;return E||(S=!0),E});return S?P:c}),!0},[]),ce=React.useCallback(o=>{const n=i.map(t=>t.id);return H(o,n,"extId")},[i,H]),ue=React.useCallback(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:c}=t,S=t.rects.find(P=>P.imageName===o);if(S){const P=___default.default.pick(S,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},P),{id:lbAnnotation.uuid(),attribute:l,order:c,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const a=new Set(t.filter(c=>o===c.imageName).map(c=>c.extId)),l=n.filter(c=>a.has(c.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),ge=React.useMemo(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:c}=l;if(!c){console.warn("Missing image name"),console.trace(l,t);return}map.addMapIndirectWeakSetItem(n,c,t.id,t)}),n},new Map),[i]),fe=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),pe=React.useMemo(()=>I.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(map.addMapIndirectWeakSetItem(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,I),o)},new Map),[I]),{fn:Fe}=useTimeoutFunc.default(o=>{N(n=>{const t=o,a=new Set(t);let l=!1;const c=n.filter(S=>{const P=a.has(S);return P||(l=!0),P});return l?c:n})},200),he=React.useCallback(o=>{const n=o.map(t=>t.id);d(o),Fe(n)},[]),M=React.useMemo(()=>{const o=i.find(e=>e.id===ae),n=e=>{const s=i.concat(e);return he(s),s},t=e=>{const s=x.concat(e);return D(s),s},a=e=>{xe(e!==!1)},l=e=>{e===void 0&&N([]),typeof e=="string"&&N([e]),Array.isArray(e)&&N(Array.from(new Set(e)))},c=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},S=e=>{const s=pickRectObject(e);u(m=>[...m,s])},P=(e,s=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?s?__spreadValues(__spreadValues({},w),m):m:w))},k=e=>{u(s=>s.filter(m=>!e.find(C=>C.id===m.id)))},K=e=>{B.includes(e)?j([]):j([e])},E=()=>{if(F===lbAnnotation.EToolName.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Te=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},me=i.filter(e=>!p.includes(e.attribute)),ve=x.filter(e=>!p.includes(e.attribute)),Pe=R.filter(e=>e.attribute&&!p.includes(e.attribute)),ze=e=>{if(p.includes(e))T(p.filter(s=>s!==e));else{const s=p.concat(e);T(s)}},We=(e=me,s=A,m=ve,C=Pe,w=W)=>{var V;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(m),f==null||f.updateLineList(C),g==null||g.generateBoxes(e),g==null||g.generateSpheres(m),(V=L==null?void 0:L.store)==null||V.updateCurrentSegment(w),Ie(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Ge=()=>{X(void 0),$(void 0),te(void 0),oe(void 0)},Ie=(e,s,m)=>__async(void 0,null,function*(){var C,w,V;if(!g)return;const Se=g.pointCloudObject;if(!Se)return;let Ce=[],we=[];try{if(s&&q.record.length){const{record:y,recordIndex:b}=q;let ye=b;b>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&s.length===((C=y[b])==null?void 0:C.pointCloudBoxList.length))&&(ye=b-1);let Ke=(w=y[ye])==null?void 0:w.pointCloudBoxList;const be=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,s,Ke);Ce=be.modifiedBoxIds,we=be.resetAreas}}catch(y){console.error("call calcResetAreasAndBoxIds error",y)}try{const y=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:G,points:Se.geometry.attributes.position.array}),b=yield g==null?void 0:g.highlightOriginPointCloud(s,y,{modifiedBoxIds:Ce,resetAreas:we});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(y){console.error("call highlightOriginPointCloud error",y)}});return{selectedID:ae,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:me,displaySphereList:ve,displayLineList:Pe,selectedIDs:v,setPointCloudResult:he,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:D,valid:U,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:c,addHighlightID:K,selectedAllBoxes:E,topViewInstance:f,setTopViewInstance:X,sideViewInstance:Y,setSideViewInstance:$,backViewInstance:ee,setBackViewInstance:te,mainViewInstance:g,setMainViewInstance:oe,polygonList:A,setPolygonList:O,rectList:I,setRectList:u,addRectIn2DView:S,removeRectIn2DView:k,updateRectIn2DView:P,lineList:R,setLineList:Re,zoom:Q,setZoom:Ae,history:q,toggleAttributesVisible:ze,hideAttributes:p,setHideAttributes:T,reRender:We,attrPanelLayout:ie,setAttrPanelLayout:Ve,syncAllViewPointCloudColor:Ie,defaultAttribute:ne,setDefaultAttribute:Be,pointCloudPattern:F,setPointCloudPattern:_e,selectSpecAttr:Te,globalPattern:z,setGlobalPattern:e=>{z!==e&&(Oe(actionCreators.ChangeSave),Ne(e),e===lbUtils.EPointCloudPattern.Detection&&se(void 0))},ptSegmentInstance:L,setPtSegmentInstance:se,segmentation:W,setSegmentation:He,clearAllDetectionInstance:Ge,highlight2DDataList:G,setHighlight2DDataList:Me,highlight2DLoading:re,setHighlight2DLoading:ke,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:De,imageSizes:le,cacheImageNodeSize:je,highlightIDs:B,setHighlightIDs:j,removeRectByPointCloudBoxId:ce,removeRectBySpecifyId:H,addRectFromPointCloudBoxByImageName:ue,rectRotateSensitivity:Z,setRectRotateSensitivity:Le,imageNamePointCloudBoxMap:ge,linkageImageNameRectMap:pe,updateRectListByReducer:fe,windowKeydownListenerHook:de}},[U,v,i,x,A,R,I,f,Y,ee,g,Q,p,ie,ne,F,z,L,W,G,re,J,le,B,ce,H,ue,Z,ge,pe,fe,de]);React.useEffect(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,B),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,B]),React.useEffect(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const qe=()=>{const o=i.filter(l=>p.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return React.useEffect(()=>{var o,n,t,a;qe(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,p),(a=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,p)},[p]),React__default.default.createElement(PointCloudContext.Provider,{value:M},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const DECIMAL_PLACES=2,DEFAULT_BOX_INFO_STYLE={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:12},SizeInfoForView=({perspectiveView:e})=>{const{pointCloudBoxList:t,selectedID:n}=React__default.default.useContext(PointCloudContext.PointCloudContext),u=t.find(a=>a.id===n),l=reactI18next.useTranslation(),{t:i}=l;if(n&&u){const{length:a,width:c,height:r}=lbUtils.PointCloudUtils.transferBox2Kitti(u),f=e===lbUtils.EPerspectiveView.Back?[{label:i("Width"),value:c},{label:i("Height"),value:r}]:[{label:i("Length"),value:a},{label:i("Height"),value:r}];return React__default.default.createElement("div",{style:__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)",pointerEvents:"none"})},f.map((s,o)=>React__default.default.createElement("span",{key:o,style:{marginRight:o===0?16:0}},`${s.label}: ${s.value.toFixed(DECIMAL_PLACES)}`)))}return null},BoxInfos=({checkMode:e,config:t,style:n})=>{const u=React__default.default.useContext(PointCloudContext.PointCloudContext),{selectedBox:l}=useSingleBox.useSingleBox(),[i,a]=React.useState([]),c=reactI18next.useTranslation(),{t:r,i18n:f}=c,s=n;return React.useEffect(()=>{var o,p;if(!l)return;const{length:b,width:v,height:x,rotation_y:P}=lbUtils.PointCloudUtils.transferBox2Kitti(l.info),{x:g,y:_,z:h}=l.info.center;let d=[{label:"x",value:g==null?void 0:g.toFixed(DECIMAL_PLACES)},{label:"y",value:_==null?void 0:_.toFixed(DECIMAL_PLACES)},{label:"z",value:h==null?void 0:h.toFixed(DECIMAL_PLACES)},{label:r("Length"),value:b==null?void 0:b.toFixed(DECIMAL_PLACES)},{label:r("Width"),value:v==null?void 0:v.toFixed(DECIMAL_PLACES)},{label:r("Height"),value:x==null?void 0:x.toFixed(DECIMAL_PLACES)},{label:r("Rotation_y"),value:(o=lbAnnotation.UnitUtils.rad2deg(P))==null?void 0:o.toFixed(DECIMAL_PLACES)}];(p=u.mainViewInstance)==null||p.filterPointsByBox(l.info).then(m=>{var y,C;if(!m){a(d);return}d.push({label:r("PointCount"),value:`${(C=(y=l.info)==null?void 0:y.count)!=null?C:0}`}),e===!0&&l.info.subAttribute&&t&&lbUtils.PointCloudUtils.getSubAttributeName(l.info.subAttribute,t).forEach(w=>d.push(w)),a(d)})},[l,f.language]),l?React__default.default.createElement("div",{style:n||__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{right:8,bottom:8})},i.map(o=>s?React__default.default.createElement("div",{key:o.label,style:{margin:"0px 4px"}},`${o.label}: ${o.value}`):React__default.default.createElement("div",{key:o.label},React__default.default.createElement("span",{style:{width:"38px",display:"inline-block",textAlign:"end"}},o.label),": ",React__default.default.createElement("span",null,o.value)))):null},PointCloudValidity=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{t}=reactI18next.useTranslation();return e.valid===!1?React__default.default.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",opacity:.7,left:0,top:0,fontSize:30,padding:"8px 16px",zIndex:20,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t("Invalid")):null};exports.BoxInfos=BoxInfos,exports.PointCloudValidity=PointCloudValidity,exports.SizeInfoForView=SizeInfoForView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:n,style:s,titleNonInteractive:l,titleOnSurface:r})=>React__default.default.createElement("div",{className:classNames__default.default([n,dom.getClassName("point-cloud-container")]),style:s},r?React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title-box"),style:{pointerEvents:l?"none":"auto"}},e):React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header")},e&&React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title")},e),a&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header-toolbar")},a)),t);exports.PointCloudContainer=PointCloudContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),useLine=require("./hooks/useLine.js"),reactI18next=require("react-i18next"),
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useRotateEdge=require("./hooks/useRotateEdge.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),useLine=require("./hooks/useLine.js"),useUpdatePointCloudColor=require("./hooks/useUpdatePointCloudColor.js"),reactI18next=require("react-i18next"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(n,r,i)=>r in n?__defProp(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i,__spreadValues=(n,r)=>{for(var i in r||(r={}))__hasOwnProp.call(r,i)&&__defNormalProp(n,i,r[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(r))__propIsEnum.call(r,i)&&__defNormalProp(n,i,r[i]);return n},__spreadProps=(n,r)=>__defProps(n,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:n,config:r,checkMode:i,configString:_,imgIndex:w,toolInstanceRef:a,setResourceLoading:f})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:V,selectNextBox:E,selectPrevBox:B,updateSelectedBox:L,deleteSelectedPointCloudBoxAndPolygon:q}=useSingleBox.useSingleBox(),{selectedSphere:b,updatePointCloudSphere:I}=useSphere.useSphere(),{clearAllResult:P,updatePointCloudPattern:O}=useStatus.useStatus(),{copySelectedBoxes:j,pasteSelectedBoxes:A,copiedBoxes:$}=useBoxes.useBoxes({config:r,currentData:n}),{updateRotate:g}=useRotate.useRotate({currentData:n}),{updateRotateEdge:T}=useRotateEdge.useRotateEdge({currentData:n}),{updatePointCloudData:p,topViewSelectedChanged:D}=usePointCloudViews.usePointCloudViews({setResourceLoading:f}),{redo:h,undo:m,pushHistoryWithList:N,pushHistoryUnderUpdatePolygon:H,pushHistoryUnderUpdateLine:K}=useHistory.useHistory(),{syncThreeViewsAttribute:S}=useAttribute.useAttribute(),{syncAllViewsConfig:U,reRenderTopViewRange:R}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{selectedLine:x}=useLine.useLine(),{t:y}=reactI18next.useTranslation(),{updatePointCloudColor:z}=useUpdatePointCloudColor.useUpdatePointCloudColor(f,r),F=ahooks.useLatest(n),v=t=>{var o;const{topViewInstance:s}=e;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(t)},G=(t,o)=>{var s,u;const{topViewInstance:c,mainViewInstance:l}=e;if(!c)return;const{pointCloud2dOperation:C}=c;switch(t){case"q":{g(e.rectRotateSensitivity);break}case"e":g(-Number(e.rectRotateSensitivity));break;case"g":T(-90);break;case"u":{const d=C.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;O(d);const Y={[lbAnnotation.EToolName.Polygon]:y("PolygonPattern"),[lbAnnotation.EToolName.Rect]:y("RectPattern")};antd.message.success(y("ChangePatternMsg",{pattern:Y[d]})),C.clearActiveStatus(),C.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize({zoomIn:!0});break;case"-":l==null||l.updatePointSize({zoomIn:!1});break;case"v":e.setPointCloudValid(!e.valid);break;case"tab":if(o.shiftKey){B();break}E(),o.preventDefault();break;case"f":V();break;case"arrowup":v({y:-1});break;case"arrowdown":v({y:1});break;case"arrowleft":v({x:-1});break;case"arrowright":v({x:1});break;case"delete":q(F.current);break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(o.keyCode,r.attributeList);d!==void 0&&((u=a.current)==null||u.setDefaultAttribute(d))}return}}},M=(t,o)=>{switch(t){case"c":j();break;case"v":A();break;case"a":o.preventDefault(),e.selectedAllBoxes();break;case"z":{o.shiftKey?h():m();break}}},W=ahooks.useLatest(t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||i===!0)return;const o=t.key.toLocaleLowerCase();if(t.ctrlKey){M(o,t);return}G(o,t)});return React.useEffect(()=>{if(!e.topViewInstance)return;const{addEventListener:o}=e.windowKeydownListenerHook;return o(c=>W.current(c))},[e,e.topViewInstance,e.windowKeydownListenerHook]),React.useEffect(()=>{U(r)},[_]),React.useEffect(()=>{(r==null?void 0:r.radius)&&R(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{p==null||p()},[w,e.mainViewInstance]),React.useEffect(()=>{e.setHideAttributes([])},[w]),React.useEffect(()=>{a.current.setDefaultAttribute=t=>{var o;if(S(t),z(t),k&&H(__spreadProps(__spreadValues({},k),{attribute:t})),x&&K(__spreadProps(__spreadValues({},x),{attribute:t})),b){const s=I(__spreadProps(__spreadValues({},b),{attribute:t}));e.mainViewInstance&&((o=e.mainViewInstance)==null||o.generateSpheres(s),D({newSelectedSphere:b,newSphereList:s}))}},a.current.setSubAttribute=(t,o)=>{var s;const u=e.selectedPointCloudBox;if(u){const c=(s=u==null?void 0:u.subAttribute)!=null?s:{};u.subAttribute=__spreadProps(__spreadValues({},c),{[t]:o}),L(u),e.mainViewInstance&&e.selectedPointCloudBox&&e.mainViewInstance.generateBox(e.selectedPointCloudBox)}},a.current.clearResult=()=>{P==null||P()},a.current.redo=()=>{h()},a.current.undo=()=>{m()},a.current.setValid=t=>{a.current.valid=t,setTimeout(()=>{e.setPointCloudValid(t),t===!1&&P()})},a.current.setForbidOperation=t=>{var o,s;(s=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setForbidOperation(t),t===!0&&e.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=t=>{var o,s;(s=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(t)},a.current.asyncData=t=>{setTimeout(()=>{p==null||p(t)})}},[e.pointCloudBoxList,e.pointCloudSphereList,e.selectedID,e.selectedIDs,e.valid,e.polygonList,e.lineList,e.mainViewInstance,e.ptSegmentInstance]),React.useEffect(()=>{a.current.updateSegmentTool=t=>{var o;(o=e.ptSegmentInstance)==null||o.emit(t)},a.current.segmentInstance=e.ptSegmentInstance},[e.ptSegmentInstance]),React.useEffect(()=>{a.current.history={pushHistory:t=>{N({pointCloudBoxList:t})},initRecord:()=>{}}},[]),React.useEffect(()=>{var t;const o=(t=e.topViewInstance)==null?void 0:t.toolInstance;if(!o||i)return;const s=l=>{S(l)},u=l=>{antd.message.error(l)},c=l=>{antd.message.info(l)};return o.on("syncAttribute",s),o.on("messageError",u),o.on("messageInfo",c),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",u),o.unbind("messageInfo",c)}},[e.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,
|
|
1
|
+
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,r,o)=>r in t?__defProp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,__spreadValues=(t,r)=>{for(var o in r||(r={}))__hasOwnProp.call(r,o)&&__defNormalProp(t,o,r[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(r))__propIsEnum.call(r,o)&&__defNormalProp(t,o,r[o]);return t},__spreadProps=(t,r)=>__defProps(t,__getOwnPropDescs(r));const PointCloudSegment2DSingleView=({path:t,url:r,fallbackUrl:o,calib:s,pcdUrl:u,highlightAttribute:c})=>{const{ptSegmentInstance:e,cacheImageNodeSize:y,imageSizes:x}=React.useContext(PointCloudContext.PointCloudContext),w=React.useRef(null),p=React.useRef(0),g=React.useRef({}),d=React.useRef(),[v,m]=React.useState([]),[D,P]=React.useState(!1),b=React.useRef(void 0);React.useEffect(()=>()=>{p.current=0,g.current={},d.current=void 0},[u]);const h=React.useCallback(()=>{var n,l,i;if(p.current=p.current+1,p.current===2){const a=(n=e==null?void 0:e.store)==null?void 0:n.originPoints;if(!a||!d.current){console.error("cacheMappingPCD2Img Error",{path:t,points:a,filterSize:d.current});return}g.current=(i=(l=lbAnnotation.pointMappingLidar2image(a,s,d.current))==null?void 0:l.pcdMapping)!=null?i:{}}},[e]),C=React.useMemo(()=>{const n=(l,i)=>{var a,S;if(l&&d.current){b.current&&((S=(a=b.current)==null?void 0:a.terminate)==null||S.call(a));const k=g.current,f=new highlightSegmentWorker;f.current=f,P(!0),f.postMessage({cacheMap:k,indexes:l,defaultRGBA:i}),f.onmessage=O=>{m(O.data.annotations),f.terminate(),P(!1),f.current=void 0}}};return _.debounce(n,100)},[]);React.useEffect(()=>{if(!(e==null?void 0:e.store))return;const n=e.store.getHighlightAttribute(c!=null?c:""),l=e==null?void 0:e.getColorFromConfig(c!=null?c:"");C(n.flat(),l.stroke)},[c,e]),React.useEffect(()=>{if(e){const n=({newAttribute:l})=>{const i=e==null?void 0:e.getColorFromConfig(l);i&&m(v.map(a=>__spreadProps(__spreadValues({},a),{defaultRGBA:i.stroke})))};return e.on("updateDefaultAttribute",n),()=>{e.unbind("updateDefaultAttribute",n)}}},[e,v]),React.useEffect(()=>{if(e){const n=l=>{if(l.cacheSegData){const{cacheSegData:i}=l;if(i==null?void 0:i.indexes){const a=e.getColorFromConfig(i.attribute);C(i==null?void 0:i.indexes,a.stroke)}}else m([])};return e.on("syncPointCloudStatus",n),e.on("loadPCDFileEnd",h),()=>{e.unbind("syncPointCloudStatus",n),e.unbind("loadPCDFileEnd",h)}}},[e,u,x]);const E=n=>{y({path:t,imgNode:n}),d.current={width:n.width,height:n.height},h()};return React__default.default.createElement("div",{key:t,style:{position:"relative"},ref:w},React__default.default.createElement(index,{title:s.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),React__default.default.createElement(antd.Spin,{spinning:D,delay:1e3},React__default.default.createElement(index$1,{size:{width:300,height:200},key:t,src:r,fallbackSrc:o,annotations:v,afterImgOnLoad:E})))},PointCloudSegment2DView=({currentData:t,highlightAttribute:r})=>{var o;const s=(o=t.mappingImgList)!=null?o:[];return(s==null?void 0:s.length)>0?React__default.default.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},s==null?void 0:s.map((u,c)=>{var e;return u.calib&&React__default.default.createElement(PointCloudSegment2DSingleView,{key:u.path+c,path:u.path,url:u.url,fallbackUrl:(e=u.fallbackUrl)!=null?e:"",calib:u.calib,pcdUrl:t.url,highlightAttribute:r})})):null};var PointCloudSegment2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment2DView);module.exports=PointCloudSegment2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../utils/index.js");const PointCloudSegmentListener=({checkMode:v,currentData:l,imgIndex:S,highlightAttribute:a,config:p,toolInstanceRef:
|
|
1
|
+
"use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../utils/index.js");const PointCloudSegmentListener=({checkMode:v,currentData:l,imgIndex:S,highlightAttribute:a,config:p,toolInstanceRef:s,configString:u})=>{const d=ctx.useDispatch(),{updateSegmentAttribute:b,updateSegmentSubAttribute:g}=useAttribute.useAttribute(),n=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:e,setSegmentation:c}=n;React.useEffect(()=>{var t;if(e&&l.url)return actionCreators.SetAnnotationLoading(d,!0),e.emit("clearStash"),e.emit("clearAllSegmentData"),e.loadPCDFile((t=l==null?void 0:l.url)!=null?t:"").then(()=>{var o,r;const i=lbUtils.PointCloudUtils.getSegmentFromResultList((o=l==null?void 0:l.result)!=null?o:"");(r=e==null?void 0:e.store)==null||r.updateCurrentSegment(i),actionCreators.SetAnnotationLoading(d,!1)}),e.on("syncSegmentData",c),()=>{e.unbind("syncSegmentData",c)}},[S,e]),React.useEffect(()=>{var t;(t=e==null?void 0:e.store)==null||t.highlightPointsByAttribute(a!=null?a:"")},[a,e]),React.useEffect(()=>{e==null||e.setConfig(index.jsonParser(u))},[u]);const C=(t,o)=>{var r,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("RectSelector");break;case"k":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Add);break;case"i":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(i=(r=e.store)==null?void 0:r.cacheSegData)==null?void 0:i.id);break}},m=t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||v===!0)return;const o=t.key.toLocaleLowerCase();C(o)};return React.useEffect(()=>(window.addEventListener("keydown",m),s.current.setDefaultAttribute=t=>{b(t),e==null||e.emit("updateDefaultAttribute",{newAttribute:t})},s.current.setSubAttribute=(t,o)=>{g(t,o)},()=>{window.removeEventListener("keydown",m)}),[e]),React.useEffect(()=>{s.current.clearResult=()=>{!n.ptSegmentInstance||(n.ptSegmentInstance.emit("clearStash"),n.ptSegmentInstance.emit("clearAllSegmentData"))}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var PointCloudSegmentListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegmentListener);module.exports=PointCloudSegmentListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),index$1=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),useZoom=require("./hooks/useZoom.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:f,height:s}=l,c={x:t.x+f*e/2,y:t.y+s*e/2},a={x:l.width/2,y:l.height/2};return{offsetX:(a.x-c.x)/e,offsetY:-(a.y-c.y)/e}},updateSideViewByCanvas2D=(t,l,e,f,s)=>{const{offsetX:c,offsetY:a}=TransferCanvas2WorldOffset(t,e,l);if(s.camera.zoom=l,t){const u=Math.cos(f),n=Math.sin(f),x=c*u,v=c*n,{x:i,y:d,z:o}=s.initCameraPosition;s.camera.position.set(i-x,d-v,o+a)}s.camera.updateProjectionMatrix(),s.render()},PointCloudSideView=({config:t,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:f,sideViewUpdatePoint:s}=usePointCloudViews.usePointCloudViews(),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:a}=useSphere.useSphere(),u=React.useRef(null),n=useSize(u),{t:x}=reactI18next.useTranslation(),{syncSideviewToolZoom:v}=useZoom.useZoom();return React.useEffect(()=>{if(u.current){const i={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:t,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setSideViewInstance(d)}},[]),React.useEffect(()=>{if(!n||!e.sideViewInstance)return;const{toolInstance:i,pointCloudInstance:d}=e.sideViewInstance;i.singleOn("renderZoom",(o,r)=>{if(e.selectedPointCloudBox){updateSideViewByCanvas2D(r,o,n,e.selectedPointCloudBox.rotation,d),v(r,o,n);return}a&&(updateSideViewByCanvas2D(r,o,n,0,d),v(r,o,n))}),i.singleOn("dragMove",({currentPos:o,zoom:r})=>{!e.selectedPointCloudBox&&!a||updateSideViewByCanvas2D(o,r,n,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,d)}),i.singleOn("updatePointByDrag",(o,r)=>{a&&(s==null||s(o,r[0]))}),i.singleOn("updatePolygonByDrag",o=>{if(e.selectedIDs.length===1&&o.length===1){const{newPolygon:r,originPolygon:C}=o[0];f(r,C)}})},[e,n]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(n)},[n]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:React__default.default.createElement(index,{title:x("SideView")}),titleOnSurface:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:u}),!c&&!a&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),index$1=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),useZoom=require("./hooks/useZoom.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:f,height:s}=l,c={x:t.x+f*e/2,y:t.y+s*e/2},a={x:l.width/2,y:l.height/2};return{offsetX:(a.x-c.x)/e,offsetY:-(a.y-c.y)/e}},updateSideViewByCanvas2D=(t,l,e,f,s)=>{const{offsetX:c,offsetY:a}=TransferCanvas2WorldOffset(t,e,l);if(s.camera.zoom=l,t){const u=Math.cos(f),n=Math.sin(f),x=c*u,v=c*n,{x:i,y:d,z:o}=s.initCameraPosition;s.camera.position.set(i-x,d-v,o+a)}s.camera.updateProjectionMatrix(),s.render()},PointCloudSideView=({config:t,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:f,sideViewUpdatePoint:s}=usePointCloudViews.usePointCloudViews(),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:a}=useSphere.useSphere(),u=React.useRef(null),n=useSize(u),{t:x}=reactI18next.useTranslation(),{syncSideviewToolZoom:v}=useZoom.useZoom();return React.useEffect(()=>{if(u.current){const i={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:t,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setSideViewInstance(d)}},[]),React.useEffect(()=>{if(!n||!e.sideViewInstance)return;const{toolInstance:i,pointCloudInstance:d}=e.sideViewInstance;i.singleOn("renderZoom",(o,r)=>{if(e.selectedPointCloudBox){updateSideViewByCanvas2D(r,o,n,e.selectedPointCloudBox.rotation,d),v(r,o,n);return}a&&(updateSideViewByCanvas2D(r,o,n,0,d),v(r,o,n))}),i.singleOn("dragMove",({currentPos:o,zoom:r})=>{!e.selectedPointCloudBox&&!a||updateSideViewByCanvas2D(o,r,n,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,d)}),i.singleOn("updatePointByDrag",(o,r)=>{a&&(s==null||s(o,r[0]))}),i.singleOn("updatePolygonByDrag",o=>{if(e.selectedIDs.length===1&&o.length===1){const{newPolygon:r,originPolygon:C}=o[0];f(r,C)}})},[e,n]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(n)},[n]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:React__default.default.createElement(index,{title:x("SideView")}),titleOnSurface:!0,titleNonInteractive:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:u}),!c&&!a&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js"),_=require("lodash"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:C,height:c}=l,w={x:o.x+C*s/2,y:o.y+c*s/2},g={x:l.width/2,y:l.height/2};return{offsetX:(g.x-w.x)/s,offsetY:-(g.y-w.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:C,zoomIn:c,zoomOut:w,initialPosition:g}=useZoom.useZoom(),{selectNextBox:V,selectPrevBox:S}=useSingleBox.useSingleBox(),{switchToNextSphere:y}=useSphere.useSphere(),{updateRotate:P}=useRotate.useRotate({currentData:o}),x=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:E}=x,I=(s=(l=x==null?void 0:x.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),p=2,e=()=>{P(-p)},r=()=>{P(p)},f=()=>{P(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:L=>{var h;(h=E==null?void 0:E.pointCloudInstance)==null||h.updatePointSize({customSize:L})}}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:f,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.descend);return}S(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.ascend);return}V(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:g,zoomIn:c,zoomOut:w,zoom:C}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:C=>{o(C)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:C,checkMode:c,intelligentFit:w,setIsEnlargeTopView:g,isEnlargeTopView:V,onExitZoom:S,highlightAttribute:y})=>{var P,x;const[E,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),p=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),r=useSize(p),f=index.jsonParser(s.config),{setZoom:L,syncTopviewToolZoom:h}=useZoom.useZoom(),{hideAttributes:D}=e,{addPolygon:B,deletePolygon:R}=usePolygon.usePolygon(),{deletePointCloudSphere:U}=useSphere.useSphere(),{deletePointCloudBox:Z,changeValidByID:z}=useSingleBox.useSingleBox(),[b,H]=React.useState(10),{t:k}=reactI18next.useTranslation(),m=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:F}=useHistory.useHistory();React.useLayoutEffect(()=>{if(!e.topViewInstance&&p.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:p.current.clientWidth,height:p.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:p.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:c,toolName:ToolUtils.getPointCloudToolList(),proxyMode:c});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!r||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(u=>__spreadProps(__spreadValues({},u),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(u.pointList,r)}));e.setSelectedIDs(i),e.setLineList(d),F({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{m.topViewAddSphere({newPoint:t,size:r,trackConfigurable:f.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{U(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=m.topViewUpdatePoint)==null||d.call(m,t,r)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,r))});B(d),e.setSelectedIDs(D.includes(t.attribute)?"":t.id);return}m.topViewAddBox({polygon:t,size:r,imgList:l,trackConfigurable:f.trackConfigurable,zoom:i,intelligentFit:w})}),n.singleOn("deletedObject",({id:t})=>{Z(t),R(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=m.topViewUpdateBox)==null||i.call(m,t,r)});const a=t=>{var i;const d=z(t);d&&e.syncAllViewPointCloudColor(d),e.polygonList.find(u=>u.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,r,o,m,e.polygonList,e.lineList,(P=e.topViewInstance)==null?void 0:P.toolInstance]),React.useEffect(()=>{var n,a;if(!(r==null?void 0:r.width)||!e.topViewInstance)return;const t=(a=(n=f==null?void 0:f.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(r),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(u,v)=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(v,r,u);if(i.camera.zoom=u,v){const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N)}i.camera.updateProjectionMatrix(),i.render(),L(u),h(v,u,r),I({zoom:u,currentPos:v})}),d.singleOn("dragMove",({currentPos:u,zoom:v})=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(u,r,v);i.camera.zoom=v;const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N),i.render(),h(u,v,r),I({zoom:v,currentPos:u})})},[r,e.topViewInstance,(x=e.topViewInstance)==null?void 0:x.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(b)},[b]),React.useEffect(()=>{var n,a,t,i;m.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>(window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}),[]);const A=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&S()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,y)},[e.topViewInstance,y]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:V?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{S()}}),React__default.default.createElement("span",null,k("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:k("TopView"),onClick:()=>{g(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:p},C==null?void 0:C(E)),!V&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f}),React__default.default.createElement(ZAxisSlider,{checkMode:c,zAxisLimit:b,setZAxisLimit:H}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useRotateEdge=require("./hooks/useRotateEdge.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js"),_=require("lodash"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,s,l)=>s in o?__defProp(o,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[s]=l,__spreadValues=(o,s)=>{for(var l in s||(s={}))__hasOwnProp.call(s,l)&&__defNormalProp(o,l,s[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(s))__propIsEnum.call(s,l)&&__defNormalProp(o,l,s[l]);return o},__spreadProps=(o,s)=>__defProps(o,__getOwnPropDescs(s));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,s,l=1)=>{const{width:C,height:p}=s,w={x:o.x+C*l/2,y:o.y+p*l/2},x={x:s.width/2,y:s.height/2};return{offsetX:(x.x-w.x)/l,offsetY:-(x.y-w.y)/l}},TopViewToolbar=({currentData:o})=>{var s,l;const{zoom:C,zoomIn:p,zoomOut:w,initialPosition:x}=useZoom.useZoom(),{selectNextBox:L,selectPrevBox:b}=useSingleBox.useSingleBox(),{switchToNextSphere:S}=useSphere.useSphere(),{updateRotate:V}=useRotate.useRotate({currentData:o}),{updateRotateEdge:O}=useRotateEdge.useRotateEdge({currentData:o}),g=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:y}=g,f=(l=(s=g==null?void 0:g.topViewInstance)==null?void 0:s.toolScheduler)==null?void 0:l.getCurrentToolName(),e=()=>{V(-Number(g.rectRotateSensitivity))},u=()=>{V(g.rectRotateSensitivity)},v=()=>{O(-90)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:T=>{var I;(I=y==null?void 0:y.pointCloudInstance)==null||I.updatePointSize({customSize:T})}}),React__default.default.createElement("span",{onClick:u,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:v,className:dom.getClassName("point-cloud","rotate-90")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(f===EToolName.Point){S(ESortDirection.descend);return}b(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(f===EToolName.Point){S(ESortDirection.ascend);return}L(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:x,zoomIn:p,zoomOut:w,zoom:C}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:s,checkMode:l})=>l?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:s,onAfterChange:C=>{o(C)}})),PointCloudTopView=({currentData:o,imgList:s,stepInfo:l,drawLayerSlot:C,checkMode:p,intelligentFit:w,setIsEnlargeTopView:x,isEnlargeTopView:L,onExitZoom:b,highlightAttribute:S})=>{var V,O;const[g,y]=React.useState({zoom:1,currentPos:{x:0,y:0}}),f=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),u=useSize(f),v=index.jsonParser(l.config),{setZoom:T,syncTopviewToolZoom:I}=useZoom.useZoom(),{hideAttributes:k}=e,{addPolygon:A,deletePolygon:U}=usePolygon.usePolygon(),{deletePointCloudSphere:Z}=useSphere.useSphere(),{deletePointCloudBox:z,changeValidByID:H}=useSingleBox.useSingleBox(),[N,F]=React.useState(10),{t:B}=reactI18next.useTranslation(),m=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:W}=useHistory.useHistory(),[$,q]=React.useState(!0);React.useLayoutEffect(()=>{if(!e.topViewInstance&&f.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:f.current.clientWidth,height:f.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:f.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},v),{pointCloudPattern:e.pointCloudPattern}),checkMode:p,toolName:ToolUtils.getPointCloudToolList(),proxyMode:p});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!u||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(r=>__spreadProps(__spreadValues({},r),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(r.pointList,u)}));e.setSelectedIDs(i),e.setLineList(d),W({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{m.topViewAddSphere({newPoint:t,size:u,trackConfigurable:v.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{Z(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=m.topViewUpdatePoint)==null||d.call(m,t,u)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,u))});A(d),e.setSelectedIDs(k.includes(t.attribute)?"":t.id);return}q(!1),m.topViewAddBox({polygon:t,size:u,imgList:s,trackConfigurable:v.trackConfigurable,zoom:i,intelligentFit:w})}),n.singleOn("deletedObject",({id:t})=>{z(t),U(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{q(!1),e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=m.topViewUpdateBox)==null||i.call(m,t,u)});const a=t=>{var i;const d=H(t);d&&e.syncAllViewPointCloudColor(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,d),e.polygonList.find(r=>r.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,u,o,m,e.polygonList,e.lineList,(V=e.topViewInstance)==null?void 0:V.toolInstance]),React.useEffect(()=>{var n,a;if(!(u==null?void 0:u.width)||!e.topViewInstance)return;const t=(a=(n=v==null?void 0:v.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(u),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(r,c)=>{const{offsetX:h,offsetY:E}=TransferCanvas2WorldOffset(c,u,r);if(i.camera.zoom=r,c){const{x:P,y:j,z:R}=i.initCameraPosition;i.camera.position.set(P+E,j-h,R)}i.camera.updateProjectionMatrix(),i.render(),T(r),I(c,r,u),y({zoom:r,currentPos:c})}),d.singleOn("dragMove",({currentPos:r,zoom:c})=>{const{offsetX:h,offsetY:E}=TransferCanvas2WorldOffset(r,u,c);i.camera.zoom=c;const{x:P,y:j,z:R}=i.initCameraPosition;i.camera.position.set(P+E,j-h,R),i.render(),I(r,c,u),y({zoom:c,currentPos:r})})},[u,e.topViewInstance,(O=e.topViewInstance)==null?void 0:O.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(N)},[N]),React.useEffect(()=>{var n,a,t,i;m.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>{const{topViewInstance:n,selectedID:a,selectedPointCloudBox:t,zoom:i}=e;if(!n||!a||!t||!$){q(!0);return}const{center:d}=t,{pointCloudInstance:r,toolInstance:c}=n,h=c.polygonList.find(K=>K.id===e.selectedID);if(!h){q(!0);return}const E=lbAnnotation.MathUtils.getRectCenterPoint(h.pointList),P=lbAnnotation.MathUtils.getCurrentPosFromRectCenter(c.size,E,i);c.setCurrentPos(P),c.render();const{x:j,y:R,z:M}=r.initCameraPosition;r.camera.position.set(d.x,d.y,M),r.render(),I(P,i,u),y({zoom:i,currentPos:P})},[e.selectedID]),React.useEffect(()=>(window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}),[]);const D=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&b()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,S)},[e.topViewInstance,S]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:L?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{b()}}),React__default.default.createElement("span",null,B("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:p,config:v,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:B("TopView"),onClick:()=>{x(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:f},C==null?void 0:C(g)),!L&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:p,config:v}),React__default.default.createElement(ZAxisSlider,{checkMode:p,zAxisLimit:N,setZAxisLimit:F}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),icons=require("@ant-design/icons"),dom=require("../../../../utils/dom.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const HighlightVisible=({visible:e,style:r,onClick:t,loading:a})=>{const
|
|
1
|
+
"use strict";var React=require("react"),icons=require("@ant-design/icons"),dom=require("../../../../utils/dom.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const HighlightVisible=({visible:e,style:r,onClick:t,loading:a,disabled:o})=>{const l={background:"rgba(0, 0, 0, 0.74)",color:"white",borderRadius:2,padding:6,fontSize:16},s={background:"rgba(0, 0, 0, 0.2)",color:"rgba(255, 255, 255, 0.5)",cursor:"not-allowed"};let i=e?icons.EyeFilled:icons.EyeInvisibleFilled;a&&(i=icons.LoadingOutlined,Object.assign(l,{borderRadius:100}));const n=__spreadValues(__spreadValues({},l),r);return o&&Object.assign(n,s),React__default.default.createElement(i,{disabled:o,className:dom.getClassName("point-cloud-highlight-view"),style:n,onClick:a||o?()=>{}:t})};module.exports=HighlightVisible;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);const useBoxes=({config:t})=>{const{selectedIDs:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js"),AnnotationDataUtils=require("../../../utils/AnnotationDataUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),index=require("../../../utils/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,o)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,__spreadValues=(t,e)=>{for(var o in e||(e={}))__hasOwnProp.call(e,o)&&__defNormalProp(t,o,e[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))__propIsEnum.call(e,o)&&__defNormalProp(t,o,e[o]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const updateBoxRects=(t,e=[],o=[])=>{const{rects:l=[]}=t,s=l.map(n=>{var d;return __spreadProps(__spreadValues({},n),{imageName:(d=AnnotationDataUtils.getNextPath({prePath:n.imageName,preMappingImgList:o,nextMappingImgList:e}))!=null?d:""})}).filter(n=>n.imageName!=="");return __spreadProps(__spreadValues({},t),{rects:s})},updateCopiedBoxesId=(t,e)=>{const o=new Set(t.map(n=>n.trackID||0));let l=Math.max(...o,0);const s=.2;return e.map((n,d)=>{const{width:y,height:g,center:m,rotation:r,trackID:x=0}=n,{x:f,y:P,z:I}=m,u=y*s,C=g*s,h=u*Math.cos(r)-C*Math.sin(r),i=u*Math.sin(r)+C*Math.cos(r),c=f-Math.abs(h),v=P-Math.abs(i);let p=x;return o.has(x)?p=++l:l=Math.max(l,p),o.add(p),__spreadProps(__spreadValues({},n),{id:lbAnnotation.uuid(),uuid:lbAnnotation.uuid(),center:{x:c,y:v,z:I},trackID:p})})},useBoxes=({config:t,currentData:e})=>{const{selectedIDs:o,pointCloudBoxList:l,displayPointCloudList:s,setPointCloudResult:n,syncAllViewPointCloudColor:d,imageSizes:y}=React.useContext(PointCloudContext.PointCloudContext),[g,m]=React.useState({copiedBoxes:[],copiedMappingImgList:[]}),{copiedBoxes:r}=g,{pointCloudBoxListUpdated:x}=usePointCloudViews.usePointCloudViews(),{t:f,i18n:P}=reactI18next.useTranslation(),{pushHistoryWithList:I}=useHistory.useHistory(),u=React.useMemo(()=>s.filter(i=>o.includes(i.id)),[o,s]),C=React.useCallback(()=>{var i;if(u.length>0){const c=(i=e==null?void 0:e.mappingImgList)!=null?i:[];m({copiedBoxes:___default.default.cloneDeep(u),copiedMappingImgList:c})}else m({copiedBoxes:[],copiedMappingImgList:[]}),antd.message.error(f("CopyEmptyInPointCloud"));antd.message.success(f("CopySuccess"))},[o,s,P.language,e]),h=React.useCallback(()=>{var i,c;if(r.length===0){antd.message.error(f("PasteEmptyInPointCloud"));return}const v=(i=e==null?void 0:e.mappingImgList)!=null?i:[],p=(c=g==null?void 0:g.copiedMappingImgList)!=null?c:[],M=r.map(a=>updateBoxRects(a,v,p)),B=updateCopiedBoxesId(s,M),w=a=>{n(a),x==null||x(a),m({copiedBoxes:[],copiedMappingImgList:[]}),I({pointCloudBoxList:a}),d(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MultiPaste,a)};B.forEach(a=>index.generatePointCloudBoxRects({pointCloudBox:a,mappingImgList:v,imageSizes:y}));const O=[...s,...B];w(O)},[r,s,P.language,e]);return{copySelectedBoxes:C,pasteSelectedBoxes:h,copiedBoxes:r,selectedBoxes:u}};exports.useBoxes=useBoxes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),ahooks=require("ahooks"),PointCloudContext=require("../PointCloudContext.js"),icon_link=require("../../../assets/annotation/icon_link.svg.js"),icon_unlink=require("../../../assets/annotation/icon_unlink.svg.js"),BatchSwitchConnectIn2DView=require("../../../views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js"),lbAnnotation=require("@labelbee/lb-annotation"),usePointCloudViews=require("./usePointCloudViews.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const useShownIcon=e=>{const{imageNamePointCloudBoxMap:s,linkageImageNameRectMap:l}=React.useContext(PointCloudContext.PointCloudContext),a=React.useMemo(()=>e?s.has(e):(console.error("Missing image name"),!1),[e,s]),d=React.useMemo(()=>{var o,f;return e?((f=(o=l.get(e))==null?void 0:o.size)!=null?f:0)>0:!1},[l,e]),m=React.useMemo(()=>a||d,[a,d]),g=ahooks.useLatest(m);return{visible:m,visibleRef:g}},iconSize={width:16,height:16},useDataLinkSwitch=e=>{e.imageName||console.warn("missing imageName");const[s,l]=React.useState(!0),a=ahooks.useLatest(e.imageName),{addRectFromPointCloudBoxByImageName:d,removeRectByPointCloudBoxId:m,linkageImageNameRectMap:g,pointCloudBoxList:o,rectList:f,updateRectListByReducer:k}=React.useContext(PointCloudContext.PointCloudContext),{visible:v,visibleRef:x}=useShownIcon(e.imageName),{syncToPointCloudBoxList:b}=usePointCloudViews.useSyncRectPositionDimensionToPointCloudList(),R=ahooks.useLatest(d),L=ahooks.useLatest(m),B=ahooks.useLatest(()=>b()),h=React.useCallback(t=>{if(!x.current)return;const n=a.current;if(!n){console.warn("invalid image name");return}l(t),t?L.current(n):R.current(n)},[]),y=ahooks.useLatest(t=>{t&&B.current(),h(t)}),E=React.useMemo(()=>{var t;if(!e.is2DView||!v)return null;const i={zIndex:(t=e.zIndex)!=null?t:999,position:"absolute",top:16,right:16+28+12,background:"rgba(0, 0, 0, 0.74)",color:"white",borderRadius:2,padding:6,display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28};return React__default.default.createElement("div",{style:i},s&&React__default.default.createElement("img",{src:icon_link,style:iconSize}),!s&&React__default.default.createElement("img",{src:icon_unlink,style:iconSize}))},[s,e.is2DView,e.zIndex,v]),M=ahooks.useLatest(g),I=React.useCallback(()=>{var t,n;if(!e.is2DView)return;const i=a.current;if(!i){console.warn("invalid image name");return}const r=[...(n=(t=M.current.get(i))==null?void 0:t.keys())!=null?n:[]];let c=!0;r.length&&(c=!1),h(c)},[e.is2DView,h]);return React.useEffect(()=>{I()},[I,o,f]),React.useEffect(()=>{const t=o.map(i=>i.id),n=new Set(t);k((i,C)=>{const r=[],c=[];return i.forEach(u=>{const w=u.extId;w!==void 0&&n.has(w)===!1?r.push(u):c.push(u)}),r.length?[...r.map(u=>C(u)),...c]:i})},[o]),React.useEffect(()=>{const t=n=>{y.current(n)};return lbAnnotation.EventBus.on(BatchSwitchConnectIn2DView.EventBusEvent.switchConnect,t),()=>lbAnnotation.EventBus.unbind(BatchSwitchConnectIn2DView.EventBusEvent.switchConnect,t)},[]),{rendered:E,isLinking:s}};module.exports=useDataLinkSwitch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__async=(s,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__async=(s,u,t)=>new Promise((g,a)=>{var n=i=>{try{o(t.next(i))}catch(l){a(l)}},d=i=>{try{o(t.throw(i))}catch(l){a(l)}},o=i=>i.done?g(i.value):Promise.resolve(i.value).then(n,d);o((t=t.apply(s,u)).next())});const useHighlight=({currentData:s})=>{var u;const{mainViewInstance:t,topViewInstance:g,pointCloudBoxList:a,highlight2DDataList:n,setHighlight2DDataList:d}=React.useContext(PointCloudContext.PointCloudContext),o=(u=s==null?void 0:s.mappingImgList)!=null?u:[],i=(r,c,C)=>__async(void 0,null,function*(){var p;let h=[...n];if(n.find(e=>e.url===r)?h=n.filter(e=>e.url!==r):h.push({url:r,fallbackUrl:c,calib:C}),d(h),!t||(o==null?void 0:o.length)===0)return;const v=t.pointCloudObject;if(!v)return;const f=yield t.getHighlightIndexByMappingImgList({mappingImgList:h,points:v.geometry.attributes.position.array});try{const e=yield t.highlightOriginPointCloud(a,f);e&&((p=g==null?void 0:g.pointCloudInstance)==null||p.updateColor(e))}catch(e){console.error("toggle2dVisible highlightOriginPointCloud error:",e)}}),l=React.useCallback(r=>n.findIndex(c=>c.url===r)>=0,[n]);return{toggle2dVisible:i,isHighlightVisible:l}};exports.useHighlight=useHighlight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(i,n,s)=>n in i?__defProp(i,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[n]=s,__spreadValues=(i,n)=>{for(var s in n||(n={}))__hasOwnProp.call(n,s)&&__defNormalProp(i,s,n[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(n))__propIsEnum.call(n,s)&&__defNormalProp(i,s,n[s]);return i};const useHistory=()=>{const{history:i,setPointCloudResult:n,setSelectedIDs:s,pointCloudBoxList:L,pointCloudSphereList:y,setPointCloudSphereList:h,mainViewInstance:d,topViewInstance:u,polygonList:c,setPolygonList:f,lineList:p,setLineList:C,syncAllViewPointCloudColor:P,segmentation:a}=React.useContext(PointCloudContext.PointCloudContext),x=({newBoxParams:t,newPolygon:o,newLine:e,newSphereParams:l})=>{const r={pointCloudBoxList:L,polygonList:c,lineList:p,pointCloudSphereList:y};t&&(r.pointCloudBoxList=L.concat(t)),o&&(r.polygonList=c.concat(o)),e&&(r.lineList=p.concat(e)),l&&(r.pointCloudSphereList=y.concat(l)),i.pushHistory(r)},v=t=>{const o={pointCloudBoxList:L,polygonList:c,lineList:p,pointCloudSphereList:y,segmentation:a};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),t.lineList&&(o.lineList=t.lineList),t.pointCloudSphereList&&(o.pointCloudSphereList=t.pointCloudSphereList),t.segmentation&&(o.segmentation=t.segmentation),i.pushHistory(o)},S=t=>{if(p.find(e=>e.id===t.id)){const e=p.map(l=>l.id===t.id?t:__spreadValues({},l));i.pushHistory({lineList:e}),C(e)}},_=t=>{if(c.find(e=>e.id===t.id)){const e=c.map(l=>l.id===t.id?t:__spreadValues({},l));i.pushHistory({pointCloudBoxList:L,polygonList:e}),f(e)}},B=({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:e})=>{i.initRecord({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:e,lineList:p},!0)},g=t=>{if(!t)return;const{pointCloudBoxList:o=[],polygonList:e=[],lineList:l=[],pointCloudSphereList:r=[]}=t;o&&(L.length!==o.length&&s(),d==null||d.clearAllBox(),d==null||d.generateBoxes(o),n(o),P(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.UndoRedo,o)),r&&(y.length!==r.length&&s(),d==null||d.clearAllSphere(),d==null||d.generateSpheres(r),h(r)),e&&f(e),l&&C(l),u==null||u.updatePolygonList(o!=null?o:[],e!=null?e:[]),u==null||u.updateLineList(l!=null?l:[]),u==null||u.updatePointList(r)};return{addHistory:x,pushHistoryWithList:v,initHistory:B,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdateLine:S,redo:()=>{g(i.redo())},undo:()=>{g(i.undo())}}};exports.useHistory=useHistory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,n)=>new Promise((a,o)=>{var d=u=>{try{c(n.next(u))}catch(f){o(f)}},P=u=>{try{c(n.throw(u))}catch(f){o(f)}},c=u=>u.done?a(u.value):Promise.resolve(u.value).then(d,P);c((n=n.apply(e,t)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,t,n,a,o)=>{const{x:d,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(e,t),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,u={center:{x:d,y:P,z:c},id:e.id},f=a?__spreadValues(__spreadValues({},a),u):__spreadProps(__spreadValues({},u),{attribute:"",valid:!0});return o&&Object.assign(f,o),f},topViewPolygon2PointCloud=(e,t,n,a,o,d)=>{let P=e.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,t)),c=0,u=1,f={};if(n){const y=n.getSensesPointZAxisInPolygon(P,void 0,d);d&&y.fittedCoordinates.length>0&&(P=y.fittedCoordinates),c=(y.maxZ+y.minZ)/2,u=y.maxZ-y.minZ,f={count:y.zCount}}const[v,B,j]=P,_=lbAnnotation.MathUtils.getLineCenterPoint([v,j]),O=lbAnnotation.MathUtils.getLineLength(v,B),I=lbAnnotation.MathUtils.getLineLength(B,j),A=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);a&&(c=a.center.z,u=a.depth);const k={center:{x:_.x,y:_.y,z:c},width:d?I+INTELLIGENT_FIT_MARGIN:I,height:d?O+INTELLIGENT_FIT_MARGIN:O,depth:u,rotation:A,id:e.id},R=__spreadValues(a?__spreadValues(__spreadValues({},a),k):__spreadProps(__spreadValues({},k),{attribute:"",valid:!0}),f);o&&Object.assign(R,o);const z=P.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,t));return{boxParams:R,newPointList:z}},sideViewPoint2PointCloud=(e,t,n)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x-a.x,y:n.center.y,z:n.center.z-a.y}})},sideViewPolygon2PointCloud=(e,t,n,a)=>{const[o,d,P]=e.pointList,[c,u,f]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),B=lbAnnotation.MathUtils.getLineCenterPoint([c,f]),_={x:{x:v.x-B.x,y:v.y-B.y}.x,y:0,z:v.y-B.y},O=lbAnnotation.MathUtils.getLineLength(o,d),I=lbAnnotation.MathUtils.getLineLength(c,u),A=O-I,k=lbAnnotation.MathUtils.getLineLength(d,P),R=lbAnnotation.MathUtils.getLineLength(u,f),z=k-R,{newBoxParams:y}=a.getNewBoxBySideUpdate(_,z,A,n);return y},backViewPoint2PointCloud=(e,t,n)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x,y:n.center.y-a.x,z:n.center.z-a.y}})},backViewPolygon2PointCloud=(e,t,n,a)=>{const[o,d,P]=e.pointList,[c,u,f]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),B=lbAnnotation.MathUtils.getLineCenterPoint([c,f]),_={x:{x:v.x-B.x,y:v.y-B.y}.x,y:0,z:v.y-B.y},O=lbAnnotation.MathUtils.getLineLength(o,d),I=lbAnnotation.MathUtils.getLineLength(c,u),A=O-I,k=lbAnnotation.MathUtils.getLineLength(d,P),R=lbAnnotation.MathUtils.getLineLength(u,f),z=k-R;let{newBoxParams:y}=a.getNewBoxByBackUpdate(_,z,A,n);return y},syncSideViewByPoint=(e,t,n,a,o)=>{var d;if(!n)return;const{toolInstance:P,pointCloudInstance:c}=n;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(u);const{point2d:f,zoom:v}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),f),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeSideView=(e,t,n,a)=>{if(!n)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=n;d.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxSidePolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncBackViewByPoint=(e,t,n,a,o)=>{var d;if(!n)return;const{toolInstance:P,pointCloudInstance:c}=n;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(u);const{point2d:f,zoom:v}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),f),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeBackView=(e,t,n,a)=>{if(!n)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=n;d.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxBackPolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncTopViewByPoint=(e,t,n,a)=>{if(!n||!a)return;a.generateSphere(e),a.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),a.render();const{toolInstance:o,pointCloudInstance:d}=n,{point2d:P}=d.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?__spreadProps(__spreadValues(__spreadValues({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},synchronizeTopView=(e,t,n,a)=>{var o,d;if(!n||!a)return;a.generateBox(e,t.id),a.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=n,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),f=[...P.polygonList],v=f.find(B=>B.id===t.id);v?(v.pointList=u,v.valid=(o=e.valid)!=null?o:!0):f.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(d=e.valid)!=null?d:!0}),P.setResultAndSelectedID(f,t.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:n,backViewInstance:a,mainViewInstance:o,addPointCloudBox:d,addPointCloudSphere:P,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:f,pointCloudSphereList:v,hideAttributes:B,setHighlight2DDataList:j,cuboidBoxIn2DView:_,imageSizes:O}=e,{addHistory:I,initHistory:A,pushHistoryUnderUpdatePolygon:k}=useHistory.useHistory(),{selectedPolygon:R}=usePolygon.usePolygon(),{getPointCloudSphereByID:z,updatePointCloudSphere:y,selectedSphere:q}=useSphere.useSphere(),{currentData:M,config:w}=ctx.useSelector(i=>{const{stepList:s,step:p,imgList:l,imgIndex:r}=i.annotation;return{currentData:l[r],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,s).config)}}),T=ctx.useDispatch(),tt=ahooks.useLatest(_),W=i=>{if(!tt.current){const{mappingImgList:s=[]}=M,p=s.map(l=>index.getRectPointCloudBox({pointCloudBox:i,mappingData:l,imageSizes:O}));Object.assign(i,{rects:p.filter(l=>l!==void 0)})}},{selectedBox:S,updateSelectedBox:ot,updateSelectedBoxes:Z,getPointCloudByID:et}=useSingleBox.useSingleBox({generateRects:W}),Q=S==null?void 0:S.info;if(!t||!n||!a)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:G}=t,it=i=>{o==null||o.generateBox(i),o==null||o.controls.update(),o==null||o.render()},nt=i=>{o==null||o.generateSphere(i),o==null||o.controls.update(),o==null||o.render()},st=({newPoint:i,size:s,zoom:p,trackConfigurable:l})=>{var r;const C={attribute:(r=t.toolInstance.defaultAttribute)!=null?r:""};l===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:v})});const h=topViewPoint2PointCloud(i,s,G,void 0,C);c(i.id);const x=P(h);F(PointCloudView.Top,i,h,p,x,w),I({newSphereParams:h})},lt=({polygon:i,size:s,imgList:p,trackConfigurable:l,zoom:r,intelligentFit:C})=>{var h,x;const g={attribute:(h=t.toolInstance.defaultAttribute)!=null?h:""};l===!0&&Object.assign(g,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:f,extraSphereList:v})});const b=t==null?void 0:t.toolInstance,m=__spreadValues({},i);let{boxParams:L,newPointList:D}=topViewPolygon2PointCloud(m,s,G,void 0,g,C);L=T(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[L],stepConfig:w,action:"viewUpdateBox"}))[0],C&&(D==null?void 0:D.length)&&(m.pointList=D);const U=B.includes(m.attribute);W(L);const N=d(L),J=(x=e==null?void 0:e.polygonList)!=null?x:[];t==null||t.updatePolygonList(N!=null?N:[],J),U?c([]):(c(L.id),b.selection.setSelectedIDs(m.id),E({omitView:PointCloudView.Top,polygon:m,boxParams:L,zoom:r,newPointCloudBoxList:N}),C&&synchronizeTopView(L,m,t,o)),I({newBoxParams:L})},rt=i=>{const{boxID:s,imageName:p,width:l,height:r,x:C,y:h}=i,x=f.find(g=>g.id===s);if(x==null?void 0:x.rects){const{rects:g=[]}=x,b=g.find(m=>m.imageName===p);if(b){let m=g;const L=__spreadProps(__spreadValues({},b),{width:l,height:r,x:C,y:h});m=g.map(U=>U===b?L:U);const D=__spreadProps(__spreadValues({},x),{rects:m}),V=f.map(U=>U===x?D:U);return t==null||t.updatePolygonList(V!=null?V:[]),V}}},at=({newSelectedBox:i,newPointCloudList:s,newSelectedSphere:p,newSphereList:l})=>{var r;const C=t==null?void 0:t.toolInstance;if(!(u.length===0||!C)){if(i||(S==null?void 0:S.info)){const h=i!=null?i:S==null?void 0:S.info;(r=C==null?void 0:C.selection)==null||r.setSelectedIDs(u[0]);const x=C.selectedPolygon;if(u.length===1&&h){E({omitView:PointCloudView.Top,polygon:x,boxParams:h,newPointCloudBoxList:s});return}}if((p||q)&&u.length===1){const h=p!=null?p:q;C.setSelectedID(u[0]);const x=C.selectedPoint;h&&F(PointCloudView.Top,x,h,void 0,l,w)}}},X=(i,s,p)=>{if(Q){let l,r;switch(p){case PointCloudView.Back:l=backViewPolygon2PointCloud;break;case PointCloudView.Side:l=sideViewPolygon2PointCloud;break;default:l=sideViewPolygon2PointCloud;break}if(r=l(i,s,Q,n.pointCloudInstance),o){const{count:b}=o.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(r).polygonPointList,[r.center.z-r.depth/2,r.center.z+r.depth/2]);r=__spreadProps(__spreadValues({},r),{count:b})}const h=T(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[r],stepConfig:w,action:"viewUpdateBox"}))[0],x=r.valid!==h.valid;r=h;const g=ot(r);return r=g.find(b=>b.id===r.id),E({omitView:x?void 0:p,polygon:i,boxParams:r,newPointCloudBoxList:g}),g}},Y=(i,s,p)=>{if(q){let l,r;switch(p){case PointCloudView.Back:l=backViewPoint2PointCloud;break;case PointCloudView.Side:l=sideViewPoint2PointCloud;break;default:l=sideViewPoint2PointCloud;break}r=l(i,s,q);const C=y(r);return F(p,i,r,void 0,C,w),C}},dt=(i,s)=>{Y(i,s,PointCloudView.Side)},ct=(i,s)=>{Y(i,s,PointCloudView.Back)},ut=(i,s)=>{X(i,s,PointCloudView.Side)},pt=(i,s)=>{X(i,s,PointCloudView.Back)},Pt=(i,s)=>{const p=z(i.id),l=topViewPoint2PointCloud(i,s,G,p),r=y(l);F(PointCloudView.Top,i,l,void 0,r,w)},Ct=(i,s)=>{if(R){const l=__spreadValues({},i[0].newPolygon);l.pointList=l.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,s)),k(l);return}let p=i.map(({newPolygon:l})=>{const r=et(l.id),{boxParams:C}=topViewPolygon2PointCloud(l,s,t.pointCloudInstance,r);return C});if(p=T(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:p,stepConfig:w,action:"viewUpdateBox"})),p.length===1){const{newPolygon:l}=i[0],r=Z(p);E({polygon:l,boxParams:p[0],newPointCloudBoxList:r})}else{const l=Z(p);l&&e.syncAllViewPointCloudColor(l)}},gt=i=>{var s,p,l,r,C;if(S){const h=Number(i.widthDefault),x=Number(i.depthDefault),g=Number(i.heightDefault),b=S==null?void 0:S.info.trackID,L=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(H=>(H==null?void 0:H.trackID)===b),D={width:(l=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:l.width,height:(C=(r=t==null?void 0:t.toolInstance)==null?void 0:r.basicImgInfo)==null?void 0:C.height},V=L.pointList.map(H=>lbUtils.PointCloudUtils.transferCanvas2World(H,D)),U=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(V,g,h),N=U[0],J=U[2],K=lbAnnotation.MathUtils.getLineCenterPoint([N,J]),ht=S.info.center.z-S.info.depth/2,$=__spreadProps(__spreadValues({},S.info),{center:{x:K.x,y:K.y,z:ht+x/2},width:h,height:g,depth:x,valid:!0}),ft=Z([$]);E({omitView:PointCloudView["3D"],polygon:L,boxParams:$,newPointCloudBoxList:ft})}},F=(i,s,p,l,r,C)=>__async(void 0,null,function*(){const h=M==null?void 0:M.url,x={[PointCloudView.Side]:()=>{syncSideViewByPoint(p,s,n,h,C)},[PointCloudView.Back]:()=>{a&&syncBackViewByPoint(p,s,a,h,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(p,s,t,o)}};Object.keys(x).forEach(g=>{g!==i&&x[g]()}),l&&(o==null||o.updateCameraZoom(l)),nt(p)}),E=i=>__async(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:l,zoom:r,newPointCloudBoxList:C}=i,h=M==null?void 0:M.url;C&&(yield e.syncAllViewPointCloudColor(C));const x={[PointCloudView.Side]:()=>{synchronizeSideView(l,p,n,h)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(l,p,a,h)},[PointCloudView.Top]:()=>{synchronizeTopView(l,p,t,o)}};Object.keys(x).forEach(g=>{g!==s&&x[g]()}),r&&(o==null||o.updateCameraZoom(r)),it(l)});return{topViewAddSphere:st,topViewAddBox:lt,topViewSelectedChanged:at,topViewUpdatePoint:Pt,sideViewUpdatePoint:dt,backViewUpdatePoint:ct,topViewUpdateBox:Ct,sideViewUpdateBox:ut,backViewUpdateBox:pt,pointCloudBoxListUpdated:i=>{t.updatePolygonList(i),o==null||o.generateBoxes(i)},initPointCloud3d:i=>{if(!o)return;const s=lbUtils.PointCloudUtils.getDefaultOrthographicParams(i);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...i)=>__async(void 0,[...i],function*(s=M){var p,l,r,C,h,x;if(!(s==null?void 0:s.url)||!o)return;j([]),actionCreators.SetPointCloudLoading(T,!0),actionCreators.SetLoadPCDFileLoading(T,!0),yield o.loadPCDFile(s.url,(p=w==null?void 0:w.radius)!=null?p:DEFAULT_RADIUS),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let g=[],b=[],m=[],L=[];o.updateTopCamera();const D=(r=(l=index.jsonParser(s.result))==null?void 0:l.valid)!=null?r:!0;if(e.setPointCloudValid(D),(C=e.sideViewInstance)==null||C.clearAllData(),(h=e.backViewInstance)==null||h.clearAllData(),s.result){if(g=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),(g==null?void 0:g.length)>0&&s.isPreResult&&(w==null?void 0:w.lowerLimitPointsNumInBox)>0){g=yield o==null?void 0:o.filterPreResult(s.url,w,g);const V=index.jsonParser(s.result);V[lbUtils.POINT_CLOUD_DEFAULT_STEP].result=g,s.result=JSON.stringify(V),e.setPointCloudResult(g)}m=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),b=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),L=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),t.updateData(s.url,s.result,{radius:(x=w==null?void 0:w.radius)!=null?x:DEFAULT_RADIUS}),o==null||o.generateBoxes(g),o==null||o.generateSpheres(L),yield e.syncAllViewPointCloudColor(g,[])}A({pointCloudBoxList:g,polygonList:m,lineList:b,pointCloudSphereList:L}),actionCreators.SetPointCloudLoading(T,!1),actionCreators.SetLoadPCDFileLoading(T,!1)}),updateViewsByDefaultSize:gt,generateRects:W,update2DViewRect:rt}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),_=require("lodash"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,n,t)=>n in o?__defProp(o,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[n]=t,__spreadValues=(o,n)=>{for(var t in n||(n={}))__hasOwnProp.call(n,t)&&__defNormalProp(o,t,n[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(n))__propIsEnum.call(n,t)&&__defNormalProp(o,t,n[t]);return o},__spreadProps=(o,n)=>__defProps(o,__getOwnPropDescs(n)),__async=(o,n,t)=>new Promise((u,p)=>{var e=a=>{try{c(t.next(a))}catch(x){p(x)}},P=a=>{try{c(t.throw(a))}catch(x){p(x)}},c=a=>a.done?u(a.value):Promise.resolve(a.value).then(e,P);c((t=t.apply(o,n)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(o,n,t,u,p)=>{const{x:e,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(o,n),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,a={center:{x:e,y:P,z:c},id:o.id},x=u?__spreadValues(__spreadValues({},u),a):__spreadProps(__spreadValues({},a),{attribute:"",valid:!0});return p&&Object.assign(x,p),x},topViewPolygon2PointCloud=(o,n,t,u,p,e)=>{let P=o.pointList.map(B=>lbUtils.PointCloudUtils.transferCanvas2World(B,n)),c=0,a=1,x={};if(t){const B=t.getSensesPointZAxisInPolygon(P,void 0,e);e&&B.fittedCoordinates.length>0&&(P=B.fittedCoordinates),c=(B.maxZ+B.minZ)/2,a=B.maxZ-B.minZ,x={count:B.zCount}}const[f,L,R]=P,D=lbAnnotation.MathUtils.getLineCenterPoint([f,R]),w=lbAnnotation.MathUtils.getLineLength(f,L),V=lbAnnotation.MathUtils.getLineLength(L,R),T=lbAnnotation.MathUtils.getRadiusFromQuadrangle(o.pointList);u&&(c=u.center.z,a=u.depth);const k={center:{x:D.x,y:D.y,z:c},width:e?V+INTELLIGENT_FIT_MARGIN:V,height:e?w+INTELLIGENT_FIT_MARGIN:w,depth:a,rotation:T,id:o.id},O=__spreadValues(u?__spreadValues(__spreadValues({},u),k):__spreadProps(__spreadValues({},k),{attribute:"",valid:!0}),x);p&&Object.assign(O,p);const M=P.map(B=>lbUtils.PointCloudUtils.transferWorld2Canvas(B,n));return{boxParams:O,newPointList:M}},sideViewPoint2PointCloud=(o,n,t)=>{const u={x:o.x-n.x,y:o.y-n.y};return __spreadProps(__spreadValues({},t),{center:{x:t.center.x-u.x,y:t.center.y,z:t.center.z-u.y}})},sideViewPolygon2PointCloud=(o,n,t,u)=>{const[p,e,P]=o.pointList,[c,a,x]=n.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([p,P]),L=lbAnnotation.MathUtils.getLineCenterPoint([c,x]),D={x:{x:f.x-L.x,y:f.y-L.y}.x,y:0,z:f.y-L.y},w=lbAnnotation.MathUtils.getLineLength(p,e),V=lbAnnotation.MathUtils.getLineLength(c,a),T=w-V,k=lbAnnotation.MathUtils.getLineLength(e,P),O=lbAnnotation.MathUtils.getLineLength(a,x),M=k-O,{newBoxParams:B}=u.getNewBoxBySideUpdate(D,M,T,t);return B},backViewPoint2PointCloud=(o,n,t)=>{const u={x:o.x-n.x,y:o.y-n.y};return __spreadProps(__spreadValues({},t),{center:{x:t.center.x,y:t.center.y-u.x,z:t.center.z-u.y}})},backViewPolygon2PointCloud=(o,n,t,u)=>{const[p,e,P]=o.pointList,[c,a,x]=n.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([p,P]),L=lbAnnotation.MathUtils.getLineCenterPoint([c,x]),D={x:{x:f.x-L.x,y:f.y-L.y}.x,y:0,z:f.y-L.y},w=lbAnnotation.MathUtils.getLineLength(p,e),V=lbAnnotation.MathUtils.getLineLength(c,a),T=w-V,k=lbAnnotation.MathUtils.getLineLength(e,P),O=lbAnnotation.MathUtils.getLineLength(a,x),M=k-O;let{newBoxParams:B}=u.getNewBoxByBackUpdate(D,M,T,t);return B},syncSideViewByPoint=(o,n,t,u,p)=>{var e;if(!t)return;const{toolInstance:P,pointCloudInstance:c}=t;c.loadPCDFile(u,(e=p==null?void 0:p.radius)!=null?e:DEFAULT_RADIUS);const{cameraPositionVector:a}=c.updateOrthoCameraBySphere(o,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(a);const{point2d:x,zoom:f}=c.getSphereSidePoint2DCoordinate(o);c.camera.zoom=f,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(f),P.setResult([__spreadProps(__spreadValues(__spreadValues({},n),x),{valid:o.valid,textAttribute:"",attribute:o.attribute})]),P.setSelectedID(n.id)},synchronizeSideView=(o,n,t,u)=>{if(!t)return;const{pointCloud2dOperation:p,pointCloudInstance:e}=t;e.loadPCDFileByBox(u,o,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=e.updateOrthoCamera(o,lbUtils.EPerspectiveView.Left);e.setInitCameraPosition(P);const{polygon2d:c,zoom:a}=e.getBoxSidePolygon2DCoordinate(o);e.camera.zoom=a,e.camera.updateProjectionMatrix(),e.render(),p.initPosition(),p.zoomChangeOnCenter(a),p.setResultAndSelectedID([{id:n.id,valid:o.valid,pointList:c,textAttribute:"",isRect:!0,attribute:o.attribute}],n.id)},syncBackViewByPoint=(o,n,t,u,p)=>{var e;if(!t)return;const{toolInstance:P,pointCloudInstance:c}=t;c.loadPCDFile(u,(e=p==null?void 0:p.radius)!=null?e:DEFAULT_RADIUS);const{cameraPositionVector:a}=c.updateOrthoCameraBySphere(o,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(a);const{point2d:x,zoom:f}=c.getSphereBackPoint2DCoordinate(o);c.camera.zoom=f,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(f),P.setResult([__spreadProps(__spreadValues(__spreadValues({},n),x),{valid:o.valid,textAttribute:"",attribute:o.attribute})]),P.setSelectedID(n.id)},synchronizeBackView=(o,n,t,u)=>{if(!t)return;const{pointCloud2dOperation:p,pointCloudInstance:e}=t;e.loadPCDFileByBox(u,o,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=e.updateOrthoCamera(o,lbUtils.EPerspectiveView.Back);e.setInitCameraPosition(P);const{polygon2d:c,zoom:a}=e.getBoxBackPolygon2DCoordinate(o);e.camera.zoom=a,e.camera.updateProjectionMatrix(),e.render(),p.initPosition(),p.zoomChangeOnCenter(a),p.setResultAndSelectedID([{id:n.id,valid:o.valid,pointList:c,textAttribute:"",isRect:!0,attribute:o.attribute}],n.id)},syncTopViewByPoint=(o,n,t,u)=>{if(!t||!u)return;u.generateSphere(o),u.updateCameraBySphere(o,lbUtils.EPerspectiveView.Top),u.render();const{toolInstance:p,pointCloudInstance:e}=t,{point2d:P}=e.getSphereTopPoint2DCoordinate(o),c=[...p.pointList].map(a=>a.id===n.id?__spreadProps(__spreadValues(__spreadValues({},n),P),{valid:o.valid,textAttribute:"",attribute:o.attribute}):a);p.setResult(c),p.setSelectedID(n.id)},synchronizeTopView=(o,n,t,u)=>{var p,e;if(!t||!u)return;u.generateBox(o,n.id),u.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=t,{polygon2d:a}=c.getBoxTopPolygon2DCoordinate(o),x=[...P.polygonList],f=x.find(L=>L.id===n.id);f?(f.pointList=a,f.valid=(p=o.valid)!=null?p:!0):x.push({id:n.id,pointList:a,textAttribute:"",isRect:!0,valid:(e=o.valid)!=null?e:!0}),P.setResultAndSelectedID(x,n.id)},usePointCloudViews=o=>{const n=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:u,backViewInstance:p,mainViewInstance:e,addPointCloudBox:P,addPointCloudSphere:c,setSelectedIDs:a,selectedIDs:x,pointCloudBoxList:f,pointCloudSphereList:L,hideAttributes:R,setHighlight2DDataList:D,cuboidBoxIn2DView:w,imageSizes:V,history:T,linkageImageNameRectMap:k}=n,{addHistory:O,initHistory:M,pushHistoryUnderUpdatePolygon:B}=useHistory.useHistory(),{selectedPolygon:ot}=usePolygon.usePolygon(),{getPointCloudSphereByID:nt,updatePointCloudSphere:Y,selectedSphere:W}=useSphere.useSphere(),{currentData:j,config:y}=ctx.useSelector(s=>{const{stepList:i,step:d,imgList:r,imgIndex:l}=s.annotation;return{currentData:r[l],config:index.jsonParser(StepUtils.getCurrentStepInfo(d,i).config)}}),z=ctx.useDispatch(),it=ahooks.useLatest(w),st=ahooks.useLatest(k),rt=React.useCallback((s,i)=>{const d=st.current,r=i.id;return s.filter(g=>{if(!g)return!1;const C=d.get(g.imageName);return C===void 0?!0:Boolean(C.get(r))})},[]),J=s=>{const{enableAutoMap2DRect:i=!1}=y;if(!it.current||i){const{mappingImgList:d=[]}=j;index.generatePointCloudBoxRects({pointCloudBox:s,mappingImgList:d,imageSizes:V},{prepareRectsFn:rt})}},{selectedBox:U,updateSelectedBox:lt,updateSelectedBoxes:Q,getPointCloudByID:at}=useSingleBox.useSingleBox({generateRects:J}),K=U==null?void 0:U.info;if(!t||!u||!p)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:X}=t,dt=s=>{e==null||e.generateSphere(s),e==null||e.controls.update(),e==null||e.render()},ut=({newPoint:s,size:i,zoom:d,trackConfigurable:r})=>{var l;const g={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(g,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:L})});const C=topViewPoint2PointCloud(s,i,X,void 0,g);a(s.id);const h=c(C);q(PointCloudView.Top,s,C,d,h,y),O({newSphereParams:C})},ct=({polygon:s,size:i,imgList:d,trackConfigurable:r,zoom:l,intelligentFit:g})=>{var C,h,m;const b={attribute:(C=t.toolInstance.defaultAttribute)!=null?C:""};r===!0&&Object.assign(b,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:f,extraSphereList:L})});const S=t==null?void 0:t.toolInstance,I=__spreadValues({},s);let{boxParams:v,newPointList:A}=topViewPolygon2PointCloud(I,i,X,void 0,b,g);v=z(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[v],stepConfig:y,action:"viewUpdateBox"}))[0],g&&(A==null?void 0:A.length)&&(I.pointList=A);const E=R.includes(I.attribute);J(v);const F=P(v),Z=(h=n==null?void 0:n.polygonList)!=null?h:[];v.subAttribute=lbAnnotation.TagUtils.getDefaultResultByConfig((y==null?void 0:y.secondaryAttributeConfigurable)?(m=y==null?void 0:y.inputList)!=null?m:[]:[]),t==null||t.updatePolygonList(F!=null?F:[],Z),E?a([]):(a(v.id),S.selection.setSelectedIDs(I.id),N({omitView:PointCloudView.Top,polygon:I,boxParams:v,zoom:l,newPointCloudBoxList:F}),g&&synchronizeTopView(v,I,t,e)),O({newBoxParams:v})},pt=s=>{const{boxID:i,imageName:d,width:r,height:l,x:g,y:C}=s,h=f.find(v=>v.id===i);if(!(h==null?void 0:h.rects)||!h.rects.find(v=>v.imageName===d))return;const b=h.rects.map(v=>v.imageName===d?__spreadProps(__spreadValues({},v),{width:r,height:l,x:g,y:C}):v),S=__spreadProps(__spreadValues({},h),{rects:b}),I=f.map(v=>v.id===i?S:v);return t==null||t.updatePolygonList(I!=null?I:[]),I},gt=s=>{const{boxID:i,imageName:d}=s,r=f.find(h=>h.id===i);if(!(r==null?void 0:r.rects))return;const l=r.rects.filter(h=>h.imageName!==d),g=__spreadProps(__spreadValues({},r),{rects:l}),C=f.map(h=>h.id===i?g:h);return t==null||t.updatePolygonList(C!=null?C:[]),C},Pt=({newSelectedBox:s,newPointCloudList:i,newSelectedSphere:d,newSphereList:r})=>{var l;const g=t==null?void 0:t.toolInstance;if(!(x.length===0||!g)){if(s||(U==null?void 0:U.info)){const C=s!=null?s:U==null?void 0:U.info;(l=g==null?void 0:g.selection)==null||l.setSelectedIDs(x[0]);const h=g.selectedPolygon;if(x.length===1&&C){N({omitView:PointCloudView.Top,polygon:h,boxParams:C,newPointCloudBoxList:i});return}}if((d||W)&&x.length===1){const C=d!=null?d:W;g.setSelectedID(x[0]);const h=g.selectedPoint;C&&q(PointCloudView.Top,h,C,void 0,r,y)}}},$=(s,i,d)=>{if(K){let r,l;switch(d){case PointCloudView.Back:r=backViewPolygon2PointCloud;break;case PointCloudView.Side:r=sideViewPolygon2PointCloud;break;default:r=sideViewPolygon2PointCloud;break}if(l=r(s,i,K,u.pointCloudInstance),e){const{count:b}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=__spreadProps(__spreadValues({},l),{count:b})}const C=z(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[l],stepConfig:y,action:"viewUpdateBox"}))[0],h=l.valid!==C.valid;l=C;const m=lt(l);return l=m.find(b=>b.id===l.id),N({omitView:h?void 0:d,polygon:s,boxParams:l,newPointCloudBoxList:m}),m}},tt=(s,i,d)=>{if(W){let r,l;switch(d){case PointCloudView.Back:r=backViewPoint2PointCloud;break;case PointCloudView.Side:r=sideViewPoint2PointCloud;break;default:r=sideViewPoint2PointCloud;break}l=r(s,i,W);const g=Y(l);return q(d,s,l,void 0,g,y),g}},Ct=(s,i)=>{tt(s,i,PointCloudView.Side)},ft=(s,i)=>{tt(s,i,PointCloudView.Back)},ht=(s,i)=>{$(s,i,PointCloudView.Side)},xt=(s,i)=>{$(s,i,PointCloudView.Back)},vt=(s,i)=>{const d=nt(s.id),r=topViewPoint2PointCloud(s,i,X,d),l=Y(r);q(PointCloudView.Top,s,r,void 0,l,y)},Lt=(s,i)=>{if(ot){const r=__spreadValues({},s[0].newPolygon);r.pointList=r.pointList.map(l=>lbUtils.PointCloudUtils.transferCanvas2World(l,i)),B(r);return}let d=s.map(({newPolygon:r})=>{const l=at(r.id),{boxParams:g}=topViewPolygon2PointCloud(r,i,t.pointCloudInstance,l);return g});if(d=z(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:d,stepConfig:y,action:"viewUpdateBox"})),d.length===1){const{newPolygon:r}=s[0],l=Q(d);N({polygon:r,boxParams:d[0],newPointCloudBoxList:l})}else{const r=Q(d);r&&n.syncAllViewPointCloudColor(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MultiMove,r)}},yt=s=>{var i,d,r,l,g;if(U){const C=Number(s.widthDefault),h=Number(s.depthDefault),m=Number(s.heightDefault),b=U==null?void 0:U.info.trackID,I=((i=t==null?void 0:t.toolInstance)==null?void 0:i.polygonList).find(G=>(G==null?void 0:G.trackID)===b),v={width:(r=(d=t==null?void 0:t.toolInstance)==null?void 0:d.basicImgInfo)==null?void 0:r.width,height:(g=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:g.height},A=I.pointList.map(G=>lbUtils.PointCloudUtils.transferCanvas2World(G,v)),H=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(A,m,C),E=H[0],F=H[2],Z=lbAnnotation.MathUtils.getLineCenterPoint([E,F]),mt=U.info.center.z-U.info.depth/2,et=__spreadProps(__spreadValues({},U.info),{center:{x:Z.x,y:Z.y,z:mt+h/2},width:C,height:m,depth:h,valid:!0}),Bt=Q([et]);N({omitView:PointCloudView["3D"],polygon:I,boxParams:et,newPointCloudBoxList:Bt})}},q=(s,i,d,r,l,g)=>__async(void 0,null,function*(){const C=j==null?void 0:j.url,h={[PointCloudView.Side]:()=>{syncSideViewByPoint(d,i,u,C,g)},[PointCloudView.Back]:()=>{p&&syncBackViewByPoint(d,i,p,C,g)},[PointCloudView.Top]:()=>{syncTopViewByPoint(d,i,t,e)}};Object.keys(h).forEach(m=>{m!==s&&h[m]()}),r&&(e==null||e.updateCameraZoom(r)),dt(d)}),N=(s,i=ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default)=>{const{omitView:d,polygon:r,boxParams:l,zoom:g,newPointCloudBoxList:C}=s,h=j==null?void 0:j.url;C&&n.syncAllViewPointCloudColor(i,C);const m={[PointCloudView.Side]:()=>{synchronizeSideView(l,r,u,h)},[PointCloudView.Back]:()=>{p&&synchronizeBackView(l,r,p,h)},[PointCloudView.Top]:()=>{synchronizeTopView(l,r,t,e)}};Object.keys(m).forEach(b=>{b!==d&&m[b]()}),g&&(e==null||e.updateCameraZoom(g))};return{topViewAddSphere:ut,topViewAddBox:ct,topViewSelectedChanged:Pt,topViewUpdatePoint:vt,sideViewUpdatePoint:Ct,backViewUpdatePoint:ft,topViewUpdateBox:Lt,sideViewUpdateBox:ht,backViewUpdateBox:xt,syncPointCloudViews:N,syncPointCloudPoint:q,pointCloudBoxListUpdated:s=>{t.updatePolygonList(s),e==null||e.generateBoxes(s)},initPointCloud3d:s=>{if(!e)return;const i=lbUtils.PointCloudUtils.getDefaultOrthographicParams(s);e.initOrthographicCamera(i),e.initRenderer(),e.render()},updatePointCloudData:(...s)=>__async(void 0,[...s],function*(i=j){var d,r,l,g,C,h,m,b;if(!(i==null?void 0:i.url)||!e)return;D([]),actionCreators.SetAnnotationLoading(z,!0),actionCreators.SetLoadPCDFileLoading(z,!0),(d=o==null?void 0:o.setResourceLoading)==null||d.call(o,!0),yield e.loadPCDFile(i.url,(r=y==null?void 0:y.radius)!=null?r:DEFAULT_RADIUS),e==null||e.clearAllBox(),e==null||e.clearAllSphere();let S=[],I=[],v=[],A=[];e.updateTopCamera();const H=(g=(l=index.jsonParser(i.result))==null?void 0:l.valid)!=null?g:!0;if(n.setPointCloudValid(H),(C=n.sideViewInstance)==null||C.clearAllData(),(h=n.backViewInstance)==null||h.clearAllData(),i.result){if(S=lbUtils.PointCloudUtils.getBoxParamsFromResultList(i.result),(S==null?void 0:S.length)>0&&i.isPreResult&&(y==null?void 0:y.lowerLimitPointsNumInBox)>0){S=yield e==null?void 0:e.filterPreResult(i.url,y,S);const E=index.jsonParser(i.result);E[lbUtils.POINT_CLOUD_DEFAULT_STEP].result=S,i.result=JSON.stringify(E),n.setPointCloudResult(S)}v=lbUtils.PointCloudUtils.getPolygonListFromResultList(i.result),I=lbUtils.PointCloudUtils.getLineListFromResultList(i.result),A=lbUtils.PointCloudUtils.getSphereParamsFromResultList(i.result),t.updateData(i.url,i.result,{radius:(m=y==null?void 0:y.radius)!=null?m:DEFAULT_RADIUS}),e==null||e.generateBoxes(S),e==null||e.generateSpheres(A),yield n.syncAllViewPointCloudColor(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,S,[])}M({pointCloudBoxList:S,polygonList:v,lineList:I,pointCloudSphereList:A}),actionCreators.SetAnnotationLoading(z,!1),actionCreators.SetLoadPCDFileLoading(z,!1),(b=o==null?void 0:o.setResourceLoading)==null||b.call(o,!1)}),updateViewsByDefaultSize:yt,generateRects:J,update2DViewRect:pt,remove2DViewRect:gt}},useSyncRectPositionDimensionToPointCloudList=()=>{const{pointCloudBoxList:o,rectList:n,setPointCloudResult:t}=React.useContext(PointCloudContext.PointCloudContext),u=ahooks.useLatest(o),p=ahooks.useLatest(n);return{syncToPointCloudBoxList:React.useCallback(()=>{const P=u.current,c=p.current;if(c.length===0)return null;const a=new Map,x=new Set;if(c.filter(f=>f.extId!==void 0).forEach(f=>{const L=f.extId,R=f.imageName,D=_.pick(f,["x","y","width","height"]);let w=a.get(L);w||(w=new Map,a.set(L,w)),w.set(R,D),x.add(L)}),a.size){const f=P.map(L=>{var R;const D=L.id;if(x.has(D)){const w=__spreadValues({},L);return(R=w.rects)==null||R.forEach(V=>{var T;const k=V.imageName;Object.assign(V,(T=a.get(D))==null?void 0:T.get(k))}),w}return L});return t(f),f}return null},[])}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews,exports.useSyncRectPositionDimensionToPointCloudList=useSyncRectPositionDimensionToPointCloudList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useHistory=require("./useHistory.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useHistory=require("./useHistory.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,t)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,__spreadValues=(e,o)=>{for(var t in o||(o={}))__hasOwnProp.call(o,t)&&__defNormalProp(e,t,o[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(o))__propIsEnum.call(o,t)&&__defNormalProp(e,t,o[t]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o));const usePolygon=()=>{const{polygonList:e,pointCloudBoxList:o,setPolygonList:t,selectedID:a}=React.useContext(PointCloudContext.PointCloudContext),{addHistory:p,pushHistoryWithList:u}=useHistory.useHistory(),d=e.find(r=>r.id===a);return{addPolygon:r=>{t(e.concat(r)),p({newPolygon:r})},deletePolygon:r=>{const i=e.filter(s=>s.id!==r).map(s=>__spreadValues({},s));t(i);const n={polygonList:i};try{const s=o.filter(l=>l.id!==r).map(l=>__spreadValues({},l));s.length<o.length&&(n.pointCloudBoxList=s)}catch(s){console.error("exec update history pointCloudBoxList error:",s)}u(n)},selectedPolygon:d,updateSelectedPolygon:r=>{d&&t(e.map(i=>i.id===a?r:i))},updatePolygonValidByID:r=>{e.find(n=>n.id===r)&&t(e.map(n=>n.id===r?__spreadProps(__spreadValues({},n),{valid:!n.valid}):n))}}};exports.usePolygon=usePolygon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),usePointCloudViews=require("./usePointCloudViews.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),ahooks=require("ahooks");const{ERotateDirection}=lbAnnotation.cAnnotation,useRotate=({currentData:o})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:i,updateSelectedBox:a}=useSingleBox.useSingleBox(),{run:c}=ahooks.useThrottleFn(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),usePointCloudViews=require("./usePointCloudViews.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js"),ahooks=require("ahooks");const{ERotateDirection}=lbAnnotation.cAnnotation,useRotate=({currentData:o})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:i,updateSelectedBox:a}=useSingleBox.useSingleBox(),{run:c}=ahooks.useThrottleFn(r=>{const{topViewInstance:l,mainViewInstance:n,syncAllViewPointCloudColor:d}=t;if(!l||!n)return;const{pointCloud2dOperation:s}=l,e=i==null?void 0:i.info;if(!e||!(o==null?void 0:o.url)||!t.backViewInstance)return;const C=a({rotation:lbUtils.PointCloudUtils.restrictAngleRange(e.rotation+Number(Math.PI*r)/180)});s.rotatePolygon(r,ERotateDirection.Anticlockwise);const u=s.selectedPolygon;n.generateBox(e),d(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate,C),usePointCloudViews.synchronizeSideView(e,u,t.sideViewInstance,o.url),usePointCloudViews.synchronizeBackView(e,u,t.backViewInstance,o.url),n.render()},{wait:800});return{updateRotate:c}};exports.useRotate=useRotate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),usePointCloudViews=require("./usePointCloudViews.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),ahooks=require("ahooks"),lbUtils=require("@labelbee/lb-utils");const useRotateEdge=({currentData:t})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:r,updateSelectedBox:d}=useSingleBox.useSingleBox(),{run:a}=ahooks.useThrottleFn(c=>{const{topViewInstance:l,mainViewInstance:i}=o;if(!l||!i)return;const{pointCloud2dOperation:s}=l,e=r==null?void 0:r.info;if(!e||!(t==null?void 0:t.url)||!o.backViewInstance)return;const n=s.selectedPolygon.pointList||[],g=n.shift();n.push(g),d({newPointList:n,rotation:lbUtils.PointCloudUtils.restrictAngleRange(e.rotation+Number(Math.PI*c)/180),width:e.height,height:e.width}),s.rotatePolygonEdge(n);const u=s.selectedPolygon;i.generateBox(e),usePointCloudViews.synchronizeSideView(e,u,o.sideViewInstance,t.url),usePointCloudViews.synchronizeBackView(e,u,o.backViewInstance,t.url),i.render()},{wait:800});return{updateRotateEdge:a}};exports.useRotateEdge=useRotateEdge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,t,d)=>t in l?__defProp(l,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):l[t]=d,__spreadValues=(l,t)=>{for(var d in t||(t={}))__hasOwnProp.call(t,d)&&__defNormalProp(l,d,t[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(t))__propIsEnum.call(t,d)&&__defNormalProp(l,d,t[d]);return l},__spreadProps=(l,t)=>__defProps(l,__getOwnPropDescs(t));const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=l=>{const{pointCloudBoxList:t,setPointCloudResult:d,topViewInstance:s,backViewInstance:I,sideViewInstance:m,selectedIDs:P,selectedID:B,mainViewInstance:f,setSelectedIDs:N,syncAllViewPointCloudColor:R,polygonList:j,pointCloudPattern:b,rectList:h,updateRectIn2DView:Z,removeRectIn2DView:k,addRectIn2DView:A,updateRectListByReducer:O}=React.useContext(PointCloudContext.PointCloudContext),{selectedPolygon:p,updateSelectedPolygon:T,updatePolygonValidByID:q,deletePolygon:H}=usePolygon.usePolygon(),{pushHistoryWithList:S}=useHistory.useHistory(),a=React.useMemo(()=>{const e=t.findIndex(n=>n.id===B);if(e>-1)return{info:t[e],index:e}},[B,t]),D=React.useCallback(e=>{var n;if(a==null?void 0:a.info){(n=l==null?void 0:l.generateRects)==null||n.call(l,e),t.splice(a.index,1,___default.default.merge(a.info,e));const o=___default.default.cloneDeep(t);return d(o),S({pointCloudBoxList:o}),o}return t},[B,t]),M=React.useCallback((e,n)=>{const o=t.findIndex(i=>i.id===n);if(o>-1){t.splice(o,1,___default.default.merge(t[o],e));const i=___default.default.cloneDeep(t);return d(i),i}return t},[t]),y=React.useCallback(e=>{s==null||s.pointCloud2dOperation.setPolygonValidAndRender(e,!0),m==null||m.pointCloud2dOperation.setPolygonValidAndRender(e,!0),I==null||I.pointCloud2dOperation.setPolygonValidAndRender(e,!0)},[s,m,I]),K=React.useCallback(()=>{if(a==null?void 0:a.info){const{id:e,valid:n=!0}=a.info,o=D({valid:!n});R(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid,o),y(e)}p&&(T(__spreadProps(__spreadValues({},p),{valid:!p.valid})),s==null||s.pointCloud2dOperation.setPolygonValidAndRender(p.id,!0))},[y,a,p]),U=React.useCallback(e=>{const n=t.find(o=>o.id===e);if(n){const{id:o,valid:i=!0}=n,u=M({valid:!i},o);return y(o),u}q(e)},[y,t,j]),V=React.useCallback((e=ESortDirection.ascend,n=!1)=>{if(!s||P.length>1)return;if(b!==lbAnnotation.EToolName.Rect&&b!==lbAnnotation.EToolName.Polygon){n&&document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:9,shiftKey:e!==ESortDirection.ascend}));return}const{pointCloud2dOperation:o}=s,i=o.switchToNextPolygon(e);i&&N(i)},[s,b,s==null?void 0:s.toolInstance]),F=(e=!1)=>{V(ESortDirection.descend,e)},W=(e=!1)=>{V(ESortDirection.ascend,e)},L=(e,n=!0)=>{const o=t.filter(i=>i.id!==e);if(d(o),f==null||f.removeObjectByName(e,"box"),f==null||f.render(),R(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleDelete,o),n){const i=h.filter(r=>r.extId===e),u=new Set(i.map(r=>r.id));O(E(u))}},E=e=>(n,o)=>{let i=!1;const u=n.map(r=>e.has(r.id)?(i=!0,o(r)):r);return i?u:n},z=React.useCallback((e,n)=>{var o,i;const u=new Set((i=(o=n.mappingImgList)==null?void 0:o.map(c=>c.path))!=null?i:[]),r=new Map;e.forEach(c=>{const C=c.id;(c.rects||[]).forEach(w=>{const{imageName:x}=w;if(u.has(x)){let v=r.get(x);v||(v=new Set,r.set(x,v)),v.add(C)}})});const g=h.filter(c=>{var C;const w=c.extId,x=c.imageName;if(x!==void 0&&w!==void 0){const v=r.get(x);return(C=v==null?void 0:v.has(w))!=null?C:!1}return!1}),Y=new Set(g.map(c=>c.id));O(E(Y))},[h,k,A]),G=e=>{a&&(L(a.info.id,!1),s==null||s.pointCloud2dOperation.deletePolygon(a.info.id),z([a.info],e)),p&&(H(p.id),s==null||s.pointCloud2dOperation.deletePolygon(p.id))},J=React.useMemo(()=>t.filter(e=>P.includes(e.id)),[P,t]),Q=React.useCallback(e=>{var n;const o=___default.default.cloneDeep(t);let i=!1;for(const u of e){const r=o.findIndex(g=>g.id===u.id);if(r>-1){const g=___default.default.merge(o[r],u);(n=l==null?void 0:l.generateRects)==null||n.call(l,g),o.splice(r,1,g),f==null||f.generateBox(g),i=!0}}if(i)return d(o),S({pointCloudBoxList:o}),f==null||f.render(),o},[P,t]),X=React.useCallback(e=>t.find(n=>n.id===e),[t]);return{selectedBox:a,updateSelectedBox:D,changeSelectedBoxValid:K,changeValidByID:U,selectNextBox:W,selectPrevBox:F,deletePointCloudBox:L,selectedBoxes:J,updateSelectedBoxes:Q,getPointCloudByID:X,deleteSelectedPointCloudBoxAndPolygon:G}};exports.useSingleBox=useSingleBox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),lbUtils=require("@labelbee/lb-utils");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),lbUtils=require("@labelbee/lb-utils"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:s,backViewInstance:u,mainViewInstance:e,setPointCloudResult:d,setPointCloudSphereList:P,setPolygonList:C,setRectList:v,pointCloudPattern:a,setPointCloudPattern:o,syncAllViewPointCloudColor:b,globalPattern:l,setLineList:h}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:p}=useHistory.useHistory(),R=()=>{e==null||e.clearAllBox(),e==null||e.clearAllSphere(),e==null||e.render(),d([]),C([]),P([]),h([]),v([]),i==null||i.toolScheduler.clearStatusAndResult(),b(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.ClearAll,[]),p({pointCloudBoxList:[],polygonList:[],pointCloudSphereList:[]})},n=()=>{s==null||s.toolInstance.clearResult(),u==null||u.toolInstance.clearResult()},y=c=>{if(c===a)return;const r=[i,s,u];switch(c){case EToolName.Rect:n(),r.forEach(t=>{t==null||t.switchToCanvas(EToolName.PointCloudPolygon),t==null||t.toolInstance.setPattern(EPolygonPattern.Rect)}),o(EToolName.Rect);break;case EToolName.Polygon:n(),r.forEach(t=>{t==null||t.switchToCanvas(EToolName.PointCloudPolygon),t==null||t.toolInstance.setPattern(EPolygonPattern.Normal)}),o(EToolName.Polygon);break;case EToolName.Point:n(),r.forEach(t=>{t==null||t.switchToCanvas(EToolName.Point)}),o(EToolName.Point);break;case EToolName.Line:n(),r.forEach(t=>{t==null||t.switchToCanvas(EToolName.Line)}),o(EToolName.Line);break}},g=React.useMemo(()=>l===lbUtils.EPointCloudPattern.Detection,[l]),L=React.useMemo(()=>l===lbUtils.EPointCloudPattern.Segmentation,[l]);return{clearAllResult:R,updatePointCloudPattern:y,pointCloudPattern:a,isPointCloudDetectionPattern:g,isPointCloudSegmentationPattern:L}};exports.useStatus=useStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ahooks=require("ahooks");const isNumber=t=>typeof t=="number",useTimeoutFunc=(t,e)=>{const s=ahooks.useMemoizedFn(t),u=React.useRef(null),r=React.useCallback(()=>{u.current&&clearTimeout(u.current)},[]),c=React.useCallback((...o)=>{!isNumber(e)||e<0||(r(),u.current=setTimeout(()=>s(...o),e))},[e]);return React.useEffect(()=>r,[r]),{fn:c,clear:r}};exports.default=useTimeoutFunc,exports.isNumber=isNumber;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../../../store/ctx.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../store/annotation/actionCreators.js"),usePointCloudViews=require("./usePointCloudViews.js"),useSphere=require("./useSphere.js"),useHistory=require("./useHistory.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},useUpdatePointCloudColor=(v,d)=>{const l=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:u,selectedIDs:i,pointCloudBoxList:s,mainViewInstance:c,selectedID:g}=l,f=ctx.useDispatch(),{selectedSphere:C}=useSphere.useSphere(),{syncPointCloudViews:p,syncPointCloudPoint:P,generateRects:h}=usePointCloudViews.usePointCloudViews({setResourceLoading:v}),{selectedBox:a,updateSelectedBox:x}=useSingleBox.useSingleBox({generateRects:h}),{pushHistoryWithList:V}=useHistory.useHistory(),q=({newSelectedSphere:n,newSphereList:o})=>{const e=u==null?void 0:u.toolInstance;if((n||C)&&i.length===1){const t=n!=null?n:C;e.setSelectedID(i[0]);const r=e.selectedPoint;t&&(P==null||P(PointCloudView.Top,r,t,void 0,o,d))}},y=({trigger:n,newSelectedBox:o})=>{const e=u==null?void 0:u.toolInstance;if(!(i.length===0||!e)&&(o||(a==null?void 0:a.info))){const t=o!=null?o:a==null?void 0:a.info,r=o;if(t){p==null||p({omitView:PointCloudView.Top,polygon:r,boxParams:t},n);return}}};return{updatePointCloudColor:n=>{if(s.forEach(o=>{var e,t,r;if(o&&i.includes(o.id)){o.attribute=n;const S=f(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[o],stepConfig:d,action:"viewUpdateBox"}));o.valid=S[0].valid,x(o),(r=(t=(e=l==null?void 0:l.topViewInstance)==null?void 0:e.pointCloud2dOperation)==null?void 0:t.setPolygonValidAndRender)==null||r.call(t,o.id,!0,o.valid),q({})}}),c){const o=i&&i.length>1?ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MulitSelect:ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single;l.syncAllViewPointCloudColor(o,s),s.forEach(e=>{y({trigger:o,newSelectedBox:e})}),c.generateBoxes(s)}g||V({pointCloudBoxList:s})}}};exports.useUpdatePointCloudColor=useUpdatePointCloudColor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");require("../utils/event-polyfill.js");const EmptyCaller=()=>()=>{},getEmptyUseWindowKeydownListener=()=>({appendEventListener:EmptyCaller,preappendEventListener:EmptyCaller,addEventListener:EmptyCaller}),ctor=()=>{},useWindowKeydownListener=()=>{const n=React.useRef([]),c=React.useCallback(e=>{const t=n.current,s=t.findIndex(o=>o===e);s>-1&&t.splice(s,1)},[]),r=React.useCallback((e,t)=>e?(t(e),()=>{c(e)}):(console.warn("invalid listener"),ctor),[c]),i=React.useCallback(e=>r(e,t=>{n.current.push(t)}),[r]),u=React.useCallback(e=>r(e,t=>{n.current.unshift(t)}),[r]);return React.useEffect(()=>()=>{n.current.length=0},[]),React.useEffect(()=>{const e=t=>{const s=n.current.slice(0);for(let o of s){if(t.isImmediatePropagationStopped())break;o(t)}};return window.addEventListener("keydown",e,!1),()=>{window.removeEventListener("keydown",e,!1)}},[]),React.useMemo(()=>({appendEventListener:i,preappendEventListener:u,addEventListener:i}),[i,u])};exports.default=useWindowKeydownListener,exports.getEmptyUseWindowKeydownListener=getEmptyUseWindowKeydownListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=a=>{const{currentData:i,imgList:P,drawLayerSlot:c,checkMode:n,intelligentFit:v,imgIndex:p,config:L,measureVisible:E}=a,e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:m,setGlobalPattern:
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=a=>{const{currentData:i,imgList:P,drawLayerSlot:c,checkMode:n,intelligentFit:v,imgIndex:p,config:L,measureVisible:E,setResourceLoading:x}=a,e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:m,setGlobalPattern:S,selectedIDs:C}=e,q=ctx.useDispatch(),[l,f]=React.useState(!1),b=(C==null?void 0:C.length)>0&&l,j=index.jsonParser(i.result),{toolInstanceRef:o,clearToolInstance:w}=annotation.useCustomToolInstance({basicInfo:j});if(React.useEffect(()=>{o.current.setPointCloudGlobalPattern=t=>{t!==m&&(S(t),e.clearAllDetectionInstance(),w())}},[m]),React.useEffect(()=>{var t;if(actionCreators.SetLoadPCDFileLoading(q,!0),i){const{boxParamsList:r,polygonList:s,lineList:u,sphereParamsList:d,segmentation:N,rectList:V}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((t=i==null?void 0:i.result)!=null?t:"");e.setPointCloudResult(r),e.setPolygonList(s),e.setLineList(u),e.setPointCloudSphereList(d),e.setRectList(V),e.setSegmentation(N)}},[p]),React.useEffect(()=>{o.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],o.current.exportCustomData=()=>{var t,r,s,u,d;return{resultPolygon:(t=e.polygonList)!=null?t:[],resultLine:(r=e.lineList)!=null?r:[],resultPoint:(s=e.pointCloudSphereList)!=null?s:[],resultRect:(u=e.rectList)!=null?u:[],segmentation:(d=e.segmentation)!=null?d:[]}}},[e.pointCloudBoxList,e.rectList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),P.length===0)return null;if(m===lbUtils.EPointCloudPattern.Segmentation)return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:n,toolInstanceRef:o}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement(PointCloudSegment,{checkMode:n}),React__default.default.createElement(PointCloudSegment2DView,null)),React__default.default.createElement(PointCloudSegmentStatus,{config:L}),c==null?void 0:c({direct:!0}));let g=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left-bottom")},React__default.default.createElement(PointCloudBackView,{checkMode:n}),React__default.default.createElement(PointCloudSideView,{checkMode:n}));return l&&(g=React__default.default.createElement(index$2,{selectAndEnlarge:b,checkMode:n})),React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:n,toolInstanceRef:o,setResourceLoading:x}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:t=>t.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud3DView,null),g),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right")]:!0,[dom.getClassName("point-cloud-container","rightZoom")]:l})},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:c,checkMode:n,intelligentFit:v,setIsEnlargeTopView:f,onExitZoom:()=>{f(!1)},isEnlargeTopView:l}),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right-bottom")]:!l,[dom.getClassName("point-cloud-container","right-bottom-floatLeft")]:l})},React__default.default.createElement(PointCloud2DView,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:n,measureVisible:E})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
|