@labelbee/lb-components 1.11.0 → 1.12.0-alpha.10

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.
Files changed (121) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/assets/annotation/pointCloudTool/addSvg.svg.js +1 -0
  3. package/dist/assets/annotation/pointCloudTool/cancel.svg.js +1 -0
  4. package/dist/assets/annotation/pointCloudTool/circleSelector.svg.js +1 -0
  5. package/dist/assets/annotation/pointCloudTool/circleSelector_a.svg.js +1 -0
  6. package/dist/assets/annotation/pointCloudTool/clearSvg.svg.js +1 -0
  7. package/dist/assets/annotation/pointCloudTool/coverMode.svg.js +1 -0
  8. package/dist/assets/annotation/pointCloudTool/finish.svg.js +1 -0
  9. package/dist/assets/annotation/pointCloudTool/lassoSelector.svg.js +1 -0
  10. package/dist/assets/annotation/pointCloudTool/lassoSelector_a.svg.js +1 -0
  11. package/dist/assets/annotation/pointCloudTool/svg.js +1 -0
  12. package/dist/assets/annotation/pointCloudTool/unCoverMode.svg.js +1 -0
  13. package/dist/components/AnnotationView/pointCloudAnnotationView.js +1 -1
  14. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  15. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  16. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  17. package/dist/components/pointCloudView/PointCloudSegment.js +1 -0
  18. package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -0
  19. package/dist/components/pointCloudView/PointCloudSegmentStatus.js +1 -0
  20. package/dist/components/pointCloudView/PointCloudSegmentToolbar.js +1 -0
  21. package/dist/components/pointCloudView/hooks/useAttribute.js +1 -1
  22. package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
  23. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  24. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  25. package/dist/components/pointCloudView/hooks/useSphere.js +1 -1
  26. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  27. package/dist/components/pointCloudView/index.js +1 -1
  28. package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
  29. package/dist/components/predictTracking/previewResult/index.js +1 -1
  30. package/dist/hooks/annotation.js +1 -1
  31. package/dist/index.css +54 -0
  32. package/dist/index.js +1 -1
  33. package/dist/store/Actions.js +1 -1
  34. package/dist/store/annotation/actionCreators.js +1 -1
  35. package/dist/store/annotation/map.js +1 -1
  36. package/dist/store/annotation/reducer.js +1 -1
  37. package/dist/types/App.d.ts +6 -8
  38. package/dist/types/assets/annotation/pointCloudTool/svg.d.ts +7 -0
  39. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
  40. package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +1 -1
  41. package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +1 -1
  42. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +18 -7
  43. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +3 -1
  44. package/dist/types/components/pointCloudView/PointCloudSegment.d.ts +9 -0
  45. package/dist/types/components/pointCloudView/PointCloudSegmentListener.d.ts +11 -0
  46. package/dist/types/components/pointCloudView/PointCloudSegmentStatus.d.ts +3 -0
  47. package/dist/types/components/pointCloudView/PointCloudSegmentToolbar.d.ts +3 -0
  48. package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +1 -1
  49. package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +1 -1
  50. package/dist/types/components/pointCloudView/hooks/useAttribute.d.ts +1 -0
  51. package/dist/types/components/pointCloudView/hooks/useHistory.d.ts +3 -1
  52. package/dist/types/components/pointCloudView/hooks/useStatus.d.ts +2 -0
  53. package/dist/types/components/pointCloudView/index.d.ts +3 -4
  54. package/dist/types/components/predictTracking/predictTrackingIcon/index.d.ts +1 -1
  55. package/dist/types/hooks/annotation.d.ts +3 -0
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/types/store/Actions.d.ts +1 -0
  58. package/dist/types/store/annotation/actionCreators.d.ts +3 -2
  59. package/dist/types/store/annotation/map.d.ts +2 -0
  60. package/dist/types/store/annotation/reducer.d.ts +1 -0
  61. package/dist/types/store/annotation/types.d.ts +1 -0
  62. package/dist/types/typeTem.d.ts +12 -0
  63. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/index.d.ts +3 -0
  64. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.d.ts +2 -1
  65. package/dist/types/views/MainView/toolHeader/SwitchPattern/index.d.ts +12 -0
  66. package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  67. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  68. package/dist/views/MainView/sidebar/index.js +1 -1
  69. package/dist/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
  70. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  71. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  72. package/dist/views/MainView/toolFooter/PageNumber/index.js +1 -1
  73. package/dist/views/MainView/toolHeader/SwitchPattern/index.js +1 -0
  74. package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
  75. package/dist/views/MainView/toolHeader/index.js +1 -1
  76. package/es/App.js +1 -1
  77. package/es/assets/annotation/pointCloudTool/addSvg.svg.js +1 -0
  78. package/es/assets/annotation/pointCloudTool/cancel.svg.js +1 -0
  79. package/es/assets/annotation/pointCloudTool/circleSelector.svg.js +1 -0
  80. package/es/assets/annotation/pointCloudTool/circleSelector_a.svg.js +1 -0
  81. package/es/assets/annotation/pointCloudTool/clearSvg.svg.js +1 -0
  82. package/es/assets/annotation/pointCloudTool/coverMode.svg.js +1 -0
  83. package/es/assets/annotation/pointCloudTool/finish.svg.js +1 -0
  84. package/es/assets/annotation/pointCloudTool/lassoSelector.svg.js +1 -0
  85. package/es/assets/annotation/pointCloudTool/lassoSelector_a.svg.js +1 -0
  86. package/es/assets/annotation/pointCloudTool/svg.js +1 -0
  87. package/es/assets/annotation/pointCloudTool/unCoverMode.svg.js +1 -0
  88. package/es/components/AnnotationView/pointCloudAnnotationView.js +1 -1
  89. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  90. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  91. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  92. package/es/components/pointCloudView/PointCloudSegment.js +1 -0
  93. package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -0
  94. package/es/components/pointCloudView/PointCloudSegmentStatus.js +1 -0
  95. package/es/components/pointCloudView/PointCloudSegmentToolbar.js +1 -0
  96. package/es/components/pointCloudView/hooks/useAttribute.js +1 -1
  97. package/es/components/pointCloudView/hooks/useHistory.js +1 -1
  98. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  99. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  100. package/es/components/pointCloudView/hooks/useSphere.js +1 -1
  101. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  102. package/es/components/pointCloudView/index.js +1 -1
  103. package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
  104. package/es/components/predictTracking/previewResult/index.js +1 -1
  105. package/es/hooks/annotation.js +1 -1
  106. package/es/index.css +54 -0
  107. package/es/index.js +1 -1
  108. package/es/store/Actions.js +1 -1
  109. package/es/store/annotation/actionCreators.js +1 -1
  110. package/es/store/annotation/map.js +1 -1
  111. package/es/store/annotation/reducer.js +1 -1
  112. package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  113. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  114. package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
  115. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  116. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  117. package/es/views/MainView/toolFooter/PageNumber/index.js +1 -1
  118. package/es/views/MainView/toolHeader/SwitchPattern/index.js +1 -0
  119. package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
  120. package/es/views/MainView/toolHeader/index.js +1 -1
  121. package/package.json +3 -3
