@labelbee/lb-components 1.6.0-alpha.0 → 1.6.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 (328) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/assets/annotation/lineTool/icon_line.svg.js +1 -0
  3. package/dist/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
  4. package/dist/assets/annotation/pointCloudTool/copy.svg.js +1 -0
  5. package/dist/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
  6. package/dist/assets/annotation/pointCloudTool/nodata.svg.js +1 -0
  7. package/dist/assets/annotation/pointCloudTool/patse.svg.js +1 -0
  8. package/dist/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
  9. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
  10. package/dist/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
  11. package/dist/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
  12. package/dist/assets/annotation/pointTool/icon_point.svg.js +1 -0
  13. package/dist/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
  14. package/dist/assets/annotation/rectTool/icon_rect.svg.js +1 -0
  15. package/dist/assets/annotation/rectTool/{icon_rectPattern.svg.js → icon_rect_a.svg.js} +0 -0
  16. package/dist/assets/attributeIcon/eraser.svg.js +1 -0
  17. package/dist/assets/attributeIcon/eraser_a.svg.js +1 -0
  18. package/dist/assets/attributeIcon/pen.svg.js +1 -0
  19. package/dist/assets/attributeIcon/pen_a.svg.js +1 -0
  20. package/dist/assets/{cssIcon/annotation/icon_clearSmall.svg → icons/25541b4d.svg} +0 -0
  21. package/dist/assets/icons/25ef334b.svg +8 -0
  22. package/dist/assets/icons/7eadb9c4.svg +5 -0
  23. package/dist/assets/icons/9d70807.svg +5 -0
  24. package/dist/assets/icons/c5b4262e.png +0 -0
  25. package/dist/assets/{cssIcon/slide_btn.svg → icons/cc550fff.svg} +0 -0
  26. package/dist/assets/{cssIcon/annotation/icon_clearSmall_a.svg → icons/dc9b6bfc.svg} +0 -0
  27. package/dist/assets/icons/e4f0b7fe.png +0 -0
  28. package/dist/components/AnnotationView/index.js +1 -1
  29. package/dist/components/AnnotationView/pointCloudAnnotationView.js +1 -0
  30. package/dist/components/attributeList/index.js +1 -1
  31. package/dist/components/customResizeHook/index.js +1 -1
  32. package/dist/components/pointCloudView/PointCloud2DView.js +1 -0
  33. package/dist/components/pointCloudView/PointCloud3DView.js +1 -0
  34. package/dist/components/pointCloudView/PointCloudBackView.js +1 -0
  35. package/dist/components/pointCloudView/PointCloudContext.js +1 -0
  36. package/dist/components/pointCloudView/PointCloudInfos.js +1 -0
  37. package/dist/components/pointCloudView/PointCloudLayout.js +1 -0
  38. package/dist/components/pointCloudView/PointCloudListener.js +1 -0
  39. package/dist/components/pointCloudView/PointCloudSideView.js +1 -0
  40. package/dist/components/pointCloudView/PointCloudTopView.js +1 -0
  41. package/dist/components/pointCloudView/components/EmptyPage/index.js +1 -0
  42. package/dist/components/pointCloudView/hooks/useBoxes.js +1 -0
  43. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
  44. package/dist/components/pointCloudView/hooks/usePolygon.js +1 -0
  45. package/dist/components/pointCloudView/hooks/useRotate.js +1 -0
  46. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -0
  47. package/dist/components/pointCloudView/hooks/useStatus.js +1 -0
  48. package/dist/components/pointCloudView/hooks/useZoom.js +1 -0
  49. package/dist/components/pointCloudView/index.js +1 -0
  50. package/dist/components/videoAnnotate/index.js +1 -1
  51. package/dist/data/enums/ToolType.js +1 -1
  52. package/dist/hooks/annotation.js +1 -0
  53. package/dist/hooks/useSize.js +1 -1
  54. package/dist/index.css +314 -44
  55. package/dist/index.js +1 -1
  56. package/dist/store/Actions.js +1 -1
  57. package/dist/store/annotation/actionCreators.js +1 -1
  58. package/dist/store/annotation/map.js +1 -0
  59. package/dist/store/annotation/reducer.js +1 -1
  60. package/dist/store/ctx.js +1 -0
  61. package/dist/types/App.d.ts +10 -2
  62. package/dist/types/components/AnnotationView/index.d.ts +6 -5
  63. package/dist/types/components/AnnotationView/pointCloudAnnotationView.d.ts +10 -0
  64. package/dist/types/components/attributeList/index.d.ts +1 -0
  65. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +6 -0
  66. package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +6 -0
  67. package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +3 -0
  68. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +33 -0
  69. package/dist/types/components/pointCloudView/PointCloudInfos.d.ts +19 -0
  70. package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +7 -0
  71. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +6 -0
  72. package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +6 -0
  73. package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +6 -0
  74. package/dist/types/components/pointCloudView/components/EmptyPage/index.d.ts +2 -0
  75. package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +10 -0
  76. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +63 -0
  77. package/dist/types/components/pointCloudView/hooks/usePolygon.d.ts +9 -0
  78. package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +8 -0
  79. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +13 -0
  80. package/dist/types/components/pointCloudView/hooks/useStatus.d.ts +11 -0
  81. package/dist/types/components/pointCloudView/hooks/useZoom.d.ts +7 -0
  82. package/dist/types/components/pointCloudView/index.d.ts +15 -0
  83. package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +1 -1
  84. package/dist/types/components/videoPlayer/index.d.ts +1 -1
  85. package/dist/types/data/enums/ToolType.d.ts +14 -8
  86. package/dist/types/hooks/annotation.d.ts +32 -0
  87. package/dist/types/hooks/useSize.d.ts +2 -2
  88. package/dist/types/index.d.ts +3 -1
  89. package/dist/types/store/Actions.d.ts +3 -0
  90. package/dist/types/store/annotation/actionCreators.d.ts +15 -5
  91. package/dist/types/store/annotation/map.d.ts +13 -0
  92. package/dist/types/store/annotation/reducer.d.ts +1 -1
  93. package/dist/types/store/annotation/types.d.ts +2 -0
  94. package/dist/types/store/ctx.d.ts +4 -0
  95. package/dist/types/utils/PageOperator.d.ts +1 -1
  96. package/dist/types/utils/StepUtils.d.ts +7 -0
  97. package/dist/types/utils/ToolUtils.d.ts +10 -0
  98. package/dist/types/utils/data.d.ts +1 -1
  99. package/dist/types/utils/dom.d.ts +1 -1
  100. package/dist/types/utils/index.d.ts +1 -1
  101. package/dist/types/views/MainView/annotationOperation/index.d.ts +3 -0
  102. package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +12 -0
  103. package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +5 -1
  104. package/dist/types/views/MainView/sidebar/GeneralOperation/useOperationList.d.ts +12 -0
  105. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/index.d.ts +11 -0
  106. package/dist/types/views/MainView/sidebar/ScribbleSidebar/index.d.ts +6 -0
  107. package/dist/types/views/MainView/sidebar/ToolIcons.d.ts +11 -0
  108. package/dist/types/views/MainView/sidebar/ToolStyle/index.d.ts +1 -1
  109. package/dist/types/views/MainView/sidebar/index.d.ts +1 -0
  110. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.d.ts +3 -0
  111. package/dist/types/views/MainView/toolFooter/Pagination.d.ts +12 -2
  112. package/dist/types/views/MainView/toolFooter/ZoomController/ZoomLevel/index.d.ts +1 -0
  113. package/dist/types/views/MainView/toolFooter/ZoomController/index.d.ts +15 -4
  114. package/dist/types/views/MainView/toolFooter/index.d.ts +7 -9
  115. package/dist/types/views/MainView/toolHeader/ExportData/index.d.ts +1 -1
  116. package/dist/utils/StepUtils.js +1 -1
  117. package/dist/utils/ToolUtils.js +1 -0
  118. package/dist/utils/data.js +1 -1
  119. package/dist/utils/dom.js +1 -1
  120. package/dist/utils/index.js +1 -1
  121. package/dist/views/MainView/annotationOperation/index.js +1 -1
  122. package/dist/views/MainView/annotationTips/index.js +1 -1
  123. package/dist/views/MainView/index.js +1 -1
  124. package/dist/views/MainView/sidebar/AnnotationText/index.js +1 -1
  125. package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
  126. package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  127. package/dist/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
  128. package/dist/views/MainView/sidebar/ImgAttributeInfo/index.js +1 -1
  129. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
  130. package/dist/views/MainView/sidebar/ScribbleSidebar/index.js +1 -0
  131. package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
  132. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  133. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  134. package/dist/views/MainView/sidebar/ToolIcons.js +1 -0
  135. package/dist/views/MainView/sidebar/ToolStyle/index.js +1 -1
  136. package/dist/views/MainView/sidebar/index.js +1 -1
  137. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  138. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
  139. package/dist/views/MainView/toolFooter/FooterTips/index.js +1 -1
  140. package/dist/views/MainView/toolFooter/HiddenTips/index.js +1 -1
  141. package/dist/views/MainView/toolFooter/PageNumber/index.js +1 -1
  142. package/dist/views/MainView/toolFooter/Pagination.js +1 -1
  143. package/dist/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
  144. package/dist/views/MainView/toolFooter/ZoomController/index.js +1 -1
  145. package/dist/views/MainView/toolFooter/index.js +1 -1
  146. package/dist/views/MainView/toolHeader/ExportData/index.js +1 -1
  147. package/dist/views/MainView/toolHeader/StepSwitch/index.js +1 -1
  148. package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
  149. package/dist/views/MainView/toolHeader/index.js +1 -1
  150. package/es/App.js +1 -1
  151. package/es/App.js.map +1 -1
  152. package/es/assets/annotation/lineTool/icon_line.svg.js +1 -0
  153. package/es/assets/annotation/lineTool/icon_line.svg.js.map +1 -0
  154. package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
  155. package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js.map +1 -0
  156. package/es/assets/annotation/pointCloudTool/copy.svg.js +1 -0
  157. package/es/assets/annotation/pointCloudTool/copy.svg.js.map +1 -0
  158. package/es/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
  159. package/es/assets/annotation/pointCloudTool/nextBox.svg.js.map +1 -0
  160. package/es/assets/annotation/pointCloudTool/nodata.svg.js +1 -0
  161. package/es/assets/annotation/pointCloudTool/nodata.svg.js.map +1 -0
  162. package/es/assets/annotation/pointCloudTool/patse.svg.js +1 -0
  163. package/es/assets/annotation/pointCloudTool/patse.svg.js.map +1 -0
  164. package/es/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
  165. package/es/assets/annotation/pointCloudTool/prevBox.svg.js.map +1 -0
  166. package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
  167. package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js.map +1 -0
  168. package/es/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
  169. package/es/assets/annotation/pointCloudTool/selectAll.svg.js.map +1 -0
  170. package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
  171. package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js.map +1 -0
  172. package/es/assets/annotation/pointTool/icon_point.svg.js +1 -0
  173. package/es/assets/annotation/pointTool/icon_point.svg.js.map +1 -0
  174. package/es/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
  175. package/es/assets/annotation/polygonTool/icon_polygon.svg.js.map +1 -0
  176. package/es/assets/annotation/rectTool/icon_rect.svg.js +1 -0
  177. package/es/assets/annotation/rectTool/icon_rect.svg.js.map +1 -0
  178. package/es/assets/annotation/rectTool/icon_rectPattern.svg.js +4 -1
  179. package/es/assets/annotation/rectTool/icon_rect_a.svg.js +1 -0
  180. package/es/assets/annotation/rectTool/icon_rect_a.svg.js.map +1 -0
  181. package/es/assets/attributeIcon/eraser.svg.js +1 -0
  182. package/es/assets/attributeIcon/eraser.svg.js.map +1 -0
  183. package/es/assets/attributeIcon/eraser_a.svg.js +1 -0
  184. package/es/assets/attributeIcon/eraser_a.svg.js.map +1 -0
  185. package/es/assets/attributeIcon/pen.svg.js +1 -0
  186. package/es/assets/attributeIcon/pen.svg.js.map +1 -0
  187. package/es/assets/attributeIcon/pen_a.svg.js +1 -0
  188. package/es/assets/attributeIcon/pen_a.svg.js.map +1 -0
  189. package/es/components/AnnotationView/index.js +1 -1
  190. package/es/components/AnnotationView/index.js.map +1 -1
  191. package/es/components/AnnotationView/pointCloudAnnotationView.js +1 -0
  192. package/es/components/AnnotationView/pointCloudAnnotationView.js.map +1 -0
  193. package/es/components/attributeList/index.js +1 -1
  194. package/es/components/attributeList/index.js.map +1 -1
  195. package/es/components/customResizeHook/index.js +1 -1
  196. package/es/components/customResizeHook/index.js.map +1 -1
  197. package/es/components/pointCloudView/PointCloud2DView.js +1 -0
  198. package/es/components/pointCloudView/PointCloud2DView.js.map +1 -0
  199. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  200. package/es/components/pointCloudView/PointCloud3DView.js.map +1 -0
  201. package/es/components/pointCloudView/PointCloudBackView.js +1 -0
  202. package/es/components/pointCloudView/PointCloudBackView.js.map +1 -0
  203. package/es/components/pointCloudView/PointCloudContext.js +1 -0
  204. package/es/components/pointCloudView/PointCloudContext.js.map +1 -0
  205. package/es/components/pointCloudView/PointCloudInfos.js +1 -0
  206. package/es/components/pointCloudView/PointCloudInfos.js.map +1 -0
  207. package/es/components/pointCloudView/PointCloudLayout.js +1 -1
  208. package/es/components/pointCloudView/PointCloudLayout.js.map +1 -0
  209. package/es/components/pointCloudView/PointCloudListener.js +1 -0
  210. package/es/components/pointCloudView/PointCloudListener.js.map +1 -0
  211. package/es/components/pointCloudView/PointCloudSideView.js +1 -0
  212. package/es/components/pointCloudView/PointCloudSideView.js.map +1 -0
  213. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  214. package/es/components/pointCloudView/PointCloudTopView.js.map +1 -0
  215. package/es/components/pointCloudView/components/EmptyPage/index.js +1 -0
  216. package/es/components/pointCloudView/components/EmptyPage/index.js.map +1 -0
  217. package/es/components/pointCloudView/data.js +4 -0
  218. package/es/components/pointCloudView/data.js.map +1 -0
  219. package/es/components/pointCloudView/hooks/useBoxes.js +1 -0
  220. package/es/components/pointCloudView/hooks/useBoxes.js.map +1 -0
  221. package/es/components/pointCloudView/hooks/useConfig.js +19 -0
  222. package/es/components/pointCloudView/hooks/useConfig.js.map +1 -0
  223. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
  224. package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +1 -0
  225. package/es/components/pointCloudView/hooks/usePolygon.js +1 -0
  226. package/es/components/pointCloudView/hooks/usePolygon.js.map +1 -0
  227. package/es/components/pointCloudView/hooks/useRotate.js +1 -0
  228. package/es/components/pointCloudView/hooks/useRotate.js.map +1 -0
  229. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -0
  230. package/es/components/pointCloudView/hooks/useSingleBox.js.map +1 -0
  231. package/es/components/pointCloudView/hooks/useStatus.js +1 -0
  232. package/es/components/pointCloudView/hooks/useStatus.js.map +1 -0
  233. package/es/components/pointCloudView/hooks/useZoom.js +1 -0
  234. package/es/components/pointCloudView/hooks/useZoom.js.map +1 -0
  235. package/es/components/pointCloudView/index.js +1 -1
  236. package/es/components/pointCloudView/index.js.map +1 -0
  237. package/es/components/videoAnnotate/index.js +1 -1
  238. package/es/components/videoAnnotate/index.js.map +1 -1
  239. package/es/data/enums/ToolType.js +1 -1
  240. package/es/data/enums/ToolType.js.map +1 -1
  241. package/es/hooks/annotation.js +1 -0
  242. package/es/hooks/annotation.js.map +1 -0
  243. package/es/hooks/useConfig.js +18 -0
  244. package/es/hooks/useConfig.js.map +1 -0
  245. package/es/hooks/useSize.js +1 -1
  246. package/es/hooks/useSize.js.map +1 -1
  247. package/es/index.css +1404 -0
  248. package/es/index.js +1 -1
  249. package/es/index.js.map +1 -1
  250. package/es/store/Actions.js +1 -1
  251. package/es/store/Actions.js.map +1 -1
  252. package/es/store/annotation/actionCreators.js +1 -1
  253. package/es/store/annotation/actionCreators.js.map +1 -1
  254. package/es/store/annotation/map.js +1 -0
  255. package/es/store/annotation/map.js.map +1 -0
  256. package/es/store/annotation/reducer.js +1 -1
  257. package/es/store/annotation/reducer.js.map +1 -1
  258. package/es/store/ctx.js +1 -0
  259. package/es/store/ctx.js.map +1 -0
  260. package/es/utils/StepUtils.js +1 -1
  261. package/es/utils/StepUtils.js.map +1 -1
  262. package/es/utils/ToolUtils.js.map +1 -0
  263. package/es/utils/data.js +1 -1
  264. package/es/utils/data.js.map +1 -1
  265. package/es/utils/dom.js +1 -1
  266. package/es/utils/dom.js.map +1 -1
  267. package/es/utils/index.js +1 -1
  268. package/es/utils/index.js.map +1 -1
  269. package/es/views/MainView/annotationOperation/index.js +1 -1
  270. package/es/views/MainView/annotationOperation/index.js.map +1 -1
  271. package/es/views/MainView/annotationTips/index.js +1 -1
  272. package/es/views/MainView/annotationTips/index.js.map +1 -1
  273. package/es/views/MainView/index.js +1 -1
  274. package/es/views/MainView/index.js.map +1 -1
  275. package/es/views/MainView/sidebar/AnnotationText/index.js +1 -1
  276. package/es/views/MainView/sidebar/AnnotationText/index.js.map +1 -1
  277. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
  278. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js.map +1 -0
  279. package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  280. package/es/views/MainView/sidebar/GeneralOperation/index.js.map +1 -1
  281. package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
  282. package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js.map +1 -0
  283. package/es/views/MainView/sidebar/ImgAttributeInfo/index.js +1 -1
  284. package/es/views/MainView/sidebar/ImgAttributeInfo/index.js.map +1 -1
  285. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
  286. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js.map +1 -0
  287. package/es/views/MainView/sidebar/ScribbleSidebar/index.js +1 -0
  288. package/es/views/MainView/sidebar/ScribbleSidebar/index.js.map +1 -0
  289. package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
  290. package/es/views/MainView/sidebar/SwitchAttributeList/index.js.map +1 -1
  291. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  292. package/es/views/MainView/sidebar/TagSidebar/index.js.map +1 -1
  293. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  294. package/es/views/MainView/sidebar/TextToolSidebar/index.js.map +1 -1
  295. package/es/views/MainView/sidebar/ToolIcons.js +1 -0
  296. package/es/views/MainView/sidebar/ToolIcons.js.map +1 -0
  297. package/es/views/MainView/sidebar/ToolStyle/index.js +1 -1
  298. package/es/views/MainView/sidebar/ToolStyle/index.js.map +1 -1
  299. package/es/views/MainView/sidebar/index.js +1 -1
  300. package/es/views/MainView/sidebar/index.js.map +1 -1
  301. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  302. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +1 -1
  303. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
  304. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js.map +1 -0
  305. package/es/views/MainView/toolFooter/FooterTips/index.js +1 -1
  306. package/es/views/MainView/toolFooter/FooterTips/index.js.map +1 -1
  307. package/es/views/MainView/toolFooter/HiddenTips/index.js +1 -1
  308. package/es/views/MainView/toolFooter/HiddenTips/index.js.map +1 -1
  309. package/es/views/MainView/toolFooter/PageNumber/index.js +1 -1
  310. package/es/views/MainView/toolFooter/PageNumber/index.js.map +1 -1
  311. package/es/views/MainView/toolFooter/Pagination.js +1 -1
  312. package/es/views/MainView/toolFooter/Pagination.js.map +1 -1
  313. package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
  314. package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js.map +1 -1
  315. package/es/views/MainView/toolFooter/ZoomController/index.js +1 -1
  316. package/es/views/MainView/toolFooter/ZoomController/index.js.map +1 -1
  317. package/es/views/MainView/toolFooter/index.js +1 -1
  318. package/es/views/MainView/toolFooter/index.js.map +1 -1
  319. package/es/views/MainView/toolHeader/ExportData/index.js +1 -1
  320. package/es/views/MainView/toolHeader/ExportData/index.js.map +1 -1
  321. package/es/views/MainView/toolHeader/StepSwitch/index.js +1 -1
  322. package/es/views/MainView/toolHeader/StepSwitch/index.js.map +1 -1
  323. package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
  324. package/es/views/MainView/toolHeader/headerOption/index.js.map +1 -1
  325. package/es/views/MainView/toolHeader/index.js +1 -1
  326. package/es/views/MainView/toolHeader/index.js.map +1 -1
  327. package/package.json +9 -8
  328. package/dist/index.css.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointCloudAnnotationView.js","sources":["../../../src/components/AnnotationView/pointCloudAnnotationView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-13 19:31:36\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-06-27 19:43:25\n */\n\nimport { PointCloud } from '@labelbee/lb-annotation';\nimport { IPointCloudBox, PointCloudUtils } from '@labelbee/lb-utils';\nimport React, { useCallback, useEffect, useRef } from 'react';\n\ninterface IProps {\n src: string; // 图片路径\n result: string;\n size: {\n width: number;\n height: number;\n };\n}\n\nconst PointCloudAnnotationView = (props: IProps) => {\n const { src, result, size } = props;\n let viewOperation = useRef<any>();\n const instance = useRef<any>();\n\n const refCallback = useCallback((node) => {\n viewOperation.current = node;\n }, []);\n\n useEffect(() => {\n const pointCloud = new PointCloud({\n container: viewOperation.current,\n backgroundColor: '#ccc',\n });\n instance.current = pointCloud;\n }, []);\n\n useEffect(() => {\n instance.current?.init();\n }, [size]);\n\n useEffect(() => {\n if (instance.current && src) {\n instance.current?.loadPCDFile(src);\n }\n }, [src]);\n\n useEffect(() => {\n if (result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n instance.current?.generateBox(v, v.id);\n });\n }\n return () => {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(result);\n boxParamsList.forEach((v: IPointCloudBox) => {\n instance.current?.removeObjectByName(v.id);\n });\n instance.current?.render();\n };\n }, [result]);\n\n return <div style={size} ref={refCallback} />;\n};\n\nexport default PointCloudAnnotationView;\n"],"names":[],"mappings":";;;;AAoBM,MAAA,wBAAA,GAA2B,CAAC,KAAkB,KAAA;AAClD,EAAM,MAAA,CAAE,GAAK,EAAA,MAAA,EAAQ,IAAS,CAAA,GAAA,KAAA,CAAA;AAC9B,EAAA,IAAI,aAAgB,GAAA,MAAA,EAAA,CAAA;AACpB,EAAA,MAAM,QAAW,GAAA,MAAA,EAAA,CAAA;AAEjB,EAAM,MAAA,WAAA,GAAc,WAAY,CAAA,CAAC,IAAS,KAAA;AACxC,IAAA,aAAA,CAAc,OAAU,GAAA,IAAA,CAAA;AAAA,GACvB,EAAA,EAAA,CAAA,CAAA;AAEH,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,UAAA,GAAa,IAAI,UAAW,CAAA;AAAA,MAChC,WAAW,aAAc,CAAA,OAAA;AAAA,MACzB,eAAiB,EAAA,MAAA;AAAA,KAAA,CAAA,CAAA;AAEnB,IAAA,QAAA,CAAS,OAAU,GAAA,UAAA,CAAA;AAAA,GAClB,EAAA,EAAA,CAAA,CAAA;AAEH,EAAA,S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AAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAEzC,MAAA,CAAA,EAAA,GAAA,QAAA,CAAS,YAAT,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAAA,EAEnB,CAAC,MAAA,CAAA,CAAA,CAAA;AAEJ,EAAA,2CAAQ,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,IAAA;AAAA,IAAM,GAAK,EAAA,WAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- import{COLORS_ARRAY as n,NULL_COLOR as b}from"../../data/Style.js";import{ColorTag as g}from"../colorTag/index.js";import{Radio as m}from"antd/es";import t from"react";const f=[b].concat(n),R=t.forwardRef((e,c)=>{const d=t.useRef(),s=e.list||[];let i=[...f];e.forbidDefault===!0&&(i=i.slice(1));let o="sensebee-radio-group";return e.noHeightLimit&&(o="sensebee-radio-group-no-limit-height"),t.createElement("div",{className:o},t.createElement(m.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,onChange:l=>e.attributeChanged(l.target.value),ref:c},s.map((l,r)=>{var u;let a=(u=e==null?void 0:e.num)!=null?u:r;return e.forbidDefault===!0&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-"),t.createElement(m,{value:l.value,ref:d,key:r},t.createElement("span",{className:"sensebee-radio-label",title:l.label},!(e==null?void 0:e.forbidColor)&&t.createElement(g,{color:r>8&&!e.forbidDefault?n[(r-1)%n.length]:i[r%i.length],style:{marginRight:"8px"}}),l.label),t.createElement("span",{className:"sensebee-radio-num"},a))})))});export{f as ATTRIBUTE_COLORS,R as default};
1
+ import{COLORS_ARRAY as i,NULL_COLOR as g}from"../../data/Style.js";import{ColorTag as R}from"../colorTag/index.js";import{Radio as c}from"antd/es";import l from"react";const f=[g].concat(i),v=l.forwardRef((e,d)=>{const s=l.useRef(),b=e.list||[];let o=[...f];e.forbidDefault===!0&&(o=o.slice(1));let n="sensebee-radio-group";return e.noHeightLimit&&(n="sensebee-radio-group-no-limit-height"),l.createElement("div",{className:n},l.createElement(c.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,onChange:t=>e.attributeChanged(t.target.value),ref:d},b.map((t,r)=>{var u;let a=(u=e==null?void 0:e.num)!=null?u:r;e.forbidDefault===!0&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-");let m=r>8&&!e.forbidDefault?i[(r-1)%i.length]:o[r%o.length];return(t==null?void 0:t.color)&&(m=t.color),l.createElement(c,{value:t.value,ref:s,key:r},l.createElement("span",{className:"sensebee-radio-label",title:t.label},!(e==null?void 0:e.forbidColor)&&l.createElement(R,{color:m,style:{marginRight:"8px"}}),t.label),l.createElement("span",{className:"sensebee-radio-num"},a))})))});export{f as ATTRIBUTE_COLORS,v as default};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/attributeList/index.tsx"],"sourcesContent":["import { COLORS_ARRAY, NULL_COLOR } from '@/data/Style';\nimport { ColorTag } from '@/components/colorTag';\nimport { Radio } from 'antd/es';\nimport React from 'react';\n\nexport const ATTRIBUTE_COLORS = [NULL_COLOR].concat(COLORS_ARRAY);\n\ninterface IProps {\n list: Array<{\n label: string;\n value: string;\n }>;\n selectedAttribute: string;\n attributeChanged: (v: string) => void;\n forbidDefault?: boolean;\n forbidColor?: boolean;\n noHeightLimit?: boolean;\n num?: number;\n}\n\nconst AttributeList = React.forwardRef((props: IProps, ref) => {\n const radioRef = React.useRef<any>();\n\n const list = props.list || [];\n\n let NEW_ATTRIBUTE_COLORS = [...ATTRIBUTE_COLORS];\n\n // 去除默认的颜色\n if (props.forbidDefault === true) {\n NEW_ATTRIBUTE_COLORS = NEW_ATTRIBUTE_COLORS.slice(1);\n }\n\n let className = 'sensebee-radio-group';\n if (props.noHeightLimit) {\n className = 'sensebee-radio-group-no-limit-height';\n }\n\n return (\n <div className={className}>\n <Radio.Group\n name=\"radiogroup\"\n defaultValue={props?.selectedAttribute}\n value={props?.selectedAttribute}\n onChange={(e) => props.attributeChanged(e.target.value)}\n ref={ref as any}\n >\n {list.map((i: any, index: number) => {\n let hotKey: number | string = props?.num ?? index;\n\n if (props.forbidDefault === true) {\n // 禁止 default 将从 1 开始\n hotKey++;\n }\n\n // 超出范围无法展示\n if (!(typeof hotKey === 'number' && hotKey <= 9 && hotKey >= 0)) {\n hotKey = '-';\n }\n\n return (\n <Radio\n value={i.value}\n ref={radioRef}\n key={index}\n >\n <span className=\"sensebee-radio-label\" title={i.label}>\n {!props?.forbidColor && (\n <ColorTag\n color={\n index > 8 && !props.forbidDefault\n ? COLORS_ARRAY[(index - 1) % COLORS_ARRAY.length]\n : NEW_ATTRIBUTE_COLORS[\n index % NEW_ATTRIBUTE_COLORS.length\n ]\n }\n style={{ marginRight: '8px' }}\n />\n )}\n {i.label}\n </span>\n <span className=\"sensebee-radio-num\">{hotKey}</span>\n </Radio>\n );\n })}\n </Radio.Group>\n </div>\n );\n});\n\nexport default AttributeList;\n"],"names":[],"mappings":";;;;;AAKa,MAAA,gBAAA,GAAmB,CAAC,UAAA,CAAA,CAAY,MAAO,CAAA,YAAA,EAAA;AAepD,MAAM,aAAgB,GAAA,KAAA,CAAM,UAAW,CAAA,CAAC,OAAe,GAAQ,KAAA;AAC7D,EAAA,MAAM,WAAW,KAAM,CAAA,MAAA,EAAA,CAAA;AAEvB,EAAM,MAAA,IAAA,GAAO,MAAM,IAAQ,IAAA,EAAA,CAAA;AAE3B,EAAI,IAAA,oBAAA,GAAuB,CAAC,GAAG,gBAAA,CAAA,CAAA;AAG/B,EAAI,IAAA,KAAA,CAAM,kBAAkB,IAAM,EAAA;AAChC,IAAA,oBAAA,GAAuB,qBAAqB,KAAM,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAGpD,EAAA,IAAI,SAAY,GAAA,sBAAA,CAAA;AAChB,EAAA,IAAI,MAAM,aA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AAA,KAAA,CAAA,GAAA,KAAA,CAAO,WACP,CAAA,oBAAA,KAAA,CAAA,aAAA,CAAC,QAAD,EAAA;AAAA,MACE,KACE,EAAA,KAAA,GAAQ,CAAK,IAAA,CAAC,KAAM,CAAA,aAAA,GAChB,YAAc,CAAA,CAAA,KAAA,GAAQ,CAAK,IAAA,YAAA,CAAa,MACxC,CAAA,GAAA,oBAAA,CACA,QAAQ,oBAAqB,CAAA,MAAA,CAAA;AAAA,MAGnC,KAAA,EAAO,CAAE,WAAa,EAAA,KAAA,CAAA;AAAA,KAGzB,CAAA,EAAA,CAAA,CAAE,KAEL,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAD,EAAA;AAAA,MAAM,SAAU,EAAA,oBAAA;AAAA,KAAsB,EAAA,MAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/attributeList/index.tsx"],"sourcesContent":["import { COLORS_ARRAY, NULL_COLOR } from '@/data/Style';\nimport { ColorTag } from '@/components/colorTag';\nimport { Radio } from 'antd/es';\nimport React from 'react';\n\nexport const ATTRIBUTE_COLORS = [NULL_COLOR].concat(COLORS_ARRAY);\n\ninterface IProps {\n list: Array<{\n label: string;\n value: string;\n color?: string;\n }>;\n selectedAttribute: string;\n attributeChanged: (v: string) => void;\n forbidDefault?: boolean;\n forbidColor?: boolean;\n noHeightLimit?: boolean;\n num?: number;\n}\n\nconst AttributeList = React.forwardRef((props: IProps, ref) => {\n const radioRef = React.useRef<any>();\n\n const list = props.list || [];\n\n let NEW_ATTRIBUTE_COLORS = [...ATTRIBUTE_COLORS];\n\n // 去除默认的颜色\n if (props.forbidDefault === true) {\n NEW_ATTRIBUTE_COLORS = NEW_ATTRIBUTE_COLORS.slice(1);\n }\n\n let className = 'sensebee-radio-group';\n if (props.noHeightLimit) {\n className = 'sensebee-radio-group-no-limit-height';\n }\n\n return (\n <div className={className}>\n <Radio.Group\n name='radiogroup'\n defaultValue={props?.selectedAttribute}\n value={props?.selectedAttribute}\n onChange={(e) => props.attributeChanged(e.target.value)}\n ref={ref as any}\n >\n {list.map((i: any, index: number) => {\n let hotKey: number | string = props?.num ?? index;\n\n if (props.forbidDefault === true) {\n // 禁止 default 将从 1 开始\n hotKey++;\n }\n\n // 超出范围无法展示\n if (!(typeof hotKey === 'number' && hotKey <= 9 && hotKey >= 0)) {\n hotKey = '-';\n }\n\n let color =\n index > 8 && !props.forbidDefault\n ? COLORS_ARRAY[(index - 1) % COLORS_ARRAY.length]\n : NEW_ATTRIBUTE_COLORS[index % NEW_ATTRIBUTE_COLORS.length];\n\n if (i?.color) {\n color = i.color;\n }\n\n return (\n <Radio value={i.value} ref={radioRef} key={index}>\n <span className='sensebee-radio-label' title={i.label}>\n {!props?.forbidColor && <ColorTag color={color} style={{ marginRight: '8px' }} />}\n {i.label}\n </span>\n <span className='sensebee-radio-num'>{hotKey}</span>\n </Radio>\n );\n })}\n </Radio.Group>\n </div>\n );\n});\n\nexport default AttributeList;\n"],"names":[],"mappings":";;;;;AAKa,MAAA,gBAAA,GAAmB,CAAC,UAAA,CAAA,CAAY,MAAO,CAAA,YAAA,EAAA;AAgBpD,MAAM,aAAgB,GAAA,KAAA,CAAM,UAAW,CAAA,CAAC,OAAe,GAAQ,KAAA;AAC7D,EAAA,MAAM,WAAW,KAAM,CAAA,MAAA,EAAA,CAAA;AAEvB,EAAM,MAAA,IAAA,GAAO,MAAM,IAAQ,IAAA,EAAA,CAAA;AAE3B,EAAI,IAAA,oBAAA,GAAuB,CAAC,GAAG,gBAAA,CAAA,CAAA;AAG/B,EAAI,IAAA,KAAA,CAAM,kBAAkB,IAAM,EAAA;AAChC,IAAA,oBAAA,GAAuB,qBAAqB,KAAM,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAGpD,EAAA,IAAI,SAAY,GAAA,sBAAA,CAAA;AAChB,EAAA,IAAI,MAAM,aAAe,EAAA;AACvB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AA,KAAA,CAAA;AAAA,KAAA;AAGZ,IAAA,2CACG,KAAD,EAAA;AAAA,MAAO,OAAO,CAAE,CAAA,KAAA;AAAA,MAAO,GAAK,EAAA,QAAA;AAAA,MAAU,GAAK,EAAA,KAAA;AAAA,KAAA,sCACxC,MAAD,EAAA;AAAA,MAAM,SAAU,EAAA,sBAAA;AAAA,MAAuB,OAAO,CAAE,CAAA,KAAA;AAAA,KAAA,EAC7C,EAAC,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAO,WAAe,CAAA,oBAAA,KAAA,CAAA,aAAA,CAAC,QAAD,EAAA;AAAA,MAAU,KAAA;AAAA,MAAc,KAAA,EAAO,CAAE,WAAa,EAAA,KAAA,CAAA;AAAA,KACrE,CAAA,EAAA,CAAA,CAAE,KAEL,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAD,EAAA;AAAA,MAAM,SAAU,EAAA,oBAAA;AAAA,KAAsB,EAAA,MAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- import{editStepWidth as g,sidebarWidth as w,headerHeight as p,footerHeight as y}from"../../data/enums/AnnotationSize.js";import{cKeyCode as C,toolUtils as v}from"@labelbee/lb-annotation";import l,{useState as f,useEffect as E,useMemo as k}from"react";import{connect as H}from"react-redux";import{PageBackward as P,PageForward as S,UpdateRotate as T,UpdateToolInstance as K}from"../../store/annotation/actionCreators.js";import{message as L}from"antd";const a=C.default,m=l.createContext({width:window.innerWidth,height:window.innerHeight}),u=e=>{const{children:d,dispatch:n}=e,[i]=f(window.innerWidth),[r]=f(window.innerHeight),o=t=>{var c;if(!!v.hotkeyFilter(t)&&(t.keyCode===a.A&&n(P()),t.keyCode===a.D&&n(S()),t.keyCode===a.R&&n(T()),t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===a.C)){L.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const h=(c=e.annotation)==null?void 0:c.annotationEngine.switchLastTwoCanvas();if(!h)return;n(K(h))}};E(()=>(window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}),[e.annotation.annotationEngine]);const s=k(()=>({width:i,height:r}),[i,r]);return l.createElement(m.Provider,{value:s},d)},W=H(e=>({annotation:e.annotation}))(u),b=(e,d=!1,n=!1)=>{const{width:i,height:r}=e,o=p+y,s=n?40+o+40:o,t=d?g+w:w;return{width:i-t,height:r-s}};export{W as ViewportProvider,u as ViewportProviderComponent,b as getFormatSize,m as viewportContext};
1
+ import{editStepWidth as C,sidebarWidth as l,headerHeight as v,footerHeight as k}from"../../data/enums/AnnotationSize.js";import{cKeyCode as E,toolUtils as P}from"@labelbee/lb-annotation";import f,{useState as u,useEffect as T,useMemo as x}from"react";import{connect as K}from"react-redux";import{PageBackward as m,PageForward as g,UpdateRotate as H,UpdateToolInstance as L}from"../../store/annotation/actionCreators.js";import{message as S}from"antd";import{LabelBeeContext as b}from"../../store/ctx.js";const s=E.default,y=f.createContext({width:window.innerWidth,height:window.innerHeight}),p=e=>{const{children:d,dispatch:n,annotation:{skipBeforePageTurning:o}}=e,[r]=u(window.innerWidth),[i]=u(window.innerHeight),a=t=>{var h;if(!!P.hotkeyFilter(t)){if(!t.shiftKey||!t.ctrlKey){if(t.keyCode===s.A){if(o){o(()=>n(m()));return}n(m())}if(t.keyCode===s.D){if(o){o(()=>n(g()));return}n(g())}t.keyCode===s.R&&n(H())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===s.C){S.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const w=(h=e.annotation)==null?void 0:h.annotationEngine.switchLastTwoCanvas();if(!w)return;n(L(w))}}};T(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[e.annotation.annotationEngine,e.annotation.skipBeforePageTurning]);const c=x(()=>({width:r,height:i}),[r,i]);return f.createElement(y.Provider,{value:c},d)},W=K(e=>({annotation:e.annotation}),null,null,{context:b})(p),B=(e,d=!1,n=!1)=>{const{width:o,height:r}=e,i=v+k,a=n?40+i+40:i,c=d?C+l:l;return{width:o-c,height:r-a}};export{W as ViewportProvider,p as ViewportProviderComponent,B as getFormatSize,y as viewportContext};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/customResizeHook/index.tsx"],"sourcesContent":["import {\n editStepWidth,\n footerHeight,\n headerHeight,\n sidebarWidth,\n} from '@/data/enums/AnnotationSize';\nimport { cKeyCode, toolUtils } from '@labelbee/lb-annotation';\n\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport {\n UpdateRotate,\n PageBackward,\n PageForward,\n UpdateToolInstance,\n} from '@/store/annotation/actionCreators';\nimport { ISize } from '@/types/main';\nimport { message } from 'antd';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const { children, dispatch } = props;\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n if (e.keyCode === EKeyCode.A) {\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\n\nexport const ViewportProvider = connect((state: AppState) => ({\n annotation: state.annotation,\n}))(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,WAAW,QAAS,CAAA,OAAA,CAAA;AAEb,MAAA,eAAA,GAAkB,MAAM,aAGlC,CAAA;AAAA,EACD,OAAO,MAAO,CAAA,UAAA;AAAA,EACd,QAAQ,MAAO,CAAA,WAAA;AAAA,CAAA,EAAA;AAGJ,MAAA,yBAAA,GAA4B,CAAC,KAAe,KAAA;AACvD,EAAM,MAAA,CAAE,UAAU,QAAa,CAAA,GAAA,KAAA,CAAA;AAC/B,EAAM,MAAA,CAAC,KAAS,CAAA,GAAA,QAAA,CAAS,MAAO,CAAA,UAAA,CAAA,CAAA;AAChC,EA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AiB,SAAW,EAAA,OAAA,CAAA,CAAA;AAEnC,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,oBAAoB,SAAW,EAAA,OAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAEvC,EAAA,CAAC,MAAM,UAAW,CAAA,gBAAA,CAAA,CAAA,CAAA;AAErB,EAAA,MAAM,OAAO,OAAQ,CAAA,QAAS,KAAO,EAAA,MAAA,CAAA,CAAA,EAAW,CAAC,KAAO,EAAA,MAAA,CAAA,CAAA,CAAA;AAExD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAgB,QAAjB,EAAA;AAAA,IAA0B,KAAO,EAAA,IAAA;AAAA,GAAO,EAAA,QAAA,CAAA,CAAA;AAAA,EAAA;AAGpC,MAAA,gBAAA,GAAmB,OAAQ,CAAA,CAAC,KAAqB,MAAA;AAAA,EAC5D,YAAY,KAAM,CAAA,UAAA;AAAA,CAChB,CAAA,CAAA,CAAA,yBAAA,EAAA;AA8BG,MAAM,gBAAgB,CAAC,UAAA,EAAmB,MAAS,GAAA,KAAA,EAAO,SAAS,KAAU,KAAA;AAClF,EAAM,MAAA,CAAE,OAAO,MAAW,CAAA,GAAA,UAAA,CAAA;AAC1B,EAAA,MAAM,cAAc,YAAe,GAAA,YAAA,CAAA;AACnC,EAAA,MAAM,iBAAoB,GAAA,MAAA,GAAS,EAAK,GAAA,WAAA,GAAc,EAAK,GAAA,WAAA,CAAA;AAC3D,EAAM,MAAA,gBAAA,GAAmB,MAAS,GAAA,aAAA,GAAgB,YAAe,GAAA,YAAA,CAAA;AAEjE,EAAO,OAAA;AAAA,IACL,OAAO,KAAQ,GAAA,gBAAA;AAAA,IACf,QAAQ,MAAS,GAAA,iBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/customResizeHook/index.tsx"],"sourcesContent":["import {\n editStepWidth,\n footerHeight,\n headerHeight,\n sidebarWidth,\n} from '@/data/enums/AnnotationSize';\nimport { cKeyCode, toolUtils } from '@labelbee/lb-annotation';\n\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport {\n UpdateRotate,\n PageBackward,\n PageForward,\n UpdateToolInstance,\n} from '@/store/annotation/actionCreators';\nimport { ISize } from '@/types/main';\nimport { message } from 'antd';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const {\n children,\n dispatch,\n annotation: { skipBeforePageTurning },\n } = props;\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n\n if (!e.shiftKey || !e.ctrlKey) {\n if (e.keyCode === EKeyCode.A) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageBackward()));\n return;\n }\n\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageForward()));\n return;\n }\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine, props.annotation.skipBeforePageTurning]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\nexport const ViewportProvider = connect(\n (state: AppState) => ({\n annotation: state.annotation,\n }),\n null,\n null,\n { context: LabelBeeContext },\n)(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAqBA,MAAM,WAAW,QAAS,CAAA,OAAA,CAAA;AAEb,MAAA,eAAA,GAAkB,MAAM,aAGlC,CAAA;AAAA,EACD,OAAO,MAAO,CAAA,UAAA;AAAA,EACd,QAAQ,MAAO,CAAA,WAAA;AAAA,CAAA,EAAA;AAGJ,MAAA,yBAAA,GAA4B,CAAC,KAAe,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAY,CAAE,qBAAA,CAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,CAAC,KAAS,CAAA,GAAA,QAAA,CAAS,MAAO,CAAA,UAA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A;AAC1B,EAAA,MAAM,cAAc,YAAe,GAAA,YAAA,CAAA;AACnC,EAAA,MAAM,iBAAoB,GAAA,MAAA,GAAS,EAAK,GAAA,WAAA,GAAc,EAAK,GAAA,WAAA,CAAA;AAC3D,EAAM,MAAA,gBAAA,GAAmB,MAAS,GAAA,aAAA,GAAgB,YAAe,GAAA,YAAA,CAAA;AAEjE,EAAO,OAAA;AAAA,IACL,OAAO,KAAQ,GAAA,gBAAA;AAAA,IACf,QAAQ,MAAS,GAAA,iBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
@@ -0,0 +1 @@
1
+ import{getClassName as h}from"../../utils/dom.js";import i,{useState as E,useContext as N,useRef as b,useEffect as _}from"react";import{PointCloudContainer as A}from"./PointCloudLayout.js";import I from"../AnnotationView/index.js";import{PointCloudContext as R}from"./PointCloudContext.js";import{connect as k}from"react-redux";import{LeftOutlined as z,RightOutlined as T}from"@ant-design/icons";import M from"../../hooks/useSize.js";import{useSingleBox as $}from"./hooks/useSingleBox.js";import{useTranslation as q}from"react-i18next";import{LabelBeeContext as F}from"../../store/ctx.js";var G=Object.defineProperty,O=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,S=(t,n,e)=>n in t?G(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,K=(t,n)=>{for(var e in n||(n={}))H.call(n,e)&&S(t,e,n[e]);if(O)for(var e of O(n))J.call(n,e)&&S(t,e,n[e]);return t};const Q=({onNext:t,onPrev:n,imgLength:e,imgIndex:s})=>i.createElement("div",null,i.createElement(z,{onClick:n}),i.createElement("span",null," ",s+1," / ",e," "),i.createElement(T,{onClick:t})),U=({imgInfo:t})=>{var n,e,s,x,L;const[p,j]=E([]),{pointCloudBoxList:P,topViewInstance:C}=N(R),[u,m]=E(0),w=b(null),v=b(),{selectedBox:f}=$(),V=M(w),{t:D}=q(),a=(n=t==null?void 0:t.mappingImgList)==null?void 0:n[u];_(()=>{m(0)},[t]),_(()=>{if(C&&a){const{pointCloudInstance:o}=C,r={fill:"transparent",color:"green"},c=P.reduce((l,d)=>{const B=o.pointCloudLidar2image(d,a.calib);return[...l,...B.map(y=>({type:y.type,annotation:K({id:d.id,pointList:y.pointList},r)}))]},[]);j(c)}},[P,a]);const g=!t||!(t==null?void 0:t.mappingImgList)||!(((e=t==null?void 0:t.mappingImgList)==null?void 0:e.length)>0);return _(()=>{var o,r;const c=(o=v.current)==null?void 0:o.toolInstance;if(!f||!c)return;const l=p.find(d=>d.annotation.id===f.info.id);((r=l==null?void 0:l.annotation.pointList)==null?void 0:r.length)>0&&c.focusPositionByPointList(l==null?void 0:l.annotation.pointList)},[f,v.current,p]),i.createElement(A,{className:h("point-cloud-2d-container"),title:D("2DView"),toolbar:g?void 0:i.createElement(Q,{imgIndex:u,imgLength:(x=(s=t.mappingImgList)==null?void 0:s.length)!=null?x:0,onNext:()=>{var o;!t||!(t==null?void 0:t.mappingImgList)||u>=((o=t==null?void 0:t.mappingImgList)==null?void 0:o.length)-1||m(r=>r+1)},onPrev:()=>{u<=0||m(o=>o-1)}}),style:{display:g?"none":"flex"}},i.createElement("div",{className:h("point-cloud-2d-image"),ref:w},i.createElement(I,{src:(L=a==null?void 0:a.url)!=null?L:"",annotations:p,size:V,ref:v,globalStyle:{display:g?"none":"block"}})))},W=t=>{const{imgList:n,imgIndex:e}=t.annotation;return{imgInfo:n[e]}};var X=k(W,null,null,{context:F})(U);export{X as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloud2DView.js","sources":["../../../src/components/pointCloudView/PointCloud2DView.tsx"],"sourcesContent":["import { getClassName } from '@/utils/dom';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport AnnotationView from '@/components/AnnotationView';\nimport { PointCloudContext } from './PointCloudContext';\nimport { AppState } from '@/store';\nimport { connect } from 'react-redux';\nimport { IFileItem } from '@/types/data';\nimport { LeftOutlined, RightOutlined } from '@ant-design/icons';\nimport useSize from '@/hooks/useSize';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { ViewOperation } from '@labelbee/lb-annotation';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\ninterface IProps {\n imgInfo: IFileItem;\n}\n\nconst Toolbar = ({\n onNext,\n onPrev,\n imgLength,\n imgIndex,\n}: {\n onNext: () => void;\n onPrev: () => void;\n imgLength: number;\n imgIndex: number;\n}) => {\n return (\n <div>\n <LeftOutlined onClick={onPrev} />\n <span>\n {' '}\n {imgIndex + 1} / {imgLength}{' '}\n </span>\n\n <RightOutlined onClick={onNext} />\n </div>\n );\n};\n\n// TODO, It will be deleted when the exported type of lb-annotation is work.\ninterface IAnnotationDataTemporarily {\n type: string;\n annotation: any;\n}\n\nconst PointCloud2DView = ({ imgInfo }: IProps) => {\n const [annotations2d, setAnnotations2d] = useState<IAnnotationDataTemporarily[]>([]);\n const { pointCloudBoxList, topViewInstance } = useContext(PointCloudContext);\n const [mappingIndex, setMappingIndex] = useState(0);\n const ref = useRef(null);\n const viewRef = useRef<{ toolInstance: ViewOperation }>();\n const { selectedBox } = useSingleBox();\n const size = useSize(ref);\n const { t } = useTranslation();\n\n const mappingData = imgInfo?.mappingImgList?.[mappingIndex];\n\n useEffect(() => {\n setMappingIndex(0);\n }, [imgInfo]);\n\n useEffect(() => {\n if (topViewInstance && mappingData) {\n const { pointCloudInstance } = topViewInstance;\n const defaultViewStyle = {\n fill: 'transparent',\n color: 'green',\n };\n const newAnnotations2d: IAnnotationDataTemporarily[] = pointCloudBoxList.reduce(\n (acc: IAnnotationDataTemporarily[], pointCloudBox) => {\n const viewDataPointList = pointCloudInstance.pointCloudLidar2image(\n pointCloudBox,\n mappingData.calib,\n );\n return [\n ...acc,\n ...viewDataPointList.map((v: any) => {\n return {\n type: v.type,\n annotation: {\n id: pointCloudBox.id,\n pointList: v.pointList,\n ...defaultViewStyle,\n },\n };\n }),\n ];\n },\n [],\n );\n\n setAnnotations2d(newAnnotations2d);\n }\n }, [pointCloudBoxList, mappingData]);\n\n const hiddenData = !imgInfo || !imgInfo?.mappingImgList || !(imgInfo?.mappingImgList?.length > 0);\n\n useEffect(() => {\n const toolInstance = viewRef.current?.toolInstance;\n\n if (!selectedBox || !toolInstance) {\n return;\n }\n const selected2data = annotations2d.find((v) => v.annotation.id === selectedBox.info.id);\n\n if (selected2data?.annotation.pointList?.length > 0) {\n toolInstance.focusPositionByPointList(selected2data?.annotation.pointList);\n }\n }, [selectedBox, viewRef.current, annotations2d]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-2d-container')}\n title={t('2DView')}\n toolbar={\n hiddenData ? undefined : (\n <Toolbar\n imgIndex={mappingIndex}\n imgLength={imgInfo.mappingImgList?.length ?? 0}\n onNext={() => {\n if (!imgInfo || !imgInfo?.mappingImgList) {\n return;\n }\n\n if (mappingIndex >= imgInfo?.mappingImgList?.length - 1) {\n return;\n }\n setMappingIndex((v) => v + 1);\n }}\n onPrev={() => {\n if (mappingIndex <= 0) {\n return;\n }\n setMappingIndex((v) => v - 1);\n }}\n />\n )\n }\n style={{ display: hiddenData ? 'none' : 'flex' }}\n >\n <div className={getClassName('point-cloud-2d-image')} ref={ref}>\n <AnnotationView\n src={mappingData?.url ?? ''}\n annotations={annotations2d}\n size={size}\n ref={viewRef}\n globalStyle={{ display: hiddenData ? 'none' : 'block' }}\n />\n </div>\n </PointCloudContainer>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const { imgList, imgIndex } = state.annotation;\n\n return {\n imgInfo: imgList[imgIndex],\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(PointCloud2DView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,UAAU,CAAC;AAAA,EACf,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,CAMI,KAAA;AACJ,EAAA,uBACG,KAAA,CAAA,aAAA,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,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOxD,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAM,MAAA,CAAE,OAAS,EAAA,QAAA,CAAA,GAAa,KAAM,CAAA,UAAA,CAAA;AAEpC,EAAO,OAAA;AAAA,IACL,SAAS,OAAQ,CAAA,QAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAIrB,yBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,gBAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- import{PointCloud as r}from"@labelbee/lb-annotation";import i,{useRef as n,useEffect as l}from"react";const c="LABELBEE-POINTCLOUD";let o;const u=()=>{const t=n(null),e=n();return l(()=>{t.current&&(e.current=new r({container:t.current}),e.current.loadPCDFile("http://10.53.25.142:8001/1/000001.pcd",()=>{}),o=e.current)},[]),i.createElement("div",{id:c,ref:t,style:{height:540,width:"100%"}})};export{u as default,o as pointCloudMain};
1
+ import{getClassName as r}from"../../utils/dom.js";import{PointCloud as L}from"@labelbee/lb-annotation";import{PointCloudUtils as b,EPerspectiveView as E}from"@labelbee/lb-utils";import T from"classnames";import e,{useContext as p,useState as D,useRef as I,useEffect as C,useMemo as S}from"react";import{PointCloudContainer as j}from"./PointCloudLayout.js";import{PointCloudContext as N}from"./PointCloudContext.js";import{aMapStateToProps as k}from"../../store/annotation/map.js";import{connect as R}from"react-redux";import{jsonParser as A}from"../../utils/index.js";import{useSingleBox as _}from"./hooks/useSingleBox.js";import{Switch as y}from"antd";import z from"../../hooks/useSize.js";import{usePointCloudViews as F}from"./hooks/usePointCloudViews.js";import{useTranslation as M}from"react-i18next";import{LabelBeeContext as O}from"../../store/ctx.js";const U="LABELBEE-POINTCLOUD",v=e.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{}}),s=({perspectiveView:t})=>{const{isActive:c,setTarget3DView:i}=p(v),u=d=>T({[r("point-cloud-3d-view",d)]:!0,active:c});return e.createElement("span",{onClick:()=>{i(E[t])},className:u(t.toLocaleLowerCase())})},q=()=>{const{reset3DView:t}=p(v);return e.createElement("div",{className:r("point-cloud-3d-sidebar")},e.createElement(s,{perspectiveView:"Top"}),e.createElement(s,{perspectiveView:"Front"}),e.createElement(s,{perspectiveView:"Left"}),e.createElement(s,{perspectiveView:"Back"}),e.createElement(s,{perspectiveView:"Right"}),e.createElement(s,{perspectiveView:"LFT"}),e.createElement(s,{perspectiveView:"RBT"}),e.createElement("span",{onClick:()=>{t()},className:r("point-cloud-3d-view","reset")}))},G=({currentData:t})=>{var c;const i=p(N),[u,d]=D(!0),m=I(null),{initPointCloud3d:w}=F(),P=z(m),{t:f}=M();C(()=>{!i.mainViewInstance||w==null||w()},[P]);const{selectedBox:l}=_(),V=n=>{var o;const a=l==null?void 0:l.info;a&&((o=i.mainViewInstance)==null||o.updateCameraByBox(a,n))},x=()=>{var n;(n=i.mainViewInstance)==null||n.resetCamera()};C(()=>{var n;if(m.current&&(t==null?void 0:t.url)){let o=i.mainViewInstance;if(o||(o=new L({container:m.current,backgroundColor:"#4c4c4c"})),t.result){const a=b.getBoxParamsFromResultList(t.result);a.forEach(B=>{o==null||o.generateBox(B)}),i.setPointCloudResult(a),i.setPointCloudValid((n=A(t.result))==null?void 0:n.valid)}i.setMainViewInstance(o)}},[t]),C(()=>{l&&V(E.Top)},[l]);const g=S(()=>({reset3DView:x,setTarget3DView:V,isActive:!!l}),[l]),h=e.createElement("div",null,e.createElement("span",{style:{marginRight:8}},f("ShowArrows")),e.createElement(y,{size:"small",checked:u,onChange:n=>{var o;d(n),(o=i.mainViewInstance)==null||o.setShowDirection(n)}}));return e.createElement(j,{className:r("point-cloud-3d-container"),title:f("3DView"),toolbar:h,style:{height:t.mappingImgList&&((c=t.mappingImgList)==null?void 0:c.length)>0?"55%":"100%"}},e.createElement("div",{className:r("point-cloud-3d-content")},e.createElement(v.Provider,{value:g},e.createElement(q,null)),e.createElement("div",{className:r("point-cloud-3d-view"),id:U,ref:m})))};var H=R(k,null,null,{context:O})(G);export{H as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloud3DView.js","sources":["../../../src/components/pointCloudView/PointCloud3DView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-13 19:31:36\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-06-27 19:43:25\n */\n\nimport { getClassName } from '@/utils/dom';\nimport { PointCloud } from '@labelbee/lb-annotation';\nimport { EPerspectiveView, IPointCloudBox, PointCloudUtils } from '@labelbee/lb-utils';\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { PointCloudContext } from './PointCloudContext';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { jsonParser } from '@/utils';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { Switch } from 'antd';\nimport useSize from '@/hooks/useSize';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst pointCloudID = 'LABELBEE-POINTCLOUD';\nconst PointCloud3DContext = React.createContext<{\n isActive: boolean;\n setTarget3DView: (perspectiveView: EPerspectiveView) => void;\n reset3DView: () => void;\n}>({\n isActive: false,\n setTarget3DView: () => {},\n reset3DView: () => {},\n});\n\nconst PointCloudViewIcon = ({\n perspectiveView,\n}: {\n perspectiveView: keyof typeof EPerspectiveView;\n}) => {\n const { isActive, setTarget3DView } = useContext(PointCloud3DContext);\n\n const getTarget3DViewClassName = (position: string) => {\n return classNames({\n [getClassName('point-cloud-3d-view', position)]: true,\n active: isActive,\n });\n };\n\n return (\n <span\n onClick={() => {\n setTarget3DView(EPerspectiveView[perspectiveView]);\n }}\n className={getTarget3DViewClassName(perspectiveView.toLocaleLowerCase())}\n />\n );\n};\n\nconst PointCloud3DSideBar = () => {\n const { reset3DView } = useContext(PointCloud3DContext);\n return (\n <div className={getClassName('point-cloud-3d-sidebar')}>\n <PointCloudViewIcon perspectiveView='Top' />\n <PointCloudViewIcon perspectiveView='Front' />\n <PointCloudViewIcon perspectiveView='Left' />\n <PointCloudViewIcon perspectiveView='Back' />\n <PointCloudViewIcon perspectiveView='Right' />\n <PointCloudViewIcon perspectiveView='LFT' />\n <PointCloudViewIcon perspectiveView='RBT' />\n <span\n onClick={() => {\n reset3DView();\n }}\n className={getClassName('point-cloud-3d-view', 'reset')}\n />\n </div>\n );\n};\n\nconst PointCloud3D: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ptCtx = useContext(PointCloudContext);\n const [showDirection, setShowDirection] = useState(true);\n const ref = useRef<HTMLDivElement>(null);\n const { initPointCloud3d } = usePointCloudViews();\n const size = useSize(ref);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!ptCtx.mainViewInstance) {\n return;\n }\n initPointCloud3d?.();\n }, [size]);\n const { selectedBox } = useSingleBox();\n\n const setTarget3DView = (perspectiveView: EPerspectiveView) => {\n const box = selectedBox?.info;\n\n if (box) {\n ptCtx.mainViewInstance?.updateCameraByBox(box, perspectiveView);\n }\n };\n\n const reset3DView = () => {\n ptCtx.mainViewInstance?.resetCamera();\n };\n\n useEffect(() => {\n if (ref.current && currentData?.url) {\n let pointCloud = ptCtx.mainViewInstance;\n if (!pointCloud) {\n pointCloud = new PointCloud({\n container: ref.current,\n backgroundColor: '#4c4c4c',\n });\n }\n\n if (currentData.result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n pointCloud?.generateBox(v);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n ptCtx.setPointCloudValid(jsonParser(currentData.result)?.valid);\n }\n\n ptCtx.setMainViewInstance(pointCloud);\n }\n }, [currentData]);\n\n /**\n * Observe selectedID and reset camera to target top-view\n */\n useEffect(() => {\n if (selectedBox) {\n setTarget3DView(EPerspectiveView.Top);\n }\n }, [selectedBox]);\n\n const ptCloud3DCtx = useMemo(() => {\n return { reset3DView, setTarget3DView, isActive: !!selectedBox };\n }, [selectedBox]);\n\n const PointCloud3DTitle = (\n <div>\n <span style={{ marginRight: 8 }}>{t('ShowArrows')}</span>\n <Switch\n size='small'\n checked={showDirection}\n onChange={(showDirection) => {\n setShowDirection(showDirection);\n ptCtx.mainViewInstance?.setShowDirection(showDirection);\n }}\n />\n </div>\n );\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-3d-container')}\n title={t('3DView')}\n toolbar={PointCloud3DTitle}\n style={{\n height:\n currentData.mappingImgList && currentData.mappingImgList?.length > 0 ? '55%' : '100%',\n }}\n >\n <div className={getClassName('point-cloud-3d-content')}>\n <PointCloud3DContext.Provider value={ptCloud3DCtx}>\n <PointCloud3DSideBar />\n </PointCloud3DContext.Provider>\n <div className={getClassName('point-cloud-3d-view')} id={pointCloudID} ref={ref} />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(PointCloud3D);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAM,YAAe,GAAA,qBAAA,CAAA;AACrB,MAAM,mBAAA,GAAsB,MAAM,aAI/B,CAAA;AAAA,EACD,QAAU,EAAA,KAAA;AAAA,EACV,iBAAiB,MAAM;AAAA,GAAA;AAAA,EACvB,aAAa,MAAM;AAAA,GAAA;AAAA,CAAA,CAAA,CAAA;AAGrB,MAAM,qBAAqB,CAAC;AAAA,EAC1B,eAAA;AAAA,CAGI,KAAA;AACJ,EAAM,MAAA,CAAE,QAAU,EAAA,eAAA,CAAA,GAAoB,UAAW,CAAA,mBAAA,CAAA,CAAA;AAEjD,EAAM,MAAA,wBAAA,GAA2B,CAAC,QAAqB,KAAA;AACrD,IAAA,OAAO,UAAW,CAAA;AA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,IAAK,WAAW,YAAa,CAAA,wBAAA,CAAA;AAAA,GAC3B,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAoB,QAArB,EAAA;AAAA,IAA8B,KAAO,EAAA,YAAA;AAAA,GAAA,kBAClC,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAD,IAEF,CAAA,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAD,EAAA;AAAA,IAAK,WAAW,YAAa,CAAA,qBAAA,CAAA;AAAA,IAAwB,EAAI,EAAA,YAAA;AAAA,IAAc,GAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAM/E,uBAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,YAAA,CAAA;;;;"}
@@ -0,0 +1 @@
1
+ import{PointCloudAnnotation as N,MathUtils as f}from"@labelbee/lb-annotation";import{getClassName as x}from"../../utils/dom.js";import{PointCloudContainer as M}from"./PointCloudLayout.js";import u,{useRef as X,useEffect as C}from"react";import{PointCloudContext as A}from"./PointCloudContext.js";import{useSingleBox as D}from"./hooks/useSingleBox.js";import{EPerspectiveView as T}from"@labelbee/lb-utils";import{SizeInfoForView as W}from"./PointCloudInfos.js";import{connect as H}from"react-redux";import{aMapStateToProps as Y}from"../../store/annotation/map.js";import{synchronizeTopView as F,synchronizeSideView as R}from"./hooks/usePointCloudViews.js";import U from"../../hooks/useSize.js";import Z from"./components/EmptyPage/index.js";import{useTranslation as q}from"react-i18next";import{LabelBeeContext as G}from"../../store/ctx.js";var J=Object.defineProperty,K=Object.defineProperties,Q=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,O=(o,e,t)=>e in o?J(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,te=(o,e)=>{for(var t in e||(e={}))$.call(e,t)&&O(o,t,e[t]);if(B)for(var t of B(e))ee.call(e,t)&&O(o,t,e[t]);return o},oe=(o,e)=>K(o,Q(e));const ne=(o,e,t=1)=>{const{width:n,height:s}=e,c={x:o.x+n*t/2,y:o.y+s*t/2},d={x:e.width/2,y:e.height/2};return{offsetX:(d.x-c.x)/t,offsetY:-(d.y-c.y)/t}},_=(o,e,t,n,s)=>{const{offsetX:c,offsetY:d}=ne(o,t,e);if(s.camera.zoom=e,o){const r=Math.cos(n.rotation),l=Math.sin(n.rotation),a=c*r,p=c*l,{x:m,y:P,z:g}=s.initCameraPosition;s.camera.position.set(m+p,P-a,g+d)}s.camera.updateProjectionMatrix(),s.render()},ie=({currentData:o})=>{const e=u.useContext(A),t=X(null),n=U(t),{updateSelectedBox:s,selectedBox:c}=D(),{t:d}=q();return C(()=>{if(t.current){const r={width:t.current.clientWidth,height:t.current.clientHeight},l=new N({container:t.current,size:r,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0}});e.setBackViewInstance(l)}},[]),C(()=>{if(!n||!e.backViewInstance)return;const{pointCloud2dOperation:r,pointCloudInstance:l}=e.backViewInstance;r.singleOn("renderZoom",(a,p)=>{!e.selectedPointCloudBox||_(p,a,n,e.selectedPointCloudBox,l)}),r.singleOn("dragMove",({currentPos:a,zoom:p})=>{!e.selectedPointCloudBox||_(a,p,n,e.selectedPointCloudBox,l)}),r.singleOn("updatePolygonByDrag",({newPolygon:a,originPolygon:p})=>{if(!e.selectedPointCloudBox||!e.mainViewInstance||!o.url)return;const[m,P,g]=a.pointList,[y,v,V]=p.pointList,w=f.getLineCenterPoint([m,g]),h=f.getLineCenterPoint([y,V]),I={x:{x:w.x-h.x,y:w.y-h.y}.x,y:0,z:w.y-h.y},b=f.getLineLength(m,P),L=f.getLineLength(y,v),j=b-L,S=f.getLineLength(P,g),E=f.getLineLength(v,V),k=S-E;let{newBoxParams:i}=l.getNewBoxByBackUpdate(I,k,j,e.selectedPointCloudBox);if(e.mainViewInstance){const{count:z}=e.mainViewInstance.getSensesPointZAxisInPolygon(e.mainViewInstance.getCuboidFromPointCloudBox(i).polygonPointList,[i.center.z-i.depth/2,i.center.z+i.depth/2]);i=oe(te({},i),{count:z})}F(i,a,e.topViewInstance,e.mainViewInstance),R(i,a,e.sideViewInstance,o.url),e.mainViewInstance.highlightOriginPointCloud(i),s(i)})},[e,n]),C(()=>{var r;(r=e==null?void 0:e.backViewInstance)==null||r.initSize(n)},[n]),u.createElement(M,{className:x("point-cloud-container","back-view"),title:d("BackView"),toolbar:u.createElement(W,{perspectiveView:T.Back})},u.createElement("div",{className:x("point-cloud-container","bottom-view-content")},u.createElement("div",{className:x("point-cloud-container","core-instance"),ref:t}),!c&&u.createElement(Z,null)))};var re=H(Y,null,null,{context:G})(ie);export{re as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudBackView.js","sources":["../../../src/components/pointCloudView/PointCloudBackView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-07-08 11:08:02\n */\nimport { PointCloud, MathUtils, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { EPerspectiveView, IPointCloudBox, IPolygonPoint } from '@labelbee/lb-utils';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { synchronizeSideView, synchronizeTopView } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport EmptyPage from './components/EmptyPage';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\n/**\n * 统一一下,将其拓展为 二维转换为 三维坐标的转换\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\nconst updateBackViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n backPointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n backPointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = backPointCloud.initCameraPosition;\n backPointCloud.camera.position.set(x + offsetXY, y - offsetXX, z + offsetY);\n }\n backPointCloud.camera.updateProjectionMatrix();\n backPointCloud.render();\n};\n\nconst PointCloudSideView = ({ currentData }: IAnnotationStateProps) => {\n const ptCtx = React.useContext(PointCloudContext);\n const ref = useRef<HTMLDivElement>(null);\n const size = useSize(ref);\n const { updateSelectedBox, selectedBox } = useSingleBox();\n const { t } = useTranslation();\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n polygonOperationProps: { showDirectionLine: false, forbidAddNew: true },\n });\n ptCtx.setBackViewInstance(pointCloudAnnotation);\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.backViewInstance) {\n return;\n }\n\n const {\n pointCloud2dOperation: backPointCloudPolygonOperation,\n pointCloudInstance: backPointCloud,\n } = ptCtx.backViewInstance;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n backPointCloudPolygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n // Synchronized 3d point cloud view displacement operations\n backPointCloudPolygonOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n backPointCloudPolygonOperation.singleOn(\n 'updatePolygonByDrag',\n ({ newPolygon, originPolygon }: any) => {\n if (!ptCtx.selectedPointCloudBox || !ptCtx.mainViewInstance || !currentData.url) {\n return;\n }\n\n // Notice. The sort of polygon is important.\n const [point1, point2, point3] = newPolygon.pointList;\n const [op1, op2, op3] = originPolygon.pointList;\n\n // 2D centerPoint => 3D x & z\n const newCenterPoint = MathUtils.getLineCenterPoint([point1, point3]);\n const oldCenterPoint = MathUtils.getLineCenterPoint([op1, op3]);\n\n const offset = {\n x: newCenterPoint.x - oldCenterPoint.x,\n y: newCenterPoint.y - oldCenterPoint.y,\n };\n\n const offsetCenterPoint = {\n x: offset.x,\n y: 0, // Not be used.\n z: newCenterPoint.y - oldCenterPoint.y,\n };\n\n // 2D height => 3D depth\n const height = MathUtils.getLineLength(point1, point2);\n const oldHeight = MathUtils.getLineLength(op1, op2);\n const offsetHeight = height - oldHeight; // 3D depth\n\n // 2D width => 3D width\n const width = MathUtils.getLineLength(point2, point3);\n const oldWidth = MathUtils.getLineLength(op2, op3);\n const offsetWidth = width - oldWidth; // 3D width\n\n let { newBoxParams } = backPointCloud.getNewBoxByBackUpdate(\n offsetCenterPoint,\n offsetWidth,\n offsetHeight,\n ptCtx.selectedPointCloudBox,\n );\n\n // Update count\n if (ptCtx.mainViewInstance) {\n const { count } = ptCtx.mainViewInstance.getSensesPointZAxisInPolygon(\n ptCtx.mainViewInstance.getCuboidFromPointCloudBox(newBoxParams)\n .polygonPointList as IPolygonPoint[],\n [\n newBoxParams.center.z - newBoxParams.depth / 2,\n newBoxParams.center.z + newBoxParams.depth / 2,\n ],\n );\n\n newBoxParams = {\n ...newBoxParams,\n count,\n };\n }\n\n synchronizeTopView(newBoxParams, newPolygon, ptCtx.topViewInstance, ptCtx.mainViewInstance);\n synchronizeSideView(newBoxParams, newPolygon, ptCtx.sideViewInstance, currentData.url);\n ptCtx.mainViewInstance.highlightOriginPointCloud(newBoxParams);\n updateSelectedBox(newBoxParams);\n },\n );\n }, [ptCtx, size]);\n\n useEffect(() => {\n // Update Size\n ptCtx?.backViewInstance?.initSize(size);\n }, [size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'back-view')}\n title={t('BackView')}\n toolbar={<SizeInfoForView perspectiveView={EPerspectiveView.Back} />}\n >\n <div className={getClassName('point-cloud-container', 'bottom-view-content')}>\n <div className={getClassName('point-cloud-container', 'core-instance')} ref={ref} />\n {!selectedBox && <EmptyPage />}\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudSideView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CA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ACvE,CAAA,EAAA,CAAC,WAAe,oBAAA,KAAA,CAAA,aAAA,CAAC,SAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAMzB,yBAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,kBAAA,CAAA;;;;"}
@@ -0,0 +1 @@
1
+ import w,{useState as t,useMemo as P}from"react";const p=w.createContext({pointCloudBoxList:[],polygonList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>{},setPolygonList:()=>{},zoom:1,setZoom:()=>{}}),R=({children:x})=>{const[s,c]=t([]),[d,f]=t([]),[o,i]=t([]),[l,m]=t(!0),[a,S]=t(1),[r,B]=t(),[u,y]=t(),[I,g]=t(),[V,v]=t(),C=P(()=>o.length===1?o[0]:"",[o]),A=P(()=>{const L=s.find(e=>e.id===C),D=e=>{c(s.concat(e))},k=e=>{m(e!==!1)},n=e=>{e===void 0&&i([]),typeof e=="string"&&i([e]),Array.isArray(e)&&i(Array.from(new Set(e)))};return{selectedID:C,pointCloudBoxList:s,selectedIDs:o,setPointCloudResult:c,setSelectedIDs:n,addPointCloudBox:D,valid:l,selectedPointCloudBox:L,setPointCloudValid:k,addSelectedID:e=>{o.includes(e)?n(o.filter(M=>M!==e)):n([...o,e])},selectedAllBoxes:()=>{n(s.map(e=>e.id))},topViewInstance:r,setTopViewInstance:B,sideViewInstance:u,setSideViewInstance:y,backViewInstance:I,setBackViewInstance:g,mainViewInstance:V,setMainViewInstance:v,polygonList:d,setPolygonList:f,zoom:a,setZoom:S}},[l,o,s,d,r,u,I,V,a]);return w.createElement(p.Provider,{value:A},x)};export{p as PointCloudContext,R as PointCloudProvider};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudContext.js","sources":["../../../src/components/pointCloudView/PointCloudContext.tsx"],"sourcesContent":["import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport React, { useMemo, useState } from 'react';\n\ninterface IPointCloudContextInstances {\n topViewInstance?: PointCloudAnnotation;\n sideViewInstance?: PointCloudAnnotation;\n backViewInstance?: PointCloudAnnotation;\n mainViewInstance?: PointCloud;\n setTopViewInstance: (instance: PointCloudAnnotation) => void;\n setSideViewInstance: (instance: PointCloudAnnotation) => void;\n setBackViewInstance: (instance: PointCloudAnnotation) => void;\n setMainViewInstance: (instance: PointCloud) => void;\n}\n\nexport interface IPointCloudContext extends IPointCloudContextInstances {\n pointCloudBoxList: IPointCloudBoxList;\n selectedIDs: string[];\n setSelectedIDs: (ids?: string[] | string) => void;\n valid: boolean;\n setPointCloudResult: (resultList: IPointCloudBoxList) => void;\n selectedPointCloudBox?: IPointCloudBox;\n setPointCloudValid: (valid?: boolean) => void;\n addSelectedID: (selectedID: string) => void;\n selectedAllBoxes: () => void;\n selectedID: string;\n addPointCloudBox: (boxParams: IPointCloudBox) => void;\n\n polygonList: IPolygonData[];\n setPolygonList: (polygonList: IPolygonData[]) => void;\n\n zoom: number;\n setZoom: (zoom: number) => void;\n}\n\nexport const PointCloudContext = React.createContext<IPointCloudContext>({\n pointCloudBoxList: [],\n polygonList: [],\n selectedID: '',\n selectedIDs: [],\n valid: true,\n setSelectedIDs: () => {},\n setPointCloudResult: () => {},\n setPointCloudValid: () => {},\n setTopViewInstance: () => {},\n setSideViewInstance: () => {},\n setBackViewInstance: () => {},\n setMainViewInstance: () => {},\n addSelectedID: () => {},\n selectedAllBoxes: () => {},\n addPointCloudBox: () => {},\n setPolygonList: () => {},\n\n zoom: 1,\n setZoom: () => {},\n});\n\nexport const PointCloudProvider: React.FC<{}> = ({ children }) => {\n const [pointCloudBoxList, setPointCloudResult] = useState<IPointCloudBoxList>([]);\n const [polygonList, setPolygonList] = useState<IPolygonData[]>([]);\n const [selectedIDs, setSelectedIDsState] = useState<string[]>([]);\n const [valid, setValid] = useState<boolean>(true);\n const [zoom, setZoom] = useState<number>(1);\n const [topViewInstance, setTopViewInstance] = useState<PointCloudAnnotation>();\n const [sideViewInstance, setSideViewInstance] = useState<PointCloudAnnotation>();\n const [backViewInstance, setBackViewInstance] = useState<PointCloudAnnotation>();\n const [mainViewInstance, setMainViewInstance] = useState<PointCloud>();\n\n const selectedID = useMemo(() => {\n return selectedIDs.length === 1 ? selectedIDs[0] : '';\n }, [selectedIDs]);\n\n const ptCtx = useMemo(() => {\n const selectedPointCloudBox = pointCloudBoxList.find((v) => v.id === selectedID);\n\n const addPointCloudBox = (box: IPointCloudBox) => {\n setPointCloudResult(pointCloudBoxList.concat(box));\n };\n\n const setPointCloudValid = (valid?: boolean) => {\n setValid(valid === false ? false : true);\n };\n\n const setSelectedIDs = (selectedIDs?: string[] | string) => {\n if (selectedIDs === undefined) {\n setSelectedIDsState([]);\n }\n\n if (typeof selectedIDs === 'string') {\n setSelectedIDsState([selectedIDs]);\n }\n\n if (Array.isArray(selectedIDs)) {\n setSelectedIDsState(Array.from(new Set(selectedIDs)));\n }\n };\n\n /**\n * If selectedID existed, remove selectedID from selectedIDs\n * If selectedID not existed, add selectedID to selectedIDs\n * @param selectedID\n */\n const addSelectedID = (selectedID: string) => {\n if (selectedIDs.includes(selectedID)) {\n setSelectedIDs(selectedIDs.filter((i) => i !== selectedID));\n } else {\n setSelectedIDs([...selectedIDs, selectedID]);\n }\n };\n\n const selectedAllBoxes = () => {\n setSelectedIDs(pointCloudBoxList.map((i) => i.id));\n };\n\n return {\n selectedID,\n pointCloudBoxList,\n selectedIDs,\n setPointCloudResult,\n setSelectedIDs,\n addPointCloudBox,\n valid,\n selectedPointCloudBox,\n setPointCloudValid,\n addSelectedID,\n selectedAllBoxes,\n topViewInstance,\n setTopViewInstance,\n sideViewInstance,\n setSideViewInstance,\n backViewInstance,\n setBackViewInstance,\n mainViewInstance,\n setMainViewInstance,\n polygonList,\n setPolygonList,\n zoom,\n setZoom,\n };\n }, [\n valid,\n selectedIDs,\n pointCloudBoxList,\n polygonList,\n topViewInstance,\n sideViewInstance,\n backViewInstance,\n mainViewInstance,\n zoom,\n ]);\n\n return <PointCloudContext.Provider value={ptCtx}>{children}</PointCloudContext.Provider>;\n};\n"],"names":[],"mappings":";;AAmCa,MAAA,iBAAA,GAAoB,MAAM,aAAkC,CAAA;AAAA,EACvE,iBAAmB,EAAA,EAAA;AAAA,EACnB,WAAa,EAAA,EAAA;AAAA,EACb,UAAY,EAAA,EAAA;AAAA,EACZ,WAAa,EAAA,EAAA;AAAA,EACb,KAAO,EAAA,IAAA;AAAA,EACP,gBAAgB,MAAM;AAAA,GAAA;AAAA,EACtB,qBAAqB,MAAM;AAAA,GAAA;AAAA,EAC3B,oBAAoB,MAAM;AAAA,GAAA;AAAA,EAC1B,oBAAoB,MAAM;AAAA,GAAA;AAAA,EAC1B,qBAAqB,MAAM;AAAA,GAAA;AAAA,EAC3B,qBAAqB,MAAM;AAAA,GAAA;AAAA,EAC3B,qBAAqB,MAAM;AAAA,GAAA;AAAA,EAC3B,eAAe,MAAM;AAAA,GAAA;AAAA,EACrB,kBAAkB,MAAM;AAAA,GAAA;AAAA,EACxB,kBAAkB,MAAM;AAAA,GAAA;AAAA,EACxB,gBAAgB,MAAM;AAAA,GAAA;AAAA,EAEtB,IAAM,EAAA,CAAA;AAAA,EACN,SAAS,MAAM;AAAA,GAAA;AAAA,CAAA,EAAA;AAGJ,MAAA,kBAAA,GAAmC,CAAC,CAAE,QAAe,CAAA,KAAA;AAChE,EAAM,MAAA,CAAC,iBAAmB,EAAA,mBAAA,CAAA,GAAuB,QAA6B,CAAA,EAAA,CAAA,CAAA;AAC9E,EAAM,MAAA,CAAC,WAAa,EAAA,cAAA,CAAA,GAAkB,QAAyB,CAAA,E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MACA,gBAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAA;AAAA,KAAA,CAAA;AAAA,GAED,EAAA;AAAA,IACD,KAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,IAAA;AAAA,GAAA,CAAA,CAAA;AAGF,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,kBAAkB,QAAnB,EAAA;AAAA,IAA4B,KAAO,EAAA,KAAA;AAAA,GAAQ,EAAA,QAAA,CAAA,CAAA;AAAA;;;;"}
@@ -0,0 +1 @@
1
+ import{PointCloudUtils as h,EPerspectiveView as v}from"@labelbee/lb-utils";import o,{useState as C,useEffect as B}from"react";import{PointCloudContext as g}from"./PointCloudContext.js";import{UnitUtils as y}from"@labelbee/lb-annotation";import{useSingleBox as E}from"./hooks/useSingleBox.js";import{useTranslation as m}from"react-i18next";const r=2,I=({perspectiveView:l})=>{const{pointCloudBoxList:e,selectedID:s}=o.useContext(g),i=e.find(a=>a.id===s),f=m(),{t}=f;if(s&&i){const{length:a,width:n,height:u}=h.transferBox2Kitti(i),x=l===v.Back?[{label:t("Width"),value:n},{label:t("Height"),value:u}]:[{label:t("Length"),value:a},{label:t("Height"),value:u}];return o.createElement(o.Fragment,null,x.map((c,d)=>o.createElement("span",{key:d,style:{marginRight:d===0?16:0,fontSize:12}},`${c.label}: ${c.value.toFixed(r)}`)))}return null},P=()=>{const l=o.useContext(g),{selectedBox:e}=E(),[s,i]=C([]),f=m(),{t,i18n:a}=f;return B(()=>{var n;if(!e)return;const{length:u,width:x,height:c,rotation_y:d}=h.transferBox2Kitti(e.info);let b=[{label:t("Length"),value:u.toFixed(r)},{label:t("Width"),value:x.toFixed(r)},{label:t("Height"),value:c.toFixed(r)},{label:t("Rotation_y"),value:y.rad2deg(d).toFixed(r)}];(n=l.mainViewInstance)==null||n.filterPointsByBox(e.info).then(p=>{if(!p){i(b);return}b.push({label:t("PointCount"),value:`${p.num}`}),i(b)})},[e,a.language]),e?o.createElement("div",{style:{position:"absolute",color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",right:8,top:8,fontSize:12,padding:8,zIndex:20}},s.map(n=>o.createElement("div",{key:n.label},`${n.label}: ${n.value}`))):null},S=()=>{const l=o.useContext(g),{t:e}=m();return l.valid===!1?o.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",left:0,top:0,fontSize:20,padding:"8px 16px",zIndex:20}},e("Invalid")):null};export{P as BoxInfos,S as PointCloudValidity,I as SizeInfoForView};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudInfos.js","sources":["../../../src/components/pointCloudView/PointCloudInfos.tsx"],"sourcesContent":["/**\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @file Display selected box's infos\n * @createdate 2022-07-13\n */\n\nimport { EPerspectiveView, PointCloudUtils } from '@labelbee/lb-utils';\nimport React, { useEffect, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { UnitUtils } from '@labelbee/lb-annotation';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\n\nconst DECIMAL_PLACES = 2;\n\n/**\n * Display size info for views\n * @param param0\n * @returns\n */\nexport const SizeInfoForView = ({ perspectiveView }: { perspectiveView: EPerspectiveView }) => {\n const { pointCloudBoxList, selectedID } = React.useContext(PointCloudContext);\n const box = pointCloudBoxList.find((i) => i.id === selectedID);\n const trans = useTranslation();\n const { t } = trans;\n\n if (selectedID && box) {\n const { length, width, height } = PointCloudUtils.transferBox2Kitti(box);\n const infos =\n perspectiveView === EPerspectiveView.Back\n ? [\n {\n label: t('Width'),\n value: width,\n },\n {\n label: t('Height'),\n value: height,\n },\n ]\n : [\n {\n label: t('Length'),\n value: length,\n },\n {\n label: t('Height'),\n value: height,\n },\n ];\n\n return (\n <>\n {infos.map((info, index) => (\n <span key={index} style={{ marginRight: index === 0 ? 16 : 0, fontSize: 12 }}>{`${\n info.label\n }: ${info.value.toFixed(DECIMAL_PLACES)}`}</span>\n ))}\n </>\n );\n }\n return null;\n};\n\n/**\n * Display selected box's infos\n */\nexport const BoxInfos = () => {\n const ptCtx = React.useContext(PointCloudContext);\n const { selectedBox } = useSingleBox();\n const [infos, setInfos] = useState<Array<{ label: string; value: string }>>([]);\n const trans = useTranslation();\n const { t, i18n } = trans;\n\n useEffect(() => {\n if (!selectedBox) {\n return;\n }\n\n const { length, width, height, rotation_y } = PointCloudUtils.transferBox2Kitti(\n selectedBox.info,\n );\n\n let infos = [\n {\n label: t('Length'),\n value: length.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Width'),\n value: width.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Height'),\n value: height.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Rotation_y'),\n value: UnitUtils.rad2deg(rotation_y).toFixed(DECIMAL_PLACES),\n },\n ];\n\n // Get Point Count.\n ptCtx.mainViewInstance?.filterPointsByBox(selectedBox.info).then((data) => {\n if (!data) {\n setInfos(infos);\n return;\n }\n\n infos.push({\n label: t('PointCount'),\n value: `${data.num}`,\n });\n setInfos(infos);\n });\n }, [selectedBox, i18n.language]);\n\n if (selectedBox) {\n return (\n <div\n style={{\n position: 'absolute',\n color: 'white',\n backgroundColor: 'rgba(153, 153, 153, 0.3)',\n right: 8,\n top: 8,\n fontSize: 12,\n padding: 8,\n zIndex: 20,\n }}\n >\n {infos.map((i) => (\n <div key={i.label}>{`${i.label}: ${i.value}`}</div>\n ))}\n </div>\n );\n }\n\n return null;\n};\n\nexport const PointCloudValidity = () => {\n const ptCtx = React.useContext(PointCloudContext);\n const { t } = useTranslation();\n\n if (ptCtx.valid === false) {\n return (\n <div\n style={{\n position: 'absolute',\n backgroundColor: 'rgb(242, 101, 73)',\n color: 'white',\n left: 0,\n top: 0,\n fontS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AAE,CAAA,KAAA;AAAA,KAAQ,EAAA,CAAA,EAAG,CAAE,CAAA,KAAA,CAAA,EAAA,EAAU,CAAE,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAM7C,EAAO,OAAA,IAAA,CAAA;AAAA,EAAA;AAGF,MAAM,qBAAqB,MAAM;AACtC,EAAM,MAAA,KAAA,GAAQ,MAAM,UAAW,CAAA,iBAAA,CAAA,CAAA;AAC/B,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAI,IAAA,KAAA,CAAM,UAAU,KAAO,EAAA;AACzB,IAAA,2CACG,KAAD,EAAA;AAAA,MACE,KAAO,EAAA;AAAA,QACL,QAAU,EAAA,UAAA;AAAA,QACV,eAAiB,EAAA,mBAAA;AAAA,QACjB,KAAO,EAAA,OAAA;AAAA,QACP,IAAM,EAAA,CAAA;AAAA,QACN,GAAK,EAAA,CAAA;AAAA,QACL,QAAU,EAAA,EAAA;AAAA,QACV,OAAS,EAAA,UAAA;AAAA,QACT,MAAQ,EAAA,EAAA;AAAA,OAAA;AAAA,KAAA,EAGT,CAAE,CAAA,SAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAIT,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- import{getClassName as t}from"../../utils/dom.js";import a from"classnames";import e from"react";const c=({title:l,toolbar:n,children:r,className:o})=>(console.log(a([o,t("point-cloud-container")])),e.createElement("div",{className:a([o,t("point-cloud-container")])},e.createElement("div",{className:t("point-cloud-container","header")},e.createElement("span",null,l),n&&e.createElement("span",null,n)),e.createElement("div",null,r)));export{c as PointCloudContainer};
1
+ import{getClassName as e}from"../../utils/dom.js";import s from"classnames";import t from"react";const i=({title:o,toolbar:a,children:n,className:r,style:c})=>t.createElement("div",{className:s([r,e("point-cloud-container")]),style:c},t.createElement("div",{className:e("point-cloud-container","header")},t.createElement("span",{className:e("point-cloud-container","header-title")},o),a&&t.createElement("div",{className:e("point-cloud-container","header-toolbar")},a)),n);export{i as PointCloudContainer};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudLayout.js","sources":["../../../src/components/pointCloudView/PointCloudLayout.tsx"],"sourcesContent":["import { getClassName } from '@/utils/dom';\nimport classNames from 'classnames';\nimport React from 'react';\n\nexport const PointCloudContainer: React.FC<{\n title: string;\n toolbar?: React.ReactElement;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ title, toolbar, children, className, style }) => {\n return (\n <div className={classNames([className, getClassName('point-cloud-container')])} style={style}>\n <div className={getClassName('point-cloud-container', 'header')}>\n <span className={getClassName('point-cloud-container', 'header-title')}>{title}</span>\n\n {toolbar && (\n <div className={getClassName('point-cloud-container', 'header-toolbar')}>{toolbar}</div>\n )}\n </div>\n\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,sBAKR,CAAC,CAAE,OAAO,OAAS,EAAA,QAAA,EAAU,WAAW,KAAY,CAAA,KAAA;AACvD,EAAA,2CACG,KAAD,EAAA;AAAA,IAAK,SAAW,EAAA,UAAA,CAAW,CAAC,SAAA,EAAW,YAAa,CAAA,uBAAA,CAAA,CAAA,CAAA;AAAA,IAA4B,KAAA;AAAA,GAAA,sCAC7E,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,QAAA,CAAA;AAAA,GAAA,sCACnD,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,aAAa,uBAAyB,EAAA,cAAA,CAAA;AAAA,GAAkB,EAAA,KAAA,CAAA,EAExE,OACC,oBAAA,KAAA,CAAA,aAAA,CAAC,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,gBAAA,CAAA;AAAA,GAAA,EAAoB,OAI7E,CAAA,CAAA,EAAA,QAAA,CAAA,CAAA;AAAA;;;;"}
@@ -0,0 +1 @@
1
+ import{PointCloudContext as O}from"./PointCloudContext.js";import{useRotate as j}from"./hooks/useRotate.js";import{useBoxes as h}from"./hooks/useBoxes.js";import{useSingleBox as L}from"./hooks/useSingleBox.js";import{useContext as V,useEffect as u}from"react";import{cTool as I}from"@labelbee/lb-annotation";import{message as R}from"antd";import{connect as A}from"react-redux";import{aMapStateToProps as E}from"../../store/annotation/map.js";import{useCustomToolInstance as N}from"../../hooks/annotation.js";import{useStatus as D}from"./hooks/useStatus.js";import{jsonParser as T}from"../../utils/index.js";import{usePointCloudViews as K}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as z}from"../../store/ctx.js";var $=Object.defineProperty,q=Object.defineProperties,G=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,v=(o,e,r)=>e in o?$(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,F=(o,e)=>{for(var r in e||(e={}))M.call(e,r)&&v(o,r,e[r]);if(b)for(var r of b(e))Y.call(e,r)&&v(o,r,e[r]);return o},H=(o,e)=>q(o,G(e));const{EPolygonPattern:i}=I,J=({currentData:o})=>{const e=V(O),{changeSelectedBoxValid:r,selectNextBox:x,selectPrevBox:w,updateSelectedBox:p}=L(),{clearAllResult:m}=D(),C=T(o.result),{copySelectedBoxes:y,pasteSelectedBoxes:k,copiedBoxes:_}=h(),{toolInstanceRef:a}=N({basicInfo:C}),{updateRotate:d}=j({currentData:o}),{updatePointCloudData:f}=K(),B=t=>{const{topViewInstance:s,mainViewInstance:l}=e;if(!s)return;const{pointCloud2dOperation:n}=s;switch(t){case"q":{d(2);break}case"e":d(-2);break;case"g":d(180);break;case"u":{const c=n.pattern===i.Normal?i.Rect:i.Normal;n.setPattern(c);const S={[i.Normal]:"Normal Pattern",[i.Rect]:"Rect Pattern"};R.success(`Change Pattern to ${S[c]} successfully`),n.clearActiveStatus(),n.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize(!0);break;case"-":l==null||l.updatePointSize(!1);break;case"v":e.setPointCloudValid(!e.valid);break;case"z":x();break;case"c":w();break;case"f":r();break;default:return}},g=t=>{switch(t){case"c":y();break;case"v":k();break;case"a":e.selectedAllBoxes();break}},P=t=>{const s=t.key.toLocaleLowerCase();if(t.ctrlKey){g(s);return}B(s)};return u(()=>{const{topViewInstance:t}=e;if(!!t)return window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P)}},[e,_]),u(()=>{f==null||f()},[o,e.mainViewInstance]),u(()=>{a.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],a.current.exportCustomData=()=>{var t;return{renderPolygon:(t=e.polygonList)!=null?t:[]}},a.current.setDefaultAttribute=t=>{const s=e.selectedPointCloudBox;s&&(s.attribute=t,p(s))},a.current.setSubAttribute=(t,s)=>{var l;const n=e.selectedPointCloudBox;if(n){const c=(l=n==null?void 0:n.subAttribute)!=null?l:{};n.subAttribute=H(F({},c),{[t]:s}),p(n)}},a.current.clearResult=()=>{m==null||m()}},[e.pointCloudBoxList,e.selectedID,e.valid,e.polygonList]),u(()=>{a.current.setValid=t=>{a.current.valid=t,setTimeout(()=>{e.setPointCloudValid(t)})}},[]),null};var Q=A(E,null,null,{context:z})(J);export{Q as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudListener.js","sources":["../../../src/components/pointCloudView/PointCloudListener.tsx"],"sourcesContent":["import { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useBoxes } from './hooks/useBoxes';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport React, { useContext, useEffect } from 'react';\nimport { cTool } from '@labelbee/lb-annotation';\nimport { message } from 'antd';\nimport { connect } from 'react-redux';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { useCustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from './hooks/useStatus';\nimport { jsonParser } from '@/utils';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst { EPolygonPattern } = cTool;\n\nconst PointCloudListener: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ptCtx = useContext(PointCloudContext);\n const { changeSelectedBoxValid, selectNextBox, selectPrevBox, updateSelectedBox } =\n useSingleBox();\n const { clearAllResult } = useStatus();\n const basicInfo = jsonParser(currentData.result);\n const { copySelectedBoxes, pasteSelectedBoxes, copiedBoxes } = useBoxes();\n const { toolInstanceRef } = useCustomToolInstance({ basicInfo });\n const { updateRotate } = useRotate({ currentData });\n const { updatePointCloudData } = usePointCloudViews();\n\n const keydownEvents = (lowerCaseKey: string) => {\n const { topViewInstance, mainViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopPointCloudPolygonOperation } = topViewInstance;\n\n switch (lowerCaseKey) {\n case 'q': {\n // Q - anticlockwise\n updateRotate(2);\n break;\n }\n\n case 'e':\n // E - closewise\n updateRotate(-2);\n\n break;\n\n case 'g':\n // G , overturn 180\n updateRotate(180);\n\n break;\n\n case 'u':\n {\n // U , change TopOpereation Pattern\n const newPattern =\n TopPointCloudPolygonOperation.pattern === EPolygonPattern.Normal\n ? EPolygonPattern.Rect\n : EPolygonPattern.Normal;\n TopPointCloudPolygonOperation.setPattern(newPattern);\n const POLYGON_PATTERN = {\n [EPolygonPattern.Normal]: 'Normal Pattern',\n [EPolygonPattern.Rect]: 'Rect Pattern',\n };\n message.success(`Change Pattern to ${POLYGON_PATTERN[newPattern]} successfully`);\n\n // Clear Status\n TopPointCloudPolygonOperation.clearActiveStatus();\n TopPointCloudPolygonOperation.clearDrawingStatus();\n }\n\n break;\n\n // +: Increase points size\n case '+':\n mainViewInstance?.updatePointSize(true);\n break;\n\n // -: Reduce points size\n case '-':\n mainViewInstance?.updatePointSize(false);\n break;\n\n case 'v':\n ptCtx.setPointCloudValid(!ptCtx.valid);\n break;\n\n case 'z':\n selectNextBox();\n break;\n\n case 'c':\n selectPrevBox();\n break;\n\n case 'f':\n changeSelectedBoxValid();\n break;\n\n default: {\n return;\n }\n }\n };\n\n const ctrlKeydownEvents = (lowerCaseKey: string) => {\n switch (lowerCaseKey) {\n case 'c':\n copySelectedBoxes();\n break;\n case 'v':\n pasteSelectedBoxes();\n break;\n case 'a':\n ptCtx.selectedAllBoxes();\n break;\n default:\n break;\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n const lowerCaseKey = e.key.toLocaleLowerCase();\n\n if (e.ctrlKey) {\n ctrlKeydownEvents(lowerCaseKey);\n return;\n }\n\n keydownEvents(lowerCaseKey);\n };\n\n useEffect(() => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n window.addEventListener('keydown', onKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [ptCtx, copiedBoxes]);\n\n // Page switch data initialization\n useEffect(() => {\n updatePointCloudData?.();\n }, [currentData, ptCtx.mainViewInstance]);\n\n useEffect(() => {\n toolInstanceRef.current.exportData = () => {\n return [ptCtx.pointCloudBoxList, { valid: ptCtx.valid }];\n };\n\n toolInstanceRef.current.exportCustomData = () => {\n return {\n renderPolygon: ptCtx.polygonList ?? [],\n };\n };\n\n toolInstanceRef.current.setDefaultAttribute = (newAttribute: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n selectBox.attribute = newAttribute;\n\n updateSelectedBox(selectBox);\n }\n };\n\n toolInstanceRef.current.setSubAttribute = (key: string, value: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n const originSubAttribute = selectBox?.subAttribute ?? {};\n\n selectBox.subAttribute = {\n ...originSubAttribute,\n [key]: value,\n };\n\n updateSelectedBox(selectBox);\n }\n };\n toolInstanceRef.current.clearResult = () => {\n clearAllResult?.();\n };\n }, [ptCtx.pointCloudBoxList, ptCtx.selectedID, ptCtx.valid, ptCtx.polygonList]);\n\n useEffect(() => {\n toolInstanceRef.current.setValid = (valid: boolean) => {\n toolInstanceRef.current.valid = valid;\n\n // Avoid triggering SetState operations in the reducer phase\n setTimeout(() => {\n ptCtx.setPointCloudValid(valid);\n });\n };\n }, []);\n\n return null;\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudListener,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAE5B,MAAM,kBAAA,GAAsD,CAAC,CAAE,WAAkB,CAAA,KAAA;AAC/E,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAA,MAAM,CAAE,sBAAA,EAAwB,aAAe,EAAA,aAAA,EAAe,iBAC5D,CAAA,GAAA,YAAA,EAAA,CAAA;AACF,EAAA,MAAM,CAAE,cAAmB,CAAA,GAAA,SAAA,EAAA,CAAA;AAC3B,EAAM,MAAA,SAAA,GAAY,WAAW,WAAY,CAAA,MAAA,CAAA,CAAA;AACzC,EAAM,MAAA,CAAE,iBAAmB,EAAA,kBAAA,EAAoB,WAAgB,CAAA,GAAA,QAAA,EAAA,CAAA;AAC/D,EAAM,MAAA,CAAE,eAAoB,CAAA,GAAA,qBAAA,CAAsB,CAAE,SAAA,CAAA,CAAA,CAAA;AACpD,EAAM,MAAA,CAAE,YAAiB,CAAA,GAAA,SAAA,CAAU,CAAE,WAAA,CAAA,CAAA,CAAA;AACrC,EAAA,MAAM,CAAE,oBAAyB,CAAA,GAAA,kBAAA,EAAA,CAAA;AAEjC,EAAM,MAAA,aAAA,GAAgB,CAAC,YAAyB,KAAA;AAC9C,IAAM,MAAA,CAAE,iBAAiB,gBAAqB,CAAA,GAAA,KAAA,CAAA;AAC9C,IAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,MAAA,OAAA;AAAA,KAAA;AAGF,IAAM,MAAA,CAAE,uBAAuB,6BAAkC,CAAA,GAAA,eAAA,CAAA;AAEjE,IAAQ,QAAA,YAAA;AAAA,MAAA,KACD,GAAK,EAAA;AAER,QAAa,YAAA,CAAA,CAAA,C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A,CAAA;AAEtD,QAAU,SAAA,CAAA,YAAA,GAAe,iCACpB,kBADoB,CAAA,EAAA;AAAA,UAAA,CAEtB,GAAM,GAAA,KAAA;AAAA,SAAA,CAAA,CAAA;AAGT,QAAkB,iBAAA,CAAA,SAAA,CAAA,CAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAGtB,IAAgB,eAAA,CAAA,OAAA,CAAQ,cAAc,MAAM;AAC1C,MAAA,cAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,cAAA,EAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAAA,EAED,CAAC,KAAM,CAAA,iBAAA,EAAmB,MAAM,UAAY,EAAA,KAAA,CAAM,OAAO,KAAM,CAAA,WAAA,CAAA,CAAA,CAAA;AAElE,EAAA,SAAA,CAAU,MAAM;AACd,IAAgB,eAAA,CAAA,OAAA,CAAQ,QAAW,GAAA,CAAC,KAAmB,KAAA;AACrD,MAAA,eAAA,CAAgB,QAAQ,KAAQ,GAAA,KAAA,CAAA;AAGhC,MAAA,UAAA,CAAW,MAAM;AACf,QAAA,KAAA,CAAM,kBAAmB,CAAA,KAAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAG5B,EAAA,EAAA,CAAA,CAAA;AAEH,EAAO,OAAA,IAAA,CAAA;AAAA,CAAA,CAAA;AAGT,2BAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,kBAAA,CAAA;;;;"}
@@ -0,0 +1 @@
1
+ import{PointCloudAnnotation as h}from"@labelbee/lb-annotation";import{getClassName as m}from"../../utils/dom.js";import{PointCloudContainer as P}from"./PointCloudLayout.js";import u,{useRef as g,useEffect as f}from"react";import{EPerspectiveView as v}from"@labelbee/lb-utils";import{PointCloudContext as V}from"./PointCloudContext.js";import{SizeInfoForView as y}from"./PointCloudInfos.js";import{connect as j}from"react-redux";import{aMapStateToProps as b}from"../../store/annotation/map.js";import{usePointCloudViews as B}from"./hooks/usePointCloudViews.js";import{useSingleBox as E}from"./hooks/useSingleBox.js";import S from"./components/EmptyPage/index.js";import I from"../../hooks/useSize.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as M}from"../../store/ctx.js";const N=(a,e,i=1)=>{const{width:c,height:t}=e,o={x:a.x+c*i/2,y:a.y+t*i/2},l={x:e.width/2,y:e.height/2};return{offsetX:(l.x-o.x)/i,offsetY:-(l.y-o.y)/i}},p=(a,e,i,c,t)=>{const{offsetX:o,offsetY:l}=N(a,i,e);if(t.camera.zoom=e,a){const n=Math.cos(c.rotation),d=Math.sin(c.rotation),s=o*n,r=o*d,{x,y:w,z:C}=t.initCameraPosition;t.camera.position.set(x-s,w-r,C+l)}t.camera.updateProjectionMatrix(),t.render()},X=({currentData:a})=>{const e=u.useContext(V),{sideViewUpdateBox:i}=B(),{selectedBox:c}=E(),t=g(null),o=I(t),{t:l}=O();return f(()=>{if(t.current){const n={width:t.current.clientWidth,height:t.current.clientHeight},d=new h({container:t.current,size:n,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0}});e.setSideViewInstance(d)}},[]),f(()=>{if(!o||!e.sideViewInstance)return;const{pointCloud2dOperation:n,pointCloudInstance:d}=e.sideViewInstance;n.singleOn("renderZoom",(s,r)=>{!e.selectedPointCloudBox||p(r,s,o,e.selectedPointCloudBox,d)}),n.singleOn("dragMove",({currentPos:s,zoom:r})=>{!e.selectedPointCloudBox||p(s,r,o,e.selectedPointCloudBox,d)}),n.singleOn("updatePolygonByDrag",({newPolygon:s,originPolygon:r})=>{i(s,r)})},[e,o]),f(()=>{var n;(n=e==null?void 0:e.sideViewInstance)==null||n.initSize(o)},[o]),u.createElement(P,{className:m("point-cloud-container","side-view"),title:l("SideView"),toolbar:u.createElement(y,{perspectiveView:v.Left})},u.createElement("div",{className:m("point-cloud-container","bottom-view-content")},u.createElement("div",{className:m("point-cloud-container","core-instance"),ref:t}),!c&&u.createElement(S,null)))};var D=j(b,null,null,{context:M})(X);export{D as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudSideView.js","sources":["../../../src/components/pointCloudView/PointCloudSideView.tsx"],"sourcesContent":["/**\n * @file PointCloud sideView - React Component\n * @createdate 2022-07-11\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { EPerspectiveView, IPointCloudBox } from '@labelbee/lb-utils';\nimport { PointCloudContext } from './PointCloudContext';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport EmptyPage from './components/EmptyPage';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n/**\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2, // 放大倍数之后的中心点的偏移量\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst updateSideViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n SidePointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n SidePointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = SidePointCloud.initCameraPosition;\n SidePointCloud.camera.position.set(x - offsetXX, y - offsetXY, z + offsetY);\n }\n SidePointCloud.camera.updateProjectionMatrix();\n SidePointCloud.render();\n};\n\nconst PointCloudSideView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ptCtx = React.useContext(PointCloudContext);\n const { sideViewUpdateBox } = usePointCloudViews();\n const { selectedBox } = useSingleBox();\n const ref = useRef<HTMLDivElement>(null);\n const size = useSize(ref);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n polygonOperationProps: { showDirectionLine: false, forbidAddNew: true },\n });\n ptCtx.setSideViewInstance(pointCloudAnnotation);\n // };\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation, pointCloudInstance } = ptCtx.sideViewInstance;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n pointCloud2dOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n // Synchronized 3d point cloud view displacement operations\n pointCloud2dOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n pointCloud2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon, originPolygon }: any) => {\n sideViewUpdateBox(newPolygon, originPolygon);\n });\n }, [ptCtx, size]);\n\n useEffect(() => {\n // Update Size\n ptCtx?.sideViewInstance?.initSize(size);\n }, [size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'side-view')}\n title={t('SideView')}\n toolbar={<SizeInfoForView perspectiveView={EPerspectiveView.Left} />}\n >\n <div className={getClassName('point-cloud-container', 'bottom-view-content')}>\n <div className={getClassName('point-cloud-container', 'core-instance')} ref={ref} />\n {!selectedBox && <EmptyPage />}\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudSideView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,CAAA,EAAG,KAAK,KAAQ,GAAA,CAAA;AAAA,IAChB,CAAA,EAAG,KAAK,MAAS,GAAA,CAAA;AAAA,GAAA,CAAA;AAGnB,EAAO,OAAA;AAAA,IACL,OAAU,EAAA,CAAA,gBAAA,CAAiB,CAAI,GAAA,iBAAA,CAAkB,CAAK,IAAA,IAAA;AAAA,IACtD,OAAS,EAAA,EAAmB,gBAAA,CAAA,CAAA,GAAI,kBAAkB,CAAK,CAAA,GAAA,IAAA;AAAA,GAAA,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zB,2BAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,kBAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- import{CanvasSchduler as P,PointCloud as b,PolygonOperation as L,MathUtils as f,cTool as E}from"@labelbee/lb-annotation";import{EPerspectiveView as R}from"@labelbee/lb-utils";import M,{useRef as O,useEffect as I}from"react";import{pointCloudMain as g}from"./PointCloud3DView.js";const{EPolygonPattern:S}=E,T=n=>{const t=document.createElement("canvas");t.width=n.width,t.height=n.height;const e=t.getContext("2d");return e?(e.fillStyle="black",e.fillRect(0,0,n.width,n.height),t.toDataURL()):""},w=(n,t,e=1)=>{const{width:h,height:d}=t,r={x:n.x+h*e/2,y:n.y+d*e/2},m={x:t.width/2,y:t.height/2};return{offsetX:(m.x-r.x)/e,offsetY:-(m.y-r.y)/e}},j=(n,t)=>{const{width:e,height:h}=t,{x:d,y:r}=n;return{x:-r+h/2,y:-(d-e/2)}},D=()=>{const n=O(null);return I(()=>{if(n.current){const t={width:n.current.clientWidth,height:n.current.clientHeight},e={left:-t.width/2,right:t.width/2,top:t.height/2,bottom:-t.height/2,near:100,far:-100},h=n.current,d=T(t),r=new Image;r.src=d,r.onload=()=>{const m=new P({container:h}),o=new b({container:h,noAppend:!0,isOrthographicCamera:!0,orthgraphicParams:e});o.loadPCDFile("http://10.53.25.142:8001/1/000001.pcd"),m.createCanvas(o.renderer.domElement);const l=new L({container:n.current,size:t,config:"{ textConfigurable: false }",imgNode:r,isAppend:!1});l.eventBinding(),l.setPattern(S.Rect),l.on("polygonCreated",s=>{const[a,i,c]=s.pointList.map(y=>j(y,t)),p=f.getLineCenterPoint([a,c]),C=f.getLineLength(a,i),x=f.getLineLength(i,c),v=f.getRadiusFromQuadrangle(s.pointList),u={center:{x:p.x,y:p.y,z:1},volume:{width:x,height:C,depth:10},rotation:v};g.generateBox(u),g.updateCamera(u,R.Front),g.controls.update(),g.render()}),l.on("renderZoom",(s,a)=>{const{offsetX:i,offsetY:c}=w(a,t,s);o.camera.zoom=s,a&&(o.camera.left=e.left+i,o.camera.right=e.right+i,o.camera.top=e.top+c,o.camera.bottom=e.bottom+c),o.camera.updateProjectionMatrix(),o.render()}),l.on("dragMove",({currentPos:s,zoom:a})=>{const{offsetX:i,offsetY:c}=w(s,t,a);o.camera.zoom=a,o.camera.left=e.left+i,o.camera.right=e.right+i,o.camera.top=e.top+c,o.camera.bottom=e.bottom+c,o.camera.updateProjectionMatrix(),o.render()}),m.createCanvas(l.canvas,{size:t})}}},[]),M.createElement("div",{style:{width:"100%",height:500},ref:n})};export{D as default};
1
+ import{getClassName as p}from"../../utils/dom.js";import{FooterDivider as I}from"../../views/MainView/toolFooter/index.js";import{ZoomController as j}from"../../views/MainView/toolFooter/ZoomController/index.js";import{UpSquareOutlined as k,DownSquareOutlined as B}from"@ant-design/icons";import{PointCloudAnnotation as T,cTool as b}from"@labelbee/lb-annotation";import o,{useRef as N,useState as Z,useLayoutEffect as A,useEffect as x}from"react";import{PointCloudContext as R}from"./PointCloudContext.js";import{useRotate as z}from"./hooks/useRotate.js";import{useSingleBox as E}from"./hooks/useSingleBox.js";import{PointCloudContainer as L}from"./PointCloudLayout.js";import{BoxInfos as M,PointCloudValidity as F}from"./PointCloudInfos.js";import{usePolygon as X}from"./hooks/usePolygon.js";import{useZoom as S}from"./hooks/useZoom.js";import{Slider as Y}from"antd";import{aMapStateToProps as _}from"../../store/annotation/map.js";import{connect as q}from"react-redux";import{usePointCloudViews as U}from"./hooks/usePointCloudViews.js";import W from"../../hooks/useSize.js";import{useTranslation as D}from"react-i18next";import{LabelBeeContext as H}from"../../store/ctx.js";const{EPolygonPattern:$}=b,O=(i,s,e=1)=>{const{width:l,height:u}=s,c={x:i.x+l*e/2,y:i.y+u*e/2},d={x:s.width/2,y:s.height/2};return{offsetX:(d.x-c.x)/e,offsetY:-(d.y-c.y)/e}},G=({currentData:i})=>{const{zoom:s,zoomIn:e,zoomOut:l,initialPosition:u}=S(),{selectNextBox:c,selectPrevBox:d}=E(),{updateRotate:f}=z({currentData:i}),m=2,w=()=>{f(-m)},g=()=>{f(m)},a=()=>{f(180)};return o.createElement(o.Fragment,null,o.createElement("span",{onClick:g,className:p("point-cloud","rotate-reserve")}),o.createElement("span",{onClick:w,className:p("point-cloud","rotate")}),o.createElement("span",{onClick:a,className:p("point-cloud","rotate-180")}),o.createElement(I,null),o.createElement(k,{onClick:()=>{d()},className:p("point-cloud","prev")}),o.createElement(B,{onClick:()=>{c()},className:p("point-cloud","next")}),o.createElement(I,null),o.createElement(j,{initialPosition:u,zoomIn:e,zoomOut:l,zoom:s}))},J=({setZAxisLimit:i,zAxisLimit:s})=>o.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},o.createElement(Y,{vertical:!0,step:.5,max:10,min:.5,defaultValue:s,onAfterChange:e=>{i(e)}})),K=({currentData:i})=>{const s=N(null),e=o.useContext(R),l=W(s),{setZoom:u}=S(),{addPolygon:c,deletePolygon:d}=X(),{deletePointCloudBox:f}=E(),[m,w]=Z(10),{t:g}=D(),a=U();return A(()=>{if(!e.topViewInstance&&s.current&&(i==null?void 0:i.url)&&(i==null?void 0:i.result)){const t={width:s.current.clientWidth,height:s.current.clientHeight},n=new T({container:s.current,size:t,pcdPath:i.url});e.setTopViewInstance(n)}},[i]),x(()=>{if(!l||!e.topViewInstance||!e.sideViewInstance)return;const{pointCloud2dOperation:t}=e.topViewInstance;t.singleOn("polygonCreated",n=>{if(t.pattern===$.Normal||!(i==null?void 0:i.url)){c(n);return}a.topViewAddBox(n,l)}),t.singleOn("deletedObject",({id:n})=>{f(n),d(n)}),t.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),t.singleOn("addSelectedIDs",n=>{e.addSelectedID(n)}),t.singleOn("setSelectedIDs",n=>{e.setSelectedIDs(n)}),t.singleOn("updatePolygonByDrag",({newPolygon:n})=>{var r;(r=a.topViewUpdateBox)==null||r.call(a,n,l)})},[e,l,i,a]),x(()=>{if(!(l==null?void 0:l.width)||!e.topViewInstance)return;e.topViewInstance.initSize(l),e.topViewInstance.updatePolygonList(e.pointCloudBoxList);const{topViewInstance:{pointCloudInstance:t,pointCloud2dOperation:n}}=e;n.singleOn("renderZoom",(r,C)=>{const{offsetX:h,offsetY:P}=O(C,l,r);if(t.camera.zoom=r,C){const{x:v,y:V,z:y}=t.initCameraPosition;t.camera.position.set(v+P,V-h,y)}t.camera.updateProjectionMatrix(),t.render(),u(r)}),n.singleOn("dragMove",({currentPos:r,zoom:C})=>{const{offsetX:h,offsetY:P}=O(r,l,C);t.camera.zoom=C;const{x:v,y:V,z:y}=t.initCameraPosition;t.camera.position.set(v+P,V-h,y),t.render()})},[l]),x(()=>{var t,n;(n=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance)==null||n.applyZAxisPoints(m)},[m]),x(()=>{a.topViewSelectedChanged()},[e.selectedIDs]),o.createElement(L,{className:p("point-cloud-container","top-view"),title:g("TopView"),toolbar:o.createElement(G,{currentData:i})},o.createElement("div",{style:{position:"relative",flex:1}},o.createElement("div",{style:{width:"100%",height:"100%"},ref:s}),o.createElement(M,null),o.createElement(J,{zAxisLimit:m,setZAxisLimit:w}),o.createElement(F,null)))};var Q=q(_,null,null,{context:H})(K);export{Q as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PointCloudTopView.js","sources":["../../../src/components/pointCloudView/PointCloudTopView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n */\nimport { getClassName } from '@/utils/dom';\nimport { FooterDivider } from '@/views/MainView/toolFooter';\nimport { ZoomController } from '@/views/MainView/toolFooter/ZoomController';\nimport { DownSquareOutlined, UpSquareOutlined } from '@ant-design/icons';\nimport { cTool, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { IPolygonData } from '@labelbee/lb-utils';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { BoxInfos, PointCloudValidity } from './PointCloudInfos';\nimport { usePolygon } from './hooks/usePolygon';\nimport { useZoom } from './hooks/useZoom';\nimport { Slider } from 'antd';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst { EPolygonPattern } = cTool;\n\n/**\n * Get the offset from canvas2d-coordinate to world coordinate (Top View)\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst TopViewToolbar = ({ currentData }: IAnnotationStateProps) => {\n const { zoom, zoomIn, zoomOut, initialPosition } = useZoom();\n const { selectNextBox, selectPrevBox } = useSingleBox();\n const { updateRotate } = useRotate({ currentData });\n\n const ratio = 2;\n\n const clockwiseRotate = () => {\n updateRotate(-ratio);\n };\n const anticlockwiseRotate = () => {\n updateRotate(ratio);\n };\n\n const reverseRotate = () => {\n updateRotate(180);\n };\n\n return (\n <>\n <span\n onClick={anticlockwiseRotate}\n className={getClassName('point-cloud', 'rotate-reserve')}\n />\n <span onClick={clockwiseRotate} className={getClassName('point-cloud', 'rotate')} />\n <span onClick={reverseRotate} className={getClassName('point-cloud', 'rotate-180')} />\n <FooterDivider />\n <UpSquareOutlined\n onClick={() => {\n selectPrevBox();\n }}\n className={getClassName('point-cloud', 'prev')}\n />\n <DownSquareOutlined\n onClick={() => {\n selectNextBox();\n }}\n className={getClassName('point-cloud', 'next')}\n />\n <FooterDivider />\n <ZoomController\n initialPosition={initialPosition}\n zoomIn={zoomIn}\n zoomOut={zoomOut}\n zoom={zoom}\n />\n </>\n );\n};\n\n/**\n * Slider for filtering Z-axis points\n */\nconst ZAxisSlider = ({\n setZAxisLimit,\n zAxisLimit,\n}: {\n setZAxisLimit: (value: number) => void;\n zAxisLimit: number;\n}) => {\n return (\n <div style={{ position: 'absolute', top: 128, right: 8, height: '50%', zIndex: 20 }}>\n <Slider\n vertical\n step={0.5}\n max={10}\n min={0.5}\n defaultValue={zAxisLimit}\n onAfterChange={(v: number) => {\n setZAxisLimit(v);\n }}\n />\n </div>\n );\n};\n\nconst PointCloudTopView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ref = useRef<HTMLDivElement>(null);\n const ptCtx = React.useContext(PointCloudContext);\n const size = useSize(ref);\n const { setZoom } = useZoom();\n\n const { addPolygon, deletePolygon } = usePolygon();\n const { deletePointCloudBox } = useSingleBox();\n const [zAxisLimit, setZAxisLimit] = useState<number>(10);\n const { t } = useTranslation();\n const pointCloudViews = usePointCloudViews();\n\n useLayoutEffect(() => {\n if (ptCtx.topViewInstance) {\n return;\n }\n\n if (ref.current && currentData?.url && currentData?.result) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n pcdPath: currentData.url,\n });\n ptCtx.setTopViewInstance(pointCloudAnnotation);\n }\n }, [currentData]);\n\n useEffect(() => {\n if (!size || !ptCtx.topViewInstance || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopView2dOperation } = ptCtx.topViewInstance;\n\n TopView2dOperation.singleOn('polygonCreated', (polygon: IPolygonData) => {\n if (TopView2dOperation.pattern === EPolygonPattern.Normal || !currentData?.url) {\n addPolygon(polygon);\n return;\n }\n\n pointCloudViews.topViewAddBox(polygon, size);\n });\n\n TopView2dOperation.singleOn('deletedObject', ({ id }) => {\n deletePointCloudBox(id);\n deletePolygon(id);\n });\n\n TopView2dOperation.singleOn('deleteSelectedIDs', () => {\n ptCtx.setSelectedIDs([]);\n });\n\n TopView2dOperation.singleOn('addSelectedIDs', (selectedID: string) => {\n ptCtx.addSelectedID(selectedID);\n });\n\n TopView2dOperation.singleOn('setSelectedIDs', (selectedIDs: string[]) => {\n ptCtx.setSelectedIDs(selectedIDs);\n });\n\n TopView2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon }: any) => {\n pointCloudViews.topViewUpdateBox?.(newPolygon, size);\n });\n }, [ptCtx, size, currentData, pointCloudViews]);\n\n useEffect(() => {\n if (!size?.width || !ptCtx.topViewInstance) {\n return;\n }\n\n // 1. Update Size\n ptCtx.topViewInstance.initSize(size);\n ptCtx.topViewInstance.updatePolygonList(ptCtx.pointCloudBoxList);\n\n const {\n topViewInstance: { pointCloudInstance: pointCloud, pointCloud2dOperation: polygonOperation },\n } = ptCtx;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n polygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n if (currentPos) {\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n }\n\n pointCloud.camera.updateProjectionMatrix();\n pointCloud.render();\n\n setZoom(zoom);\n });\n\n // Synchronized 3d point cloud view displacement operations\n polygonOperation.singleOn('dragMove', ({ currentPos, zoom }) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n pointCloud.render();\n });\n }, [size]);\n\n useEffect(() => {\n ptCtx.topViewInstance?.pointCloudInstance?.applyZAxisPoints(zAxisLimit);\n }, [zAxisLimit]);\n\n useEffect(() => {\n pointCloudViews.topViewSelectedChanged();\n }, [ptCtx.selectedIDs]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'top-view')}\n title={t('TopView')}\n toolbar={<TopViewToolbar currentData={currentData} />}\n >\n <div style={{ position: 'relative', flex: 1 }}>\n <div style={{ width: '100%', height: '100%' }} ref={ref} />\n\n <BoxInfos />\n <ZAxisSlider zAxisLimit={zAxisLimit} setZAxisLimit={setZAxisLimit} />\n <PointCloudValidity />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudTopView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAS5B,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,CAAA,EAAG,KAAK,KAAQ,GAAA,CAAA;AAAA,IAChB,CAAA,EAAG,KAAK,MAAS,GAAA,CAAA;AAAA,GAAA,CAAA;AAGnB,EAAO,OAAA;AAAA,IACL,OAAU,EAAA,CAAA,gBAAA,C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,CAAA;AAEV,EAAA,2CACG,mBAAD,EAAA;AAAA,IACE,SAAA,EAAW,aAAa,uBAAyB,EAAA,UAAA,CAAA;AAAA,IACjD,OAAO,CAAE,CAAA,SAAA,CAAA;AAAA,IACT,OAAA,sCAAU,cAAD,EAAA;AAAA,MAAgB,WAAA;AAAA,KAAA,CAAA;AAAA,GAAA,sCAExB,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,CAAE,QAAU,EAAA,UAAA,EAAY,IAAM,EAAA,CAAA,CAAA;AAAA,GAAA,sCACvC,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,CAAE,KAAO,EAAA,MAAA,EAAQ,MAAQ,EAAA,MAAA,CAAA;AAAA,IAAU,GAAA;AAAA,GAAA,CAAA,kBAE9C,KAAA,CAAA,aAAA,CAAA,QAAA,EAAD,IACA,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAD,EAAA;AAAA,IAAa,UAAA;AAAA,IAAwB,aAAA;AAAA,GAAA,CAAA,sCACpC,kBAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAMR,0BAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,iBAAA,CAAA;;;;"}
@@ -0,0 +1 @@
1
+ import t from"react";import a from"../../../../assets/annotation/pointCloudTool/nodata.svg.js";import{getClassName as e}from"../../../../utils/dom.js";const o=()=>t.createElement("div",{className:e("point-cloud-container","empty-page")},t.createElement("img",{src:a}),t.createElement("span",{className:e("point-cloud-container","empty-page","text")},"\u6682\u65E0\u6570\u636E"));export{o as default};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/pointCloudView/components/EmptyPage/index.tsx"],"sourcesContent":["/**\n * @file EmptyPage\n * @createDate 2022-08-31\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport React from 'react';\nimport NoDataSvg from '@/assets/annotation/pointCloudTool/nodata.svg';\nimport { getClassName } from '@/utils/dom';\n\nconst EmptyPage = () => {\n return (\n <div className={getClassName('point-cloud-container', 'empty-page')}>\n <img src={NoDataSvg} />\n <span className={getClassName('point-cloud-container', 'empty-page', 'text')}>暂无数据</span>\n </div>\n );\n};\n\nexport default EmptyPage;\n"],"names":["NoDataSvg"],"mappings":";;;;AASA,MAAM,YAAY,MAAM;AACtB,EAAA,2CACG,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,YAAA,CAAA;AAAA,GAAA,sCACnD,KAAD,EAAA;AAAA,IAAK,GAAK,EAAAA,GAAA;AAAA,GAAA,CAAA,sCACT,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,YAAa,CAAA,uBAAA,EAAyB,YAAc,EAAA,MAAA,CAAA;AAAA,GAAS,EAAA,0BAAA,CAAA,CAAA,CAAA;AAAA;;;;"}