@labelbee/lb-components 1.23.0-alpha.11 → 1.23.0-alpha.111
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/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/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/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.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/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/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/hooks/useToolStyle.js +1 -0
- package/dist/index.css +146 -12
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- 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/toolConfig/index.js +1 -0
- package/dist/types/App.d.ts +6 -1
- package/dist/types/components/AnnotationView/index.d.ts +1 -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/LLMToolView/utils/data.d.ts +1 -1
- 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 +2 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +28 -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 +13 -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/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/hooks/useToolStyle.d.ts +30 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/store/Actions.d.ts +1 -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/toolConfig/index.d.ts +6 -0
- package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
- package/dist/types/utils/index.d.ts +31 -1
- 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/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/index.js +1 -1
- 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/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/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- 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/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/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/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.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/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/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/hooks/useToolStyle.js +1 -0
- package/es/index.css +146 -12
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- 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/toolConfig/index.js +1 -0
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/es/utils/index.js +1 -1
- 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/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/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- 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 +6 -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,2 +1,3 @@
|
|
|
1
|
-
import{message as
|
|
2
|
-
${
|
|
1
|
+
import{message as b}from"antd";import{cKeyCode as K}from"@labelbee/lb-annotation";import{useAudioClipStore as _}from"../../audioAnnotate/audioContext/index.js";import{useMemoizedFn as C,useEventListener as D}from"ahooks";import{useEffect as L}from"react";import{cloneDeep as O}from"lodash";const z=K.default,Z=y=>{const{waveRef:E,sortByStartRegions:B,regionMap:g,updateRegion:x,removeRegion:a,generateRegions:h,setSelectedRegion:A}=y,{audioClipState:R,setAudioClipState:m}=_(),{selectedRegion:v,clipConfigurable:$,combined:k,clipTextList:F}=R,{id:i}=v,I=(o,d,c)=>{const t=O(o);return F.forEach((e,l)=>{const u=d[e.key],s=c[e.key],f=[u,s].includes("")?`${u}${s}`:`${u}
|
|
2
|
+
${s}`;l===0?Object.assign(t,{text:f}):Object.assign(t,{[e.key]:f})}),t},w=C(o=>{var d,c;if(!i)return;const t=g[i],e=g[o.id];if(t.attribute!==e.attribute){b.info("\u8BF7\u9009\u62E9\u76F8\u90BB\u540C\u5C5E\u6027\u7247\u6BB5");return}const l=B.filter(n=>n.attribute===t.attribute),u=l.findIndex(n=>n.id===i),s=l.findIndex(n=>n.id===o.id);if(Math.abs(u-s)!==1){b.info("\u8BF7\u9009\u62E9\u76F8\u90BB\u540C\u5C5E\u6027\u7247\u6BB5");return}const r=[];["start","end"].forEach(n=>{r.push(t[n]),r.push(e[n])});const S=Math.min(...r),T=Math.max(...r),j={id:(d=E.current)==null?void 0:d.util.getId("combined_"),start:S,end:T,attribute:t.attribute,text:[t.text,e.text].includes("")?`${t.text}${e.text}`:`${t.text}
|
|
3
|
+
${e.text}`,subAttribute:(c=e.subAttribute)!=null?c:{}},p=I(j,t,e);x==null||x(p),a==null||a(i),a==null||a(e.id),h(),m({combined:!1}),A({id:p.id,playImmediately:!0})}),M=C(o=>{if(!!$&&o.altKey&&o.keyCode===z.Z){if(!i){b.info("\u8BF7\u5148\u9009\u62E9\u9700\u8981\u5408\u5E76\u7684\u533A\u95F4");return}m({combined:!0,segment:!1})}});return L(()=>{k&&m({combined:!1})},[i]),D("keydown",M),{combineInstance:w}};export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as w}from"react";import{precisionAdd as B,precisionMinus as C}from"../../../utils/audio.js";import{useLatest as
|
|
1
|
+
import{useEffect as w}from"react";import{precisionAdd as B,precisionMinus as C}from"../../../utils/audio.js";import{useLatest as f}from"ahooks";import{audioZoomInfo as g}from"../zoomSlider/index.js";const v=m=>{const{container:t,target:i,bufferWidth:o=10,clipping:h=!1,zoom:r=1,zoomHandler:c}=m,R=f(t),l=f(r),a=e=>{var n;e.ctrlKey&&((n=R.current)==null?void 0:n.contains(e.target))&&(e.deltaY>0?c(B(l.current,g.ratio)):c(C(l.current,g.ratio)))};if(w(()=>(document.addEventListener("wheel",a),()=>{document.removeEventListener("wheel",a)}),[]),t&&i&&h&&r>1){const{scrollLeft:e}=t,{right:n,left:d,width:p}=i.getBoundingClientRect(),{right:s,left:u,width:L}=t.getBoundingClientRect();if(p>L)return;u+o>d&&d>u&&window.requestAnimationFrame(()=>{t.scrollLeft=e-20}),n+o>s&&n<s&&window.requestAnimationFrame(()=>{t.scrollLeft=e+20})}};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{useRef as O,useEffect as P}from"react";import{message as T}from"antd";import{cKeyCode as z,TagUtils as G}from"@labelbee/lb-annotation";import{useAudioClipStore as N}from"../../audioAnnotate/audioContext/index.js";import{useMemoizedFn as y,useEventListener as U}from"ahooks";import R from"../../audioAnnotate/utils/dataTransform.js";var X=Object.defineProperty,q=Object.defineProperties,H=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,S=(r,e,t)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,x=(r,e)=>{for(var t in e||(e={}))J.call(e,t)&&S(r,t,e[t]);if(E)for(var t of E(e))Q.call(e,t)&&S(r,t,e[t]);return r},B=(r,e)=>q(r,H(e));const W=z.default,Y=r=>{const{waveRef:e,regionMap:t,updateRegion:d,removeRegion:C,generateRegions:D,setSelectedRegion:j}=r,{audioClipState:F,setAudioClipState:p}=N(),{selectedRegion:I,clipConfigurable:h,segment:m,clipTextList:w,subAttributeList:A,secondaryAttributeConfigurable:L=!1}=F,{id:n}=I,v=O(null),f=O(null);P(()=>{var o,u,i,a,c,s,g;if(f.current&&e.current&&m&&n){const l=(s=(i=(u=(o=e.current)==null?void 0:o.regions)==null?void 0:u.util)==null?void 0:i.getRegionSnapToGridValue)==null?void 0:s.call(i,((a=e.current)==null?void 0:a.drawer.handleEvent(f.current))*((c=e.current)==null?void 0:c.getDuration())),_=(g=t[n])!=null?g:{},{start:b,end:V}=_;if(l>b&&l<V){v.current=l;return}}v.current=null},[f.current,m]);const M=y((o,u)=>{var i,a,c;if(!n||n!==o.id){T.info("\u8BF7\u70B9\u51FB\u6240\u9009\u533A\u95F4");return}const s=t[n],g=R.getClipTextByConfig(s,w),l=B(x({},g),{id:(i=e.current)==null?void 0:i.util.getId("segment_"),end:u,subAttribute:(a=s.subAttribute)!=null?a:{}}),_=R.getClipTextByConfig(s,w,!0),b=B(x({},_),{id:(c=e.current)==null?void 0:c.util.getId("segment_"),start:u,subAttribute:G.getDefaultResultByConfig(L?A!=null?A:[]:[])});d==null||d(l),d==null||d(b),C==null||C(n),D(),p({segment:!1}),j({id:l.id,playImmediately:!0})}),K=y(o=>{if(!!h&&o.altKey&&o.keyCode===W.X){if(!n){T.info("\u8BF7\u5148\u9009\u62E9\u9700\u8981\u5206\u5272\u7684\u533A\u95F4");return}p({segment:!0,combined:!1})}}),k=y((o,u)=>{f.current=u});return U("keydown",K),P(()=>{m&&p({segment:!1})},[n]),{segmentInstance:M,onRegionMouseMove:k,segmentTimeTip:v.current}};export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useEffect as p}from"react";import{ZoomOutOutlined as y,ZoomInOutlined as E}from"@ant-design/icons";import{Slider as k}from"antd";import{precisionAdd as v,precisionMinus as x}from"../../../utils/audio.js";import{cKeyCode as C}from"@labelbee/lb-annotation";import{useLatest as h}from"ahooks";import Z from"./index.module.scss.js";import{useTranslation as b}from"react-i18next";const l=C.default,o={min:1,max:150,ratio:1},g=d=>{const{onChange:u,zoom:r}=d,{t:f}=b(),i=h(r),n=e=>{u(e)},a={fontSize:14,margin:"0 8px",cursor:"pointer"},s=()=>{const e=v(i.current,o.ratio);n(e)},c=()=>{const e=x(i.current,o.ratio);n(e)},m=e=>{switch(e.keyCode){case l.I:e.ctrlKey&&s();break;case l.O:e.ctrlKey&&(e.preventDefault(),c());break}};return p(()=>(document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}),[]),t.createElement("div",{className:Z.sliderContainer},t.createElement("div",null,f("Scale")),t.createElement(y,{style:a,onClick:c}),t.createElement("div",{style:{width:120}},t.createElement(k,{min:o.min,max:o.max,step:o.ratio,onChange:n,value:r})),t.createElement(E,{style:a,onClick:s}))};export{o as audioZoomInfo,g as default};
|
|
1
|
+
import t,{useEffect as p}from"react";import{ZoomOutOutlined as y,ZoomInOutlined as E}from"@ant-design/icons";import{Slider as k}from"antd";import{precisionAdd as v,precisionMinus as x}from"../../../utils/audio.js";import{cKeyCode as C}from"@labelbee/lb-annotation";import{useLatest as h}from"ahooks";import Z from"./index.module.scss.js";import{useTranslation as b}from"react-i18next";const l=C.default,o={min:1,max:150,ratio:1,defaultValue:30},g=d=>{const{onChange:u,zoom:r}=d,{t:f}=b(),i=h(r),n=e=>{u(e)},a={fontSize:14,margin:"0 8px",cursor:"pointer"},s=()=>{const e=v(i.current,o.ratio);n(e)},c=()=>{const e=x(i.current,o.ratio);n(e)},m=e=>{switch(e.keyCode){case l.I:e.ctrlKey&&s();break;case l.O:e.ctrlKey&&(e.preventDefault(),c());break}};return p(()=>(document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}),[]),t.createElement("div",{className:Z.sliderContainer},t.createElement("div",null,f("Scale")),t.createElement(y,{style:a,onClick:c}),t.createElement("div",{style:{width:120}},t.createElement(k,{min:o.min,max:o.max,step:o.ratio,onChange:n,value:r})),t.createElement(E,{style:a,onClick:s}))};export{o as audioZoomInfo,g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l,{forwardRef as h,useRef as E,useMemo as S}from"react";import{Tooltip as T,Popover as x}from"antd";import{useSize as j}from"ahooks";import{prefix as L}from"../../constant/index.js";import{SearchOutlined as C}from"@ant-design/icons";var M=Object.defineProperty,N=Object.defineProperties,R=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,b=(t,e,r)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f=(t,e)=>{for(var r in e||(e={}))g.call(e,r)&&b(t,r,e[r]);if(v)for(var r of v(e))P.call(e,r)&&b(t,r,e[r]);return t},W=(t,e)=>N(t,R(e)),$=(t,e)=>{var r={};for(var n in t)g.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&v)for(var n of v(t))e.indexOf(n)<0&&P.call(t,n)&&(r[n]=t[n]);return r};const u=`${L}-longText`,_=h((t,e)=>{var r=t,{text:n,overflowMaxLines:p,style:i}=r,m=$(r,["text","overflowMaxLines","style"]);const a={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},o={display:"-webkit-box",WebkitLineClamp:p,WebkitBoxOrient:"vertical",overflow:"hidden"},d=p>1?o:a,c=f(f({},d),i!=null?i:{});return l.createElement("div",f({style:c,ref:e},m),n)}),k=t=>{const{text:e,placement:r="bottom",icon:n=l.createElement(C,null),openByText:p,style:i,isToolTips:m,overflowMaxLines:a=1}=t,o=E(null),d=j(o),c=S(()=>{var s,y,O,w;return a>1?o.current&&((s=o.current)==null?void 0:s.clientHeight)<((y=o.current)==null?void 0:y.scrollHeight):o.current&&((O=o.current)==null?void 0:O.clientWidth)<((w=o.current)==null?void 0:w.scrollWidth)},[d]);if(p){let s={placement:r,overlayClassName:`${u}-popover`,content:e,key:`${c}`};return c||Object.assign(s,{open:!1}),m?l.createElement(T,W(f({},s),{title:e}),l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e})):l.createElement(x,f({},s),l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e}))}return l.createElement("div",{className:u,style:i},l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e}),c&&l.createElement(x,{placement:r,overlayClassName:`${u}-popover`,content:e},n))};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLatest as
|
|
1
|
+
import{useLatest as q,useMemoizedFn as U}from"ahooks";import{Spin as le}from"antd/es";import k,{useContext as ie,useRef as G,useState as ce,useMemo as ue,useCallback as se,useEffect as f}from"react";import{connect as ae}from"react-redux";import{usePointCloudViews as de}from"../pointCloudView/hooks/usePointCloudViews.js";import{PointCloudContext as fe}from"../pointCloudView/PointCloudContext.js";import{a2MapStateToProps as pe}from"../../store/annotation/map.js";import{LabelBeeContext as me}from"../../store/ctx.js";import{PointCloud2DRectOperation as ve,ImgUtils as ge}from"@labelbee/lb-annotation";import{selectSpecifiedRectsFromTopViewSelectedIds as Re}from"./util.js";import{useUpdateRectList as _e}from"./useUpdateRectList.js";import{useToolStyleContext as De}from"../../hooks/useToolStyle.js";var Ie=Object.defineProperty,he=Object.defineProperties,be=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,K=(u,i,c)=>i in u?Ie(u,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):u[i]=c,m=(u,i)=>{for(var c in i||(i={}))we.call(i,c)&&K(u,c,i[c]);if(H)for(var c of H(i))ye.call(i,c)&&K(u,c,i[c]);return u},h=(u,i)=>he(u,be(i)),A=(u,i,c)=>new Promise((s,v)=>{var _=a=>{try{D(c.next(a))}catch(g){v(g)}},S=a=>{try{D(c.throw(a))}catch(g){v(g)}},D=a=>a.done?s(a.value):Promise.resolve(a.value).then(_,S);D((c=c.apply(u,i)).next())});const Pe=u=>{var i,c;const{mappingData:s,size:v,config:_,checkMode:S,afterImgOnLoad:D,shouldExcludePointCloudBoxListUpdate:a}=u,g=(i=s==null?void 0:s.url)!=null?i:"",b=(c=s==null?void 0:s.fallbackUrl)!=null?c:"",{pointCloudBoxList:C,setPointCloudResult:O,defaultAttribute:L,rectList:V,addRectIn2DView:Q,updateRectIn2DView:W,removeRectIn2DView:X,updateRectListByReducer:Y,selectedIDs:w,setSelectedIDs:T}=ie(fe),{value:j}=De(),Z=q(w),{update2DViewRect:ee,remove2DViewRect:te}=de(),E=k.useRef(null),o=G(null),F=U(ee),y=U(te),P=G(null),[ne,M]=ce(!0),N=ue(()=>V==null?void 0:V.filter(e=>e.imageName===(s==null?void 0:s.path)),[s==null?void 0:s.path,V]),x=q(s==null?void 0:s.path),B=se(e=>A(void 0,null,function*(){try{const r=Z.current.slice(0),t=yield Promise.resolve(e());if(!t||t.length===0)return t;if(r.length){const n=new Set(r),l=t.filter(d=>n.has(d.id)).map(d=>d.id);T(l)}return t}catch(r){}}),[T]),z=e=>{const{boxID:r}=e;if(!a&&r){B(()=>{const t=F==null?void 0:F(e);return t?(P.current=t,O(t),t):null});return}W(e,!0)},J=e=>{x.current&&Q(h(m({},e),{imageName:x.current}))},$=e=>{if(e.length===0)return;if(!a){const t=e.find(n=>n.boxID);if(t){B(()=>{const n=y==null?void 0:y(t);return n?(P.current=n,O(n),R(),n):null});return}}const r=e.find(t=>t.extId);r&&B(()=>{const{imageName:t,extId:n}=r,l=y==null?void 0:y({boxID:n,imageName:t});return l?(P.current=l,O(l),l):null}),X(e)},re=U(()=>{let e=[];return C.forEach(r=>{const{rects:t=[],id:n,attribute:l,trackID:d}=r,p=t.find(oe=>oe.imageName===x.current),I=n+"_"+x.current;p&&(e=[...e,h(m({},p),{boxID:n,id:I,attribute:l,order:d})])}),e}),R=_e(()=>{var e,r,t;const n=a?[]:re(),l=(e=o.current)==null?void 0:e.selectedRectID,d=w.slice(0),p=Re(d,n,N);(r=o.current)==null||r.setResult(p),l&&((t=o.current)==null||t.setSelectedRectID(l))});return f(()=>{if(E.current){const e=new ve({container:E.current,size:v,config:h(m({},_),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:S});return o.current=e,o.current.init(),o.current.on("updateDragResult",z),o.current.on("afterAddingDrawingRect",J),o.current.on("deleteSelectedRects",$),()=>{var r,t,n,l;(r=o.current)==null||r.unbind("updateDragResult",z),(t=o.current)==null||t.unbind("afterAddingDrawingRect",J),(n=o.current)==null||n.unbind("deleteSelectedRects",$),(l=o.current)==null||l.destroy()}}},[]),f(()=>{const e=t=>A(void 0,null,function*(){try{return yield ge.load(t)}catch(n){return console.error("Error loading image:",n),null}}),r=()=>A(void 0,null,function*(){var t;M(!0);let n=yield e(g);!n&&b&&(n=yield e(b)),n&&((t=o.current)==null||t.setImgNode(n),D(n)),M(!1)});o.current&&(g||b)&&r()},[g,b]),f(()=>{var e;(e=o.current)==null||e.setSize(v)},[v]),f(()=>{C!==P.current&&R()},[C]),f(()=>{var e,r;const t=N.find(n=>n.id===o.current.selectedRectID);(r=(e=o.current)==null?void 0:e.setDefaultAttribute)==null||r.call(e,L),t&&Y(n=>{var l;const d=[];let p=null;return n.forEach(I=>{I.id!==o.current.selectedRectID?d.push(I):p=I}),t.extId===void 0&&(p=(l=o.current)==null?void 0:l.selectedRect),[...d,h(m({},p||{}),{attribute:L})]}),R()},[L]),f(()=>{R()},[N]),f(()=>{R()},[a]),f(()=>{var e,r,t,n;const l=(r=(e=o.current)==null?void 0:e.config)!=null?r:{},d=h(m({},l),{attributeList:(t=_.attributeList)!=null?t:[]});(n=o.current)==null||n.setConfig(JSON.stringify(d))},[_.attributeList]),f(()=>{var e;(e=o.current)==null||e.setEnableAddRect(w.length===0),R()},[w]),f(()=>{const{hiddenText:e}=j||{};if(e===void 0)return;const r=o.current;if(!r)return;const t=m(m({},r.style),j);r.setStyle(t)},[j]),k.createElement(le,{spinning:ne},k.createElement("div",{ref:E,style:m({position:"relative"},v)}))};var xe=ae(pe,null,null,{context:me})(Pe);export{xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useDebounceFn as o}from"ahooks";const n=t=>{const{run:e}=o(t,{wait:100});return e};export{n as useUpdateRectList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const c=(t,r,n)=>{if(t.length){const f=new Set(t),l=r.filter(({boxID:e})=>f.has(e)),o=n.filter(e=>e.extId&&f.has(e.extId));return[...l,...o]}return[...r,...n]};export{c as selectSpecifiedRectsFromTopViewSelectedIds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as F}from"../../utils/dom.js";import s,{useRef as j,useState as T,useContext as q,useMemo as w,useCallback as D,useEffect as G}from"react";import J from"../AnnotationView/index.js";import K from"../../hooks/useSize.js";import{useSingleBox as M}from"./hooks/useSingleBox.js";import{useHighlight as Q}from"./hooks/useHighlight.js";import W from"./components/HighlightVisible/index.js";import{PointCloudContext as X}from"./PointCloudContext.js";import Y from"./hooks/useDataLinkSwitch.js";import Z from"../pointCloud2DRectOperationView/index.js";var $=(t,u,i)=>new Promise((a,r)=>{var f=o=>{try{e(i.next(o))}catch(n){r(n)}},d=o=>{try{e(i.throw(o))}catch(n){r(n)}},e=o=>o.done?a(o.value):Promise.resolve(o.value).then(f,d);e((i=i.apply(t,u)).next())});const tt=({view2dData:t,setSelectedID:u,currentData:i,showEnlarge:a,checkMode:r=!1,measureVisible:f})=>{var d,e;const o=j(null),n=j(),{selectedBox:m}=M(),p=K(o),{url:b,fallbackUrl:k,calib:x,path:_}=t,{toggle2dVisible:v,isHighlightVisible:z}=Q({currentData:i}),[B,C]=T(!1),{highlight2DLoading:I,setHighlight2DLoading:L,cuboidBoxIn2DView:h,cacheImageNodeSize:O}=q(X),H=!t,R=w(()=>({zIndex:a?-1:101,is2DView:!h,imageName:t.path}),[a,h,t.path]),{rendered:E,isLinking:N}=Y(R),S=l=>{g(),O({path:_,imgNode:l})},g=D(()=>{var l,y;const V=(l=n.current)==null?void 0:l.toolInstance;if(u(""),!m||!V)return;const c=t.annotations.find(A=>A.annotation.id===m.info.id);let P="";c&&((y=c==null?void 0:c.annotation.pointList)==null?void 0:y.length)>0&&(V.focusPositionByPointList(c==null?void 0:c.annotation.pointList),P=m.info.id,u(P))},[m,n.current,t.annotations]);G(()=>{g()},[g]);const U=()=>$(void 0,null,function*(){C(!0),L(!0);try{yield v(b,k!=null?k:"",x)}catch(l){console.error("highlightOnClick error:",l)}finally{C(!1),L(!1)}});return s.createElement("div",{className:F("point-cloud-2d-image"),ref:o},h?s.createElement(J,{src:(d=t==null?void 0:t.url)!=null?d:"",fallbackSrc:(e=t==null?void 0:t.fallbackUrl)!=null?e:"",annotations:t.annotations,size:p,ref:n,globalStyle:{display:H?"none":"block"},afterImgOnLoad:S,zoomInfo:{min:.01,max:1e3,ratio:.4},measureVisible:f}):s.createElement(s.Fragment,null,s.createElement(Z,{shouldExcludePointCloudBoxListUpdate:!N,mappingData:t,size:p,checkMode:r,afterImgOnLoad:S}),!r&&E),x&&s.createElement(W,{visible:z(b),onClick:U,loading:B,disabled:I,style:{position:"absolute",right:16,top:16,zIndex:a?-1:101}}))};export{tt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as _}from"../../utils/dom.js";import t,{useState as f,useContext as z,useCallback as $,useRef as q,useEffect as j}from"react";import{PointCloudContainer as D}from"./PointCloudLayout.js";import{PointCloudContext as M}from"./PointCloudContext.js";import{connect as W}from"react-redux";import{cKeyCode as H,EventBus as G}from"@labelbee/lb-annotation";import{LabelBeeContext as J}from"../../store/ctx.js";import{a2MapStateToProps as Q}from"../../store/annotation/map.js";import U from"./PointCloud2DSingleView.js";import S from"./components/TitleButton/index.js";import{LeftOutlined as X}from"@ant-design/icons";import Y from"classnames";import Z from"../../assets/annotation/common/icon_esc.svg.js";import ee from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import te from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";import ne from"../../_virtual/2DViewWorker.js";import{useLatest as oe}from"ahooks";const C=H.default,ie=({showEnlarge:n,isEnlargeTopView:v,data:l,setIsEnlarge:c,setCurIndex:m,curIndex:u=0,index:E,annotations2d:p})=>v?t.createElement(S,{title:l==null?void 0:l.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):n?t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(X,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{c(!1),m(void 0)}}),t.createElement("span",null,l==null?void 0:l.calName),t.createElement("span",{style:{marginLeft:"8px"}},u+1,"/",p==null?void 0:p.length)):t.createElement(S,{title:l==null?void 0:l.calName,onClick:()=>{c(!0),m(E)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),le=({currentData:n,config:v,thumbnailWidth:l,isEnlargeTopView:c,highlightAttribute:m,loadPCDFileLoading:u,checkMode:E,measureVisible:p})=>{var h;const[a,N]=f([]),{topViewInstance:R,displayPointCloudList:k,polygonList:w,imageSizes:F,selectedIDs:b,windowKeydownListenerHook:x}=z(M),[L,A]=f(""),[d,V]=f(!1),[r,g]=f(void 0),y=$(e=>{V(e),G.emit("2d-image:enlarge",e)},[]),s=q();j(()=>{var e;if(!u&&R&&(n==null?void 0:n.mappingImgList)&&((e=n==null?void 0:n.mappingImgList)==null?void 0:e.length)>0)return s.current&&s.current.terminate(),s.current=new ne,s.current.onmessage=o=>{var i;const O=o.data;N(O),(i=s.current)==null||i.terminate()},s.current.postMessage({currentData:n,displayPointCloudList:k,selectedID:L,highlightAttribute:m,imageSizes:F,config:v,polygonList:w,selectedIDs:b}),()=>{var o;(o=s.current)==null||o.terminate()}},[k,n==null?void 0:n.mappingImgList,L,m,u,w,F,b]);const T=oe(e=>{if(!d)return;const o=()=>{e.stopImmediatePropagation()};switch(e.keyCode){case C.Esc:{y(!1);break}case C.Left:{I();break}case C.Right:{P();break}}o()}),I=()=>{r===void 0||!d||Number(r)>0&&g(r-1)},P=()=>{r===void 0||!d||Number(r)<(a==null?void 0:a.length)-1&&g(r+1)};j(()=>{const e=i=>T.current(i);return x.preappendEventListener(e)},[x,x.preappendEventListener]);const B=!n||!(n==null?void 0:n.mappingImgList)||!(((h=n==null?void 0:n.mappingImgList)==null?void 0:h.length)>0),K=t.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},t.createElement("img",{src:ee,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>I()}),t.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),t.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),t.createElement("img",{src:te,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>P()}),t.createElement("img",{src:Z,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{y(!1),g(void 0)}}),t.createElement("span",null,"\u952E\u9000\u51FA"));return(a==null?void 0:a.length)>0?t.createElement(t.Fragment,null,a.map((e,o)=>{const i=d&&o===r;return t.createElement(D,{className:Y({[_("point-cloud-2d-container")]:!0,[_("point-cloud-container","zoom")]:i}),title:t.createElement(ie,{showEnlarge:i,isEnlargeTopView:c,data:e,setIsEnlarge:y,setCurIndex:g,curIndex:r,index:o,annotations2d:a}),titleOnSurface:!i,style:{display:B?"none":"flex",width:i?"100%":l},key:o,toolbar:K},(e==null?void 0:e.annotations)&&(e==null?void 0:e.url)&&t.createElement(U,{key:e.url,currentData:n,view2dData:e,setSelectedID:A,showEnlarge:i,checkMode:E,measureVisible:p}))})):null};var re=W(Q,null,null,{context:J})(le);export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as m}from"../../utils/dom.js";import{cKeyCode as
|
|
1
|
+
import{getClassName as m}from"../../utils/dom.js";import{cKeyCode as Z,PointCloud as H}from"@labelbee/lb-annotation";import{PointCloudUtils as S,toolStyleConverter as U,EPerspectiveView as E}from"@labelbee/lb-utils";import j from"classnames";import e,{useContext as T,useState as O,useRef as q,useEffect as u,useMemo as G}from"react";import{PointCloudContainer as J}from"./PointCloudLayout.js";import{PointCloudContext as Q}from"./PointCloudContext.js";import{a2MapStateToProps as W}from"../../store/annotation/map.js";import{connect as X}from"react-redux";import{jsonParser as Y}from"../../utils/index.js";import{useSingleBox as $}from"./hooks/useSingleBox.js";import{useSphere as ee}from"./hooks/useSphere.js";import{Switch as te,Tooltip as oe}from"antd";import ne from"../../hooks/useSize.js";import{usePointCloudViews as ie}from"./hooks/usePointCloudViews.js";import{useTranslation as z}from"react-i18next";import{LabelBeeContext as re}from"../../store/ctx.js";import le from"./components/PointCloudSizeSlider/index.js";import ae from"./components/TitleButton/index.js";import{LeftOutlined as se}from"@ant-design/icons";var ce=Object.defineProperty,me=Object.defineProperties,de=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,N=(n,r,l)=>r in n?ce(n,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[r]=l,k=(n,r)=>{for(var l in r||(r={}))ue.call(r,l)&&N(n,l,r[l]);if(D)for(var l of D(r))pe.call(r,l)&&N(n,l,r[l]);return n},ve=(n,r)=>me(n,de(r));const we=Z.default,fe="LABELBEE-POINTCLOUD",_=e.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),p=({perspectiveView:n})=>{const{isActive:r,setTarget3DView:l}=T(_),v=o=>j({[m("point-cloud-3d-view",o)]:!0,active:r});return e.createElement("span",{onClick:()=>{l(E[n])},className:v(n.toLocaleLowerCase())})},R=({isEnlarge:n})=>{const{reset3DView:r,followTopView:l}=T(_),{t:v}=z(),o=e.createElement(e.Fragment,null,e.createElement(p,{perspectiveView:"Top"}),e.createElement(p,{perspectiveView:"Front"}),e.createElement(p,{perspectiveView:"Left"}),e.createElement(p,{perspectiveView:"Back"}),e.createElement(p,{perspectiveView:"Right"}),e.createElement(p,{perspectiveView:"LFT"}),e.createElement(p,{perspectiveView:"RBT"})),g=e.createElement(e.Fragment,null,e.createElement(oe,{title:v("CameraFollowTopView")},e.createElement("span",{onClick:()=>{l()},className:m("point-cloud-3d-view","followTop")})),e.createElement("span",{onClick:()=>{r()},className:m("point-cloud-3d-view","reset")}));return n?e.createElement("div",{className:m("point-cloud-3d-sidebarZoom")},g,o):e.createElement("div",{className:m("point-cloud-3d-sidebar")},o,g)},Ce=({currentData:n,config:r,highlightAttribute:l})=>{var v;const o=T(Q),[g,F]=O(!0),[w,h]=O(!1),f=q(null),{initPointCloud3d:y}=ie(),C=ne(f),{t:I}=z();u(()=>{!o.mainViewInstance||y==null||y(C)},[C]);const{selectedBox:d}=$(),{selectedSphere:P}=ee(),x=t=>{var i,a;const s=d==null?void 0:d.info;if(s){const c=k({},s.center);c.x=c.x-.01,c.z=1e3;const V=t===E.Top;(i=o.mainViewInstance)==null||i.updateCameraByBox(s,t,V?c:void 0)}P&&((a=o.mainViewInstance)==null||a.updateCameraBySphere(P,t))},A=()=>{var t;(t=o.mainViewInstance)==null||t.resetCamera()},K=()=>{var t,i;const a=(t=o.topViewInstance)==null?void 0:t.pointCloudInstance.camera;a&&((i=o.mainViewInstance)==null||i.applyCameraTarget(a))};u(()=>{if(f.current&&(n==null?void 0:n.url)){let t=o.mainViewInstance;!t&&C.width&&(t=new H({container:f.current,isOrthographicCamera:!0,orthographicParams:S.getDefaultOrthographicParams(C),config:r}),o.setMainViewInstance(t))}},[C,n]),u(()=>{var t;if(f.current&&(n==null?void 0:n.url)&&n.result&&o.mainViewInstance){let i=o.mainViewInstance;const a=S.getBoxParamsFromResultList(n.result);a.forEach(c=>{var V;const b=(V=U.getColorFromConfig({attribute:c.attribute},ve(k({},r),{attributeConfigurable:!0}),{}))==null?void 0:V.hex;i==null||i.addBoxToSense(c,b)}),i.render(),o.setPointCloudResult(a);const s=S.getRectParamsFromResultList(n.result);o.setRectList(s),o.setPointCloudValid((t=Y(n.result))==null?void 0:t.valid)}},[n,o.mainViewInstance]),u(()=>{var t,i,a,s,c;if(((t=d==null?void 0:d.info)==null?void 0:t.id)!==void 0){x(E.Top);const b=(s=(a=(i=o.topViewInstance)==null?void 0:i.pointCloudInstance)==null?void 0:a.camera.zoom)!=null?s:1;(c=o.mainViewInstance)==null||c.updateCameraZoom(b)}},[(v=d==null?void 0:d.info)==null?void 0:v.id]),u(()=>{var t,i,a,s;if(P){x(E.Top);const c=(a=(i=(t=o.topViewInstance)==null?void 0:t.pointCloudInstance)==null?void 0:i.camera.zoom)!=null?a:1;(s=o.mainViewInstance)==null||s.updateCameraZoom(c)}},[P]),u(()=>(window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}),[]);const B=t=>{if(t.keyCode===we.Esc){h(!1);return}},L=G(()=>({reset3DView:A,setTarget3DView:x,isActive:!!d,followTopView:K}),[d,o.mainViewInstance]);u(()=>{var t,i,a;const s=o.pointCloudBoxList.filter(c=>c.attribute===l);(s==null?void 0:s.length)>0&&((t=o.mainViewInstance)==null||t.clearHighlightBoxes(),(i=o.mainViewInstance)==null||i.highlightBoxes(s)),s.length===0&&((a=o.mainViewInstance)==null||a.clearHighlightBoxesAndRender())},[l,o.mainViewInstance]);const M=e.createElement(e.Fragment,null,e.createElement(le,{onChange:t=>{var i;(i=o.mainViewInstance)==null||i.updatePointSize({customSize:t})}}),e.createElement("span",{style:{marginRight:8}},I("ShowArrows")),e.createElement(te,{size:"small",checked:g,onChange:t=>{var i;F(t),(i=o.mainViewInstance)==null||i.setShowDirection(t)}}),w&&e.createElement(_.Provider,{value:L},e.createElement(R,{isEnlarge:w})));return e.createElement(J,{className:j({[m("point-cloud-3d-container")]:!0,[m("point-cloud-container","zoom")]:w}),title:w?e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement(se,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{h(!1)}}),I("3DView")):e.createElement(ae,{title:I("3DView"),onClick:()=>{h(!0)}}),toolbar:M},e.createElement("div",{className:m("point-cloud-3d-content")},!w&&e.createElement(_.Provider,{value:L},e.createElement(R,null)),e.createElement("div",{className:m("point-cloud-3d-view"),id:fe,ref:f})))};var Ve=X(W,null,null,{context:re})(Ce);export{Ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudAnnotation as B}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as
|
|
1
|
+
import{PointCloudAnnotation as B}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import c,{useRef as y,useEffect as h}from"react";import{PointCloudContext as k}from"./PointCloudContext.js";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{useSingleBox as V}from"./hooks/useSingleBox.js";import{useSphere as b}from"./hooks/useSphere.js";import{useZoom as S}from"./hooks/useZoom.js";import{SizeInfoForView as E}from"./PointCloudInfos.js";import{connect as I}from"react-redux";import{a2MapStateToProps as T}from"../../store/annotation/map.js";import{usePointCloudViews as D}from"./hooks/usePointCloudViews.js";import N from"../../hooks/useSize.js";import O from"./components/EmptyPage/index.js";import{useTranslation as M}from"react-i18next";import{LabelBeeContext as X}from"../../store/ctx.js";import U from"../../utils/ToolUtils.js";import Z from"./components/TitleButton/index.js";const A=(u,r,a=1)=>{const{width:e,height:o}=r,t={x:u.x+e*a/2,y:u.y+o*a/2},m={x:r.width/2,y:r.height/2};return{offsetX:(m.x-t.x)/a,offsetY:-(m.y-t.y)/a}},g=(u,r,a,e,o)=>{const{offsetX:t,offsetY:m}=A(u,a,r);if(o.camera.zoom=r,u){const d=Math.cos(e),f=Math.sin(e),x=t*d,C=t*f,{x:p,y:n,z:l}=o.initCameraPosition;o.camera.position.set(p+C,n-x,l+m)}o.camera.updateProjectionMatrix(),o.render()},L=({currentData:u,config:r,checkMode:a})=>{const e=c.useContext(k),o=y(null),t=N(o),{selectedBox:m}=V(),{selectedSphere:d}=b(),{syncBackviewToolZoom:f}=S(),{t:x}=M(),{backViewUpdateBox:C,backViewUpdatePoint:p}=D();return h(()=>{if(o.current){const n={width:o.current.clientWidth,height:o.current.clientHeight},l=new B({container:o.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:r,checkMode:a,toolName:U.getPointCloudToolList()});e.setBackViewInstance(l)}},[]),h(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:n,pointCloudInstance:l}=e.backViewInstance;n.singleOn("renderZoom",(i,s)=>{if(e.selectedPointCloudBox){g(s,i,t,e.selectedPointCloudBox.rotation,l),f(s,i,t);return}if(d){g(s,i,t,0,l),f(s,i,t);return}}),n.singleOn("dragMove",({currentPos:i,zoom:s})=>{!e.selectedPointCloudBox&&!d||g(i,s,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,l)}),n.singleOn("updatePointByDrag",(i,s)=>{d&&(p==null||p(i,s[0]))}),n.singleOn("updatePolygonByDrag",i=>{if(e.selectedIDs.length===1&&i.length===1){const{newPolygon:s,originPolygon:P}=i[0];s&&P&&C(s,P)}})},[e,t]),h(()=>{var n;(n=e==null?void 0:e.backViewInstance)==null||n.initSize(t)},[t]),c.createElement(v,{className:w("point-cloud-container","back-view"),title:c.createElement(Z,{title:x("BackView")}),titleOnSurface:!0,titleNonInteractive:!0},c.createElement("div",{className:w("point-cloud-container","bottom-view-content")},c.createElement("div",{className:w("point-cloud-container","core-instance"),ref:o}),!m&&!d&&c.createElement(O,null),c.createElement(E,{perspectiveView:j.Back})))};var Y=I(T,null,null,{context:X})(L);export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudPattern as
|
|
1
|
+
import{EPointCloudPattern as Y}from"@labelbee/lb-utils";import Ne,{useState as r,useRef as dt,useMemo as F,useCallback as N,useEffect as $}from"react";import{EPointCloudBoxRenderTrigger as E,calcResetAreasAndBoxIds as ct}from"../../utils/ToolPointCloudBoxRenderHelper.js";import{ActionsHistory as He,EToolName as ee,uuid as ut}from"@labelbee/lb-annotation";import{useDispatch as gt}from"../../store/ctx.js";import{ChangeSave as pt}from"../../store/annotation/actionCreators.js";import ft from"../../store/annotatedBox/index.js";import Oe from"lodash";import{addMapIndirectWeakSetItem as Me}from"./utils/map.js";import mt from"./hooks/useTimeoutFunc.js";import ht,{getEmptyUseWindowKeydownListener as It}from"./hooks/useWindowKeydownListener.js";var vt=Object.defineProperty,Pt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ke=(d,i,c)=>i in d?vt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c,z=(d,i)=>{for(var c in i||(i={}))yt.call(i,c)&&ke(d,c,i[c]);if(je)for(var c of je(i))Ct.call(i,c)&&ke(d,c,i[c]);return d},Fe=(d,i)=>Pt(d,wt(i)),Rt=(d,i,c)=>new Promise((x,A)=>{var B=g=>{try{w(c.next(g))}catch(L){A(L)}},K=g=>{try{w(c.throw(g))}catch(L){A(L)}},w=g=>g.done?x(g.value):Promise.resolve(g.value).then(B,K);w((c=c.apply(d,i)).next())});const G=d=>Oe.pick(d,["id","attribute","width","height","x","y","imageName"]),Ee=Ne.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 He,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:ee.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:Y.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:d=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:d=>!1,removeRectBySpecifyId:(d,i,c)=>!1,removeRectByPointCloudBoxId:d=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:It()}),St=({children:d})=>{const[i,c]=r([]),[x,A]=r([]),[B,K]=r([]),[w,g]=r([]),[L,ze]=r([]),[v,H]=r([]),[_,T]=r([]),[te,Ge]=r(!0),[oe,Ke]=r(2),[ne,Te]=r(!0),[ie,We]=r(1),[f,se]=r(),[re,le]=r(),[ae,de]=r(),[p,ce]=r(),[ue,Ze]=r(""),[W,Ue]=r(ee.Rect),Z=dt(new He).current,[m,U]=r([]),[ge,qe]=r(""),[q,Je]=r(Y.Detection),[D,pe]=r(void 0),[J,Qe]=r([]),[Q,Xe]=r([]),[fe,Ye]=r(!1),h=ft(),[me,$e]=r({}),et=gt(),tt=o=>{const{imgNode:n,path:t}=o;t&&n&&$e(a=>Fe(z({},a),{[t]:{width:n.width,height:n.height}}))},he=F(()=>v.length===1?v[0]:"",[v]),Ie=ht(),O=N((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return g(u=>{let y=!1;const P=u.filter(j=>{const X=j[a],k=l.has(X)?j.imageName!==o:!0;return k||(y=!0),k});return y?P:u}),!0},[]),ve=N(o=>{const n=i.map(t=>t.id);return O(o,n,"extId")},[i,O]),Pe=N(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:u}=t,y=t.rects.find(P=>P.imageName===o);if(y){const P=Oe.pick(y,["width","height","x","y","imageName"]);return Fe(z({},P),{id:ut(),attribute:l,order:u,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(g(t=>{const a=new Set(t.filter(u=>o===u.imageName).map(u=>u.extId)),l=n.filter(u=>a.has(u.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),we=F(()=>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:u}=l;if(!u){console.warn("Missing image name"),console.trace(l,t);return}Me(n,u,t.id,t)}),n},new Map),[i]),ye=N(o=>{g(n=>o(n,G))},[G]),Ce=F(()=>w.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(Me(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,w),o)},new Map),[w]),{fn:ot}=mt(o=>{H(n=>{const t=o,a=new Set(t);let l=!1;const u=n.filter(y=>{const P=a.has(y);return P||(l=!0),P});return l?u:n})},200),Re=N(o=>{const n=o.map(t=>t.id);c(o),ot(n)},[]),M=F(()=>{const o=i.find(e=>e.id===he),n=e=>{const s=i.concat(e);return Re(s),s},t=e=>{const s=x.concat(e);return A(s),s},a=e=>{Ge(e!==!1)},l=e=>{e===void 0&&H([]),typeof e=="string"&&H([e]),Array.isArray(e)&&H(Array.from(new Set(e)))},u=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},y=e=>{const s=G(e);g(I=>[...I,s])},P=(e,s=!1)=>{const I=G(e);g(C=>C.map(R=>R.id===e.id?s?z(z({},R),I):I:R))},j=e=>{g(s=>s.filter(I=>!e.find(C=>C.id===I.id)))},X=e=>{_.includes(e)?T([]):T([e])},k=()=>{if(W===ee.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},it=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},Se=i.filter(e=>!m.includes(e.attribute)),be=x.filter(e=>!m.includes(e.attribute)),Le=L.filter(e=>e.attribute&&!m.includes(e.attribute)),st=e=>{if(m.includes(e))U(m.filter(s=>s!==e));else{const s=m.concat(e);U(s)}},rt=(e=Se,s=B,I=be,C=Le,R=J)=>{var V;p==null||p.clearAllBox(),p==null||p.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(I),f==null||f.updateLineList(C),p==null||p.generateBoxes(e),p==null||p.generateSpheres(I),(V=D==null?void 0:D.store)==null||V.updateCurrentSegment(R),xe(E.Default,e)},lt=()=>{se(void 0),le(void 0),de(void 0),ce(void 0)},xe=(e,s,I)=>Rt(void 0,null,function*(){var C,R,V;if(!p)return;const De=p.pointCloudObject;if(!De)return;let Ae=[],Be=[];try{if(s&&Z.record.length){const{record:S,recordIndex:b}=Z;let _e=b;b>0&&(e===E.SingleToggleValid||e===E.SingleRotate||e===E.Single&&s.length===((C=S[b])==null?void 0:C.pointCloudBoxList.length))&&(_e=b-1);let at=(R=S[_e])==null?void 0:R.pointCloudBoxList;const Ve=ct(e,s,at);Ae=Ve.modifiedBoxIds,Be=Ve.resetAreas}}catch(S){console.error("call calcResetAreasAndBoxIds error",S)}try{const S=yield p.getHighlightIndexByMappingImgList({mappingImgList:I!=null?I:Q,points:De.geometry.attributes.position.array}),b=yield p==null?void 0:p.highlightOriginPointCloud(s,S,{modifiedBoxIds:Ae,resetAreas:Be});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(S){console.error("call highlightOriginPointCloud error",S)}});return{selectedID:he,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:Se,displaySphereList:be,displayLineList:Le,selectedIDs:v,setPointCloudResult:Re,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:A,valid:te,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:u,addHighlightID:X,selectedAllBoxes:k,topViewInstance:f,setTopViewInstance:se,sideViewInstance:re,setSideViewInstance:le,backViewInstance:ae,setBackViewInstance:de,mainViewInstance:p,setMainViewInstance:ce,polygonList:B,setPolygonList:K,rectList:w,setRectList:g,addRectIn2DView:y,removeRectIn2DView:j,updateRectIn2DView:P,lineList:L,setLineList:ze,zoom:ie,setZoom:We,history:Z,toggleAttributesVisible:st,hideAttributes:m,setHideAttributes:U,reRender:rt,attrPanelLayout:ge,setAttrPanelLayout:qe,syncAllViewPointCloudColor:xe,defaultAttribute:ue,setDefaultAttribute:Ze,pointCloudPattern:W,setPointCloudPattern:Ue,selectSpecAttr:it,globalPattern:q,setGlobalPattern:e=>{q!==e&&(et(pt),Je(e),e===Y.Detection&&pe(void 0))},ptSegmentInstance:D,setPtSegmentInstance:pe,segmentation:J,setSegmentation:Qe,clearAllDetectionInstance:lt,highlight2DDataList:Q,setHighlight2DDataList:Xe,highlight2DLoading:fe,setHighlight2DLoading:Ye,cuboidBoxIn2DView:ne,setCuboidBoxIn2DView:Te,imageSizes:me,cacheImageNodeSize:tt,highlightIDs:_,setHighlightIDs:T,removeRectByPointCloudBoxId:ve,removeRectBySpecifyId:O,addRectFromPointCloudBoxByImageName:Pe,rectRotateSensitivity:oe,setRectRotateSensitivity:Ke,imageNamePointCloudBoxMap:we,linkageImageNameRectMap:Ce,updateRectListByReducer:ye,windowKeydownListenerHook:Ie}},[te,v,i,x,B,L,w,f,re,ae,p,ie,m,ge,ue,W,q,D,J,Q,fe,ne,me,_,ve,O,Pe,oe,we,Ce,ye,Ie]);$(()=>{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,_),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,_]),$(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const nt=()=>{const o=i.filter(l=>m.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 $(()=>{var o,n,t,a;nt(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,m),(a=(t=D==null?void 0:D.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,m)},[m]),Ne.createElement(Ee.Provider,{value:M},d)};export{Ee as PointCloudContext,St as PointCloudProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudUtils as v,EPerspectiveView as k}from"@labelbee/lb-utils";import r,{useState as D,useEffect as N}from"react";import{PointCloudContext as m}from"./PointCloudContext.js";import{UnitUtils as V}from"@labelbee/lb-annotation";import{useSingleBox as $}from"./hooks/useSingleBox.js";import{useTranslation as x}from"react-i18next";var H=Object.defineProperty,U=Object.defineProperties,R=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,S=(o,e,t)=>e in o?H(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,B=(o,e)=>{for(var t in e||(e={}))T.call(e,t)&&S(o,t,e[t]);if(I)for(var t of I(e))K.call(e,t)&&S(o,t,e[t]);return o},F=(o,e)=>U(o,R(e));const a=2,A={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:12},W=({perspectiveView:o})=>{const{pointCloudBoxList:e,selectedID:t}=r.useContext(m),d=e.find(u=>u.id===t),l=x(),{t:s}=l;if(t&&d){const{length:u,width:f,height:i}=v.transferBox2Kitti(d),b=o===k.Back?[{label:s("Width"),value:f},{label:s("Height"),value:i}]:[{label:s("Length"),value:u},{label:s("Height"),value:i}];return r.createElement("div",{style:F(B({position:"absolute"},A),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)"})},b.map((c,n)=>r.createElement("span",{key:n,style:{marginRight:n===0?16:0}},`${c.label}: ${c.value.toFixed(a)}`)))}return null},M=({checkMode:o,config:e,style:t})=>{const d=r.useContext(m),{selectedBox:l}=$(),[s,u]=D([]),f=x(),{t:i,i18n:b}=f,c=t;return N(()=>{var n,g;if(!l)return;const{length:h,width:_,height:y,rotation_y:L}=v.transferBox2Kitti(l.info),{x:P,y:C,z:
|
|
1
|
+
import{PointCloudUtils as v,EPerspectiveView as k}from"@labelbee/lb-utils";import r,{useState as D,useEffect as N}from"react";import{PointCloudContext as m}from"./PointCloudContext.js";import{UnitUtils as V}from"@labelbee/lb-annotation";import{useSingleBox as $}from"./hooks/useSingleBox.js";import{useTranslation as x}from"react-i18next";var H=Object.defineProperty,U=Object.defineProperties,R=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,S=(o,e,t)=>e in o?H(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,B=(o,e)=>{for(var t in e||(e={}))T.call(e,t)&&S(o,t,e[t]);if(I)for(var t of I(e))K.call(e,t)&&S(o,t,e[t]);return o},F=(o,e)=>U(o,R(e));const a=2,A={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:12},W=({perspectiveView:o})=>{const{pointCloudBoxList:e,selectedID:t}=r.useContext(m),d=e.find(u=>u.id===t),l=x(),{t:s}=l;if(t&&d){const{length:u,width:f,height:i}=v.transferBox2Kitti(d),b=o===k.Back?[{label:s("Width"),value:f},{label:s("Height"),value:i}]:[{label:s("Length"),value:u},{label:s("Height"),value:i}];return r.createElement("div",{style:F(B({position:"absolute"},A),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)",pointerEvents:"none"})},b.map((c,n)=>r.createElement("span",{key:n,style:{marginRight:n===0?16:0}},`${c.label}: ${c.value.toFixed(a)}`)))}return null},M=({checkMode:o,config:e,style:t})=>{const d=r.useContext(m),{selectedBox:l}=$(),[s,u]=D([]),f=x(),{t:i,i18n:b}=f,c=t;return N(()=>{var n,g;if(!l)return;const{length:h,width:_,height:y,rotation_y:L}=v.transferBox2Kitti(l.info),{x:P,y:C,z:E}=l.info.center;let p=[{label:"x",value:P==null?void 0:P.toFixed(a)},{label:"y",value:C==null?void 0:C.toFixed(a)},{label:"z",value:E==null?void 0:E.toFixed(a)},{label:i("Length"),value:h==null?void 0:h.toFixed(a)},{label:i("Width"),value:_==null?void 0:_.toFixed(a)},{label:i("Height"),value:y==null?void 0:y.toFixed(a)},{label:i("Rotation_y"),value:(n=V.rad2deg(L))==null?void 0:n.toFixed(a)}];(g=d.mainViewInstance)==null||g.filterPointsByBox(l.info).then(j=>{var w,O;if(!j){u(p);return}p.push({label:i("PointCount"),value:`${(O=(w=l.info)==null?void 0:w.count)!=null?O:0}`}),o===!0&&l.info.subAttribute&&e&&v.getSubAttributeName(l.info.subAttribute,e).forEach(z=>p.push(z)),u(p)})},[l,b.language]),l?r.createElement("div",{style:t||F(B({position:"absolute"},A),{right:8,bottom:8})},s.map(n=>c?r.createElement("div",{key:n.label,style:{margin:"0px 4px"}},`${n.label}: ${n.value}`):r.createElement("div",{key:n.label},r.createElement("span",{style:{width:"38px",display:"inline-block",textAlign:"end"}},n.label),": ",r.createElement("span",null,n.value)))):null},X=()=>{const o=r.useContext(m),{t:e}=x();return o.valid===!1?r.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"}},e("Invalid")):null};export{M as BoxInfos,X as PointCloudValidity,W as SizeInfoForView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as e}from"../../utils/dom.js";import
|
|
1
|
+
import{getClassName as e}from"../../utils/dom.js";import i from"classnames";import a from"react";const m=({title:t,toolbar:n,children:o,className:r,style:c,titleNonInteractive:s,titleOnSurface:l})=>a.createElement("div",{className:i([r,e("point-cloud-container")]),style:c},l?a.createElement("span",{className:e("point-cloud-container","header-title-box"),style:{pointerEvents:s?"none":"auto"}},t):a.createElement("div",{className:e("point-cloud-container","header")},t&&a.createElement("span",{className:e("point-cloud-container","header-title")},t),n&&a.createElement("div",{className:e("point-cloud-container","header-toolbar")},n)),o);export{m as PointCloudContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as
|
|
1
|
+
import{PointCloudContext as re}from"./PointCloudContext.js";import{useRotate as se}from"./hooks/useRotate.js";import{useRotateEdge as ne}from"./hooks/useRotateEdge.js";import{useBoxes as ie}from"./hooks/useBoxes.js";import{useSingleBox as ae}from"./hooks/useSingleBox.js";import{useSphere as ue}from"./hooks/useSphere.js";import{useContext as le,useEffect as d}from"react";import{CommonToolUtils as ce,EPointCloudName as de,AttributeUtils as pe,EToolName as f,cTool as me}from"@labelbee/lb-annotation";import{message as g}from"antd";import{connect as ve}from"react-redux";import{a2MapStateToProps as be}from"../../store/annotation/map.js";import{useStatus as fe}from"./hooks/useStatus.js";import{usePointCloudViews as Pe}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as ye,useDispatch as we}from"../../store/ctx.js";import{useHistory as Ce}from"./hooks/useHistory.js";import{useAttribute as he}from"./hooks/useAttribute.js";import{useConfig as ge}from"./hooks/useConfig.js";import{usePolygon as Se}from"./hooks/usePolygon.js";import{useLine as ke}from"./hooks/useLine.js";import{useTranslation as xe}from"react-i18next";import{PreDataProcess as _e}from"../../store/annotation/actionCreators.js";import{useLatest as A}from"ahooks";var Ve=Object.defineProperty,Le=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,E=(a,r,l)=>r in a?Ve(a,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[r]=l,P=(a,r)=>{for(var l in r||(r={}))Oe.call(r,l)&&E(a,l,r[l]);if(I)for(var l of I(r))je.call(r,l)&&E(a,l,r[l]);return a},y=(a,r)=>Le(a,Be(r));const{EPolygonPattern:Ae}=me,Ie=({currentData:a,config:r,checkMode:l,configString:D,imgIndex:S,toolInstanceRef:u,setResourceLoading:T})=>{const e=le(re),{changeSelectedBoxValid:H,selectNextBox:K,selectPrevBox:N,updateSelectedBox:k,deleteSelectedPointCloudBoxAndPolygon:R}=ae(),{selectedSphere:w,updatePointCloudSphere:U}=ue(),{clearAllResult:C,updatePointCloudPattern:z}=fe(),{copySelectedBoxes:F,pasteSelectedBoxes:q,copiedBoxes:De}=ie({config:r,currentData:a}),{updateRotate:x}=se({currentData:a}),{updateRotateEdge:G}=ne({currentData:a}),{updatePointCloudData:v,topViewSelectedChanged:_}=Pe({setResourceLoading:T}),{redo:V,undo:L,pushHistoryWithList:M,pushHistoryUnderUpdatePolygon:W,pushHistoryUnderUpdateLine:Y}=Ce(),$=we(),{syncThreeViewsAttribute:B}=he(),{syncAllViewsConfig:J,reRenderTopViewRange:Q}=ge(),{selectedPolygon:O}=Se(),{selectedLine:j}=ke(),{t:h}=xe(),X=A(a),b=t=>{var o;const{topViewInstance:s}=e;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(t)},Z=(t,o)=>{var s,i;const{topViewInstance:c,mainViewInstance:n}=e;if(!c)return;const{pointCloud2dOperation:p}=c;switch(t){case"q":{x(e.rectRotateSensitivity);break}case"e":x(-Number(e.rectRotateSensitivity));break;case"g":G(-90);break;case"u":{const m=p.pattern===Ae.Normal?f.Rect:f.Polygon;z(m);const oe={[f.Polygon]:h("PolygonPattern"),[f.Rect]:h("RectPattern")};g.success(h("ChangePatternMsg",{pattern:oe[m]})),p.clearActiveStatus(),p.clearDrawingStatus()}break;case"+":n==null||n.updatePointSize({zoomIn:!0});break;case"-":n==null||n.updatePointSize({zoomIn:!1});break;case"v":e.setPointCloudValid(!e.valid);break;case"tab":if(o.shiftKey){N();break}K(),o.preventDefault();break;case"f":H();break;case"arrowup":b({y:-1});break;case"arrowdown":b({y:1});break;case"arrowleft":b({x:-1});break;case"arrowright":b({x:1});break;case"delete":R(X.current);break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const m=pe.getAttributeByKeycode(o.keyCode,r.attributeList);m!==void 0&&((i=u.current)==null||i.setDefaultAttribute(m))}return}}},ee=(t,o)=>{switch(t){case"c":F();break;case"v":q();break;case"a":o.preventDefault(),e.selectedAllBoxes();break;case"z":{o.shiftKey?V():L();break}}},te=A(t=>{if(!ce.hotkeyFilter(t)||l===!0)return;const o=t.key.toLocaleLowerCase();if(t.ctrlKey){ee(o,t);return}Z(o,t)});return d(()=>{if(!e.topViewInstance)return;const{addEventListener:o}=e.windowKeydownListenerHook;return o(c=>te.current(c))},[e,e.topViewInstance,e.windowKeydownListenerHook]),d(()=>{J(r)},[D]),d(()=>{(r==null?void 0:r.radius)&&Q(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),d(()=>{v==null||v()},[S,e.mainViewInstance]),d(()=>{e.setHideAttributes([])},[S]),d(()=>{u.current.setDefaultAttribute=t=>{var o,s,i,c;B(t);const n=e.selectedPointCloudBox;if(n){n.attribute=t;const p=$(_e({tool:de.PointCloud,dataList:[n],stepConfig:r,action:"viewUpdateBox"}));n.valid=p[0].valid;const m=k(n);(i=(s=(o=e==null?void 0:e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:s.setPolygonValidAndRender)==null||i.call(s,n.id,!0,n.valid),e.mainViewInstance&&_({newSelectedBox:n,newPointCloudList:m})}if(O&&W(y(P({},O),{attribute:t})),j&&Y(y(P({},j),{attribute:t})),w){const p=U(y(P({},w),{attribute:t}));e.mainViewInstance&&((c=e.mainViewInstance)==null||c.generateSpheres(p),_({newSelectedSphere:w,newSphereList:p}))}},u.current.setSubAttribute=(t,o)=>{var s;const i=e.selectedPointCloudBox;if(i){const c=(s=i==null?void 0:i.subAttribute)!=null?s:{};i.subAttribute=y(P({},c),{[t]:o}),k(i)}},u.current.clearResult=()=>{C==null||C()},u.current.redo=()=>{V()},u.current.undo=()=>{L()},u.current.setValid=t=>{u.current.valid=t,setTimeout(()=>{e.setPointCloudValid(t),t===!1&&C()})},u.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)},u.current.setShowDefaultCursor=t=>{var o,s;(s=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(t)},u.current.asyncData=t=>{setTimeout(()=>{v==null||v(t)})}},[e.pointCloudBoxList,e.pointCloudSphereList,e.selectedID,e.valid,e.polygonList,e.lineList,e.mainViewInstance,e.ptSegmentInstance]),d(()=>{u.current.updateSegmentTool=t=>{var o;(o=e.ptSegmentInstance)==null||o.emit(t)},u.current.segmentInstance=e.ptSegmentInstance},[e.ptSegmentInstance]),d(()=>{u.current.history={pushHistory:t=>{M({pointCloudBoxList:t})},initRecord:()=>{}}},[]),d(()=>{var t;const o=(t=e.topViewInstance)==null?void 0:t.toolInstance;if(!o||l)return;const s=n=>{B(n)},i=n=>{g.error(n)},c=n=>{g.info(n)};return o.on("syncAttribute",s),o.on("messageError",i),o.on("messageInfo",c),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",i),o.unbind("messageInfo",c)}},[e.topViewInstance]),null};var Ee=ve(be,null,null,{context:ye})(Ie);export{Ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a2MapStateToProps as
|
|
1
|
+
import{a2MapStateToProps as z}from"../../store/annotation/map.js";import{LabelBeeContext as R}from"../../store/ctx.js";import f,{useContext as V,useRef as m,useState as x,useEffect as v,useCallback as B,useMemo as A}from"react";import W from"../AnnotationView/index.js";import{connect as T}from"react-redux";import{PointCloudContext as U}from"./PointCloudContext.js";import G from"./components/TitleButton/index.js";import{Spin as H}from"antd";import N from"../../_virtual/highlightSegmentWorker.js";import{pointMappingLidar2image as Y}from"@labelbee/lb-annotation";import{debounce as $}from"lodash";var q=Object.defineProperty,J=Object.defineProperties,K=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,k=(t,o,n)=>o in t?q(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,Z=(t,o)=>{for(var n in o||(o={}))Q.call(o,n)&&k(t,n,o[n]);if(D)for(var n of D(o))X.call(o,n)&&k(t,n,o[n]);return t},ee=(t,o)=>J(t,K(o));const te=({path:t,url:o,fallbackUrl:n,calib:c,pcdUrl:s,highlightAttribute:u})=>{const{ptSegmentInstance:e,cacheImageNodeSize:O,imageSizes:E}=V(U),F=m(null),g=m(0),h=m({}),p=m(),[P,_]=x([]),[I,C]=x(!1),S=m(void 0);v(()=>()=>{g.current=0,h.current={},p.current=void 0},[s]);const b=B(()=>{var r,l,i;if(g.current=g.current+1,g.current===2){const a=(r=e==null?void 0:e.store)==null?void 0:r.originPoints;if(!a||!p.current){console.error("cacheMappingPCD2Img Error",{path:t,points:a,filterSize:p.current});return}h.current=(i=(l=Y(a,c,p.current))==null?void 0:l.pcdMapping)!=null?i:{}}},[e]),y=A(()=>$((l,i)=>{var a,w;if(l&&p.current){S.current&&((w=(a=S.current)==null?void 0:a.terminate)==null||w.call(a));const M=h.current,d=new N;d.current=d,C(!0),d.postMessage({cacheMap:M,indexes:l,defaultRGBA:i}),d.onmessage=L=>{_(L.data.annotations),d.terminate(),C(!1),d.current=void 0}}},100),[]);v(()=>{if(!(e==null?void 0:e.store))return;const r=e.store.getHighlightAttribute(u!=null?u:""),l=e==null?void 0:e.getColorFromConfig(u!=null?u:"");y(r.flat(),l.stroke)},[u,e]),v(()=>{if(e){const r=({newAttribute:l})=>{const i=e==null?void 0:e.getColorFromConfig(l);i&&_(P.map(a=>ee(Z({},a),{defaultRGBA:i.stroke})))};return e.on("updateDefaultAttribute",r),()=>{e.unbind("updateDefaultAttribute",r)}}},[e,P]),v(()=>{if(e){const r=l=>{if(l.cacheSegData){const{cacheSegData:i}=l;if(i==null?void 0:i.indexes){const a=e.getColorFromConfig(i.attribute);y(i==null?void 0:i.indexes,a.stroke)}}else _([])};return e.on("syncPointCloudStatus",r),e.on("loadPCDFileEnd",b),()=>{e.unbind("syncPointCloudStatus",r),e.unbind("loadPCDFileEnd",b)}}},[e,s,E]);const j=r=>{O({path:t,imgNode:r}),p.current={width:r.width,height:r.height},b()};return f.createElement("div",{key:t,style:{position:"relative"},ref:F},f.createElement(G,{title:c.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),f.createElement(H,{spinning:I,delay:1e3},f.createElement(W,{size:{width:300,height:200},key:t,src:o,fallbackSrc:n,annotations:P,afterImgOnLoad:j})))},oe=({currentData:t,highlightAttribute:o})=>{var n;const c=(n=t.mappingImgList)!=null?n:[];return(c==null?void 0:c.length)>0?f.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},c==null?void 0:c.map((s,u)=>{var e;return s.calib&&f.createElement(te,{key:s.path+u,path:s.path,url:s.url,fallbackUrl:(e=s.fallbackUrl)!=null?e:"",calib:s.calib,pcdUrl:t.url,highlightAttribute:o})})):null};var ne=T(z,null,null,{context:R})(oe);export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as L,useEffect as r}from"react";import{a2MapStateToProps as x}from"../../store/annotation/map.js";import{connect as y}from"react-redux";import{LabelBeeContext as
|
|
1
|
+
import{useContext as L,useEffect as r}from"react";import{a2MapStateToProps as x}from"../../store/annotation/map.js";import{connect as y}from"react-redux";import{LabelBeeContext as w,useDispatch as P}from"../../store/ctx.js";import{PointCloudContext as h}from"./PointCloudContext.js";import{CommonToolUtils as A}from"@labelbee/lb-annotation";import{PointCloudUtils as j,EPointCloudSegmentMode as S}from"@labelbee/lb-utils";import{useAttribute as D}from"./hooks/useAttribute.js";import{SetAnnotationLoading as v}from"../../store/annotation/actionCreators.js";import{jsonParser as E}from"../../utils/index.js";const _=({checkMode:b,currentData:l,imgIndex:g,highlightAttribute:s,config:B,toolInstanceRef:u,configString:m})=>{const d=P(),{updateSegmentAttribute:C,updateSegmentSubAttribute:f}=D(),n=L(h),{ptSegmentInstance:e,setSegmentation:c}=n;r(()=>{var t;if(e&&l.url)return v(d,!0),e.emit("clearStash"),e.emit("clearAllSegmentData"),e.loadPCDFile((t=l==null?void 0:l.url)!=null?t:"").then(()=>{var o,i;const a=j.getSegmentFromResultList((o=l==null?void 0:l.result)!=null?o:"");(i=e==null?void 0:e.store)==null||i.updateCurrentSegment(a),v(d,!1)}),e.on("syncSegmentData",c),()=>{e.unbind("syncSegmentData",c)}},[g,e]),r(()=>{var t;(t=e==null?void 0:e.store)==null||t.highlightPointsByAttribute(s!=null?s:"")},[s,e]),r(()=>{e==null||e.setConfig(E(m))},[m]);const k=(t,o)=>{var i,a;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",S.Add);break;case"i":e==null||e.emit("setSegmentMode",S.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(a=(i=e.store)==null?void 0:i.cacheSegData)==null?void 0:a.id);break}},p=t=>{if(!A.hotkeyFilter(t)||b===!0)return;const o=t.key.toLocaleLowerCase();k(o)};return r(()=>(window.addEventListener("keydown",p),u.current.setDefaultAttribute=t=>{C(t),e==null||e.emit("updateDefaultAttribute",{newAttribute:t})},u.current.setSubAttribute=(t,o)=>{f(t,o)},()=>{window.removeEventListener("keydown",p)}),[e]),r(()=>{u.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 M=y(x,null,null,{context:w})(_);export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudAnnotation as P}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import
|
|
1
|
+
import{PointCloudAnnotation as P}from"@labelbee/lb-annotation";import{getClassName as w}from"../../utils/dom.js";import{PointCloudContainer as v}from"./PointCloudLayout.js";import m,{useRef as y,useEffect as C}from"react";import{EPerspectiveView as j}from"@labelbee/lb-utils";import{PointCloudContext as B}from"./PointCloudContext.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as S}from"react-redux";import{a2MapStateToProps as b}from"../../store/annotation/map.js";import{usePointCloudViews as E}from"./hooks/usePointCloudViews.js";import{useSingleBox as I}from"./hooks/useSingleBox.js";import{useSphere as T}from"./hooks/useSphere.js";import N from"./components/EmptyPage/index.js";import D from"../../hooks/useSize.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as k}from"../../store/ctx.js";import M from"../../utils/ToolUtils.js";import{useZoom as X}from"./hooks/useZoom.js";import L from"./components/TitleButton/index.js";const U=(c,l,e=1)=>{const{width:f,height:i}=l,d={x:c.x+f*e/2,y:c.y+i*e/2},r={x:l.width/2,y:l.height/2};return{offsetX:(r.x-d.x)/e,offsetY:-(r.y-d.y)/e}},h=(c,l,e,f,i)=>{const{offsetX:d,offsetY:r}=U(c,e,l);if(i.camera.zoom=l,c){const a=Math.cos(f),o=Math.sin(f),x=d*a,p=d*o,{x:n,y:u,z:t}=i.initCameraPosition;i.camera.position.set(n-x,u-p,t+r)}i.camera.updateProjectionMatrix(),i.render()},Z=({config:c,checkMode:l})=>{const e=m.useContext(B),{sideViewUpdateBox:f,sideViewUpdatePoint:i}=E(),{selectedBox:d}=I(),{selectedSphere:r}=T(),a=y(null),o=D(a),{t:x}=O(),{syncSideviewToolZoom:p}=X();return C(()=>{if(a.current){const n={width:a.current.clientWidth,height:a.current.clientHeight},u=new P({container:a.current,size:n,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:c,checkMode:l,toolName:M.getPointCloudToolList()});e.setSideViewInstance(u)}},[]),C(()=>{if(!o||!e.sideViewInstance)return;const{toolInstance:n,pointCloudInstance:u}=e.sideViewInstance;n.singleOn("renderZoom",(t,s)=>{if(e.selectedPointCloudBox){h(s,t,o,e.selectedPointCloudBox.rotation,u),p(s,t,o);return}r&&(h(s,t,o,0,u),p(s,t,o))}),n.singleOn("dragMove",({currentPos:t,zoom:s})=>{!e.selectedPointCloudBox&&!r||h(t,s,o,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,u)}),n.singleOn("updatePointByDrag",(t,s)=>{r&&(i==null||i(t,s[0]))}),n.singleOn("updatePolygonByDrag",t=>{if(e.selectedIDs.length===1&&t.length===1){const{newPolygon:s,originPolygon:g}=t[0];f(s,g)}})},[e,o]),C(()=>{var n;(n=e==null?void 0:e.sideViewInstance)==null||n.initSize(o)},[o]),m.createElement(v,{className:w("point-cloud-container","side-view"),title:m.createElement(L,{title:x("SideView")}),titleOnSurface:!0,titleNonInteractive:!0},m.createElement("div",{className:w("point-cloud-container","bottom-view-content")},m.createElement("div",{className:w("point-cloud-container","core-instance"),ref:a}),!d&&!r&&m.createElement(N,null),m.createElement(V,{perspectiveView:j.Left})))};var A=S(b,null,null,{context:k})(Z);export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as I}from"../../utils/dom.js";import{FooterDivider as z}from"../../views/MainView/toolFooter/index.js";import{ZoomController as ae}from"../../views/MainView/toolFooter/ZoomController/index.js";import{LeftOutlined as de,UpSquareOutlined as ce,DownSquareOutlined as pe}from"@ant-design/icons";import{cKeyCode as ue,PointCloudAnnotation as me,cTool as fe,cAnnotation as ve}from"@labelbee/lb-annotation";import{PointCloudUtils as H}from"@labelbee/lb-utils";import{EPointCloudBoxRenderTrigger as we}from"../../utils/ToolPointCloudBoxRenderHelper.js";import i,{useState as W,useRef as Ce,useLayoutEffect as ge,useEffect as x}from"react";import{PointCloudContext as F}from"./PointCloudContext.js";import{useRotate as Pe}from"./hooks/useRotate.js";import{useRotateEdge as ye}from"./hooks/useRotateEdge.js";import{useSingleBox as K}from"./hooks/useSingleBox.js";import{PointCloudContainer as Ie}from"./PointCloudLayout.js";import{BoxInfos as X,PointCloudValidity as xe}from"./PointCloudInfos.js";import{usePolygon as he}from"./hooks/usePolygon.js";import{useSphere as Y}from"./hooks/useSphere.js";import{useZoom as q}from"./hooks/useZoom.js";import{Slider as Ve}from"antd";import{a2MapStateToProps as Se}from"../../store/annotation/map.js";import{connect as _e}from"react-redux";import{usePointCloudViews as Ee}from"./hooks/usePointCloudViews.js";import Le from"../../hooks/useSize.js";import{useTranslation as Oe}from"react-i18next";import{LabelBeeContext as be}from"../../store/ctx.js";import{jsonParser as je}from"../../utils/index.js";import Te from"../../utils/ToolUtils.js";import ke from"lodash";import Re from"./components/PointCloudSizeSlider/index.js";import{useHistory as Ae}from"./hooks/useHistory.js";import Be from"./components/TitleButton/index.js";var Ne=Object.defineProperty,De=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,$=(n,l,r)=>l in n?Ne(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r,N=(n,l)=>{for(var r in l||(l={}))Ze.call(l,r)&&$(n,r,l[r]);if(M)for(var r of M(l))ze.call(l,r)&&$(n,r,l[r]);return n},D=(n,l)=>De(n,Ue(l));const{EPolygonPattern:He,EToolName:G}=fe,{ESortDirection:J}=ve,We=ue.default,Q=(n,l,r=1)=>{const{width:w,height:u}=l,P={x:n.x+w*r/2,y:n.y+u*r/2},y={x:l.width/2,y:l.height/2};return{offsetX:(y.x-P.x)/r,offsetY:-(y.y-P.y)/r}},Fe=({currentData:n})=>{var l,r;const{zoom:w,zoomIn:u,zoomOut:P,initialPosition:y}=q(),{selectNextBox:E,selectPrevBox:L}=K(),{switchToNextSphere:h}=Y(),{updateRotate:V}=Pe({currentData:n}),{updateRotateEdge:O}=ye({currentData:n}),g=i.useContext(F),{topViewInstance:S}=g,m=(r=(l=g==null?void 0:g.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:r.getCurrentToolName(),e=()=>{V(-Number(g.rectRotateSensitivity))},d=()=>{V(g.rectRotateSensitivity)},f=()=>{O(-90)};return i.createElement(i.Fragment,null,i.createElement(Re,{onChange:b=>{var _;(_=S==null?void 0:S.pointCloudInstance)==null||_.updatePointSize({customSize:b})}}),i.createElement("span",{onClick:d,className:I("point-cloud","rotate-reserve")}),i.createElement("span",{onClick:e,className:I("point-cloud","rotate")}),i.createElement("span",{onClick:f,className:I("point-cloud","rotate-90")}),i.createElement(z,null),i.createElement(ce,{onClick:()=>{if(m===G.Point){h(J.descend);return}L(!0)},className:I("point-cloud","prev")}),i.createElement(pe,{onClick:()=>{if(m===G.Point){h(J.ascend);return}E(!0)},className:I("point-cloud","next")}),i.createElement(z,null),i.createElement(ae,{initialPosition:y,zoomIn:u,zoomOut:P,zoom:w}))},Ke=({setZAxisLimit:n,zAxisLimit:l,checkMode:r})=>r?null:i.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},i.createElement(Ve,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:w=>{n(w)}})),Xe=({currentData:n,imgList:l,stepInfo:r,drawLayerSlot:w,checkMode:u,intelligentFit:P,setIsEnlargeTopView:y,isEnlargeTopView:E,onExitZoom:L,highlightAttribute:h})=>{var V,O;const[g,S]=W({zoom:1,currentPos:{x:0,y:0}}),m=Ce(null),e=i.useContext(F),d=Le(m),f=je(r.config),{setZoom:b,syncTopviewToolZoom:_}=q(),{hideAttributes:ee}=e,{addPolygon:te,deletePolygon:oe}=he(),{deletePointCloudSphere:ne}=Y(),{deletePointCloudBox:ie,changeValidByID:se}=K(),[j,le]=W(10),{t:U}=Oe(),C=Ee(),{pushHistoryWithList:re}=Ae();ge(()=>{if(!e.topViewInstance&&m.current&&(n==null?void 0:n.url)&&(n==null?void 0:n.result)){const o={width:m.current.clientWidth,height:m.current.clientHeight},a=new me({container:m.current,size:o,pcdPath:n.url,config:D(N({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:u,toolName:Te.getPointCloudToolList(),proxyMode:u});e.setTopViewInstance(a)}},[n]),x(()=>{if(!d||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:o}=e.topViewInstance;o.singleOn("dataUpdated",(t,s)=>{const p=ke.cloneDeep(t).map(c=>D(N({},c),{pointList:H.pointListTransferCanvas2World(c.pointList,d)}));e.setSelectedIDs(s),e.setLineList(p),re({lineList:p})}),o.singleOn("pointCreated",(t,s)=>{C.topViewAddSphere({newPoint:t,size:d,trackConfigurable:f.trackConfigurable,zoom:s})}),o.singleOn("pointDeleted",t=>{ne(t)}),o.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),o.singleOn("updatePointByDrag",(t,s)=>{var p;(p=C.topViewUpdatePoint)==null||p.call(C,t,d)}),o.singleOn("polygonCreated",(t,s)=>{if(o.pattern===He.Normal||!(n==null?void 0:n.url)){const p=D(N({},t),{pointList:t.pointList.map(c=>H.transferCanvas2World(c,d))});te(p),e.setSelectedIDs(ee.includes(t.attribute)?"":t.id);return}C.topViewAddBox({polygon:t,size:d,imgList:l,trackConfigurable:f.trackConfigurable,zoom:s,intelligentFit:P})}),o.singleOn("deletedObject",({id:t})=>{ie(t),oe(t)}),o.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),o.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),o.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),o.singleOn("updatePolygonByDrag",t=>{var s;(s=C.topViewUpdateBox)==null||s.call(C,t,d)});const a=t=>{var s;const p=se(t);p&&e.syncAllViewPointCloudColor(we.Default,p),e.polygonList.find(c=>c.id===t)&&((s=e.topViewInstance)==null||s.toolInstance.setPolygonValidAndRender(t,!0))};return o.on("validUpdate",a),()=>{o.unbind("validUpdate",a)}},[e,d,n,C,e.polygonList,e.lineList,(V=e.topViewInstance)==null?void 0:V.toolInstance]),x(()=>{var o,a;if(!(d==null?void 0:d.width)||!e.topViewInstance)return;const t=(a=(o=f==null?void 0:f.attributeList)==null?void 0:o[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(d),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:s,toolInstance:p}}=e;p.singleOn("renderZoom",(c,v)=>{const{offsetX:T,offsetY:k}=Q(v,d,c);if(s.camera.zoom=c,v){const{x:R,y:A,z:B}=s.initCameraPosition;s.camera.position.set(R+k,A-T,B)}s.camera.updateProjectionMatrix(),s.render(),b(c),_(v,c,d),S({zoom:c,currentPos:v})}),p.singleOn("dragMove",({currentPos:c,zoom:v})=>{const{offsetX:T,offsetY:k}=Q(c,d,v);s.camera.zoom=v;const{x:R,y:A,z:B}=s.initCameraPosition;s.camera.position.set(R+k,A-T,B),s.render(),_(c,v,d),S({zoom:v,currentPos:c})})},[d,e.topViewInstance,(O=e.topViewInstance)==null?void 0:O.toolInstance]),x(()=>{var o,a;(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null||a.applyZAxisPoints(j)},[j]),x(()=>{var o,a,t,s;C.topViewSelectedChanged({}),(s=(t=(a=(o=e.topViewInstance)==null?void 0:o.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||s.call(t,e.selectedIDs)},[e.selectedIDs]),x(()=>(window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}),[]);const Z=o=>{const{keyCode:a}=o;a===We.Esc&&L()};return x(()=>{var o,a,t;(t=(a=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,h)},[e.topViewInstance,h]),i.createElement(Ie,{className:I("point-cloud-container","top-view"),title:E?i.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},i.createElement(de,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{L()}}),i.createElement("span",null,U("TopView")),i.createElement(X,{checkMode:u,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):i.createElement(Be,{title:U("TopView"),onClick:()=>{y(!0)}}),toolbar:i.createElement(Fe,{currentData:n})},i.createElement("div",{style:{position:"relative",flex:1}},i.createElement("div",{style:{width:"100%",height:"100%"},ref:m},w==null?void 0:w(g)),!E&&i.createElement(X,{checkMode:u,config:f}),i.createElement(Ke,{checkMode:u,zAxisLimit:j,setZAxisLimit:le}),i.createElement(xe,null)))};var Ye=_e(Se,null,null,{context:be})(Xe);export{Ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"react";import{EyeFilled as f,EyeInvisibleFilled as g,LoadingOutlined as m}from"@ant-design/icons";import{getClassName as _}from"../../../../utils/dom.js";var b=Object.defineProperty,s=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,c=(t,e,r)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d=(t,e)=>{for(var r in e||(e={}))y.call(e,r)&&c(t,r,e[r]);if(s)for(var r of s(e))O.call(e,r)&&c(t,r,e[r]);return t};const h=({visible:t,style:e,onClick:r,loading:a,disabled:o})=>{const l={background:"rgba(0, 0, 0, 0.74)",color:"white",borderRadius:2,padding:6,fontSize:16},p={background:"rgba(0, 0, 0, 0.2)",color:"rgba(255, 255, 255, 0.5)",cursor:"not-allowed"};let i=t?f:g;a&&(i=m,Object.assign(l,{borderRadius:100}));const n=d(d({},l),e);return o&&Object.assign(n,p),u.createElement(i,{disabled:o,className:_("point-cloud-highlight-view"),style:n,onClick:a||o?()=>{}:r})};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as E,useState as T,useMemo as k,useCallback as O}from"react";import N from"lodash";import{message as v}from"antd";import{usePointCloudViews as H}from"./usePointCloudViews.js";import{PointCloudContext as V}from"../PointCloudContext.js";import{useTranslation as A}from"react-i18next";import{EPointCloudBoxRenderTrigger as U}from"../../../utils/ToolPointCloudBoxRenderHelper.js";import z from"../../../utils/AnnotationDataUtils.js";import{uuid as L}from"@labelbee/lb-annotation";import{useHistory as X}from"./useHistory.js";import{generatePointCloudBoxRects as Y}from"../../../utils/index.js";var W=Object.defineProperty,q=Object.defineProperties,F=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,j=(o,t,e)=>t in o?W(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,M=(o,t)=>{for(var e in t||(t={}))G.call(t,e)&&j(o,e,t[e]);if(b)for(var e of b(t))J.call(t,e)&&j(o,e,t[e]);return o},B=(o,t)=>q(o,F(t));const K=(o,t=[],e=[])=>{const{rects:p=[]}=o,s=p.map(i=>{var m;return B(M({},i),{imageName:(m=z.getNextPath({prePath:i.imageName,preMappingImgList:e,nextMappingImgList:t}))!=null?m:""})}).filter(i=>i.imageName!=="");return B(M({},o),{rects:s})},Q=(o,t)=>{const e=new Set(o.map(i=>i.trackID||0));let p=Math.max(...e,0);const s=.2;return t.map((i,m)=>{const{width:_,height:u,center:g,rotation:n,trackID:f=0}=i,{x,y:P,z:h}=g,c=_*s,C=u*s,y=c*Math.cos(n)-C*Math.sin(n),r=c*Math.sin(n)+C*Math.cos(n),l=x-Math.abs(y),I=P-Math.abs(r);let d=f;return e.has(f)?d=++p:p=Math.max(p,d),e.add(d),B(M({},i),{id:L(),uuid:L(),center:{x:l,y:I,z:h},trackID:d})})},Z=({config:o,currentData:t})=>{const{selectedIDs:e,pointCloudBoxList:p,displayPointCloudList:s,setPointCloudResult:i,syncAllViewPointCloudColor:m,imageSizes:_}=E(V),[u,g]=T({copiedBoxes:[],copiedMappingImgList:[]}),{copiedBoxes:n}=u,{pointCloudBoxListUpdated:f}=H(),{t:x,i18n:P}=A(),{pushHistoryWithList:h}=X(),c=k(()=>s.filter(r=>e.includes(r.id)),[e,s]),C=O(()=>{var r;if(c.length>0){const l=(r=t==null?void 0:t.mappingImgList)!=null?r:[];g({copiedBoxes:N.cloneDeep(c),copiedMappingImgList:l})}else g({copiedBoxes:[],copiedMappingImgList:[]}),v.error(x("CopyEmptyInPointCloud"));v.success(x("CopySuccess"))},[e,s,P.language,t]),y=O(()=>{var r,l;if(n.length===0){v.error(x("PasteEmptyInPointCloud"));return}const I=(r=t==null?void 0:t.mappingImgList)!=null?r:[],d=(l=u==null?void 0:u.copiedMappingImgList)!=null?l:[],R=n.map(a=>K(a,I,d)),w=Q(s,R),S=a=>{i(a),f==null||f(a),g({copiedBoxes:[],copiedMappingImgList:[]}),h({pointCloudBoxList:a}),m(U.MultiPaste,a)};w.forEach(a=>Y({pointCloudBox:a,mappingImgList:I,imageSizes:_}));const D=[...s,...w];S(D)},[n,s,P.language,t]);return{copySelectedBoxes:C,pasteSelectedBoxes:y,copiedBoxes:n,selectedBoxes:c}};export{Z as useBoxes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import v,{useState as T,useContext as p,useCallback as B,useMemo as h,useEffect as C}from"react";import{useLatest as s}from"ahooks";import{PointCloudContext as y}from"../PointCloudContext.js";import U from"../../../assets/annotation/icon_link.svg.js";import $ from"../../../assets/annotation/icon_unlink.svg.js";import{EventBusEvent as L}from"../../../views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js";import{EventBus as M}from"@labelbee/lb-annotation";import{useSyncRectPositionDimensionToPointCloudList as q}from"./usePointCloudViews.js";const A=e=>{const{imageNamePointCloudBoxMap:o,linkageImageNameRectMap:m}=p(y),r=h(()=>e?o.has(e):(console.error("Missing image name"),!1),[e,o]),d=h(()=>{var a,f;return e?((f=(a=m.get(e))==null?void 0:a.size)!=null?f:0)>0:!1},[m,e]),g=h(()=>r||d,[r,d]),I=s(g);return{visible:g,visibleRef:I}},N={width:16,height:16},G=e=>{e.imageName||console.warn("missing imageName");const[o,m]=T(!0),r=s(e.imageName),{addRectFromPointCloudBoxByImageName:d,removeRectByPointCloudBoxId:g,linkageImageNameRectMap:I,pointCloudBoxList:a,rectList:f,updateRectListByReducer:P}=p(y),{visible:R,visibleRef:D}=A(e.imageName),{syncToPointCloudBoxList:E}=q(),S=s(d),_=s(g),V=s(()=>E()),w=B(n=>{if(!D.current)return;const t=r.current;if(!t){console.warn("invalid image name");return}m(n),n?_.current(t):S.current(t)},[]),j=s(n=>{n&&V.current(),w(n)}),z=h(()=>{var n;if(!e.is2DView||!R)return null;const i={zIndex:(n=e.zIndex)!=null?n: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 v.createElement("div",{style:i},o&&v.createElement("img",{src:U,style:N}),!o&&v.createElement("img",{src:$,style:N}))},[o,e.is2DView,e.zIndex,R]),F=s(I),k=B(()=>{var n,t;if(!e.is2DView)return;const i=r.current;if(!i){console.warn("invalid image name");return}const c=[...(t=(n=F.current.get(i))==null?void 0:n.keys())!=null?t:[]];let l=!0;c.length&&(l=!1),w(l)},[e.is2DView,w]);return C(()=>{k()},[k,a,f]),C(()=>{const n=a.map(i=>i.id),t=new Set(n);P((i,x)=>{const c=[],l=[];return i.forEach(u=>{const b=u.extId;b!==void 0&&t.has(b)===!1?c.push(u):l.push(u)}),c.length?[...c.map(u=>x(u)),...l]:i})},[a]),C(()=>{const n=t=>{j.current(t)};return M.on(L.switchConnect,n),()=>M.unbind(L.switchConnect,n)},[]),{rendered:z,isLinking:o}};export{G as default};
|