@labelbee/lb-components 1.10.0-alpha.0 → 1.10.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/useAttribute.js +1 -1
- package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
- package/dist/components/pointCloudView/hooks/useLine.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useSphere.js +1 -0
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/hooks/useZoom.js +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +8 -2
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/useHistory.d.ts +6 -2
- package/dist/types/components/pointCloudView/hooks/useLine.d.ts +12 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +44 -2
- package/dist/types/components/pointCloudView/hooks/useSphere.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useZoom.d.ts +4 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/cuboid/index.d.ts +6 -0
- package/dist/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/cuboid/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/es/App.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/hooks/useAttribute.js +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -1
- package/es/components/pointCloudView/hooks/useLine.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/useSphere.js +1 -0
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useZoom.js +1 -1
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/cuboid/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/package.json +4 -4
- package/es/App.js.map +0 -1
- package/es/assets/annotation/common/icon_adapt.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_adapt_black.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_back.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_backA.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_clear.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_clearSmall.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_clearSmall_a.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_clear_a.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_invalid.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_invalid_a.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_next.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_nextA.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_r.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_rA.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_save.svg.js.map +0 -1
- package/es/assets/annotation/common/icon_saveA.svg.js.map +0 -1
- package/es/assets/annotation/image/brightness.svg.js.map +0 -1
- package/es/assets/annotation/image/contrast.svg.js.map +0 -1
- package/es/assets/annotation/image/icon_yuantu.svg.js.map +0 -1
- package/es/assets/annotation/image/saturation.svg.js.map +0 -1
- package/es/assets/annotation/lineTool/icon_line.svg.js.map +0 -1
- package/es/assets/annotation/lineTool/icon_line_a.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/copy.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/nextBox.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/nodata.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/patse.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/prevBox.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/selectAll.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/unitAttribute.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/unitAttributeForbid.svg.js.map +0 -1
- package/es/assets/annotation/pointCloudTool/unitAttributeHover.svg.js.map +0 -1
- package/es/assets/annotation/pointTool/icon_point.svg.js.map +0 -1
- package/es/assets/annotation/pointTool/icon_point_a.svg.js.map +0 -1
- package/es/assets/annotation/polygonTool/icon_polygon.svg.js.map +0 -1
- package/es/assets/annotation/polygonTool/icon_polygon_a.svg.js.map +0 -1
- package/es/assets/annotation/rectTool/icon_rect.svg.js.map +0 -1
- package/es/assets/annotation/rectTool/icon_rectPattern.svg.js +0 -4
- package/es/assets/annotation/rectTool/icon_rectPattern.svg.js.map +0 -1
- package/es/assets/annotation/rectTool/icon_rect_a.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_alttab_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_cencel_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_copyBackwardResult.svg.js +0 -4
- package/es/assets/annotation/toolHotKeyIcon/icon_copyBackwardResult.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_frameActive_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_frameChange_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_frameNull_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_frame_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_fullView_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_kj1.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_last_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineActive_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineChange_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineCont_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineDel_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineInsert_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineNull_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_lineSpecial_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_line_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_loupe_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_mouse_middle_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_next_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_noDisplay.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_pointActive_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_pointNull_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_point_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonActive_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonChange_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonDel_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonInsert_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonNull_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_reform_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_reload_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_save_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_segment.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_straightLine_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_tag_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_unGrip_kj.svg.js.map +0 -1
- package/es/assets/annotation/toolHotKeyIcon/setValid.svg.js.map +0 -1
- package/es/assets/annotation/video/icon_keyboard_h.svg.js.map +0 -1
- package/es/assets/attributeIcon/eraser.svg.js.map +0 -1
- package/es/assets/attributeIcon/eraser_a.svg.js.map +0 -1
- package/es/assets/attributeIcon/pen.svg.js.map +0 -1
- package/es/assets/attributeIcon/pen_a.svg.js.map +0 -1
- package/es/assets/attributeIcon/zoomUp.svg.js.map +0 -1
- package/es/assets/cssIcon/annotation/icon_clearSmall.svg +0 -10
- package/es/assets/cssIcon/annotation/icon_clearSmall_a.svg +0 -10
- package/es/assets/cssIcon/slide_btn.svg +0 -23
- package/es/assets/predictTracking/icon.svg.js.map +0 -1
- package/es/assets/toolStyle/icon_border.svg.js.map +0 -1
- package/es/assets/toolStyle/icon_borderColor.svg.js.map +0 -1
- package/es/assets/toolStyle/icon_opacityFill.svg.js.map +0 -1
- package/es/assets/toolStyle/icon_opacityStroke.svg.js.map +0 -1
- package/es/components/AnnotationView/index.js.map +0 -1
- package/es/components/AnnotationView/pointCloudAnnotationView.js.map +0 -1
- package/es/components/ImageError/index.js +0 -53
- package/es/components/ImageError/index.js.map +0 -1
- package/es/components/annotationStepPopover/index.js.map +0 -1
- package/es/components/attributeList/index.js.map +0 -1
- package/es/components/checkboxList/index.js.map +0 -1
- package/es/components/colorTag/index.js.map +0 -1
- package/es/components/customAntd/IconWithText/index.js.map +0 -1
- package/es/components/customResizeHook/index.js.map +0 -1
- package/es/components/fileException/FileError.js.map +0 -1
- package/es/components/fileException/FileInvalid.js.map +0 -1
- package/es/components/fileException/index.js.map +0 -1
- package/es/components/pointCloudView/PointCloud2DView.js.map +0 -1
- package/es/components/pointCloudView/PointCloud3DView.js.map +0 -1
- package/es/components/pointCloudView/PointCloudBackView.js.map +0 -1
- package/es/components/pointCloudView/PointCloudContext.js.map +0 -1
- package/es/components/pointCloudView/PointCloudInfos.js.map +0 -1
- package/es/components/pointCloudView/PointCloudLayout.js.map +0 -1
- package/es/components/pointCloudView/PointCloudListener.js.map +0 -1
- package/es/components/pointCloudView/PointCloudSideView.js.map +0 -1
- package/es/components/pointCloudView/PointCloudTopView.js.map +0 -1
- package/es/components/pointCloudView/components/EmptyPage/index.js.map +0 -1
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js +0 -228
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js.map +0 -1
- package/es/components/pointCloudView/components/UnifyParamsModal/index.js.map +0 -1
- package/es/components/pointCloudView/data.js +0 -4
- package/es/components/pointCloudView/data.js.map +0 -1
- package/es/components/pointCloudView/hooks/useAttribute.js.map +0 -1
- package/es/components/pointCloudView/hooks/useBoxes.js.map +0 -1
- package/es/components/pointCloudView/hooks/useConfig.js.map +0 -1
- package/es/components/pointCloudView/hooks/useHistory.js.map +0 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +0 -1
- package/es/components/pointCloudView/hooks/usePolygon.js.map +0 -1
- package/es/components/pointCloudView/hooks/useRotate.js.map +0 -1
- package/es/components/pointCloudView/hooks/useSingleBox.js.map +0 -1
- package/es/components/pointCloudView/hooks/useStatus.js.map +0 -1
- package/es/components/pointCloudView/hooks/useZoom.js.map +0 -1
- package/es/components/pointCloudView/index.js.map +0 -1
- package/es/components/predictTracking/index.js.map +0 -1
- package/es/components/predictTracking/predictTrackingIcon/index.js.map +0 -1
- package/es/components/predictTracking/previewResult/index.js.map +0 -1
- package/es/components/predictTracking/previewResult/util.js.map +0 -1
- package/es/components/videoAnnotate/index.js.map +0 -1
- package/es/components/videoPlayer/TagToolInstanceAdaptor.js.map +0 -1
- package/es/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js.map +0 -1
- package/es/components/videoPlayer/VideoTagLayer.js.map +0 -1
- package/es/components/videoPlayer/components/controller/index.js.map +0 -1
- package/es/components/videoPlayer/index.js.map +0 -1
- package/es/components/videoPlayer/utils.js.map +0 -1
- package/es/configureStore.js.map +0 -1
- package/es/constant/index.js.map +0 -1
- package/es/constant/styleString.js.map +0 -1
- package/es/data/Style.js.map +0 -1
- package/es/data/enums/AnnotationSize.js.map +0 -1
- package/es/data/enums/ToolType.js.map +0 -1
- package/es/hooks/annotation.js.map +0 -1
- package/es/hooks/useConfig.js +0 -18
- package/es/hooks/useConfig.js.map +0 -1
- package/es/hooks/useRafState.js.map +0 -1
- package/es/hooks/useRefCache.js.map +0 -1
- package/es/hooks/useSafeSate.js.map +0 -1
- package/es/hooks/useSize.js.map +0 -1
- package/es/hooks/useUnmountedRef.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/store/Actions.js.map +0 -1
- package/es/store/annotation/actionCreators.js.map +0 -1
- package/es/store/annotation/map.js.map +0 -1
- package/es/store/annotation/reducer.js.map +0 -1
- package/es/store/annotation/selectors.js.map +0 -1
- package/es/store/ctx.js.map +0 -1
- package/es/store/imgAttribute/actionCreators.js.map +0 -1
- package/es/store/imgAttribute/reducer.js.map +0 -1
- package/es/store/index.js.map +0 -1
- package/es/store/toolStyle/actionCreators.js.map +0 -1
- package/es/store/toolStyle/reducer.js.map +0 -1
- package/es/utils/AnnotationDataUtils.js.map +0 -1
- package/es/utils/ConfigUtils.js.map +0 -1
- package/es/utils/PageOperator.js.map +0 -1
- package/es/utils/StepUtils.js.map +0 -1
- package/es/utils/TextUtils.js.map +0 -1
- package/es/utils/ToolStyleUtils.js.map +0 -1
- package/es/utils/ToolUtils.js.map +0 -1
- package/es/utils/data.js.map +0 -1
- package/es/utils/dom.js.map +0 -1
- package/es/utils/index.js.map +0 -1
- package/es/views/MainView/annotationOperation/index.js.map +0 -1
- package/es/views/MainView/annotationTips/index.js.map +0 -1
- package/es/views/MainView/index.js.map +0 -1
- package/es/views/MainView/sidebar/AnnotationText/index.js.map +0 -1
- package/es/views/MainView/sidebar/ClearIcon/index.js.map +0 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js.map +0 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js.map +0 -1
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js.map +0 -1
- package/es/views/MainView/sidebar/ImgAttributeInfo/index.js.map +0 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.js.map +0 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js.map +0 -1
- package/es/views/MainView/sidebar/ScribbleSidebar/index.js.map +0 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js.map +0 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js.map +0 -1
- package/es/views/MainView/sidebar/TextAreaFormat/index.js.map +0 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js.map +0 -1
- package/es/views/MainView/sidebar/ToolIcons.js.map +0 -1
- package/es/views/MainView/sidebar/ToolStyle/index.js.map +0 -1
- package/es/views/MainView/sidebar/index.js.map +0 -1
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterPopover.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/line/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/point/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/rectToolShortCutTable/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/tag/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/text/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js.map +0 -1
- package/es/views/MainView/toolFooter/FooterTips/index.js.map +0 -1
- package/es/views/MainView/toolFooter/HiddenTips/index.js.map +0 -1
- package/es/views/MainView/toolFooter/PageNumber/index.js.map +0 -1
- package/es/views/MainView/toolFooter/Pagination.js.map +0 -1
- package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js.map +0 -1
- package/es/views/MainView/toolFooter/ZoomController/index.js.map +0 -1
- package/es/views/MainView/toolFooter/index.js.map +0 -1
- package/es/views/MainView/toolHeader/ExportData/index.js.map +0 -1
- package/es/views/MainView/toolHeader/StepSwitch/index.js.map +0 -1
- package/es/views/MainView/toolHeader/headerOption/index.js.map +0 -1
- package/es/views/MainView/toolHeader/index.js.map +0 -1
package/dist/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:
|
|
1
|
+
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:i=1,stepList:s,onSubmit:l,onSave:c,onPageChange:u,onStepChange:d,initialIndex:p=0,toolInstance:h,setToolInstance:P,getFileData:f,pageSize:g=10,loadFileList:r,defaultLang:v="cn",skipBeforePageTurning:I,beforeRotate:_,checkMode:S=!1,intelligentFit:m=!0}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:l,stepList:s,step:i,getFileData:f,pageSize:g,loadFileList:r,onSave:c,onPageChange:u,onStepChange:d,skipBeforePageTurning:I,beforeRotate:_,checkMode:S})),O(),lbUtils.i18n.changeLanguage(v);const n=()=>{a(L=>L+1)};return lbUtils.i18n.on("languageChanged",n),()=>{lbUtils.i18n.off("languageChanged",n),actionCreators.InitAnnotationState(index.store.dispatch)}},[]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateInjectFunc({onSubmit:l,stepList:s,getFileData:f,pageSize:g,loadFileList:r,onSave:c,onPageChange:u,onStepChange:d,beforeRotate:_})),lbUtils.i18n.changeLanguage(v)},[l,s,f,g,r,c,u,d,v,_]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateProcessingStep(i))},[i]),React.useEffect(()=>{P==null||P(h)},[h]);const O=()=>{r?actionCreators.loadImgList(index.store.dispatch,index.store.getState,p,!0).then(n=>{n&&index.store.dispatch(reducer.LoadFileAndFileData(p))}):o&&o.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:o}}),index.store.dispatch(reducer.LoadFileAndFileData(p)))};return React__default.default.createElement("div",null,React__default.default.createElement(es.ConfigProvider,{locale:lbUtils.i18n.language==="en"?enUS__default.default:zhCN__default.default},React__default.default.createElement(index$1,__spreadProps(__spreadValues({},e),{intelligentFit:m}))))},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var App$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(App);module.exports=App$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,a,i)=>a in e?__defProp(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i,__spreadValues=(e,a)=>{for(var i in a||(a={}))__hasOwnProp.call(a,i)&&__defNormalProp(e,i,a[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(a))__propIsEnum.call(a,i)&&__defNormalProp(e,i,a[i]);return e},__spreadProps=(e,a)=>__defProps(e,__getOwnPropDescs(a));const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:e})=>{const{isActive:a,setTarget3DView:i}=React.useContext(PointCloud3DContext),o=p=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",p)]:!0,active:a});return React__default.default.createElement("span",{onClick:()=>{i(lbUtils.EPerspectiveView[e])},className:o(e.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:e,followTopView:a}=React.useContext(PointCloud3DContext),{t:i}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Top"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Front"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Left"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Back"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Right"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"LFT"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"RBT"}),React__default.default.createElement(antd.Tooltip,{title:i("CameraFollowTopView")},React__default.default.createElement("span",{onClick:()=>{a()},className:dom.getClassName("point-cloud-3d-view","followTop")})),React__default.default.createElement("span",{onClick:()=>{e()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:e,config:a})=>{var i;const o=React.useContext(PointCloudContext.PointCloudContext),[p,V]=React.useState(!0),d=React.useRef(null),{initPointCloud3d:w}=usePointCloudViews.usePointCloudViews(),u=useSize(d),{t:C}=reactI18next.useTranslation();React.useEffect(()=>{!o.mainViewInstance||w==null||w(u)},[u]);const{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:m}=useSphere.useSphere(),v=t=>{var n,r;const l=c==null?void 0:c.info;if(l){const s=__spreadValues({},l.center);s.x=s.x-.01,s.z=10;const f=t===lbUtils.EPerspectiveView.Top;(n=o.mainViewInstance)==null||n.updateCameraByBox(l,t,f?s:void 0)}m&&((r=o.mainViewInstance)==null||r.updateCameraBySphere(m,t))},P=()=>{var t;(t=o.mainViewInstance)==null||t.resetCamera()},g=()=>{var t,n;const r=(t=o.topViewInstance)==null?void 0:t.pointCloudInstance.camera;r&&((n=o.mainViewInstance)==null||n.applyCameraTarget(r))};React.useEffect(()=>{if(d.current&&(e==null?void 0:e.url)){let t=o.mainViewInstance;if(!t&&u.width){const n={left:-u.width/2,right:u.width/2,top:u.height/2,bottom:-u.height/2,near:100,far:-100};t=new lbAnnotation.PointCloud({container:d.current,isOrthographicCamera:!0,orthographicParams:n,config:a}),o.setMainViewInstance(t)}}},[u]),React.useEffect(()=>{var t;if(d.current&&(e==null?void 0:e.url)&&e.result&&o.mainViewInstance){let n=o.mainViewInstance;const r=lbUtils.PointCloudUtils.getBoxParamsFromResultList(e.result);r.forEach(l=>{var s;const f=(s=lbUtils.toolStyleConverter.getColorFromConfig({attribute:l.attribute},__spreadProps(__spreadValues({},a),{attributeConfigurable:!0}),{}))==null?void 0:s.hex;n==null||n.generateBox(l,f)}),o.setPointCloudResult(r),o.setPointCloudValid((t=index.jsonParser(e.result))==null?void 0:t.valid)}},[e,o.mainViewInstance]),React.useEffect(()=>{var t,n,r,l;if(c){v(lbUtils.EPerspectiveView.Top);const s=(r=(n=(t=o.topViewInstance)==null?void 0:t.pointCloudInstance)==null?void 0:n.camera.zoom)!=null?r:1;(l=o.mainViewInstance)==null||l.updateCameraZoom(s)}},[c]),React.useEffect(()=>{var t,n,r,l;if(m){v(lbUtils.EPerspectiveView.Top);const s=(r=(n=(t=o.topViewInstance)==null?void 0:t.pointCloudInstance)==null?void 0:n.camera.zoom)!=null?r:1;(l=o.mainViewInstance)==null||l.updateCameraZoom(s)}},[m]);const _=React.useMemo(()=>({reset3DView:P,setTarget3DView:v,isActive:!!c,followTopView:g}),[c,o.mainViewInstance]),h=React__default.default.createElement("div",null,React__default.default.createElement("span",{style:{marginRight:8}},C("ShowArrows")),React__default.default.createElement(antd.Switch,{size:"small",checked:p,onChange:t=>{var n;V(t),(n=o.mainViewInstance)==null||n.setShowDirection(t)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:C("3DView"),toolbar:h,style:{height:e.mappingImgList&&((i=e.mappingImgList)==null?void 0:i.length)>0?"55%":"100%"}},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},React__default.default.createElement(PointCloud3DContext.Provider,{value:_},React__default.default.createElement(PointCloud3DSideBar,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-view"),id:pointCloudID,ref:d})))};var PointCloud3DView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud3D);module.exports=PointCloud3DView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(n,r,l=1)=>{const{width:e,height:o}=r,t={x:n.x+e*l/2,y:n.y+o*l/2},u={x:r.width/2,y:r.height/2};return{offsetX:(u.x-t.x)/l,offsetY:-(u.y-t.y)/l}},updateBackViewByCanvas2D=(n,r,l,e,o)=>{const{offsetX:t,offsetY:u}=TransferCanvas2WorldOffset(n,l,r);if(o.camera.zoom=r,n){const d=Math.cos(e),f=Math.sin(e),C=t*d,x=t*f,{x:v,y:i,z:c}=o.initCameraPosition;o.camera.position.set(v+x,i-C,c+u)}o.camera.updateProjectionMatrix(),o.render()},PointCloudBackView=({currentData:n,config:r,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),o=React.useRef(null),t=useSize(o),{selectedBox:u}=useSingleBox.useSingleBox(),{selectedSphere:d}=useSphere.useSphere(),{syncBackviewToolZoom:f}=useZoom.useZoom(),{t:C}=reactI18next.useTranslation(),{backViewUpdateBox:x,backViewUpdatePoint:v}=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(o.current){const i={width:o.current.clientWidth,height:o.current.clientHeight},c=new lbAnnotation.PointCloudAnnotation({container:o.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:r,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setBackViewInstance(c)}},[]),React.useEffect(()=>{if(!t||!e.backViewInstance)return;const{toolInstance:i,pointCloudInstance:c}=e.backViewInstance;i.singleOn("renderZoom",(a,s)=>{if(e.selectedPointCloudBox){updateBackViewByCanvas2D(s,a,t,e.selectedPointCloudBox.rotation,c),f(s,a,t);return}if(d){updateBackViewByCanvas2D(s,a,t,0,c),f(s,a,t);return}}),i.singleOn("dragMove",({currentPos:a,zoom:s})=>{!e.selectedPointCloudBox&&!d||updateBackViewByCanvas2D(a,s,t,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,c)}),i.singleOn("updatePointByDrag",(a,s)=>{d&&(v==null||v(a,s[0]))}),i.singleOn("updatePolygonByDrag",a=>{if(e.selectedIDs.length===1&&a.length===1){const{newPolygon:s,originPolygon:p}=a[0];s&&p&&x(s,p)}})},[e,t]),React.useEffect(()=>{var i;(i=e==null?void 0:e.backViewInstance)==null||i.initSize(t)},[t]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:C("BackView"),toolbar:React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Back})},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:o}),!u&&!d&&React__default.default.createElement(index,null)))};var PointCloudBackView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudBackView);module.exports=PointCloudBackView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{}}),PointCloudProvider=({children:u})=>{const[l,y]=React.useState([]),[c,h]=React.useState([]),[C,j]=React.useState([]),[S,N]=React.useState([]),[r,L]=React.useState([]),[m,T]=React.useState(!0),[w,_]=React.useState(1),[n,k]=React.useState(),[I,q]=React.useState(),[V,z]=React.useState(),[o,F]=React.useState(),[g,Z]=React.useState(""),[x,G]=React.useState(lbAnnotation.EToolName.Rect),J=React.useRef(new lbAnnotation.ActionsHistory).current,[i,v]=React.useState([]),[B,K]=React.useState(""),R=React.useMemo(()=>r.length===1?r[0]:"",[r]),D=React.useMemo(()=>{const d=l.find(t=>t.id===R),A=t=>{const e=l.concat(t);return y(e),e},b=t=>{const e=c.concat(t);return h(e),e},f=t=>{T(t!==!1)},s=t=>{t===void 0&&L([]),typeof t=="string"&&L([t]),Array.isArray(t)&&L(Array.from(new Set(t)))},U=t=>{r.includes(t)?s(r.filter(e=>e!==t)):s([...r,t])},W=()=>{s(l.map(t=>t.id))},X=t=>{s(l.filter(e=>e.attribute===t).map(e=>e.id))},E=l.filter(t=>!i.includes(t.attribute)),H=c.filter(t=>!i.includes(t.attribute)),Y=t=>{if(i.includes(t))v(i.filter(e=>e!==t));else{const e=i.concat(t);v(e)}},$=(t=E,e=C,P=H,p=S)=>{l.forEach(a=>{o==null||o.removeObjectByName(a.id)}),c.forEach(a=>{o==null||o.removeObjectByName(a.id)}),n==null||n.updatePolygonList(t,e),n==null||n.updatePointList(P),n==null||n.updateLineList(p),o==null||o.generateBoxes(t),o==null||o.generateSpheres(P),M(t)},M=t=>{const e=o==null?void 0:o.highlightOriginPointCloud(t);return new Promise(P=>{e==null||e.then(p=>{[n].forEach(a=>{var O;p&&((O=a==null?void 0:a.pointCloudInstance)==null||O.updateColor(p),P({color:p}))})})})};return{selectedID:R,pointCloudBoxList:l,pointCloudSphereList:c,displayPointCloudList:E,displaySphereList:H,selectedIDs:r,setPointCloudResult:y,setSelectedIDs:s,addPointCloudBox:A,addPointCloudSphere:b,setPointCloudSphereList:h,valid:m,selectedPointCloudBox:d,setPointCloudValid:f,addSelectedID:U,selectedAllBoxes:W,topViewInstance:n,setTopViewInstance:k,sideViewInstance:I,setSideViewInstance:q,backViewInstance:V,setBackViewInstance:z,mainViewInstance:o,setMainViewInstance:F,polygonList:C,setPolygonList:j,lineList:S,setLineList:N,zoom:w,setZoom:_,history:J,toggleAttributesVisible:Y,hideAttributes:i,setHideAttributes:v,reRender:$,attrPanelLayout:B,setAttrPanelLayout:K,syncAllViewPointCloudColor:M,defaultAttribute:g,setDefaultAttribute:Z,pointCloudPattern:x,setPointCloudPattern:G,selectSpecAttr:X}},[m,r,l,c,C,S,n,I,V,o,w,i,B,g,x]),Q=()=>{const d=l.filter(s=>i.includes(s.attribute)),{setSelectedIDs:A,reRender:b}=D,f=d.map(s=>s.id);f.length>0&&A(r.filter(s=>!f.includes(s))),b()};return React.useEffect(()=>{var d;Q(),(d=n==null?void 0:n.pointCloud2dOperation)==null||d.setHiddenAttributes(i)},[i]),React__default.default.createElement(PointCloudContext.Provider,{value:D},u)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,r,
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,r,i)=>r in u?__defProp(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,__spreadValues=(u,r)=>{for(var i in r||(r={}))__hasOwnProp.call(r,i)&&__defNormalProp(u,i,r[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(r))__propIsEnum.call(r,i)&&__defNormalProp(u,i,r[i]);return u},__spreadProps=(u,r)=>__defProps(u,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:u,config:r,checkMode:i,configString:_,imgIndex:w})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:B,selectNextBox:I,selectPrevBox:L,updateSelectedBox:C,deleteSelectedPointCloudBoxAndPolygon:V}=useSingleBox.useSingleBox(),{selectedSphere:f,updatePointCloudSphere:E}=useSphere.useSphere(),{clearAllResult:b,updatePointCloudPattern:q}=useStatus.useStatus(),A=index.jsonParser(u.result),{copySelectedBoxes:O,pasteSelectedBoxes:j,copiedBoxes:T}=useBoxes.useBoxes({config:r}),{toolInstanceRef:a}=annotation.useCustomToolInstance({basicInfo:A}),{updateRotate:P}=useRotate.useRotate({currentData:u}),{updatePointCloudData:p,topViewSelectedChanged:x}=usePointCloudViews.usePointCloudViews(),{redo:h,undo:g,pushHistoryWithList:R,pushHistoryUnderUpdatePolygon:D}=useHistory.useHistory(),{syncThreeViewsAttribute:S}=useAttribute.useAttribute(),{syncAllViewsConfig:N,reRenderTopViewRange:H}=useConfig.useConfig(),{selectedPolygon:m}=usePolygon.usePolygon(),{t:y}=reactI18next.useTranslation(),v=e=>{var o;const{topViewInstance:s}=t;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},K=(e,o)=>{var s;const{topViewInstance:n,mainViewInstance:l}=t;if(!n)return;const{pointCloud2dOperation:c}=n;switch(e){case"q":{P(2);break}case"e":P(-2);break;case"g":P(180);break;case"u":{const d=c.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;q(d);const z={[lbAnnotation.EToolName.Polygon]:y("PolygonPattern"),[lbAnnotation.EToolName.Rect]:y("RectPattern")};antd.message.success(y("ChangePatternMsg",{pattern:z[d]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize(!0);break;case"-":l==null||l.updatePointSize(!1);break;case"v":t.setPointCloudValid(!t.valid);break;case"tab":if(o.shiftKey){L();break}I(),o.preventDefault();break;case"f":B();break;case"arrowup":v({y:-1});break;case"arrowdown":v({y:1});break;case"arrowleft":v({x:-1});break;case"arrowright":v({x:1});break;case"delete":V();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(o.keyCode,r.attributeList);d!==void 0&&a.current.setDefaultAttribute(d)}return}}},U=(e,o)=>{switch(e){case"c":O();break;case"v":j();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?h():g();break}}},k=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||i===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){U(o,e);return}K(o,e)};return React.useEffect(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[t,T,r,t.pointCloudBoxList,t.polygonList]),React.useEffect(()=>{N(r)},[_]),React.useEffect(()=>{(r==null?void 0:r.radius)&&H(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{p==null||p()},[w,t.mainViewInstance]),React.useEffect(()=>{t.setHideAttributes([])},[w]),React.useEffect(()=>{a.current.exportData=()=>[t.pointCloudBoxList,{valid:t.valid}],a.current.exportCustomData=()=>{var e,o,s;return{resultPolygon:(e=t.polygonList)!=null?e:[],resultLine:(o=t.lineList)!=null?o:[],resultPoint:(s=t.pointCloudSphereList)!=null?s:[]}},a.current.setDefaultAttribute=e=>{var o;S(e);const s=t.selectedPointCloudBox;if(s){s.attribute=e;const n=C(s);t.mainViewInstance&&x({newSelectedBox:s,newPointCloudList:n})}if(m&&D(__spreadProps(__spreadValues({},m),{attribute:e})),f){const n=E(__spreadProps(__spreadValues({},f),{attribute:e}));t.mainViewInstance&&((o=t.mainViewInstance)==null||o.generateSpheres(n),x({newSelectedSphere:f,newSphereList:n}))}},a.current.setSubAttribute=(e,o)=>{var s;const n=t.selectedPointCloudBox;if(n){const l=(s=n==null?void 0:n.subAttribute)!=null?s:{};n.subAttribute=__spreadProps(__spreadValues({},l),{[e]:o}),C(n)}},a.current.clearResult=()=>{b==null||b()},a.current.redo=()=>{h()},a.current.undo=()=>{g()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{t.setPointCloudValid(e),e===!1&&b()})},a.current.setForbidOperation=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&t.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)},a.current.asyncData=e=>{setTimeout(()=>{p==null||p(e)})}},[t.pointCloudBoxList,t.pointCloudSphereList,t.selectedID,t.valid,t.polygonList,t.lineList,t.mainViewInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{R({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const o=(e=t.topViewInstance)==null?void 0:e.toolInstance;if(!o||i)return;const s=c=>{S(c)},n=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return o.on("syncAttribute",s),o.on("messageError",n),o.on("messageInfo",l),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",n),o.unbind("messageInfo",l)}},[t.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),ToolUtils=require("../../utils/ToolUtils.js"),useZoom=require("./hooks/useZoom.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:f,height:s}=l,c={x:t.x+f*e/2,y:t.y+s*e/2},a={x:l.width/2,y:l.height/2};return{offsetX:(a.x-c.x)/e,offsetY:-(a.y-c.y)/e}},updateSideViewByCanvas2D=(t,l,e,f,s)=>{const{offsetX:c,offsetY:a}=TransferCanvas2WorldOffset(t,e,l);if(s.camera.zoom=l,t){const u=Math.cos(f),n=Math.sin(f),x=c*u,v=c*n,{x:i,y:d,z:o}=s.initCameraPosition;s.camera.position.set(i-x,d-v,o+a)}s.camera.updateProjectionMatrix(),s.render()},PointCloudSideView=({config:t,checkMode:l})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:f,sideViewUpdatePoint:s}=usePointCloudViews.usePointCloudViews(),{selectedBox:c}=useSingleBox.useSingleBox(),{selectedSphere:a}=useSphere.useSphere(),u=React.useRef(null),n=useSize(u),{t:x}=reactI18next.useTranslation(),{syncSideviewToolZoom:v}=useZoom.useZoom();return React.useEffect(()=>{if(u.current){const i={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:i,extraProps:{showDirectionLine:!1,forbidAddNew:!0,forbidDelete:!0},config:t,checkMode:l,toolName:ToolUtils.getPointCloudToolList()});e.setSideViewInstance(d)}},[]),React.useEffect(()=>{if(!n||!e.sideViewInstance)return;const{toolInstance:i,pointCloudInstance:d}=e.sideViewInstance;i.singleOn("renderZoom",(o,r)=>{if(e.selectedPointCloudBox){updateSideViewByCanvas2D(r,o,n,e.selectedPointCloudBox.rotation,d),v(r,o,n);return}a&&(updateSideViewByCanvas2D(r,o,n,0,d),v(r,o,n))}),i.singleOn("dragMove",({currentPos:o,zoom:r})=>{!e.selectedPointCloudBox&&!a||updateSideViewByCanvas2D(o,r,n,e.selectedPointCloudBox?e.selectedPointCloudBox.rotation:0,d)}),i.singleOn("updatePointByDrag",(o,r)=>{a&&(s==null||s(o,r[0]))}),i.singleOn("updatePolygonByDrag",o=>{if(e.selectedIDs.length===1&&o.length===1){const{newPolygon:r,originPolygon:C}=o[0];f(r,C)}})},[e,n]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(n)},[n]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:x("SideView"),toolbar:React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:u}),!c&&!a&&React__default.default.createElement(index,null)))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),index$1=require("../../views/MainView/toolFooter/index.js"),index$2=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),index$1=require("../../views/MainView/toolFooter/index.js"),index$2=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useLine=require("./hooks/useLine.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:p,height:C}=l,m={x:o.x+p*s/2,y:o.y+C*s/2},g={x:l.width/2,y:l.height/2};return{offsetX:(g.x-m.x)/s,offsetY:-(g.y-m.y)/s}},TopViewToolbar=({currentData:o})=>{const{zoom:l,zoomIn:s,zoomOut:p,initialPosition:C}=useZoom.useZoom(),{selectNextBox:m,selectPrevBox:g}=useSingleBox.useSingleBox(),{updateRotate:P}=useRotate.useRotate({currentData:o}),x=2,I=()=>{P(-x)},f=()=>{P(x)},t=()=>{P(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:f,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:I,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:t,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{g()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{m()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(index$2.ZoomController,{initialPosition:C,zoomIn:s,zoomOut:p,zoom:l}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:p=>{o(p)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:p,checkMode:C,intelligentFit:m})=>{var g,P;const[x,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),f=React.useRef(null),t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=useSize(f),w=index.jsonParser(s.config),{setZoom:q,syncTopviewToolZoom:j}=useZoom.useZoom(),{hideAttributes:_}=t,{addPolygon:E,deletePolygon:A}=usePolygon.usePolygon(),{addLine:N,deleteLine:T}=useLine.useLine(),{deletePointCloudSphere:k}=useSphere.useSphere(),{deletePointCloudBox:L,changeValidByID:B}=useSingleBox.useSingleBox(),[y,D]=React.useState(10),{t:R}=reactI18next.useTranslation(),d=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(!t.topViewInstance&&f.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:f.current.clientWidth,height:f.current.clientHeight},c=new lbAnnotation.PointCloudAnnotation({container:f.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},w),{pointCloudPattern:t.pointCloudPattern}),checkMode:C,toolName:ToolUtils.getPointCloudToolList()});t.setTopViewInstance(c)}},[o]),React.useEffect(()=>{if(!a||!t.topViewInstance||!t.sideViewInstance)return;const{toolInstance:n}=t.topViewInstance;n.singleOn("lineCreated",(e,i)=>{const u=__spreadProps(__spreadValues({},e),{pointList:e.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,a))});N(u),t.setSelectedIDs(_.includes(e.attribute)?"":e.id)}),n.singleOn("lineDeleted",e=>{L(e),T(e)}),n.singleOn("lineSelected",e=>{t.setSelectedIDs([e])}),n.singleOn("updateLineByDrag",e=>{var i;(i=d.topViewUpdateLine)==null||i.call(d,e,a)}),n.singleOn("pointCreated",(e,i)=>{d.topViewAddSphere({newPoint:e,size:a,trackConfigurable:w.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",e=>{k(e)}),n.singleOn("pointSelected",e=>{t.setSelectedIDs([e])}),n.singleOn("updatePointByDrag",(e,i)=>{var u;(u=d.topViewUpdatePoint)==null||u.call(d,e,a)}),n.singleOn("polygonCreated",(e,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const u=__spreadProps(__spreadValues({},e),{pointList:e.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,a))});E(u),t.setSelectedIDs(_.includes(e.attribute)?"":e.id);return}d.topViewAddBox({polygon:e,size:a,imgList:l,trackConfigurable:w.trackConfigurable,zoom:i,intelligentFit:m})}),n.singleOn("deletedObject",({id:e})=>{L(e),A(e)}),n.singleOn("deleteSelectedIDs",()=>{t.setSelectedIDs([])}),n.singleOn("addSelectedIDs",e=>{t.addSelectedID(e)}),n.singleOn("setSelectedIDs",e=>{t.setSelectedIDs(e)}),n.singleOn("updatePolygonByDrag",e=>{var i;(i=d.topViewUpdateBox)==null||i.call(d,e,a)});const c=e=>{var i;const u=B(e);u&&t.syncAllViewPointCloudColor(u),t.polygonList.find(r=>r.id===e)&&((i=t.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(e,!0))};return n.on("validUpdate",c),()=>{n.unbind("validUpdate",c)}},[t,a,o,d,t.polygonList,t.lineList,(g=t.topViewInstance)==null?void 0:g.toolInstance]),React.useEffect(()=>{var n,c;if(!(a==null?void 0:a.width)||!t.topViewInstance)return;const e=(c=(n=w==null?void 0:w.attributeList)==null?void 0:n[0])==null?void 0:c.value;e&&t.topViewInstance.toolInstance.setDefaultAttribute(e),t.topViewInstance.initSize(a),t.topViewInstance.updatePolygonList(t.displayPointCloudList,t.polygonList),t.topViewInstance.updatePointList(t.displaySphereList);const{topViewInstance:{pointCloudInstance:i,toolInstance:u}}=t;u.singleOn("renderZoom",(r,v)=>{const{offsetX:V,offsetY:h}=TransferCanvas2WorldOffset(v,a,r);if(i.camera.zoom=r,v){const{x:O,y:S,z:b}=i.initCameraPosition;i.camera.position.set(O+h,S-V,b)}i.camera.updateProjectionMatrix(),i.render(),q(r),j(v,r,a),I({zoom:r,currentPos:v})}),u.singleOn("dragMove",({currentPos:r,zoom:v})=>{const{offsetX:V,offsetY:h}=TransferCanvas2WorldOffset(r,a,v);i.camera.zoom=v;const{x:O,y:S,z:b}=i.initCameraPosition;i.camera.position.set(O+h,S-V,b),i.render(),I({zoom:v,currentPos:r})})},[a,t.topViewInstance,(P=t.topViewInstance)==null?void 0:P.toolInstance]),React.useEffect(()=>{var n,c;(c=(n=t.topViewInstance)==null?void 0:n.pointCloudInstance)==null||c.applyZAxisPoints(y)},[y]),React.useEffect(()=>{d.topViewSelectedChanged({})},[t.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:R("TopView"),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:f},p==null?void 0:p(x)),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:C,config:w}),React__default.default.createElement(ZAxisSlider,{checkMode:C,zAxisLimit:y,setZAxisLimit:D}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useAttribute=()=>{const{topViewInstance:t,sideViewInstance:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useAttribute=()=>{const{topViewInstance:t,sideViewInstance:n,backViewInstance:o,mainViewInstance:u,defaultAttribute:i,setDefaultAttribute:r}=React.useContext(PointCloudContext.PointCloudContext);return React.useEffect(()=>{if(!(t==null?void 0:t.toolInstance))return;const e=()=>{r(t==null?void 0:t.toolInstance.defaultAttribute)};return t==null||t.toolInstance.on("changeAttributeSidebar",e),()=>{t==null||t.toolInstance.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.toolInstance]),{syncThreeViewsAttribute:e=>{[t==null?void 0:t.toolInstance,n==null?void 0:n.toolInstance,o==null?void 0:o.toolInstance].forEach(l=>{l==null||l.setDefaultAttribute(e)})},updateDefaultAttribute:e=>{t==null||t.toolInstance.setDefaultAttribute(e)},reRenderPointCloud3DBox:e=>{u==null||u.generateBox(e)},defaultAttribute:i}};exports.useAttribute=useAttribute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,s,r)=>s in e?__defProp(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r,__spreadValues=(e,s)=>{for(var r in s||(s={}))__hasOwnProp.call(s,r)&&__defNormalProp(e,r,s[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(s))__propIsEnum.call(s,r)&&__defNormalProp(e,r,s[r]);return e};const useHistory=()=>{const{history:e,setPointCloudResult:s,setSelectedIDs:r,pointCloudBoxList:l,pointCloudSphereList:P,mainViewInstance:p,topViewInstance:L,polygonList:u,setPolygonList:f,lineList:c,setLineList:a,syncAllViewPointCloudColor:h}=React.useContext(PointCloudContext.PointCloudContext),g=({newBoxParams:t,newPolygon:o,newLine:i})=>{const n={pointCloudBoxList:l,polygonList:u,lineList:c};t&&(n.pointCloudBoxList=l.concat(t)),o&&(n.polygonList=u.concat(o)),i&&(n.lineList=c.concat(i)),e.pushHistory(n)},v=t=>{const o={pointCloudBoxList:l,polygonList:u,lineList:c};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),t.lineList&&(o.lineList=t.lineList),e.pushHistory(o)},x=t=>{if(c.find(i=>i.id===t.id)){const i=c.map(n=>n.id===t.id?t:__spreadValues({},n));e.pushHistory({lineList:i}),a(i)}},_=t=>{t&&e.pushHistory({pointCloudSphereList:P})},H=t=>{if(u.find(i=>i.id===t.id)){const i=u.map(n=>n.id===t.id?t:__spreadValues({},n));e.pushHistory({pointCloudBoxList:l,polygonList:i}),f(i)}},w=({pointCloudBoxList:t,polygonList:o})=>{e.initRecord({pointCloudBoxList:t,polygonList:o},!0)},C=t=>{if(!t)return;const{pointCloudBoxList:o=[],polygonList:i=[],lineList:n=[]}=t;if(o){l.length!==o.length&&r();const B=l.filter(d=>o.every(y=>y.id!==d.id)),O=o.filter(d=>l.every(y=>y.id!==d.id));B.forEach(d=>{p==null||p.removeObjectByName(d.id)}),O.forEach(d=>{p==null||p.generateBox(d)}),s(o),h(o)}i&&f(i),n&&a(n),L==null||L.updatePolygonList(o!=null?o:[],i!=null?i:[]),L==null||L.updateLineList(n!=null?n:[])};return{addHistory:g,pushHistoryWithList:v,initHistory:w,pushHistoryUnderUpdatePoint:_,pushHistoryUnderUpdatePolygon:H,pushHistoryUnderUpdateLine:x,redo:()=>{C(e.redo())},undo:()=>{C(e.undo())}}};exports.useHistory=useHistory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useHistory=require("./useHistory.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,r)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,__spreadValues=(t,e)=>{for(var r in e||(e={}))__hasOwnProp.call(e,r)&&__defNormalProp(t,r,e[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))__propIsEnum.call(e,r)&&__defNormalProp(t,r,e[r]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const useLine=()=>{const{lineList:t,setLineList:e,selectedID:r}=React.useContext(PointCloudContext.PointCloudContext),{addHistory:a,pushHistoryWithList:d}=useHistory.useHistory(),s=t.find(i=>i.id===r);return{addLine:i=>{e(t.concat(i)),a({newLine:i})},deleteLine:i=>{const o=t.filter(n=>n.id!==i).map(n=>__spreadValues({},n));e(o),d({lineList:o})},selectedLine:s,updateSelectedLine:i=>{s&&e(t.map(o=>o.id===r?i:o))},updateLineValidByID:i=>{t.find(n=>n.id===i)&&e(t.map(n=>n.id===i?__spreadProps(__spreadValues({},n),{valid:!n.valid}):n))}}};exports.useLine=useLine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,n)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,__spreadValues=(e,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(e,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(e,n,o[n]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__async=(e,o,n)=>new Promise((u,t)=>{var s=r=>{try{c(n.next(r))}catch(C){t(C)}},p=r=>{try{c(n.throw(r))}catch(C){t(C)}},c=r=>r.done?u(r.value):Promise.resolve(r.value).then(s,p);c((n=n.apply(e,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPolygon2PointCloud=(e,o,n,u,t,s)=>{let p=e.pointList.map(g=>lbUtils.PointCloudUtils.transferCanvas2World(g,o)),c=0,r=1,C={};if(n){const g=n.getSensesPointZAxisInPolygon(p,void 0,s);s&&(p=g.fittedCoordinates),c=(g.maxZ+g.minZ)/2,r=g.maxZ-g.minZ,C={count:g.zCount}}const[f,v,O]=p,w=lbAnnotation.MathUtils.getLineCenterPoint([f,O]),V=lbAnnotation.MathUtils.getLineLength(f,v),U=lbAnnotation.MathUtils.getLineLength(v,O),I=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);u&&(c=u.center.z,r=u.depth);const B={center:{x:w.x,y:w.y,z:c},width:U,height:V,depth:r,rotation:I,id:e.id},h=__spreadValues(u?__spreadValues(__spreadValues({},u),B):__spreadProps(__spreadValues({},B),{attribute:"",valid:!0}),C);t&&Object.assign(h,t);const b=p.map(g=>lbUtils.PointCloudUtils.transferWorld2Canvas(g,o));return{boxParams:h,newPointList:b}},sideViewPolygon2PointCloud=(e,o,n,u)=>{const[t,s,p]=e.pointList,[c,r,C]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([t,p]),v=lbAnnotation.MathUtils.getLineCenterPoint([c,C]),w={x:{x:f.x-v.x,y:f.y-v.y}.x,y:0,z:f.y-v.y},V=lbAnnotation.MathUtils.getLineLength(t,s),U=lbAnnotation.MathUtils.getLineLength(c,r),I=V-U,B=lbAnnotation.MathUtils.getLineLength(s,p),h=lbAnnotation.MathUtils.getLineLength(r,C),b=B-h,{newBoxParams:g}=u.getNewBoxBySideUpdate(w,b,I,n);return g},backViewPolygon2PointCloud=(e,o,n,u)=>{const[t,s,p]=e.pointList,[c,r,C]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([t,p]),v=lbAnnotation.MathUtils.getLineCenterPoint([c,C]),w={x:{x:f.x-v.x,y:f.y-v.y}.x,y:0,z:f.y-v.y},V=lbAnnotation.MathUtils.getLineLength(t,s),U=lbAnnotation.MathUtils.getLineLength(c,r),I=V-U,B=lbAnnotation.MathUtils.getLineLength(s,p),h=lbAnnotation.MathUtils.getLineLength(r,C),b=B-h;let{newBoxParams:g}=u.getNewBoxByBackUpdate(w,b,I,n);return g},synchronizeSideView=(e,o,n,u)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:s}=n;s.loadPCDFileByBox(u,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=s.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);s.setInitCameraPosition(p);const{polygon2d:c,zoom:r}=s.getBoxSidePolygon2DCoordinate(e);s.camera.zoom=r,s.camera.updateProjectionMatrix(),s.render(),t.initPosition(),t.zoomChangeOnCenter(r),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],o.id)},synchronizeBackView=(e,o,n,u)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:s}=n;s.loadPCDFileByBox(u,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=s.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);s.setInitCameraPosition(p);const{polygon2d:c,zoom:r}=s.getBoxBackPolygon2DCoordinate(e);s.camera.zoom=r,s.camera.updateProjectionMatrix(),s.render(),t.initPosition(),t.zoomChangeOnCenter(r),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],o.id)},synchronizeTopView=(e,o,n,u)=>{var t;if(!n||!u)return;u.generateBox(e,o.id),u.render();const{pointCloud2dOperation:s,pointCloudInstance:p}=n,{polygon2d:c}=p.getBoxTopPolygon2DCoordinate(e),r=[...s.polygonList],C=r.find(f=>f.id===o.id);C?C.pointList=c:r.push({id:o.id,pointList:c,textAttribute:"",isRect:!0,valid:(t=e.valid)!=null?t:!0}),s.setResultAndSelectedID(r,o.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:n,backViewInstance:u,mainViewInstance:t,addPointCloudBox:s,setSelectedIDs:p,selectedIDs:c,pointCloudBoxList:r,hideAttributes:C}=e,{addHistory:f,initHistory:v,pushHistoryUnderUpdatePolygon:O}=useHistory.useHistory(),{selectedPolygon:w}=usePolygon.usePolygon(),{updateSelectedBox:V,updateSelectedBoxes:U,getPointCloudByID:I}=useSingleBox.useSingleBox(),{currentData:B,config:h}=ctx.useSelector(i=>{const{stepList:l,step:P,imgList:d,imgIndex:a}=i.annotation;return{currentData:d[a],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,l).config)}}),b=ctx.useDispatch(),{selectedBox:g}=useSingleBox.useSingleBox(),{t:M}=reactI18next.useTranslation(),A=g==null?void 0:g.info;if(!o||!n||!u)return{topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:T}=o,z=i=>{t==null||t.generateBox(i),t==null||t.controls.update(),t==null||t.render()},R=({polygon:i,size:l,imgList:P,trackConfigurable:d,zoom:a,intelligentFit:y})=>{var m;const S={attribute:(m=o.pointCloud2dOperation.defaultAttribute)!=null?m:""};d===!0&&Object.assign(S,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:r})});const x=__spreadValues({},i),{boxParams:L,newPointList:D}=topViewPolygon2PointCloud(x,l,T,void 0,S,y),_=o==null?void 0:o.pointCloud2dOperation;if((h==null?void 0:h.lowerLimitPointsNumInBox)&&typeof L.count=="number"&&L.count<h.lowerLimitPointsNumInBox){antd.message.info(M("LowerLimitPointsNumInBox",{num:h.lowerLimitPointsNumInBox})),_.deletePolygon(L.id);return}y&&(D==null?void 0:D.length)&&(x.pointList=D);const W=C.includes(x.attribute),Z=s(L);W?p([]):(p(L.id),_.setSelectedIDs([x.id]),j(PointCloudView.Top,x,L,a,Z),y&&synchronizeTopView(L,x,o,t)),f({newBoxParams:L})},q=(i,l)=>{const P=i!=null?i:g==null?void 0:g.info,d=o==null?void 0:o.pointCloud2dOperation;if(d.setSelectedIDs(c),c.length===0||!d)return;const a=d.selectedPolygon;if(c.length===1&&P){j(PointCloudView.Top,a,P,void 0,l);return}},k=(i,l,P)=>{if(A){let d,a;switch(P){case PointCloudView.Back:d=backViewPolygon2PointCloud;break;case PointCloudView.Side:d=sideViewPolygon2PointCloud;break;default:d=sideViewPolygon2PointCloud;break}if(a=d(i,l,A,n.pointCloudInstance),t){const{count:m}=t.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(a).polygonPointList,[a.center.z-a.depth/2,a.center.z+a.depth/2]);a=__spreadProps(__spreadValues({},a),{count:m})}const y=V(a);return j(P,i,a,void 0,y),y}},H=(i,l)=>{k(i,l,PointCloudView.Side)},E=(i,l)=>{k(i,l,PointCloudView.Back)},N=(i,l)=>{if(w){const d=i[0].newPolygon;d.pointList=d.pointList.map(a=>lbUtils.PointCloudUtils.transferCanvas2World(a,l)),O(i[0].newPolygon);return}const P=i.map(({newPolygon:d})=>{const a=I(d.id),{boxParams:y}=topViewPolygon2PointCloud(d,l,o.pointCloudInstance,a);return y});if(P.length===1){const{newPolygon:d}=i[0],a=U(P);j(PointCloudView.Top,d,P[0],void 0,a)}else{const d=U(P);d&&e.syncAllViewPointCloudColor(d)}},j=(i,l,P,d,a)=>__async(void 0,null,function*(){const y=B==null?void 0:B.url;a&&(yield e.syncAllViewPointCloudColor(a));const m={[PointCloudView.Side]:()=>{synchronizeSideView(P,l,n,y)},[PointCloudView.Back]:()=>{u&&synchronizeBackView(P,l,u,y)},[PointCloudView.Top]:()=>{synchronizeTopView(P,l,o,t)}};Object.keys(m).forEach(S=>{S!==i&&m[S]()}),d&&(t==null||t.updateCameraZoom(d)),z(P)});return{topViewAddBox:R,topViewSelectedChanged:q,topViewUpdateBox:N,sideViewUpdateBox:H,backViewUpdateBox:E,pointCloudBoxListUpdated:i=>{o.updatePolygonList(i),t==null||t.generateBoxes(i)},initPointCloud3d:i=>{if(!t)return;const l={left:-i.width/2,right:i.width/2,top:i.height/2,bottom:-i.height/2,near:100,far:-100};t.initOrthographicCamera(l),t.initRenderer(),t.render()},updatePointCloudData:(...i)=>__async(void 0,[...i],function*(l=B){var P,d,a,y,m,S;if(!(l==null?void 0:l.url)||!t)return;actionCreators.SetPointCloudLoading(b,!0),yield t.loadPCDFile(l.url,(P=h==null?void 0:h.radius)!=null?P:DEFAULT_RADIUS),r.forEach(_=>{t==null||t.removeObjectByName(_.id)});let x=[],L=[];l.result?(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(l.result),L=lbUtils.PointCloudUtils.getPolygonListFromResultList(l.result),x.forEach(_=>{t==null||t.generateBox(_)}),e.syncAllViewPointCloudColor(x),e.setPointCloudResult(x),e.setPolygonList(L)):(e.setPointCloudResult([]),e.setPolygonList([])),v({pointCloudBoxList:x,polygonList:L}),t.updateTopCamera();const D=(a=(d=index.jsonParser(l.result))==null?void 0:d.valid)!=null?a:!0;e.setPointCloudValid(D),(y=e.sideViewInstance)==null||y.clearAllData(),(m=e.backViewInstance)==null||m.clearAllData(),o.updateData(l.url,l.result,{radius:(S=h==null?void 0:h.radius)!=null?S:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(b,!1)})}};exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,o,i)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,__spreadValues=(t,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(t,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(t,i,o[i]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o)),__async=(t,o,i)=>new Promise((r,e)=>{var c=l=>{try{s(i.next(l))}catch(h){e(h)}},p=l=>{try{s(i.throw(l))}catch(h){e(h)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(c,p);s((i=i.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(t,o,i,r,e)=>{const{x:c,y:p}=lbUtils.PointCloudUtils.transferCanvas2World(t,o),{defaultZ:s}=lbUtils.DEFAULT_SPHERE_PARAMS,l={center:{x:c,y:p,z:s},id:t.id},h=r?__spreadValues(__spreadValues({},r),l):__spreadProps(__spreadValues({},l),{attribute:"",valid:!0});return e&&Object.assign(h,e),h},topViewPolygon2PointCloud=(t,o,i,r,e,c)=>{let p=t.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,o)),s=0,l=1,h={};if(i){const y=i.getSensesPointZAxisInPolygon(p,void 0,c);c&&y.fittedCoordinates.length>0&&(p=y.fittedCoordinates),s=(y.maxZ+y.minZ)/2,l=y.maxZ-y.minZ,h={count:y.zCount}}const[g,x,j]=p,b=lbAnnotation.MathUtils.getLineCenterPoint([g,j]),_=lbAnnotation.MathUtils.getLineLength(g,x),O=lbAnnotation.MathUtils.getLineLength(x,j),k=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);r&&(s=r.center.z,l=r.depth);const V={center:{x:b.x,y:b.y,z:s},width:O,height:_,depth:l,rotation:k,id:t.id},I=__spreadValues(r?__spreadValues(__spreadValues({},r),V):__spreadProps(__spreadValues({},V),{attribute:"",valid:!0}),h);e&&Object.assign(I,e);const D=p.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,o));return{boxParams:I,newPointList:D}},sideViewPoint2PointCloud=(t,o,i)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-r.x,y:i.center.y,z:i.center.z-r.y}})},sideViewPolygon2PointCloud=(t,o,i,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),b={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(s,l),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),I=lbAnnotation.MathUtils.getLineLength(l,h),D=V-I,{newBoxParams:y}=r.getNewBoxBySideUpdate(b,D,k,i);return y},backViewPoint2PointCloud=(t,o,i)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-r.x,z:i.center.z-r.y}})},backViewPolygon2PointCloud=(t,o,i,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),b={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(s,l),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),I=lbAnnotation.MathUtils.getLineLength(l,h),D=V-I;let{newBoxParams:y}=r.getNewBoxByBackUpdate(b,D,k,i);return y},syncSideViewByPoint=(t,o,i,r,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:s}=i;s.loadPCDFile(r,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:l}=s.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Left);s.setInitCameraPosition(l);const{point2d:h,zoom:g}=s.getSphereSidePoint2DCoordinate(t);s.camera.zoom=g,s.camera.updateProjectionMatrix(),s.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeSideView=(t,o,i,r)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(r,t,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(p);const{polygon2d:s,zoom:l}=c.getBoxSidePolygon2DCoordinate(t);c.camera.zoom=l,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:s,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncBackViewByPoint=(t,o,i,r,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:s}=i;s.loadPCDFile(r,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:l}=s.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Back);s.setInitCameraPosition(l);const{point2d:h,zoom:g}=s.getSphereBackPoint2DCoordinate(t);s.camera.zoom=g,s.camera.updateProjectionMatrix(),s.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeBackView=(t,o,i,r)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(r,t,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(p);const{polygon2d:s,zoom:l}=c.getBoxBackPolygon2DCoordinate(t);c.camera.zoom=l,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:s,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncTopViewByPoint=(t,o,i,r)=>{if(!i||!r)return;r.generateSphere(t),r.updateCameraBySphere(t,lbUtils.EPerspectiveView.Top),r.render();const{toolInstance:e,pointCloudInstance:c}=i,{point2d:p}=c.getSphereTopPoint2DCoordinate(t),s=[...e.pointList].map(l=>l.id===o.id?__spreadProps(__spreadValues(__spreadValues({},o),p),{valid:t.valid,textAttribute:"",attribute:t.attribute}):l);e.setResult(s),e.setSelectedID(o.id)},synchronizeTopView=(t,o,i,r)=>{var e;if(!i||!r)return;r.generateBox(t,o.id),r.render();const{pointCloud2dOperation:c,pointCloudInstance:p}=i,{polygon2d:s}=p.getBoxTopPolygon2DCoordinate(t),l=[...c.polygonList],h=l.find(g=>g.id===o.id);h?h.pointList=s:l.push({id:o.id,pointList:s,textAttribute:"",isRect:!0,valid:(e=t.valid)!=null?e:!0}),c.setResultAndSelectedID(l,o.id)},usePointCloudViews=()=>{const t=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:r,mainViewInstance:e,addPointCloudBox:c,addPointCloudSphere:p,setSelectedIDs:s,selectedIDs:l,pointCloudBoxList:h,pointCloudSphereList:g,hideAttributes:x}=t,{addHistory:j,initHistory:b,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdatePoint:O,pushHistoryUnderUpdateLine:k}=useHistory.useHistory(),{selectedPolygon:V}=usePolygon.usePolygon(),{updateSelectedBox:I,updateSelectedBoxes:D,getPointCloudByID:y}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:G,updatePointCloudSphere:H,selectedSphere:z}=useSphere.useSphere(),{currentData:w,config:L}=ctx.useSelector(n=>{const{stepList:a,step:P,imgList:u,imgIndex:d}=n.annotation;return{currentData:u[d],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,a).config)}}),F=ctx.useDispatch(),{selectedBox:T}=useSingleBox.useSingleBox(),{t:X}=reactI18next.useTranslation(),N=T==null?void 0:T.info;if(!o||!i||!r)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:E}=o,Y=n=>{e==null||e.generateBox(n),e==null||e.controls.update(),e==null||e.render()},Q=n=>{e==null||e.generateSphere(n),e==null||e.controls.update(),e==null||e.render()},J=({newPoint:n,size:a,zoom:P,trackConfigurable:u})=>{var d;const C={attribute:(d=o.toolInstance.defaultAttribute)!=null?d:""};u===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:g})});const f=topViewPoint2PointCloud(n,a,E,void 0,C);s(n.id);const v=p(f);M(PointCloudView.Top,n,f,P,v,L)},K=({polygon:n,size:a,imgList:P,trackConfigurable:u,zoom:d,intelligentFit:C})=>{var f;const v={attribute:(f=o.toolInstance.defaultAttribute)!=null?f:""};u===!0&&Object.assign(v,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:g})});const m=o==null?void 0:o.toolInstance,S=__spreadValues({},n),{boxParams:B,newPointList:A}=topViewPolygon2PointCloud(S,a,E,void 0,v,C);if((L==null?void 0:L.lowerLimitPointsNumInBox)&&typeof B.count=="number"&&B.count<L.lowerLimitPointsNumInBox){antd.message.info(X("LowerLimitPointsNumInBox",{num:L.lowerLimitPointsNumInBox})),m.deletePolygon(B.id);return}C&&(A==null?void 0:A.length)&&(S.pointList=A);const q=x.includes(S.attribute),U=c(B);q?s([]):(s(B.id),m.setSelectedIDs([S.id]),R(PointCloudView.Top,S,B,d,U),C&&synchronizeTopView(B,S,o,e)),j({newBoxParams:B})},$=({newSelectedBox:n,newPointCloudList:a,newSelectedSphere:P,newSphereList:u})=>{const d=o==null?void 0:o.toolInstance;if(!(l.length===0||!d)){if(n||(T==null?void 0:T.info)){const C=n!=null?n:T==null?void 0:T.info;d.setSelectedIDs(l);const f=d.selectedPolygon;if(l.length===1&&C){R(PointCloudView.Top,f,C,void 0,a);return}}if((P||z)&&l.length===1){const C=P!=null?P:z;d.setSelectedID(l[0]);const f=d.selectedPoint;C&&M(PointCloudView.Top,f,C,void 0,u,L)}}},W=(n,a,P)=>{if(N){let u,d;switch(P){case PointCloudView.Back:u=backViewPolygon2PointCloud;break;case PointCloudView.Side:u=sideViewPolygon2PointCloud;break;default:u=sideViewPolygon2PointCloud;break}if(d=u(n,a,N,i.pointCloudInstance),e){const{count:f}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(d).polygonPointList,[d.center.z-d.depth/2,d.center.z+d.depth/2]);d=__spreadProps(__spreadValues({},d),{count:f})}const C=I(d);return R(P,n,d,void 0,C),C}},Z=(n,a,P)=>{if(z){let u,d;switch(P){case PointCloudView.Back:u=backViewPoint2PointCloud;break;case PointCloudView.Side:u=sideViewPoint2PointCloud;break;default:u=sideViewPoint2PointCloud;break}d=u(n,a,z);const C=H(d);return M(P,n,d,void 0,C,L),C}},tt=(n,a)=>{Z(n,a,PointCloudView.Side)},et=(n,a)=>{Z(n,a,PointCloudView.Back)},ot=(n,a)=>{W(n,a,PointCloudView.Side)},it=(n,a)=>{W(n,a,PointCloudView.Back)},nt=(n,a)=>{k(n)},st=(n,a)=>{const{x:P,y:u}=lbUtils.PointCloudUtils.transferCanvas2World(n,a);O(__spreadProps(__spreadValues({},n),{x:P,y:u}));const d=G(n.id),C=topViewPoint2PointCloud(n,a,E,d),f=H(C);M(PointCloudView.Top,n,C,void 0,f,L)},rt=(n,a)=>{if(V){const u=n[0].newPolygon;u.pointList=u.pointList.map(d=>lbUtils.PointCloudUtils.transferCanvas2World(d,a)),_(n[0].newPolygon);return}const P=n.map(({newPolygon:u})=>{const d=y(u.id),{boxParams:C}=topViewPolygon2PointCloud(u,a,o.pointCloudInstance,d);return C});if(P.length===1){const{newPolygon:u}=n[0],d=D(P);R(PointCloudView.Top,u,P[0],void 0,d)}else{const u=D(P);u&&t.syncAllViewPointCloudColor(u)}},M=(n,a,P,u,d,C)=>__async(void 0,null,function*(){const f=w==null?void 0:w.url,v={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,a,i,f,C)},[PointCloudView.Back]:()=>{r&&syncBackViewByPoint(P,a,r,f,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,a,o,e)}};Object.keys(v).forEach(m=>{m!==n&&v[m]()}),u&&(e==null||e.updateCameraZoom(u)),Q(P)}),R=(n,a,P,u,d)=>__async(void 0,null,function*(){const C=w==null?void 0:w.url;d&&(yield t.syncAllViewPointCloudColor(d));const f={[PointCloudView.Side]:()=>{synchronizeSideView(P,a,i,C)},[PointCloudView.Back]:()=>{r&&synchronizeBackView(P,a,r,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,a,o,e)}};Object.keys(f).forEach(v=>{v!==n&&f[v]()}),u&&(e==null||e.updateCameraZoom(u)),Y(P)});return{topViewAddSphere:J,topViewAddBox:K,topViewSelectedChanged:$,topViewUpdatePoint:st,sideViewUpdatePoint:tt,backViewUpdatePoint:et,topViewUpdateBox:rt,topViewUpdateLine:nt,sideViewUpdateBox:ot,backViewUpdateBox:it,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),e==null||e.generateBoxes(n)},initPointCloud3d:n=>{if(!e)return;const a={left:-n.width/2,right:n.width/2,top:n.height/2,bottom:-n.height/2,near:100,far:-100};e.initOrthographicCamera(a),e.initRenderer(),e.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(a=w){var P,u,d,C,f,v;if(!(a==null?void 0:a.url)||!e)return;actionCreators.SetPointCloudLoading(F,!0),yield e.loadPCDFile(a.url,(P=L==null?void 0:L.radius)!=null?P:DEFAULT_RADIUS),h.forEach(U=>{e==null||e.removeObjectByName(U.id)}),g.forEach(U=>{e==null||e.removeObjectByName(U.id)});let m=[],S=[],B=[],A=[];w.result?(m=lbUtils.PointCloudUtils.getBoxParamsFromResultList(w.result),B=lbUtils.PointCloudUtils.getPolygonListFromResultList(w.result),S=lbUtils.PointCloudUtils.getLineListFromResultList(w.result),A=lbUtils.PointCloudUtils.getSphereParamsFromResultList(w.result),m.forEach(U=>{e==null||e.generateBox(U)}),A.forEach(U=>{e==null||e.generateSphere(U)}),t.syncAllViewPointCloudColor(m),t.setPointCloudResult(m),t.setPolygonList(B),t.setLineList(S),t.setPointCloudSphereList(A)):(t.setPointCloudResult([]),t.setPolygonList([]),t.setPointCloudSphereList([]),t.setLineList([])),b({pointCloudBoxList:m,polygonList:B}),e.updateTopCamera();const q=(d=(u=index.jsonParser(a.result))==null?void 0:u.valid)!=null?d:!0;t.setPointCloudValid(q),(C=t.sideViewInstance)==null||C.clearAllData(),(f=t.backViewInstance)==null||f.clearAllData(),o.updateData(a.url,a.result,{radius:(v=L==null?void 0:L.radius)!=null?v:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(F,!1)})}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),_=require("lodash");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const useSphere=()=>{const{pointCloudSphereList:e,setPointCloudSphereList:u,selectedID:i,mainViewInstance:r}=React.useContext(PointCloudContext.PointCloudContext),l=React.useMemo(()=>e.find(t=>t.id===i),[i,e]),d=React.useCallback(t=>e.find(n=>n.id===t),[e]),s=React.useCallback(t=>{const n=e.findIndex(o=>o.id===t.id);if(n>-1){e.splice(n,1,___default.default.merge(e[n],t));const o=___default.default.cloneDeep(e);return u(o),o}return e},[e]),c=React.useCallback(t=>{const n=e.filter(o=>o.id!==t);u(n),r==null||r.removeObjectByName(t),r==null||r.render()},[e]);return{selectedSphere:l,getPointCloudSphereByID:d,updatePointCloudSphere:s,deletePointCloudSphere:c}};exports.useSphere=useSphere;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:r,backViewInstance:a,mainViewInstance:t,pointCloudBoxList:c,pointCloudSphereList:d,setPointCloudResult:P,setPointCloudSphereList:C,setPolygonList:v,pointCloudPattern:u,setPointCloudPattern:n,syncAllViewPointCloudColor:h}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:y}=useHistory.useHistory(),p=()=>{c.forEach(e=>{t==null||t.removeObjectByName(e.id)}),d.forEach(e=>{t==null||t.removeObjectByName(e.id)}),t==null||t.render(),P([]),v([]),C([]),i==null||i.toolScheduler.clearStatusAndResult(),h([]),y({pointCloudBoxList:[],polygonList:[]})},l=()=>{r==null||r.toolInstance.clearResult(),a==null||a.toolInstance.clearResult()};return{clearAllResult:p,updatePointCloudPattern:e=>{if(e===u)return;const s=[i,r,a];switch(e){case EToolName.Rect:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Rect)}),n(EToolName.Rect);break;case EToolName.Polygon:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Normal)}),n(EToolName.Polygon);break;case EToolName.Point:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Point)}),n(EToolName.Point);break;case EToolName.Line:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Line)}),n(EToolName.Line);break}},pointCloudPattern:u}};exports.useStatus=useStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useZoom=()=>{const{topViewInstance:o}=React.useContext(PointCloudContext.PointCloudContext),{zoom:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useZoom=()=>{const{topViewInstance:o,sideViewInstance:i,backViewInstance:l}=React.useContext(PointCloudContext.PointCloudContext),{zoom:s,setZoom:c}=React.useContext(PointCloudContext.PointCloudContext);return{zoom:s,setZoom:c,initialPosition:()=>{o==null||o.pointCloud2dOperation.initImgPos()},zoomOut:()=>{o==null||o.pointCloud2dOperation.zoomChanged(!1)},zoomIn:()=>{o==null||o.pointCloud2dOperation.zoomChanged(!0)},syncTopviewToolZoom:(n,t,e)=>{o==null||o.toolScheduler.syncPosition(n,t,e,o==null?void 0:o.toolInstance)},syncSideviewToolZoom:(n,t,e)=>{i==null||i.toolScheduler.syncPosition(n,t,e,i==null?void 0:i.toolInstance)},syncBackviewToolZoom:(n,t,e)=>{l==null||l.toolScheduler.syncPosition(n,t,e,l==null?void 0:l.toolInstance)}}};exports.useZoom=useZoom;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';
|
|
1
|
+
import { IPointCloudBox, IPointCloudBoxList, IPolygonData, IPointCloudSphereList, IPointCloudSphere, ILine } from '@labelbee/lb-utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PointCloud, PointCloudAnnotation, ActionsHistory, EToolName } from '@labelbee/lb-annotation';
|
|
4
4
|
interface IPointCloudContextInstances {
|
|
@@ -14,26 +14,32 @@ interface IPointCloudContextInstances {
|
|
|
14
14
|
type AttrPanelLayout = '' | 'left' | 'right';
|
|
15
15
|
export interface IPointCloudContext extends IPointCloudContextInstances {
|
|
16
16
|
pointCloudBoxList: IPointCloudBoxList;
|
|
17
|
+
pointCloudSphereList: IPointCloudSphereList;
|
|
17
18
|
displayPointCloudList: IPointCloudBoxList;
|
|
19
|
+
displaySphereList: IPointCloudSphereList;
|
|
18
20
|
selectedIDs: string[];
|
|
19
21
|
setSelectedIDs: (ids?: string[] | string) => void;
|
|
20
22
|
valid: boolean;
|
|
21
23
|
setPointCloudResult: (resultList: IPointCloudBoxList) => void;
|
|
24
|
+
setPointCloudSphereList: (sphereList: IPointCloudSphereList) => void;
|
|
22
25
|
selectedPointCloudBox?: IPointCloudBox;
|
|
23
26
|
setPointCloudValid: (valid?: boolean) => void;
|
|
24
27
|
addSelectedID: (selectedID: string) => void;
|
|
25
28
|
selectedAllBoxes: () => void;
|
|
26
29
|
selectedID: string;
|
|
27
30
|
addPointCloudBox: (boxParams: IPointCloudBox) => IPointCloudBox[];
|
|
31
|
+
addPointCloudSphere: (sphereParams: IPointCloudSphere) => IPointCloudSphere[];
|
|
28
32
|
polygonList: IPolygonData[];
|
|
29
33
|
setPolygonList: (polygonList: IPolygonData[]) => void;
|
|
34
|
+
lineList: ILine[];
|
|
35
|
+
setLineList: (lineList: ILine[]) => void;
|
|
30
36
|
zoom: number;
|
|
31
37
|
setZoom: (zoom: number) => void;
|
|
32
38
|
history: ActionsHistory;
|
|
33
39
|
hideAttributes: string[];
|
|
34
40
|
setHideAttributes: (hideAttrs: string[]) => void;
|
|
35
41
|
toggleAttributesVisible: (attribute: string) => void;
|
|
36
|
-
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[]) => void;
|
|
42
|
+
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[], _displaySphereList: IPointCloudSphereList, _lineList: ILine[]) => void;
|
|
37
43
|
attrPanelLayout: AttrPanelLayout;
|
|
38
44
|
setAttrPanelLayout: (layout: AttrPanelLayout) => void;
|
|
39
45
|
syncAllViewPointCloudColor: (newPointCloudList?: IPointCloudBox[]) => void;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';
|
|
1
|
+
import { IPointCloudBox, IPointCloudBoxList, IPolygonData, IPointUnit, ILine } from '@labelbee/lb-utils';
|
|
2
2
|
export declare const useHistory: () => {
|
|
3
|
-
addHistory: ({ newBoxParams, newPolygon, }: {
|
|
3
|
+
addHistory: ({ newBoxParams, newPolygon, newLine, }: {
|
|
4
4
|
newBoxParams?: IPointCloudBox | undefined;
|
|
5
5
|
newPolygon?: IPolygonData | undefined;
|
|
6
|
+
newLine?: ILine | undefined;
|
|
6
7
|
}) => void;
|
|
7
8
|
pushHistoryWithList: (params: Partial<{
|
|
8
9
|
pointCloudBoxList: IPointCloudBoxList;
|
|
9
10
|
polygonList: IPolygonData[];
|
|
11
|
+
lineList: ILine[];
|
|
10
12
|
}>) => void;
|
|
11
13
|
initHistory: ({ pointCloudBoxList, polygonList, }: {
|
|
12
14
|
pointCloudBoxList: IPointCloudBoxList;
|
|
13
15
|
polygonList: IPolygonData[];
|
|
14
16
|
}) => void;
|
|
17
|
+
pushHistoryUnderUpdatePoint: (point: IPointUnit) => void;
|
|
15
18
|
pushHistoryUnderUpdatePolygon: (polygon: IPolygonData) => void;
|
|
19
|
+
pushHistoryUnderUpdateLine: (line: ILine) => void;
|
|
16
20
|
redo: () => void;
|
|
17
21
|
undo: () => void;
|
|
18
22
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ILine } from '@labelbee/lb-utils';
|
|
2
|
+
/**
|
|
3
|
+
* PointCloud line Hook
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const useLine: () => {
|
|
7
|
+
addLine: (line: ILine) => void;
|
|
8
|
+
deleteLine: (id: string) => void;
|
|
9
|
+
selectedLine: ILine | undefined;
|
|
10
|
+
updateSelectedLine: (line: ILine) => void;
|
|
11
|
+
updateLineValidByID: (id: string) => void;
|
|
12
|
+
};
|
|
@@ -4,27 +4,49 @@
|
|
|
4
4
|
* @createdate 2022-08-17
|
|
5
5
|
*/
|
|
6
6
|
import { PointCloudAnnotation, PointCloud } from '@labelbee/lb-annotation';
|
|
7
|
-
import { IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';
|
|
7
|
+
import { IPointCloudBox, IPointCloudSphere, IPointUnit, UpdatePolygonByDragList, ILine } from '@labelbee/lb-utils';
|
|
8
8
|
import { ISize } from '@/types/main';
|
|
9
9
|
import { IFileItem } from '@/types/data';
|
|
10
|
+
export declare const topViewPoint2PointCloud: (newPoint: any, size: ISize, pointCloud: PointCloud, selectedPointCloudSphere?: IPointCloudSphere, defaultValue?: {
|
|
11
|
+
[v: string]: any;
|
|
12
|
+
} | undefined) => IPointCloudSphere;
|
|
10
13
|
export declare const topViewPolygon2PointCloud: (newPolygon: any, size: ISize, pointCloud?: PointCloud, selectedPointCloudBox?: IPointCloudBox, defaultValue?: {
|
|
11
14
|
[v: string]: any;
|
|
12
15
|
} | undefined, intelligentFit?: boolean) => {
|
|
13
16
|
boxParams: Omit<IPointCloudBox, "trackID">;
|
|
14
17
|
newPointList: any;
|
|
15
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param sphereParams
|
|
22
|
+
* @param newPoint
|
|
23
|
+
* @param sideViewInstance
|
|
24
|
+
* @param url
|
|
25
|
+
* todo: need to be merged with func synchronizeSideView
|
|
26
|
+
*/
|
|
27
|
+
export declare const syncSideViewByPoint: (sphereParams: IPointCloudSphere, newPoint: IPointUnit, sideViewInstance: PointCloudAnnotation | undefined, url: string, config?: any) => void;
|
|
16
28
|
/**
|
|
17
29
|
* NewBox synchronize sideView
|
|
18
30
|
* @param boxParams
|
|
19
31
|
* @param newPolygon TODO! Need to add type
|
|
20
32
|
*/
|
|
21
33
|
export declare const synchronizeSideView: (boxParams: IPointCloudBox, newPolygon: any, sideViewInstance: PointCloudAnnotation | undefined, url: string) => void;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param sphereParams
|
|
37
|
+
* @param newPoint
|
|
38
|
+
* @param backViewInstance
|
|
39
|
+
* @param url
|
|
40
|
+
* todo: need to be merged with func synchronizeBackView
|
|
41
|
+
*/
|
|
42
|
+
export declare const syncBackViewByPoint: (sphereParams: IPointCloudSphere, newPoint: IPointUnit, backViewInstance: PointCloudAnnotation | undefined, url: string, config?: any) => void;
|
|
22
43
|
/**
|
|
23
44
|
* NewBox synchronize backView
|
|
24
45
|
* @param boxParams
|
|
25
46
|
* @param newPolygon TODO! Need to add type
|
|
26
47
|
*/
|
|
27
48
|
export declare const synchronizeBackView: (boxParams: IPointCloudBox, newPolygon: any, BackViewInstance: PointCloudAnnotation, url: string) => void;
|
|
49
|
+
export declare const syncTopViewByPoint: (newSphereParams: IPointCloudSphere, newPoint: any, topViewInstance?: PointCloudAnnotation, mainViewInstance?: PointCloud) => void;
|
|
28
50
|
/**
|
|
29
51
|
* NewBox synchronize TopView
|
|
30
52
|
* @param boxParams
|
|
@@ -32,15 +54,26 @@ export declare const synchronizeBackView: (boxParams: IPointCloudBox, newPolygon
|
|
|
32
54
|
*/
|
|
33
55
|
export declare const synchronizeTopView: (newBoxParams: IPointCloudBox, newPolygon: any, topViewInstance?: PointCloudAnnotation, mainViewInstance?: PointCloud) => void;
|
|
34
56
|
export declare const usePointCloudViews: () => {
|
|
57
|
+
topViewAddSphere: () => void;
|
|
35
58
|
topViewAddBox: () => void;
|
|
36
59
|
topViewSelectedChanged: () => void;
|
|
37
60
|
sideViewUpdateBox: () => void;
|
|
38
61
|
backViewUpdateBox: () => void;
|
|
62
|
+
topViewUpdatePoint?: undefined;
|
|
63
|
+
sideViewUpdatePoint?: undefined;
|
|
64
|
+
backViewUpdatePoint?: undefined;
|
|
39
65
|
topViewUpdateBox?: undefined;
|
|
66
|
+
topViewUpdateLine?: undefined;
|
|
40
67
|
pointCloudBoxListUpdated?: undefined;
|
|
41
68
|
initPointCloud3d?: undefined;
|
|
42
69
|
updatePointCloudData?: undefined;
|
|
43
70
|
} | {
|
|
71
|
+
topViewAddSphere: ({ newPoint, size, zoom, trackConfigurable, }: {
|
|
72
|
+
newPoint: IPointUnit;
|
|
73
|
+
size: ISize;
|
|
74
|
+
zoom: number;
|
|
75
|
+
trackConfigurable?: boolean | undefined;
|
|
76
|
+
}) => void;
|
|
44
77
|
topViewAddBox: ({ polygon, size, imgList, trackConfigurable, zoom, intelligentFit, }: {
|
|
45
78
|
polygon: any;
|
|
46
79
|
size: ISize;
|
|
@@ -49,8 +82,17 @@ export declare const usePointCloudViews: () => {
|
|
|
49
82
|
zoom: number;
|
|
50
83
|
intelligentFit?: boolean | undefined;
|
|
51
84
|
}) => void;
|
|
52
|
-
topViewSelectedChanged: (newSelectedBox
|
|
85
|
+
topViewSelectedChanged: ({ newSelectedBox, newPointCloudList, newSelectedSphere, newSphereList, }: {
|
|
86
|
+
newSelectedBox?: IPointCloudBox | undefined;
|
|
87
|
+
newPointCloudList?: IPointCloudBox[] | undefined;
|
|
88
|
+
newSelectedSphere?: IPointCloudSphere | undefined;
|
|
89
|
+
newSphereList?: IPointCloudSphere[] | undefined;
|
|
90
|
+
}) => void;
|
|
91
|
+
topViewUpdatePoint: (updatePoint: IPointUnit, size: ISize) => void;
|
|
92
|
+
sideViewUpdatePoint: (newPoint: IPointUnit, originPoint: IPointUnit) => void;
|
|
93
|
+
backViewUpdatePoint: (newPoint: IPointUnit, originPoint: IPointUnit) => void;
|
|
53
94
|
topViewUpdateBox: (updateList: UpdatePolygonByDragList, size: ISize) => void;
|
|
95
|
+
topViewUpdateLine: (updateList: ILine, size: ISize) => void;
|
|
54
96
|
sideViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
55
97
|
backViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
56
98
|
pointCloudBoxListUpdated: (newBoxes: IPointCloudBox[]) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const useSphere: () => {
|
|
2
|
+
selectedSphere: import("@labelbee/lb-utils").IPointCloudSphere | undefined;
|
|
3
|
+
getPointCloudSphereByID: (id: string) => import("@labelbee/lb-utils").IPointCloudSphere | undefined;
|
|
4
|
+
updatePointCloudSphere: (sphereParams: any) => import("@labelbee/lb-utils").IPointCloudSphereList;
|
|
5
|
+
deletePointCloudSphere: (id: string) => void;
|
|
6
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { ICoordinate, ISize } from '@labelbee/lb-utils';
|
|
1
2
|
export declare const useZoom: () => {
|
|
2
3
|
zoom: number;
|
|
3
4
|
setZoom: (zoom: number) => void;
|
|
4
5
|
initialPosition: () => void;
|
|
5
6
|
zoomOut: () => void;
|
|
6
7
|
zoomIn: () => void;
|
|
8
|
+
syncTopviewToolZoom: (currentPos: ICoordinate, zoom: number, size: ISize) => void;
|
|
9
|
+
syncSideviewToolZoom: (currentPos: ICoordinate, zoom: number, size: ISize) => void;
|
|
10
|
+
syncBackviewToolZoom: (currentPos: ICoordinate, zoom: number, size: ISize) => void;
|
|
7
11
|
};
|