@labelbee/lb-components 1.10.0-alpha.0 → 1.10.0-alpha.1
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/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 +6 -2
- package/dist/types/components/pointCloudView/hooks/useHistory.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +42 -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/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:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},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[i,b]=React.useState([]),[c,y]=React.useState([]),[P,O]=React.useState([]),[l,C]=React.useState([]),[h,j]=React.useState(!0),[L,N]=React.useState(1),[r,T]=React.useState(),[m,_]=React.useState(),[w,k]=React.useState(),[o,q]=React.useState(),[I,z]=React.useState(""),[V,F]=React.useState(lbAnnotation.EToolName.Rect),Z=React.useRef(new lbAnnotation.ActionsHistory).current,[s,S]=React.useState([]),[g,G]=React.useState(""),x=React.useMemo(()=>l.length===1?l[0]:"",[l]),B=React.useMemo(()=>{const a=i.find(t=>t.id===x),v=t=>{const e=i.concat(t);return b(e),e},A=t=>{const e=c.concat(t);return y(e),e},p=t=>{j(t!==!1)},n=t=>{t===void 0&&C([]),typeof t=="string"&&C([t]),Array.isArray(t)&&C(Array.from(new Set(t)))},K=t=>{l.includes(t)?n(l.filter(e=>e!==t)):n([...l,t])},Q=()=>{n(i.map(t=>t.id))},U=t=>{n(i.filter(e=>e.attribute===t).map(e=>e.id))},R=i.filter(t=>!s.includes(t.attribute)),D=c.filter(t=>!s.includes(t.attribute)),W=t=>{if(s.includes(t))S(s.filter(e=>e!==t));else{const e=s.concat(t);S(e)}},X=(t=R,e=P,f=D)=>{i.forEach(d=>{o==null||o.removeObjectByName(d.id)}),c.forEach(d=>{o==null||o.removeObjectByName(d.id)}),r==null||r.updatePolygonList(t,e),r==null||r.updatePointList(f),o==null||o.generateBoxes(t),o==null||o.generateSpheres(f),E(t)},E=t=>{const e=o==null?void 0:o.highlightOriginPointCloud(t);return new Promise(f=>{e==null||e.then(d=>{[r].forEach(H=>{var M;d&&((M=H==null?void 0:H.pointCloudInstance)==null||M.updateColor(d),f({color:d}))})})})};return{selectedID:x,pointCloudBoxList:i,pointCloudSphereList:c,displayPointCloudList:R,displaySphereList:D,selectedIDs:l,setPointCloudResult:b,setSelectedIDs:n,addPointCloudBox:v,addPointCloudSphere:A,setPointCloudSphereList:y,valid:h,selectedPointCloudBox:a,setPointCloudValid:p,addSelectedID:K,selectedAllBoxes:Q,topViewInstance:r,setTopViewInstance:T,sideViewInstance:m,setSideViewInstance:_,backViewInstance:w,setBackViewInstance:k,mainViewInstance:o,setMainViewInstance:q,polygonList:P,setPolygonList:O,zoom:L,setZoom:N,history:Z,toggleAttributesVisible:W,hideAttributes:s,setHideAttributes:S,reRender:X,attrPanelLayout:g,setAttrPanelLayout:G,syncAllViewPointCloudColor:E,defaultAttribute:I,setDefaultAttribute:z,pointCloudPattern:V,setPointCloudPattern:F,selectSpecAttr:U}},[h,l,i,c,P,r,m,w,o,L,s,g,I,V]),J=()=>{const a=i.filter(n=>s.includes(n.attribute)),{setSelectedIDs:v,reRender:A}=B,p=a.map(n=>n.id);p.length>0&&v(l.filter(n=>!p.includes(n))),A()};return React.useEffect(()=>{var a;J(),(a=r==null?void 0:r.pointCloud2dOperation)==null||a.setHiddenAttributes(s)},[s]),React__default.default.createElement(PointCloudContext.Provider,{value:B},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 o=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:B,selectNextBox:I,selectPrevBox:V,updateSelectedBox:C,deleteSelectedPointCloudBoxAndPolygon:E}=useSingleBox.useSingleBox(),{selectedSphere:f,updatePointCloudSphere:L}=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 t;const{topViewInstance:s}=o;!s||(t=s.pointCloud2dOperation)==null||t.updateSelectedPolygonsPoints(e)},K=(e,t)=>{var s;const{topViewInstance:n,mainViewInstance:l}=o;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":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){V();break}I(),t.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":E();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(t.keyCode,r.attributeList);d!==void 0&&a.current.setDefaultAttribute(d)}return}}},U=(e,t)=>{switch(e){case"c":O();break;case"v":j();break;case"a":t.preventDefault(),o.selectedAllBoxes();break;case"z":{t.shiftKey?h():g();break}}},k=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||i===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){U(t,e);return}K(t,e)};return React.useEffect(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[o,T,r,o.pointCloudBoxList,o.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,o.mainViewInstance]),React.useEffect(()=>{o.setHideAttributes([])},[w]),React.useEffect(()=>{a.current.exportData=()=>[o.pointCloudBoxList,{valid:o.valid}],a.current.exportCustomData=()=>{var e,t;return{resultPolygon:(e=o.polygonList)!=null?e:[],resultPoint:(t=o.pointCloudSphereList)!=null?t:[]}},a.current.setDefaultAttribute=e=>{var t;S(e);const s=o.selectedPointCloudBox;if(s){s.attribute=e;const n=C(s);o.mainViewInstance&&x({newSelectedBox:s,newPointCloudList:n})}if(m&&D(__spreadProps(__spreadValues({},m),{attribute:e})),f){const n=L(__spreadProps(__spreadValues({},f),{attribute:e}));o.mainViewInstance&&((t=o.mainViewInstance)==null||t.generateSpheres(n),x({newSelectedSphere:f,newSphereList:n}))}},a.current.setSubAttribute=(e,t)=>{var s;const n=o.selectedPointCloudBox;if(n){const l=(s=n==null?void 0:n.subAttribute)!=null?s:{};n.subAttribute=__spreadProps(__spreadValues({},l),{[e]:t}),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(()=>{o.setPointCloudValid(e),e===!1&&b()})},a.current.setForbidOperation=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&o.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)},a.current.asyncData=e=>{setTimeout(()=>{p==null||p(e)})}},[o.pointCloudBoxList,o.pointCloudSphereList,o.selectedID,o.valid,o.polygonList,o.mainViewInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{R({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.toolInstance;if(!t||i)return;const s=c=>{S(c)},n=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return t.on("syncAttribute",s),t.on("messageError",n),t.on("messageInfo",l),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",n),t.unbind("messageInfo",l)}},[o.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(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,
|
|
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"),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(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,i)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,__spreadValues=(e,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(e,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(e,i,n[i]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(e,n,i=1)=>{const{width:c,height:m}=n,g={x:e.x+c*i/2,y:e.y+m*i/2},C={x:n.width/2,y:n.height/2};return{offsetX:(C.x-g.x)/i,offsetY:-(C.y-g.y)/i}},TopViewToolbar=({currentData:e})=>{const{zoom:n,zoomIn:i,zoomOut:c,initialPosition:m}=useZoom.useZoom(),{selectNextBox:g,selectPrevBox:C}=useSingleBox.useSingleBox(),{updateRotate:w}=useRotate.useRotate({currentData:e}),x=2,p=()=>{w(-x)},t=()=>{w(x)},a=()=>{w(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:t,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:p,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:a,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{C()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{g()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(index$2.ZoomController,{initialPosition:m,zoomIn:i,zoomOut:c,zoom:n}))},ZAxisSlider=({setZAxisLimit:e,zAxisLimit:n,checkMode:i})=>i?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:n,onAfterChange:c=>{e(c)}})),PointCloudTopView=({currentData:e,imgList:n,stepInfo:i,drawLayerSlot:c,checkMode:m,intelligentFit:g})=>{var C;const[w,x]=React.useState({zoom:1,currentPos:{x:0,y:0}}),p=React.useRef(null),t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=useSize(p),P=index.jsonParser(i.config),{setZoom:O,syncTopviewToolZoom:_}=useZoom.useZoom(),{hideAttributes:q}=t,{addPolygon:E,deletePolygon:j}=usePolygon.usePolygon(),{deletePointCloudSphere:L}=useSphere.useSphere(),{deletePointCloudBox:A,changeValidByID:N}=useSingleBox.useSingleBox(),[y,T]=React.useState(10),{t:k}=reactI18next.useTranslation(),f=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(!t.topViewInstance&&p.current&&(e==null?void 0:e.url)&&(e==null?void 0:e.result)){const l={width:p.current.clientWidth,height:p.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:p.current,size:l,pcdPath:e.url,config:P,checkMode:m,toolName:ToolUtils.getPointCloudToolList()});t.setTopViewInstance(u)}},[e]),React.useEffect(()=>{if(!a||!t.topViewInstance||!t.sideViewInstance)return;const{toolInstance:l}=t.topViewInstance;l.singleOn("pointCreated",(o,s)=>{f.topViewAddSphere({newPoint:o,size:a,trackConfigurable:P.trackConfigurable,zoom:s})}),l.singleOn("pointDeleted",o=>{L(o)}),l.singleOn("pointSelected",o=>{t.setSelectedIDs([o])}),l.singleOn("updatePointByDrag",(o,s)=>{var d;(d=f.topViewUpdatePoint)==null||d.call(f,o,a)}),l.singleOn("polygonCreated",(o,s)=>{if(l.pattern===EPolygonPattern.Normal||!(e==null?void 0:e.url)){const d=__spreadProps(__spreadValues({},o),{pointList:o.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,a))});E(d),t.setSelectedIDs(q.includes(o.attribute)?"":o.id);return}f.topViewAddBox({polygon:o,size:a,imgList:n,trackConfigurable:P.trackConfigurable,zoom:s,intelligentFit:g})}),l.singleOn("deletedObject",({id:o})=>{A(o),j(o)}),l.singleOn("deleteSelectedIDs",()=>{t.setSelectedIDs([])}),l.singleOn("addSelectedIDs",o=>{t.addSelectedID(o)}),l.singleOn("setSelectedIDs",o=>{t.setSelectedIDs(o)}),l.singleOn("updatePolygonByDrag",o=>{var s;(s=f.topViewUpdateBox)==null||s.call(f,o,a)});const u=o=>{var s;const d=N(o);d&&t.syncAllViewPointCloudColor(d),t.polygonList.find(r=>r.id===o)&&((s=t.topViewInstance)==null||s.toolInstance.setPolygonValidAndRender(o,!0))};return l.on("validUpdate",u),()=>{l.unbind("validUpdate",u)}},[t,a,e,f,t.polygonList]),React.useEffect(()=>{var l,u;if(!(a==null?void 0:a.width)||!t.topViewInstance)return;const o=(u=(l=P==null?void 0:P.attributeList)==null?void 0:l[0])==null?void 0:u.value;o&&t.topViewInstance.toolInstance.setDefaultAttribute(o),t.topViewInstance.initSize(a),t.topViewInstance.updatePolygonList(t.displayPointCloudList,t.polygonList),t.topViewInstance.updatePointList(t.displaySphereList);const{topViewInstance:{pointCloudInstance:s,toolInstance:d}}=t;d.singleOn("renderZoom",(r,v)=>{const{offsetX:I,offsetY:h}=TransferCanvas2WorldOffset(v,a,r);if(s.camera.zoom=r,v){const{x:V,y:S,z:b}=s.initCameraPosition;s.camera.position.set(V+h,S-I,b)}s.camera.updateProjectionMatrix(),s.render(),O(r),_(v,r,a),x({zoom:r,currentPos:v})}),d.singleOn("dragMove",({currentPos:r,zoom:v})=>{const{offsetX:I,offsetY:h}=TransferCanvas2WorldOffset(r,a,v);s.camera.zoom=v;const{x:V,y:S,z:b}=s.initCameraPosition;s.camera.position.set(V+h,S-I,b),s.render(),x({zoom:v,currentPos:r})})},[a,t.topViewInstance,(C=t.topViewInstance)==null?void 0:C.toolInstance]),React.useEffect(()=>{var l,u;(u=(l=t.topViewInstance)==null?void 0:l.pointCloudInstance)==null||u.applyZAxisPoints(y)},[y]),React.useEffect(()=>{f.topViewSelectedChanged({})},[t.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:k("TopView"),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:e})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:p},c==null?void 0:c(w)),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:m,config:P}),React__default.default.createElement(ZAxisSlider,{checkMode:m,zAxisLimit:y,setZAxisLimit:T}),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,i,
|
|
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,i,s)=>i in e?__defProp(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,__spreadValues=(e,i)=>{for(var s in i||(i={}))__hasOwnProp.call(i,s)&&__defNormalProp(e,s,i[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(i))__propIsEnum.call(i,s)&&__defNormalProp(e,s,i[s]);return e};const useHistory=()=>{const{history:e,setPointCloudResult:i,setSelectedIDs:s,pointCloudBoxList:r,pointCloudSphereList:L,mainViewInstance:u,topViewInstance:y,polygonList:d,setPolygonList:a,syncAllViewPointCloudColor:C}=React.useContext(PointCloudContext.PointCloudContext),P=({newBoxParams:o,newPolygon:t})=>{const n={pointCloudBoxList:r,polygonList:d};o&&(n.pointCloudBoxList=r.concat(o)),t&&(n.polygonList=d.concat(t)),e.pushHistory(n)},g=o=>{const t={pointCloudBoxList:r,polygonList:d};o.pointCloudBoxList&&(t.pointCloudBoxList=o.pointCloudBoxList),o.polygonList&&(t.polygonList=o.polygonList),e.pushHistory(t)},h=o=>{o&&e.pushHistory({pointCloudSphereList:L})},v=o=>{if(d.find(n=>n.id===o.id)){const n=d.map(c=>c.id===o.id?o:__spreadValues({},c));e.pushHistory({pointCloudBoxList:r,polygonList:n}),a(n)}},x=({pointCloudBoxList:o,polygonList:t})=>{e.initRecord({pointCloudBoxList:o,polygonList:t},!0)},f=o=>{if(!o)return;const{pointCloudBoxList:t=[],polygonList:n=[]}=o;if(t){r.length!==t.length&&s();const c=r.filter(l=>t.every(p=>p.id!==l.id)),_=t.filter(l=>r.every(p=>p.id!==l.id));c.forEach(l=>{u==null||u.removeObjectByName(l.id)}),_.forEach(l=>{u==null||u.generateBox(l)}),i(t),C(t)}n&&a(n),y==null||y.updatePolygonList(t!=null?t:[],n!=null?n:[])};return{addHistory:P,pushHistoryWithList:g,initHistory:x,pushHistoryUnderUpdatePoint:h,pushHistoryUnderUpdatePolygon:v,redo:()=>{f(e.redo())},undo:()=>{f(e.undo())}}};exports.useHistory=useHistory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),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,n)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,__spreadValues=(t,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(t,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(t,n,o[n]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o)),__async=(t,o,n)=>new Promise((r,e)=>{var c=l=>{try{s(n.next(l))}catch(h){e(h)}},p=l=>{try{s(n.throw(l))}catch(h){e(h)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(c,p);s((n=n.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(t,o,n,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,n,r,e,c)=>{let p=t.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,o)),s=0,l=1,h={};if(n){const y=n.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,L,A]=p,U=lbAnnotation.MathUtils.getLineCenterPoint([g,A]),I=lbAnnotation.MathUtils.getLineLength(g,L),D=lbAnnotation.MathUtils.getLineLength(L,A),_=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);r&&(s=r.center.z,l=r.depth);const V={center:{x:U.x,y:U.y,z:s},width:D,height:I,depth:l,rotation:_,id:t.id},w=__spreadValues(r?__spreadValues(__spreadValues({},r),V):__spreadProps(__spreadValues({},V),{attribute:"",valid:!0}),h);e&&Object.assign(w,e);const O=p.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,o));return{boxParams:w,newPointList:O}},sideViewPoint2PointCloud=(t,o,n)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x-r.x,y:n.center.y,z:n.center.z-r.y}})},sideViewPolygon2PointCloud=(t,o,n,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),L=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),U={x:{x:g.x-L.x,y:g.y-L.y}.x,y:0,z:g.y-L.y},I=lbAnnotation.MathUtils.getLineLength(e,c),D=lbAnnotation.MathUtils.getLineLength(s,l),_=I-D,V=lbAnnotation.MathUtils.getLineLength(c,p),w=lbAnnotation.MathUtils.getLineLength(l,h),O=V-w,{newBoxParams:y}=r.getNewBoxBySideUpdate(U,O,_,n);return y},backViewPoint2PointCloud=(t,o,n)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x,y:n.center.y-r.x,z:n.center.z-r.y}})},backViewPolygon2PointCloud=(t,o,n,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),L=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),U={x:{x:g.x-L.x,y:g.y-L.y}.x,y:0,z:g.y-L.y},I=lbAnnotation.MathUtils.getLineLength(e,c),D=lbAnnotation.MathUtils.getLineLength(s,l),_=I-D,V=lbAnnotation.MathUtils.getLineLength(c,p),w=lbAnnotation.MathUtils.getLineLength(l,h),O=V-w;let{newBoxParams:y}=r.getNewBoxByBackUpdate(U,O,_,n);return y},syncSideViewByPoint=(t,o,n,r,e)=>{var c;if(!n)return;const{toolInstance:p,pointCloudInstance:s}=n;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,n,r)=>{if(!n)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=n;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,n,r,e)=>{var c;if(!n)return;const{toolInstance:p,pointCloudInstance:s}=n;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,n,r)=>{if(!n)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=n;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,n,r)=>{if(!n||!r)return;r.generateSphere(t),r.updateCameraBySphere(t,lbUtils.EPerspectiveView.Top),r.render();const{toolInstance:e,pointCloudInstance:c}=n,{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,n,r)=>{var e;if(!n||!r)return;r.generateBox(t,o.id),r.render();const{pointCloud2dOperation:c,pointCloudInstance:p}=n,{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:n,backViewInstance:r,mainViewInstance:e,addPointCloudBox:c,addPointCloudSphere:p,setSelectedIDs:s,selectedIDs:l,pointCloudBoxList:h,pointCloudSphereList:g,hideAttributes:L}=t,{addHistory:A,initHistory:U,pushHistoryUnderUpdatePolygon:I,pushHistoryUnderUpdatePoint:D}=useHistory.useHistory(),{selectedPolygon:_}=usePolygon.usePolygon(),{updateSelectedBox:V,updateSelectedBoxes:w,getPointCloudByID:O}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:y,updatePointCloudSphere:q,selectedSphere:T}=useSphere.useSphere(),{currentData:S,config:B}=ctx.useSelector(i=>{const{stepList:a,step:P,imgList:u,imgIndex:d}=i.annotation;return{currentData:u[d],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,a).config)}}),H=ctx.useDispatch(),{selectedBox:j}=useSingleBox.useSingleBox(),{t:Z}=reactI18next.useTranslation(),N=j==null?void 0:j.info;if(!o||!n||!r)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:E}=o,G=i=>{e==null||e.generateBox(i),e==null||e.controls.update(),e==null||e.render()},X=i=>{e==null||e.generateSphere(i),e==null||e.controls.update(),e==null||e.render()},Y=({newPoint:i,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(i,a,E,void 0,C);s(i.id);const x=p(f);z(PointCloudView.Top,i,f,P,x,B)},Q=({polygon:i,size:a,imgList:P,trackConfigurable:u,zoom:d,intelligentFit:C})=>{var f;const x={attribute:(f=o.toolInstance.defaultAttribute)!=null?f:""};u===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:g})});const v=__spreadValues({},i),{boxParams:m,newPointList:k}=topViewPolygon2PointCloud(v,a,E,void 0,x,C),R=o==null?void 0:o.toolInstance;if((B==null?void 0:B.lowerLimitPointsNumInBox)&&typeof m.count=="number"&&m.count<B.lowerLimitPointsNumInBox){antd.message.info(Z("LowerLimitPointsNumInBox",{num:B.lowerLimitPointsNumInBox})),R.deletePolygon(m.id);return}C&&(k==null?void 0:k.length)&&(v.pointList=k);const b=L.includes(v.attribute),it=c(m);b?s([]):(s(m.id),R.setSelectedIDs([v.id]),M(PointCloudView.Top,v,m,d,it),C&&synchronizeTopView(m,v,o,e)),A({newBoxParams:m})},J=({newSelectedBox:i,newPointCloudList:a,newSelectedSphere:P,newSphereList:u})=>{const d=o==null?void 0:o.toolInstance;if(!(l.length===0||!d)){if(i||(j==null?void 0:j.info)){const C=i!=null?i:j==null?void 0:j.info;d.setSelectedIDs(l);const f=d.selectedPolygon;if(l.length===1&&C){M(PointCloudView.Top,f,C,void 0,a);return}}if((P||T)&&l.length===1){const C=P!=null?P:T;d.setSelectedID(l[0]);const f=d.selectedPoint;C&&z(PointCloudView.Top,f,C,void 0,u,B)}}},F=(i,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(i,a,N,n.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=V(d);return M(P,i,d,void 0,C),C}},W=(i,a,P)=>{if(T){let u,d;switch(P){case PointCloudView.Back:u=backViewPoint2PointCloud;break;case PointCloudView.Side:u=sideViewPoint2PointCloud;break;default:u=sideViewPoint2PointCloud;break}d=u(i,a,T);const C=q(d);return z(P,i,d,void 0,C,B),C}},K=(i,a)=>{W(i,a,PointCloudView.Side)},$=(i,a)=>{W(i,a,PointCloudView.Back)},tt=(i,a)=>{F(i,a,PointCloudView.Side)},et=(i,a)=>{F(i,a,PointCloudView.Back)},ot=(i,a)=>{const{x:P,y:u}=lbUtils.PointCloudUtils.transferCanvas2World(i,a);D(__spreadProps(__spreadValues({},i),{x:P,y:u}));const d=y(i.id),C=topViewPoint2PointCloud(i,a,E,d),f=q(C);z(PointCloudView.Top,i,C,void 0,f,B)},nt=(i,a)=>{if(_){const u=i[0].newPolygon;u.pointList=u.pointList.map(d=>lbUtils.PointCloudUtils.transferCanvas2World(d,a)),I(i[0].newPolygon);return}const P=i.map(({newPolygon:u})=>{const d=O(u.id),{boxParams:C}=topViewPolygon2PointCloud(u,a,o.pointCloudInstance,d);return C});if(P.length===1){const{newPolygon:u}=i[0],d=w(P);M(PointCloudView.Top,u,P[0],void 0,d)}else{const u=w(P);u&&t.syncAllViewPointCloudColor(u)}},z=(i,a,P,u,d,C)=>__async(void 0,null,function*(){const f=S==null?void 0:S.url,x={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,a,n,f,C)},[PointCloudView.Back]:()=>{r&&syncBackViewByPoint(P,a,r,f,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,a,o,e)}};Object.keys(x).forEach(v=>{v!==i&&x[v]()}),u&&(e==null||e.updateCameraZoom(u)),X(P)}),M=(i,a,P,u,d)=>__async(void 0,null,function*(){const C=S==null?void 0:S.url;d&&(yield t.syncAllViewPointCloudColor(d));const f={[PointCloudView.Side]:()=>{synchronizeSideView(P,a,n,C)},[PointCloudView.Back]:()=>{r&&synchronizeBackView(P,a,r,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,a,o,e)}};Object.keys(f).forEach(x=>{x!==i&&f[x]()}),u&&(e==null||e.updateCameraZoom(u)),G(P)});return{topViewAddSphere:Y,topViewAddBox:Q,topViewSelectedChanged:J,topViewUpdatePoint:ot,sideViewUpdatePoint:K,backViewUpdatePoint:$,topViewUpdateBox:nt,sideViewUpdateBox:tt,backViewUpdateBox:et,pointCloudBoxListUpdated:i=>{o.updatePolygonList(i),e==null||e.generateBoxes(i)},initPointCloud3d:i=>{if(!e)return;const a={left:-i.width/2,right:i.width/2,top:i.height/2,bottom:-i.height/2,near:100,far:-100};e.initOrthographicCamera(a),e.initRenderer(),e.render()},updatePointCloudData:(...i)=>__async(void 0,[...i],function*(a=S){var P,u,d,C,f,x;if(!(a==null?void 0:a.url)||!e)return;actionCreators.SetPointCloudLoading(H,!0),yield e.loadPCDFile(a.url,(P=B==null?void 0:B.radius)!=null?P:DEFAULT_RADIUS),h.forEach(b=>{e==null||e.removeObjectByName(b.id)}),g.forEach(b=>{e==null||e.removeObjectByName(b.id)});let v=[],m=[],k=[];S.result?(v=lbUtils.PointCloudUtils.getBoxParamsFromResultList(S.result),m=lbUtils.PointCloudUtils.getPolygonListFromResultList(S.result),k=lbUtils.PointCloudUtils.getSphereParamsFromResultList(S.result),v.forEach(b=>{e==null||e.generateBox(b)}),k.forEach(b=>{e==null||e.generateSphere(b)}),t.syncAllViewPointCloudColor(v),t.setPointCloudResult(v),t.setPolygonList(m),t.setPointCloudSphereList(k)):(t.setPointCloudResult([]),t.setPolygonList([]),t.setPointCloudSphereList([])),U({pointCloudBoxList:v,polygonList:m}),e.updateTopCamera();const R=(d=(u=index.jsonParser(a.result))==null?void 0:u.valid)!=null?d:!0;t.setPointCloudValid(R),(C=t.sideViewInstance)==null||C.clearAllData(),(f=t.backViewInstance)==null||f.clearAllData(),o.updateData(a.url,a.result,{radius:(x=B==null?void 0:B.radius)!=null?x:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(H,!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 } 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,17 +14,21 @@ 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;
|
|
30
34
|
zoom: number;
|
|
@@ -33,7 +37,7 @@ export interface IPointCloudContext extends IPointCloudContextInstances {
|
|
|
33
37
|
hideAttributes: string[];
|
|
34
38
|
setHideAttributes: (hideAttrs: string[]) => void;
|
|
35
39
|
toggleAttributesVisible: (attribute: string) => void;
|
|
36
|
-
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[]) => void;
|
|
40
|
+
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[], _displaySphereList: IPointCloudSphereList) => void;
|
|
37
41
|
attrPanelLayout: AttrPanelLayout;
|
|
38
42
|
setAttrPanelLayout: (layout: AttrPanelLayout) => void;
|
|
39
43
|
syncAllViewPointCloudColor: (newPointCloudList?: IPointCloudBox[]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';
|
|
1
|
+
import { IPointCloudBox, IPointCloudBoxList, IPolygonData, IPointUnit } from '@labelbee/lb-utils';
|
|
2
2
|
export declare const useHistory: () => {
|
|
3
3
|
addHistory: ({ newBoxParams, newPolygon, }: {
|
|
4
4
|
newBoxParams?: IPointCloudBox | undefined;
|
|
@@ -12,6 +12,7 @@ export declare const useHistory: () => {
|
|
|
12
12
|
pointCloudBoxList: IPointCloudBoxList;
|
|
13
13
|
polygonList: IPolygonData[];
|
|
14
14
|
}) => void;
|
|
15
|
+
pushHistoryUnderUpdatePoint: (point: IPointUnit) => void;
|
|
15
16
|
pushHistoryUnderUpdatePolygon: (polygon: IPolygonData) => void;
|
|
16
17
|
redo: () => void;
|
|
17
18
|
undo: () => void;
|
|
@@ -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 } 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,25 @@ 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;
|
|
40
66
|
pointCloudBoxListUpdated?: undefined;
|
|
41
67
|
initPointCloud3d?: undefined;
|
|
42
68
|
updatePointCloudData?: undefined;
|
|
43
69
|
} | {
|
|
70
|
+
topViewAddSphere: ({ newPoint, size, zoom, trackConfigurable, }: {
|
|
71
|
+
newPoint: IPointUnit;
|
|
72
|
+
size: ISize;
|
|
73
|
+
zoom: number;
|
|
74
|
+
trackConfigurable?: boolean | undefined;
|
|
75
|
+
}) => void;
|
|
44
76
|
topViewAddBox: ({ polygon, size, imgList, trackConfigurable, zoom, intelligentFit, }: {
|
|
45
77
|
polygon: any;
|
|
46
78
|
size: ISize;
|
|
@@ -49,7 +81,15 @@ export declare const usePointCloudViews: () => {
|
|
|
49
81
|
zoom: number;
|
|
50
82
|
intelligentFit?: boolean | undefined;
|
|
51
83
|
}) => void;
|
|
52
|
-
topViewSelectedChanged: (newSelectedBox
|
|
84
|
+
topViewSelectedChanged: ({ newSelectedBox, newPointCloudList, newSelectedSphere, newSphereList, }: {
|
|
85
|
+
newSelectedBox?: IPointCloudBox | undefined;
|
|
86
|
+
newPointCloudList?: IPointCloudBox[] | undefined;
|
|
87
|
+
newSelectedSphere?: IPointCloudSphere | undefined;
|
|
88
|
+
newSphereList?: IPointCloudSphere[] | undefined;
|
|
89
|
+
}) => void;
|
|
90
|
+
topViewUpdatePoint: (updatePoint: IPointUnit, size: ISize) => void;
|
|
91
|
+
sideViewUpdatePoint: (newPoint: IPointUnit, originPoint: IPointUnit) => void;
|
|
92
|
+
backViewUpdatePoint: (newPoint: IPointUnit, originPoint: IPointUnit) => void;
|
|
53
93
|
topViewUpdateBox: (updateList: UpdatePolygonByDragList, size: ISize) => void;
|
|
54
94
|
sideViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
55
95
|
backViewUpdateBox: (newPolygon: any, originPolygon: any) => 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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),React=require("react"),selectors=require("../../../../store/annotation/selectors.js"),ctx=require("../../../../store/ctx.js"),lbUtils=require("@labelbee/lb-utils"),icons=require("@ant-design/icons"),useHistory=require("../../../../components/pointCloudView/hooks/useHistory.js"),dom=require("../../../../utils/dom.js"),StepUtils=require("../../../../utils/StepUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),FooterPopover=require("../FooterPopover.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),React=require("react"),selectors=require("../../../../store/annotation/selectors.js"),ctx=require("../../../../store/ctx.js"),lbUtils=require("@labelbee/lb-utils"),icons=require("@ant-design/icons"),useHistory=require("../../../../components/pointCloudView/hooks/useHistory.js"),dom=require("../../../../utils/dom.js"),StepUtils=require("../../../../utils/StepUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),FooterPopover=require("../FooterPopover.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,t)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,__spreadValues=(e,n)=>{for(var t in n||(n={}))__hasOwnProp.call(n,t)&&__defNormalProp(e,t,n[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(n))__propIsEnum.call(n,t)&&__defNormalProp(e,t,n[t]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const AnnotatedAttributesItem=({attribute:e})=>{const n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:t,pointCloudSphereList:o,hideAttributes:s,toggleAttributesVisible:r,polygonList:u,setPolygonList:c,setPointCloudResult:i,setPointCloudSphereList:g,reRender:P,selectSpecAttr:x}=n,[p,y]=React.useState(!0),{pushHistoryWithList:b}=useHistory.useHistory(),m=[...t,...u,...o].filter(l=>l.attribute===e.value),C=()=>{r(e.value)},E=s.includes(e.value),A=({trackID:l,order:a})=>l||a,L=({trackID:l,order:a})=>l?`trackID_${l}`:`order_${a}`,h=l=>{if(m.length===0)return;const a=u.filter(d=>l!==d.attribute),f=t.filter(d=>l!==d.attribute),v=o.filter(d=>l!==d.attribute);P(f,a,v),c(a),i(f),g(v),b({pointCloudBoxList:f,polygonList:a})},_=l=>{antd.Modal.confirm({content:lbUtils.i18n.t("onDeleteGraphByAttr",{attribute:l.key}),onOk:()=>{h(l.value)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")})};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","item")},E?React__default.default.createElement(icons.EyeInvisibleFilled,{onClick:C}):React__default.default.createElement(icons.EyeFilled,{onClick:C}),React__default.default.createElement(icons.CaretDownFilled,{rotate:p?0:270,onClick:()=>{y(!p)}}),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","item","text"),onClick:()=>{x(e.value)}},e.key),React__default.default.createElement(icons.DeleteOutlined,{onClick:()=>_(e)})),p&&m.map((l,a)=>React__default.default.createElement("div",{key:L(__spreadProps(__spreadValues({},l),{order:a})),style:{paddingLeft:54}},`${A(__spreadProps(__spreadValues({},l),{order:a}))}.${e.key}`)))},AnnotatedAttributesPanel=()=>{const e=ctx.useSelector(selectors.stepConfigSelector),{attrPanelLayout:n,setAttrPanelLayout:t,pointCloudBoxList:o,polygonList:s}=React.useContext(PointCloudContext.PointCloudContext),{t:r}=reactI18next.useTranslation(),u=React.useMemo(()=>[...o,...s].map(i=>i.attribute),[o,s]),c=React.useMemo(()=>e.attributeList.filter(i=>u.includes(i.value)),[u]);return React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute")},n?React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",null,r("AnnotatedResult")),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","pin"),onClick:()=>{t("")}},React__default.default.createElement(icons.PushpinFilled,null),r("CancelFixed"))):React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",{onClick:()=>{t("left")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),r("FixedOnLeft")),React__default.default.createElement("span",{onClick:()=>{t("right")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),r("FixedOnRight"))),React__default.default.createElement("div",null,c.length>0?c.map(i=>React__default.default.createElement(AnnotatedAttributesItem,{attribute:i,key:i.value})):React__default.default.createElement("div",{style:{textAlign:"center",height:200,lineHeight:"200px"}},r("NoData"))))},AnnotatedAttributesPanelFixedLeft=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext);return e==="left"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesPanelFixedRight=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext);return e==="right"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesIcon=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext),{t:n}=reactI18next.useTranslation(),t=ctx.useSelector(o=>{var s,r;return StepUtils.getCurrentStepInfo((s=o==null?void 0:o.annotation)==null?void 0:s.step,(r=o.annotation)==null?void 0:r.stepList)});return(t==null?void 0:t.tool)!==lbAnnotation.EPointCloudName.PointCloud||e?null:React__default.default.createElement(FooterPopover,{hoverIcon:React__default.default.createElement(icons.UnorderedListOutlined,{style:{marginRight:4}}),icon:React__default.default.createElement(icons.UnorderedListOutlined,{style:{marginRight:4}}),title:n("AnnotatedList"),content:React__default.default.createElement(AnnotatedAttributesPanel,null)})};exports.AnnotatedAttributesIcon=AnnotatedAttributesIcon,exports.AnnotatedAttributesPanel=AnnotatedAttributesPanel,exports.AnnotatedAttributesPanelFixedLeft=AnnotatedAttributesPanelFixedLeft,exports.AnnotatedAttributesPanelFixedRight=AnnotatedAttributesPanelFixedRight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var index=require("../common/index.js"),index$1=require("../rectToolShortCutTable/index.js");const cuboidShortCutTable=[index.backward,index.forward,index$1.drawRect,index$1.drawInvalidRect,index.dargWithRightClick,index$1.selectRect,index$1.deleteRect,index$1.changeValid,index$1.changeValidByClick,index.scale,index.saveResult,index.restore,index.revoke,index.rotate,index.setValid,index.hidden];module.exports=cuboidShortCutTable;
|