@labelbee/lb-components 1.23.0-alpha.9 → 1.23.0-alpha.90
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/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/NLPToolView/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/dist/components/audioPlayer/useAudioSegment/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/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/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 +140 -17
- 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/types/App.d.ts +5 -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/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/components/HighlightVisible/index.d.ts +2 -1
- 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 +8 -0
- 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/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 +7 -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 +3 -2
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- 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/GeneralOperation/index.d.ts +2 -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/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- 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/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/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/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/NLPToolView/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/es/components/audioPlayer/useAudioSegment/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/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/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 +140 -17
- 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/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/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- 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/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/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 +5 -3
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),getWebPcm2Wac=require("../audioAnnotate/utils/getWebPcm2Wac.js"),_=require("lodash"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),index$a=require("../invalidPage/index.js"),index$5=require("../imageError/index.js"),index$9=require("../../utils/index.js"),index$c=require("../videoPlayer/components/SpeedController/index.js"),WaveSurfer=require("@labelbee/wavesurfer"),Region=require("@labelbee/wavesurfer/dist/plugin/wavesurfer.regions.js"),Cursor=require("@labelbee/wavesurfer/dist/plugin/wavesurfer.cursor.js"),index$d=require("./zoomSlider/index.js"),index$e=require("./labelDisplayToggle/index.js"),index$f=require("./clipRegion/index.js"),index=require("../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks"),index$1=require("./useAudioScroll/index.js"),index_module=require("./index.module.scss.js"),audio=require("../../utils/audio.js"),index$b=require("./progressDot/index.js"),index$6=require("./clipTip/index.js"),index$4=require("./useSwitchHotkey/index.js"),index$2=require("./useAudioCombine/index.js"),index$3=require("./useAudioSegment/index.js"),index$7=require("./combineTip/index.js"),index$8=require("./segmentTip/index.js"),index$g=require("../../views/MainView/toolFooter/index.js"),utils=require("../videoPlayer/utils.js");function _interopDefaultLegacy(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),WaveSurfer__default=_interopDefaultLegacy(WaveSurfer),Region__default=_interopDefaultLegacy(Region),Cursor__default=_interopDefaultLegacy(Cursor),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(s,l,u)=>l in s?__defProp(s,l,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[l]=u,__spreadValues=(s,l)=>{for(var u in l||(l={}))__hasOwnProp.call(l,u)&&__defNormalProp(s,u,l[u]);if(__getOwnPropSymbols)for(var u of __getOwnPropSymbols(l))__propIsEnum.call(l,u)&&__defNormalProp(s,u,l[u]);return s},__spreadProps=(s,l)=>__defProps(s,__getOwnPropDescs(l));const{EToolName}=lbAnnotation.cTool,EKeyCode=lbAnnotation.cKeyCode.default,PER_PROGRESS=.1,AudioPlayerContext=React__default.default.createContext({count:0,isEdit:!1,toolName:EToolName.Empty,imgIndex:0}),AudioPlayer=({fileData:s={},onLoaded:l,context:u,invalid:$e,height:Ie,hideError:Le,onError:te,updateRegion:x,removeRegion:B,regions:C=[],activeToolPanel:Oe,clipConfigurable:Ne,clipTextConfigurable:We,clipAttributeList:Fe,clipAttributeConfigurable:re,isCheck:E,hoverRegionId:I,footer:ze,drawLayerSlot:ne})=>{var oe,ie;const{url:M,path:ae}=s,[L,O]=React.useState(!1),[le,se]=React.useState(!1),[R,He]=React.useState(0),[Ue,ue]=React.useState(!1),[D,de]=React.useState(0),o=React.useRef(null),S=React.useRef(null),ce=React.useRef(R),N=e=>{ce.current=e,He(e)},[ve,Xe]=React.useState(0),[k,Ze]=React.useState(1),W=React.useRef(null),[fe,Ke]=React.useState({}),{audioClipState:F,setAudioClipState:A}=index.useAudioClipStore(),[z,H]=React.useState(!1),d=ahooks.useLatest(F),me=ahooks.useLatest(fe),Ve=ahooks.useLatest(L),w=ahooks.useLatest(C),pe=ahooks.useUpdate(),[ge,Ge]=React.useState([]),[_e,Ye]=React.useState({}),Je=_.debounce(()=>{lbAnnotation.EventBus.emit("audioZoom")},500),be=e=>{e<index$d.audioZoomInfo.min||e>index$d.audioZoomInfo.max||(Ze(e),audio.dispatchResizeEvent(),Je())};index$1({container:W.current,target:document.querySelector(`[data-id=${(ie=(oe=d.current)==null?void 0:oe.selectedRegion)==null?void 0:ie.id}]`),clipping:z,zoom:k,zoomHandler:be});const $=()=>{let e=w.current;const{attributeLockList:r}=d.current;r.length&&(e=e.filter(t=>r.includes(t.attribute))),X(),e.forEach(t=>{var n;(n=o.current)==null||n.addRegion(__spreadProps(__spreadValues({},t),{drag:!E,resize:!E,color:"rgba(0, 0, 0, 0)"}))}),pe()},v=e=>{var r,t,n,i,a,f,g;const{id:c,loop:m=!0,playImmediately:y=!1}=e;if(c){const T=(n=(t=(r=o.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?n:{};Object.entries(T).forEach(([,p])=>{const{id:P}=p;c===P?p.select():p.cancelSelect()}),A({selectedRegion:{id:c,loop:m},selectedAttribute:(f=(a=(i=w.current)==null?void 0:i.find(p=>p.id===c))==null?void 0:a.attribute)!=null?f:""}),m&&y&&((g=q(c))==null||g.playLoop())}else A({selectedRegion:{}})},{combineInstance:Qe}=index$2({waveRef:o,sortByStartRegions:ge,regionMap:_e,updateRegion:x,removeRegion:B,generateRegions:$,setSelectedRegion:v}),{segmentInstance:et,onRegionMouseMove:tt,segmentTimeTip:rt}=index$3({waveRef:o,regionMap:_e,updateRegion:x,removeRegion:B,generateRegions:$,setSelectedRegion:v}),ye={clipTextConfigurable:We,clipAttributeList:Fe,clipAttributeConfigurable:re,clipConfigurable:Ne};React.useEffect(()=>{A({selectedAttribute:""})},[re]),React.useEffect(()=>{U()},[F.selectedAttribute]),React.useEffect(()=>{$()},[F.attributeLockList]),ahooks.useDeepCompareEffect(()=>{A(ye),setTimeout(()=>{Ee()})},[ye]),ahooks.useDeepCompareEffect(()=>{Ge(_.sortBy(C,["start"])),Ye(C.reduce((e,r)=>{const{id:t}=r;return __spreadProps(__spreadValues({},e),{[t]:r})},{}))},[C]),React.useEffect(()=>{if(I){const e=Ve.current;v({id:I,loop:e,playImmediately:!0})}else v({})},[I]);const Ee=()=>{var e,r;d.current.clipConfigurable?(!E&&o.current&&((e=o.current)==null||e.enableDragSelection({slop:5})),$()):((r=o.current)==null||r.disableDragSelection(),X()),U()},U=()=>{var e,r,t,n,i;let a="";d.current.clipConfigurable?a=audio.getAttributeColor(d.current.selectedAttribute,(e=d.current.clipAttributeList)!=null?e:[]):a="transparent",((t=(r=o==null?void 0:o.current)==null?void 0:r.cursor)==null?void 0:t.cursor)&&((i=(n=o==null?void 0:o.current)==null?void 0:n.cursor)==null||i.setStyle({border:`2px dashed ${a}`}))},q=e=>{var r,t,n;return((n=(t=(r=o.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?n:{})[e]},Re=()=>{var e,r;if(M){const t=((r=(e=ae==null?void 0:ae.split("."))==null?void 0:e.pop())==null?void 0:r.toLowerCase())==="pcm";ue(!1),t?getWebPcm2Wac.getWebPcm2WavBase64(M).then(n=>{Se(n)}):Se(M)}},Se=e=>{var r;e&&(se(!0),N(0),de(0),(r=o==null?void 0:o.current)==null||r.load(e))},X=()=>{var e;(e=o.current)==null||e.clearRegions()},Z=e=>{const r=q(e);r&&(H(!1),r==null||r.remove(),B==null||B(e),v({}))},{run:he}=ahooks.useThrottleFn(v,{wait:500});index$4({sortByStartRegions:ge,setSelectedRegion:v});const nt=e=>{const{start:r,end:t}=me.current;return(r||t)&&e.update(me.current),e},ot=({action:e,id:r,eventDownTime:t})=>{var n,i;if(!d.current.clipConfigurable)return;r&&v({id:r});const a=q((r!=null?r:(n=d.current.selectedRegion)==null?void 0:n.id)||""),f=[];(e==="create"?w.current:(i=w.current)==null?void 0:i.filter(m=>m.id!==a.id)).forEach(m=>{const{start:y,end:T,attribute:p}=m;p===d.current.selectedAttribute&&[y,T].forEach(P=>{f.includes(P)||f.push(P)})});const c=audio.getCanMoveRange(f.sort((m,y)=>m-y),t);o.current.range=c},it=e=>{U(),setTimeout(()=>{H(!1)});const r=nt(e),{id:t,start:n,end:i}=r;v({id:t,playImmediately:!0});const a={id:t,start:utils.decimalReserved(n,3),end:utils.decimalReserved(i,3)};x==null||x(a),pe()},at=()=>{const e=WaveSurfer__default.default.create({container:"#waveform",waveColor:"#999",progressColor:"#999",height:Ie||245,normalize:!0,cursorWidth:2,cursorColor:"white",responsive:0,hideScrollbar:!0,plugins:[Region__default.default.create({regions:C,dragSelection:{slop:5},canMove:!1}),Cursor__default.default.create({opacity:1,customStyle:{border:"2px dashed transparent"}})]}),r=()=>{var t;N(((t=o==null?void 0:o.current)==null?void 0:t.getCurrentTime())||0)};e.on("ready",()=>{var t;const n=((t=o==null?void 0:o.current)==null?void 0:t.getDuration())||0;de(n),r(),l==null||l({duration:Math.round(n)}),se(!1),j(),lbAnnotation.EventBus.on("setCurrentTimeByPosition",V),lbAnnotation.EventBus.on("clearRegions",X),lbAnnotation.EventBus.on("removeRegionById",Z),lbAnnotation.EventBus.on("setSelectedRegion",he),e.on("regions-eventDown",ot),Ee()}),e.on("audioprocess",()=>{r()}),e.on("play",()=>{O(!0)}),e.on("pause",()=>{O(!1)}),e.on("finish",()=>{O(!1)}),e.on("seek",()=>{r()}),e.on("error",()=>{ue(!0),l==null||l({hasError:!0}),te==null||te()}),e.on("region-created",t=>{const{id:n,start:i,end:a}=t;if(w.current.find(g=>g.id===n))return;const f={id:n,start:utils.decimalReserved(i,3),end:utils.decimalReserved(a,3),attribute:d.current.selectedAttribute,text:""};x==null||x(f)}),e.on("region-updated",(t,n)=>{var i,a,f,g,c,m,y,T,p,P;const je=n==null?void 0:n.action;A({combined:!1,segment:!1}),je==="resize"&&((a=(i=o==null?void 0:o.current)==null?void 0:i.cursor)==null||a.setStyle({borderStyle:"solid"})),je==="drag"&&((g=(f=o==null?void 0:o.current)==null?void 0:f.cursor)==null||g.setStyle({borderColor:"transparent"}));const G={},Y=[],J={},bt=(c=w.current)==null?void 0:c.filter(b=>b.id!==t.id),yt=(T=(y=(m=o.current)==null?void 0:m.regions)==null?void 0:y.list)!=null?T:{};bt.forEach(b=>{var Me,De;const{element:Q}=(Me=yt[b.id])!=null?Me:{},{start:St,end:ht}=b;if(Q){const{x:ke,width:Pt}=((De=Q.getBoundingClientRect)==null?void 0:De.call(Q))||{},xt=ke+Pt;[ke,xt].forEach((ee,Ct)=>{Y.includes(ee)||(Y.push(ee),J[ee]=Ct===0?St:ht)})}});const{x:Be,width:Et}=((P=(p=t.element).getBoundingClientRect)==null?void 0:P.call(p))||{},Rt=Be+Et;Y.forEach(b=>{Math.abs(audio.precisionMinus(b,Be))<5&&(G.start=J[b]),Math.abs(audio.precisionMinus(b,Rt))<5&&(G.end=J[b])}),Ke(G),he({id:t.id}),H(!0)}),e.on("region-update-end",t=>{it(t)}),e.on("region-contextmenu",(t,n)=>{if(!E){if(n.preventDefault(),n.stopPropagation(),audio.isDoubleClick(n)){Z(t.id);return}v({id:t.id,playImmediately:!0})}}),e.on("region-click",(t,n,i)=>{if(!E){if(n.preventDefault(),n.stopPropagation(),d.current.combined){Qe(t);return}if(d.current.segment){et(t,i);return}v({id:t.id,playImmediately:!0})}}),e.on("region-mousemove",tt),o.current=e},lt=L?React__default.default.createElement(icons.PauseOutlined,null):React__default.default.createElement(icons.CaretRightOutlined,null),Pe=e=>e?`${parseFloat((e/D*100).toFixed(4))}%`:"0%",xe=Pe(R),st=Pe(ve),h=()=>{if(!le)return o==null?void 0:o.current},ut=()=>{var e;(e=h())==null||e.skipForward(PER_PROGRESS)},dt=()=>{var e;(e=h())==null||e.skipBackward(PER_PROGRESS)},j=()=>{var e;(e=h())==null||e.playPause(),v({})},Ce=e=>{var r;switch(e.keyCode){case EKeyCode.Right:ut();break;case EKeyCode.Left:dt();break;case EKeyCode.Space:e.preventDefault(),j();break;case EKeyCode.Delete:if(!E){const{id:t}=((r=d.current)==null?void 0:r.selectedRegion)||{};t&&Z(t)}break}},ct=e=>{V(e)},we=___default.default.throttle(ct,50);let K=!1;const Te=()=>{K&&(j(),K=!1),document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Te)},vt=e=>{V(e),L&&(K=!0,j()),document.addEventListener("mousemove",we),document.addEventListener("mouseup",Te)},ft=()=>{Re()};React.useEffect(()=>(at(),()=>{var e;(e=o==null?void 0:o.current)==null||e.destroy(),o.current=null,lbAnnotation.EventBus.unbindAll("setCurrentTimeByPosition"),lbAnnotation.EventBus.unbindAll("clearRegions"),lbAnnotation.EventBus.unbindAll("removeRegionById"),lbAnnotation.EventBus.unbindAll("setSelectedRegion")}),[]);const mt=e=>{var r,t,n;(r=h())==null||r.playPause(),(t=h())==null||t.setPlaybackRate(e),(n=h())==null||n.playPause()};React.useEffect(()=>(document.addEventListener("keydown",Ce),()=>{document.removeEventListener("keydown",Ce)})),React.useEffect(()=>{v({}),Re()},[M]);const Ae=e=>{var r,t,n,i;if((o==null?void 0:o.current)&&(S==null?void 0:S.current)){const a=(t=(r=o==null?void 0:o.current)==null?void 0:r.getDuration())!=null?t:0,f=(n=S==null?void 0:S.current)==null?void 0:n.getBoundingClientRect();let c=(e.clientX-f.left)/(((i=S==null?void 0:S.current)==null?void 0:i.clientWidth)||0)*a;return c>a&&(c=a),c}return 0},V=e=>{var r;const t=Ae(e);(r=o==null?void 0:o.current)==null||r.skip(t-ce.current),N(t)},pt=e=>{Xe(Ae(e))},gt=D?Math.max(D-R,0):0,_t=(u==null?void 0:u.toolName)!==EToolName.Empty&&(u==null?void 0:u.isEdit)!==!0&&(Oe==="remark"||E),qe=React__default.default.createElement("div",{className:index_module.audioPlayer},Ue&&!Le&&React__default.default.createElement(index$5,{fileTypeName:"\u97F3\u9891",ignoreOffsetY:!0,reloadImage:ft,backgroundColor:"#ffffffbb"}),React__default.default.createElement(index$6,{getRegionInstanceById:q,clipping:z}),React__default.default.createElement(index$7,{container:W.current}),React__default.default.createElement(index$8,{segmentTimeTip:rt}),React__default.default.createElement("div",{className:index_module.waveformContainer,ref:W},React__default.default.createElement("div",{id:"waveform",style:{width:`${k*100}%`},className:index$9.classnames({[index_module.waveform]:!0,"bee-audio-combined":d.current.combined,"bee-audio-clip":d.current.clipConfigurable})},$e&&React__default.default.createElement(index$a,{isAudio:!0}),React__default.default.createElement("div",{ref:S,className:index_module.progress,onMouseDown:vt,onMouseMove:pt},React__default.default.createElement("div",{className:index$9.classnames({[index_module.radioTooltip]:!0}),style:{left:xe}},audio.formatTime(R)),React__default.default.createElement("div",{className:index$9.classnames({[index_module.radioTooltip]:!0,[index_module.mouseTooltip]:!0}),style:{left:st}},audio.formatTime(ve)),React__default.default.createElement(index$b,{playPercentage:xe})),_t&&(ne==null?void 0:ne({currentTime:R,remainingTime:gt,audioPlayer:h()})))),React__default.default.createElement("div",{className:index_module.controlBar},React__default.default.createElement(antd.Button,{type:"link",icon:lt,onClick:()=>{j()},className:index$9.classnames({[index_module.playButton]:!0,[index_module.playButtonDisabled]:le})}),React__default.default.createElement("span",{className:index_module.time},`${audio.timeFormat(R,"ss.SSS")} / -${audio.timeFormat(D-R,"ss.SSS")}`),React__default.default.createElement(index$c.default,{playerType:index$c.EPlayerType.Audio,onChange:e=>{mt(e)}}),React__default.default.createElement(index$d.default,{onChange:e=>{be(e)},zoom:k}),React__default.default.createElement(index$e,{EventBus:lbAnnotation.EventBus})));return u?React__default.default.createElement(AudioPlayerContext.Provider,{value:u},qe,C.map(e=>{const{id:r}=e,t=document.querySelector(`[data-id=${r}]`);return t?React__default.default.createElement(index$f,{el:t,key:r,region:e,edgeAdsorption:fe,clipping:z,zoom:k,instance:q(r)}):null}),React__default.default.createElement(index$g.default,{footer:ze})):qe};exports.AudioPlayer=AudioPlayer,exports.AudioPlayerContext=AudioPlayerContext;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),getWebPcm2Wac=require("../audioAnnotate/utils/getWebPcm2Wac.js"),_=require("lodash"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),index$a=require("../invalidPage/index.js"),index$5=require("../imageError/index.js"),index$9=require("../../utils/index.js"),index$c=require("../videoPlayer/components/SpeedController/index.js"),WaveSurfer=require("@labelbee/wavesurfer"),Region=require("@labelbee/wavesurfer/dist/plugin/wavesurfer.regions.js"),Cursor=require("@labelbee/wavesurfer/dist/plugin/wavesurfer.cursor.js"),index$d=require("./zoomSlider/index.js"),index$e=require("./labelDisplayToggle/index.js"),index$f=require("./clipRegion/index.js"),index=require("../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks"),index$1=require("./useAudioScroll/index.js"),index_module=require("./index.module.scss.js"),audio=require("../../utils/audio.js"),index$b=require("./progressDot/index.js"),index$6=require("./clipTip/index.js"),index$4=require("./useSwitchHotkey/index.js"),index$2=require("./useAudioCombine/index.js"),index$3=require("./useAudioSegment/index.js"),index$7=require("./combineTip/index.js"),index$8=require("./segmentTip/index.js"),index$g=require("../../views/MainView/toolFooter/index.js"),utils=require("../videoPlayer/utils.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),WaveSurfer__default=_interopDefaultLegacy(WaveSurfer),Region__default=_interopDefaultLegacy(Region),Cursor__default=_interopDefaultLegacy(Cursor),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,u,d)=>u in l?__defProp(l,u,{enumerable:!0,configurable:!0,writable:!0,value:d}):l[u]=d,__spreadValues=(l,u)=>{for(var d in u||(u={}))__hasOwnProp.call(u,d)&&__defNormalProp(l,d,u[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(u))__propIsEnum.call(u,d)&&__defNormalProp(l,d,u[d]);return l},__spreadProps=(l,u)=>__defProps(l,__getOwnPropDescs(u));const{EToolName}=lbAnnotation.cTool,EKeyCode=lbAnnotation.cKeyCode.default,PER_PROGRESS=.1,AudioPlayerContext=React__default.default.createContext({count:0,isEdit:!1,toolName:EToolName.Empty,imgIndex:0}),AudioPlayer=({fileData:l={},onLoaded:u,context:d,invalid:Oe,height:We,hideError:Ne,onError:re,updateRegion:C,removeRegion:D,regions:w=[],activeToolPanel:Fe,clipConfigurable:ze,clipTextConfigurable:ne,clipAttributeList:Ue,clipAttributeConfigurable:oe,secondaryAttributeConfigurable:He,subAttributeList:Xe,isCheck:b,hoverRegionId:O,footer:Ze,drawLayerSlot:ie,clipTextList:Ke,lang:ae})=>{var le,se;const{url:I,path:ue}=l,[W,N]=React.useState(!1),[ce,de]=React.useState(!1),[S,Ve]=React.useState(0),[Ge,fe]=React.useState(!1),[$,ve]=React.useState(0),o=React.useRef(null),R=React.useRef(null),me=React.useRef(S),F=e=>{me.current=e,Ve(e)},[pe,Ye]=React.useState(0),[k,Je]=React.useState(1),z=React.useRef(null),[ge,Qe]=React.useState({}),{audioClipState:U,setAudioClipState:q}=index.useAudioClipStore(),[H,X]=React.useState(!1),c=ahooks.useLatest(U),be=ahooks.useLatest(ge),_e=ahooks.useLatest(W),A=ahooks.useLatest(w),ye=ahooks.useUpdate(),[Ee,et]=React.useState([]),[Se,tt]=React.useState({}),rt=_.debounce(()=>{lbAnnotation.EventBus.emit("audioZoom")},500),Re=e=>{e<index$d.audioZoomInfo.min||e>index$d.audioZoomInfo.max||(Je(e),audio.dispatchResizeEvent(),rt())};index$1({container:z.current,target:document.querySelector(`[data-id=${(se=(le=c.current)==null?void 0:le.selectedRegion)==null?void 0:se.id}]`),clipping:H,zoom:k,zoomHandler:Re});const j=()=>{let e=A.current;const{attributeLockList:r}=c.current;r.length&&(e=e.filter(t=>r.includes(t.attribute))),K(),e.forEach(t=>{var n;(n=o.current)==null||n.addRegion(__spreadProps(__spreadValues({},t),{drag:!b,resize:!b,color:"rgba(0, 0, 0, 0)"}))}),ye()},v=e=>{var r,t,n,i,s,m,p;const{id:a,loop:f=!0,playImmediately:g=!1,isLoopStatus:T}=e,P=T?_e.current:f;if(a){const h=(n=(t=(r=o.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?n:{};Object.entries(h).forEach(([,E])=>{const{id:M}=E;a===M?E.select():E.cancelSelect()}),q({selectedRegion:{id:a,loop:P},selectedAttribute:(m=(s=(i=A.current)==null?void 0:i.find(E=>E.id===a))==null?void 0:s.attribute)!=null?m:""}),P&&g&&((p=B(a))==null||p.playLoop())}else q({selectedRegion:{}})},{combineInstance:nt}=index$2({waveRef:o,sortByStartRegions:Ee,regionMap:Se,updateRegion:C,removeRegion:D,generateRegions:j,setSelectedRegion:v}),{segmentInstance:ot,onRegionMouseMove:it,segmentTimeTip:at}=index$3({waveRef:o,regionMap:Se,updateRegion:C,removeRegion:D,generateRegions:j,setSelectedRegion:v}),xe={clipTextConfigurable:ne,clipAttributeList:Ue,clipAttributeConfigurable:oe,clipConfigurable:ze,secondaryAttributeConfigurable:He,subAttributeList:Xe,clipTextList:Ke};React.useEffect(()=>{var e;ae&&((e=lbUtils.i18n)==null||e.changeLanguage(ae))},[]),React.useEffect(()=>{q({selectedAttribute:""})},[oe]),React.useEffect(()=>{Z()},[U.selectedAttribute]),React.useEffect(()=>{j()},[U.attributeLockList]),ahooks.useDeepCompareEffect(()=>{q(xe),setTimeout(()=>{Pe()})},[xe]),ahooks.useDeepCompareEffect(()=>{et(_.sortBy(w,["start"])),tt(w.reduce((e,r)=>{const{id:t}=r;return __spreadProps(__spreadValues({},e),{[t]:r})},{})),b&&j()},[w]),React.useEffect(()=>{if(O){const e=_e.current;v({id:O,loop:e,playImmediately:!0})}else v({})},[O]);const Pe=()=>{var e,r;c.current.clipConfigurable?(!b&&o.current&&((e=o.current)==null||e.enableDragSelection({slop:5})),j()):((r=o.current)==null||r.disableDragSelection(),K()),Z()},Z=()=>{var e,r,t,n,i;let s="";c.current.clipConfigurable?s=audio.getAttributeColor(c.current.selectedAttribute,(e=c.current.clipAttributeList)!=null?e:[]):s="transparent",((t=(r=o==null?void 0:o.current)==null?void 0:r.cursor)==null?void 0:t.cursor)&&((i=(n=o==null?void 0:o.current)==null?void 0:n.cursor)==null||i.setStyle({border:`2px dashed ${s}`}))},B=e=>{var r,t,n;return((n=(t=(r=o.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?n:{})[e]},he=()=>{var e,r;if(I){const t=((r=(e=ue==null?void 0:ue.split("."))==null?void 0:e.pop())==null?void 0:r.toLowerCase())==="pcm";fe(!1),t?getWebPcm2Wac.getWebPcm2WavBase64(I).then(n=>{Ce(n)}):Ce(I)}},Ce=e=>{var r;e&&(de(!0),F(0),ve(0),(r=o==null?void 0:o.current)==null||r.load(e))},K=()=>{var e;(e=o.current)==null||e.clearRegions()},V=e=>{const r=B(e);r&&(X(!1),r==null||r.remove(),D==null||D(e),v({}))},{run:we}=ahooks.useThrottleFn(v,{wait:500});index$4({sortByStartRegions:Ee,setSelectedRegion:v});const lt=e=>{const{start:r,end:t}=be.current;return(r||t)&&e.update(be.current),e},st=({action:e,id:r,eventDownTime:t})=>{var n,i;if(!c.current.clipConfigurable)return;r&&v({id:r});const s=B((r!=null?r:(n=c.current.selectedRegion)==null?void 0:n.id)||""),m=[];(e==="create"?A.current:(i=A.current)==null?void 0:i.filter(f=>f.id!==s.id)).forEach(f=>{const{start:g,end:T,attribute:P}=f;P===c.current.selectedAttribute&&[g,T].forEach(h=>{m.includes(h)||m.push(h)})});const a=audio.getCanMoveRange(m.sort((f,g)=>f-g),t);o.current.range=a},ut=e=>{Z(),setTimeout(()=>{X(!1)});const r=lt(e),{id:t,start:n,end:i}=r;v({id:t,playImmediately:!0});const s={id:t,start:utils.decimalReserved(n,3),end:utils.decimalReserved(i,3)};C==null||C(s),ye()},ct=()=>{const e=WaveSurfer__default.default.create({container:"#waveform",waveColor:"#999",progressColor:"#999",height:We||245,normalize:!0,cursorWidth:2,cursorColor:"white",responsive:0,hideScrollbar:!0,plugins:[Region__default.default.create({regions:w,dragSelection:{slop:5},canMove:!1}),Cursor__default.default.create({opacity:1,customStyle:{border:"2px dashed transparent"}})]}),r=()=>{var t;F(((t=o==null?void 0:o.current)==null?void 0:t.getCurrentTime())||0)};e.on("ready",()=>{var t;const n=((t=o==null?void 0:o.current)==null?void 0:t.getDuration())||0;ve(n),r(),u==null||u({duration:Math.round(n)}),de(!1),L(),lbAnnotation.EventBus.on("setCurrentTimeByPosition",Y),lbAnnotation.EventBus.on("clearRegions",K),lbAnnotation.EventBus.on("removeRegionById",V),lbAnnotation.EventBus.on("setSelectedRegion",we),e.on("regions-eventDown",st),Pe()}),e.on("audioprocess",()=>{r()}),e.on("play",()=>{N(!0)}),e.on("pause",()=>{N(!1)}),e.on("finish",()=>{N(!1)}),e.on("seek",()=>{r()}),e.on("error",()=>{fe(!0),u==null||u({hasError:!0}),re==null||re()}),e.on("region-created",t=>{var n;const{id:i,start:s,end:m}=t;if(A.current.find(a=>a.id===i))return;const p={id:i,start:utils.decimalReserved(s,3),end:utils.decimalReserved(m,3),attribute:c.current.selectedAttribute,text:""};if(c.current.secondaryAttributeConfigurable){const a=lbAnnotation.TagUtils.getDefaultResultByConfig((n=c.current.subAttributeList)!=null?n:[]);p.subAttribute=a!=null?a:{}}ne&&c.current.clipTextList.forEach((f,g)=>{g===0?Object.assign(p,{text:f==null?void 0:f.default}):Object.assign(p,{[f.key]:f==null?void 0:f.default})}),C==null||C(p)}),e.on("region-updated",(t,n)=>{var i,s,m,p,a,f,g,T,P,h;const E=n==null?void 0:n.action;q({combined:!1,segment:!1}),E==="resize"&&((s=(i=o==null?void 0:o.current)==null?void 0:i.cursor)==null||s.setStyle({borderStyle:"solid"})),E==="drag"&&((p=(m=o==null?void 0:o.current)==null?void 0:m.cursor)==null||p.setStyle({borderColor:"transparent"}));const M={},J=[],Q={},Rt=(a=A.current)==null?void 0:a.filter(y=>y.id!==t.id),xt=(T=(g=(f=o.current)==null?void 0:f.regions)==null?void 0:g.list)!=null?T:{};Rt.forEach(y=>{var Ie,$e;const{element:ee}=(Ie=xt[y.id])!=null?Ie:{},{start:Ct,end:wt}=y;if(ee){const{x:ke,width:At}=(($e=ee.getBoundingClientRect)==null?void 0:$e.call(ee))||{},Tt=ke+At;[ke,Tt].forEach((te,qt)=>{J.includes(te)||(J.push(te),Q[te]=qt===0?Ct:wt)})}});const{x:De,width:Pt}=((h=(P=t.element).getBoundingClientRect)==null?void 0:h.call(P))||{},ht=De+Pt;J.forEach(y=>{Math.abs(audio.precisionMinus(y,De))<5&&(M.start=Q[y]),Math.abs(audio.precisionMinus(y,ht))<5&&(M.end=Q[y])}),Qe(M),we({id:t.id}),X(!0)}),e.on("region-update-end",t=>{ut(t)}),e.on("region-contextmenu",(t,n)=>{if(!b){if(n.preventDefault(),n.stopPropagation(),audio.isDoubleClick(n)){V(t.id);return}v({id:t.id,playImmediately:!0})}}),e.on("region-click",(t,n,i)=>{if(!b){if(n.preventDefault(),n.stopPropagation(),c.current.combined){nt(t);return}if(c.current.segment){ot(t,i);return}v({id:t.id,playImmediately:!0})}}),e.on("region-mousemove",it),o.current=e},dt=W?React__default.default.createElement(icons.PauseOutlined,null):React__default.default.createElement(icons.CaretRightOutlined,null),Ae=e=>e?`${parseFloat((e/$*100).toFixed(4))}%`:"0%",Te=Ae(S),ft=Ae(pe),x=()=>{if(!ce)return o==null?void 0:o.current},vt=()=>{var e;(e=x())==null||e.skipForward(PER_PROGRESS)},mt=()=>{var e;(e=x())==null||e.skipBackward(PER_PROGRESS)},L=()=>{var e;(e=x())==null||e.playPause(),v({})},qe=e=>{var r;switch(e.keyCode){case EKeyCode.Right:vt();break;case EKeyCode.Left:mt();break;case EKeyCode.Space:e.preventDefault(),L();break;case EKeyCode.Delete:if(!b){const{id:t}=((r=c.current)==null?void 0:r.selectedRegion)||{};t&&V(t)}break}},pt=e=>{Y(e)},je=___default.default.throttle(pt,50);let G=!1;const Be=()=>{G&&(L(),G=!1),document.removeEventListener("mousemove",je),document.removeEventListener("mouseup",Be)},gt=e=>{Y(e),W&&(G=!0,L()),document.addEventListener("mousemove",je),document.addEventListener("mouseup",Be)},bt=()=>{he()};React.useEffect(()=>(ct(),()=>{var e;(e=o==null?void 0:o.current)==null||e.destroy(),o.current=null,lbAnnotation.EventBus.unbindAll("setCurrentTimeByPosition"),lbAnnotation.EventBus.unbindAll("clearRegions"),lbAnnotation.EventBus.unbindAll("removeRegionById"),lbAnnotation.EventBus.unbindAll("setSelectedRegion")}),[]);const _t=e=>{var r,t,n;(r=x())==null||r.playPause(),(t=x())==null||t.setPlaybackRate(e),(n=x())==null||n.playPause()};React.useEffect(()=>(document.addEventListener("keydown",qe),()=>{document.removeEventListener("keydown",qe)})),React.useEffect(()=>{v({}),he()},[I]);const Le=e=>{var r,t,n,i;if((o==null?void 0:o.current)&&(R==null?void 0:R.current)){const s=(t=(r=o==null?void 0:o.current)==null?void 0:r.getDuration())!=null?t:0,m=(n=R==null?void 0:R.current)==null?void 0:n.getBoundingClientRect();let a=(e.clientX-m.left)/(((i=R==null?void 0:R.current)==null?void 0:i.clientWidth)||0)*s;return a>s&&(a=s),a}return 0},Y=e=>{var r;const t=Le(e);(r=o==null?void 0:o.current)==null||r.skip(t-me.current),F(t)},yt=e=>{Ye(Le(e))},Et=$?Math.max($-S,0):0,St=(d==null?void 0:d.toolName)!==EToolName.Empty&&(d==null?void 0:d.isEdit)!==!0&&(Fe==="remark"||b),Me=React__default.default.createElement("div",{className:index_module.audioPlayer},Ge&&!Ne&&React__default.default.createElement(index$5,{fileTypeName:"\u97F3\u9891",ignoreOffsetY:!0,reloadImage:bt,backgroundColor:"#ffffffbb"}),React__default.default.createElement(index$6,{getRegionInstanceById:B,clipping:H}),React__default.default.createElement(index$7,{container:z.current}),React__default.default.createElement(index$8,{segmentTimeTip:at}),React__default.default.createElement("div",{className:index_module.waveformContainer,ref:z},React__default.default.createElement("div",{id:"waveform",style:{width:`${k*100}%`},className:index$9.classnames({[index_module.waveform]:!0,"bee-audio-combined":c.current.combined,"bee-audio-clip":c.current.clipConfigurable})},Oe&&React__default.default.createElement(index$a,{isAudio:!0}),React__default.default.createElement("div",{ref:R,className:index_module.progress,onMouseDown:gt,onMouseMove:yt},React__default.default.createElement("div",{className:index$9.classnames({[index_module.radioTooltip]:!0}),style:{left:Te}},audio.formatTime(S)),React__default.default.createElement("div",{className:index$9.classnames({[index_module.radioTooltip]:!0,[index_module.mouseTooltip]:!0}),style:{left:ft}},audio.formatTime(pe)),React__default.default.createElement(index$b,{playPercentage:Te})),St&&(ie==null?void 0:ie({currentTime:S,remainingTime:Et,audioPlayer:x()})))),React__default.default.createElement("div",{className:index_module.controlBar},React__default.default.createElement(antd.Button,{type:"link",icon:dt,onClick:()=>{L()},className:index$9.classnames({[index_module.playButton]:!0,[index_module.playButtonDisabled]:ce})}),React__default.default.createElement("span",{className:index_module.time},`${audio.timeFormat(S,"ss.SSS")} / -${audio.timeFormat($-S,"ss.SSS")}`),React__default.default.createElement(index$c.default,{playerType:index$c.EPlayerType.Audio,onChange:e=>{_t(e)}}),React__default.default.createElement(index$d.default,{onChange:e=>{Re(e)},zoom:k}),React__default.default.createElement(index$e,{EventBus:lbAnnotation.EventBus})));return d?React__default.default.createElement(AudioPlayerContext.Provider,{value:d},Me,w.map(e=>{const{id:r}=e,t=document.querySelector(`[data-id=${r}]`);return t?React__default.default.createElement(index$f,{el:t,key:r,region:e,edgeAdsorption:ge,clipping:H,zoom:k,instance:B(r),isCheck:b}):null}),React__default.default.createElement(index$g.default,{footer:Ze})):Me},WrapAudioPlayer=l=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(AudioPlayer,__spreadValues({},l)));exports.AudioPlayer=AudioPlayer,exports.AudioPlayerContext=AudioPlayerContext,exports.WrapAudioPlayer=WrapAudioPlayer;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use strict";var antd=require("antd"),lbAnnotation=require("@labelbee/lb-annotation"),index=require("../../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks"),React=require("react");const EKeyCode=lbAnnotation.cKeyCode.default,useAudioCombine=
|
|
2
|
-
${
|
|
1
|
+
"use strict";var antd=require("antd"),lbAnnotation=require("@labelbee/lb-annotation"),index=require("../../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks"),React=require("react"),_=require("lodash");const EKeyCode=lbAnnotation.cKeyCode.default,useAudioCombine=C=>{const{waveRef:v,sortByStartRegions:y,regionMap:m,updateRegion:g,removeRegion:a,generateRegions:p,setSelectedRegion:E}=C,{audioClipState:B,setAudioClipState:b}=index.useAudioClipStore(),{selectedRegion:h,clipConfigurable:A,combined:R,clipTextList:k}=B,{id:u}=h,F=(i,d,c)=>{const e=_.cloneDeep(i);return k.forEach((t,l)=>{const o=d[t.key],s=c[t.key],f=[o,s].includes("")?`${o}${s}`:`${o}
|
|
2
|
+
${s}`;l===0?Object.assign(e,{text:f}):Object.assign(e,{[t.key]:f})}),e},$=ahooks.useMemoizedFn(i=>{var d,c;if(!u)return;const e=m[u],t=m[i.id];if(e.attribute!==t.attribute){antd.message.info("\u8BF7\u9009\u62E9\u76F8\u90BB\u540C\u5C5E\u6027\u7247\u6BB5");return}const l=y.filter(n=>n.attribute===e.attribute),o=l.findIndex(n=>n.id===u),s=l.findIndex(n=>n.id===i.id);if(Math.abs(o-s)!==1){antd.message.info("\u8BF7\u9009\u62E9\u76F8\u90BB\u540C\u5C5E\u6027\u7247\u6BB5");return}const r=[];["start","end"].forEach(n=>{r.push(e[n]),r.push(t[n])});const q=Math.min(...r),w=Math.max(...r),M={id:(d=v.current)==null?void 0:d.util.getId("combined_"),start:q,end:w,attribute:e.attribute,text:[e.text,t.text].includes("")?`${e.text}${t.text}`:`${e.text}
|
|
3
|
+
${t.text}`,subAttribute:(c=t.subAttribute)!=null?c:{}},x=F(M,e,t);g==null||g(x),a==null||a(u),a==null||a(t.id),p(),b({combined:!1}),E({id:x.id,playImmediately:!0})}),I=ahooks.useMemoizedFn(i=>{if(!!A&&i.altKey&&i.keyCode===EKeyCode.Z){if(!u){antd.message.info("\u8BF7\u5148\u9009\u62E9\u9700\u8981\u5408\u5E76\u7684\u533A\u95F4");return}b({combined:!0,segment:!1})}});return React.useEffect(()=>{R&&b({combined:!1})},[u]),ahooks.useEventListener("keydown",I),{combineInstance:$}};module.exports=useAudioCombine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),antd=require("antd"),lbAnnotation=require("@labelbee/lb-annotation"),index=require("../../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks");const EKeyCode=lbAnnotation.cKeyCode.default,useAudioSegment=
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),lbAnnotation=require("@labelbee/lb-annotation"),index=require("../../audioAnnotate/audioContext/index.js"),ahooks=require("ahooks"),dataTransform=require("../../audioAnnotate/utils/dataTransform.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));const EKeyCode=lbAnnotation.cKeyCode.default,useAudioSegment=r=>{const{waveRef:e,regionMap:t,updateRegion:d,removeRegion:y,generateRegions:R,setSelectedRegion:w}=r,{audioClipState:O,setAudioClipState:v}=index.useAudioClipStore(),{selectedRegion:P,clipConfigurable:T,segment:p,clipTextList:C,subAttributeList:A,secondaryAttributeConfigurable:E=!1}=O,{id:n}=P,m=React.useRef(null),g=React.useRef(null);React.useEffect(()=>{var u,o,i,l,c,s,f;if(g.current&&e.current&&p&&n){const a=(s=(i=(o=(u=e.current)==null?void 0:u.regions)==null?void 0:o.util)==null?void 0:i.getRegionSnapToGridValue)==null?void 0:s.call(i,((l=e.current)==null?void 0:l.drawer.handleEvent(g.current))*((c=e.current)==null?void 0:c.getDuration())),_=(f=t[n])!=null?f:{},{start:b,end:B}=_;if(a>b&&a<B){m.current=a;return}}m.current=null},[g.current,p]);const x=ahooks.useMemoizedFn((u,o)=>{var i,l,c;if(!n||n!==u.id){antd.message.info("\u8BF7\u70B9\u51FB\u6240\u9009\u533A\u95F4");return}const s=t[n],f=dataTransform.getClipTextByConfig(s,C),a=__spreadProps(__spreadValues({},f),{id:(i=e.current)==null?void 0:i.util.getId("segment_"),end:o,subAttribute:(l=s.subAttribute)!=null?l:{}}),_=dataTransform.getClipTextByConfig(s,C,!0),b=__spreadProps(__spreadValues({},_),{id:(c=e.current)==null?void 0:c.util.getId("segment_"),start:o,subAttribute:lbAnnotation.TagUtils.getDefaultResultByConfig(E?A!=null?A:[]:[])});d==null||d(a),d==null||d(b),y==null||y(n),R(),v({segment:!1}),w({id:a.id,playImmediately:!0})}),F=ahooks.useMemoizedFn(u=>{if(!!T&&u.altKey&&u.keyCode===EKeyCode.X){if(!n){antd.message.info("\u8BF7\u5148\u9009\u62E9\u9700\u8981\u5206\u5272\u7684\u533A\u95F4");return}v({segment:!0,combined:!1})}}),S=ahooks.useMemoizedFn((u,o)=>{g.current=o});return ahooks.useEventListener("keydown",F),React.useEffect(()=>{p&&v({segment:!1})},[n]),{segmentInstance:x,onRegionMouseMove:S,segmentTimeTip:m.current}};module.exports=useAudioSegment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),antd=require("antd"),ahooks=require("ahooks"),index=require("../../constant/index.js"),icons=require("@ant-design/icons");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const longTextCls=`${index.prefix}-longText`,
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),ahooks=require("ahooks"),index=require("../../constant/index.js"),icons=require("@ant-design/icons");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var r={};for(var n in e)__hasOwnProp.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))t.indexOf(n)<0&&__propIsEnum.call(e,n)&&(r[n]=e[n]);return r};const longTextCls=`${index.prefix}-longText`,TextDom=React.forwardRef((e,t)=>{var r=e,{text:n,overflowMaxLines:c,style:o}=r,f=__objRest(r,["text","overflowMaxLines","style"]);const a={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},l={display:"-webkit-box",WebkitLineClamp:c,WebkitBoxOrient:"vertical",overflow:"hidden"},u=c>1?l:a,s=__spreadValues(__spreadValues({},u),o!=null?o:{});return React__default.default.createElement("div",__spreadValues({style:s,ref:t},f),n)}),LongText=e=>{const{text:t,placement:r="bottom",icon:n=React__default.default.createElement(icons.SearchOutlined,null),openByText:c,style:o,isToolTips:f,overflowMaxLines:a=1}=e,l=React.useRef(null),u=ahooks.useSize(l),s=React.useMemo(()=>{var i,d,v,p;return a>1?l.current&&((i=l.current)==null?void 0:i.clientHeight)<((d=l.current)==null?void 0:d.scrollHeight):l.current&&((v=l.current)==null?void 0:v.clientWidth)<((p=l.current)==null?void 0:p.scrollWidth)},[u]);if(c){let i={placement:r,overlayClassName:`${longTextCls}-popover`,content:t,key:`${s}`};return s||Object.assign(i,{open:!1}),f?React__default.default.createElement(antd.Tooltip,__spreadProps(__spreadValues({},i),{title:t}),React__default.default.createElement(TextDom,{overflowMaxLines:a,style:o,ref:l,text:t})):React__default.default.createElement(antd.Popover,__spreadValues({},i),React__default.default.createElement(TextDom,{overflowMaxLines:a,style:o,ref:l,text:t}))}return React__default.default.createElement("div",{className:longTextCls,style:o},React__default.default.createElement(TextDom,{overflowMaxLines:a,style:o,ref:l,text:t}),s&&React__default.default.createElement(antd.Popover,{placement:r,overlayClassName:`${longTextCls}-popover`,content:t},n))};module.exports=LongText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation"),util=require("./util.js"),useUpdateRectList=require("./useUpdateRectList.js"),useToolStyle=require("../../hooks/useToolStyle.js");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,i,c)=>i in l?__defProp(l,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[i]=c,__spreadValues=(l,i)=>{for(var c in i||(i={}))__hasOwnProp.call(i,c)&&__defNormalProp(l,c,i[c]);if(__getOwnPropSymbols)for(var c of __getOwnPropSymbols(i))__propIsEnum.call(i,c)&&__defNormalProp(l,c,i[c]);return l},__spreadProps=(l,i)=>__defProps(l,__getOwnPropDescs(i)),__async=(l,i,c)=>new Promise((s,v)=>{var m=a=>{try{g(c.next(a))}catch(p){v(p)}},y=a=>{try{g(c.throw(a))}catch(p){v(p)}},g=a=>a.done?s(a.value):Promise.resolve(a.value).then(m,y);g((c=c.apply(l,i)).next())});const PointCloud2DRectOperationView=l=>{var i,c;const{mappingData:s,size:v,config:m,checkMode:y,afterImgOnLoad:g,shouldExcludePointCloudBoxListUpdate:a}=l,p=(i=s==null?void 0:s.url)!=null?i:"",D=(c=s==null?void 0:s.fallbackUrl)!=null?c:"",{pointCloudBoxList:P,setPointCloudResult:x,defaultAttribute:C,rectList:S,addRectIn2DView:A,updateRectIn2DView:F,removeRectIn2DView:M,updateRectListByReducer:T,selectedIDs:I,setSelectedIDs:j}=React.useContext(PointCloudContext.PointCloudContext),{value:E}=useToolStyle.useToolStyleContext(),z=ahooks.useLatest(I),{update2DViewRect:J,remove2DViewRect:$}=usePointCloudViews.usePointCloudViews(),L=React__default.default.useRef(null),o=React.useRef(null),q=ahooks.useMemoizedFn(J),b=ahooks.useMemoizedFn($),h=React.useRef(null),[G,N]=React.useState(!0),O=React.useMemo(()=>S==null?void 0:S.filter(e=>e.imageName===(s==null?void 0:s.path)),[s==null?void 0:s.path,S]),w=ahooks.useLatest(s==null?void 0:s.path),V=React.useCallback(e=>__async(void 0,null,function*(){try{const n=z.current.slice(0),t=yield Promise.resolve(e());if(!t||t.length===0)return t;if(n.length){const r=new Set(n),u=t.filter(d=>r.has(d.id)).map(d=>d.id);j(u)}return t}catch(n){}}),[j]),B=e=>{const{boxID:n}=e;if(!a&&n){V(()=>{const t=q==null?void 0:q(e);return t?(h.current=t,x(t),t):null});return}F(e,!0)},U=e=>{w.current&&A(__spreadProps(__spreadValues({},e),{imageName:w.current}))},k=e=>{if(e.length===0)return;if(!a){const t=e.find(r=>r.boxID);if(t){V(()=>{const r=b==null?void 0:b(t);return r?(h.current=r,x(r),R(),r):null});return}}const n=e.find(t=>t.extId);n&&V(()=>{const{imageName:t,extId:r}=n,u=b==null?void 0:b({boxID:r,imageName:t});return u?(h.current=u,x(u),u):null}),M(e)},H=ahooks.useMemoizedFn(()=>{let e=[];return P.forEach(n=>{const{rects:t=[],id:r,attribute:u,trackID:d}=n,f=t.find(K=>K.imageName===w.current),_=r+"_"+w.current;f&&(e=[...e,__spreadProps(__spreadValues({},f),{boxID:r,id:_,attribute:u,order:d})])}),e}),R=useUpdateRectList.useUpdateRectList(()=>{var e,n,t;const r=a?[]:H(),u=(e=o.current)==null?void 0:e.selectedRectID,d=I.slice(0),f=util.selectSpecifiedRectsFromTopViewSelectedIds(d,r,O);(n=o.current)==null||n.setResult(f),u&&((t=o.current)==null||t.setSelectedRectID(u))});return React.useEffect(()=>{if(L.current){const e=new lbAnnotation.PointCloud2DRectOperation({container:L.current,size:v,config:__spreadProps(__spreadValues({},m),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:y});return o.current=e,o.current.init(),o.current.on("updateDragResult",B),o.current.on("afterAddingDrawingRect",U),o.current.on("deleteSelectedRects",k),()=>{var n,t,r,u;(n=o.current)==null||n.unbind("updateDragResult",B),(t=o.current)==null||t.unbind("afterAddingDrawingRect",U),(r=o.current)==null||r.unbind("deleteSelectedRects",k),(u=o.current)==null||u.destroy()}}},[]),React.useEffect(()=>{const e=t=>__async(void 0,null,function*(){try{return yield lbAnnotation.ImgUtils.load(t)}catch(r){return console.error("Error loading image:",r),null}}),n=()=>__async(void 0,null,function*(){var t;N(!0);let r=yield e(p);!r&&D&&(r=yield e(D)),r&&((t=o.current)==null||t.setImgNode(r),g(r)),N(!1)});o.current&&(p||D)&&n()},[p,D]),React.useEffect(()=>{var e;(e=o.current)==null||e.setSize(v)},[v]),React.useEffect(()=>{P!==h.current&&R()},[P]),React.useEffect(()=>{var e,n;const t=O.find(r=>r.id===o.current.selectedRectID);(n=(e=o.current)==null?void 0:e.setDefaultAttribute)==null||n.call(e,C),t&&T(r=>{var u;const d=[];let f=null;return r.forEach(_=>{_.id!==o.current.selectedRectID?d.push(_):f=_}),t.extId===void 0&&(f=(u=o.current)==null?void 0:u.selectedRect),[...d,__spreadProps(__spreadValues({},f||{}),{attribute:C})]}),R()},[C]),React.useEffect(()=>{R()},[O]),React.useEffect(()=>{R()},[a]),React.useEffect(()=>{var e,n,t,r;const u=(n=(e=o.current)==null?void 0:e.config)!=null?n:{},d=__spreadProps(__spreadValues({},u),{attributeList:(t=m.attributeList)!=null?t:[]});(r=o.current)==null||r.setConfig(JSON.stringify(d))},[m.attributeList]),React.useEffect(()=>{var e;(e=o.current)==null||e.setEnableAddRect(I.length===0),R()},[I]),React.useEffect(()=>{const{hiddenText:e}=E||{};if(e===void 0)return;const n=o.current;if(!n)return;const t=__spreadValues(__spreadValues({},n.style),E);n.setStyle(t)},[E]),React__default.default.createElement(es.Spin,{spinning:G},React__default.default.createElement("div",{ref:L,style:__spreadValues({position:"relative"},v)}))};var PointCloud2DRectOperationView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DRectOperationView);module.exports=PointCloud2DRectOperationView$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ahooks=require("ahooks");const useUpdateRectList=e=>{const{run:t}=ahooks.useDebounceFn(e,{wait:100});return t};exports.useUpdateRectList=useUpdateRectList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const selectSpecifiedRectsFromTopViewSelectedIds=(t,r,s)=>{if(t.length){const c=new Set(t),o=r.filter(({boxID:e})=>c.has(e)),d=s.filter(e=>e.extId&&c.has(e.extId));return[...o,...d]}return[...r,...s]};exports.selectSpecifiedRectsFromTopViewSelectedIds=selectSpecifiedRectsFromTopViewSelectedIds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),useDataLinkSwitch=require("./hooks/useDataLinkSwitch.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,u,i)=>new Promise((s,a)=>{var f=t=>{try{o(i.next(t))}catch(n){a(n)}},c=t=>{try{o(i.throw(t))}catch(n){a(n)}},o=t=>t.done?s(t.value):Promise.resolve(t.value).then(f,c);o((i=i.apply(e,u)).next())});const PointCloud2DSingleView=({view2dData:e,setSelectedID:u,currentData:i,showEnlarge:s,checkMode:a=!1,measureVisible:f})=>{var c,o;const t=React.useRef(null),n=React.useRef(),{selectedBox:d}=useSingleBox.useSingleBox(),m=useSize(t),{url:p,fallbackUrl:x,calib:v,path:j}=e,{toggle2dVisible:q,isHighlightVisible:P}=useHighlight.useHighlight({currentData:i}),[_,b]=React.useState(!1),{highlight2DLoading:B,setHighlight2DLoading:k,cuboidBoxIn2DView:h,cacheImageNodeSize:V}=React.useContext(PointCloudContext.PointCloudContext),z=!e,I=React.useMemo(()=>({zIndex:s?-1:101,is2DView:!h,imageName:e.path}),[s,h,e.path]),{rendered:R,isLinking:H}=useDataLinkSwitch(I),C=l=>{g(),V({path:j,imgNode:l})},g=React.useCallback(()=>{var l,L;const y=(l=n.current)==null?void 0:l.toolInstance;if(u(""),!d||!y)return;const r=e.annotations.find(E=>E.annotation.id===d.info.id);let S="";r&&((L=r==null?void 0:r.annotation.pointList)==null?void 0:L.length)>0&&(y.focusPositionByPointList(r==null?void 0:r.annotation.pointList),S=d.info.id,u(S))},[d,n.current,e.annotations]);React.useEffect(()=>{g()},[g]);const O=()=>__async(void 0,null,function*(){b(!0),k(!0);try{yield q(p,x!=null?x:"",v)}catch(l){console.error("highlightOnClick error:",l)}finally{b(!1),k(!1)}});return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:t},h?React__default.default.createElement(index,{src:(c=e==null?void 0:e.url)!=null?c:"",fallbackSrc:(o=e==null?void 0:e.fallbackUrl)!=null?o:"",annotations:e.annotations,size:m,ref:n,globalStyle:{display:z?"none":"block"},afterImgOnLoad:C,zoomInfo:{min:.01,max:1e3,ratio:.4},measureVisible:f}):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$1,{shouldExcludePointCloudBoxListUpdate:!H,mappingData:e,size:m,checkMode:a,afterImgOnLoad:C}),!a&&R),v&&React__default.default.createElement(index$2,{visible:P(p),onClick:O,loading:_,disabled:B,style:{position:"absolute",right:16,top:16,zIndex:s?-1:101}}))};module.exports=PointCloud2DSingleView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),PointCloud2DSingleView=require("./PointCloud2DSingleView.js"),index=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons"),classNames=require("classnames"),icon_esc=require("../../assets/annotation/common/icon_esc.svg.js"),icon_left_squareOutlined=require("../../assets/annotation/common/icon_left_squareOutlined.svg.js"),icon_right_squareOutlined=require("../../assets/annotation/common/icon_right_squareOutlined.svg.js"),_2DViewWorker=require("../../_virtual/2DViewWorker.js"),ahooks=require("ahooks");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const EKeyCode=lbAnnotation.cKeyCode.default,ContainerTitle=({showEnlarge:e,isEnlargeTopView:g,data:o,setIsEnlarge:u,setCurIndex:s,curIndex:c=0,index:f,annotations2d:d})=>g?React__default.default.createElement(index,{title:o==null?void 0:o.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{u(!1),s(void 0)}}),React__default.default.createElement("span",null,o==null?void 0:o.calName),React__default.default.createElement("span",{style:{marginLeft:"8px"}},c+1,"/",d==null?void 0:d.length)):React__default.default.createElement(index,{title:o==null?void 0:o.calName,onClick:()=>{u(!0),s(f)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),PointCloud2DView=({currentData:e,config:g,thumbnailWidth:o,isEnlargeTopView:u,highlightAttribute:s,loadPCDFileLoading:c,checkMode:f,measureVisible:d})=>{var x;const[a,w]=React.useState([]),{topViewInstance:L,displayPointCloudList:C,polygonList:y,imageSizes:_,selectedIDs:h,windowKeydownListenerHook:v}=React.useContext(PointCloudContext.PointCloudContext),[q,F]=React.useState(""),[m,P]=React.useState(!1),[i,p]=React.useState(void 0),E=React.useCallback(t=>{P(t),lbAnnotation.EventBus.emit("2d-image:enlarge",t)},[]),r=React.useRef();React.useEffect(()=>{var t;if(!c&&L&&(e==null?void 0:e.mappingImgList)&&((t=e==null?void 0:e.mappingImgList)==null?void 0:t.length)>0)return r.current&&r.current.terminate(),r.current=new _2DViewWorker,r.current.onmessage=n=>{var l;const N=n.data;w(N),(l=r.current)==null||l.terminate()},r.current.postMessage({currentData:e,displayPointCloudList:C,selectedID:q,highlightAttribute:s,imageSizes:_,config:g,polygonList:y,selectedIDs:h}),()=>{var n;(n=r.current)==null||n.terminate()}},[C,e==null?void 0:e.mappingImgList,q,s,c,y,_,h]);const I=ahooks.useLatest(t=>{if(!m)return;const n=()=>{t.stopImmediatePropagation()};switch(t.keyCode){case EKeyCode.Esc:{E(!1);break}case EKeyCode.Left:{k();break}case EKeyCode.Right:{b();break}}n()}),k=()=>{i===void 0||!m||Number(i)>0&&p(i-1)},b=()=>{i===void 0||!m||Number(i)<(a==null?void 0:a.length)-1&&p(i+1)};React.useEffect(()=>{const t=l=>I.current(l);return v.preappendEventListener(t)},[v,v.preappendEventListener]);const j=!e||!(e==null?void 0:e.mappingImgList)||!(((x=e==null?void 0:e.mappingImgList)==null?void 0:x.length)>0),S=React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},React__default.default.createElement("img",{src:icon_left_squareOutlined,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>k()}),React__default.default.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("img",{src:icon_right_squareOutlined,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>b()}),React__default.default.createElement("img",{src:icon_esc,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{E(!1),p(void 0)}}),React__default.default.createElement("span",null,"\u952E\u9000\u51FA"));return(a==null?void 0:a.length)>0?React__default.default.createElement(React__default.default.Fragment,null,a.map((t,n)=>{const l=m&&n===i;return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:classNames__default.default({[dom.getClassName("point-cloud-2d-container")]:!0,[dom.getClassName("point-cloud-container","zoom")]:l}),title:React__default.default.createElement(ContainerTitle,{showEnlarge:l,isEnlargeTopView:u,data:t,setIsEnlarge:E,setCurIndex:p,curIndex:i,index:n,annotations2d:a}),titleOnSurface:!l,style:{display:j?"none":"flex",width:l?"100%":o},key:n,toolbar:S},(t==null?void 0:t.annotations)&&(t==null?void 0:t.url)&&React__default.default.createElement(PointCloud2DSingleView,{key:t.url,currentData:e,view2dData:t,setSelectedID:F,showEnlarge:l,checkMode:f,measureVisible:d}))})):null};var PointCloud2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DView);module.exports=PointCloud2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index$1=require("./components/PointCloudSizeSlider/index.js"),index$2=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index$1=require("./components/PointCloudSizeSlider/index.js"),index$2=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,a,i)=>a in t?__defProp(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,__spreadValues=(t,a)=>{for(var i in a||(a={}))__hasOwnProp.call(a,i)&&__defNormalProp(t,i,a[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(a))__propIsEnum.call(a,i)&&__defNormalProp(t,i,a[i]);return t},__spreadProps=(t,a)=>__defProps(t,__getOwnPropDescs(a));const EKeyCode=lbAnnotation.cKeyCode.default,pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:t})=>{const{isActive:a,setTarget3DView:i}=React.useContext(PointCloud3DContext),c=n=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",n)]:!0,active:a});return React__default.default.createElement("span",{onClick:()=>{i(lbUtils.EPerspectiveView[t])},className:c(t.toLocaleLowerCase())})},PointCloud3DSideBar=({isEnlarge:t})=>{const{reset3DView:a,followTopView:i}=React.useContext(PointCloud3DContext),{t:c}=reactI18next.useTranslation(),n=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Top"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Front"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Left"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Back"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Right"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"LFT"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"RBT"})),p=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(antd.Tooltip,{title:c("CameraFollowTopView")},React__default.default.createElement("span",{onClick:()=>{i()},className:dom.getClassName("point-cloud-3d-view","followTop")})),React__default.default.createElement("span",{onClick:()=>{a()},className:dom.getClassName("point-cloud-3d-view","reset")}));return t?React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebarZoom")},p,n):React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},n,p)},PointCloud3D=({currentData:t,config:a,highlightAttribute:i})=>{var c;const n=React.useContext(PointCloudContext.PointCloudContext),[p,h]=React.useState(!0),[d,C]=React.useState(!1),m=React.useRef(null),{initPointCloud3d:P}=usePointCloudViews.usePointCloudViews(),v=useSize(m),{t:g}=reactI18next.useTranslation();React.useEffect(()=>{!n.mainViewInstance||P==null||P(v)},[v]);const{selectedBox:u}=useSingleBox.useSingleBox(),{selectedSphere:w}=useSphere.useSphere(),V=e=>{var o,l;const r=u==null?void 0:u.info;if(r){const s=__spreadValues({},r.center);s.x=s.x-.01,s.z=1e3;const f=e===lbUtils.EPerspectiveView.Top;(o=n.mainViewInstance)==null||o.updateCameraByBox(r,e,f?s:void 0)}w&&((l=n.mainViewInstance)==null||l.updateCameraBySphere(w,e))},I=()=>{var e;(e=n.mainViewInstance)==null||e.resetCamera()},b=()=>{var e,o;const l=(e=n.topViewInstance)==null?void 0:e.pointCloudInstance.camera;l&&((o=n.mainViewInstance)==null||o.applyCameraTarget(l))};React.useEffect(()=>{if(m.current&&(t==null?void 0:t.url)){let e=n.mainViewInstance;!e&&v.width&&(e=new lbAnnotation.PointCloud({container:m.current,isOrthographicCamera:!0,orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(v),config:a}),n.setMainViewInstance(e))}},[v,t]),React.useEffect(()=>{var e;if(m.current&&(t==null?void 0:t.url)&&t.result&&n.mainViewInstance){let o=n.mainViewInstance;const l=lbUtils.PointCloudUtils.getBoxParamsFromResultList(t.result);l.forEach(s=>{var f;const E=(f=lbUtils.toolStyleConverter.getColorFromConfig({attribute:s.attribute},__spreadProps(__spreadValues({},a),{attributeConfigurable:!0}),{}))==null?void 0:f.hex;o==null||o.addBoxToSense(s,E)}),o.render(),n.setPointCloudResult(l);const r=lbUtils.PointCloudUtils.getRectParamsFromResultList(t.result);n.setRectList(r),n.setPointCloudValid((e=index.jsonParser(t.result))==null?void 0:e.valid)}},[t,n.mainViewInstance]),React.useEffect(()=>{var e,o,l,r,s;if(((e=u==null?void 0:u.info)==null?void 0:e.id)!==void 0){V(lbUtils.EPerspectiveView.Top);const E=(r=(l=(o=n.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:l.camera.zoom)!=null?r:1;(s=n.mainViewInstance)==null||s.updateCameraZoom(E)}},[(c=u==null?void 0:u.info)==null?void 0:c.id]),React.useEffect(()=>{var e,o,l,r;if(w){V(lbUtils.EPerspectiveView.Top);const s=(l=(o=(e=n.topViewInstance)==null?void 0:e.pointCloudInstance)==null?void 0:o.camera.zoom)!=null?l:1;(r=n.mainViewInstance)==null||r.updateCameraZoom(s)}},[w]),React.useEffect(()=>(window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}),[]);const x=e=>{if(e.keyCode===EKeyCode.Esc){C(!1);return}},_=React.useMemo(()=>({reset3DView:I,setTarget3DView:V,isActive:!!u,followTopView:b}),[u,n.mainViewInstance]);React.useEffect(()=>{var e,o,l;const r=n.pointCloudBoxList.filter(s=>s.attribute===i);(r==null?void 0:r.length)>0&&((e=n.mainViewInstance)==null||e.clearHighlightBoxes(),(o=n.mainViewInstance)==null||o.highlightBoxes(r)),r.length===0&&((l=n.mainViewInstance)==null||l.clearHighlightBoxesAndRender())},[i,n.mainViewInstance]);const S=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$1,{onChange:e=>{var o;(o=n.mainViewInstance)==null||o.updatePointSize({customSize:e})}}),React__default.default.createElement("span",{style:{marginRight:8}},g("ShowArrows")),React__default.default.createElement(antd.Switch,{size:"small",checked:p,onChange:e=>{var o;h(e),(o=n.mainViewInstance)==null||o.setShowDirection(e)}}),d&&React__default.default.createElement(PointCloud3DContext.Provider,{value:_},React__default.default.createElement(PointCloud3DSideBar,{isEnlarge:d})));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:classNames__default.default({[dom.getClassName("point-cloud-3d-container")]:!0,[dom.getClassName("point-cloud-container","zoom")]:d}),title:d?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{C(!1)}}),g("3DView")):React__default.default.createElement(index$2,{title:g("3DView"),onClick:()=>{C(!0)}}),toolbar:S},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},!d&&React__default.default.createElement(PointCloud3DContext.Provider,{value:_},React__default.default.createElement(PointCloud3DSideBar,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-view"),id:pointCloudID,ref:m})))};var PointCloud3DView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud3D);module.exports=PointCloud3DView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index$1=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(n,s,l=1)=>{const{width:e,height:o}=s,t={x:n.x+e*l/2,y:n.y+o*l/2},c={x:s.width/2,y:s.height/2};return{offsetX:(c.x-t.x)/l,offsetY:-(c.y-t.y)/l}},updateBackViewByCanvas2D=(n,s,l,e,o)=>{const{offsetX:t,offsetY:c}=TransferCanvas2WorldOffset(n,l,s);if(o.camera.zoom=s,n){const d=Math.cos(e),f=Math.sin(e),x=t*d,C=t*f,{x:v,y:i,z:u}=o.initCameraPosition;o.camera.position.set(v+C,i-x,u+c)}o.camera.updateProjectionMatrix(),o.render()},PointCloudBackView=({currentData:n,config:s,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),o=React.useRef(null),t=useSize(o),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:d}=useSphere.useSphere(),{syncBackviewToolZoom:f}=useZoom.useZoom(),{t:x}=reactI18next.useTranslation(),{backViewUpdateBox:C,backViewUpdatePoint:v}=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(o.current){const i={width:o.current.clientWidth,height:o.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:o.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:s,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setBackViewInstance(u)}},[]),React.useEffect(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:i,pointCloudInstance:u}=e.backViewInstance;i.singleOn("renderZoom",(r,a)=>{if(e.selectedPointCloudBox){updateBackViewByCanvas2D(a,r,t,e.selectedPointCloudBox.rotation,u),f(a,r,t);return}if(d){updateBackViewByCanvas2D(a,r,t,0,u),f(a,r,t);return}}),i.singleOn("dragMove",({currentPos:r,zoom:a})=>{!e.selectedPointCloudBox&&!d||updateBackViewByCanvas2D(r,a,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,u)}),i.singleOn("updatePointByDrag",(r,a)=>{d&&(v==null||v(r,a[0]))}),i.singleOn("updatePolygonByDrag",r=>{if(e.selectedIDs.length===1&&r.length===1){const{newPolygon:a,originPolygon:p}=r[0];a&&p&&C(a,p)}})},[e,t]),React.useEffect(()=>{var i;(i=e==null?void 0:e.backViewInstance)==null||i.initSize(t)},[t]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:React__default.default.createElement(index,{title:x("BackView")}),titleOnSurface:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:o}),!c&&!d&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Back})))};var PointCloudBackView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudBackView);module.exports=PointCloudBackView$1;
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index$1=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(n,s,l=1)=>{const{width:e,height:o}=s,t={x:n.x+e*l/2,y:n.y+o*l/2},c={x:s.width/2,y:s.height/2};return{offsetX:(c.x-t.x)/l,offsetY:-(c.y-t.y)/l}},updateBackViewByCanvas2D=(n,s,l,e,o)=>{const{offsetX:t,offsetY:c}=TransferCanvas2WorldOffset(n,l,s);if(o.camera.zoom=s,n){const d=Math.cos(e),f=Math.sin(e),x=t*d,C=t*f,{x:v,y:i,z:u}=o.initCameraPosition;o.camera.position.set(v+C,i-x,u+c)}o.camera.updateProjectionMatrix(),o.render()},PointCloudBackView=({currentData:n,config:s,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),o=React.useRef(null),t=useSize(o),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:d}=useSphere.useSphere(),{syncBackviewToolZoom:f}=useZoom.useZoom(),{t:x}=reactI18next.useTranslation(),{backViewUpdateBox:C,backViewUpdatePoint:v}=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(o.current){const i={width:o.current.clientWidth,height:o.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:o.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:s,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setBackViewInstance(u)}},[]),React.useEffect(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:i,pointCloudInstance:u}=e.backViewInstance;i.singleOn("renderZoom",(r,a)=>{if(e.selectedPointCloudBox){updateBackViewByCanvas2D(a,r,t,e.selectedPointCloudBox.rotation,u),f(a,r,t);return}if(d){updateBackViewByCanvas2D(a,r,t,0,u),f(a,r,t);return}}),i.singleOn("dragMove",({currentPos:r,zoom:a})=>{!e.selectedPointCloudBox&&!d||updateBackViewByCanvas2D(r,a,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,u)}),i.singleOn("updatePointByDrag",(r,a)=>{d&&(v==null||v(r,a[0]))}),i.singleOn("updatePolygonByDrag",r=>{if(e.selectedIDs.length===1&&r.length===1){const{newPolygon:a,originPolygon:p}=r[0];a&&p&&C(a,p)}})},[e,t]),React.useEffect(()=>{var i;(i=e==null?void 0:e.backViewInstance)==null||i.initSize(t)},[t]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:React__default.default.createElement(index,{title:x("BackView")}),titleOnSurface:!0,titleNonInteractive:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:o}),!c&&!d&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Back})))};var PointCloudBackView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudBackView);module.exports=PointCloudBackView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(n,e,i)=>e in n?__defProp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,__spreadValues=(n,e)=>{for(var i in e||(e={}))__hasOwnProp.call(e,i)&&__defNormalProp(n,i,e[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(e))__propIsEnum.call(e,i)&&__defNormalProp(n,i,e[i]);return n},__spreadProps=(n,e)=>__defProps(n,__getOwnPropDescs(e)),__async=(n,e,i)=>new Promise((h,C)=>{var I=P=>{try{f(i.next(P))}catch(s){C(s)}},_=P=>{try{f(i.throw(P))}catch(s){C(s)}},f=P=>P.done?h(P.value):Promise.resolve(P.value).then(I,_);f((i=i.apply(n,e)).next())});const PointCloudContext=React__default.default.createContext({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:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:n=>{},imageSizes:{},cacheImageNodeSize:()=>{}}),PointCloudProvider=({children:n})=>{const[e,i]=React.useState([]),[h,C]=React.useState([]),[I,_]=React.useState([]),[f,P]=React.useState([]),[s,A]=React.useState([]),[m,x]=React.useState([]),[R,$]=React.useState(!0),[j,tt]=React.useState(!0),[z,et]=React.useState(1),[a,N]=React.useState(),[q,M]=React.useState(),[G,T]=React.useState(),[l,F]=React.useState(),[Z,ot]=React.useState(""),[V,nt]=React.useState(lbAnnotation.EToolName.Rect),it=React.useRef(new lbAnnotation.ActionsHistory).current,[c,B]=React.useState([]),[k,st]=React.useState(""),[O,lt]=React.useState(lbUtils.EPointCloudPattern.Detection),[S,U]=React.useState(void 0),[H,rt]=React.useState([]),[E,at]=React.useState([]),p=index(),[J,ut]=React.useState({}),dt=ctx.useDispatch(),ct=r=>{const{imgNode:u,path:d}=r;d&&u&&ut(g=>__spreadProps(__spreadValues({},g),{[d]:{width:u.width,height:u.height}}))},K=React.useMemo(()=>s.length===1?s[0]:"",[s]),D=React.useMemo(()=>{const r=e.find(t=>t.id===K),u=t=>{const o=e.concat(t);return i(o),o},d=t=>{const o=h.concat(t);return C(o),o},g=t=>{$(t!==!1)},v=t=>{t===void 0&&A([]),typeof t=="string"&&A([t]),Array.isArray(t)&&A(Array.from(new Set(t)))},vt=t=>{s.includes(t)?v(s.filter(o=>o!==t)):v([...s,t])},Pt=t=>{m.includes(t)?x([]):x([t])},gt=()=>{if(V===lbAnnotation.EToolName.Rect){const t=e.map(o=>o.id);v(t),a==null||a.pointCloud2dOperation.setSelectedIDs(t)}},ft=t=>{v(e.filter(o=>o.attribute===t).map(o=>o.id))},Q=e.filter(t=>!c.includes(t.attribute)),W=h.filter(t=>!c.includes(t.attribute)),X=f.filter(t=>t.attribute&&!c.includes(t.attribute)),ht=t=>{if(c.includes(t))B(c.filter(o=>o!==t));else{const o=c.concat(t);B(o)}},St=(t=Q,o=I,y=W,w=X,L=H)=>{var b;l==null||l.clearAllBox(),l==null||l.clearAllSphere(),a==null||a.updatePolygonList(t,o),a==null||a.updatePointList(y),a==null||a.updateLineList(w),l==null||l.generateBoxes(t),l==null||l.generateSpheres(y),(b=S==null?void 0:S.store)==null||b.updateCurrentSegment(L),Y(t)},bt=()=>{N(void 0),M(void 0),T(void 0),F(void 0)},Y=(t,o)=>__async(void 0,null,function*(){var y;if(!l)return;const w=l.pointCloudObject;if(!!w)try{const L=yield l.getHighlightIndexByMappingImgList({mappingImgList:o!=null?o:E,points:w.geometry.attributes.position.array}),b=yield l==null?void 0:l.highlightOriginPointCloud(t,L);return b&&((y=a==null?void 0:a.pointCloudInstance)==null||y.updateColor(b)),b}catch(L){console.error(L)}});return{selectedID:K,pointCloudBoxList:e,pointCloudSphereList:h,displayPointCloudList:Q,displaySphereList:W,displayLineList:X,selectedIDs:s,setPointCloudResult:i,setSelectedIDs:v,addPointCloudBox:u,addPointCloudSphere:d,setPointCloudSphereList:C,valid:R,selectedPointCloudBox:r,setPointCloudValid:g,addSelectedID:vt,addHighlightID:Pt,selectedAllBoxes:gt,topViewInstance:a,setTopViewInstance:N,sideViewInstance:q,setSideViewInstance:M,backViewInstance:G,setBackViewInstance:T,mainViewInstance:l,setMainViewInstance:F,polygonList:I,setPolygonList:_,lineList:f,setLineList:P,zoom:z,setZoom:et,history:it,toggleAttributesVisible:ht,hideAttributes:c,setHideAttributes:B,reRender:St,attrPanelLayout:k,setAttrPanelLayout:st,syncAllViewPointCloudColor:Y,defaultAttribute:Z,setDefaultAttribute:ot,pointCloudPattern:V,setPointCloudPattern:nt,selectSpecAttr:ft,globalPattern:O,setGlobalPattern:t=>{O!==t&&(dt(actionCreators.ChangeSave),lt(t),t===lbUtils.EPointCloudPattern.Detection&&U(void 0))},ptSegmentInstance:S,setPtSegmentInstance:U,segmentation:H,setSegmentation:rt,clearAllDetectionInstance:bt,highlight2DDataList:E,setHighlight2DDataList:at,cuboidBoxIn2DView:j,setCuboidBoxIn2DView:tt,imageSizes:J,cacheImageNodeSize:ct,highlightIDs:m,setHighlightIDs:x}},[R,s,e,h,I,f,a,q,G,l,z,c,k,Z,V,O,S,H,E,j,J,m]);React.useEffect(()=>{var r,u,d;(r=p==null?void 0:p.setPointCloudBoxList)==null||r.call(p,e),(u=p==null?void 0:p.setHighlightIDs)==null||u.call(p,m),(d=p==null?void 0:p.setSelectedIDs)==null||d.call(p,s)},[e,s,m]),React.useEffect(()=>{var r;(r=p==null?void 0:p.setPtCtx)==null||r.call(p,D)},[D]);const pt=()=>{const r=e.filter(v=>c.includes(v.attribute)),{setSelectedIDs:u,reRender:d}=D,g=r.map(v=>v.id);g.length>0&&u(s.filter(v=>!g.includes(v))),d()};return React.useEffect(()=>{var r,u,d,g;pt(),(u=(r=a==null?void 0:a.toolInstance)==null?void 0:r.setHiddenAttributes)==null||u.call(r,c),(g=(d=S==null?void 0:S.store)==null?void 0:d.setHiddenAttributes)==null||g.call(d,c)},[c]),React__default.default.createElement(PointCloudContext.Provider,{value:D},n)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash"),map=require("./utils/map.js"),useTimeoutFunc=require("./hooks/useTimeoutFunc.js"),useWindowKeydownListener=require("./hooks/useWindowKeydownListener.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,i,d)=>i in r?__defProp(r,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[i]=d,__spreadValues=(r,i)=>{for(var d in i||(i={}))__hasOwnProp.call(i,d)&&__defNormalProp(r,d,i[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(i))__propIsEnum.call(i,d)&&__defNormalProp(r,d,i[d]);return r},__spreadProps=(r,i)=>__defProps(r,__getOwnPropDescs(i)),__async=(r,i,d)=>new Promise((x,D)=>{var A=u=>{try{I(d.next(u))}catch(R){D(R)}},O=u=>{try{I(d.throw(u))}catch(R){D(R)}},I=u=>u.done?x(u.value):Promise.resolve(u.value).then(A,O);I((d=d.apply(r,i)).next())});const pickRectObject=r=>___default.default.pick(r,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:r=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:r=>!1,removeRectBySpecifyId:(r,i,d)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener()}),PointCloudProvider=({children:r})=>{const[i,d]=React.useState([]),[x,D]=React.useState([]),[A,O]=React.useState([]),[I,u]=React.useState([]),[R,Re]=React.useState([]),[v,N]=React.useState([]),[B,j]=React.useState([]),[U,xe]=React.useState(!0),[Z,Le]=React.useState(2),[J,De]=React.useState(!0),[Q,Ae]=React.useState(1),[f,X]=React.useState(),[Y,$]=React.useState(),[ee,te]=React.useState(),[g,oe]=React.useState(),[ne,Be]=React.useState(""),[F,_e]=React.useState(lbAnnotation.EToolName.Rect),q=React.useRef(new lbAnnotation.ActionsHistory).current,[p,T]=React.useState([]),[ie,Ve]=React.useState(""),[z,Ne]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,se]=React.useState(void 0),[W,He]=React.useState([]),[G,Me]=React.useState([]),[re,ke]=React.useState(!1),h=index(),[le,Ee]=React.useState({}),Oe=ctx.useDispatch(),je=o=>{const{imgNode:n,path:t}=o;t&&n&&Ee(a=>__spreadProps(__spreadValues({},a),{[t]:{width:n.width,height:n.height}}))},ae=React.useMemo(()=>v.length===1?v[0]:"",[v]),de=useWindowKeydownListener.default(),H=React.useCallback((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return u(c=>{let S=!1;const P=c.filter(k=>{const K=k[a],E=l.has(K)?k.imageName!==o:!0;return E||(S=!0),E});return S?P:c}),!0},[]),ce=React.useCallback(o=>{const n=i.map(t=>t.id);return H(o,n,"extId")},[i,H]),ue=React.useCallback(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:c}=t,S=t.rects.find(P=>P.imageName===o);if(S){const P=___default.default.pick(S,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},P),{id:lbAnnotation.uuid(),attribute:l,order:c,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const a=new Set(t.filter(c=>o===c.imageName).map(c=>c.extId)),l=n.filter(c=>a.has(c.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),ge=React.useMemo(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:c}=l;if(!c){console.warn("Missing image name"),console.trace(l,t);return}map.addMapIndirectWeakSetItem(n,c,t.id,t)}),n},new Map),[i]),fe=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),pe=React.useMemo(()=>I.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(map.addMapIndirectWeakSetItem(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,I),o)},new Map),[I]),{fn:Fe}=useTimeoutFunc.default(o=>{N(n=>{const t=o,a=new Set(t);let l=!1;const c=n.filter(S=>{const P=a.has(S);return P||(l=!0),P});return l?c:n})},200),he=React.useCallback(o=>{const n=o.map(t=>t.id);d(o),Fe(n)},[]),M=React.useMemo(()=>{const o=i.find(e=>e.id===ae),n=e=>{const s=i.concat(e);return he(s),s},t=e=>{const s=x.concat(e);return D(s),s},a=e=>{xe(e!==!1)},l=e=>{e===void 0&&N([]),typeof e=="string"&&N([e]),Array.isArray(e)&&N(Array.from(new Set(e)))},c=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},S=e=>{const s=pickRectObject(e);u(m=>[...m,s])},P=(e,s=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?s?__spreadValues(__spreadValues({},w),m):m:w))},k=e=>{u(s=>s.filter(m=>!e.find(C=>C.id===m.id)))},K=e=>{B.includes(e)?j([]):j([e])},E=()=>{if(F===lbAnnotation.EToolName.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Te=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},me=i.filter(e=>!p.includes(e.attribute)),ve=x.filter(e=>!p.includes(e.attribute)),Pe=R.filter(e=>e.attribute&&!p.includes(e.attribute)),ze=e=>{if(p.includes(e))T(p.filter(s=>s!==e));else{const s=p.concat(e);T(s)}},We=(e=me,s=A,m=ve,C=Pe,w=W)=>{var V;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(m),f==null||f.updateLineList(C),g==null||g.generateBoxes(e),g==null||g.generateSpheres(m),(V=L==null?void 0:L.store)==null||V.updateCurrentSegment(w),Ie(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Ge=()=>{X(void 0),$(void 0),te(void 0),oe(void 0)},Ie=(e,s,m)=>__async(void 0,null,function*(){var C,w,V;if(!g)return;const Se=g.pointCloudObject;if(!Se)return;let Ce=[],we=[];try{if(s&&q.record.length){const{record:y,recordIndex:b}=q;let ye=b;b>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&s.length===((C=y[b])==null?void 0:C.pointCloudBoxList.length))&&(ye=b-1);let Ke=(w=y[ye])==null?void 0:w.pointCloudBoxList;const be=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,s,Ke);Ce=be.modifiedBoxIds,we=be.resetAreas}}catch(y){console.error("call calcResetAreasAndBoxIds error",y)}try{const y=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:G,points:Se.geometry.attributes.position.array}),b=yield g==null?void 0:g.highlightOriginPointCloud(s,y,{modifiedBoxIds:Ce,resetAreas:we});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(y){console.error("call highlightOriginPointCloud error",y)}});return{selectedID:ae,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:me,displaySphereList:ve,displayLineList:Pe,selectedIDs:v,setPointCloudResult:he,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:D,valid:U,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:c,addHighlightID:K,selectedAllBoxes:E,topViewInstance:f,setTopViewInstance:X,sideViewInstance:Y,setSideViewInstance:$,backViewInstance:ee,setBackViewInstance:te,mainViewInstance:g,setMainViewInstance:oe,polygonList:A,setPolygonList:O,rectList:I,setRectList:u,addRectIn2DView:S,removeRectIn2DView:k,updateRectIn2DView:P,lineList:R,setLineList:Re,zoom:Q,setZoom:Ae,history:q,toggleAttributesVisible:ze,hideAttributes:p,setHideAttributes:T,reRender:We,attrPanelLayout:ie,setAttrPanelLayout:Ve,syncAllViewPointCloudColor:Ie,defaultAttribute:ne,setDefaultAttribute:Be,pointCloudPattern:F,setPointCloudPattern:_e,selectSpecAttr:Te,globalPattern:z,setGlobalPattern:e=>{z!==e&&(Oe(actionCreators.ChangeSave),Ne(e),e===lbUtils.EPointCloudPattern.Detection&&se(void 0))},ptSegmentInstance:L,setPtSegmentInstance:se,segmentation:W,setSegmentation:He,clearAllDetectionInstance:Ge,highlight2DDataList:G,setHighlight2DDataList:Me,highlight2DLoading:re,setHighlight2DLoading:ke,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:De,imageSizes:le,cacheImageNodeSize:je,highlightIDs:B,setHighlightIDs:j,removeRectByPointCloudBoxId:ce,removeRectBySpecifyId:H,addRectFromPointCloudBoxByImageName:ue,rectRotateSensitivity:Z,setRectRotateSensitivity:Le,imageNamePointCloudBoxMap:ge,linkageImageNameRectMap:pe,updateRectListByReducer:fe,windowKeydownListenerHook:de}},[U,v,i,x,A,R,I,f,Y,ee,g,Q,p,ie,ne,F,z,L,W,G,re,J,le,B,ce,H,ue,Z,ge,pe,fe,de]);React.useEffect(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,B),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,B]),React.useEffect(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const qe=()=>{const o=i.filter(l=>p.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return React.useEffect(()=>{var o,n,t,a;qe(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,p),(a=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,p)},[p]),React__default.default.createElement(PointCloudContext.Provider,{value:M},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const DECIMAL_PLACES=2,DEFAULT_BOX_INFO_STYLE={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:12},SizeInfoForView=({perspectiveView:e})=>{const{pointCloudBoxList:t,selectedID:n}=React__default.default.useContext(PointCloudContext.PointCloudContext),u=t.find(a=>a.id===n),l=reactI18next.useTranslation(),{t:i}=l;if(n&&u){const{length:a,width:c,height:r}=lbUtils.PointCloudUtils.transferBox2Kitti(u),f=e===lbUtils.EPerspectiveView.Back?[{label:i("Width"),value:c},{label:i("Height"),value:r}]:[{label:i("Length"),value:a},{label:i("Height"),value:r}];return React__default.default.createElement("div",{style:__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)",pointerEvents:"none"})},f.map((s,o)=>React__default.default.createElement("span",{key:o,style:{marginRight:o===0?16:0}},`${s.label}: ${s.value.toFixed(DECIMAL_PLACES)}`)))}return null},BoxInfos=({checkMode:e,config:t,style:n})=>{const u=React__default.default.useContext(PointCloudContext.PointCloudContext),{selectedBox:l}=useSingleBox.useSingleBox(),[i,a]=React.useState([]),c=reactI18next.useTranslation(),{t:r,i18n:f}=c,s=n;return React.useEffect(()=>{var o,p;if(!l)return;const{length:b,width:v,height:x,rotation_y:P}=lbUtils.PointCloudUtils.transferBox2Kitti(l.info),{x:g,y:_,z:h}=l.info.center;let d=[{label:"x",value:g==null?void 0:g.toFixed(DECIMAL_PLACES)},{label:"y",value:_==null?void 0:_.toFixed(DECIMAL_PLACES)},{label:"z",value:h==null?void 0:h.toFixed(DECIMAL_PLACES)},{label:r("Length"),value:b==null?void 0:b.toFixed(DECIMAL_PLACES)},{label:r("Width"),value:v==null?void 0:v.toFixed(DECIMAL_PLACES)},{label:r("Height"),value:x==null?void 0:x.toFixed(DECIMAL_PLACES)},{label:r("Rotation_y"),value:(o=lbAnnotation.UnitUtils.rad2deg(P))==null?void 0:o.toFixed(DECIMAL_PLACES)}];(p=u.mainViewInstance)==null||p.filterPointsByBox(l.info).then(m=>{var y,C;if(!m){a(d);return}d.push({label:r("PointCount"),value:`${(C=(y=l.info)==null?void 0:y.count)!=null?C:0}`}),e===!0&&l.info.subAttribute&&t&&lbUtils.PointCloudUtils.getSubAttributeName(l.info.subAttribute,t).forEach(w=>d.push(w)),a(d)})},[l,f.language]),l?React__default.default.createElement("div",{style:n||__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{right:8,bottom:8})},i.map(o=>s?React__default.default.createElement("div",{key:o.label,style:{margin:"0px 4px"}},`${o.label}: ${o.value}`):React__default.default.createElement("div",{key:o.label},React__default.default.createElement("span",{style:{width:"38px",display:"inline-block",textAlign:"end"}},o.label),": ",React__default.default.createElement("span",null,o.value)))):null},PointCloudValidity=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{t}=reactI18next.useTranslation();return e.valid===!1?React__default.default.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",opacity:.7,left:0,top:0,fontSize:30,padding:"8px 16px",zIndex:20,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t("Invalid")):null};exports.BoxInfos=BoxInfos,exports.PointCloudValidity=PointCloudValidity,exports.SizeInfoForView=SizeInfoForView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:n,style:s,titleNonInteractive:l,titleOnSurface:r})=>React__default.default.createElement("div",{className:classNames__default.default([n,dom.getClassName("point-cloud-container")]),style:s},r?React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title-box"),style:{pointerEvents:l?"none":"auto"}},e):React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header")},e&&React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title")},e),a&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header-toolbar")},a)),t);exports.PointCloudContainer=PointCloudContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),useLine=require("./hooks/useLine.js"),reactI18next=require("react-i18next"),actionCreators=require("../../store/annotation/actionCreators.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useRotateEdge=require("./hooks/useRotateEdge.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),useLine=require("./hooks/useLine.js"),reactI18next=require("react-i18next"),actionCreators=require("../../store/annotation/actionCreators.js"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,r,l)=>r in u?__defProp(u,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[r]=l,__spreadValues=(u,r)=>{for(var l in r||(r={}))__hasOwnProp.call(r,l)&&__defNormalProp(u,l,r[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(r))__propIsEnum.call(r,l)&&__defNormalProp(u,l,r[l]);return u},__spreadProps=(u,r)=>__defProps(u,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:u,config:r,checkMode:l,configString:V,imgIndex:f,toolInstanceRef:i})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:E,selectNextBox:L,selectPrevBox:B,updateSelectedBox:C,deleteSelectedPointCloudBoxAndPolygon:q}=useSingleBox.useSingleBox(),{selectedSphere:P,updatePointCloudSphere:O}=useSphere.useSphere(),{clearAllResult:y,updatePointCloudPattern:A}=useStatus.useStatus(),{copySelectedBoxes:j,pasteSelectedBoxes:I,copiedBoxes:Y}=useBoxes.useBoxes({config:r}),{updateRotate:g}=useRotate.useRotate({currentData:u}),{updateRotateEdge:T}=useRotateEdge.useRotateEdge({currentData:u}),{updatePointCloudData:v,topViewSelectedChanged:h}=usePointCloudViews.usePointCloudViews(),{redo:m,undo:S,pushHistoryWithList:D,pushHistoryUnderUpdatePolygon:N,pushHistoryUnderUpdateLine:R}=useHistory.useHistory(),H=ctx.useDispatch(),{syncThreeViewsAttribute:x}=useAttribute.useAttribute(),{syncAllViewsConfig:K,reRenderTopViewRange:U}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{selectedLine:_}=useLine.useLine(),{t:w}=reactI18next.useTranslation(),z=ahooks.useLatest(u),b=t=>{var o;const{topViewInstance:s}=e;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(t)},F=(t,o)=>{var s,a;const{topViewInstance:c,mainViewInstance:n}=e;if(!c)return;const{pointCloud2dOperation:d}=c;switch(t){case"q":{g(e.rectRotateSensitivity);break}case"e":g(-Number(e.rectRotateSensitivity));break;case"g":T(-90);break;case"u":{const p=d.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;A(p);const W={[lbAnnotation.EToolName.Polygon]:w("PolygonPattern"),[lbAnnotation.EToolName.Rect]:w("RectPattern")};antd.message.success(w("ChangePatternMsg",{pattern:W[p]})),d.clearActiveStatus(),d.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){B();break}L(),o.preventDefault();break;case"f":E();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":q(z.current);break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const p=lbAnnotation.AttributeUtils.getAttributeByKeycode(o.keyCode,r.attributeList);p!==void 0&&((a=i.current)==null||a.setDefaultAttribute(p))}return}}},G=(t,o)=>{switch(t){case"c":j();break;case"v":I();break;case"a":o.preventDefault(),e.selectedAllBoxes();break;case"z":{o.shiftKey?m():S();break}}},M=ahooks.useLatest(t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||l===!0)return;const o=t.key.toLocaleLowerCase();if(t.ctrlKey){G(o,t);return}F(o,t)});return React.useEffect(()=>{if(!e.topViewInstance)return;const{addEventListener:o}=e.windowKeydownListenerHook;return o(c=>M.current(c))},[e,e.topViewInstance,e.windowKeydownListenerHook]),React.useEffect(()=>{K(r)},[V]),React.useEffect(()=>{(r==null?void 0:r.radius)&&U(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{v==null||v()},[f,e.mainViewInstance]),React.useEffect(()=>{e.setHideAttributes([])},[f]),React.useEffect(()=>{i.current.setDefaultAttribute=t=>{var o,s,a,c;x(t);const n=e.selectedPointCloudBox;if(n){n.attribute=t;const d=H(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[n],stepConfig:r,action:"viewUpdateBox"}));n.valid=d[0].valid;const p=C(n);(a=(s=(o=e==null?void 0:e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:s.setPolygonValidAndRender)==null||a.call(s,n.id,!0,n.valid),e.mainViewInstance&&h({newSelectedBox:n,newPointCloudList:p})}if(k&&N(__spreadProps(__spreadValues({},k),{attribute:t})),_&&R(__spreadProps(__spreadValues({},_),{attribute:t})),P){const d=O(__spreadProps(__spreadValues({},P),{attribute:t}));e.mainViewInstance&&((c=e.mainViewInstance)==null||c.generateSpheres(d),h({newSelectedSphere:P,newSphereList:d}))}},i.current.setSubAttribute=(t,o)=>{var s;const a=e.selectedPointCloudBox;if(a){const c=(s=a==null?void 0:a.subAttribute)!=null?s:{};a.subAttribute=__spreadProps(__spreadValues({},c),{[t]:o}),C(a)}},i.current.clearResult=()=>{y==null||y()},i.current.redo=()=>{m()},i.current.undo=()=>{S()},i.current.setValid=t=>{i.current.valid=t,setTimeout(()=>{e.setPointCloudValid(t),t===!1&&y()})},i.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)},i.current.setShowDefaultCursor=t=>{var o,s;(s=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(t)},i.current.asyncData=t=>{setTimeout(()=>{v==null||v(t)})}},[e.pointCloudBoxList,e.pointCloudSphereList,e.selectedID,e.valid,e.polygonList,e.lineList,e.mainViewInstance,e.ptSegmentInstance]),React.useEffect(()=>{i.current.updateSegmentTool=t=>{var o;(o=e.ptSegmentInstance)==null||o.emit(t)},i.current.segmentInstance=e.ptSegmentInstance},[e.ptSegmentInstance]),React.useEffect(()=>{i.current.history={pushHistory:t=>{D({pointCloudBoxList:t})},initRecord:()=>{}}},[]),React.useEffect(()=>{var t;const o=(t=e.topViewInstance)==null?void 0:t.toolInstance;if(!o||l)return;const s=n=>{x(n)},a=n=>{antd.message.error(n)},c=n=>{antd.message.info(n)};return o.on("syncAttribute",s),o.on("messageError",a),o.on("messageInfo",c),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",a),o.unbind("messageInfo",c)}},[e.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,
|
|
1
|
+
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,r,o)=>r in t?__defProp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,__spreadValues=(t,r)=>{for(var o in r||(r={}))__hasOwnProp.call(r,o)&&__defNormalProp(t,o,r[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(r))__propIsEnum.call(r,o)&&__defNormalProp(t,o,r[o]);return t},__spreadProps=(t,r)=>__defProps(t,__getOwnPropDescs(r));const PointCloudSegment2DSingleView=({path:t,url:r,fallbackUrl:o,calib:s,pcdUrl:u,highlightAttribute:c})=>{const{ptSegmentInstance:e,cacheImageNodeSize:y,imageSizes:x}=React.useContext(PointCloudContext.PointCloudContext),w=React.useRef(null),p=React.useRef(0),g=React.useRef({}),d=React.useRef(),[v,m]=React.useState([]),[D,P]=React.useState(!1),b=React.useRef(void 0);React.useEffect(()=>()=>{p.current=0,g.current={},d.current=void 0},[u]);const h=React.useCallback(()=>{var n,l,i;if(p.current=p.current+1,p.current===2){const a=(n=e==null?void 0:e.store)==null?void 0:n.originPoints;if(!a||!d.current){console.error("cacheMappingPCD2Img Error",{path:t,points:a,filterSize:d.current});return}g.current=(i=(l=lbAnnotation.pointMappingLidar2image(a,s,d.current))==null?void 0:l.pcdMapping)!=null?i:{}}},[e]),C=React.useMemo(()=>{const n=(l,i)=>{var a,S;if(l&&d.current){b.current&&((S=(a=b.current)==null?void 0:a.terminate)==null||S.call(a));const k=g.current,f=new highlightSegmentWorker;f.current=f,P(!0),f.postMessage({cacheMap:k,indexes:l,defaultRGBA:i}),f.onmessage=O=>{m(O.data.annotations),f.terminate(),P(!1),f.current=void 0}}};return _.debounce(n,100)},[]);React.useEffect(()=>{if(!(e==null?void 0:e.store))return;const n=e.store.getHighlightAttribute(c!=null?c:""),l=e==null?void 0:e.getColorFromConfig(c!=null?c:"");C(n.flat(),l.stroke)},[c,e]),React.useEffect(()=>{if(e){const n=({newAttribute:l})=>{const i=e==null?void 0:e.getColorFromConfig(l);i&&m(v.map(a=>__spreadProps(__spreadValues({},a),{defaultRGBA:i.stroke})))};return e.on("updateDefaultAttribute",n),()=>{e.unbind("updateDefaultAttribute",n)}}},[e,v]),React.useEffect(()=>{if(e){const n=l=>{if(l.cacheSegData){const{cacheSegData:i}=l;if(i==null?void 0:i.indexes){const a=e.getColorFromConfig(i.attribute);C(i==null?void 0:i.indexes,a.stroke)}}else m([])};return e.on("syncPointCloudStatus",n),e.on("loadPCDFileEnd",h),()=>{e.unbind("syncPointCloudStatus",n),e.unbind("loadPCDFileEnd",h)}}},[e,u,x]);const E=n=>{y({path:t,imgNode:n}),d.current={width:n.width,height:n.height},h()};return React__default.default.createElement("div",{key:t,style:{position:"relative"},ref:w},React__default.default.createElement(index,{title:s.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),React__default.default.createElement(antd.Spin,{spinning:D,delay:1e3},React__default.default.createElement(index$1,{size:{width:300,height:200},key:t,src:r,fallbackSrc:o,annotations:v,afterImgOnLoad:E})))},PointCloudSegment2DView=({currentData:t,highlightAttribute:r})=>{var o;const s=(o=t.mappingImgList)!=null?o:[];return(s==null?void 0:s.length)>0?React__default.default.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},s==null?void 0:s.map((u,c)=>{var e;return u.calib&&React__default.default.createElement(PointCloudSegment2DSingleView,{key:u.path+c,path:u.path,url:u.url,fallbackUrl:(e=u.fallbackUrl)!=null?e:"",calib:u.calib,pcdUrl:t.url,highlightAttribute:r})})):null};var PointCloudSegment2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment2DView);module.exports=PointCloudSegment2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),index$1=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),useZoom=require("./hooks/useZoom.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:f,height:s}=l,c={x:t.x+f*e/2,y:t.y+s*e/2},a={x:l.width/2,y:l.height/2};return{offsetX:(a.x-c.x)/e,offsetY:-(a.y-c.y)/e}},updateSideViewByCanvas2D=(t,l,e,f,s)=>{const{offsetX:c,offsetY:a}=TransferCanvas2WorldOffset(t,e,l);if(s.camera.zoom=l,t){const u=Math.cos(f),n=Math.sin(f),x=c*u,v=c*n,{x:i,y:d,z:o}=s.initCameraPosition;s.camera.position.set(i-x,d-v,o+a)}s.camera.updateProjectionMatrix(),s.render()},PointCloudSideView=({config:t,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:f,sideViewUpdatePoint:s}=usePointCloudViews.usePointCloudViews(),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:a}=useSphere.useSphere(),u=React.useRef(null),n=useSize(u),{t:x}=reactI18next.useTranslation(),{syncSideviewToolZoom:v}=useZoom.useZoom();return React.useEffect(()=>{if(u.current){const i={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:t,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setSideViewInstance(d)}},[]),React.useEffect(()=>{if(!n||!e.sideViewInstance)return;const{toolInstance:i,pointCloudInstance:d}=e.sideViewInstance;i.singleOn("renderZoom",(o,r)=>{if(e.selectedPointCloudBox){updateSideViewByCanvas2D(r,o,n,e.selectedPointCloudBox.rotation,d),v(r,o,n);return}a&&(updateSideViewByCanvas2D(r,o,n,0,d),v(r,o,n))}),i.singleOn("dragMove",({currentPos:o,zoom:r})=>{!e.selectedPointCloudBox&&!a||updateSideViewByCanvas2D(o,r,n,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,d)}),i.singleOn("updatePointByDrag",(o,r)=>{a&&(s==null||s(o,r[0]))}),i.singleOn("updatePolygonByDrag",o=>{if(e.selectedIDs.length===1&&o.length===1){const{newPolygon:r,originPolygon:C}=o[0];f(r,C)}})},[e,n]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(n)},[n]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:React__default.default.createElement(index,{title:x("SideView")}),titleOnSurface:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:u}),!c&&!a&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),index$1=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),useZoom=require("./hooks/useZoom.js"),index=require("./components/TitleButton/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:f,height:s}=l,c={x:t.x+f*e/2,y:t.y+s*e/2},a={x:l.width/2,y:l.height/2};return{offsetX:(a.x-c.x)/e,offsetY:-(a.y-c.y)/e}},updateSideViewByCanvas2D=(t,l,e,f,s)=>{const{offsetX:c,offsetY:a}=TransferCanvas2WorldOffset(t,e,l);if(s.camera.zoom=l,t){const u=Math.cos(f),n=Math.sin(f),x=c*u,v=c*n,{x:i,y:d,z:o}=s.initCameraPosition;s.camera.position.set(i-x,d-v,o+a)}s.camera.updateProjectionMatrix(),s.render()},PointCloudSideView=({config:t,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:f,sideViewUpdatePoint:s}=usePointCloudViews.usePointCloudViews(),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:a}=useSphere.useSphere(),u=React.useRef(null),n=useSize(u),{t:x}=reactI18next.useTranslation(),{syncSideviewToolZoom:v}=useZoom.useZoom();return React.useEffect(()=>{if(u.current){const i={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:t,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setSideViewInstance(d)}},[]),React.useEffect(()=>{if(!n||!e.sideViewInstance)return;const{toolInstance:i,pointCloudInstance:d}=e.sideViewInstance;i.singleOn("renderZoom",(o,r)=>{if(e.selectedPointCloudBox){updateSideViewByCanvas2D(r,o,n,e.selectedPointCloudBox.rotation,d),v(r,o,n);return}a&&(updateSideViewByCanvas2D(r,o,n,0,d),v(r,o,n))}),i.singleOn("dragMove",({currentPos:o,zoom:r})=>{!e.selectedPointCloudBox&&!a||updateSideViewByCanvas2D(o,r,n,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,d)}),i.singleOn("updatePointByDrag",(o,r)=>{a&&(s==null||s(o,r[0]))}),i.singleOn("updatePolygonByDrag",o=>{if(e.selectedIDs.length===1&&o.length===1){const{newPolygon:r,originPolygon:C}=o[0];f(r,C)}})},[e,n]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(n)},[n]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:React__default.default.createElement(index,{title:x("SideView")}),titleOnSurface:!0,titleNonInteractive:!0},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:u}),!c&&!a&&React__default.default.createElement(index$1,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js"),_=require("lodash"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:C,height:c}=l,w={x:o.x+C*s/2,y:o.y+c*s/2},g={x:l.width/2,y:l.height/2};return{offsetX:(g.x-w.x)/s,offsetY:-(g.y-w.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:C,zoomIn:c,zoomOut:w,initialPosition:g}=useZoom.useZoom(),{selectNextBox:V,selectPrevBox:S}=useSingleBox.useSingleBox(),{switchToNextSphere:y}=useSphere.useSphere(),{updateRotate:P}=useRotate.useRotate({currentData:o}),x=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:E}=x,I=(s=(l=x==null?void 0:x.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),p=2,e=()=>{P(-p)},r=()=>{P(p)},f=()=>{P(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:L=>{var h;(h=E==null?void 0:E.pointCloudInstance)==null||h.updatePointSize({customSize:L})}}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:f,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.descend);return}S(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.ascend);return}V(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:g,zoomIn:c,zoomOut:w,zoom:C}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:C=>{o(C)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:C,checkMode:c,intelligentFit:w,setIsEnlargeTopView:g,isEnlargeTopView:V,onExitZoom:S,highlightAttribute:y})=>{var P,x;const[E,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),p=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),r=useSize(p),f=index.jsonParser(s.config),{setZoom:L,syncTopviewToolZoom:h}=useZoom.useZoom(),{hideAttributes:D}=e,{addPolygon:B,deletePolygon:R}=usePolygon.usePolygon(),{deletePointCloudSphere:U}=useSphere.useSphere(),{deletePointCloudBox:Z,changeValidByID:z}=useSingleBox.useSingleBox(),[b,H]=React.useState(10),{t:k}=reactI18next.useTranslation(),m=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:F}=useHistory.useHistory();React.useLayoutEffect(()=>{if(!e.topViewInstance&&p.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:p.current.clientWidth,height:p.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:p.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:c,toolName:ToolUtils.getPointCloudToolList(),proxyMode:c});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!r||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(u=>__spreadProps(__spreadValues({},u),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(u.pointList,r)}));e.setSelectedIDs(i),e.setLineList(d),F({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{m.topViewAddSphere({newPoint:t,size:r,trackConfigurable:f.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{U(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=m.topViewUpdatePoint)==null||d.call(m,t,r)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,r))});B(d),e.setSelectedIDs(D.includes(t.attribute)?"":t.id);return}m.topViewAddBox({polygon:t,size:r,imgList:l,trackConfigurable:f.trackConfigurable,zoom:i,intelligentFit:w})}),n.singleOn("deletedObject",({id:t})=>{Z(t),R(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=m.topViewUpdateBox)==null||i.call(m,t,r)});const a=t=>{var i;const d=z(t);d&&e.syncAllViewPointCloudColor(d),e.polygonList.find(u=>u.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,r,o,m,e.polygonList,e.lineList,(P=e.topViewInstance)==null?void 0:P.toolInstance]),React.useEffect(()=>{var n,a;if(!(r==null?void 0:r.width)||!e.topViewInstance)return;const t=(a=(n=f==null?void 0:f.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(r),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(u,v)=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(v,r,u);if(i.camera.zoom=u,v){const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N)}i.camera.updateProjectionMatrix(),i.render(),L(u),h(v,u,r),I({zoom:u,currentPos:v})}),d.singleOn("dragMove",({currentPos:u,zoom:v})=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(u,r,v);i.camera.zoom=v;const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N),i.render(),h(u,v,r),I({zoom:v,currentPos:u})})},[r,e.topViewInstance,(x=e.topViewInstance)==null?void 0:x.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(b)},[b]),React.useEffect(()=>{var n,a,t,i;m.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>(window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}),[]);const A=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&S()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,y)},[e.topViewInstance,y]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:V?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{S()}}),React__default.default.createElement("span",null,k("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:k("TopView"),onClick:()=>{g(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:p},C==null?void 0:C(E)),!V&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f}),React__default.default.createElement(ZAxisSlider,{checkMode:c,zAxisLimit:b,setZAxisLimit:H}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useRotateEdge=require("./hooks/useRotateEdge.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js"),_=require("lodash"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:C,height:c}=l,w={x:o.x+C*s/2,y:o.y+c*s/2},P={x:l.width/2,y:l.height/2};return{offsetX:(P.x-w.x)/s,offsetY:-(P.y-w.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:C,zoomIn:c,zoomOut:w,initialPosition:P}=useZoom.useZoom(),{selectNextBox:S,selectPrevBox:V}=useSingleBox.useSingleBox(),{switchToNextSphere:x}=useSphere.useSphere(),{updateRotate:y}=useRotate.useRotate({currentData:o}),{updateRotateEdge:E}=useRotateEdge.useRotateEdge({currentData:o}),g=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:I}=g,p=(s=(l=g==null?void 0:g.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),e=()=>{y(-Number(g.rectRotateSensitivity))},r=()=>{y(g.rectRotateSensitivity)},f=()=>{E(-90)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:b=>{var h;(h=I==null?void 0:I.pointCloudInstance)==null||h.updatePointSize({customSize:b})}}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:f,className:dom.getClassName("point-cloud","rotate-90")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(p===EToolName.Point){x(ESortDirection.descend);return}V(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(p===EToolName.Point){x(ESortDirection.ascend);return}S(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:P,zoomIn:c,zoomOut:w,zoom:C}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:C=>{o(C)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:C,checkMode:c,intelligentFit:w,setIsEnlargeTopView:P,isEnlargeTopView:S,onExitZoom:V,highlightAttribute:x})=>{var y,E;const[g,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),p=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),r=useSize(p),f=index.jsonParser(s.config),{setZoom:b,syncTopviewToolZoom:h}=useZoom.useZoom(),{hideAttributes:B}=e,{addPolygon:A,deletePolygon:D}=usePolygon.usePolygon(),{deletePointCloudSphere:U}=useSphere.useSphere(),{deletePointCloudBox:Z,changeValidByID:H}=useSingleBox.useSingleBox(),[L,z]=React.useState(10),{t:N}=reactI18next.useTranslation(),m=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:F}=useHistory.useHistory();React.useLayoutEffect(()=>{if(!e.topViewInstance&&p.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:p.current.clientWidth,height:p.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:p.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:c,toolName:ToolUtils.getPointCloudToolList(),proxyMode:c});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!r||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(u=>__spreadProps(__spreadValues({},u),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(u.pointList,r)}));e.setSelectedIDs(i),e.setLineList(d),F({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{m.topViewAddSphere({newPoint:t,size:r,trackConfigurable:f.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{U(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=m.topViewUpdatePoint)==null||d.call(m,t,r)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,r))});A(d),e.setSelectedIDs(B.includes(t.attribute)?"":t.id);return}m.topViewAddBox({polygon:t,size:r,imgList:l,trackConfigurable:f.trackConfigurable,zoom:i,intelligentFit:w})}),n.singleOn("deletedObject",({id:t})=>{Z(t),D(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=m.topViewUpdateBox)==null||i.call(m,t,r)});const a=t=>{var i;const d=H(t);d&&e.syncAllViewPointCloudColor(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,d),e.polygonList.find(u=>u.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,r,o,m,e.polygonList,e.lineList,(y=e.topViewInstance)==null?void 0:y.toolInstance]),React.useEffect(()=>{var n,a;if(!(r==null?void 0:r.width)||!e.topViewInstance)return;const t=(a=(n=f==null?void 0:f.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(r),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(u,v)=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(v,r,u);if(i.camera.zoom=u,v){const{x:j,y:T,z:R}=i.initCameraPosition;i.camera.position.set(j+q,T-O,R)}i.camera.updateProjectionMatrix(),i.render(),b(u),h(v,u,r),I({zoom:u,currentPos:v})}),d.singleOn("dragMove",({currentPos:u,zoom:v})=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(u,r,v);i.camera.zoom=v;const{x:j,y:T,z:R}=i.initCameraPosition;i.camera.position.set(j+q,T-O,R),i.render(),h(u,v,r),I({zoom:v,currentPos:u})})},[r,e.topViewInstance,(E=e.topViewInstance)==null?void 0:E.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(L)},[L]),React.useEffect(()=>{var n,a,t,i;m.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>(window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}),[]);const k=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&V()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,x)},[e.topViewInstance,x]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:S?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{V()}}),React__default.default.createElement("span",null,N("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:N("TopView"),onClick:()=>{P(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:p},C==null?void 0:C(g)),!S&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f}),React__default.default.createElement(ZAxisSlider,{checkMode:c,zAxisLimit:L,setZAxisLimit:z}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|