package/dist/App.js CHANGED
@@ -1 +1 @@
1
- "use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:P=1,stepList:i,onSubmit:s,onSave:l,onPageChange:c,onStepChange:u,initialIndex:d=0,toolInstance:_,setToolInstance:h,getFileData:p,pageSize:f=10,loadFileList:r,defaultLang:g="cn",skipBeforePageTurning:I,beforeRotate:v,checkMode:m=!1,intelligentFit:O=!0}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:s,stepList:i,step:P,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,skipBeforePageTurning:I,beforeRotate:v,checkMode:m})),S(),lbUtils.i18n.changeLanguage(g);const n=()=>{a(L=>L+1)};return lbUtils.i18n.on("languageChanged",n),()=>{lbUtils.i18n.off("languageChanged",n),actionCreators.InitAnnotationState(index.store.dispatch)}},[]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateInjectFunc({onSubmit:s,stepList:i,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,beforeRotate:v})),lbUtils.i18n.changeLanguage(g)},[s,i,p,f,r,l,c,u,g,v]),React.useEffect(()=>{h==null||h(_)},[_]);const S=()=>{r?actionCreators.loadImgList(index.store.dispatch,index.store.getState,d,!0).then(n=>{n&&index.store.dispatch(reducer.LoadFileAndFileData(d))}):o&&o.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:o}}),index.store.dispatch(reducer.LoadFileAndFileData(d)))};return React__default.default.createElement("div",null,React__default.default.createElement(es.ConfigProvider,{locale:lbUtils.i18n.language==="en"?enUS__default.default:zhCN__default.default},React__default.default.createElement(index$1,__spreadProps(__spreadValues({},e),{intelligentFit:O}))))},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var App$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(App);module.exports=App$1;
1
+ "use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:I=1,stepList:i,onSubmit:s,onSave:l,onPageChange:c,onStepChange:u,initialIndex:d=0,toolInstance:h,setToolInstance:P,getFileData:p,pageSize:f=10,loadFileList:r,defaultLang:g="cn",skipBeforePageTurning:m,beforeRotate:v,checkMode:O=!1,intelligentFit:S=!0,highlightAttribute:_=""}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:s,stepList:i,step:I,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,skipBeforePageTurning:m,beforeRotate:v,checkMode:O,highlightAttribute:_})),L(),lbUtils.i18n.changeLanguage(g);const n=()=>{a(b=>b+1)};return lbUtils.i18n.on("languageChanged",n),()=>{lbUtils.i18n.off("languageChanged",n),actionCreators.InitAnnotationState(index.store.dispatch)}},[]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateInjectFunc({onSubmit:s,stepList:i,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,beforeRotate:v,highlightAttribute:_})),lbUtils.i18n.changeLanguage(g)},[s,i,p,f,r,l,c,u,g,v,_]),React.useEffect(()=>{P==null||P(h)},[h]);const L=()=>{r?actionCreators.loadImgList(index.store.dispatch,index.store.getState,d,!0).then(n=>{n&&index.store.dispatch(reducer.LoadFileAndFileData(d))}):o&&o.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:o}}),index.store.dispatch(reducer.LoadFileAndFileData(d)))};return React__default.default.createElement("div",null,React__default.default.createElement(es.ConfigProvider,{locale:lbUtils.i18n.language==="en"?enUS__default.default:zhCN__default.default},React__default.default.createElement(index$1,__spreadProps(__spreadValues({},e),{intelligentFit:S}))))},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var App$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(App);module.exports=App$1;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='9.201172' height='9.200073' viewBox='0 0 9.20117 9.20007' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cpath id='Exclude' d='M8.20117 5.59998L5.60156 5.59998L5.60156 8.20007C5.60156 8.75232 5.15234 9.20007 4.60156 9.20007C4.04883 9.20007 3.60156 8.75232 3.60156 8.20007L3.60156 5.59998L1 5.59998C0.449219 5.59998 0 5.15234 0 4.59998C0 4.04773 0.449219 3.59998 1 3.59998L3.60156 3.59998L3.60156 1C3.60156 0.447754 4.04883 0 4.60156 0C5.15234 0 5.60156 0.447754 5.60156 1L5.60156 3.59998L8.20117 3.59998C8.75391 3.59998 9.20117 4.04773 9.20117 4.59998C9.20117 5.15234 8.75391 5.59998 8.20117 5.59998Z' fill-rule='evenodd' fill='%23999999'/%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='10.450195' height='10.420227' viewBox='0 0 10.4502 10.4202' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cpath id='%e9%94%99%e8%af%af' d='M10.1914 0.194397C9.93066 -0.0654907 9.50879 -0.0646973 9.24854 0.196106L5.21533 4.2442L1.16699 0.210693C0.90625 -0.0491943 0.484375 -0.0484619 0.224121 0.212402C-0.0356445 0.473206 -0.034668 0.895325 0.226074 1.15521L4.27393 5.18872L0.194336 9.28302C-0.0654297 9.54382 -0.0649414 9.96594 0.196289 10.2258C0.457031 10.4857 0.878906 10.4849 1.13867 10.2241L5.21875 6.12982L9.31299 10.2095C9.57373 10.4694 9.99609 10.4687 10.2559 10.2079C10.5156 9.94702 10.5151 9.52496 10.2539 9.26508L6.15967 5.1853L10.1934 1.13721C10.4531 0.876404 10.4526 0.454285 10.1914 0.194397Z' fill-rule='evenodd' fill='%23333333'/%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='24.000000' height='24.000000' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cmask id='mask1_15950' mask-type='alpha' maskUnits='userSpaceOnUse' x='0.000000' y='0.000000' width='24.000000' height='24.000000'%3e %3crect id='Frame 1312316549 (Background/Mask)' width='24.000000' height='24.000000' fill='%23C4C4C4'/%3e %3c/mask%3e %3cg mask='url(%23mask1_15950)'%3e %3ccircle id='Ellipse 1677' cx='12.000000' cy='12.000000' r='9.000000' stroke='%23999999' stroke-width='2.000000' stroke-dasharray='0 0'/%3e %3c/g%3e %3cg mask='url(%23mask1_15950)'%3e %3ccircle id='Ellipse 1678' cx='12.000000' cy='12.000000' r='4.000000' fill='%23999999'/%3e %3c/g%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='24.000000' height='24.000000' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cmask id='mask1_15950' mask-type='alpha' maskUnits='userSpaceOnUse' x='0.000000' y='0.000000' width='24.000000' height='24.000000'%3e %3crect id='Frame 1312316549 (Background/Mask)' width='24.000000' height='24.000000' fill='%231664FF'/%3e %3c/mask%3e %3cg mask='url(%23mask1_15950)'%3e %3ccircle id='Ellipse 1677' cx='12.000000' cy='12.000000' r='9.000000' stroke='%231664FF' stroke-width='2.000000' stroke-dasharray='0 0'/%3e %3c/g%3e %3cg mask='url(%23mask1_15950)'%3e %3ccircle id='Ellipse 1678' cx='12.000000' cy='12.000000' r='4.000000' fill='%231664FF'/%3e %3c/g%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='10.000000' height='2.000000' viewBox='0 0 10 2' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cpath id='%e6%b7%bb%e5%8a%a0' d='M4.44434 0L5.55566 0L9.44434 0C9.75146 0 10 0.447754 10 1C10 1.55225 9.75146 2 9.44434 2L5.55566 2L4.44434 2L0.555664 2C0.248535 2 0 1.55225 0 1C0 0.447754 0.248535 0 0.555664 0L4.44434 0Z' fill-rule='evenodd' fill='%23464A53'/%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='24px' height='24px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3ctitle%3eFrame 1312316531%3c/title%3e %3cdefs%3e %3crect id='path-1' x='0' y='0' width='24' height='24'%3e%3c/rect%3e %3c/defs%3e %3cg id='%e6%a0%87%e6%b3%a8%e5%b7%a5%e5%85%b7%e4%bc%98%e5%8c%96' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e %3cg id='%e7%82%b9%e4%ba%91%e5%b7%a5%e5%85%b7-%e5%88%86%e5%89%b2%e6%a8%a1%e5%bc%8f' transform='translate(-1432.000000%2c -88.000000)'%3e %3cg id='%e7%bc%96%e7%bb%84-10' transform='translate(1352.000000%2c 84.000000)'%3e %3cg id='Frame-1312316531' transform='translate(80.000000%2c 4.000000)'%3e %3cmask id='mask-2' fill='white'%3e %3cuse xlink:href='%23path-1'%3e%3c/use%3e %3c/mask%3e %3cg id='Frame-1312316531-(Background/Mask)'%3e%3c/g%3e %3cg id='Group-1312317594' mask='url(%23mask-2)'%3e %3cg transform='translate(3.000000%2c 3.000000)'%3e %3cpath d='M0%2c0 L14%2c0 L14%2c14 L0%2c14 L0%2c0 Z' id='Vector-205' stroke='white' stroke-width='2' fill='none' stroke-linejoin='round' stroke-dasharray='0%2c0'%3e%3c/path%3e %3cpath d='M4%2c3 L17%2c3 C17.5522847%2c3 18%2c3.44771525 18%2c4 L18%2c17 C18%2c17.5522847 17.5522847%2c18 17%2c18 L4%2c18 C3.44771525%2c18 3%2c17.5522847 3%2c17 L3%2c4 C3%2c3.44771525 3.44771525%2c3 4%2c3 Z' id='Vector-206' stroke='none' fill='white' fill-rule='evenodd'%3e%3c/path%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='13.666504' height='9.666687' viewBox='0 0 13.6665 9.66669' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cpath id='%e6%ad%a3%e7%a1%ae' d='M13.4761 1.1333L5.30957 9.46661C5.18164 9.59692 5.00635 9.66919 4.82373 9.66663C4.6416 9.664 4.46826 9.58679 4.34424 9.45294L0.177734 4.95294C-0.0727539 4.6828 -0.0566406 4.26099 0.213867 4.0108C0.483887 3.76068 0.905762 3.77692 1.15576 4.04706L4.84717 8.03357L12.5239 0.200073C12.7817 -0.0629272 13.2036 -0.0671997 13.4668 0.190552C13.7295 0.448242 13.7339 0.8703 13.4761 1.1333Z' fill-rule='evenodd' fill='%23333333'/%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='24.000000' height='24.000000' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cmask id='mask1_15945' mask-type='alpha' maskUnits='userSpaceOnUse' x='0.000000' y='0.000000' width='24.000000' height='24.000000'%3e %3crect id='Frame 1312316543 (Background/Mask)' width='24.000000' height='24.000000' fill='%23999999'/%3e %3c/mask%3e %3cg mask='url(%23mask1_15945)'%3e %3cpath id='Vector 197' d='M6.82031 21.1879C7.30859 20.8242 7.65674 20.4422 7.89697 20.0767C8.56055 19.0654 7.91553 17.8707 7.32861 16.813C6.78955 15.8416 6.34033 14.9126 5.68604 14.0402C3.5 11.1254 3.98877 7.18506 6.86133 4.94373C9.97998 2.51038 13.4199 2.427 15.9365 3.36963C16.5493 3.59912 17.186 3.94055 17.7881 4.3363C20.1196 5.86804 21.0063 8.93555 19.5503 11.3146C17.5649 14.5581 13.4385 15.5564 10.3657 15.641' stroke='%23999999' stroke-width='1.995000' stroke-linejoin='round' stroke-linecap='round' stroke-dasharray='0 0'/%3e %3c/g%3e %3cg mask='url(%23mask1_15945)'%3e %3cpath id='Vector 198' d='M4.979 17.3167C3.92969 16.8472 3.81592 15.4429 4.79492 14.8404C5.9707 14.1169 7.58301 13.7576 9.354 14.7828C10.374 15.3734 10.4321 16.5123 9.39893 17.0798C8.32764 17.6683 6.73828 18.1039 4.979 17.3167Z' stroke='%23999999' stroke-width='1.895129' stroke-linejoin='round' stroke-dasharray='0 0'/%3e %3c/g%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='24.000000' height='24.000000' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cmask id='mask1_15945' mask-type='alpha' maskUnits='userSpaceOnUse' x='0.000000' y='0.000000' width='24.000000' height='24.000000'%3e %3crect id='Frame 1312316543 (Background/Mask)' width='24.000000' height='24.000000' fill='%23C4C4C4'/%3e %3c/mask%3e %3cg mask='url(%23mask1_15945)'%3e %3cpath id='Vector 197' d='M6.82031 21.1879C7.30859 20.8242 7.65674 20.4422 7.89697 20.0767C8.56055 19.0654 7.91553 17.8707 7.32861 16.813C6.78955 15.8416 6.34033 14.9126 5.68604 14.0402C3.5 11.1254 3.98877 7.18506 6.86133 4.94373C9.97998 2.51038 13.4199 2.427 15.9365 3.36963C16.5493 3.59912 17.186 3.94055 17.7881 4.3363C20.1196 5.86804 21.0063 8.93555 19.5503 11.3146C17.5649 14.5581 13.4385 15.5564 10.3657 15.641' stroke='%231664FF' stroke-width='1.995000' stroke-linejoin='round' stroke-linecap='round' stroke-dasharray='0 0'/%3e %3c/g%3e %3cg mask='url(%23mask1_15945)'%3e %3cpath id='Vector 198' d='M4.979 17.3167C3.92969 16.8472 3.81592 15.4429 4.79492 14.8404C5.9707 14.1169 7.58301 13.7576 9.354 14.7828C10.374 15.3734 10.4321 16.5123 9.39893 17.0798C8.32764 17.6683 6.73828 18.1039 4.979 17.3167Z' stroke='%231664FF' stroke-width='1.895129' stroke-linejoin='round' stroke-dasharray='0 0'/%3e %3c/g%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const HidePointCloudSegmentSvg=e=>{var t,l,r;return React__default.default.createElement("svg",{width:"24.000000",height:"24.000000",viewBox:"0 0 24 24",fill:"none"},React__default.default.createElement("g",null,React__default.default.createElement("rect",{id:"Rectangle 12065",x:"2.500000",y:"7.002930",rx:"0.500000",width:"8.127075",height:"10.000000",fill:(t=e.color)!=null?t:"#FFFFFF"}),React__default.default.createElement("rect",{id:"Rectangle 12066",x:"15.503906",y:"8.002930",width:"5.996094",height:"8.000000",stroke:(l=e.color)!=null?l:"#FFFFFF",strokeWidth:"2.000000",strokeLinejoin:"round",strokeDasharray:"0 0"}),React__default.default.createElement("path",{id:"Vector 183",d:"M12.5098 4L12.5098 20",stroke:(r=e.color)!=null?r:"#FFFFFF",strokeWidth:"2.000000",strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:"0 0"})),React__default.default.createElement("defs",null))},FocusModeSvg=e=>{var t,l,r,a,o,d;return React__default.default.createElement("svg",{width:"24.000000",height:"24.000000",viewBox:"0 0 24 24",fill:"none"},React__default.default.createElement("g",null,React__default.default.createElement("path",{id:"Vector",d:"M14.5811 6.89233L14.5811 3.22339L9.58105 3.22339L9.58105 6.89233C8.08643 7.75684 7.08105 9.37268 7.08105 11.2234C7.08105 13.9849 9.31982 16.2234 12.0811 16.2234C14.8423 16.2234 17.0811 13.9849 17.0811 11.2234C17.0811 9.37268 16.0757 7.75684 14.5811 6.89233ZM14.5811 6.89233C13.8457 6.46692 12.9917 6.22339 12.0811 6.22339C11.1704 6.22339 10.3164 6.46692 9.58105 6.89233L9.58105 7.22339L14.5811 7.22339L14.5811 6.89233Z",clipRule:"evenodd",fillRule:"evenodd",fill:(t=e.color)!=null?t:"#FFFFFF",fillOpacity:"1.000000"}),React__default.default.createElement("path",{id:"Vector 170",d:"M2.36572 10.2231L5.41895 10.2231",stroke:(l=e.color)!=null?l:"#FFFFFF",strokeWidth:"2.000000",strokeDasharray:"0 0"}),React__default.default.createElement("path",{id:"Vector 172",d:"M11.0811 17.7231L11.0811 20.7763",stroke:(r=e.color)!=null?r:"#FFFFFF",strokeWidth:"2.000000",strokeDasharray:"0 0"}),React__default.default.createElement("path",{id:"Vector 173",d:"M17.0015 15.6702L19.1602 17.8291",stroke:(a=e.color)!=null?a:"#FFFFFF",strokeWidth:"2.000000",strokeDasharray:"0 0"}),React__default.default.createElement("path",{id:"Vector 174",d:"M4.58105 17.8293L6.73975 15.6704",stroke:(o=e.color)!=null?o:"#FFFFFF",strokeWidth:"2.000000",strokeDasharray:"0 0"}),React__default.default.createElement("path",{id:"Vector 171",d:"M18.5811 10.2231L21.6343 10.2231",stroke:(d=e.color)!=null?d:"#FFFFFF",strokeWidth:"2.000000",strokeDasharray:"0 0"})),React__default.default.createElement("defs",null))};exports.FocusModeSvg=FocusModeSvg,exports.HidePointCloudSegmentSvg=HidePointCloudSegmentSvg;
@@ -0,0 +1 @@
1
+ "use strict";var img="data:image/svg+xml,%3csvg width='24.000000' height='24.000000' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e %3cdesc%3e Created with Pixso. %3c/desc%3e %3cmask id='mask155_5132' mask-type='alpha' maskUnits='userSpaceOnUse' x='0.000000' y='0.000000' width='24.000000' height='24.000000'%3e %3crect id='Frame 1312316531 (Background/Mask)' width='24.000000' height='24.000000' fill='%23C4C4C4'/%3e %3c/mask%3e %3cg mask='url(%23mask155_5132)'%3e %3cpath id='Vector 205' d='M3 3L17 3L17 17L3 17L3 3Z' fill-rule='evenodd' fill='white'/%3e %3cpath id='Vector 205' d='M17 3L17 17L3 17L3 3L17 3Z' stroke='white' stroke-width='2.000000' stroke-linejoin='round' stroke-dasharray='0 0'/%3e %3cpath id='Vector 206' d='M6 7C6 6.44775 6.44775 6 7 6L20 6C20.5522 6 21 6.44775 21 7L21 20C21 20.5522 20.5522 21 20 21L7 21C6.44775 21 6 20.5522 6 20L6 7ZM19 8L8 8L8 19L19 19L19 8Z' fill-rule='evenodd' fill='white'/%3e %3c/g%3e %3cdefs/%3e%3c/svg%3e";module.exports=img;
@@ -1 +1 @@
1
- "use strict";var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React);function getDefaultOrthographicParams(r){return{left:-r.width/2,right:r.width/2,top:r.height/2,bottom:-r.height/2,near:100,far:-100}}const PointCloudAnnotationView=r=>{const{src:l,result:o,size:i,isOrthographicCamera:u=!1,backgroundColor:f="#ccc"}=r;let c=React.useRef();const e=React.useRef(),d=React.useCallback(t=>{c.current=t},[]);return React.useEffect(()=>{let t={container:c.current,backgroundColor:f,isOrthographicCamera:u};u&&Object.assign(t,{orthographicParams:getDefaultOrthographicParams(i)});const n=new lbAnnotation.PointCloud(t);return e.current=n,()=>{var a;(a=e.current.renderer)==null||a.forceContextLoss()}},[]),React.useEffect(()=>{var t,n,a;e.current&&((t=e.current)==null||t.init(),(n=e.current)==null||n.initOrthographicCamera(getDefaultOrthographicParams(i)),(a=e.current)==null||a.render())},[i]),React.useEffect(()=>{var t;e.current&&l&&((t=e.current)==null||t.loadPCDFile(l))},[l]),React.useEffect(()=>(o&&lbUtils.PointCloudUtils.getBoxParamsFromResultList(o).forEach(n=>{var a;(a=e.current)==null||a.generateBox(n,n.id)}),()=>{var t;lbUtils.PointCloudUtils.getBoxParamsFromResultList(o).forEach(a=>{var s;(s=e.current)==null||s.removeObjectByName(a.id)}),(t=e.current)==null||t.render()}),[o]),React__default.default.createElement("div",{style:i,ref:d})};module.exports=PointCloudAnnotationView;
1
+ "use strict";var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const PointCloudAnnotationView=o=>{const{src:l,result:n,size:i,isOrthographicCamera:u=!1,backgroundColor:d="#ccc"}=o;let c=React.useRef();const r=React.useRef(),f=React.useCallback(e=>{c.current=e},[]);return React.useEffect(()=>{let e={container:c.current,backgroundColor:d,isOrthographicCamera:u};u&&Object.assign(e,{orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(i)});const a=new lbAnnotation.PointCloud(e);return r.current=a,()=>{var t;(t=r.current.renderer)==null||t.forceContextLoss()}},[]),React.useEffect(()=>{var e,a,t;r.current&&((e=r.current)==null||e.init(),(a=r.current)==null||a.initOrthographicCamera(lbUtils.PointCloudUtils.getDefaultOrthographicParams(i)),(t=r.current)==null||t.render())},[i]),React.useEffect(()=>{var e;r.current&&l&&((e=r.current)==null||e.loadPCDFile(l))},[l]),React.useEffect(()=>(n&&lbUtils.PointCloudUtils.getBoxParamsFromResultList(n).forEach(a=>{var t;(t=r.current)==null||t.generateBox(a,a.id)}),()=>{var e;lbUtils.PointCloudUtils.getBoxParamsFromResultList(n).forEach(t=>{var s;(s=r.current)==null||s.removeObjectByName(t.id,"box")}),(e=r.current)==null||e.render()}),[n]),React__default.default.createElement("div",{style:i,ref:f})};module.exports=PointCloudAnnotationView;
@@ -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");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,n,e)=>n in t?__defProp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,__spreadValues=(t,n)=>{for(var e in n||(n={}))__hasOwnProp.call(n,e)&&__defNormalProp(t,e,n[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(n))__propIsEnum.call(n,e)&&__defNormalProp(t,e,n[e]);return t},__spreadProps=(t,n)=>__defProps(t,__getOwnPropDescs(n));const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:t})=>{const{isActive:n,setTarget3DView:e}=React.useContext(PointCloud3DContext),m=p=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",p)]:!0,active:n});return React__default.default.createElement("span",{onClick:()=>{e(lbUtils.EPerspectiveView[t])},className:m(t.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:t,followTopView:n}=React.useContext(PointCloud3DContext),{t:e}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},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"}),React__default.default.createElement(antd.Tooltip,{title:e("CameraFollowTopView")},React__default.default.createElement("span",{onClick:()=>{n()},className:dom.getClassName("point-cloud-3d-view","followTop")})),React__default.default.createElement("span",{onClick:()=>{t()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:t,config:n})=>{const e=React.useContext(PointCloudContext.PointCloudContext),[m,p]=React.useState(!0),c=React.useRef(null),{initPointCloud3d:w}=usePointCloudViews.usePointCloudViews(),s=useSize(c),{t:C}=reactI18next.useTranslation();React.useEffect(()=>{!e.mainViewInstance||w==null||w(s)},[s]);const{selectedBox:u}=useSingleBox.useSingleBox(),{selectedSphere:d}=useSphere.useSphere(),v=o=>{var a,i;const r=u==null?void 0:u.info;if(r){const l=__spreadValues({},r.center);l.x=l.x-.01,l.z=10;const f=o===lbUtils.EPerspectiveView.Top;(a=e.mainViewInstance)==null||a.updateCameraByBox(r,o,f?l:void 0)}d&&((i=e.mainViewInstance)==null||i.updateCameraBySphere(d,o))},V=()=>{var o;(o=e.mainViewInstance)==null||o.resetCamera()},P=()=>{var o,a;const i=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance.camera;i&&((a=e.mainViewInstance)==null||a.applyCameraTarget(i))};React.useEffect(()=>{if(c.current&&(t==null?void 0:t.url)){let o=e.mainViewInstance;if(!o&&s.width){const a={left:-s.width/2,right:s.width/2,top:s.height/2,bottom:-s.height/2,near:100,far:-100};o=new lbAnnotation.PointCloud({container:c.current,isOrthographicCamera:!0,orthographicParams:a,config:n}),e.setMainViewInstance(o)}}},[s]),React.useEffect(()=>{var o;if(c.current&&(t==null?void 0:t.url)&&t.result&&e.mainViewInstance){let a=e.mainViewInstance;const i=lbUtils.PointCloudUtils.getBoxParamsFromResultList(t.result);i.forEach(r=>{var l;const f=(l=lbUtils.toolStyleConverter.getColorFromConfig({attribute:r.attribute},__spreadProps(__spreadValues({},n),{attributeConfigurable:!0}),{}))==null?void 0:l.hex;a==null||a.generateBox(r,f)}),e.setPointCloudResult(i),e.setPointCloudValid((o=index.jsonParser(t.result))==null?void 0:o.valid)}},[t,e.mainViewInstance]),React.useEffect(()=>{var o,a,i,r;if(u){v(lbUtils.EPerspectiveView.Top);const l=(i=(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:a.camera.zoom)!=null?i:1;(r=e.mainViewInstance)==null||r.updateCameraZoom(l)}},[u]),React.useEffect(()=>{var o,a,i,r;if(d){v(lbUtils.EPerspectiveView.Top);const l=(i=(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:a.camera.zoom)!=null?i:1;(r=e.mainViewInstance)==null||r.updateCameraZoom(l)}},[d]);const _=React.useMemo(()=>({reset3DView:V,setTarget3DView:v,isActive:!!u,followTopView:P}),[u,e.mainViewInstance]),g=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$1,{onChange:o=>{var a;(a=e.mainViewInstance)==null||a.updatePointSize({customSize:o})}}),React__default.default.createElement("span",{style:{marginRight:8}},C("ShowArrows")),React__default.default.createElement(antd.Switch,{size:"small",checked:m,onChange:o=>{var a;p(o),(a=e.mainViewInstance)==null||a.setShowDirection(o)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:C("3DView"),toolbar:g},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},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:c})))};var PointCloud3DView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud3D);module.exports=PointCloud3DView;
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");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,e)=>a in t?__defProp(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e,__spreadValues=(t,a)=>{for(var e in a||(a={}))__hasOwnProp.call(a,e)&&__defNormalProp(t,e,a[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(a))__propIsEnum.call(a,e)&&__defNormalProp(t,e,a[e]);return t},__spreadProps=(t,a)=>__defProps(t,__getOwnPropDescs(a));const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:t})=>{const{isActive:a,setTarget3DView:e}=React.useContext(PointCloud3DContext),m=p=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",p)]:!0,active:a});return React__default.default.createElement("span",{onClick:()=>{e(lbUtils.EPerspectiveView[t])},className:m(t.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:t,followTopView:a}=React.useContext(PointCloud3DContext),{t:e}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},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"}),React__default.default.createElement(antd.Tooltip,{title:e("CameraFollowTopView")},React__default.default.createElement("span",{onClick:()=>{a()},className:dom.getClassName("point-cloud-3d-view","followTop")})),React__default.default.createElement("span",{onClick:()=>{t()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:t,config:a})=>{const e=React.useContext(PointCloudContext.PointCloudContext),[m,p]=React.useState(!0),u=React.useRef(null),{initPointCloud3d:w}=usePointCloudViews.usePointCloudViews(),c=useSize(u),{t:C}=reactI18next.useTranslation();React.useEffect(()=>{!e.mainViewInstance||w==null||w(c)},[c]);const{selectedBox:s}=useSingleBox.useSingleBox(),{selectedSphere:d}=useSphere.useSphere(),v=o=>{var n,i;const r=s==null?void 0:s.info;if(r){const l=__spreadValues({},r.center);l.x=l.x-.01,l.z=10;const f=o===lbUtils.EPerspectiveView.Top;(n=e.mainViewInstance)==null||n.updateCameraByBox(r,o,f?l:void 0)}d&&((i=e.mainViewInstance)==null||i.updateCameraBySphere(d,o))},V=()=>{var o;(o=e.mainViewInstance)==null||o.resetCamera()},P=()=>{var o,n;const i=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance.camera;i&&((n=e.mainViewInstance)==null||n.applyCameraTarget(i))};React.useEffect(()=>{if(u.current&&(t==null?void 0:t.url)){let o=e.mainViewInstance;!o&&c.width&&(o=new lbAnnotation.PointCloud({container:u.current,isOrthographicCamera:!0,orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(c),config:a}),e.setMainViewInstance(o))}},[c]),React.useEffect(()=>{var o;if(u.current&&(t==null?void 0:t.url)&&t.result&&e.mainViewInstance){let n=e.mainViewInstance;const i=lbUtils.PointCloudUtils.getBoxParamsFromResultList(t.result);i.forEach(r=>{var l;const f=(l=lbUtils.toolStyleConverter.getColorFromConfig({attribute:r.attribute},__spreadProps(__spreadValues({},a),{attributeConfigurable:!0}),{}))==null?void 0:l.hex;n==null||n.generateBox(r,f)}),e.setPointCloudResult(i),e.setPointCloudValid((o=index.jsonParser(t.result))==null?void 0:o.valid)}},[t,e.mainViewInstance]),React.useEffect(()=>{var o,n,i,r;if(s){v(lbUtils.EPerspectiveView.Top);const l=(i=(n=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:n.camera.zoom)!=null?i:1;(r=e.mainViewInstance)==null||r.updateCameraZoom(l)}},[s]),React.useEffect(()=>{var o,n,i,r;if(d){v(lbUtils.EPerspectiveView.Top);const l=(i=(n=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:n.camera.zoom)!=null?i:1;(r=e.mainViewInstance)==null||r.updateCameraZoom(l)}},[d]);const _=React.useMemo(()=>({reset3DView:V,setTarget3DView:v,isActive:!!s,followTopView:P}),[s,e.mainViewInstance]),g=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$1,{onChange:o=>{var n;(n=e.mainViewInstance)==null||n.updatePointSize({customSize:o})}}),React__default.default.createElement("span",{style:{marginRight:8}},C("ShowArrows")),React__default.default.createElement(antd.Switch,{size:"small",checked:m,onChange:o=>{var n;p(o),(n=e.mainViewInstance)==null||n.setShowDirection(o)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:C("3DView"),toolbar:g},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},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:u})))};var PointCloud3DView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud3D);module.exports=PointCloud3DView;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{}}),PointCloudProvider=({children:u})=>{const[l,h]=React.useState([]),[p,m]=React.useState([]),[C,T]=React.useState([]),[S,j]=React.useState([]),[r,L]=React.useState([]),[w,_]=React.useState(!0),[I,k]=React.useState(1),[o,q]=React.useState(),[V,z]=React.useState(),[g,F]=React.useState(),[n,Z]=React.useState(),[x,G]=React.useState(""),[v,J]=React.useState(lbAnnotation.EToolName.Rect),K=React.useRef(new lbAnnotation.ActionsHistory).current,[i,b]=React.useState([]),[B,Q]=React.useState(""),R=React.useMemo(()=>r.length===1?r[0]:"",[r]),D=React.useMemo(()=>{const a=l.find(t=>t.id===R),y=t=>{const e=l.concat(t);return h(e),e},A=t=>{const e=p.concat(t);return m(e),e},f=t=>{_(t!==!1)},s=t=>{t===void 0&&L([]),typeof t=="string"&&L([t]),Array.isArray(t)&&L(Array.from(new Set(t)))},W=t=>{r.includes(t)?s(r.filter(e=>e!==t)):s([...r,t])},X=()=>{if(v===lbAnnotation.EToolName.Rect){const t=l.map(e=>e.id);s(t),o==null||o.pointCloud2dOperation.setSelectedIDs(t)}},Y=t=>{s(l.filter(e=>e.attribute===t).map(e=>e.id))},E=l.filter(t=>!i.includes(t.attribute)),H=p.filter(t=>!i.includes(t.attribute)),O=S.filter(t=>t.attribute&&!i.includes(t.attribute)),$=t=>{if(i.includes(t))b(i.filter(e=>e!==t));else{const e=i.concat(t);b(e)}},tt=(t=E,e=C,P=H,d=O)=>{l.forEach(c=>{n==null||n.removeObjectByName(c.id)}),p.forEach(c=>{n==null||n.removeObjectByName(c.id)}),o==null||o.updatePolygonList(t,e),o==null||o.updatePointList(P),o==null||o.updateLineList(d),n==null||n.generateBoxes(t),n==null||n.generateSpheres(P),M(t)},M=t=>{const e=n==null?void 0:n.highlightOriginPointCloud(t);return new Promise(P=>{e==null||e.then(d=>{[o].forEach(c=>{var N;d&&((N=c==null?void 0:c.pointCloudInstance)==null||N.updateColor(d),P({color:d}))})}).catch(d=>{console.error(d)})})};return{selectedID:R,pointCloudBoxList:l,pointCloudSphereList:p,displayPointCloudList:E,displaySphereList:H,displayLineList:O,selectedIDs:r,setPointCloudResult:h,setSelectedIDs:s,addPointCloudBox:y,addPointCloudSphere:A,setPointCloudSphereList:m,valid:w,selectedPointCloudBox:a,setPointCloudValid:f,addSelectedID:W,selectedAllBoxes:X,topViewInstance:o,setTopViewInstance:q,sideViewInstance:V,setSideViewInstance:z,backViewInstance:g,setBackViewInstance:F,mainViewInstance:n,setMainViewInstance:Z,polygonList:C,setPolygonList:T,lineList:S,setLineList:j,zoom:I,setZoom:k,history:K,toggleAttributesVisible:$,hideAttributes:i,setHideAttributes:b,reRender:tt,attrPanelLayout:B,setAttrPanelLayout:Q,syncAllViewPointCloudColor:M,defaultAttribute:x,setDefaultAttribute:G,pointCloudPattern:v,setPointCloudPattern:J,selectSpecAttr:Y}},[w,r,l,p,C,S,o,V,g,n,I,i,B,x,v]),U=()=>{const a=l.filter(s=>i.includes(s.attribute)),{setSelectedIDs:y,reRender:A}=D,f=a.map(s=>s.id);f.length>0&&y(r.filter(s=>!f.includes(s))),A()};return React.useEffect(()=>{var a;U(),(a=o==null?void 0:o.pointCloud2dOperation)==null||a.setHiddenAttributes(i)},[i]),React__default.default.createElement(PointCloudContext.Provider,{value:D},u)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
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");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{}}),PointCloudProvider=({children:r})=>{const[a,w]=React.useState([]),[C,V]=React.useState([]),[L,Z]=React.useState([]),[A,U]=React.useState([]),[l,g]=React.useState([]),[x,J]=React.useState(!0),[D,K]=React.useState(1),[o,R]=React.useState(),[B,E]=React.useState(),[H,_]=React.useState(),[n,q]=React.useState(),[G,Q]=React.useState(""),[I,W]=React.useState(lbAnnotation.EToolName.Rect),X=React.useRef(new lbAnnotation.ActionsHistory).current,[s,h]=React.useState([]),[M,Y]=React.useState(""),[m,$]=React.useState(lbUtils.EPointCloudPattern.Detection),[p,T]=React.useState(void 0),[y,tt]=React.useState([]),et=ctx.useDispatch(),j=React.useMemo(()=>l.length===1?l[0]:"",[l]),F=React.useMemo(()=>{const u=a.find(t=>t.id===j),S=t=>{const e=a.concat(t);return w(e),e},d=t=>{const e=C.concat(t);return V(e),e},c=t=>{J(t!==!1)},i=t=>{t===void 0&&g([]),typeof t=="string"&&g([t]),Array.isArray(t)&&g(Array.from(new Set(t)))},nt=t=>{l.includes(t)?i(l.filter(e=>e!==t)):i([...l,t])},st=()=>{if(I===lbAnnotation.EToolName.Rect){const t=a.map(e=>e.id);i(t),o==null||o.pointCloud2dOperation.setSelectedIDs(t)}},it=t=>{i(a.filter(e=>e.attribute===t).map(e=>e.id))},k=a.filter(t=>!s.includes(t.attribute)),N=C.filter(t=>!s.includes(t.attribute)),O=A.filter(t=>t.attribute&&!s.includes(t.attribute)),lt=t=>{if(s.includes(t))h(s.filter(e=>e!==t));else{const e=s.concat(t);h(e)}},at=(t=k,e=L,f=N,P=O,b=y)=>{var v;n==null||n.clearAllBox(),n==null||n.clearAllSphere(),o==null||o.updatePolygonList(t,e),o==null||o.updatePointList(f),o==null||o.updateLineList(P),n==null||n.generateBoxes(t),n==null||n.generateSpheres(f),(v=p==null?void 0:p.store)==null||v.updateCurrentSegment(b),z(t)},rt=()=>{R(void 0),E(void 0),_(void 0),q(void 0)},z=t=>{const e=n==null?void 0:n.highlightOriginPointCloud(t);return new Promise(f=>{e==null||e.then(P=>{[o].forEach(b=>{var v;P&&((v=b==null?void 0:b.pointCloudInstance)==null||v.updateColor(P),f({color:P}))})}).catch(P=>{console.error(P)})})};return{selectedID:j,pointCloudBoxList:a,pointCloudSphereList:C,displayPointCloudList:k,displaySphereList:N,displayLineList:O,selectedIDs:l,setPointCloudResult:w,setSelectedIDs:i,addPointCloudBox:S,addPointCloudSphere:d,setPointCloudSphereList:V,valid:x,selectedPointCloudBox:u,setPointCloudValid:c,addSelectedID:nt,selectedAllBoxes:st,topViewInstance:o,setTopViewInstance:R,sideViewInstance:B,setSideViewInstance:E,backViewInstance:H,setBackViewInstance:_,mainViewInstance:n,setMainViewInstance:q,polygonList:L,setPolygonList:Z,lineList:A,setLineList:U,zoom:D,setZoom:K,history:X,toggleAttributesVisible:lt,hideAttributes:s,setHideAttributes:h,reRender:at,attrPanelLayout:M,setAttrPanelLayout:Y,syncAllViewPointCloudColor:z,defaultAttribute:G,setDefaultAttribute:Q,pointCloudPattern:I,setPointCloudPattern:W,selectSpecAttr:it,globalPattern:m,setGlobalPattern:t=>{m!==t&&(et(actionCreators.ChangeSave),$(t),t===lbUtils.EPointCloudPattern.Detection&&T(void 0))},ptSegmentInstance:p,setPtSegmentInstance:T,segmentation:y,setSegmentation:tt,clearAllDetectionInstance:rt}},[x,l,a,C,L,A,o,B,H,n,D,s,M,G,I,m,p,y]),ot=()=>{const u=a.filter(i=>s.includes(i.attribute)),{setSelectedIDs:S,reRender:d}=F,c=u.map(i=>i.id);c.length>0&&S(l.filter(i=>!c.includes(i))),d()};return React.useEffect(()=>{var u,S,d,c;ot(),(S=(u=o==null?void 0:o.toolInstance)==null?void 0:u.setHiddenAttributes)==null||S.call(u,s),(c=(d=p==null?void 0:p.store)==null?void 0:d.setHiddenAttributes)==null||c.call(d,s)},[s]),React__default.default.createElement(PointCloudContext.Provider,{value:F},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
@@ -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"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.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"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,r,i)=>r in u?__defProp(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,__spreadValues=(u,r)=>{for(var i in r||(r={}))__hasOwnProp.call(r,i)&&__defNormalProp(u,i,r[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(r))__propIsEnum.call(r,i)&&__defNormalProp(u,i,r[i]);return u},__spreadProps=(u,r)=>__defProps(u,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:u,config:r,checkMode:i,configString:_,imgIndex:w})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:I,selectNextBox:B,selectPrevBox:L,updateSelectedBox:C,deleteSelectedPointCloudBoxAndPolygon:V}=useSingleBox.useSingleBox(),{selectedSphere:f,updatePointCloudSphere:E}=useSphere.useSphere(),{clearAllResult:b,updatePointCloudPattern:q}=useStatus.useStatus(),A=index.jsonParser(u.result),{copySelectedBoxes:O,pasteSelectedBoxes:j,copiedBoxes:T}=useBoxes.useBoxes({config:r}),{toolInstanceRef:a}=annotation.useCustomToolInstance({basicInfo:A}),{updateRotate:P}=useRotate.useRotate({currentData:u}),{updatePointCloudData:p,topViewSelectedChanged:x}=usePointCloudViews.usePointCloudViews(),{redo:h,undo:g,pushHistoryWithList:R,pushHistoryUnderUpdatePolygon:D}=useHistory.useHistory(),{syncThreeViewsAttribute:m}=useAttribute.useAttribute(),{syncAllViewsConfig:N,reRenderTopViewRange:H}=useConfig.useConfig(),{selectedPolygon:S}=usePolygon.usePolygon(),{t:y}=reactI18next.useTranslation(),v=e=>{var o;const{topViewInstance:s}=t;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},K=(e,o)=>{var s;const{topViewInstance:n,mainViewInstance:l}=t;if(!n)return;const{pointCloud2dOperation:c}=n;switch(e){case"q":{P(2);break}case"e":P(-2);break;case"g":P(180);break;case"u":{const d=c.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;q(d);const U={[lbAnnotation.EToolName.Polygon]:y("PolygonPattern"),[lbAnnotation.EToolName.Rect]:y("RectPattern")};antd.message.success(y("ChangePatternMsg",{pattern:U[d]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize({zoomIn:!0});break;case"-":l==null||l.updatePointSize({zoomIn:!1});break;case"v":t.setPointCloudValid(!t.valid);break;case"tab":if(o.shiftKey){L();break}B(),o.preventDefault();break;case"f":I();break;case"arrowup":v({y:-1});break;case"arrowdown":v({y:1});break;case"arrowleft":v({x:-1});break;case"arrowright":v({x:1});break;case"delete":V();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(o.keyCode,r.attributeList);d!==void 0&&a.current.setDefaultAttribute(d)}return}}},z=(e,o)=>{switch(e){case"c":O();break;case"v":j();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?h():g();break}}},k=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||i===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){z(o,e);return}K(o,e)};return React.useEffect(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[t,T,r,t.pointCloudBoxList,t.polygonList]),React.useEffect(()=>{N(r)},[_]),React.useEffect(()=>{(r==null?void 0:r.radius)&&H(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{p==null||p()},[w,t.mainViewInstance]),React.useEffect(()=>{t.setHideAttributes([])},[w]),React.useEffect(()=>{a.current.exportData=()=>[t.pointCloudBoxList,{valid:t.valid}],a.current.exportCustomData=()=>{var e,o,s;return{resultPolygon:(e=t.polygonList)!=null?e:[],resultLine:(o=t.lineList)!=null?o:[],resultPoint:(s=t.pointCloudSphereList)!=null?s:[]}},a.current.setDefaultAttribute=e=>{var o;m(e);const s=t.selectedPointCloudBox;if(s){s.attribute=e;const n=C(s);t.mainViewInstance&&x({newSelectedBox:s,newPointCloudList:n})}if(S&&D(__spreadProps(__spreadValues({},S),{attribute:e})),f){const n=E(__spreadProps(__spreadValues({},f),{attribute:e}));t.mainViewInstance&&((o=t.mainViewInstance)==null||o.generateSpheres(n),x({newSelectedSphere:f,newSphereList:n}))}},a.current.setSubAttribute=(e,o)=>{var s;const n=t.selectedPointCloudBox;if(n){const l=(s=n==null?void 0:n.subAttribute)!=null?s:{};n.subAttribute=__spreadProps(__spreadValues({},l),{[e]:o}),C(n)}},a.current.clearResult=()=>{b==null||b()},a.current.redo=()=>{h()},a.current.undo=()=>{g()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{t.setPointCloudValid(e),e===!1&&b()})},a.current.setForbidOperation=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&t.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)},a.current.asyncData=e=>{setTimeout(()=>{p==null||p(e)})}},[t.pointCloudBoxList,t.pointCloudSphereList,t.selectedID,t.valid,t.polygonList,t.lineList,t.mainViewInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{R({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const o=(e=t.topViewInstance)==null?void 0:e.toolInstance;if(!o||i)return;const s=c=>{m(c)},n=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return o.on("syncAttribute",s),o.on("messageError",n),o.on("messageInfo",l),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",n),o.unbind("messageInfo",l)}},[t.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$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"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,o,i)=>o in u?__defProp(u,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[o]=i,__spreadValues=(u,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(u,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(u,i,o[i]);return u},__spreadProps=(u,o)=>__defProps(u,__getOwnPropDescs(o));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:u,config:o,checkMode:i,configString:B,imgIndex:C,toolInstanceRef:a})=>{const r=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:V,selectNextBox:E,selectPrevBox:A,updateSelectedBox:g,deleteSelectedPointCloudBoxAndPolygon:O}=useSingleBox.useSingleBox(),{selectedSphere:b,updatePointCloudSphere:L}=useSphere.useSphere(),{clearAllResult:P,updatePointCloudPattern:q}=useStatus.useStatus(),{copySelectedBoxes:j,pasteSelectedBoxes:T,copiedBoxes:I}=useBoxes.useBoxes({config:o}),{updateRotate:y}=useRotate.useRotate({currentData:u}),{updatePointCloudData:p,topViewSelectedChanged:m}=usePointCloudViews.usePointCloudViews(),{redo:S,undo:x,pushHistoryWithList:D,pushHistoryUnderUpdatePolygon:N}=useHistory.useHistory(),{syncThreeViewsAttribute:h}=useAttribute.useAttribute(),{syncAllViewsConfig:H,reRenderTopViewRange:K}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{t:w}=reactI18next.useTranslation(),v=e=>{var t;const{topViewInstance:s}=r;!s||(t=s.pointCloud2dOperation)==null||t.updateSelectedPolygonsPoints(e)},z=(e,t)=>{var s,n;const{topViewInstance:c,mainViewInstance:l}=r;if(!c)return;const{pointCloud2dOperation:f}=c;switch(e){case"q":{y(2);break}case"e":y(-2);break;case"g":y(180);break;case"u":{const d=f.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;q(d);const F={[lbAnnotation.EToolName.Polygon]:w("PolygonPattern"),[lbAnnotation.EToolName.Rect]:w("RectPattern")};antd.message.success(w("ChangePatternMsg",{pattern:F[d]})),f.clearActiveStatus(),f.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize({zoomIn:!0});break;case"-":l==null||l.updatePointSize({zoomIn:!1});break;case"v":r.setPointCloudValid(!r.valid);break;case"tab":if(t.shiftKey){A();break}E(),t.preventDefault();break;case"f":V();break;case"arrowup":v({y:-1});break;case"arrowdown":v({y:1});break;case"arrowleft":v({x:-1});break;case"arrowright":v({x:1});break;case"delete":O();break;default:{if(((s=o.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(t.keyCode,o.attributeList);d!==void 0&&((n=a.current)==null||n.setDefaultAttribute(d))}return}}},U=(e,t)=>{switch(e){case"c":j();break;case"v":T();break;case"a":t.preventDefault(),r.selectedAllBoxes();break;case"z":{t.shiftKey?S():x();break}}},_=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||i===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){U(t,e);return}z(t,e)};return React.useEffect(()=>{const{topViewInstance:e}=r;if(!!e)return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[r,I,o,r.pointCloudBoxList,r.polygonList]),React.useEffect(()=>{H(o)},[B]),React.useEffect(()=>{(o==null?void 0:o.radius)&&K(o==null?void 0:o.radius)},[o==null?void 0:o.radius]),React.useEffect(()=>{p==null||p()},[C,r.mainViewInstance]),React.useEffect(()=>{r.setHideAttributes([])},[C]),React.useEffect(()=>{a.current.setDefaultAttribute=e=>{var t;h(e);const s=r.selectedPointCloudBox;if(s){s.attribute=e;const n=g(s);r.mainViewInstance&&m({newSelectedBox:s,newPointCloudList:n})}if(k&&N(__spreadProps(__spreadValues({},k),{attribute:e})),b){const n=L(__spreadProps(__spreadValues({},b),{attribute:e}));r.mainViewInstance&&((t=r.mainViewInstance)==null||t.generateSpheres(n),m({newSelectedSphere:b,newSphereList:n}))}},a.current.setSubAttribute=(e,t)=>{var s;const n=r.selectedPointCloudBox;if(n){const c=(s=n==null?void 0:n.subAttribute)!=null?s:{};n.subAttribute=__spreadProps(__spreadValues({},c),{[e]:t}),g(n)}},a.current.clearResult=()=>{P==null||P()},a.current.redo=()=>{S()},a.current.undo=()=>{x()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{r.setPointCloudValid(e),e===!1&&P()})},a.current.setForbidOperation=e=>{var t,s;(s=(t=r.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&r.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var t,s;(s=(t=r.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)},a.current.asyncData=e=>{setTimeout(()=>{p==null||p(e)})}},[r.pointCloudBoxList,r.pointCloudSphereList,r.selectedID,r.valid,r.polygonList,r.lineList,r.mainViewInstance,r.ptSegmentInstance]),React.useEffect(()=>{a.current.updateSegmentTool=e=>{var t;(t=r.ptSegmentInstance)==null||t.emit(e)},a.current.segmentInstance=r.ptSegmentInstance},[r.ptSegmentInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{D({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const t=(e=r.topViewInstance)==null?void 0:e.toolInstance;if(!t||i)return;const s=l=>{h(l)},n=l=>{antd.message.error(l)},c=l=>{antd.message.info(l)};return t.on("syncAttribute",s),t.on("messageError",n),t.on("messageInfo",c),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",n),t.unbind("messageInfo",c)}},[r.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
@@ -0,0 +1 @@
1
+ "use strict";var useSize=require("../../hooks/useSize.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudSegment=({currentData:e,config:n,checkMode:c})=>{var o,u;const a=React.useRef(null),{setPtSegmentInstance:d,setDefaultAttribute:m,ptSegmentInstance:r}=React.useContext(PointCloudContext.PointCloudContext),t=useSize(a),i=(u=(o=n==null?void 0:n.attributeList)==null?void 0:o[0])==null?void 0:u.value;return React.useEffect(()=>{var l;if(!(t==null?void 0:t.width)||!a.current||r)return;const s=new lbAnnotation.PointCloud({container:a.current,isOrthographicCamera:!0,isSegment:!0,orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(t),config:n,checkMode:c});(l=s.store)==null||l.setAttribute(i),m(i),d(s)},[t]),React.useEffect(()=>{r&&(r.initRenderer(),r.initOrthographicCamera(lbUtils.PointCloudUtils.getDefaultOrthographicParams(t)),r.render())},[t]),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),ref:a})};var PointCloudSegment$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment);module.exports=PointCloudSegment$1;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js");const PointCloudSegmentListener=({checkMode:c,currentData:r,imgIndex:m,highlightAttribute:u,config:v,toolInstanceRef:a})=>{const{updateSegmentAttribute:b}=useAttribute.useAttribute(),n=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:e,setSegmentation:s}=n;React.useEffect(()=>{var t;if(e&&r.url)return e.emit("clearStash"),e.emit("clearAllSegmentData"),e.loadPCDFile((t=r==null?void 0:r.url)!=null?t:"").then(()=>{var l,o;const i=lbUtils.PointCloudUtils.getSegmentFromResultList((l=r==null?void 0:r.result)!=null?l:"");(o=e==null?void 0:e.store)==null||o.updateCurrentSegment(i)}),e.on("syncSegmentData",s),()=>{e.unbind("syncSegmentData",s)}},[m,e]),React.useEffect(()=>{var t,l;let o=(t=v.attributeList.find(i=>(i==null?void 0:i.key)===u))==null?void 0:t.value;(l=e==null?void 0:e.store)==null||l.highlightPointsByAttribute(o!=null?o:"")},[u,e]);const S=(t,l)=>{var o,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Add);break;case"i":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(i=(o=e.store)==null?void 0:o.cacheSegData)==null?void 0:i.id);break}},d=t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||c===!0)return;const l=t.key.toLocaleLowerCase();S(l)};return React.useEffect(()=>(window.addEventListener("keydown",d),a.current.setDefaultAttribute=t=>{b(t)},()=>{window.removeEventListener("keydown",d)}),[e]),React.useEffect(()=>{a.current.clearResult=()=>{!n.ptSegmentInstance||n.ptSegmentInstance.emit("clearAllSegmentData")}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var PointCloudSegmentListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegmentListener);module.exports=PointCloudSegmentListener$1;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),dom=require("../../utils/dom.js"),finish=require("../../assets/annotation/pointCloudTool/finish.svg.js"),cancel=require("../../assets/annotation/pointCloudTool/cancel.svg.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const SegmentInfo=({infoList:e})=>{const{t:l}=reactI18next.useTranslation();return e?React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","info")},e.map(n=>React__default.default.createElement("div",{key:n.key},React__default.default.createElement("span",null,l(n.key),"\uFF1A "),React__default.default.createElement("span",null,n.value)))):null},PointCloudSegmentStatus=()=>{var e,l,n,d,r;const{t:s}=reactI18next.useTranslation(),{ptSegmentInstance:t,setDefaultAttribute:m}=React.useContext(PointCloudContext.PointCloudContext),[o,f]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready});React.useEffect(()=>{if(t){const a=c=>{f(c),c.cacheSegData&&m(c.cacheSegData.attribute)};return t==null||t.on("syncPointCloudStatus",a),()=>{t==null||t.unbind("syncPointCloudStatus",a)}}},[t]);const u=o.segmentStatus;if(u===lbUtils.EPointCloudSegmentStatus.Ready)return null;const g=u===lbUtils.EPointCloudSegmentStatus.Check,C=u===lbUtils.EPointCloudSegmentStatus.Edit;let i=null;const S=((n=(l=(e=o.cacheSegData)==null?void 0:e.points)==null?void 0:l.length)!=null?n:0)/3;let v=[{key:"SelectedPoints",value:S},{key:"Attribute",value:(r=(d=o.cacheSegData)==null?void 0:d.attribute)!=null?r:""}];return g&&(i=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","operation")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{t==null||t.emit("updateCheck2Edit")}},s("EnterEditMode"),"(Enter)"))),C&&(i=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","operation")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{var a;t==null||t.emit("addStash2Store"),((a=t==null?void 0:t.store)==null?void 0:a.segmentFocusMode)===lbUtils.EPointCloudSegmentFocusMode.Focus&&(t==null||t.emit("setSegmentFocusMode",lbUtils.EPointCloudSegmentFocusMode.Unfocus))}},React__default.default.createElement("img",{className:dom.getClassName("point-cloud-status","icon"),src:finish}),s("Finish")),React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{var a;t==null||t.emit("clearStash"),((a=t==null?void 0:t.store)==null?void 0:a.segmentFocusMode)===lbUtils.EPointCloudSegmentFocusMode.Focus&&(t==null||t.emit("setSegmentFocusMode",lbUtils.EPointCloudSegmentFocusMode.Unfocus))}},React__default.default.createElement("img",{className:dom.getClassName("point-cloud-status","icon"),src:cancel}),s("Cancel")))),React__default.default.createElement(React__default.default.Fragment,null,i,React__default.default.createElement(SegmentInfo,{infoList:v}))};module.exports=PointCloudSegmentStatus;
@@ -0,0 +1 @@
1
+ "use strict";var dom=require("../../utils/dom.js"),antd=require("antd"),coverMode=require("../../assets/annotation/pointCloudTool/coverMode.svg.js"),unCoverMode=require("../../assets/annotation/pointCloudTool/unCoverMode.svg.js"),React=require("react"),svg=require("../../assets/annotation/pointCloudTool/svg.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const PointCloudSegmentToolbar=()=>{var t,c,r,C,m,v,g,S;const{t:n}=reactI18next.useTranslation(),{ptSegmentInstance:e}=React.useContext(PointCloudContext.PointCloudContext),[h,p]=React.useState((c=(t=e==null?void 0:e.store)==null?void 0:t.segmentMode)!=null?c:lbUtils.EPointCloudSegmentMode.Add),[s,b]=React.useState((C=(r=e==null?void 0:e.store)==null?void 0:r.segmentCoverMode)!=null?C:lbUtils.EPointCloudSegmentCoverMode.Cover),[u,_]=React.useState((v=(m=e==null?void 0:e.store)==null?void 0:m.segmentFocusMode)!=null?v:lbUtils.EPointCloudSegmentFocusMode.Unfocus),[d,x]=React.useState((S=(g=e==null?void 0:e.store)==null?void 0:g.hideSegment)!=null?S:!1),[M,H]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready});React.useEffect(()=>{if(!e)return;const l=o=>{p(o)},P=o=>{b(o)},F=o=>{_(o)},f=o=>{x(o)},E=o=>{H(o)};return e.on("setSegmentMode",l),e.on("setSegmentCoverMode",P),e.on("setSegmentFocusMode",F),e.on("switchHideSegment",f),e.on("syncPointCloudStatus",E),()=>{e.unbind("setSegmentMode",l),e.unbind("setSegmentCoverMode",P),e.unbind("setSegmentFocusMode",F),e.unbind("switchHideSegment",f),e.unbind("syncPointCloudStatus",E)}},[e]);const q=h===lbUtils.EPointCloudSegmentMode.Add,i=d===!0||!(M==null?void 0:M.cacheSegData),a=u===lbUtils.EPointCloudSegmentFocusMode.Focus;return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-toolbar")},React__default.default.createElement(antd.Switch,{checkedChildren:"+",unCheckedChildren:"-",checked:q,onChange:l=>{e==null||e.emit("setSegmentMode",l?lbUtils.EPointCloudSegmentMode.Add:lbUtils.EPointCloudSegmentMode.Remove)}}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-toolbox"),onClick:()=>{e==null||e.emit("setSegmentCoverMode",s===lbUtils.EPointCloudSegmentCoverMode.Cover?lbUtils.EPointCloudSegmentCoverMode.Uncover:lbUtils.EPointCloudSegmentCoverMode.Cover),antd.message.info({content:n(s===lbUtils.EPointCloudSegmentCoverMode.Cover?"PointCloudUncoverMode":"PointCloudCoverMode"),icon:()=>null})}},React__default.default.createElement("img",{src:s===lbUtils.EPointCloudSegmentCoverMode.Cover?coverMode:unCoverMode})),React__default.default.createElement(antd.Tooltip,{title:i?n(d===!0?"PointCloudHideFocusInvalid_hide":"PointCloudHideFocusInvalid_none"):""},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-toolbox"),onClick:()=>{i||(e==null||e.emit("setSegmentFocusMode",u===lbUtils.EPointCloudSegmentFocusMode.Focus?lbUtils.EPointCloudSegmentFocusMode.Unfocus:lbUtils.EPointCloudSegmentFocusMode.Focus),antd.message.success(n(u===lbUtils.EPointCloudSegmentFocusMode.Focus?"PointCloudUnfocusMode":"PointCloudFocusMode")))}},React__default.default.createElement(svg.FocusModeSvg,{color:i?"#CCC":u===lbUtils.EPointCloudSegmentFocusMode.Focus?"#1664FF":"#FFF"}))),React__default.default.createElement(antd.Tooltip,{title:a?n("PointCloudHideSegmentInvalid"):""},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-toolbox"),onClick:()=>{a||(e==null||e.emit("switchHideSegment",!d),antd.message.success(n(d===!0?"PointCloudShowSegment":"PointCloudHideSegment")))}},React__default.default.createElement(svg.HidePointCloudSegmentSvg,{color:a?"#CCC":d?"#1664FF":"#FFF"}))))};module.exports=PointCloudSegmentToolbar;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useAttribute=()=>{const{topViewInstance:t,sideViewInstance:n,backViewInstance:o,mainViewInstance:u,defaultAttribute:i,setDefaultAttribute:r}=React.useContext(PointCloudContext.PointCloudContext);return React.useEffect(()=>{if(!(t==null?void 0:t.toolInstance))return;const e=()=>{r(t==null?void 0:t.toolInstance.defaultAttribute)};return t==null||t.toolInstance.on("changeAttributeSidebar",e),()=>{t==null||t.toolInstance.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.toolInstance]),{syncThreeViewsAttribute:e=>{[t==null?void 0:t.toolInstance,n==null?void 0:n.toolInstance,o==null?void 0:o.toolInstance].forEach(l=>{l==null||l.setDefaultAttribute(e)})},updateDefaultAttribute:e=>{t==null||t.toolInstance.setDefaultAttribute(e)},reRenderPointCloud3DBox:e=>{u==null||u.generateBox(e)},defaultAttribute:i}};exports.useAttribute=useAttribute;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useAttribute=()=>{const{topViewInstance:t,sideViewInstance:u,backViewInstance:l,mainViewInstance:i,ptSegmentInstance:o,defaultAttribute:s,setDefaultAttribute:r}=React.useContext(PointCloudContext.PointCloudContext);React.useEffect(()=>{if(!(t==null?void 0:t.toolInstance))return;const e=()=>{r(t==null?void 0:t.toolInstance.defaultAttribute)};return t==null||t.toolInstance.on("changeAttributeSidebar",e),()=>{t==null||t.toolInstance.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.toolInstance]);const d=e=>{[t==null?void 0:t.toolInstance,u==null?void 0:u.toolInstance,l==null?void 0:l.toolInstance].forEach(n=>{n==null||n.setDefaultAttribute(e)})},c=e=>{t==null||t.toolInstance.setDefaultAttribute(e)},b=e=>{i==null||i.generateBox(e)},v=React.useCallback(e=>{var n,a;!o||((n=o.store)==null||n.setAttribute(e),(a=o.pointCloudRender)==null||a.updatePointsColor(),r(e))},[o]);return{syncThreeViewsAttribute:d,updateDefaultAttribute:c,reRenderPointCloud3DBox:b,defaultAttribute:s,updateSegmentAttribute:v}};exports.useAttribute=useAttribute;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,s,l)=>s in e?__defProp(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l,__spreadValues=(e,s)=>{for(var l in s||(s={}))__hasOwnProp.call(s,l)&&__defNormalProp(e,l,s[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(s))__propIsEnum.call(s,l)&&__defNormalProp(e,l,s[l]);return e};const useHistory=()=>{const{history:e,setPointCloudResult:s,setSelectedIDs:l,pointCloudBoxList:p,pointCloudSphereList:L,setPointCloudSphereList:x,mainViewInstance:u,topViewInstance:y,polygonList:f,setPolygonList:P,lineList:C,setLineList:g,syncAllViewPointCloudColor:_}=React.useContext(PointCloudContext.PointCloudContext),S=({newBoxParams:t,newPolygon:o,newLine:i,newSphereParams:r})=>{const d={pointCloudBoxList:p,polygonList:f,lineList:C,pointCloudSphereList:L};t&&(d.pointCloudBoxList=p.concat(t)),o&&(d.polygonList=f.concat(o)),i&&(d.lineList=C.concat(i)),r&&(d.pointCloudSphereList=L.concat(r)),e.pushHistory(d)},B=t=>{const o={pointCloudBoxList:p,polygonList:f,lineList:C,pointCloudSphereList:L};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),t.lineList&&(o.lineList=t.lineList),t.pointCloudSphereList&&(o.pointCloudSphereList=t.pointCloudSphereList),e.pushHistory(o)},H=t=>{if(C.find(i=>i.id===t.id)){const i=C.map(r=>r.id===t.id?t:__spreadValues({},r));e.pushHistory({lineList:i}),g(i)}},O=t=>{if(f.find(i=>i.id===t.id)){const i=f.map(r=>r.id===t.id?t:__spreadValues({},r));e.pushHistory({pointCloudBoxList:p,polygonList:i}),P(i)}},w=({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i})=>{e.initRecord({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i},!0)},v=t=>{if(!t)return;const{pointCloudBoxList:o=[],polygonList:i=[],lineList:r=[],pointCloudSphereList:d=[]}=t;if(o){p.length!==o.length&&l();const h=p.filter(n=>o.every(c=>c.id!==n.id)),a=o.filter(n=>p.every(c=>c.id!==n.id));h.forEach(n=>{u==null||u.removeObjectByName(n.id)}),a.forEach(n=>{u==null||u.generateBox(n)}),s(o),_(o)}if(d){L.length!==d.length&&l();let h=L.filter(n=>d.every(c=>c.id!==n.id)),a=d.filter(n=>L.every(c=>c.id!==n.id));h.forEach(n=>{u==null||u.removeObjectByName(n.id)}),a.forEach(n=>{u==null||u.generateSphere(n)}),x(d)}i&&P(i),r&&g(r),y==null||y.updatePolygonList(o!=null?o:[],i!=null?i:[]),y==null||y.updateLineList(r!=null?r:[]),y==null||y.updatePointList(d)};return{addHistory:S,pushHistoryWithList:B,initHistory:w,pushHistoryUnderUpdatePolygon:O,pushHistoryUnderUpdateLine:H,redo:()=>{v(e.redo())},undo:()=>{v(e.undo())}}};exports.useHistory=useHistory;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,s)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,__spreadValues=(e,n)=>{for(var s in n||(n={}))__hasOwnProp.call(n,s)&&__defNormalProp(e,s,n[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(n))__propIsEnum.call(n,s)&&__defNormalProp(e,s,n[s]);return e};const useHistory=()=>{const{history:e,setPointCloudResult:n,setSelectedIDs:s,pointCloudBoxList:L,pointCloudSphereList:y,setPointCloudSphereList:g,mainViewInstance:u,topViewInstance:d,polygonList:c,setPolygonList:f,lineList:p,setLineList:C,syncAllViewPointCloudColor:P,segmentation:a}=React.useContext(PointCloudContext.PointCloudContext),x=({newBoxParams:t,newPolygon:o,newLine:i,newSphereParams:l})=>{const r={pointCloudBoxList:L,polygonList:c,lineList:p,pointCloudSphereList:y};t&&(r.pointCloudBoxList=L.concat(t)),o&&(r.polygonList=c.concat(o)),i&&(r.lineList=p.concat(i)),l&&(r.pointCloudSphereList=y.concat(l)),e.pushHistory(r)},v=t=>{const o={pointCloudBoxList:L,polygonList:c,lineList:p,pointCloudSphereList:y,segmentation:a};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),t.lineList&&(o.lineList=t.lineList),t.pointCloudSphereList&&(o.pointCloudSphereList=t.pointCloudSphereList),t.segmentation&&(o.segmentation=t.segmentation),e.pushHistory(o)},S=t=>{if(p.find(i=>i.id===t.id)){const i=p.map(l=>l.id===t.id?t:__spreadValues({},l));e.pushHistory({lineList:i}),C(i)}},_=t=>{if(c.find(i=>i.id===t.id)){const i=c.map(l=>l.id===t.id?t:__spreadValues({},l));e.pushHistory({pointCloudBoxList:L,polygonList:i}),f(i)}},H=({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i})=>{e.initRecord({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i,lineList:p},!0)},h=t=>{if(!t)return;const{pointCloudBoxList:o=[],polygonList:i=[],lineList:l=[],pointCloudSphereList:r=[]}=t;o&&(L.length!==o.length&&s(),u==null||u.clearAllBox(),u==null||u.generateBoxes(o),n(o),P(o)),r&&(y.length!==r.length&&s(),u==null||u.clearAllSphere(),u==null||u.generateSpheres(r),g(r)),i&&f(i),l&&C(l),d==null||d.updatePolygonList(o!=null?o:[],i!=null?i:[]),d==null||d.updateLineList(l!=null?l:[]),d==null||d.updatePointList(r)};return{addHistory:x,pushHistoryWithList:v,initHistory:H,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdateLine:S,redo:()=>{h(e.redo())},undo:()=>{h(e.undo())}}};exports.useHistory=useHistory;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,o,i)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,__spreadValues=(t,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(t,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(t,i,o[i]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o)),__async=(t,o,i)=>new Promise((l,e)=>{var a=d=>{try{r(i.next(d))}catch(g){e(g)}},p=d=>{try{r(i.throw(d))}catch(g){e(g)}},r=d=>d.done?l(d.value):Promise.resolve(d.value).then(a,p);r((i=i.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(t,o,i,l,e)=>{const{x:a,y:p}=lbUtils.PointCloudUtils.transferCanvas2World(t,o),{defaultZ:r}=lbUtils.DEFAULT_SPHERE_PARAMS,d={center:{x:a,y:p,z:r},id:t.id},g=l?__spreadValues(__spreadValues({},l),d):__spreadProps(__spreadValues({},d),{attribute:"",valid:!0});return e&&Object.assign(g,e),g},topViewPolygon2PointCloud=(t,o,i,l,e,a)=>{let p=t.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,o)),r=0,d=1,g={};if(i){const y=i.getSensesPointZAxisInPolygon(p,void 0,a);a&&y.fittedCoordinates.length>0&&(p=y.fittedCoordinates),r=(y.maxZ+y.minZ)/2,d=y.maxZ-y.minZ,g={count:y.zCount}}const[f,L,I]=p,U=lbAnnotation.MathUtils.getLineCenterPoint([f,I]),_=lbAnnotation.MathUtils.getLineLength(f,L),D=lbAnnotation.MathUtils.getLineLength(L,I),O=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);l&&(r=l.center.z,d=l.depth);const V={center:{x:U.x,y:U.y,z:r},width:D,height:_,depth:d,rotation:O,id:t.id},w=__spreadValues(l?__spreadValues(__spreadValues({},l),V):__spreadProps(__spreadValues({},V),{attribute:"",valid:!0}),g);e&&Object.assign(w,e);const k=p.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,o));return{boxParams:w,newPointList:k}},sideViewPoint2PointCloud=(t,o,i)=>{const l={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-l.x,y:i.center.y,z:i.center.z-l.y}})},sideViewPolygon2PointCloud=(t,o,i,l)=>{const[e,a,p]=t.pointList,[r,d,g]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),L=lbAnnotation.MathUtils.getLineCenterPoint([r,g]),U={x:{x:f.x-L.x,y:f.y-L.y}.x,y:0,z:f.y-L.y},_=lbAnnotation.MathUtils.getLineLength(e,a),D=lbAnnotation.MathUtils.getLineLength(r,d),O=_-D,V=lbAnnotation.MathUtils.getLineLength(a,p),w=lbAnnotation.MathUtils.getLineLength(d,g),k=V-w,{newBoxParams:y}=l.getNewBoxBySideUpdate(U,k,O,i);return y},backViewPoint2PointCloud=(t,o,i)=>{const l={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-l.x,z:i.center.z-l.y}})},backViewPolygon2PointCloud=(t,o,i,l)=>{const[e,a,p]=t.pointList,[r,d,g]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),L=lbAnnotation.MathUtils.getLineCenterPoint([r,g]),U={x:{x:f.x-L.x,y:f.y-L.y}.x,y:0,z:f.y-L.y},_=lbAnnotation.MathUtils.getLineLength(e,a),D=lbAnnotation.MathUtils.getLineLength(r,d),O=_-D,V=lbAnnotation.MathUtils.getLineLength(a,p),w=lbAnnotation.MathUtils.getLineLength(d,g),k=V-w;let{newBoxParams:y}=l.getNewBoxByBackUpdate(U,k,O,i);return y},syncSideViewByPoint=(t,o,i,l,e)=>{var a;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(a=e==null?void 0:e.radius)!=null?a:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Left);r.setInitCameraPosition(d);const{point2d:g,zoom:f}=r.getSphereSidePoint2DCoordinate(t);r.camera.zoom=f,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(f),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),g),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeSideView=(t,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:a}=i;a.loadPCDFileByBox(l,t,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=a.updateOrthoCamera(t,lbUtils.EPerspectiveView.Left);a.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=a.getBoxSidePolygon2DCoordinate(t);a.camera.zoom=d,a.camera.updateProjectionMatrix(),a.render(),e.initPosition(),e.zoomChangeOnCenter(d),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:r,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncBackViewByPoint=(t,o,i,l,e)=>{var a;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(a=e==null?void 0:e.radius)!=null?a:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Back);r.setInitCameraPosition(d);const{point2d:g,zoom:f}=r.getSphereBackPoint2DCoordinate(t);r.camera.zoom=f,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(f),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),g),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeBackView=(t,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:a}=i;a.loadPCDFileByBox(l,t,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=a.updateOrthoCamera(t,lbUtils.EPerspectiveView.Back);a.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=a.getBoxBackPolygon2DCoordinate(t);a.camera.zoom=d,a.camera.updateProjectionMatrix(),a.render(),e.initPosition(),e.zoomChangeOnCenter(d),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:r,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncTopViewByPoint=(t,o,i,l)=>{if(!i||!l)return;l.generateSphere(t),l.updateCameraBySphere(t,lbUtils.EPerspectiveView.Top),l.render();const{toolInstance:e,pointCloudInstance:a}=i,{point2d:p}=a.getSphereTopPoint2DCoordinate(t),r=[...e.pointList].map(d=>d.id===o.id?__spreadProps(__spreadValues(__spreadValues({},o),p),{valid:t.valid,textAttribute:"",attribute:t.attribute}):d);e.setResult(r),e.setSelectedID(o.id)},synchronizeTopView=(t,o,i,l)=>{var e;if(!i||!l)return;l.generateBox(t,o.id),l.render();const{pointCloud2dOperation:a,pointCloudInstance:p}=i,{polygon2d:r}=p.getBoxTopPolygon2DCoordinate(t),d=[...a.polygonList],g=d.find(f=>f.id===o.id);g?g.pointList=r:d.push({id:o.id,pointList:r,textAttribute:"",isRect:!0,valid:(e=t.valid)!=null?e:!0}),a.setResultAndSelectedID(d,o.id)},usePointCloudViews=()=>{const t=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:l,mainViewInstance:e,addPointCloudBox:a,addPointCloudSphere:p,setSelectedIDs:r,selectedIDs:d,pointCloudBoxList:g,pointCloudSphereList:f,hideAttributes:L}=t,{addHistory:I,initHistory:U,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdateLine:D}=useHistory.useHistory(),{selectedPolygon:O}=usePolygon.usePolygon(),{updateSelectedBox:V,updateSelectedBoxes:w,getPointCloudByID:k}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:y,updatePointCloudSphere:F,selectedSphere:M}=useSphere.useSphere(),{currentData:j,config:B}=ctx.useSelector(n=>{const{stepList:s,step:P,imgList:c,imgIndex:u}=n.annotation;return{currentData:c[u],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,s).config)}}),N=ctx.useDispatch(),{selectedBox:A}=useSingleBox.useSingleBox(),{t:Q}=reactI18next.useTranslation(),Z=A==null?void 0:A.info;if(!o||!i||!l)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:q}=o,X=n=>{e==null||e.generateBox(n),e==null||e.controls.update(),e==null||e.render()},Y=n=>{e==null||e.generateSphere(n),e==null||e.controls.update(),e==null||e.render()},J=({newPoint:n,size:s,zoom:P,trackConfigurable:c})=>{var u;const C={attribute:(u=o.toolInstance.defaultAttribute)!=null?u:""};c===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:f})});const h=topViewPoint2PointCloud(n,s,q,void 0,C);r(n.id);const v=p(h);R(PointCloudView.Top,n,h,P,v,B),I({newSphereParams:h})},K=({polygon:n,size:s,imgList:P,trackConfigurable:c,zoom:u,intelligentFit:C})=>{var h,v;const m={attribute:(h=o.toolInstance.defaultAttribute)!=null?h:""};c===!0&&Object.assign(m,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:g,extraSphereList:f})});const T=o==null?void 0:o.toolInstance,S=__spreadValues({},n),{boxParams:x,newPointList:z}=topViewPolygon2PointCloud(S,s,q,void 0,m,C);if((B==null?void 0:B.lowerLimitPointsNumInBox)&&typeof x.count=="number"&&x.count<B.lowerLimitPointsNumInBox){antd.message.info(Q("LowerLimitPointsNumInBox",{num:B.lowerLimitPointsNumInBox})),T.deletePolygon(x.id);return}C&&(z==null?void 0:z.length)&&(S.pointList=z);const b=L.includes(S.attribute),H=a(x),lt=(v=t==null?void 0:t.polygonList)!=null?v:[];o==null||o.updatePolygonList(H!=null?H:[],lt),b?r([]):(r(x.id),T.selection.setSelectedIDs(S.id),E(PointCloudView.Top,S,x,u,H),C&&synchronizeTopView(x,S,o,e)),I({newBoxParams:x})},$=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:P,newSphereList:c})=>{var u;const C=o==null?void 0:o.toolInstance;if(!(d.length===0||!C)){if(n||(A==null?void 0:A.info)){const h=n!=null?n:A==null?void 0:A.info;(u=C==null?void 0:C.selection)==null||u.setSelectedIDs(d[0]);const v=C.selectedPolygon;if(d.length===1&&h){E(PointCloudView.Top,v,h,void 0,s);return}}if((P||M)&&d.length===1){const h=P!=null?P:M;C.setSelectedID(d[0]);const v=C.selectedPoint;h&&R(PointCloudView.Top,v,h,void 0,c,B)}}},W=(n,s,P)=>{if(Z){let c,u;switch(P){case PointCloudView.Back:c=backViewPolygon2PointCloud;break;case PointCloudView.Side:c=sideViewPolygon2PointCloud;break;default:c=sideViewPolygon2PointCloud;break}if(u=c(n,s,Z,i.pointCloudInstance),e){const{count:h}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(u).polygonPointList,[u.center.z-u.depth/2,u.center.z+u.depth/2]);u=__spreadProps(__spreadValues({},u),{count:h})}const C=V(u);return E(P,n,u,void 0,C),C}},G=(n,s,P)=>{if(M){let c,u;switch(P){case PointCloudView.Back:c=backViewPoint2PointCloud;break;case PointCloudView.Side:c=sideViewPoint2PointCloud;break;default:c=sideViewPoint2PointCloud;break}u=c(n,s,M);const C=F(u);return R(P,n,u,void 0,C,B),C}},tt=(n,s)=>{G(n,s,PointCloudView.Side)},et=(n,s)=>{G(n,s,PointCloudView.Back)},ot=(n,s)=>{W(n,s,PointCloudView.Side)},it=(n,s)=>{W(n,s,PointCloudView.Back)},nt=(n,s)=>{D(n)},st=(n,s)=>{const P=y(n.id),c=topViewPoint2PointCloud(n,s,q,P),u=F(c);R(PointCloudView.Top,n,c,void 0,u,B)},rt=(n,s)=>{if(O){const c=n[0].newPolygon;c.pointList=c.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,s)),_(n[0].newPolygon);return}const P=n.map(({newPolygon:c})=>{const u=k(c.id),{boxParams:C}=topViewPolygon2PointCloud(c,s,o.pointCloudInstance,u);return C});if(P.length===1){const{newPolygon:c}=n[0],u=w(P);E(PointCloudView.Top,c,P[0],void 0,u)}else{const c=w(P);c&&t.syncAllViewPointCloudColor(c)}},R=(n,s,P,c,u,C)=>__async(void 0,null,function*(){const h=j==null?void 0:j.url,v={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,s,i,h,C)},[PointCloudView.Back]:()=>{l&&syncBackViewByPoint(P,s,l,h,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,s,o,e)}};Object.keys(v).forEach(m=>{m!==n&&v[m]()}),c&&(e==null||e.updateCameraZoom(c)),Y(P)}),E=(n,s,P,c,u)=>__async(void 0,null,function*(){const C=j==null?void 0:j.url;u&&(yield t.syncAllViewPointCloudColor(u));const h={[PointCloudView.Side]:()=>{synchronizeSideView(P,s,i,C)},[PointCloudView.Back]:()=>{l&&synchronizeBackView(P,s,l,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,s,o,e)}};Object.keys(h).forEach(v=>{v!==n&&h[v]()}),c&&(e==null||e.updateCameraZoom(c)),X(P)});return{topViewAddSphere:J,topViewAddBox:K,topViewSelectedChanged:$,topViewUpdatePoint:st,sideViewUpdatePoint:tt,backViewUpdatePoint:et,topViewUpdateBox:rt,topViewUpdateLine:nt,sideViewUpdateBox:ot,backViewUpdateBox:it,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),e==null||e.generateBoxes(n)},initPointCloud3d:n=>{if(!e)return;const s={left:-n.width/2,right:n.width/2,top:n.height/2,bottom:-n.height/2,near:100,far:-100};e.initOrthographicCamera(s),e.initRenderer(),e.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=j){var P,c,u,C,h,v;if(!(s==null?void 0:s.url)||!e)return;actionCreators.SetPointCloudLoading(N,!0),yield e.loadPCDFile(s.url,(P=B==null?void 0:B.radius)!=null?P:DEFAULT_RADIUS),g.forEach(b=>{e==null||e.removeObjectByName(b.id)}),f.forEach(b=>{e==null||e.removeObjectByName(b.id)});let m=[],T=[],S=[],x=[];s.result?(m=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),S=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),T=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),x=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),m.forEach(b=>{e==null||e.generateBox(b)}),x.forEach(b=>{e==null||e.generateSphere(b)}),t.syncAllViewPointCloudColor(m),t.setPointCloudResult(m),t.setPolygonList(S),t.setLineList(T),t.setPointCloudSphereList(x)):(t.setPointCloudResult([]),t.setPolygonList([]),t.setPointCloudSphereList([]),t.setLineList([])),U({pointCloudBoxList:m,polygonList:S,pointCloudSphereList:x}),e.updateTopCamera();const z=(u=(c=index.jsonParser(s.result))==null?void 0:c.valid)!=null?u:!0;t.setPointCloudValid(z),(C=t.sideViewInstance)==null||C.clearAllData(),(h=t.backViewInstance)==null||h.clearAllData(),o.updateData(s.url,s.result,{radius:(v=B==null?void 0:B.radius)!=null?v:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(N,!1)})}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,i)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[o]=i,__spreadValues=(e,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(e,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(e,i,o[i]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__async=(e,o,i)=>new Promise((l,t)=>{var a=d=>{try{r(i.next(d))}catch(g){t(g)}},p=d=>{try{r(i.throw(d))}catch(g){t(g)}},r=d=>d.done?l(d.value):Promise.resolve(d.value).then(a,p);r((i=i.apply(e,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,o,i,l,t)=>{const{x:a,y:p}=lbUtils.PointCloudUtils.transferCanvas2World(e,o),{defaultZ:r}=lbUtils.DEFAULT_SPHERE_PARAMS,d={center:{x:a,y:p,z:r},id:e.id},g=l?__spreadValues(__spreadValues({},l),d):__spreadProps(__spreadValues({},d),{attribute:"",valid:!0});return t&&Object.assign(g,t),g},topViewPolygon2PointCloud=(e,o,i,l,t,a)=>{let p=e.pointList.map(v=>lbUtils.PointCloudUtils.transferCanvas2World(v,o)),r=0,d=1,g={};if(i){const v=i.getSensesPointZAxisInPolygon(p,void 0,a);a&&v.fittedCoordinates.length>0&&(p=v.fittedCoordinates),r=(v.maxZ+v.minZ)/2,d=v.maxZ-v.minZ,g={count:v.zCount}}const[f,x,V]=p,U=lbAnnotation.MathUtils.getLineCenterPoint([f,V]),I=lbAnnotation.MathUtils.getLineLength(f,x),_=lbAnnotation.MathUtils.getLineLength(x,V),D=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);l&&(r=l.center.z,d=l.depth);const b={center:{x:U.x,y:U.y,z:r},width:_,height:I,depth:d,rotation:D,id:e.id},S=__spreadValues(l?__spreadValues(__spreadValues({},l),b):__spreadProps(__spreadValues({},b),{attribute:"",valid:!0}),g);t&&Object.assign(S,t);const O=p.map(v=>lbUtils.PointCloudUtils.transferWorld2Canvas(v,o));return{boxParams:S,newPointList:O}},sideViewPoint2PointCloud=(e,o,i)=>{const l={x:e.x-o.x,y:e.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-l.x,y:i.center.y,z:i.center.z-l.y}})},sideViewPolygon2PointCloud=(e,o,i,l)=>{const[t,a,p]=e.pointList,[r,d,g]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([t,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([r,g]),U={x:{x:f.x-x.x,y:f.y-x.y}.x,y:0,z:f.y-x.y},I=lbAnnotation.MathUtils.getLineLength(t,a),_=lbAnnotation.MathUtils.getLineLength(r,d),D=I-_,b=lbAnnotation.MathUtils.getLineLength(a,p),S=lbAnnotation.MathUtils.getLineLength(d,g),O=b-S,{newBoxParams:v}=l.getNewBoxBySideUpdate(U,O,D,i);return v},backViewPoint2PointCloud=(e,o,i)=>{const l={x:e.x-o.x,y:e.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-l.x,z:i.center.z-l.y}})},backViewPolygon2PointCloud=(e,o,i,l)=>{const[t,a,p]=e.pointList,[r,d,g]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([t,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([r,g]),U={x:{x:f.x-x.x,y:f.y-x.y}.x,y:0,z:f.y-x.y},I=lbAnnotation.MathUtils.getLineLength(t,a),_=lbAnnotation.MathUtils.getLineLength(r,d),D=I-_,b=lbAnnotation.MathUtils.getLineLength(a,p),S=lbAnnotation.MathUtils.getLineLength(d,g),O=b-S;let{newBoxParams:v}=l.getNewBoxByBackUpdate(U,O,D,i);return v},syncSideViewByPoint=(e,o,i,l,t)=>{var a;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(a=t==null?void 0:t.radius)!=null?a:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);r.setInitCameraPosition(d);const{point2d:g,zoom:f}=r.getSphereSidePoint2DCoordinate(e);r.camera.zoom=f,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(f),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),g),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),p.setSelectedID(o.id)},synchronizeSideView=(e,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:t,pointCloudInstance:a}=i;a.loadPCDFileByBox(l,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=a.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);a.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=a.getBoxSidePolygon2DCoordinate(e);a.camera.zoom=d,a.camera.updateProjectionMatrix(),a.render(),t.initPosition(),t.zoomChangeOnCenter(d),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:r,textAttribute:"",isRect:!0,attribute:e.attribute}],o.id)},syncBackViewByPoint=(e,o,i,l,t)=>{var a;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(a=t==null?void 0:t.radius)!=null?a:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);r.setInitCameraPosition(d);const{point2d:g,zoom:f}=r.getSphereBackPoint2DCoordinate(e);r.camera.zoom=f,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(f),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),g),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),p.setSelectedID(o.id)},synchronizeBackView=(e,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:t,pointCloudInstance:a}=i;a.loadPCDFileByBox(l,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=a.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);a.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=a.getBoxBackPolygon2DCoordinate(e);a.camera.zoom=d,a.camera.updateProjectionMatrix(),a.render(),t.initPosition(),t.zoomChangeOnCenter(d),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:r,textAttribute:"",isRect:!0,attribute:e.attribute}],o.id)},syncTopViewByPoint=(e,o,i,l)=>{if(!i||!l)return;l.generateSphere(e),l.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),l.render();const{toolInstance:t,pointCloudInstance:a}=i,{point2d:p}=a.getSphereTopPoint2DCoordinate(e),r=[...t.pointList].map(d=>d.id===o.id?__spreadProps(__spreadValues(__spreadValues({},o),p),{valid:e.valid,textAttribute:"",attribute:e.attribute}):d);t.setResult(r),t.setSelectedID(o.id)},synchronizeTopView=(e,o,i,l)=>{var t;if(!i||!l)return;l.generateBox(e,o.id),l.render();const{pointCloud2dOperation:a,pointCloudInstance:p}=i,{polygon2d:r}=p.getBoxTopPolygon2DCoordinate(e),d=[...a.polygonList],g=d.find(f=>f.id===o.id);g?g.pointList=r:d.push({id:o.id,pointList:r,textAttribute:"",isRect:!0,valid:(t=e.valid)!=null?t:!0}),a.setResultAndSelectedID(d,o.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:l,mainViewInstance:t,addPointCloudBox:a,addPointCloudSphere:p,setSelectedIDs:r,selectedIDs:d,pointCloudBoxList:g,pointCloudSphereList:f,hideAttributes:x}=e,{addHistory:V,initHistory:U,pushHistoryUnderUpdatePolygon:I,pushHistoryUnderUpdateLine:_}=useHistory.useHistory(),{selectedPolygon:D}=usePolygon.usePolygon(),{updateSelectedBox:b,updateSelectedBoxes:S,getPointCloudByID:O}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:v,updatePointCloudSphere:H,selectedSphere:T}=useSphere.useSphere(),{currentData:A,config:L}=ctx.useSelector(n=>{const{stepList:s,step:P,imgList:c,imgIndex:u}=n.annotation;return{currentData:c[u],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,s).config)}}),F=ctx.useDispatch(),{selectedBox:k}=useSingleBox.useSingleBox(),{t:G}=reactI18next.useTranslation(),N=k==null?void 0:k.info;if(!o||!i||!l)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:E}=o,Q=n=>{t==null||t.generateBox(n),t==null||t.controls.update(),t==null||t.render()},X=n=>{t==null||t.generateSphere(n),t==null||t.controls.update(),t==null||t.render()},Y=({newPoint:n,size:s,zoom:P,trackConfigurable:c})=>{var u;const C={attribute:(u=o.toolInstance.defaultAttribute)!=null?u:""};c===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:f})});const h=topViewPoint2PointCloud(n,s,E,void 0,C);r(n.id);const y=p(h);M(PointCloudView.Top,n,h,P,y,L),V({newSphereParams:h})},J=({polygon:n,size:s,imgList:P,trackConfigurable:c,zoom:u,intelligentFit:C})=>{var h,y;const m={attribute:(h=o.toolInstance.defaultAttribute)!=null?h:""};c===!0&&Object.assign(m,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:g,extraSphereList:f})});const z=o==null?void 0:o.toolInstance,w=__spreadValues({},n),{boxParams:B,newPointList:j}=topViewPolygon2PointCloud(w,s,E,void 0,m,C);if((L==null?void 0:L.lowerLimitPointsNumInBox)&&typeof B.count=="number"&&B.count<L.lowerLimitPointsNumInBox){antd.message.info(G("LowerLimitPointsNumInBox",{num:L.lowerLimitPointsNumInBox})),z.deletePolygon(B.id);return}C&&(j==null?void 0:j.length)&&(w.pointList=j);const rt=x.includes(w.attribute),q=a(B),lt=(y=e==null?void 0:e.polygonList)!=null?y:[];o==null||o.updatePolygonList(q!=null?q:[],lt),rt?r([]):(r(B.id),z.selection.setSelectedIDs(w.id),R(PointCloudView.Top,w,B,u,q),C&&synchronizeTopView(B,w,o,t)),V({newBoxParams:B})},K=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:P,newSphereList:c})=>{var u;const C=o==null?void 0:o.toolInstance;if(!(d.length===0||!C)){if(n||(k==null?void 0:k.info)){const h=n!=null?n:k==null?void 0:k.info;(u=C==null?void 0:C.selection)==null||u.setSelectedIDs(d[0]);const y=C.selectedPolygon;if(d.length===1&&h){R(PointCloudView.Top,y,h,void 0,s);return}}if((P||T)&&d.length===1){const h=P!=null?P:T;C.setSelectedID(d[0]);const y=C.selectedPoint;h&&M(PointCloudView.Top,y,h,void 0,c,L)}}},Z=(n,s,P)=>{if(N){let c,u;switch(P){case PointCloudView.Back:c=backViewPolygon2PointCloud;break;case PointCloudView.Side:c=sideViewPolygon2PointCloud;break;default:c=sideViewPolygon2PointCloud;break}if(u=c(n,s,N,i.pointCloudInstance),t){const{count:h}=t.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(u).polygonPointList,[u.center.z-u.depth/2,u.center.z+u.depth/2]);u=__spreadProps(__spreadValues({},u),{count:h})}const C=b(u);return R(P,n,u,void 0,C),C}},W=(n,s,P)=>{if(T){let c,u;switch(P){case PointCloudView.Back:c=backViewPoint2PointCloud;break;case PointCloudView.Side:c=sideViewPoint2PointCloud;break;default:c=sideViewPoint2PointCloud;break}u=c(n,s,T);const C=H(u);return M(P,n,u,void 0,C,L),C}},$=(n,s)=>{W(n,s,PointCloudView.Side)},tt=(n,s)=>{W(n,s,PointCloudView.Back)},et=(n,s)=>{Z(n,s,PointCloudView.Side)},ot=(n,s)=>{Z(n,s,PointCloudView.Back)},it=(n,s)=>{_(n)},nt=(n,s)=>{const P=v(n.id),c=topViewPoint2PointCloud(n,s,E,P),u=H(c);M(PointCloudView.Top,n,c,void 0,u,L)},st=(n,s)=>{if(D){const c=n[0].newPolygon;c.pointList=c.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,s)),I(n[0].newPolygon);return}const P=n.map(({newPolygon:c})=>{const u=O(c.id),{boxParams:C}=topViewPolygon2PointCloud(c,s,o.pointCloudInstance,u);return C});if(P.length===1){const{newPolygon:c}=n[0],u=S(P);R(PointCloudView.Top,c,P[0],void 0,u)}else{const c=S(P);c&&e.syncAllViewPointCloudColor(c)}},M=(n,s,P,c,u,C)=>__async(void 0,null,function*(){const h=A==null?void 0:A.url,y={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,s,i,h,C)},[PointCloudView.Back]:()=>{l&&syncBackViewByPoint(P,s,l,h,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,s,o,t)}};Object.keys(y).forEach(m=>{m!==n&&y[m]()}),c&&(t==null||t.updateCameraZoom(c)),X(P)}),R=(n,s,P,c,u)=>__async(void 0,null,function*(){const C=A==null?void 0:A.url;u&&(yield e.syncAllViewPointCloudColor(u));const h={[PointCloudView.Side]:()=>{synchronizeSideView(P,s,i,C)},[PointCloudView.Back]:()=>{l&&synchronizeBackView(P,s,l,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,s,o,t)}};Object.keys(h).forEach(y=>{y!==n&&h[y]()}),c&&(t==null||t.updateCameraZoom(c)),Q(P)});return{topViewAddSphere:Y,topViewAddBox:J,topViewSelectedChanged:K,topViewUpdatePoint:nt,sideViewUpdatePoint:$,backViewUpdatePoint:tt,topViewUpdateBox:st,topViewUpdateLine:it,sideViewUpdateBox:et,backViewUpdateBox:ot,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),t==null||t.generateBoxes(n)},initPointCloud3d:n=>{if(!t)return;const s=lbUtils.PointCloudUtils.getDefaultOrthographicParams(n);t.initOrthographicCamera(s),t.initRenderer(),t.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=A){var P,c,u,C,h,y;if(!(s==null?void 0:s.url)||!t)return;actionCreators.SetPointCloudLoading(F,!0),yield t.loadPCDFile(s.url,(P=L==null?void 0:L.radius)!=null?P:DEFAULT_RADIUS),t==null||t.clearAllBox(),t==null||t.clearAllSphere();let m=[],z=[],w=[],B=[];s.result&&(m=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),w=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),z=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),B=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),t==null||t.generateBoxes(m),t==null||t.generateSpheres(B),e.syncAllViewPointCloudColor(m)),U({pointCloudBoxList:m,polygonList:w,lineList:z,pointCloudSphereList:B}),t.updateTopCamera();const j=(u=(c=index.jsonParser(s.result))==null?void 0:c.valid)!=null?u:!0;e.setPointCloudValid(j),(C=e.sideViewInstance)==null||C.clearAllData(),(h=e.backViewInstance)==null||h.clearAllData(),o.updateData(s.url,s.result,{radius:(y=L==null?void 0:L.radius)!=null?y:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(F,!1)})}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,l,n)=>l in e?__defProp(e,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[l]=n,__spreadValues=(e,l)=>{for(var n in l||(l={}))__hasOwnProp.call(l,n)&&__defNormalProp(e,n,l[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(l))__propIsEnum.call(l,n)&&__defNormalProp(e,n,l[n]);return e},__spreadProps=(e,l)=>__defProps(e,__getOwnPropDescs(l));const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=()=>{const{pointCloudBoxList:e,setPointCloudResult:l,topViewInstance:n,backViewInstance:P,sideViewInstance:y,selectedIDs:c,selectedID:v,mainViewInstance:s,setSelectedIDs:I,syncAllViewPointCloudColor:C,polygonList:O,pointCloudPattern:x}=React.useContext(PointCloudContext.PointCloudContext),{selectedPolygon:a,updateSelectedPolygon:m,updatePolygonValidByID:h,deletePolygon:D}=usePolygon.usePolygon(),{pushHistoryWithList:g}=useHistory.useHistory(),d=React.useMemo(()=>{const o=e.findIndex(t=>t.id===v);if(o>-1)return{info:e[o],index:o}},[v,e]),B=React.useCallback(o=>{if(d==null?void 0:d.info){e.splice(d.index,1,___default.default.merge(d.info,o));const t=___default.default.cloneDeep(e);return l(t),g({pointCloudBoxList:t}),t}return e},[v,e]),V=React.useCallback((o,t)=>{const i=e.findIndex(r=>r.id===t);if(i>-1){e.splice(i,1,___default.default.merge(e[i],o));const r=___default.default.cloneDeep(e);return l(r),r}return e},[e]),f=React.useCallback(o=>{n==null||n.pointCloud2dOperation.setPolygonValidAndRender(o,!0),y==null||y.pointCloud2dOperation.setPolygonValidAndRender(o,!0),P==null||P.pointCloud2dOperation.setPolygonValidAndRender(o,!0)},[n,y,P]),L=React.useCallback(()=>{if(d==null?void 0:d.info){const{id:o,valid:t=!0}=d.info,i=B({valid:!t});C(i),f(o)}a&&(m(__spreadProps(__spreadValues({},a),{valid:!a.valid})),n==null||n.pointCloud2dOperation.setPolygonValidAndRender(a.id,!0))},[f,d,a]),S=React.useCallback(o=>{const t=e.find(i=>i.id===o);if(t){const{id:i,valid:r=!0}=t,u=V({valid:!r},i);return f(i),u}h(o)},[f,e,O]),b=React.useCallback((o=ESortDirection.ascend,t=!1)=>{if(!n||c.length>1)return;if(x!==lbAnnotation.EToolName.Rect&&x!==lbAnnotation.EToolName.Polygon){t&&document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:9,shiftKey:o!==ESortDirection.ascend}));return}const{pointCloud2dOperation:i}=n,r=i.switchToNextPolygon(o);r&&I(r)},[n,x,n==null?void 0:n.toolInstance]),j=(o=!1)=>{b(ESortDirection.descend,o)},k=(o=!1)=>{b(ESortDirection.ascend,o)},w=o=>{const t=e.filter(i=>i.id!==o);l(t),s==null||s.removeObjectByName(o),s==null||s.render(),C(t)},A=()=>{d&&(w(d.info.id),n==null||n.pointCloud2dOperation.deletePolygon(d.info.id)),a&&(D(a.id),n==null||n.pointCloud2dOperation.deletePolygon(a.id))},E=React.useMemo(()=>e.filter(o=>c.includes(o.id)),[c,e]),N=React.useCallback(o=>{const t=___default.default.cloneDeep(e);let i=!1;if(o.forEach(r=>{const u=t.findIndex(p=>p.id===r.id);if(u>-1){const p=___default.default.merge(t[u],r);t.splice(u,1,p),s==null||s.generateBox(p),i=!0}}),i)return l(t),g({pointCloudBoxList:t}),s==null||s.render(),t},[c,e]),R=React.useCallback(o=>e.find(t=>t.id===o),[e]);return{selectedBox:d,updateSelectedBox:B,changeSelectedBoxValid:L,changeValidByID:S,selectNextBox:k,selectPrevBox:j,deletePointCloudBox:w,selectedBoxes:E,updateSelectedBoxes:N,getPointCloudByID:R,deleteSelectedPointCloudBoxAndPolygon:A}};exports.useSingleBox=useSingleBox;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,l,n)=>l in e?__defProp(e,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[l]=n,__spreadValues=(e,l)=>{for(var n in l||(l={}))__hasOwnProp.call(l,n)&&__defNormalProp(e,n,l[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(l))__propIsEnum.call(l,n)&&__defNormalProp(e,n,l[n]);return e},__spreadProps=(e,l)=>__defProps(e,__getOwnPropDescs(l));const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=()=>{const{pointCloudBoxList:e,setPointCloudResult:l,topViewInstance:n,backViewInstance:P,sideViewInstance:y,selectedIDs:c,selectedID:x,mainViewInstance:s,setSelectedIDs:I,syncAllViewPointCloudColor:C,polygonList:O,pointCloudPattern:v}=React.useContext(PointCloudContext.PointCloudContext),{selectedPolygon:a,updateSelectedPolygon:m,updatePolygonValidByID:h,deletePolygon:D}=usePolygon.usePolygon(),{pushHistoryWithList:g}=useHistory.useHistory(),d=React.useMemo(()=>{const o=e.findIndex(t=>t.id===x);if(o>-1)return{info:e[o],index:o}},[x,e]),B=React.useCallback(o=>{if(d==null?void 0:d.info){e.splice(d.index,1,___default.default.merge(d.info,o));const t=___default.default.cloneDeep(e);return l(t),g({pointCloudBoxList:t}),t}return e},[x,e]),V=React.useCallback((o,t)=>{const i=e.findIndex(r=>r.id===t);if(i>-1){e.splice(i,1,___default.default.merge(e[i],o));const r=___default.default.cloneDeep(e);return l(r),r}return e},[e]),f=React.useCallback(o=>{n==null||n.pointCloud2dOperation.setPolygonValidAndRender(o,!0),y==null||y.pointCloud2dOperation.setPolygonValidAndRender(o,!0),P==null||P.pointCloud2dOperation.setPolygonValidAndRender(o,!0)},[n,y,P]),L=React.useCallback(()=>{if(d==null?void 0:d.info){const{id:o,valid:t=!0}=d.info,i=B({valid:!t});C(i),f(o)}a&&(m(__spreadProps(__spreadValues({},a),{valid:!a.valid})),n==null||n.pointCloud2dOperation.setPolygonValidAndRender(a.id,!0))},[f,d,a]),S=React.useCallback(o=>{const t=e.find(i=>i.id===o);if(t){const{id:i,valid:r=!0}=t,u=V({valid:!r},i);return f(i),u}h(o)},[f,e,O]),b=React.useCallback((o=ESortDirection.ascend,t=!1)=>{if(!n||c.length>1)return;if(v!==lbAnnotation.EToolName.Rect&&v!==lbAnnotation.EToolName.Polygon){t&&document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:9,shiftKey:o!==ESortDirection.ascend}));return}const{pointCloud2dOperation:i}=n,r=i.switchToNextPolygon(o);r&&I(r)},[n,v,n==null?void 0:n.toolInstance]),j=(o=!1)=>{b(ESortDirection.descend,o)},k=(o=!1)=>{b(ESortDirection.ascend,o)},w=o=>{const t=e.filter(i=>i.id!==o);l(t),s==null||s.removeObjectByName(o,"box"),s==null||s.render(),C(t)},A=()=>{d&&(w(d.info.id),n==null||n.pointCloud2dOperation.deletePolygon(d.info.id)),a&&(D(a.id),n==null||n.pointCloud2dOperation.deletePolygon(a.id))},E=React.useMemo(()=>e.filter(o=>c.includes(o.id)),[c,e]),N=React.useCallback(o=>{const t=___default.default.cloneDeep(e);let i=!1;if(o.forEach(r=>{const u=t.findIndex(p=>p.id===r.id);if(u>-1){const p=___default.default.merge(t[u],r);t.splice(u,1,p),s==null||s.generateBox(p),i=!0}}),i)return l(t),g({pointCloudBoxList:t}),s==null||s.render(),t},[c,e]),R=React.useCallback(o=>e.find(t=>t.id===o),[e]);return{selectedBox:d,updateSelectedBox:B,changeSelectedBoxValid:L,changeValidByID:S,selectNextBox:k,selectPrevBox:j,deletePointCloudBox:w,selectedBoxes:E,updateSelectedBoxes:N,getPointCloudByID:R,deleteSelectedPointCloudBoxAndPolygon:A}};exports.useSingleBox=useSingleBox;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),_=require("lodash"),useHistory=require("./useHistory.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const{ESortDirection}=lbAnnotation.cAnnotation,useSphere=()=>{const{pointCloudSphereList:e,setPointCloudSphereList:l,selectedID:u,setSelectedIDs:a,mainViewInstance:s,topViewInstance:r}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:p}=useHistory.useHistory(),C=React.useMemo(()=>e.find(t=>t.id===u),[u,e]),f=React.useCallback(t=>e.find(n=>n.id===t),[e]),h=React.useCallback(t=>{const n=e.findIndex(o=>o.id===t.id);if(n>-1){e.splice(n,1,___default.default.merge(e[n],t));const o=___default.default.cloneDeep(e);return l(o),p({pointCloudSphereList:o}),o}return e},[e]),S=React.useCallback(t=>{const n=e.filter(o=>o.id!==t);l(n),s==null||s.removeObjectByName(t),s==null||s.render()},[e]),I=React.useCallback((t=ESortDirection.ascend)=>{if(!r)return;const n=r.toolInstance.pointList,o=r.toolInstance.selectedID,d=n.findIndex(i=>(i==null?void 0:i.id)===o);if(d>-1){let i=1;t===ESortDirection.descend&&(i=-1);const c=n.length,b=n[(d+i+c)%c];a(b.id)}},[r]);return{selectedSphere:C,getPointCloudSphereByID:f,updatePointCloudSphere:h,deletePointCloudSphere:S,switchToNextSphere:I}};exports.useSphere=useSphere;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),_=require("lodash"),useHistory=require("./useHistory.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const{ESortDirection}=lbAnnotation.cAnnotation,useSphere=()=>{const{pointCloudSphereList:e,setPointCloudSphereList:l,selectedID:u,setSelectedIDs:a,mainViewInstance:s,topViewInstance:r}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:p}=useHistory.useHistory(),C=React.useMemo(()=>e.find(t=>t.id===u),[u,e]),f=React.useCallback(t=>e.find(n=>n.id===t),[e]),h=React.useCallback(t=>{const n=e.findIndex(o=>o.id===t.id);if(n>-1){e.splice(n,1,___default.default.merge(e[n],t));const o=___default.default.cloneDeep(e);return l(o),p({pointCloudSphereList:o}),o}return e},[e]),S=React.useCallback(t=>{const n=e.filter(o=>o.id!==t);l(n),s==null||s.removeObjectByName(t,"sphere"),s==null||s.render()},[e]),I=React.useCallback((t=ESortDirection.ascend)=>{if(!r)return;const n=r.toolInstance.pointList,o=r.toolInstance.selectedID,d=n.findIndex(i=>(i==null?void 0:i.id)===o);if(d>-1){let i=1;t===ESortDirection.descend&&(i=-1);const c=n.length,b=n[(d+i+c)%c];a(b.id)}},[r]);return{selectedSphere:C,getPointCloudSphereByID:f,updatePointCloudSphere:h,deletePointCloudSphere:S,switchToNextSphere:I}};exports.useSphere=useSphere;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:r,backViewInstance:u,mainViewInstance:t,pointCloudBoxList:c,pointCloudSphereList:d,setPointCloudResult:P,setPointCloudSphereList:C,setPolygonList:v,pointCloudPattern:a,setPointCloudPattern:n,syncAllViewPointCloudColor:h,setLineList:p}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:y}=useHistory.useHistory(),L=()=>{c.forEach(e=>{t==null||t.removeObjectByName(e.id)}),d.forEach(e=>{t==null||t.removeObjectByName(e.id)}),t==null||t.render(),P([]),v([]),C([]),p([]),i==null||i.toolScheduler.clearStatusAndResult(),h([]),y({pointCloudBoxList:[],polygonList:[],pointCloudSphereList:[]})},l=()=>{r==null||r.toolInstance.clearResult(),u==null||u.toolInstance.clearResult()};return{clearAllResult:L,updatePointCloudPattern:e=>{if(e===a)return;const s=[i,r,u];switch(e){case EToolName.Rect:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Rect)}),n(EToolName.Rect);break;case EToolName.Polygon:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Normal)}),n(EToolName.Polygon);break;case EToolName.Point:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Point)}),n(EToolName.Point);break;case EToolName.Line:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Line)}),n(EToolName.Line);break}},pointCloudPattern:a}};exports.useStatus=useStatus;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),lbUtils=require("@labelbee/lb-utils");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:r,backViewInstance:u,mainViewInstance:o,setPointCloudResult:d,setPointCloudSphereList:P,setPolygonList:C,pointCloudPattern:a,setPointCloudPattern:e,syncAllViewPointCloudColor:v,globalPattern:n,setLineList:b}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:h}=useHistory.useHistory(),p=()=>{o==null||o.clearAllBox(),o==null||o.clearAllSphere(),o==null||o.render(),d([]),C([]),P([]),b([]),i==null||i.toolScheduler.clearStatusAndResult(),v([]),h({pointCloudBoxList:[],polygonList:[],pointCloudSphereList:[]})},l=()=>{r==null||r.toolInstance.clearResult(),u==null||u.toolInstance.clearResult()},y=c=>{if(c===a)return;const s=[i,r,u];switch(c){case EToolName.Rect:l(),s.forEach(t=>{t==null||t.switchToCanvas(EToolName.PointCloudPolygon),t==null||t.toolInstance.setPattern(EPolygonPattern.Rect)}),e(EToolName.Rect);break;case EToolName.Polygon:l(),s.forEach(t=>{t==null||t.switchToCanvas(EToolName.PointCloudPolygon),t==null||t.toolInstance.setPattern(EPolygonPattern.Normal)}),e(EToolName.Polygon);break;case EToolName.Point:l(),s.forEach(t=>{t==null||t.switchToCanvas(EToolName.Point)}),e(EToolName.Point);break;case EToolName.Line:l(),s.forEach(t=>{t==null||t.switchToCanvas(EToolName.Line)}),e(EToolName.Line);break}},w=React.useMemo(()=>n===lbUtils.EPointCloudPattern.Detection,[n]),L=React.useMemo(()=>n===lbUtils.EPointCloudPattern.Segmentation,[n]);return{clearAllResult:p,updatePointCloudPattern:y,pointCloudPattern:a,isPointCloudDetectionPattern:w,isPointCloudSegmentationPattern:L}};exports.useStatus=useStatus;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({imgList:e,drawLayerSlot:a,checkMode:t,intelligentFit:l})=>e.length===0?null:React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:t}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:a,checkMode:t,intelligentFit:l}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,{checkMode:t}),React__default.default.createElement(PointCloudBackView,{checkMode:t})))),React__default.default.createElement(index.AnnotatedAttributesPanelFixedRight,null)))),mapStateToProps=e=>({imgList:e.annotation.imgList});var PointCloudView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
1
+ "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({currentData:t,imgList:d,drawLayerSlot:u,checkMode:l,intelligentFit:c,imgIndex:m})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:s,setGlobalPattern:C}=e,P=index.jsonParser(t.result),{toolInstanceRef:o,clearToolInstance:f}=annotation.useCustomToolInstance({basicInfo:P});return React.useEffect(()=>{o.current.setPointCloudGlobalPattern=n=>{n!==s&&(C(n),e.clearAllDetectionInstance(),f())}},[s]),React.useEffect(()=>{var n;if(t){const{boxParamsList:a,polygonList:i,lineList:r,sphereParamsList:v,segmentation:g}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((n=t==null?void 0:t.result)!=null?n:"");e.setPointCloudResult(a),e.setPolygonList(i),e.setLineList(r),e.setPointCloudSphereList(v),e.setSegmentation(g)}},[m]),React.useEffect(()=>{o.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],o.current.exportCustomData=()=>{var n,a,i,r;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(a=e.lineList)!=null?a:[],resultPoint:(i=e.pointCloudSphereList)!=null?i:[],segmentation:(r=e.segmentation)!=null?r:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),d.length===0?null:s===lbUtils.EPointCloudPattern.Segmentation?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegmentStatus,null),u==null?void 0:u({direct:!0})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:u,checkMode:l,intelligentFit:c}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,{checkMode:l}),React__default.default.createElement(PointCloudBackView,{checkMode:l})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
@@ -1 +1 @@
1
- "use strict";var antd=require("antd"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),icon=require("../../../assets/predictTracking/icon.svg.js"),useSingleBox=require("../../pointCloudView/hooks/useSingleBox.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),util=require("../previewResult/util.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__async=(t,n,r)=>new Promise((c,a)=>{var l=e=>{try{i(r.next(e))}catch(o){a(o)}},s=e=>{try{i(r.throw(e))}catch(o){a(o)}},i=e=>e.done?c(e.value):Promise.resolve(e.value).then(l,s);i((r=r.apply(t,n)).next())});const PredictTrackingIcon=t=>{const n=ctx.useDispatch(),{t:r}=reactI18next.useTranslation(),{loading:c}=t,{selectedBox:a}=useSingleBox.useSingleBox(),l=()=>__async(void 0,null,function*(){if(c)return;const s=a==null?void 0:a.info.trackID;if(!s){antd.message.error(r("BeforePredictStarting"));return}yield n(actionCreators.ChangeSave);const i=a==null?void 0:a.info.id,e=yield n(actionCreators.GetBoxesByID(s,i));if(e.length<2){antd.message.error(r("MarkOnlyOne"));return}const o=e.findIndex(g=>g.id===i),u=e[o-1],d=e[o],f=d.index-u.index;if(f<2){antd.message.error(r("HaveNoNeed"));return}if(f>8){antd.message.error(r("ThePredictedPointCloud"));return}antd.message.success(r("PredictingDataFrom",{startPage:u.index+1,endPage:d.index+1,selectedBoxTrackID:s})),actionCreators.SetPointCloudLoading(n,!0);const x=util.predict(u,d);actionCreators.SetPredictResult(n,x),actionCreators.SetPredictResultVisible(n,!0)});return React__default.default.createElement(antd.Button,{type:"link",onClick:l,style:{display:"flex",flexDirection:"column",height:"auto",alignItems:"center"}},React__default.default.createElement("img",{src:icon,style:{alignSelf:"center"}}),React__default.default.createElement("span",{style:{color:"#797979"}},r("ComplementaryTracking")))},mapStateToProps=t=>({loading:t.annotation.loading});var PredictTrackingIcon$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PredictTrackingIcon);module.exports=PredictTrackingIcon$1;
1
+ "use strict";var antd=require("antd"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),icon=require("../../../assets/predictTracking/icon.svg.js"),useSingleBox=require("../../pointCloudView/hooks/useSingleBox.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),util=require("../previewResult/util.js"),useStatus=require("../../pointCloudView/hooks/useStatus.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,i,t)=>new Promise((c,s)=>{var o=r=>{try{a(t.next(r))}catch(n){s(n)}},l=r=>{try{a(t.throw(r))}catch(n){s(n)}},a=r=>r.done?c(r.value):Promise.resolve(r.value).then(o,l);a((t=t.apply(e,i)).next())});const PredictTrackingIcon=e=>{const i=ctx.useDispatch(),{t}=reactI18next.useTranslation(),{isPointCloudSegmentationPattern:c}=useStatus.useStatus(),{loading:s}=e,{selectedBox:o}=useSingleBox.useSingleBox(),l=()=>__async(void 0,null,function*(){if(s)return;const a=o==null?void 0:o.info.trackID;if(!a){antd.message.error(t("BeforePredictStarting"));return}yield i(actionCreators.ChangeSave);const r=o==null?void 0:o.info.id,n=yield i(actionCreators.GetBoxesByID(a,r));if(n.length<2){antd.message.error(t("MarkOnlyOne"));return}const f=n.findIndex(v=>v.id===r),u=n[f-1],d=n[f],g=d.index-u.index;if(g<2){antd.message.error(t("HaveNoNeed"));return}if(g>8){antd.message.error(t("ThePredictedPointCloud"));return}antd.message.success(t("PredictingDataFrom",{startPage:u.index+1,endPage:d.index+1,selectedBoxTrackID:a})),actionCreators.SetPointCloudLoading(i,!0);const x=util.predict(u,d);actionCreators.SetPredictResult(i,x),actionCreators.SetPredictResultVisible(i,!0)});return c?null:React__default.default.createElement(antd.Button,{type:"link",onClick:l,style:{display:"flex",flexDirection:"column",height:"auto",alignItems:"center"}},React__default.default.createElement("img",{src:icon,style:{alignSelf:"center"}}),React__default.default.createElement("span",{style:{color:"#797979"}},t("ComplementaryTracking")))},mapStateToProps=e=>({loading:e.annotation.loading});var PredictTrackingIcon$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PredictTrackingIcon);module.exports=PredictTrackingIcon$1;
@@ -1 +1 @@
1
- "use strict";var classNames=require("classnames"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),PointCloudContext=require("../../pointCloudView/PointCloudContext.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),dom=require("../../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),util=require("./util.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}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=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,a)=>new Promise((c,n)=>{var o=l=>{try{i(a.next(l))}catch(s){n(s)}},r=l=>{try{i(a.throw(l))}catch(s){n(s)}},i=l=>l.done?c(l.value):Promise.resolve(l.value).then(o,r);i((a=a.apply(e,t)).next())});const PreviewResult=e=>{const{predictionResult:t,predictionResultVisible:a,imgList:c}=e,[n,o]=React.useState([]),r=ctx.useDispatch(),{t:i}=reactI18next.useTranslation(),l=()=>{actionCreators.SetPredictResultVisible(r,!1),actionCreators.SetPredictResult(r,[]),o([])},s=()=>__async(void 0,null,function*(){actionCreators.SetPointCloudLoading(r,!0),yield r(actionCreators.BatchUpdateImgListResultByPredictResult()),actionCreators.SetPointCloudLoading(r,!1),l()});return a?React__default.default.createElement(React__default.default.Fragment,null,n.length>0&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","bar")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title")},React__default.default.createElement("div",null,i("ComplementaryTrackingPrediction"),n.length>0?`\uFF08${n.length}\uFF09`:""),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","option")},React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","cancelOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:l},i("Cancel")),React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","okOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:s},i("Apply")))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","content")},React__default.default.createElement(Result,{list:n})))),t.length>0&&React__default.default.createElement(GenerateViewsDataUrl,{result:t,imgList:c,setList:o})):null},Result=e=>{const{list:t}=e,{t:a}=reactI18next.useTranslation(),c=[a("TopView"),a("SideView"),a("BackView")];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","left")},c.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title"),key:n},n))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","right")},t.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","item"),key:n.id},util.views.map(o=>{const r=n[o];return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","view"),key:`${n.id}-${o}`},React__default.default.createElement("img",{src:r}))})))))},GenerateViewsDataUrl=e=>{const t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=ctx.useDispatch(),{result:c,imgList:n,setList:o}=e,r=React.useRef(null),i={width:600,height:600};return React.useEffect(()=>{(()=>__async(void 0,null,function*(){var s,f,g,v,C,h;const p=(s=t.mainViewInstance)==null?void 0:s.config;if(p&&r.current){const P={left:-i.width/2,right:i.width/2,top:i.height/2,bottom:-i.height/2,near:200,far:-200},u=new lbAnnotation.PointCloud({container:r.current,isOrthographicCamera:!0,orthographicParams:P,config:p});u.setShowDirection(!1);for(const d of c){const{index:m}=d,y=n[m].url?n[m].url:(C=(v=(g=(f=n[m])==null?void 0:f.webPointCloudFile)==null?void 0:g.lidar)==null?void 0:v.url)!=null?C:"";yield u.loadPCDFileByBox(y,d,{width:2,height:2,depth:2}),yield u.updateCameraZoom(t.zoom);const N=(h=lbUtils.toolStyleConverter.getColorFromConfig({attribute:d.attribute},__spreadProps(__spreadValues({},p),{attributeConfigurable:!0}),{}))==null?void 0:h.fill;u.generateBox(d,N),yield util.sleep(500),yield util.getViewsDataUrl(u,d,t.zoom),yield u.removeObjectByName(d.id),yield u.clearPointCloudAndRender()}o(c),actionCreators.SetPointCloudLoading(a,!1)}}))()},[]),React__default.default.createElement("div",{style:i,ref:r,className:"generate-view"})},mapStateToProps=e=>({predictionResult:e.annotation.predictionResult,predictionResultVisible:e.annotation.predictionResultVisible,imgList:e.annotation.imgList});var PreviewResult$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PreviewResult);module.exports=PreviewResult$1;
1
+ "use strict";var classNames=require("classnames"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),PointCloudContext=require("../../pointCloudView/PointCloudContext.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),dom=require("../../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),util=require("./util.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}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=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,a)=>new Promise((c,n)=>{var o=i=>{try{l(a.next(i))}catch(s){n(s)}},r=i=>{try{l(a.throw(i))}catch(s){n(s)}},l=i=>i.done?c(i.value):Promise.resolve(i.value).then(o,r);l((a=a.apply(e,t)).next())});const PreviewResult=e=>{const{predictionResult:t,predictionResultVisible:a,imgList:c}=e,[n,o]=React.useState([]),r=ctx.useDispatch(),{t:l}=reactI18next.useTranslation(),i=()=>{actionCreators.SetPredictResultVisible(r,!1),actionCreators.SetPredictResult(r,[]),o([])},s=()=>__async(void 0,null,function*(){actionCreators.SetPointCloudLoading(r,!0),yield r(actionCreators.BatchUpdateImgListResultByPredictResult()),actionCreators.SetPointCloudLoading(r,!1),i()});return a?React__default.default.createElement(React__default.default.Fragment,null,n.length>0&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","bar")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title")},React__default.default.createElement("div",null,l("ComplementaryTrackingPrediction"),n.length>0?`\uFF08${n.length}\uFF09`:""),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","option")},React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","cancelOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:i},l("Cancel")),React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","okOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:s},l("Apply")))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","content")},React__default.default.createElement(Result,{list:n})))),t.length>0&&React__default.default.createElement(GenerateViewsDataUrl,{result:t,imgList:c,setList:o})):null},Result=e=>{const{list:t}=e,{t:a}=reactI18next.useTranslation(),c=[a("TopView"),a("SideView"),a("BackView")];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","left")},c.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title"),key:n},n))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","right")},t.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","item"),key:n.id},util.views.map(o=>{const r=n[o];return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","view"),key:`${n.id}-${o}`},React__default.default.createElement("img",{src:r}))})))))},GenerateViewsDataUrl=e=>{const t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=ctx.useDispatch(),{result:c,imgList:n,setList:o}=e,r=React.useRef(null),l={width:600,height:600};return React.useEffect(()=>{(()=>__async(void 0,null,function*(){var s,f,g,v,C,P;const p=(s=t.mainViewInstance)==null?void 0:s.config;if(p&&r.current){const y=lbUtils.PointCloudUtils.getDefaultOrthographicParams(l),u=new lbAnnotation.PointCloud({container:r.current,isOrthographicCamera:!0,orthographicParams:y,config:p});u.setShowDirection(!1);for(const d of c){const{index:m}=d,N=n[m].url?n[m].url:(C=(v=(g=(f=n[m])==null?void 0:f.webPointCloudFile)==null?void 0:g.lidar)==null?void 0:v.url)!=null?C:"";yield u.loadPCDFileByBox(N,d,{width:2,height:2,depth:2}),yield u.updateCameraZoom(t.zoom);const _=(P=lbUtils.toolStyleConverter.getColorFromConfig({attribute:d.attribute},__spreadProps(__spreadValues({},p),{attributeConfigurable:!0}),{}))==null?void 0:P.fill;u.generateBox(d,_),yield util.sleep(500),yield util.getViewsDataUrl(u,d,t.zoom),yield u.removeObjectByName(d.id,"box"),yield u.clearPointCloudAndRender()}o(c),actionCreators.SetPointCloudLoading(a,!1)}}))()},[]),React__default.default.createElement("div",{style:l,ref:r,className:"generate-view"})},mapStateToProps=e=>({predictionResult:e.annotation.predictionResult,predictionResultVisible:e.annotation.predictionResultVisible,imgList:e.annotation.imgList});var PreviewResult$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PreviewResult);module.exports=PreviewResult$1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../store/ctx.js"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:e}={})=>{var r;const o=ctx.useDispatch(),s=React.useRef({valid:(r=e==null?void 0:e.valid)!=null?r:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},unbind:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:t=>{},setForbidOperation:()=>{},setShowDefaultCursor:()=>{},setSubAttribute:(t,a)=>{},setValid:()=>{},updateRotate:()=>{},redo:()=>{},undo:()=>{}}),u=t=>{o({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:t}})},n=()=>{o({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})};return React.useEffect(()=>(u(s.current),()=>{n()}),[]),{toolInstanceRef:s}};exports.useCustomToolInstance=useCustomToolInstance;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../store/ctx.js"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:o}={})=>{var s;const r=ctx.useDispatch(),n={valid:(s=o==null?void 0:o.valid)!=null?s:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},unbind:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:t=>{},setForbidOperation:()=>{},setShowDefaultCursor:()=>{},setSubAttribute:(t,l)=>{},setValid:()=>{},updateRotate:()=>{},redo:()=>{},undo:()=>{},setPointCloudGlobalPattern:t=>{}},e=React.useRef(n),u=t=>{r({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:t}})},a=()=>{r({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})},i=()=>{Object.assign(e.current,n)};return React.useEffect(()=>(u(e.current),()=>{a()}),[]),{toolInstanceRef:e,clearToolInstance:i}};exports.useCustomToolInstance=useCustomToolInstance;
package/dist/index.css CHANGED
@@ -1234,6 +1234,7 @@
1234
1234
  flex-direction: column;
1235
1235
  overflow: hidden;
1236
1236
  flex: 1;
1237
+ position: relative;
1237
1238
  }
1238
1239
 
1239
1240
  .bee-point-cloud-wrapper {
@@ -1490,6 +1491,59 @@
1490
1491
  height: 100%;
1491
1492
  }
1492
1493
 
1494
+ .bee-point-cloud-status__operation {
1495
+ z-index: 200;
1496
+ position: absolute;
1497
+ left: 50%;
1498
+ top: 60px;
1499
+ transform: translateX(-50%);
1500
+ display: flex;
1501
+ }
1502
+ .bee-point-cloud-status__operation .bee-point-cloud-status__button {
1503
+ background-color: white;
1504
+ padding: 7.5px 16px;
1505
+ border: 0.5px solid rgb(196, 196, 196);
1506
+ cursor: pointer;
1507
+ border-radius: 2px;
1508
+ display: flex;
1509
+ align-items: center;
1510
+ }
1511
+
1512
+ .bee-point-cloud-status__info {
1513
+ z-index: 200;
1514
+ position: absolute;
1515
+ right: 20px;
1516
+ top: 60px;
1517
+ padding: 16px;
1518
+ color: white;
1519
+ background: rgb(51, 51, 51);
1520
+ border-radius: 2px;
1521
+ }
1522
+
1523
+ .bee-point-cloud-status__icon {
1524
+ margin-right: 5px;
1525
+ }
1526
+
1527
+ .bee-point-cloud-toolbar {
1528
+ height: 40px;
1529
+ padding: 10px 26px;
1530
+ display: flex;
1531
+ justify-content: flex-end;
1532
+ align-items: center;
1533
+ background-color: rgb(102, 102, 102);
1534
+ }
1535
+ .bee-point-cloud-toolbar .bee-point-cloud-toolbox {
1536
+ margin-left: 16px;
1537
+ display: flex;
1538
+ align-items: center;
1539
+ justify-content: center;
1540
+ cursor: pointer;
1541
+ }
1542
+ .bee-point-cloud-toolbar .bee-point-cloud-toolbox img {
1543
+ height: 24px;
1544
+ width: 24px;
1545
+ }
1546
+
1493
1547
  /** PointCloud样式 end */
1494
1548
  .bee-point-cloud-predict-tracking-container .bee-point-cloud-predict-tracking-container__bar {
1495
1549
  position: fixed;