@labelbee/lb-components 1.16.0-alpha.9 → 1.17.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/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -0
- package/dist/_virtual/highlightSegmentWorker.js +1 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -0
- package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegmentStatus.js +1 -1
- package/dist/components/pointCloudView/hooks/useAttribute.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/index.css +7 -6
- package/dist/types/components/AnnotationView/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegment2DView.d.ts +7 -0
- package/dist/types/components/pointCloudView/PointCloudSegmentStatus.d.ts +4 -1
- package/dist/types/components/pointCloudView/hooks/useAttribute.d.ts +1 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -0
- package/es/_virtual/highlightSegmentWorker.js +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -0
- package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegmentStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useAttribute.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/index.css +7 -6
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function decodeBase64(o,n){var r=atob(o);if(n){for(var e=new Uint8Array(r.length),t=0,a=r.length;t<a;++t)e[t]=r.charCodeAt(t);return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}return r}function createURL(o,n,r){var e=n===void 0?null:n,t=r===void 0?!1:r,a=decodeBase64(o,t),u=a.indexOf(`
|
|
2
|
+
`,10)+1,c=a.substring(u)+(e?"//# sourceMappingURL="+e:""),i=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(i)}function createBase64WorkerFactory(o,n,r){var e;return function(a){return e=e||createURL(o,n,r),new Worker(e,a)}}exports.createBase64WorkerFactory=createBase64WorkerFactory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _rollupPluginWebWorkerLoader__helper__browser__createBase64WorkerFactory=require("./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js"),WorkerFactory=_rollupPluginWebWorkerLoader__helper__browser__createBase64WorkerFactory.createBase64WorkerFactory("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGM9T2JqZWN0LmRlZmluZVByb3BlcnR5LF89T2JqZWN0LmRlZmluZVByb3BlcnRpZXMsZj1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9ycyxuPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMsbD1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LFA9T2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZSxzPSh0LGUscik9PmUgaW4gdD9jKHQsZSx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6cn0pOnRbZV09cix1PSh0LGUpPT57Zm9yKHZhciByIGluIGV8fChlPXt9KSlsLmNhbGwoZSxyKSYmcyh0LHIsZVtyXSk7aWYobilmb3IodmFyIHIgb2YgbihlKSlQLmNhbGwoZSxyKSYmcyh0LHIsZVtyXSk7cmV0dXJuIHR9LE89KHQsZSk9Pl8odCxmKGUpKTtvbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7Y29uc3R7Y2FjaGVNYXA6cixpbmRleGVzOmEsY29sb3I6ZH09ZS5kYXRhLHY9YS5sZW5ndGgscD1bXTtmb3IobGV0IG89MDtvPHY7bz1vKzEpe2NvbnN0IGk9clthW29dXTtpJiZwLnB1c2goTyh1KHt9LGkpLHtjb2xvcjpkfSkpfXBvc3RNZXNzYWdlKHthbm5vdGF0aW9uczpbe3R5cGU6InBpeGVsUG9pbnRzIixhbm5vdGF0aW9uOnB9XX0pfX0pKCk7Cgo=",null,!1);module.exports=WorkerFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),es=require("antd/es"),useRefCache=require("../../hooks/useRefCache.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e};const DEFAULT_SIZE={width:455,height:100},sizeInitialized=e=>{if(!e)return DEFAULT_SIZE;if(e.width&&e.height)return e;const t=__spreadValues({},e);return t.width||(t.width=DEFAULT_SIZE.width),t.height||(t.height=DEFAULT_SIZE.height),t},AnnotationView=(e,t)=>{var o,h;const{src:g,annotations:l=[],style:m={stroke:"blue",thickness:3},zoomChange:
|
|
1
|
+
"use strict";var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),es=require("antd/es"),useRefCache=require("../../hooks/useRefCache.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e};const DEFAULT_SIZE={width:455,height:100},sizeInitialized=e=>{if(!e)return DEFAULT_SIZE;if(e.width&&e.height)return e;const t=__spreadValues({},e);return t.width||(t.width=DEFAULT_SIZE.width),t.height||(t.height=DEFAULT_SIZE.height),t},AnnotationView=(e,t)=>{var o,h;const{src:g,annotations:l=[],style:m={stroke:"blue",thickness:3},zoomChange:c,backgroundStyle:w={},onChange:s,showLoading:b=!1,globalStyle:p,afterImgOnLoad:y}=e,f=sizeInitialized(e.size),[I,d]=React.useState(!1),v=React.useRef(null),r=React.useRef(),_=useRefCache(y);React.useImperativeHandle(t,()=>{const n=r.current;return n?{zoomIn:()=>n.zoomChanged(!0),zoomOut:()=>n.zoomChanged(!1),initImgPos:()=>n.initImgPos(),toolInstance:n}:{}},[r.current]),React.useEffect(()=>(v.current&&(r.current=new lbAnnotation.ViewOperation({container:v.current,size:f,style:m,annotations:l,config:"{}",zoomInfo:e.zoomInfo,staticMode:e.staticMode}),r.current.init()),()=>{var n;(n=r.current)==null||n.destroy()}),[]),React.useEffect(()=>{var n;r.current&&(d(!0),(n=r.current)==null||n.setLoading(!0),lbAnnotation.ImgUtils.load(g).then(i=>{var a,u;(a=r.current)==null||a.setLoading(!1),d(!1),(u=r.current)==null||u.setImgNode(i),_.current&&_.current(i)}).catch(()=>{var i;(i=r.current)==null||i.setLoading(!1),d(!1)}))},[g]),React.useEffect(()=>{r.current&&r.current.updateData(l)},[l]),React.useEffect(()=>{const n=r.current;(n==null?void 0:n.setSize)&&(n.setSize(f),n.initPosition())},[(o=e.size)==null?void 0:o.width,(h=e.size)==null?void 0:h.height]),React.useEffect(()=>{var n,i;return r.current&&((n=r.current)==null||n.on("onChange",(...a)=>{s==null||s.apply(null,a)}),(i=r.current)==null||i.on("renderZoom",a=>{c&&c(a)})),()=>{var a,u;(a=r.current)==null||a.unbindAll("onChange"),(u=r.current)==null||u.unbindAll("renderZoom")}},[c,s]);const O=React__default.default.createElement("div",{ref:v,style:__spreadValues(__spreadValues({position:"relative"},f),w)});return React__default.default.createElement(es.Spin,{spinning:b||I,delay:300,style:p},O)};var AnnotationView$1=React__default.default.forwardRef(AnnotationView);module.exports=AnnotationView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(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,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));const PointCloud2DRectOperationView=e=>{var r;const{mappingData:t,size:i,config:
|
|
1
|
+
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(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,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));const PointCloud2DRectOperationView=e=>{var r;const{mappingData:t,size:i,config:P,checkMode:C,afterImgOnLoad:g}=e,l=(r=t==null?void 0:t.url)!=null?r:"",{pointCloudBoxList:s,setPointCloudResult:w}=React.useContext(PointCloudContext.PointCloudContext),{update2DViewRect:R}=usePointCloudViews.usePointCloudViews(),c=React__default.default.useRef(null),o=React.useRef(null),d=ahooks.useLatest(R),p=React.useRef(null),[O,b]=React.useState(!0),f=n=>{var a;const u=(a=d.current)==null?void 0:a.call(d,n);p.current=u,w(u)},m=()=>{var n;let a=[];s.forEach(u=>{const{rects:D=[],id:v,attribute:x,trackID:h}=u,_=D.find(V=>V.imageName===(t==null?void 0:t.path)),y=v+"_"+(t==null?void 0:t.path);_&&(a=[...a,__spreadProps(__spreadValues({},_),{boxID:v,id:y,attribute:x,order:h})])}),(n=o.current)==null||n.setResult(a)};return React.useEffect(()=>{if(c.current){const n=new lbAnnotation.PointCloud2DRectOperation({container:c.current,size:i,config:__spreadProps(__spreadValues({},P),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:C});return o.current=n,o.current.init(),o.current.on("updateDragResult",f),()=>{var a,u;(a=o.current)==null||a.unbind("updateDragResult",f),(u=o.current)==null||u.destroy()}}},[]),React.useEffect(()=>{o.current&&l&&lbAnnotation.ImgUtils.load(l).then(n=>{o.current.setImgNode(n),g(n),b(!1)})},[l]),React.useEffect(()=>{var n;(n=o.current)==null||n.setSize(i)},[i]),React.useEffect(()=>{s!==p.current&&m()},[s,l]),React__default.default.createElement(es.Spin,{spinning:O},React__default.default.createElement("div",{ref:c,style:__spreadValues({position:"relative"},i)}))};var PointCloud2DRectOperationView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DRectOperationView);module.exports=PointCloud2DRectOperationView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,s,o)=>new Promise((d,a)=>{var u=t=>{try{n(o.next(t))}catch(i){a(i)}},r=t=>{try{n(o.throw(t))}catch(i){a(i)}},n=t=>t.done?d(t.value):Promise.resolve(t.value).then(u,r);n((o=o.apply(e,s)).next())});const PointCloud2DSingleView=({view2dData:e,setSelectedID:s,currentData:o,showEnlarge:d,checkMode:a=!1})=>{var u;const r=React.useRef(null),n=React.useRef(),{selectedBox:t}=useSingleBox.useSingleBox(),i=useSize(r),{url:g,calib:
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,s,o)=>new Promise((d,a)=>{var u=t=>{try{n(o.next(t))}catch(i){a(i)}},r=t=>{try{n(o.throw(t))}catch(i){a(i)}},n=t=>t.done?d(t.value):Promise.resolve(t.value).then(u,r);n((o=o.apply(e,s)).next())});const PointCloud2DSingleView=({view2dData:e,setSelectedID:s,currentData:o,showEnlarge:d,checkMode:a=!1})=>{var u;const r=React.useRef(null),n=React.useRef(),{selectedBox:t}=useSingleBox.useSingleBox(),i=useSize(r),{url:g,calib:h,path:b}=e,{toggle2dVisible:y,isHighlightVisible:j}=useHighlight.useHighlight({currentData:o}),[q,v]=React.useState(!1),{cuboidBoxIn2DView:S,cacheImageNodeSize:P}=React.useContext(PointCloudContext.PointCloudContext),_=!e,m=c=>{f(),P({path:b,imgNode:c})},f=React.useCallback(()=>{var c,x;const p=(c=n.current)==null?void 0:c.toolInstance;if(s(""),!t||!p)return;const l=e.annotations.find(B=>B.annotation.id===t.info.id);let C="";l&&((x=l==null?void 0:l.annotation.pointList)==null?void 0:x.length)>0&&(p.focusPositionByPointList(l==null?void 0:l.annotation.pointList),C=t.info.id,s(C))},[t,n.current,e.annotations]);React.useEffect(()=>{f()},[f]);const k=()=>__async(void 0,null,function*(){v(!0),yield y(g,h),v(!1)});return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:r},S?React__default.default.createElement(index,{src:(u=e==null?void 0:e.url)!=null?u:"",annotations:e.annotations,size:i,ref:n,globalStyle:{display:_?"none":"block"},afterImgOnLoad:m,zoomInfo:{min:.01,max:1e3,ratio:.4}}):React__default.default.createElement(index$1,{mappingData:e,size:i,checkMode:a,afterImgOnLoad:m}),h&&React__default.default.createElement(index$2,{visible:j(g),onClick:k,loading:q,style:{position:"absolute",right:16,top:16,zIndex:d?-1:101}}))};module.exports=PointCloud2DSingleView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils"),PointCloud2DSingleView=require("./PointCloud2DSingleView.js"),index=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons"),classNames=require("classnames"),icon_esc=require("../../assets/annotation/common/icon_esc.svg.js"),icon_left_squareOutlined=require("../../assets/annotation/common/icon_left_squareOutlined.svg.js"),icon_right_squareOutlined=require("../../assets/annotation/common/icon_right_squareOutlined.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),__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 EKeyCode=lbAnnotation.cKeyCode.default,ContainerTitle=({showEnlarge:e,isEnlargeTopView:n,data:t,setIsEnlarge:v,setCurIndex:u,curIndex:p=0,index:y,annotations2d:c})=>n?React__default.default.createElement(index,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{v(!1),u(void 0)}}),React__default.default.createElement("span",null,t==null?void 0:t.calName),React__default.default.createElement("span",{style:{marginLeft:"8px"}},p+1,"/",c==null?void 0:c.length)):React__default.default.createElement(index,{title:t==null?void 0:t.calName,onClick:()=>{v(!0),u(y)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),PointCloud2DView=({currentData:e,config:n,thumbnailWidth:t,isEnlargeTopView:v,highlightAttribute:u,loadPCDFileLoading:p,checkMode:y})=>{var c;const[s,O]=React.useState([]),{topViewInstance:F,displayPointCloudList:w}=React.useContext(PointCloudContext.PointCloudContext),[E,j]=React.useState(""),[m,_]=React.useState(!1),[a,g]=React.useState(void 0);React.useEffect(()=>{var l;if(!p&&F&&(e==null?void 0:e.mappingImgList)&&((l=e==null?void 0:e.mappingImgList)==null?void 0:l.length)>0){const
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils"),PointCloud2DSingleView=require("./PointCloud2DSingleView.js"),index=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons"),classNames=require("classnames"),icon_esc=require("../../assets/annotation/common/icon_esc.svg.js"),icon_left_squareOutlined=require("../../assets/annotation/common/icon_left_squareOutlined.svg.js"),icon_right_squareOutlined=require("../../assets/annotation/common/icon_right_squareOutlined.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),__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 EKeyCode=lbAnnotation.cKeyCode.default,ContainerTitle=({showEnlarge:e,isEnlargeTopView:n,data:t,setIsEnlarge:v,setCurIndex:u,curIndex:p=0,index:y,annotations2d:c})=>n?React__default.default.createElement(index,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{v(!1),u(void 0)}}),React__default.default.createElement("span",null,t==null?void 0:t.calName),React__default.default.createElement("span",{style:{marginLeft:"8px"}},p+1,"/",c==null?void 0:c.length)):React__default.default.createElement(index,{title:t==null?void 0:t.calName,onClick:()=>{v(!0),u(y)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),PointCloud2DView=({currentData:e,config:n,thumbnailWidth:t,isEnlargeTopView:v,highlightAttribute:u,loadPCDFileLoading:p,checkMode:y})=>{var c;const[s,O]=React.useState([]),{topViewInstance:F,displayPointCloudList:w}=React.useContext(PointCloudContext.PointCloudContext),[E,j]=React.useState(""),[m,_]=React.useState(!1),[a,g]=React.useState(void 0);React.useEffect(()=>{var l;if(!p&&F&&(e==null?void 0:e.mappingImgList)&&((l=e==null?void 0:e.mappingImgList)==null?void 0:l.length)>0){const r={fill:"transparent",color:"green"};let i=[];e==null||e.mappingImgList.forEach(o=>{var d;const N=w.reduce((R,f)=>{var h;const V=f.id===E||u===f.attribute,{transferViewData:A,viewRangePointList:b}=lbAnnotation.pointCloudLidar2image(f,o.calib,{createRange:V}),L=(h=lbUtils.toolStyleConverter.getColorFromConfig({attribute:f.attribute},__spreadProps(__spreadValues({},n),{attributeConfigurable:!0}),{}))==null?void 0:h.stroke,T=k({viewDataPointList:A,pointCloudBox:f,defaultViewStyle:r,stroke:L}),q=[...R,...T];return(b==null?void 0:b.length)>0&&q.push({type:"polygon",annotation:__spreadProps(__spreadValues({id:E,pointList:b},r),{stroke:L,fill:"rgba(255, 255, 255, 0.6)"})}),q},[]);i.push({annotations:N,url:o==null?void 0:o.url,calName:(d=o==null?void 0:o.calib)==null?void 0:d.calName,calib:o==null?void 0:o.calib,path:o==null?void 0:o.path})}),O(i)}},[w,e==null?void 0:e.mappingImgList,E,u,p]),React.useEffect(()=>(window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}),[a]);const x=l=>{const{keyCode:r}=l;switch(r){case EKeyCode.Esc:m&&_(!1);break;case EKeyCode.Left:P();break;case EKeyCode.Right:C();break}},P=()=>{a===void 0||!m||Number(a)>0&&g(a-1)},C=()=>{a===void 0||!m||Number(a)<(s==null?void 0:s.length)-1&&g(a+1)},k=({viewDataPointList:l,pointCloudBox:r,defaultViewStyle:i,stroke:o})=>l.map(d=>({type:d.type,annotation:__spreadProps(__spreadValues({id:r.id,pointList:d.pointList},i),{stroke:o})})),I=!e||!(e==null?void 0:e.mappingImgList)||!(((c=e==null?void 0:e.mappingImgList)==null?void 0:c.length)>0),S=React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},React__default.default.createElement("img",{src:icon_left_squareOutlined,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>P()}),React__default.default.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("img",{src:icon_right_squareOutlined,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>C()}),React__default.default.createElement("img",{src:icon_esc,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{_(!1),g(void 0)}}),React__default.default.createElement("span",null,"\u952E\u9000\u51FA"));return(s==null?void 0:s.length)>0?React__default.default.createElement(React__default.default.Fragment,null,s.map((l,r)=>{const i=m&&r===a;return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:classNames__default.default({[dom.getClassName("point-cloud-2d-container")]:!0,[dom.getClassName("point-cloud-container","zoom")]:i}),title:React__default.default.createElement(ContainerTitle,{showEnlarge:i,isEnlargeTopView:v,data:l,setIsEnlarge:_,setCurIndex:g,curIndex:a,index:r,annotations2d:s}),titleOnSurface:!i,style:{display:I?"none":"flex",width:i?"100%":t},key:r,toolbar:S},(l==null?void 0:l.annotations)&&(l==null?void 0:l.url)&&React__default.default.createElement(PointCloud2DSingleView,{currentData:e,view2dData:l,setSelectedID:j,showEnlarge:i,checkMode:y}))})):null};var PointCloud2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DView);module.exports=PointCloud2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var useSize=require("../../hooks/useSize.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudSegment=({currentData:e,config:n,checkMode:c})=>{var o,u;const a=React.useRef(null),{setPtSegmentInstance:d,setDefaultAttribute:m,ptSegmentInstance:r}=React.useContext(PointCloudContext.PointCloudContext),t=useSize(a),i=(u=(o=n==null?void 0:n.attributeList)==null?void 0:o[0])==null?void 0:u.value;return React.useEffect(()=>{var l;if(!(t==null?void 0:t.width)||!a.current||r)return;const s=new lbAnnotation.PointCloud({container:a.current,isOrthographicCamera:!0,isSegment:!0,orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(t),config:n,checkMode:c});(l=s.store)==null||l.setAttribute(i),m(i),d(s)},[t]),React.useEffect(()=>{r&&(r.initRenderer(),r.initOrthographicCamera(lbUtils.PointCloudUtils.getDefaultOrthographicParams(t)),r.render())},[t]),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-
|
|
1
|
+
"use strict";var useSize=require("../../hooks/useSize.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudSegment=({currentData:e,config:n,checkMode:c})=>{var o,u;const a=React.useRef(null),{setPtSegmentInstance:d,setDefaultAttribute:m,ptSegmentInstance:r}=React.useContext(PointCloudContext.PointCloudContext),t=useSize(a),i=(u=(o=n==null?void 0:n.attributeList)==null?void 0:o[0])==null?void 0:u.value;return React.useEffect(()=>{var l;if(!(t==null?void 0:t.width)||!a.current||r)return;const s=new lbAnnotation.PointCloud({container:a.current,isOrthographicCamera:!0,isSegment:!0,orthographicParams:lbUtils.PointCloudUtils.getDefaultOrthographicParams(t),config:n,checkMode:c});(l=s.store)==null||l.setAttribute(i),m(i),d(s)},[t]),React.useEffect(()=>{r&&(r.initRenderer(),r.initOrthographicCamera(lbUtils.PointCloudUtils.getDefaultOrthographicParams(t)),r.render())},[t]),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper"),ref:a})};var PointCloudSegment$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment);module.exports=PointCloudSegment$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation");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,o)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,__spreadValues=(e,n)=>{for(var o in n||(n={}))__hasOwnProp.call(n,o)&&__defNormalProp(e,o,n[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(n))__propIsEnum.call(n,o)&&__defNormalProp(e,o,n[o]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const PointCloudSegment2DSingleView=({path:e,url:n,calib:o,pcdUrl:u,highlightAttribute:a})=>{const{ptSegmentInstance:t,cacheImageNodeSize:h,imageSizes:C}=React.useContext(PointCloudContext.PointCloudContext),S=React.useRef(null),d=React.useRef(0),f=React.useRef({}),c=React.useRef(),[p,g]=React.useState([]),[_,v]=React.useState(!1);React.useEffect(()=>()=>{d.current=0,f.current={},c.current=void 0},[u]);const m=React.useCallback(()=>{var r;if(d.current=d.current+1,d.current===2){const i=(r=t==null?void 0:t.store)==null?void 0:r.originPoints;if(!i||!c.current){console.error("cacheMappingPCD2Img Error",{path:e,points:i,filterSize:c.current});return}f.current=lbAnnotation.pointMappingLidar2image(i,o,c.current).pcdMapping}},[t]),P=React.useCallback((r,i)=>{if(r&&c.current){const l=f.current,s=new highlightSegmentWorker;v(!0),s.postMessage({cacheMap:l,indexes:r,color:i}),s.onmessage=y=>{g(y.data.annotations),s.terminate(),v(!1)}}},[]);React.useEffect(()=>{if(!(t==null?void 0:t.store))return;const r=t.store.getHighlightAttribute(a!=null?a:""),i=t==null?void 0:t.getColorFromConfig(a!=null?a:"");P(r.flat(),i.stroke)},[a,t]),React.useEffect(()=>{if(t){const r=({newAttribute:i})=>{const l=t==null?void 0:t.getColorFromConfig(i);l&&g(p.map(s=>__spreadProps(__spreadValues({},s),{annotation:__spreadProps(__spreadValues({},s.annotation),{fill:l.fill,stroke:l.fill})})))};return t.on("updateDefaultAttribute",r),()=>{t.unbind("updateDefaultAttribute",r)}}},[t,p]),React.useEffect(()=>{if(t){const r=i=>{if(i.cacheSegData){const{cacheSegData:l}=i;if(l==null?void 0:l.indexes){const s=t.getColorFromConfig(l.attribute);P(l==null?void 0:l.indexes,s.stroke)}}else g([])};return t.on("syncPointCloudStatus",r),t.on("loadPCDFileEnd",m),()=>{t.unbind("syncPointCloudStatus",r),t.unbind("loadPCDFileEnd",m)}}},[t,u,C]);const b=r=>{h({path:e,imgNode:r}),c.current={width:r.width,height:r.height},m()};return React__default.default.createElement("div",{key:e,style:{position:"relative"},ref:S},React__default.default.createElement(index,{title:o.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),React__default.default.createElement(antd.Spin,{spinning:_,delay:1e3},React__default.default.createElement(index$1,{size:{width:300,height:200},key:e,src:n,annotations:p,afterImgOnLoad:b})))},PointCloudSegment2DView=({currentData:e,highlightAttribute:n})=>{var o;const u=(o=e.mappingImgList)!=null?o:[];return(u==null?void 0:u.length)>0?React__default.default.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},u==null?void 0:u.map((a,t)=>a.calib&&React__default.default.createElement(PointCloudSegment2DSingleView,{key:a.path,path:a.path,url:a.url,calib:a.calib,pcdUrl:e.url,highlightAttribute:n}))):null};var PointCloudSegment2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment2DView);module.exports=PointCloudSegment2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js");const PointCloudSegmentListener=({checkMode:
|
|
1
|
+
"use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js"),actionCreators=require("../../store/annotation/actionCreators.js");const PointCloudSegmentListener=({checkMode:m,currentData:l,imgIndex:v,highlightAttribute:a,config:C,toolInstanceRef:u})=>{const s=ctx.useDispatch(),{updateSegmentAttribute:S,updateSegmentSubAttribute:b}=useAttribute.useAttribute(),n=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:e,setSegmentation:d}=n;React.useEffect(()=>{var t;if(e&&l.url)return actionCreators.SetPointCloudLoading(s,!0),e.emit("clearStash"),e.emit("clearAllSegmentData"),e.loadPCDFile((t=l==null?void 0:l.url)!=null?t:"").then(()=>{var o,r;const i=lbUtils.PointCloudUtils.getSegmentFromResultList((o=l==null?void 0:l.result)!=null?o:"");(r=e==null?void 0:e.store)==null||r.updateCurrentSegment(i),actionCreators.SetPointCloudLoading(s,!1)}),e.on("syncSegmentData",d),()=>{e.unbind("syncSegmentData",d)}},[v,e]),React.useEffect(()=>{var t;(t=e==null?void 0:e.store)==null||t.highlightPointsByAttribute(a!=null?a:"")},[a,e]);const g=(t,o)=>{var r,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("RectSelector");break;case"k":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Add);break;case"i":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(i=(r=e.store)==null?void 0:r.cacheSegData)==null?void 0:i.id);break}},c=t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||m===!0)return;const o=t.key.toLocaleLowerCase();g(o)};return React.useEffect(()=>(window.addEventListener("keydown",c),u.current.setDefaultAttribute=t=>{S(t),e==null||e.emit("updateDefaultAttribute",{newAttribute:t})},u.current.setSubAttribute=(t,o)=>{b(t,o)},()=>{window.removeEventListener("keydown",c)}),[e]),React.useEffect(()=>{u.current.clearResult=()=>{!n.ptSegmentInstance||(n.ptSegmentInstance.emit("clearStash"),n.ptSegmentInstance.emit("clearAllSegmentData"))}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var PointCloudSegmentListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegmentListener);module.exports=PointCloudSegmentListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),dom=require("../../utils/dom.js"),finish=require("../../assets/annotation/pointCloudTool/finish.svg.js"),cancel=require("../../assets/annotation/pointCloudTool/cancel.svg.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),reactI18next=require("react-i18next");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var React=require("react"),dom=require("../../utils/dom.js"),finish=require("../../assets/annotation/pointCloudTool/finish.svg.js"),cancel=require("../../assets/annotation/pointCloudTool/cancel.svg.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),reactI18next=require("react-i18next");function _interopDefaultLegacy(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var React__default=_interopDefaultLegacy(React);const SegmentInfo=({infoList:a})=>{const{t:u}=reactI18next.useTranslation();return a?React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","info")},a.map(n=>React__default.default.createElement("div",{key:n.key},React__default.default.createElement("span",null,u(n.key),"\uFF1A "),React__default.default.createElement("span",null,n.value)))):null},PointCloudSegmentStatus=a=>{var u,n,d,r,m,f;const{config:g}=a,{t:s}=reactI18next.useTranslation(),{ptSegmentInstance:t,setDefaultAttribute:v}=React.useContext(PointCloudContext.PointCloudContext),[o,C]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready});React.useEffect(()=>{if(t){const e=l=>{C(l),l.cacheSegData&&v(l.cacheSegData.attribute)};return t==null||t.on("syncPointCloudStatus",e),()=>{t==null||t.unbind("syncPointCloudStatus",e)}}},[t]);const i=o.segmentStatus;if(i===lbUtils.EPointCloudSegmentStatus.Ready)return null;const S=i===lbUtils.EPointCloudSegmentStatus.Check,E=i===lbUtils.EPointCloudSegmentStatus.Edit;let c=null;const p=((d=(n=(u=o.cacheSegData)==null?void 0:u.points)==null?void 0:n.length)!=null?d:0)/3;let b=[{key:"SelectedPoints",value:p},{key:"Attribute",value:(m=(r=g.attributeList.find(e=>{var l;return e.value===((l=o.cacheSegData)==null?void 0:l.attribute)}))==null?void 0:r.key)!=null?m:""},{key:"SubAttribute",value:lbUtils.PointCloudUtils.getSubAttributeName(((f=o.cacheSegData)==null?void 0:f.subAttribute)||{},g).map(e=>React__default.default.createElement("div",{key:e.label},e.label," - ",e.value))}];return S&&(c=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","operation")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{t==null||t.emit("updateCheck2Edit")}},s("EnterEditMode"),"(Enter)"))),E&&(c=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-status","operation")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{var e;t==null||t.emit("addStash2Store"),((e=t==null?void 0:t.store)==null?void 0:e.segmentFocusMode)===lbUtils.EPointCloudSegmentFocusMode.Focus&&(t==null||t.emit("setSegmentFocusMode",lbUtils.EPointCloudSegmentFocusMode.Unfocus))}},React__default.default.createElement("img",{className:dom.getClassName("point-cloud-status","icon"),src:finish}),s("Finish")),React__default.default.createElement("span",{className:dom.getClassName("point-cloud-status","button"),onClick:()=>{var e;t==null||t.emit("clearStash"),((e=t==null?void 0:t.store)==null?void 0:e.segmentFocusMode)===lbUtils.EPointCloudSegmentFocusMode.Focus&&(t==null||t.emit("setSegmentFocusMode",lbUtils.EPointCloudSegmentFocusMode.Unfocus))}},React__default.default.createElement("img",{className:dom.getClassName("point-cloud-status","icon"),src:cancel}),s("Cancel")))),React__default.default.createElement(React__default.default.Fragment,null,c,React__default.default.createElement(SegmentInfo,{infoList:b}))};module.exports=PointCloudSegmentStatus;
|
|
@@ -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:l,backViewInstance:i,mainViewInstance:r,ptSegmentInstance:n,defaultAttribute:s,setDefaultAttribute:a}=React.useContext(PointCloudContext.PointCloudContext);React.useEffect(()=>{if(!(t==null?void 0:t.toolInstance))return;const e=()=>{a(t==null?void 0:t.toolInstance.defaultAttribute)};return t==null||t.toolInstance.on("changeAttributeSidebar",e),()=>{t==null||t.toolInstance.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.toolInstance]);const d=e=>{[t==null?void 0:t.toolInstance,l==null?void 0:l.toolInstance,i==null?void 0:i.toolInstance].forEach(o=>{o==null||o.setDefaultAttribute(e)})},c=e=>{t==null||t.toolInstance.setDefaultAttribute(e)},b=e=>{r==null||r.generateBox(e)},v=React.useCallback(e=>{var o,u;!n||((o=n.store)==null||o.setAttribute(e),(u=n.pointCloudRender)==null||u.updatePointsColor(),a(e))},[n]),A=React.useCallback((e,o)=>{var u;!n||(u=n.store)==null||u.setSubAttribute(e,o)},[n]);return{syncThreeViewsAttribute:d,updateDefaultAttribute:c,reRenderPointCloud3DBox:b,defaultAttribute:s,updateSegmentAttribute:v,updateSegmentSubAttribute:A}};exports.useAttribute=useAttribute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,i)=>new Promise((a,o)=>{var d=u=>{try{c(i.next(u))}catch(h){o(h)}},P=u=>{try{c(i.throw(u))}catch(h){o(h)}},c=u=>u.done?a(u.value):Promise.resolve(u.value).then(d,P);c((i=i.apply(e,t)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,t,i,a,o)=>{const{x:d,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(e,t),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,u={center:{x:d,y:P,z:c},id:e.id},h=a?__spreadValues(__spreadValues({},a),u):__spreadProps(__spreadValues({},u),{attribute:"",valid:!0});return o&&Object.assign(h,o),h},topViewPolygon2PointCloud=(e,t,i,a,o,d)=>{let P=e.pointList.map(L=>lbUtils.PointCloudUtils.transferCanvas2World(L,t)),c=0,u=1,h={};if(i){const L=i.getSensesPointZAxisInPolygon(P,void 0,d);d&&L.fittedCoordinates.length>0&&(P=L.fittedCoordinates),c=(L.maxZ+L.minZ)/2,u=L.maxZ-L.minZ,h={count:L.zCount}}const[v,b,T]=P,V=lbAnnotation.MathUtils.getLineCenterPoint([v,T]),_=lbAnnotation.MathUtils.getLineLength(v,b),D=lbAnnotation.MathUtils.getLineLength(b,T),A=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);a&&(c=a.center.z,u=a.depth);const O={center:{x:V.x,y:V.y,z:c},width:d?D+INTELLIGENT_FIT_MARGIN:D,height:d?_+INTELLIGENT_FIT_MARGIN:_,depth:u,rotation:A,id:e.id},k=__spreadValues(a?__spreadValues(__spreadValues({},a),O):__spreadProps(__spreadValues({},O),{attribute:"",valid:!0}),h);o&&Object.assign(k,o);const z=P.map(L=>lbUtils.PointCloudUtils.transferWorld2Canvas(L,t));return{boxParams:k,newPointList:z}},sideViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-a.x,y:i.center.y,z:i.center.z-a.y}})},sideViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,O=lbAnnotation.MathUtils.getLineLength(d,P),k=lbAnnotation.MathUtils.getLineLength(u,h),z=O-k,{newBoxParams:L}=a.getNewBoxBySideUpdate(V,z,A,i);return L},backViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-a.x,z:i.center.z-a.y}})},backViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,O=lbAnnotation.MathUtils.getLineLength(d,P),k=lbAnnotation.MathUtils.getLineLength(u,h),z=O-k;let{newBoxParams:L}=a.getNewBoxByBackUpdate(V,z,A,i);return L},syncSideViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeSideView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxSidePolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncBackViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeBackView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxBackPolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncTopViewByPoint=(e,t,i,a)=>{if(!i||!a)return;a.generateSphere(e),a.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),a.render();const{toolInstance:o,pointCloudInstance:d}=i,{point2d:P}=d.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?__spreadProps(__spreadValues(__spreadValues({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},synchronizeTopView=(e,t,i,a)=>{var o,d;if(!i||!a)return;a.generateBox(e,t.id),a.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),h=[...P.polygonList],v=h.find(b=>b.id===t.id);v?(v.pointList=u,v.valid=(o=e.valid)!=null?o:!0):h.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(d=e.valid)!=null?d:!0}),P.setResultAndSelectedID(h,t.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:i,backViewInstance:a,mainViewInstance:o,addPointCloudBox:d,addPointCloudSphere:P,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:h,pointCloudSphereList:v,hideAttributes:b,setHighlight2DDataList:T,cuboidBoxIn2DView:V,imageSizes:_}=e,{addHistory:D,initHistory:A,pushHistoryUnderUpdatePolygon:O}=useHistory.useHistory(),{selectedPolygon:k}=usePolygon.usePolygon(),{getPointCloudSphereByID:z,updatePointCloudSphere:L,selectedSphere:q}=useSphere.useSphere(),{currentData:j,config:m}=ctx.useSelector(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,s).config)}}),R=ctx.useDispatch(),W=n=>{if(!V){const{mappingImgList:s=[]}=j,p=s.map(r=>index.getRectPointCloudBox({pointCloudBox:n,mappingData:r,imageSizes:_}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:S,updateSelectedBox:tt,updateSelectedBoxes:Z,getPointCloudByID:ot}=useSingleBox.useSingleBox({generateRects:W}),{t:et}=reactI18next.useTranslation(),X=S==null?void 0:S.info;if(!t||!i||!a)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:G}=t,nt=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},it=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},st=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const C={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:v})});const g=topViewPoint2PointCloud(n,s,G,void 0,C);c(n.id);const f=P(g);H(PointCloudView.Top,n,g,p,f,m),D({newSphereParams:g})},rt=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:C})=>{var g,f;const x={attribute:(g=t.toolInstance.defaultAttribute)!=null?g:""};r===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:v})});const B=t==null?void 0:t.toolInstance,w=__spreadValues({},n);let{boxParams:y,newPointList:U}=topViewPolygon2PointCloud(w,s,G,void 0,x,C);if(y=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[y],stepConfig:m,action:"viewUpdateBox"}))[0],(m==null?void 0:m.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<m.lowerLimitPointsNumInBox){antd.message.info(et("LowerLimitPointsNumInBox",{num:m.lowerLimitPointsNumInBox})),B.deletePolygon(y.id);return}C&&(U==null?void 0:U.length)&&(w.pointList=U);const I=b.includes(w.attribute);W(y);const N=d(y),Q=(f=e==null?void 0:e.polygonList)!=null?f:[];t==null||t.updatePolygonList(N!=null?N:[],Q),I?c([]):(c(y.id),B.selection.setSelectedIDs(w.id),E({omitView:PointCloudView.Top,polygon:w,boxParams:y,zoom:l,newPointCloudBoxList:N}),C&&synchronizeTopView(y,w,t,o)),D({newBoxParams:y})},lt=n=>{const{boxID:s,imageName:p,width:r,height:l,x:C,y:g}=n,f=h.find(x=>x.id===s);if(f==null?void 0:f.rects){const{rects:x=[]}=f,B=x.find(w=>w.imageName===p);if(B){let w=x;const y=__spreadProps(__spreadValues({},B),{width:r,height:l,x:C,y:g});w=x.map(I=>I===B?y:I);const U=__spreadProps(__spreadValues({},f),{rects:w}),M=h.map(I=>I===f?U:I);return t==null||t.updatePolygonList(M!=null?M:[]),M}}},at=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const C=t==null?void 0:t.toolInstance;if(!(u.length===0||!C)){if(n||(S==null?void 0:S.info)){const g=n!=null?n:S==null?void 0:S.info;(l=C==null?void 0:C.selection)==null||l.setSelectedIDs(u[0]);const f=C.selectedPolygon;if(u.length===1&&g){E({omitView:PointCloudView.Top,polygon:f,boxParams:g,newPointCloudBoxList:s});return}}if((p||q)&&u.length===1){const g=p!=null?p:q;C.setSelectedID(u[0]);const f=C.selectedPoint;g&&H(PointCloudView.Top,f,g,void 0,r,m)}}},Y=(n,s,p)=>{if(X){let r,l;switch(p){case PointCloudView.Back:r=backViewPolygon2PointCloud;break;case PointCloudView.Side:r=sideViewPolygon2PointCloud;break;default:r=sideViewPolygon2PointCloud;break}l=r(n,s,X,i.pointCloudInstance);const g=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[l],stepConfig:m,action:"viewUpdateBox"}))[0],f=l.valid!==g.valid;if(l=g,o){const{count:B}=o.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=__spreadProps(__spreadValues({},l),{count:B})}const x=tt(l);return l=x.find(B=>B.id===l.id),E({omitView:f?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},J=(n,s,p)=>{if(q){let r,l;switch(p){case PointCloudView.Back:r=backViewPoint2PointCloud;break;case PointCloudView.Side:r=sideViewPoint2PointCloud;break;default:r=sideViewPoint2PointCloud;break}l=r(n,s,q);const C=L(l);return H(p,n,l,void 0,C,m),C}},dt=(n,s)=>{J(n,s,PointCloudView.Side)},ct=(n,s)=>{J(n,s,PointCloudView.Back)},ut=(n,s)=>{Y(n,s,PointCloudView.Side)},pt=(n,s)=>{Y(n,s,PointCloudView.Back)},Pt=(n,s)=>{const p=z(n.id),r=topViewPoint2PointCloud(n,s,G,p),l=L(r);H(PointCloudView.Top,n,r,void 0,l,m)},Ct=(n,s)=>{if(k){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>lbUtils.PointCloudUtils.transferCanvas2World(l,s)),O(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=ot(r.id),{boxParams:C}=topViewPolygon2PointCloud(r,s,t.pointCloudInstance,l);return C});if(p=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:p,stepConfig:m,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=Z(p);E({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=Z(p);r&&e.syncAllViewPointCloudColor(r)}},gt=n=>{var s,p,r,l,C;if(S){const g=Number(n.widthDefault),f=Number(n.depthDefault),x=Number(n.heightDefault),B=S==null?void 0:S.info.trackID,y=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(F=>(F==null?void 0:F.trackID)===B),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(C=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:C.height},M=y.pointList.map(F=>lbUtils.PointCloudUtils.transferCanvas2World(F,U)),I=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(M,x,g),N=I[0],Q=I[2],K=lbAnnotation.MathUtils.getLineCenterPoint([N,Q]),ht=S.info.center.z-S.info.depth/2,$=__spreadProps(__spreadValues({},S.info),{center:{x:K.x,y:K.y,z:ht+f/2},width:g,height:x,depth:f,valid:!0}),ft=Z([$]);E({omitView:PointCloudView["3D"],polygon:y,boxParams:$,newPointCloudBoxList:ft})}},H=(n,s,p,r,l,C)=>__async(void 0,null,function*(){const g=j==null?void 0:j.url,f={[PointCloudView.Side]:()=>{syncSideViewByPoint(p,s,i,g,C)},[PointCloudView.Back]:()=>{a&&syncBackViewByPoint(p,s,a,g,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(p,s,t,o)}};Object.keys(f).forEach(x=>{x!==n&&f[x]()}),r&&(o==null||o.updateCameraZoom(r)),it(p)}),E=n=>__async(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:C}=n,g=j==null?void 0:j.url;C&&(yield e.syncAllViewPointCloudColor(C));const f={[PointCloudView.Side]:()=>{synchronizeSideView(r,p,i,g)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(r,p,a,g)},[PointCloudView.Top]:()=>{synchronizeTopView(r,p,t,o)}};Object.keys(f).forEach(x=>{x!==s&&f[x]()}),l&&(o==null||o.updateCameraZoom(l)),nt(r)});return{topViewAddSphere:st,topViewAddBox:rt,topViewSelectedChanged:at,topViewUpdatePoint:Pt,sideViewUpdatePoint:dt,backViewUpdatePoint:ct,topViewUpdateBox:Ct,sideViewUpdateBox:ut,backViewUpdateBox:pt,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=lbUtils.PointCloudUtils.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=j){var p,r,l,C,g,f;if(!(s==null?void 0:s.url)||!o)return;T([]),actionCreators.SetPointCloudLoading(R,!0),actionCreators.SetLoadPCDFileLoading(R,!0),yield o.loadPCDFile(s.url,(p=m==null?void 0:m.radius)!=null?p:DEFAULT_RADIUS),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],B=[],w=[],y=[];o.updateTopCamera();const U=(l=(r=index.jsonParser(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(C=e.sideViewInstance)==null||C.clearAllData(),(g=e.backViewInstance)==null||g.clearAllData(),t.updateData(s.url,s.result,{radius:(f=m==null?void 0:m.radius)!=null?f:DEFAULT_RADIUS}),s.result&&(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),w=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),B=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),y=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),A({pointCloudBoxList:x,polygonList:w,lineList:B,pointCloudSphereList:y}),actionCreators.SetPointCloudLoading(R,!1),actionCreators.SetLoadPCDFileLoading(R,!1)}),updateViewsByDefaultSize:gt,generateRects:W,update2DViewRect:lt}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,i)=>new Promise((a,o)=>{var d=u=>{try{c(i.next(u))}catch(h){o(h)}},P=u=>{try{c(i.throw(u))}catch(h){o(h)}},c=u=>u.done?a(u.value):Promise.resolve(u.value).then(d,P);c((i=i.apply(e,t)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,t,i,a,o)=>{const{x:d,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(e,t),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,u={center:{x:d,y:P,z:c},id:e.id},h=a?__spreadValues(__spreadValues({},a),u):__spreadProps(__spreadValues({},u),{attribute:"",valid:!0});return o&&Object.assign(h,o),h},topViewPolygon2PointCloud=(e,t,i,a,o,d)=>{let P=e.pointList.map(L=>lbUtils.PointCloudUtils.transferCanvas2World(L,t)),c=0,u=1,h={};if(i){const L=i.getSensesPointZAxisInPolygon(P,void 0,d);d&&L.fittedCoordinates.length>0&&(P=L.fittedCoordinates),c=(L.maxZ+L.minZ)/2,u=L.maxZ-L.minZ,h={count:L.zCount}}const[v,b,T]=P,V=lbAnnotation.MathUtils.getLineCenterPoint([v,T]),_=lbAnnotation.MathUtils.getLineLength(v,b),D=lbAnnotation.MathUtils.getLineLength(b,T),A=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);a&&(c=a.center.z,u=a.depth);const k={center:{x:V.x,y:V.y,z:c},width:d?D+INTELLIGENT_FIT_MARGIN:D,height:d?_+INTELLIGENT_FIT_MARGIN:_,depth:u,rotation:A,id:e.id},O=__spreadValues(a?__spreadValues(__spreadValues({},a),k):__spreadProps(__spreadValues({},k),{attribute:"",valid:!0}),h);o&&Object.assign(O,o);const z=P.map(L=>lbUtils.PointCloudUtils.transferWorld2Canvas(L,t));return{boxParams:O,newPointList:z}},sideViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-a.x,y:i.center.y,z:i.center.z-a.y}})},sideViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O,{newBoxParams:L}=a.getNewBoxBySideUpdate(V,z,A,i);return L},backViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-a.x,z:i.center.z-a.y}})},backViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O;let{newBoxParams:L}=a.getNewBoxByBackUpdate(V,z,A,i);return L},syncSideViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeSideView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxSidePolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncBackViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeBackView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxBackPolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncTopViewByPoint=(e,t,i,a)=>{if(!i||!a)return;a.generateSphere(e),a.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),a.render();const{toolInstance:o,pointCloudInstance:d}=i,{point2d:P}=d.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?__spreadProps(__spreadValues(__spreadValues({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},synchronizeTopView=(e,t,i,a)=>{var o,d;if(!i||!a)return;a.generateBox(e,t.id),a.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),h=[...P.polygonList],v=h.find(b=>b.id===t.id);v?(v.pointList=u,v.valid=(o=e.valid)!=null?o:!0):h.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(d=e.valid)!=null?d:!0}),P.setResultAndSelectedID(h,t.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:i,backViewInstance:a,mainViewInstance:o,addPointCloudBox:d,addPointCloudSphere:P,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:h,pointCloudSphereList:v,hideAttributes:b,setHighlight2DDataList:T,cuboidBoxIn2DView:V,imageSizes:_}=e,{addHistory:D,initHistory:A,pushHistoryUnderUpdatePolygon:k}=useHistory.useHistory(),{selectedPolygon:O}=usePolygon.usePolygon(),{getPointCloudSphereByID:z,updatePointCloudSphere:L,selectedSphere:q}=useSphere.useSphere(),{currentData:j,config:m}=ctx.useSelector(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,s).config)}}),R=ctx.useDispatch(),tt=ahooks.useLatest(V),W=n=>{if(!tt.current){const{mappingImgList:s=[]}=j,p=s.map(r=>index.getRectPointCloudBox({pointCloudBox:n,mappingData:r,imageSizes:_}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:I,updateSelectedBox:ot,updateSelectedBoxes:Z,getPointCloudByID:et}=useSingleBox.useSingleBox({generateRects:W}),{t:nt}=reactI18next.useTranslation(),X=I==null?void 0:I.info;if(!t||!i||!a)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:G}=t,it=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},st=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},rt=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const C={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:v})});const g=topViewPoint2PointCloud(n,s,G,void 0,C);c(n.id);const f=P(g);H(PointCloudView.Top,n,g,p,f,m),D({newSphereParams:g})},lt=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:C})=>{var g,f;const x={attribute:(g=t.toolInstance.defaultAttribute)!=null?g:""};r===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:v})});const B=t==null?void 0:t.toolInstance,w=__spreadValues({},n);let{boxParams:y,newPointList:U}=topViewPolygon2PointCloud(w,s,G,void 0,x,C);if(y=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[y],stepConfig:m,action:"viewUpdateBox"}))[0],(m==null?void 0:m.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<m.lowerLimitPointsNumInBox){antd.message.info(nt("LowerLimitPointsNumInBox",{num:m.lowerLimitPointsNumInBox})),B.deletePolygon(y.id);return}C&&(U==null?void 0:U.length)&&(w.pointList=U);const S=b.includes(w.attribute);W(y);const N=d(y),Q=(f=e==null?void 0:e.polygonList)!=null?f:[];t==null||t.updatePolygonList(N!=null?N:[],Q),S?c([]):(c(y.id),B.selection.setSelectedIDs(w.id),E({omitView:PointCloudView.Top,polygon:w,boxParams:y,zoom:l,newPointCloudBoxList:N}),C&&synchronizeTopView(y,w,t,o)),D({newBoxParams:y})},at=n=>{const{boxID:s,imageName:p,width:r,height:l,x:C,y:g}=n,f=h.find(x=>x.id===s);if(f==null?void 0:f.rects){const{rects:x=[]}=f,B=x.find(w=>w.imageName===p);if(B){let w=x;const y=__spreadProps(__spreadValues({},B),{width:r,height:l,x:C,y:g});w=x.map(S=>S===B?y:S);const U=__spreadProps(__spreadValues({},f),{rects:w}),M=h.map(S=>S===f?U:S);return t==null||t.updatePolygonList(M!=null?M:[]),M}}},dt=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const C=t==null?void 0:t.toolInstance;if(!(u.length===0||!C)){if(n||(I==null?void 0:I.info)){const g=n!=null?n:I==null?void 0:I.info;(l=C==null?void 0:C.selection)==null||l.setSelectedIDs(u[0]);const f=C.selectedPolygon;if(u.length===1&&g){E({omitView:PointCloudView.Top,polygon:f,boxParams:g,newPointCloudBoxList:s});return}}if((p||q)&&u.length===1){const g=p!=null?p:q;C.setSelectedID(u[0]);const f=C.selectedPoint;g&&H(PointCloudView.Top,f,g,void 0,r,m)}}},Y=(n,s,p)=>{if(X){let r,l;switch(p){case PointCloudView.Back:r=backViewPolygon2PointCloud;break;case PointCloudView.Side:r=sideViewPolygon2PointCloud;break;default:r=sideViewPolygon2PointCloud;break}l=r(n,s,X,i.pointCloudInstance);const g=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[l],stepConfig:m,action:"viewUpdateBox"}))[0],f=l.valid!==g.valid;if(l=g,o){const{count:B}=o.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=__spreadProps(__spreadValues({},l),{count:B})}const x=ot(l);return l=x.find(B=>B.id===l.id),E({omitView:f?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},J=(n,s,p)=>{if(q){let r,l;switch(p){case PointCloudView.Back:r=backViewPoint2PointCloud;break;case PointCloudView.Side:r=sideViewPoint2PointCloud;break;default:r=sideViewPoint2PointCloud;break}l=r(n,s,q);const C=L(l);return H(p,n,l,void 0,C,m),C}},ct=(n,s)=>{J(n,s,PointCloudView.Side)},ut=(n,s)=>{J(n,s,PointCloudView.Back)},pt=(n,s)=>{Y(n,s,PointCloudView.Side)},Pt=(n,s)=>{Y(n,s,PointCloudView.Back)},Ct=(n,s)=>{const p=z(n.id),r=topViewPoint2PointCloud(n,s,G,p),l=L(r);H(PointCloudView.Top,n,r,void 0,l,m)},gt=(n,s)=>{if(O){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>lbUtils.PointCloudUtils.transferCanvas2World(l,s)),k(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=et(r.id),{boxParams:C}=topViewPolygon2PointCloud(r,s,t.pointCloudInstance,l);return C});if(p=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:p,stepConfig:m,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=Z(p);E({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=Z(p);r&&e.syncAllViewPointCloudColor(r)}},ht=n=>{var s,p,r,l,C;if(I){const g=Number(n.widthDefault),f=Number(n.depthDefault),x=Number(n.heightDefault),B=I==null?void 0:I.info.trackID,y=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(F=>(F==null?void 0:F.trackID)===B),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(C=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:C.height},M=y.pointList.map(F=>lbUtils.PointCloudUtils.transferCanvas2World(F,U)),S=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(M,x,g),N=S[0],Q=S[2],K=lbAnnotation.MathUtils.getLineCenterPoint([N,Q]),ft=I.info.center.z-I.info.depth/2,$=__spreadProps(__spreadValues({},I.info),{center:{x:K.x,y:K.y,z:ft+f/2},width:g,height:x,depth:f,valid:!0}),xt=Z([$]);E({omitView:PointCloudView["3D"],polygon:y,boxParams:$,newPointCloudBoxList:xt})}},H=(n,s,p,r,l,C)=>__async(void 0,null,function*(){const g=j==null?void 0:j.url,f={[PointCloudView.Side]:()=>{syncSideViewByPoint(p,s,i,g,C)},[PointCloudView.Back]:()=>{a&&syncBackViewByPoint(p,s,a,g,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(p,s,t,o)}};Object.keys(f).forEach(x=>{x!==n&&f[x]()}),r&&(o==null||o.updateCameraZoom(r)),st(p)}),E=n=>__async(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:C}=n,g=j==null?void 0:j.url;C&&(yield e.syncAllViewPointCloudColor(C));const f={[PointCloudView.Side]:()=>{synchronizeSideView(r,p,i,g)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(r,p,a,g)},[PointCloudView.Top]:()=>{synchronizeTopView(r,p,t,o)}};Object.keys(f).forEach(x=>{x!==s&&f[x]()}),l&&(o==null||o.updateCameraZoom(l)),it(r)});return{topViewAddSphere:rt,topViewAddBox:lt,topViewSelectedChanged:dt,topViewUpdatePoint:Ct,sideViewUpdatePoint:ct,backViewUpdatePoint:ut,topViewUpdateBox:gt,sideViewUpdateBox:pt,backViewUpdateBox:Pt,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=lbUtils.PointCloudUtils.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=j){var p,r,l,C,g,f;if(!(s==null?void 0:s.url)||!o)return;T([]),actionCreators.SetPointCloudLoading(R,!0),actionCreators.SetLoadPCDFileLoading(R,!0),yield o.loadPCDFile(s.url,(p=m==null?void 0:m.radius)!=null?p:DEFAULT_RADIUS),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],B=[],w=[],y=[];o.updateTopCamera();const U=(l=(r=index.jsonParser(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(C=e.sideViewInstance)==null||C.clearAllData(),(g=e.backViewInstance)==null||g.clearAllData(),t.updateData(s.url,s.result,{radius:(f=m==null?void 0:m.radius)!=null?f:DEFAULT_RADIUS}),s.result&&(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),w=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),B=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),y=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),A({pointCloudBoxList:x,polygonList:w,lineList:B,pointCloudSphereList:y}),actionCreators.SetPointCloudLoading(R,!1),actionCreators.SetLoadPCDFileLoading(R,!1)}),updateViewsByDefaultSize:ht,generateRects:W,update2DViewRect:at}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=({currentData:t,imgList:f,drawLayerSlot:
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=({currentData:t,imgList:f,drawLayerSlot:s,checkMode:l,intelligentFit:g,imgIndex:P,loadPCDFileLoading:S,config:v})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:d,setGlobalPattern:p,selectedIDs:c}=e,E=ctx.useDispatch(),[a,m]=React.useState(!1),x=(c==null?void 0:c.length)>0&&a,L=index.jsonParser(t.result),{toolInstanceRef:o,clearToolInstance:q}=annotation.useCustomToolInstance({basicInfo:L});if(React.useEffect(()=>{o.current.setPointCloudGlobalPattern=n=>{n!==d&&(p(n),e.clearAllDetectionInstance(),q())}},[d]),React.useEffect(()=>{var n;if(actionCreators.SetLoadPCDFileLoading(E,!0),t){const{boxParamsList:i,polygonList:r,lineList:u,sphereParamsList:b,segmentation:j}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((n=t==null?void 0:t.result)!=null?n:"");e.setPointCloudResult(i),e.setPolygonList(r),e.setLineList(u),e.setPointCloudSphereList(b),e.setSegmentation(j)}},[P]),React.useEffect(()=>{o.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],o.current.exportCustomData=()=>{var n,i,r,u;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(i=e.lineList)!=null?i:[],resultPoint:(r=e.pointCloudSphereList)!=null?r:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),f.length===0)return null;if(d===lbUtils.EPointCloudPattern.Segmentation)return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegment2DView,null)),React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegmentStatus,{config:v}),s==null?void 0:s({direct:!0}));let C=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left-bottom")},React__default.default.createElement(PointCloudBackView,{checkMode:l}),React__default.default.createElement(PointCloudSideView,{checkMode:l}));return a&&(C=React__default.default.createElement(index$2,{selectAndEnlarge:x,checkMode:l})),React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud3DView,null),C),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right")]:!0,[dom.getClassName("point-cloud-container","rightZoom")]:a})},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:s,checkMode:l,intelligentFit:g,setIsEnlargeTopView:m,onExitZoom:()=>{m(!1)},isEnlargeTopView:a}),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right-bottom")]:!a,[dom.getClassName("point-cloud-container","right-bottom-floatLeft")]:a})},React__default.default.createElement(PointCloud2DView,{isEnlargeTopView:a,thumbnailWidth:a?300:455,checkMode:l})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
|
package/dist/index.css
CHANGED
|
@@ -1964,6 +1964,13 @@
|
|
|
1964
1964
|
position: relative;
|
|
1965
1965
|
}
|
|
1966
1966
|
|
|
1967
|
+
.bee-point-cloud-container__title-button {
|
|
1968
|
+
border-radius: 2px;
|
|
1969
|
+
padding: 4px 8px;
|
|
1970
|
+
background-color: #fff;
|
|
1971
|
+
color: #000000;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1967
1974
|
.bee-point-cloud-wrapper {
|
|
1968
1975
|
display: flex;
|
|
1969
1976
|
height: 100%;
|
|
@@ -2061,12 +2068,6 @@
|
|
|
2061
2068
|
left: 16px;
|
|
2062
2069
|
z-index: 1000;
|
|
2063
2070
|
}
|
|
2064
|
-
.bee-point-cloud-wrapper .bee-point-cloud-container__title-button {
|
|
2065
|
-
border-radius: 2px;
|
|
2066
|
-
padding: 4px 8px;
|
|
2067
|
-
background-color: #fff;
|
|
2068
|
-
color: #000000;
|
|
2069
|
-
}
|
|
2070
2071
|
.bee-point-cloud-wrapper .bee-point-cloud-container__zoom {
|
|
2071
2072
|
position: absolute;
|
|
2072
2073
|
top: 0px;
|
|
@@ -22,7 +22,7 @@ interface IPointCloudSegment {
|
|
|
22
22
|
type AttrPanelLayout = '' | 'left' | 'right';
|
|
23
23
|
interface IHighlight2DData {
|
|
24
24
|
url: string;
|
|
25
|
-
calib
|
|
25
|
+
calib?: ICalib;
|
|
26
26
|
}
|
|
27
27
|
export interface IPointCloudContext extends IPointCloudContextInstances, IPointCloudStatus, IPointCloudSegment {
|
|
28
28
|
pointCloudBoxList: IPointCloudBoxList;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IA2MapStateProps } from '@/store/annotation/map';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IProps extends IA2MapStateProps {
|
|
4
|
+
checkMode?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("react-redux").ConnectedComponent<({ currentData, highlightAttribute }: IProps) => React.JSX.Element | null, import("react-redux").Omit<IProps, "imgIndex" | "imgList" | "config" | "highlightAttribute" | "loadPCDFileLoading" | "currentData" | "stepInfo" | "configString">>;
|
|
7
|
+
export default _default;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { IPointCloudConfig } from '@labelbee/lb-utils';
|
|
3
|
+
declare const PointCloudSegmentStatus: (props: {
|
|
4
|
+
config: IPointCloudConfig;
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
3
6
|
export default PointCloudSegmentStatus;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { IAnnotationStateProps } from '../../../store/annotation/map';
|
|
7
7
|
import { ICalib } from '@labelbee/lb-utils';
|
|
8
8
|
declare const useHighlight: ({ currentData }: Partial<IAnnotationStateProps>) => {
|
|
9
|
-
toggle2dVisible: (url: string, calib
|
|
9
|
+
toggle2dVisible: (url: string, calib?: ICalib) => Promise<void>;
|
|
10
10
|
isHighlightVisible: (url: string) => boolean;
|
|
11
11
|
};
|
|
12
12
|
export { useHighlight };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("./components/batchUpdateModal/index.js"),lbUtils=require("@labelbee/lb-utils"),index$2=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),index$3=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const AnnotatedBox=({imgList:t,imgIndex:e})=>{const n=React.useContext(PointCloudContext.PointCloudContext),[d,s]=React.useState([]),{t:a}=reactI18next.useTranslation();React.useEffect(()=>{const f=t;let r=new Map;s(lbUtils.PointCloudUtils.getAllPointCloudResult({imgList:f,extraBoxList:u,ignoreIndexList:[e]}).filter(o=>!o.trackID||r.get(o.trackID)?!1:(r.set(o.trackID,!0),!0)).sort((o,v)=>{var i,g;const c=(i=o==null?void 0:o.trackID)!=null?i:0,p=(g=v==null?void 0:v.trackID)!=null?g:0;return c-p}).map(o=>{var v;return(v=o==null?void 0:o.trackID)!=null?v:0}))},[n.pointCloudBoxList,t]);const{pointCloudBoxList:u}=n;return React__default.default.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},React__default.default.createElement("div",{style:{marginBottom:16}},a("AllTrackIDs")),React__default.default.createElement("div",null,d.map(f=>React__default.default.createElement(antd.Tag,{color:"#F3F4FF",key:f,style:{color:"#666",marginBottom:8}},f))))},BoxTrackIDInput=()=>{const[t,e]=React.useState(!1),n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:d}=n,{selectedBox:s,updateSelectedBox:a}=useSingleBox.useSingleBox(),[u,f]=React.useState(""),{t:r}=reactI18next.useTranslation(),o=s==null?void 0:s.info.trackID,v=c=>!!d.find(S=>S.trackID===c&&S.id!==(s==null?void 0:s.info.id)),i=(c=!1)=>{const p=parseInt(u,10);if(c&&e(!1),isNaN(p)){antd.message.error(r("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(r("NotAllowDecimalPointsInTrackID"));return}if(v(p)){antd.message.error(r("DuplicateTrackIDsExist"));return}if(!(p>0)){antd.message.error(r("PositiveIntegerCheck"));return}g(p)};React.useEffect(()=>{e(!1)},[o]);const g=c=>{var p;const S=a({trackID:c});(p=n==null?void 0:n.topViewInstance)==null||p.updatePolygonList(S!=null?S:[])};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,r("CurrentBoxTrackIDs")),o&&React__default.default.createElement(index$1,{id:o,updateCurrentPolygonList:c=>g(c)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t&&o?React__default.default.createElement(antd.Input,{defaultValue:o,onChange:c=>{f(c.target.value)},disabled:!o,size:"small",onBlur:()=>{i()},onPressEnter:()=>{i(!0)}}):React__default.default.createElement("span",null,o),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof o!="undefined"?"pointer":"not-allowed"},onClick:()=>{o&&e(!t)}})))},AttributeUpdater=({attributeList:t,subAttributeList:e,toolInstance:n,config:d,stepList:s,stepInfo:a,enableColorPicker:u})=>{const{selectedBox:f}=useSingleBox.useSingleBox(),r=React.useContext(PointCloudContext.PointCloudContext),{t:o}=reactI18next.useTranslation(),{defaultAttribute:v}=useAttribute.useAttribute(),i=usePointCloudViews.usePointCloudViews(),g=ctx.useDispatch(),c={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},p={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},S=(l,x)=>{var b,_,I,y,m;const E=(b=d==null?void 0:d.attributeList)==null?void 0:b.map(C=>C.value===l?__spreadProps(__spreadValues({},C),{color:x}):C),k=__spreadProps(__spreadValues({},d),{attributeList:E}),T=JSON.stringify(k),B=s==null?void 0:s.map(C=>(C==null?void 0:C.step)===(a==null?void 0:a.step)?__spreadProps(__spreadValues({},C),{config:T}):C);(_=r==null?void 0:r.topViewInstance)==null||_.updateAttributeList(E),(I=r==null?void 0:r.sideViewInstance)==null||I.updateAttributeList(E),(y=r==null?void 0:r.backViewInstance)==null||y.updateAttributeList(E),(m=r==null?void 0:r.mainViewInstance)==null||m.setConfig(k),g(actionCreators.SetTaskStepList({stepList:B}))},w=l=>{i.updateViewsByDefaultSize&&i.updateViewsByDefaultSize(l)},D=l=>{n.setDefaultAttribute(l)},P=(l,x)=>{n.setSubAttribute(l,x)},L=t.map(l=>({label:l.key,value:l.value,color:l==null?void 0:l.color,limit:l==null?void 0:l.limit,isDefault:l==null?void 0:l.isDefault}));return React__default.default.createElement("div",null,React__default.default.createElement("div",{style:c},o("Attribute")),React__default.default.createElement(index$2.default,{list:L,forbidDefault:!0,selectedAttribute:v!=null?v:"",attributeChanged:l=>D(l),updateColorConfig:S,enableColorPicker:u,updateSize:w}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),f&&React__default.default.createElement(React__default.default.Fragment,null,e.map(l=>{var x,b,_,I,y;return(l==null?void 0:l.subSelected)&&React__default.default.createElement("div",{style:{marginTop:12},key:l.value},React__default.default.createElement("div",{style:p},o("SubAttribute"),"-",l.key),((x=l.subSelected)==null?void 0:x.length)<5?React__default.default.createElement(index$2.default,{list:l.subSelected.map(m=>({label:m.key,value:m.value})),selectedAttribute:(_=(b=r.selectedPointCloudBox)==null?void 0:b.subAttribute)==null?void 0:_[l.value],num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:m=>P(l.value,m),style:{marginBottom:12}}):React__default.default.createElement(antd.Select,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(y=(I=r.selectedPointCloudBox)==null?void 0:I.subAttribute)==null?void 0:y[l.value],placeholder:o("PleaseSelect"),onChange:m=>P(l.value,m),allowClear:!0},l.subSelected.map(m=>React__default.default.createElement(antd.Select.Option,{key:m.value,value:m.value},m.key))),React__default.default.createElement(antd.Divider,{style:{margin:0}}))})))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:t})=>{const{ptSegmentInstance:e}=React.useContext(PointCloudContext.PointCloudContext),[n,d]=React.useState("LassoSelector"),{t:s}=reactI18next.useTranslation();return React.useEffect(()=>{if(!e)return;const a=()=>{d("LassoSelector")},u=()=>{d("CircleSelector")};return e.on("LassoSelector",a),e.on("CircleSelector",u),()=>{e.unbind("LassoSelector",a),e.unbind("CircleSelector",u)}},[e]),React__default.default.createElement("div",{className:`${index$3.sidebarCls}__level`},renderSegmentTools.map(a=>{const u=n===a.toolName;return React__default.default.createElement("span",{className:`${index$3.sidebarCls}__toolOption`,key:a.toolName,onClick:()=>e==null?void 0:e.emit(a.toolName)},React__default.default.createElement("img",{className:`${index$3.sidebarCls}__singleTool`,src:u?a==null?void 0:a.selectedSvg:a==null?void 0:a.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$3.sidebarCls}__toolOption__selected`]:u})},s(a.toolName)))}))},PointCloudToolSidebar=({stepInfo:t,toolInstance:e,imgList:n,imgIndex:d,stepList:s,enableColorPicker:a})=>{var u,f;const{updatePointCloudPattern:r,pointCloudPattern:o,isPointCloudSegmentationPattern:v}=useStatus.useStatus(),i=index.jsonParser(t.config),g=(u=i==null?void 0:i.attributeList)!=null?u:[],c=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(f=i==null?void 0:i.inputList)!=null?f:[]:[];return v?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:e}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:g,subAttributeList:c,config:i,stepList:s,stepInfo:t,enableColorPicker:a})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:o,onChange:p=>r==null?void 0:r(p)}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:g,subAttributeList:c,config:i,stepList:s,stepInfo:t,enableColorPicker:a}),(i==null?void 0:i.trackConfigurable)===!0&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(AnnotatedBox,{imgList:n,imgIndex:d})))},mapStateToProps=t=>{var e,n,d,s;const a=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList),u=(d=t.annotation)==null?void 0:d.toolInstance,f=(s=t.annotation)==null?void 0:s.stepList;return{stepInfo:a,toolInstance:u,imgList:t.annotation.imgList,imgIndex:t.annotation.imgIndex,stepList:f}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("./components/batchUpdateModal/index.js"),lbUtils=require("@labelbee/lb-utils"),index$2=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),icon_rect=require("../../../../assets/annotation/rectTool/icon_rect.svg.js"),icon_rect_a=require("../../../../assets/annotation/rectTool/icon_rect_a.svg.js"),index$3=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,o)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,__spreadValues=(t,e)=>{for(var o in e||(e={}))__hasOwnProp.call(e,o)&&__defNormalProp(t,o,e[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))__propIsEnum.call(e,o)&&__defNormalProp(t,o,e[o]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const AnnotatedBox=({imgList:t,imgIndex:e})=>{const o=React.useContext(PointCloudContext.PointCloudContext),[p,i]=React.useState([]),{t:l}=reactI18next.useTranslation();React.useEffect(()=>{const c=t;let v=new Map;i(lbUtils.PointCloudUtils.getAllPointCloudResult({imgList:c,extraBoxList:u,ignoreIndexList:[e]}).filter(a=>!a.trackID||v.get(a.trackID)?!1:(v.set(a.trackID,!0),!0)).sort((a,r)=>{var s,g;const d=(s=a==null?void 0:a.trackID)!=null?s:0,m=(g=r==null?void 0:r.trackID)!=null?g:0;return d-m}).map(a=>{var r;return(r=a==null?void 0:a.trackID)!=null?r:0}))},[o.pointCloudBoxList,t]);const{pointCloudBoxList:u}=o;return React__default.default.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},React__default.default.createElement("div",{style:{marginBottom:16}},l("AllTrackIDs")),React__default.default.createElement("div",null,p.map(c=>React__default.default.createElement(antd.Tag,{color:"#F3F4FF",key:c,style:{color:"#666",marginBottom:8}},c))))},BoxTrackIDInput=()=>{const[t,e]=React.useState(!1),o=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:p}=o,{selectedBox:i,updateSelectedBox:l}=useSingleBox.useSingleBox(),[u,c]=React.useState(""),{t:v}=reactI18next.useTranslation(),a=i==null?void 0:i.info.trackID,r=d=>!!p.find(C=>C.trackID===d&&C.id!==(i==null?void 0:i.info.id)),s=(d=!1)=>{const m=parseInt(u,10);if(d&&e(!1),isNaN(m)){antd.message.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(v("NotAllowDecimalPointsInTrackID"));return}if(r(m)){antd.message.error(v("DuplicateTrackIDsExist"));return}if(!(m>0)){antd.message.error(v("PositiveIntegerCheck"));return}g(m)};React.useEffect(()=>{e(!1)},[a]);const g=d=>{var m;const C=l({trackID:d});(m=o==null?void 0:o.topViewInstance)==null||m.updatePolygonList(C!=null?C:[])};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,v("CurrentBoxTrackIDs")),a&&React__default.default.createElement(index$1,{id:a,updateCurrentPolygonList:d=>g(d)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t&&a?React__default.default.createElement(antd.Input,{defaultValue:a,onChange:d=>{c(d.target.value)},disabled:!a,size:"small",onBlur:()=>{s()},onPressEnter:()=>{s(!0)}}):React__default.default.createElement("span",null,a),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof a!="undefined"?"pointer":"not-allowed"},onClick:()=>{a&&e(!t)}})))},AttributeUpdater=({attributeList:t,subAttributeList:e,toolInstance:o,config:p,stepList:i,stepInfo:l,enableColorPicker:u})=>{const[c,v]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready}),{selectedBox:a}=useSingleBox.useSingleBox(),r=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:s}=r,{t:g}=reactI18next.useTranslation(),{defaultAttribute:d}=useAttribute.useAttribute(),m=usePointCloudViews.usePointCloudViews(),C=ctx.useDispatch(),T={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},k={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"};React.useEffect(()=>{if(!!s)return s.on("syncPointCloudStatus",v),()=>{s.unbind("syncPointCloudStatus",v)}},[s]);const w=(n,_)=>{var b,y,E,I,P;const x=(b=p==null?void 0:p.attributeList)==null?void 0:b.map(S=>S.value===n?__spreadProps(__spreadValues({},S),{color:_}):S),f=__spreadProps(__spreadValues({},p),{attributeList:x}),h=JSON.stringify(f),q=i==null?void 0:i.map(S=>(S==null?void 0:S.step)===(l==null?void 0:l.step)?__spreadProps(__spreadValues({},S),{config:h}):S);(y=r==null?void 0:r.topViewInstance)==null||y.updateAttributeList(x),(E=r==null?void 0:r.sideViewInstance)==null||E.updateAttributeList(x),(I=r==null?void 0:r.backViewInstance)==null||I.updateAttributeList(x),(P=r==null?void 0:r.mainViewInstance)==null||P.setConfig(f),C(actionCreators.SetTaskStepList({stepList:q}))},L=n=>{m.updateViewsByDefaultSize&&m.updateViewsByDefaultSize(n)},j=n=>{o.setDefaultAttribute(n)},D=(n,_)=>{o.setSubAttribute(n,_)},B=t.map(n=>({label:n.key,value:n.value,color:n==null?void 0:n.color,limit:n==null?void 0:n.limit,isDefault:n==null?void 0:n.isDefault}));return React__default.default.createElement("div",null,React__default.default.createElement("div",{style:T},g("Attribute")),React__default.default.createElement(index$2.default,{list:B,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:n=>j(n),updateColorConfig:w,enableColorPicker:u,updateSize:L}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),(a||c.cacheSegData)&&React__default.default.createElement(React__default.default.Fragment,null,e.map(n=>{var _,b,y,E,I,P,x;return(n==null?void 0:n.subSelected)&&React__default.default.createElement("div",{style:{marginTop:12},key:n.value},React__default.default.createElement("div",{style:k},g("SubAttribute"),"-",n.key),((_=n.subSelected)==null?void 0:_.length)<5?React__default.default.createElement(index$2.default,{list:n.subSelected.map(f=>({label:f.key,value:f.value})),selectedAttribute:((y=(b=r.selectedPointCloudBox)==null?void 0:b.subAttribute)==null?void 0:y[n.value])||((I=(E=c.cacheSegData)==null?void 0:E.subAttribute)==null?void 0:I[n.value]),num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:f=>D(n.value,f),style:{marginBottom:12}}):React__default.default.createElement(antd.Select,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(x=(P=r.selectedPointCloudBox)==null?void 0:P.subAttribute)==null?void 0:x[n.value],placeholder:g("PleaseSelect"),onChange:f=>D(n.value,f),allowClear:!0},n.subSelected.map(f=>React__default.default.createElement(antd.Select.Option,{key:f.value,value:f.value},f.key))),React__default.default.createElement(antd.Divider,{style:{margin:0}}))})))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"RectSelector",commonSvg:icon_rect,selectedSvg:icon_rect_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:t})=>{const{ptSegmentInstance:e}=React.useContext(PointCloudContext.PointCloudContext),[o,p]=React.useState("LassoSelector"),{t:i}=reactI18next.useTranslation();return React.useEffect(()=>{if(!e)return;const l=()=>{p("LassoSelector")},u=()=>{p("RectSelector")},c=()=>{p("CircleSelector")};return e.on("LassoSelector",l),e.on("RectSelector",u),e.on("CircleSelector",c),()=>{e.unbind("LassoSelector",l),e.unbind("RectSelector",u),e.unbind("CircleSelector",c)}},[e]),React__default.default.createElement("div",{className:`${index$3.sidebarCls}__level`},renderSegmentTools.map(l=>{const u=o===l.toolName;return React__default.default.createElement("span",{className:`${index$3.sidebarCls}__toolOption`,key:l.toolName,onClick:()=>e==null?void 0:e.emit(l.toolName)},React__default.default.createElement("img",{className:`${index$3.sidebarCls}__singleTool`,src:u?l==null?void 0:l.selectedSvg:l==null?void 0:l.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$3.sidebarCls}__toolOption__selected`]:u})},i(l.toolName)))}))},PointCloudToolSidebar=({stepInfo:t,toolInstance:e,imgList:o,imgIndex:p,stepList:i,enableColorPicker:l})=>{var u,c;const{updatePointCloudPattern:v,pointCloudPattern:a,isPointCloudSegmentationPattern:r}=useStatus.useStatus(),s=index.jsonParser(t.config),g=(u=s==null?void 0:s.attributeList)!=null?u:[],d=(s==null?void 0:s.secondaryAttributeConfigurable)===!0?(c=s==null?void 0:s.inputList)!=null?c:[]:[];return r?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:e}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:g,subAttributeList:d,config:s,stepList:i,stepInfo:t,enableColorPicker:l})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:a,onChange:m=>v==null?void 0:v(m)}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:g,subAttributeList:d,config:s,stepList:i,stepInfo:t,enableColorPicker:l}),(s==null?void 0:s.trackConfigurable)===!0&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(AnnotatedBox,{imgList:o,imgIndex:p})))},mapStateToProps=t=>{var e,o,p,i;const l=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(o=t.annotation)==null?void 0:o.stepList),u=(p=t.annotation)==null?void 0:p.toolInstance,c=(i=t.annotation)==null?void 0:i.stepList;return{stepInfo:l,toolInstance:u,imgList:t.annotation.imgList,imgIndex:t.annotation.imgIndex,stepList:c}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate180_black=require("../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),icon_del_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js"),lassoSelector=require("../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),circleSelector=require("../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),addSvg=require("../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js"),clearSvg=require("../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js"),React=require("react"),icons=require("@ant-design/icons"),index$1=require("../polygon/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj]},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate180={name:"Rotate180",icon:rotate180_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},deleteBox={name:"Delete",icon:icon_del_kj,shortCut:["Del"],noticeInfo:"SelectedStatus"},LassoSelector={name:"LassoSelector",icon:lassoSelector,shortCut:["H"],noticeInfo:"SelectorMsg"},CircleSelector={name:"CircleSelector",icon:circleSelector,shortCut:["
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate180_black=require("../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),icon_del_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js"),lassoSelector=require("../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),icon_rect=require("../../../../../../assets/annotation/rectTool/icon_rect.svg.js"),circleSelector=require("../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),addSvg=require("../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js"),clearSvg=require("../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js"),React=require("react"),icons=require("@ant-design/icons"),index$1=require("../polygon/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj]},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate180={name:"Rotate180",icon:rotate180_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},deleteBox={name:"Delete",icon:icon_del_kj,shortCut:["Del"],noticeInfo:"SelectedStatus"},LassoSelector={name:"LassoSelector",icon:lassoSelector,shortCut:["H"],noticeInfo:"SelectorMsg"},RectSelector={name:"RectSelector",icon:icon_rect,shortCut:["J"],noticeInfo:"SelectorMsg"},CircleSelector={name:"CircleSelector",icon:circleSelector,shortCut:["K"],noticeInfo:"SelectorMsg"},Drag3DBySpace={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:["space",icon_mouse_right_kj]},AddMove={name:"AddPoint",icon:addSvg,shortCut:["U"]},DeletePoint={name:"DeletePoint",icon:clearSvg,shortCut:["I"]},pointCloudShortCutTable=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"RectPattern"},CopyBox,PasteBox,LeftRotate,RightRotate,PrevBox,NextBox,Rotate180,CopyPrevPage,ChangeBoxInvalid,deleteBox,SelectMulti,SelectAll,index.fullScreen],pointCloudShortCutTable_POLYGON=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"PolygonPattern"},index$1.polygon,index$1.invalidPolygon,index$1.selectedPolygon,index$1.changePolygonAttribute,index$1.deletePolygon,index$1.insertPolygonPoint,index$1.deletePolygonPoint],pointCloudShortCutTable_SEGMENT=[index.backward,index.forward,rotateRoundCenter,Drag3DBySpace,LassoSelector,RectSelector,CircleSelector,AddMove,DeletePoint];exports.default=pointCloudShortCutTable,exports.pointCloudShortCutTable_POLYGON=pointCloudShortCutTable_POLYGON,exports.pointCloudShortCutTable_SEGMENT=pointCloudShortCutTable_SEGMENT;
|
package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function i(o,a){var r=atob(o);if(a){for(var e=new Uint8Array(r.length),n=0,t=r.length;n<t;++n)e[n]=r.charCodeAt(n);return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}return r}function l(o,a,r){var e=a===void 0?null:a,n=r===void 0?!1:r,t=i(o,n),u=t.indexOf(`
|
|
2
|
+
`,10)+1,c=t.substring(u)+(e?"//# sourceMappingURL="+e:""),f=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(f)}function v(o,a,r){var e;return function(t){return e=e||l(o,a,r),new Worker(e,t)}}export{v as createBase64WorkerFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createBase64WorkerFactory as b}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var l=b("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGM9T2JqZWN0LmRlZmluZVByb3BlcnR5LF89T2JqZWN0LmRlZmluZVByb3BlcnRpZXMsZj1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9ycyxuPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMsbD1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LFA9T2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZSxzPSh0LGUscik9PmUgaW4gdD9jKHQsZSx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6cn0pOnRbZV09cix1PSh0LGUpPT57Zm9yKHZhciByIGluIGV8fChlPXt9KSlsLmNhbGwoZSxyKSYmcyh0LHIsZVtyXSk7aWYobilmb3IodmFyIHIgb2YgbihlKSlQLmNhbGwoZSxyKSYmcyh0LHIsZVtyXSk7cmV0dXJuIHR9LE89KHQsZSk9Pl8odCxmKGUpKTtvbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7Y29uc3R7Y2FjaGVNYXA6cixpbmRleGVzOmEsY29sb3I6ZH09ZS5kYXRhLHY9YS5sZW5ndGgscD1bXTtmb3IobGV0IG89MDtvPHY7bz1vKzEpe2NvbnN0IGk9clthW29dXTtpJiZwLnB1c2goTyh1KHt9LGkpLHtjb2xvcjpkfSkpfXBvc3RNZXNzYWdlKHthbm5vdGF0aW9uczpbe3R5cGU6InBpeGVsUG9pbnRzIixhbm5vdGF0aW9uOnB9XX0pfX0pKCk7Cgo=",null,!1);export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import v,{useState as A,useRef as b,useImperativeHandle as V,useEffect as u}from"react";import{ViewOperation as j,ImgUtils as Z}from"@labelbee/lb-annotation";import{Spin as k}from"antd/es";import D from"../../hooks/useRefCache.js";var
|
|
1
|
+
import v,{useState as A,useRef as b,useImperativeHandle as V,useEffect as u}from"react";import{ViewOperation as j,ImgUtils as Z}from"@labelbee/lb-annotation";import{Spin as k}from"antd/es";import D from"../../hooks/useRefCache.js";var M=Object.defineProperty,y=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,O=(e,t,o)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,g=(e,t)=>{for(var o in t||(t={}))U.call(t,o)&&O(e,o,t[o]);if(y)for(var o of y(t))x.call(t,o)&&O(e,o,t[o]);return e};const _={width:455,height:100},F=e=>{if(!e)return _;if(e.width&&e.height)return e;const t=g({},e);return t.width||(t.width=_.width),t.height||(t.height=_.height),t},H=(e,t)=>{var o,w;const{src:p,annotations:s=[],style:z={stroke:"blue",thickness:3},zoomChange:c,backgroundStyle:P={},onChange:d,showLoading:S=!1,globalStyle:C,afterImgOnLoad:L}=e,f=F(e.size),[R,h]=A(!1),m=b(null),r=b(),I=D(L);V(t,()=>{const n=r.current;return n?{zoomIn:()=>n.zoomChanged(!0),zoomOut:()=>n.zoomChanged(!1),initImgPos:()=>n.initImgPos(),toolInstance:n}:{}},[r.current]),u(()=>(m.current&&(r.current=new j({container:m.current,size:f,style:z,annotations:s,config:"{}",zoomInfo:e.zoomInfo,staticMode:e.staticMode}),r.current.init()),()=>{var n;(n=r.current)==null||n.destroy()}),[]),u(()=>{var n;r.current&&(h(!0),(n=r.current)==null||n.setLoading(!0),Z.load(p).then(a=>{var i,l;(i=r.current)==null||i.setLoading(!1),h(!1),(l=r.current)==null||l.setImgNode(a),I.current&&I.current(a)}).catch(()=>{var a;(a=r.current)==null||a.setLoading(!1),h(!1)}))},[p]),u(()=>{r.current&&r.current.updateData(s)},[s]),u(()=>{const n=r.current;(n==null?void 0:n.setSize)&&(n.setSize(f),n.initPosition())},[(o=e.size)==null?void 0:o.width,(w=e.size)==null?void 0:w.height]),u(()=>{var n,a;return r.current&&((n=r.current)==null||n.on("onChange",(...i)=>{d==null||d.apply(null,i)}),(a=r.current)==null||a.on("renderZoom",i=>{c&&c(i)})),()=>{var i,l;(i=r.current)==null||i.unbindAll("onChange"),(l=r.current)==null||l.unbindAll("renderZoom")}},[c,d]);const E=v.createElement("div",{ref:m,style:g(g({position:"relative"},f),P)});return v.createElement(k,{spinning:S||R,delay:300,style:C},E)};var N=v.forwardRef(H);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLatest as
|
|
1
|
+
import{useLatest as B}from"ahooks";import{Spin as M}from"antd/es";import d,{useContext as N,useRef as w,useState as U,useEffect as u}from"react";import{connect as F}from"react-redux";import{usePointCloudViews as T}from"../pointCloudView/hooks/usePointCloudViews.js";import{PointCloudContext as $}from"../pointCloudView/PointCloudContext.js";import{a2MapStateToProps as q}from"../../store/annotation/map.js";import{LabelBeeContext as A}from"../../store/ctx.js";import{PointCloud2DRectOperation as G,ImgUtils as H}from"@labelbee/lb-annotation";var J=Object.defineProperty,K=Object.defineProperties,Q=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,O=(o,e,t)=>e in o?J(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,f=(o,e)=>{for(var t in e||(e={}))W.call(e,t)&&O(o,t,e[t]);if(C)for(var t of C(e))X.call(e,t)&&O(o,t,e[t]);return o},R=(o,e)=>K(o,Q(e));const Y=o=>{var e;const{mappingData:t,size:l,config:b,checkMode:D,afterImgOnLoad:h}=o,s=(e=t==null?void 0:t.url)!=null?e:"",{pointCloudBoxList:c,setPointCloudResult:x}=N($),{update2DViewRect:y}=T(),p=d.useRef(null),n=w(null),m=B(y),v=w(null),[I,V]=U(!0),_=r=>{var a;const i=(a=m.current)==null?void 0:a.call(m,r);v.current=i,x(i)},j=()=>{var r;let a=[];c.forEach(i=>{const{rects:S=[],id:P,attribute:E,trackID:L}=i,g=S.find(z=>z.imageName===(t==null?void 0:t.path)),k=P+"_"+(t==null?void 0:t.path);g&&(a=[...a,R(f({},g),{boxID:P,id:k,attribute:E,order:L})])}),(r=n.current)==null||r.setResult(a)};return u(()=>{if(p.current){const r=new G({container:p.current,size:l,config:R(f({},b),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:D});return n.current=r,n.current.init(),n.current.on("updateDragResult",_),()=>{var a,i;(a=n.current)==null||a.unbind("updateDragResult",_),(i=n.current)==null||i.destroy()}}},[]),u(()=>{n.current&&s&&H.load(s).then(r=>{n.current.setImgNode(r),h(r),V(!1)})},[s]),u(()=>{var r;(r=n.current)==null||r.setSize(l)},[l]),u(()=>{c!==v.current&&j()},[c,s]),d.createElement(M,{spinning:I},d.createElement("div",{ref:p,style:f({position:"relative"},l)}))};var Z=F(q,null,null,{context:A})(Y);export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as H}from"../../utils/dom.js";import m,{useRef as
|
|
1
|
+
import{getClassName as H}from"../../utils/dom.js";import m,{useRef as V,useState as L,useContext as R,useCallback as _,useEffect as O}from"react";import N from"../AnnotationView/index.js";import w from"../../hooks/useSize.js";import{useSingleBox as A}from"./hooks/useSingleBox.js";import{useHighlight as q}from"./hooks/useHighlight.js";import F from"./components/HighlightVisible/index.js";import{PointCloudContext as G}from"./PointCloudContext.js";import J from"../pointCloud2DRectOperationView/index.js";var K=(t,l,e)=>new Promise((d,a)=>{var r=o=>{try{n(e.next(o))}catch(i){a(i)}},c=o=>{try{n(e.throw(o))}catch(i){a(i)}},n=o=>o.done?d(o.value):Promise.resolve(o.value).then(r,c);n((e=e.apply(t,l)).next())});const M=({view2dData:t,setSelectedID:l,currentData:e,showEnlarge:d,checkMode:a=!1})=>{var r;const c=V(null),n=V(),{selectedBox:o}=A(),i=w(c),{url:p,calib:h,path:y}=t,{toggle2dVisible:j,isHighlightVisible:P}=q({currentData:e}),[S,g]=L(!1),{cuboidBoxIn2DView:k,cacheImageNodeSize:z}=R(G),B=!t,x=u=>{f(),z({path:y,imgNode:u})},f=_(()=>{var u,b;const C=(u=n.current)==null?void 0:u.toolInstance;if(l(""),!o||!C)return;const s=t.annotations.find(E=>E.annotation.id===o.info.id);let v="";s&&((b=s==null?void 0:s.annotation.pointList)==null?void 0:b.length)>0&&(C.focusPositionByPointList(s==null?void 0:s.annotation.pointList),v=o.info.id,l(v))},[o,n.current,t.annotations]);O(()=>{f()},[f]);const I=()=>K(void 0,null,function*(){g(!0),yield j(p,h),g(!1)});return m.createElement("div",{className:H("point-cloud-2d-image"),ref:c},k?m.createElement(N,{src:(r=t==null?void 0:t.url)!=null?r:"",annotations:t.annotations,size:i,ref:n,globalStyle:{display:B?"none":"block"},afterImgOnLoad:x,zoomInfo:{min:.01,max:1e3,ratio:.4}}):m.createElement(J,{mappingData:t,size:i,checkMode:a,afterImgOnLoad:x}),h&&m.createElement(F,{visible:P(p),onClick:I,loading:S,style:{position:"absolute",right:16,top:16,zIndex:d?-1:101}}))};export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as S}from"../../utils/dom.js";import n,{useState as E,useContext as X,useEffect as V}from"react";import{PointCloudContainer as Y}from"./PointCloudLayout.js";import{PointCloudContext as Z}from"./PointCloudContext.js";import{connect as B}from"react-redux";import{cKeyCode as D,pointCloudLidar2image as ee}from"@labelbee/lb-annotation";import{LabelBeeContext as te}from"../../store/ctx.js";import{a2MapStateToProps as ne}from"../../store/annotation/map.js";import{toolStyleConverter as oe}from"@labelbee/lb-utils";import ie from"./PointCloud2DSingleView.js";import R from"./components/TitleButton/index.js";import{LeftOutlined as le}from"@ant-design/icons";import re from"classnames";import se from"../../assets/annotation/common/icon_esc.svg.js";import ae from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import ce from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";var ue=Object.defineProperty,me=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,T=(e,o,t)=>o in e?ue(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,h=(e,o)=>{for(var t in o||(o={}))de.call(o,t)&&T(e,t,o[t]);if(A)for(var t of A(o))fe.call(o,t)&&T(e,t,o[t]);return e},x=(e,o)=>me(e,pe(o));const C=D.default,ge=({showEnlarge:e,isEnlargeTopView:o,data:t,setIsEnlarge:f,setCurIndex:u,curIndex:g=0,index:w,annotations2d:m})=>o?n.createElement(R,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?n.createElement("div",{style:{display:"flex",alignItems:"center"}},n.createElement(le,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{f(!1),u(void 0)}}),n.createElement("span",null,t==null?void 0:t.calName),n.createElement("span",{style:{marginLeft:"8px"}},g+1,"/",m==null?void 0:m.length)):n.createElement(R,{title:t==null?void 0:t.calName,onClick:()=>{f(!0),u(w)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),ve=({currentData:e,config:o,thumbnailWidth:t,isEnlargeTopView:f,highlightAttribute:u,loadPCDFileLoading:g,checkMode:w})=>{var m;const[c,K]=E([]),{topViewInstance:$,displayPointCloudList:L}=X(Z),[b,q]=E(""),[v,P]=E(!1),[a,y]=E(void 0);V(()=>{var i;if(!g&&$&&(e==null?void 0:e.mappingImgList)&&((i=e==null?void 0:e.mappingImgList)==null?void 0:i.length)>0){const
|
|
1
|
+
import{getClassName as S}from"../../utils/dom.js";import n,{useState as E,useContext as X,useEffect as V}from"react";import{PointCloudContainer as Y}from"./PointCloudLayout.js";import{PointCloudContext as Z}from"./PointCloudContext.js";import{connect as B}from"react-redux";import{cKeyCode as D,pointCloudLidar2image as ee}from"@labelbee/lb-annotation";import{LabelBeeContext as te}from"../../store/ctx.js";import{a2MapStateToProps as ne}from"../../store/annotation/map.js";import{toolStyleConverter as oe}from"@labelbee/lb-utils";import ie from"./PointCloud2DSingleView.js";import R from"./components/TitleButton/index.js";import{LeftOutlined as le}from"@ant-design/icons";import re from"classnames";import se from"../../assets/annotation/common/icon_esc.svg.js";import ae from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import ce from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";var ue=Object.defineProperty,me=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,T=(e,o,t)=>o in e?ue(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,h=(e,o)=>{for(var t in o||(o={}))de.call(o,t)&&T(e,t,o[t]);if(A)for(var t of A(o))fe.call(o,t)&&T(e,t,o[t]);return e},x=(e,o)=>me(e,pe(o));const C=D.default,ge=({showEnlarge:e,isEnlargeTopView:o,data:t,setIsEnlarge:f,setCurIndex:u,curIndex:g=0,index:w,annotations2d:m})=>o?n.createElement(R,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?n.createElement("div",{style:{display:"flex",alignItems:"center"}},n.createElement(le,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{f(!1),u(void 0)}}),n.createElement("span",null,t==null?void 0:t.calName),n.createElement("span",{style:{marginLeft:"8px"}},g+1,"/",m==null?void 0:m.length)):n.createElement(R,{title:t==null?void 0:t.calName,onClick:()=>{f(!0),u(w)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),ve=({currentData:e,config:o,thumbnailWidth:t,isEnlargeTopView:f,highlightAttribute:u,loadPCDFileLoading:g,checkMode:w})=>{var m;const[c,K]=E([]),{topViewInstance:$,displayPointCloudList:L}=X(Z),[b,q]=E(""),[v,P]=E(!1),[a,y]=E(void 0);V(()=>{var i;if(!g&&$&&(e==null?void 0:e.mappingImgList)&&((i=e==null?void 0:e.mappingImgList)==null?void 0:i.length)>0){const r={fill:"transparent",color:"green"};let s=[];e==null||e.mappingImgList.forEach(l=>{var p;const H=L.reduce((J,d)=>{var k;const Q=d.id===b||u===d.attribute,{transferViewData:U,viewRangePointList:_}=ee(d,l.calib,{createRange:Q}),I=(k=oe.getColorFromConfig({attribute:d.attribute},x(h({},o),{attributeConfigurable:!0}),{}))==null?void 0:k.stroke,W=z({viewDataPointList:U,pointCloudBox:d,defaultViewStyle:r,stroke:I}),N=[...J,...W];return(_==null?void 0:_.length)>0&&N.push({type:"polygon",annotation:x(h({id:b,pointList:_},r),{stroke:I,fill:"rgba(255, 255, 255, 0.6)"})}),N},[]);s.push({annotations:H,url:l==null?void 0:l.url,calName:(p=l==null?void 0:l.calib)==null?void 0:p.calName,calib:l==null?void 0:l.calib,path:l==null?void 0:l.path})}),K(s)}},[L,e==null?void 0:e.mappingImgList,b,u,g]),V(()=>(window.addEventListener("keydown",F),()=>{window.removeEventListener("keydown",F)}),[a]);const F=i=>{const{keyCode:r}=i;switch(r){case C.Esc:v&&P(!1);break;case C.Left:O();break;case C.Right:j();break}},O=()=>{a===void 0||!v||Number(a)>0&&y(a-1)},j=()=>{a===void 0||!v||Number(a)<(c==null?void 0:c.length)-1&&y(a+1)},z=({viewDataPointList:i,pointCloudBox:r,defaultViewStyle:s,stroke:l})=>i.map(p=>({type:p.type,annotation:x(h({id:r.id,pointList:p.pointList},s),{stroke:l})})),M=!e||!(e==null?void 0:e.mappingImgList)||!(((m=e==null?void 0:e.mappingImgList)==null?void 0:m.length)>0),G=n.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},n.createElement("img",{src:ae,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>O()}),n.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),n.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),n.createElement("img",{src:ce,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>j()}),n.createElement("img",{src:se,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{P(!1),y(void 0)}}),n.createElement("span",null,"\u952E\u9000\u51FA"));return(c==null?void 0:c.length)>0?n.createElement(n.Fragment,null,c.map((i,r)=>{const s=v&&r===a;return n.createElement(Y,{className:re({[S("point-cloud-2d-container")]:!0,[S("point-cloud-container","zoom")]:s}),title:n.createElement(ge,{showEnlarge:s,isEnlargeTopView:f,data:i,setIsEnlarge:P,setCurIndex:y,curIndex:a,index:r,annotations2d:c}),titleOnSurface:!s,style:{display:M?"none":"flex",width:s?"100%":t},key:r,toolbar:G},(i==null?void 0:i.annotations)&&(i==null?void 0:i.url)&&n.createElement(ie,{currentData:e,view2dData:i,setSelectedID:q,showEnlarge:s,checkMode:w}))})):null};var ye=B(ne,null,null,{context:te})(ve);export{ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"../../hooks/useSize.js";import{a2MapStateToProps as C}from"../../store/annotation/map.js";import{LabelBeeContext as b}from"../../store/ctx.js";import{getClassName as g}from"../../utils/dom.js";import{PointCloud as h}from"@labelbee/lb-annotation";import P,{useRef as v,useContext as S,useEffect as u}from"react";import{connect as x}from"react-redux";import{PointCloudContext as j}from"./PointCloudContext.js";import{PointCloudUtils as m}from"@labelbee/lb-utils";const
|
|
1
|
+
import f from"../../hooks/useSize.js";import{a2MapStateToProps as C}from"../../store/annotation/map.js";import{LabelBeeContext as b}from"../../store/ctx.js";import{getClassName as g}from"../../utils/dom.js";import{PointCloud as h}from"@labelbee/lb-annotation";import P,{useRef as v,useContext as S,useEffect as u}from"react";import{connect as x}from"react-redux";import{PointCloudContext as j}from"./PointCloudContext.js";import{PointCloudUtils as m}from"@labelbee/lb-utils";const w=({currentData:O,config:o,checkMode:c})=>{var n,a;const r=v(null),{setPtSegmentInstance:p,setDefaultAttribute:d,ptSegmentInstance:e}=S(j),t=f(r),i=(a=(n=o==null?void 0:o.attributeList)==null?void 0:n[0])==null?void 0:a.value;return u(()=>{var l;if(!(t==null?void 0:t.width)||!r.current||e)return;const s=new h({container:r.current,isOrthographicCamera:!0,isSegment:!0,orthographicParams:m.getDefaultOrthographicParams(t),config:o,checkMode:c});(l=s.store)==null||l.setAttribute(i),d(i),p(s)},[t]),u(()=>{e&&(e.initRenderer(),e.initOrthographicCamera(m.getDefaultOrthographicParams(t)),e.render())},[t]),P.createElement("div",{className:g("point-cloud-wrapper"),ref:r})};var D=x(C,null,null,{context:b})(w);export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a2MapStateToProps as L}from"../../store/annotation/map.js";import{LabelBeeContext as M}from"../../store/ctx.js";import p,{useContext as z,useRef as m,useState as y,useEffect as d,useCallback as _}from"react";import V from"../AnnotationView/index.js";import{connect as B}from"react-redux";import{PointCloudContext as R}from"./PointCloudContext.js";import A from"./components/TitleButton/index.js";import{Spin as T}from"antd";import W from"../../_virtual/highlightSegmentWorker.js";import{pointMappingLidar2image as H}from"@labelbee/lb-annotation";var N=Object.defineProperty,Y=Object.defineProperties,$=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,w=(e,o,r)=>o in e?N(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,x=(e,o)=>{for(var r in o||(o={}))q.call(o,r)&&w(e,r,o[r]);if(b)for(var r of b(o))G.call(o,r)&&w(e,r,o[r]);return e},D=(e,o)=>Y(e,$(o));const J=({path:e,url:o,calib:r,pcdUrl:c,highlightAttribute:l})=>{const{ptSegmentInstance:t,cacheImageNodeSize:O,imageSizes:E}=z(R),F=m(null),f=m(0),g=m({}),u=m(),[P,v]=y([]),[I,C]=y(!1);d(()=>()=>{f.current=0,g.current={},u.current=void 0},[c]);const h=_(()=>{var n;if(f.current=f.current+1,f.current===2){const i=(n=t==null?void 0:t.store)==null?void 0:n.originPoints;if(!i||!u.current){console.error("cacheMappingPCD2Img Error",{path:e,points:i,filterSize:u.current});return}g.current=H(i,r,u.current).pcdMapping}},[t]),S=_((n,i)=>{if(n&&u.current){const a=g.current,s=new W;C(!0),s.postMessage({cacheMap:a,indexes:n,color:i}),s.onmessage=k=>{v(k.data.annotations),s.terminate(),C(!1)}}},[]);d(()=>{if(!(t==null?void 0:t.store))return;const n=t.store.getHighlightAttribute(l!=null?l:""),i=t==null?void 0:t.getColorFromConfig(l!=null?l:"");S(n.flat(),i.stroke)},[l,t]),d(()=>{if(t){const n=({newAttribute:i})=>{const a=t==null?void 0:t.getColorFromConfig(i);a&&v(P.map(s=>D(x({},s),{annotation:D(x({},s.annotation),{fill:a.fill,stroke:a.fill})})))};return t.on("updateDefaultAttribute",n),()=>{t.unbind("updateDefaultAttribute",n)}}},[t,P]),d(()=>{if(t){const n=i=>{if(i.cacheSegData){const{cacheSegData:a}=i;if(a==null?void 0:a.indexes){const s=t.getColorFromConfig(a.attribute);S(a==null?void 0:a.indexes,s.stroke)}}else v([])};return t.on("syncPointCloudStatus",n),t.on("loadPCDFileEnd",h),()=>{t.unbind("syncPointCloudStatus",n),t.unbind("loadPCDFileEnd",h)}}},[t,c,E]);const j=n=>{O({path:e,imgNode:n}),u.current={width:n.width,height:n.height},h()};return p.createElement("div",{key:e,style:{position:"relative"},ref:F},p.createElement(A,{title:r.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),p.createElement(T,{spinning:I,delay:1e3},p.createElement(V,{size:{width:300,height:200},key:e,src:o,annotations:P,afterImgOnLoad:j})))},K=({currentData:e,highlightAttribute:o})=>{var r;const c=(r=e.mappingImgList)!=null?r:[];return(c==null?void 0:c.length)>0?p.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},c==null?void 0:c.map((l,t)=>l.calib&&p.createElement(J,{key:l.path,path:l.path,url:l.url,calib:l.calib,pcdUrl:e.url,highlightAttribute:o}))):null};var Q=B(L,null,null,{context:M})(K);export{Q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as k,useEffect as a}from"react";import{a2MapStateToProps as L}from"../../store/annotation/map.js";import{connect as y}from"react-redux";import{LabelBeeContext as w,useDispatch as x}from"../../store/ctx.js";import{PointCloudContext as P}from"./PointCloudContext.js";import{CommonToolUtils as h}from"@labelbee/lb-annotation";import{PointCloudUtils as A,EPointCloudSegmentMode as S}from"@labelbee/lb-utils";import{useAttribute as D}from"./hooks/useAttribute.js";import{SetPointCloudLoading as p}from"../../store/annotation/actionCreators.js";const j=({checkMode:v,currentData:l,imgIndex:g,highlightAttribute:s,config:_,toolInstanceRef:u})=>{const m=x(),{updateSegmentAttribute:b,updateSegmentSubAttribute:C}=D(),n=k(P),{ptSegmentInstance:e,setSegmentation:d}=n;a(()=>{var t;if(e&&l.url)return p(m,!0),e.emit("clearStash"),e.emit("clearAllSegmentData"),e.loadPCDFile((t=l==null?void 0:l.url)!=null?t:"").then(()=>{var o,i;const r=A.getSegmentFromResultList((o=l==null?void 0:l.result)!=null?o:"");(i=e==null?void 0:e.store)==null||i.updateCurrentSegment(r),p(m,!1)}),e.on("syncSegmentData",d),()=>{e.unbind("syncSegmentData",d)}},[g,e]),a(()=>{var t;(t=e==null?void 0:e.store)==null||t.highlightPointsByAttribute(s!=null?s:"")},[s,e]);const f=(t,o)=>{var i,r;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("RectSelector");break;case"k":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",S.Add);break;case"i":e==null||e.emit("setSegmentMode",S.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(r=(i=e.store)==null?void 0:i.cacheSegData)==null?void 0:r.id);break}},c=t=>{if(!h.hotkeyFilter(t)||v===!0)return;const o=t.key.toLocaleLowerCase();f(o)};return a(()=>(window.addEventListener("keydown",c),u.current.setDefaultAttribute=t=>{b(t),e==null||e.emit("updateDefaultAttribute",{newAttribute:t})},u.current.setSubAttribute=(t,o)=>{C(t,o)},()=>{window.removeEventListener("keydown",c)}),[e]),a(()=>{u.current.clearResult=()=>{!n.ptSegmentInstance||(n.ptSegmentInstance.emit("clearStash"),n.ptSegmentInstance.emit("clearAllSegmentData"))}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var E=y(L,null,null,{context:w})(j);export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as
|
|
1
|
+
import e,{useContext as P,useState as _,useEffect as A}from"react";import{getClassName as o}from"../../utils/dom.js";import M from"../../assets/annotation/pointCloudTool/finish.svg.js";import x from"../../assets/annotation/pointCloudTool/cancel.svg.js";import{PointCloudContext as D}from"./PointCloudContext.js";import{EPointCloudSegmentStatus as c,PointCloudUtils as j,EPointCloudSegmentFocusMode as r}from"@labelbee/lb-utils";import{useTranslation as b}from"react-i18next";const R=({infoList:s})=>{const{t:u}=b();return s?e.createElement("div",{className:o("point-cloud-status","info")},s.map(a=>e.createElement("div",{key:a.key},e.createElement("span",null,u(a.key),"\uFF1A "),e.createElement("span",null,a.value)))):null},T=s=>{var u,a,v,g,f,S;const{config:E}=s,{t:d}=b(),{ptSegmentInstance:t,setDefaultAttribute:C}=P(D),[i,h]=_({segmentStatus:c.Ready});A(()=>{if(t){const n=l=>{h(l),l.cacheSegData&&C(l.cacheSegData.attribute)};return t==null||t.on("syncPointCloudStatus",n),()=>{t==null||t.unbind("syncPointCloudStatus",n)}}},[t]);const m=i.segmentStatus;if(m===c.Ready)return null;const k=m===c.Check,y=m===c.Edit;let p=null;const F=((v=(a=(u=i.cacheSegData)==null?void 0:u.points)==null?void 0:a.length)!=null?v:0)/3;let N=[{key:"SelectedPoints",value:F},{key:"Attribute",value:(f=(g=E.attributeList.find(n=>{var l;return n.value===((l=i.cacheSegData)==null?void 0:l.attribute)}))==null?void 0:g.key)!=null?f:""},{key:"SubAttribute",value:j.getSubAttributeName(((S=i.cacheSegData)==null?void 0:S.subAttribute)||{},E).map(n=>e.createElement("div",{key:n.label},n.label," - ",n.value))}];return k&&(p=e.createElement("div",{className:o("point-cloud-status","operation")},e.createElement("span",{className:o("point-cloud-status","button"),onClick:()=>{t==null||t.emit("updateCheck2Edit")}},d("EnterEditMode"),"(Enter)"))),y&&(p=e.createElement("div",{className:o("point-cloud-status","operation")},e.createElement("span",{className:o("point-cloud-status","button"),onClick:()=>{var n;t==null||t.emit("addStash2Store"),((n=t==null?void 0:t.store)==null?void 0:n.segmentFocusMode)===r.Focus&&(t==null||t.emit("setSegmentFocusMode",r.Unfocus))}},e.createElement("img",{className:o("point-cloud-status","icon"),src:M}),d("Finish")),e.createElement("span",{className:o("point-cloud-status","button"),onClick:()=>{var n;t==null||t.emit("clearStash"),((n=t==null?void 0:t.store)==null?void 0:n.segmentFocusMode)===r.Focus&&(t==null||t.emit("setSegmentFocusMode",r.Unfocus))}},e.createElement("img",{className:o("point-cloud-status","icon"),src:x}),d("Cancel")))),e.createElement(e.Fragment,null,p,e.createElement(R,{infoList:N}))};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as I,useEffect as p,useCallback as s}from"react";import{PointCloudContext as C}from"../PointCloudContext.js";const m=()=>{const{topViewInstance:t,sideViewInstance:l,backViewInstance:i,mainViewInstance:r,ptSegmentInstance:n,defaultAttribute:d,setDefaultAttribute:a}=I(C);p(()=>{if(!(t==null?void 0:t.toolInstance))return;const e=()=>{a(t==null?void 0:t.toolInstance.defaultAttribute)};return t==null||t.toolInstance.on("changeAttributeSidebar",e),()=>{t==null||t.toolInstance.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.toolInstance]);const c=e=>{[t==null?void 0:t.toolInstance,l==null?void 0:l.toolInstance,i==null?void 0:i.toolInstance].forEach(o=>{o==null||o.setDefaultAttribute(e)})},b=e=>{t==null||t.toolInstance.setDefaultAttribute(e)},v=e=>{r==null||r.generateBox(e)},f=s(e=>{var o,u;!n||((o=n.store)==null||o.setAttribute(e),(u=n.pointCloudRender)==null||u.updatePointsColor(),a(e))},[n]),A=s((e,o)=>{var u;!n||(u=n.store)==null||u.setSubAttribute(e,o)},[n]);return{syncThreeViewsAttribute:c,updateDefaultAttribute:b,reRenderPointCloud3DBox:v,defaultAttribute:d,updateSegmentAttribute:f,updateSegmentSubAttribute:A}};export{m as useAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudName as nt,MathUtils as w,getCuboidFromPointCloudBox as Mt}from"@labelbee/lb-annotation";import{EPerspectiveView as Q,PointCloudUtils as V,DEFAULT_SPHERE_PARAMS as Gt}from"@labelbee/lb-utils";import{useContext as Qt}from"react";import{PointCloudContext as Xt}from"../PointCloudContext.js";import{useSingleBox as Yt}from"./useSingleBox.js";import{useSphere as qt}from"./useSphere.js";import{useSelector as Jt,useDispatch as Kt}from"../../../store/ctx.js";import $t from"../../../utils/StepUtils.js";import{jsonParser as ft,getRectPointCloudBox as to}from"../../../utils/index.js";import{PreDataProcess as it,SetPointCloudLoading as Ct,SetLoadPCDFileLoading as Pt}from"../../../store/annotation/actionCreators.js";import{message as oo}from"antd";import{useTranslation as eo}from"react-i18next";import{useHistory as no}from"./useHistory.js";import{usePolygon as io}from"./usePolygon.js";var so=Object.defineProperty,ro=Object.defineProperties,lo=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable,xt=(e,t,i)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))ao.call(t,i)&&xt(e,i,t[i]);if(mt)for(var i of mt(t))co.call(t,i)&&xt(e,i,t[i]);return e},O=(e,t)=>ro(e,lo(t)),st=(e,t,i)=>new Promise((d,o)=>{var a=u=>{try{c(i.next(u))}catch(P){o(P)}},g=u=>{try{c(i.throw(u))}catch(P){o(P)}},c=u=>u.done?d(u.value):Promise.resolve(u.value).then(a,g);c((i=i.apply(e,t)).next())});const J=5,K=90,ht=.01,v={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},rt=(e,t,i,d,o)=>{const{x:a,y:g}=V.transferCanvas2World(e,t),{defaultZ:c}=Gt,u={center:{x:a,y:g,z:c},id:e.id},P=d?y(y({},d),u):O(y({},u),{attribute:"",valid:!0});return o&&Object.assign(P,o),P},lt=(e,t,i,d,o,a)=>{let g=e.pointList.map(B=>V.transferCanvas2World(B,t)),c=0,u=1,P={};if(i){const B=i.getSensesPointZAxisInPolygon(g,void 0,a);a&&B.fittedCoordinates.length>0&&(g=B.fittedCoordinates),c=(B.maxZ+B.minZ)/2,u=B.maxZ-B.minZ,P={count:B.zCount}}const[h,D,F]=g,R=w.getLineCenterPoint([h,F]),z=w.getLineLength(h,D),A=w.getLineLength(D,F),N=w.getRadiusFromQuadrangle(e.pointList);d&&(c=d.center.z,u=d.depth);const T={center:{x:R.x,y:R.y,z:c},width:a?A+ht:A,height:a?z+ht:z,depth:u,rotation:N,id:e.id},j=y(d?y(y({},d),T):O(y({},T),{attribute:"",valid:!0}),P);o&&Object.assign(j,o);const E=g.map(B=>V.transferWorld2Canvas(B,t));return{boxParams:j,newPointList:E}},yt=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(y({},i),{center:{x:i.center.x-d.x,y:i.center.y,z:i.center.z-d.y}})},Lt=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),D=w.getLineCenterPoint([c,P]),R={x:{x:h.x-D.x,y:h.y-D.y}.x,y:0,z:h.y-D.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j,{newBoxParams:B}=d.getNewBoxBySideUpdate(R,E,N,i);return B},uo=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(y({},i),{center:{x:i.center.x,y:i.center.y-d.x,z:i.center.z-d.y}})},po=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),D=w.getLineCenterPoint([c,P]),R={x:{x:h.x-D.x,y:h.y-D.y}.x,y:0,z:h.y-D.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j;let{newBoxParams:B}=d.getNewBoxByBackUpdate(R,E,N,i);return B},vt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Left);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(y(y({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},Bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{width:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Left);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxSidePolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},wt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Back);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(y(y({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{height:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Back);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxBackPolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},It=(e,t,i,d)=>{if(!i||!d)return;d.generateSphere(e),d.updateCameraBySphere(e,Q.Top),d.render();const{toolInstance:o,pointCloudInstance:a}=i,{point2d:g}=a.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?O(y(y({},t),g),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},dt=(e,t,i,d)=>{var o,a;if(!i||!d)return;d.generateBox(e,t.id),d.render();const{pointCloud2dOperation:g,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),P=[...g.polygonList],h=P.find(D=>D.id===t.id);h?(h.pointList=u,h.valid=(o=e.valid)!=null?o:!0):P.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(a=e.valid)!=null?a:!0}),g.setResultAndSelectedID(P,t.id)},go=()=>{const e=Qt(Xt),{topViewInstance:t,sideViewInstance:i,backViewInstance:d,mainViewInstance:o,addPointCloudBox:a,addPointCloudSphere:g,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:P,pointCloudSphereList:h,hideAttributes:D,setHighlight2DDataList:F,cuboidBoxIn2DView:R,imageSizes:z}=e,{addHistory:A,initHistory:N,pushHistoryUnderUpdatePolygon:T}=no(),{selectedPolygon:j}=io(),{getPointCloudSphereByID:E,updatePointCloudSphere:B,selectedSphere:X}=qt(),{currentData:W,config:b}=Jt(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:ft($t.getCurrentStepInfo(p,s).config)}}),H=Kt(),$=n=>{if(!R){const{mappingImgList:s=[]}=W,p=s.map(r=>to({pointCloudBox:n,mappingData:r,imageSizes:z}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:_,updateSelectedBox:St,updateSelectedBoxes:tt,getPointCloudByID:Dt}=Yt({generateRects:$}),{t:_t}=eo(),at=_==null?void 0:_.info;if(!t||!i||!d)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:ot}=t,Vt=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},Ot=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},kt=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const f={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(f,{trackID:V.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:h})});const C=rt(n,s,ot,void 0,f);c(n.id);const m=g(C);Y(v.Top,n,C,p,m,b),A({newSphereParams:C})},At=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:f})=>{var C,m;const x={attribute:(C=t.toolInstance.defaultAttribute)!=null?C:""};r===!0&&Object.assign(x,{trackID:V.getNextTrackID({imgList:[],extraBoxList:P,extraSphereList:h})});const I=t==null?void 0:t.toolInstance,S=y({},n);let{boxParams:L,newPointList:U}=lt(S,s,ot,void 0,x,f);if(L=H(it({tool:nt.PointCloud,dataList:[L],stepConfig:b,action:"viewUpdateBox"}))[0],(b==null?void 0:b.lowerLimitPointsNumInBox)&&typeof L.count=="number"&&L.count<b.lowerLimitPointsNumInBox){oo.info(_t("LowerLimitPointsNumInBox",{num:b.lowerLimitPointsNumInBox})),I.deletePolygon(L.id);return}f&&(U==null?void 0:U.length)&&(S.pointList=U);const k=D.includes(S.attribute);$(L);const G=a(L),et=(m=e==null?void 0:e.polygonList)!=null?m:[];t==null||t.updatePolygonList(G!=null?G:[],et),k?c([]):(c(L.id),I.selection.setSelectedIDs(S.id),M({omitView:v.Top,polygon:S,boxParams:L,zoom:l,newPointCloudBoxList:G}),f&&dt(L,S,t,o)),A({newBoxParams:L})},Ut=n=>{const{boxID:s,imageName:p,width:r,height:l,x:f,y:C}=n,m=P.find(x=>x.id===s);if(m==null?void 0:m.rects){const{rects:x=[]}=m,I=x.find(S=>S.imageName===p);if(I){let S=x;const L=O(y({},I),{width:r,height:l,x:f,y:C});S=x.map(k=>k===I?L:k);const U=O(y({},m),{rects:S}),Z=P.map(k=>k===m?U:k);return t==null||t.updatePolygonList(Z!=null?Z:[]),Z}}},Rt=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const f=t==null?void 0:t.toolInstance;if(!(u.length===0||!f)){if(n||(_==null?void 0:_.info)){const C=n!=null?n:_==null?void 0:_.info;(l=f==null?void 0:f.selection)==null||l.setSelectedIDs(u[0]);const m=f.selectedPolygon;if(u.length===1&&C){M({omitView:v.Top,polygon:m,boxParams:C,newPointCloudBoxList:s});return}}if((p||X)&&u.length===1){const C=p!=null?p:X;f.setSelectedID(u[0]);const m=f.selectedPoint;C&&Y(v.Top,m,C,void 0,r,b)}}},ct=(n,s,p)=>{if(at){let r,l;switch(p){case v.Back:r=po;break;case v.Side:r=Lt;break;default:r=Lt;break}l=r(n,s,at,i.pointCloudInstance);const C=H(it({tool:nt.PointCloud,dataList:[l],stepConfig:b,action:"viewUpdateBox"}))[0],m=l.valid!==C.valid;if(l=C,o){const{count:I}=o.getSensesPointZAxisInPolygon(Mt(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=O(y({},l),{count:I})}const x=St(l);return l=x.find(I=>I.id===l.id),M({omitView:m?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},ut=(n,s,p)=>{if(X){let r,l;switch(p){case v.Back:r=uo;break;case v.Side:r=yt;break;default:r=yt;break}l=r(n,s,X);const f=B(l);return Y(p,n,l,void 0,f,b),f}},zt=(n,s)=>{ut(n,s,v.Side)},Tt=(n,s)=>{ut(n,s,v.Back)},jt=(n,s)=>{ct(n,s,v.Side)},Nt=(n,s)=>{ct(n,s,v.Back)},Et=(n,s)=>{const p=E(n.id),r=rt(n,s,ot,p),l=B(r);Y(v.Top,n,r,void 0,l,b)},Ht=(n,s)=>{if(j){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>V.transferCanvas2World(l,s)),T(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=Dt(r.id),{boxParams:f}=lt(r,s,t.pointCloudInstance,l);return f});if(p=H(it({tool:nt.PointCloud,dataList:p,stepConfig:b,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=tt(p);M({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=tt(p);r&&e.syncAllViewPointCloudColor(r)}},Ft=n=>{var s,p,r,l,f;if(_){const C=Number(n.widthDefault),m=Number(n.depthDefault),x=Number(n.heightDefault),I=_==null?void 0:_.info.trackID,L=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(q=>(q==null?void 0:q.trackID)===I),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(f=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:f.height},Z=L.pointList.map(q=>V.transferCanvas2World(q,U)),k=w.getModifiedRectangleCoordinates(Z,x,C),G=k[0],et=k[2],pt=w.getLineCenterPoint([G,et]),Wt=_.info.center.z-_.info.depth/2,gt=O(y({},_.info),{center:{x:pt.x,y:pt.y,z:Wt+m/2},width:C,height:x,depth:m,valid:!0}),Zt=tt([gt]);M({omitView:v["3D"],polygon:L,boxParams:gt,newPointCloudBoxList:Zt})}},Y=(n,s,p,r,l,f)=>st(void 0,null,function*(){const C=W==null?void 0:W.url,m={[v.Side]:()=>{vt(p,s,i,C,f)},[v.Back]:()=>{d&&wt(p,s,d,C,f)},[v.Top]:()=>{It(p,s,t,o)}};Object.keys(m).forEach(x=>{x!==n&&m[x]()}),r&&(o==null||o.updateCameraZoom(r)),Ot(p)}),M=n=>st(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:f}=n,C=W==null?void 0:W.url;f&&(yield e.syncAllViewPointCloudColor(f));const m={[v.Side]:()=>{Bt(r,p,i,C)},[v.Back]:()=>{d&&bt(r,p,d,C)},[v.Top]:()=>{dt(r,p,t,o)}};Object.keys(m).forEach(x=>{x!==s&&m[x]()}),l&&(o==null||o.updateCameraZoom(l)),Vt(r)});return{topViewAddSphere:kt,topViewAddBox:At,topViewSelectedChanged:Rt,topViewUpdatePoint:Et,sideViewUpdatePoint:zt,backViewUpdatePoint:Tt,topViewUpdateBox:Ht,sideViewUpdateBox:jt,backViewUpdateBox:Nt,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=V.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>st(void 0,[...n],function*(s=W){var p,r,l,f,C,m;if(!(s==null?void 0:s.url)||!o)return;F([]),Ct(H,!0),Pt(H,!0),yield o.loadPCDFile(s.url,(p=b==null?void 0:b.radius)!=null?p:K),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],I=[],S=[],L=[];o.updateTopCamera();const U=(l=(r=ft(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(f=e.sideViewInstance)==null||f.clearAllData(),(C=e.backViewInstance)==null||C.clearAllData(),t.updateData(s.url,s.result,{radius:(m=b==null?void 0:b.radius)!=null?m:K}),s.result&&(x=V.getBoxParamsFromResultList(s.result),S=V.getPolygonListFromResultList(s.result),I=V.getLineListFromResultList(s.result),L=V.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(L),yield e.syncAllViewPointCloudColor(x,[])),N({pointCloudBoxList:x,polygonList:S,lineList:I,pointCloudSphereList:L}),Ct(H,!1),Pt(H,!1)}),updateViewsByDefaultSize:Ft,generateRects:$,update2DViewRect:Ut}};export{wt as syncBackViewByPoint,vt as syncSideViewByPoint,It as syncTopViewByPoint,bt as synchronizeBackView,Bt as synchronizeSideView,dt as synchronizeTopView,rt as topViewPoint2PointCloud,lt as topViewPolygon2PointCloud,go as usePointCloudViews};
|
|
1
|
+
import{EPointCloudName as nt,MathUtils as w,getCuboidFromPointCloudBox as Gt}from"@labelbee/lb-annotation";import{EPerspectiveView as Q,PointCloudUtils as V,DEFAULT_SPHERE_PARAMS as Qt}from"@labelbee/lb-utils";import{useContext as Xt}from"react";import{PointCloudContext as Yt}from"../PointCloudContext.js";import{useSingleBox as qt}from"./useSingleBox.js";import{useSphere as Jt}from"./useSphere.js";import{useSelector as Kt,useDispatch as $t}from"../../../store/ctx.js";import to from"../../../utils/StepUtils.js";import{jsonParser as ft,getRectPointCloudBox as oo}from"../../../utils/index.js";import{PreDataProcess as it,SetPointCloudLoading as Ct,SetLoadPCDFileLoading as Pt}from"../../../store/annotation/actionCreators.js";import{message as eo}from"antd";import{useTranslation as no}from"react-i18next";import{useHistory as io}from"./useHistory.js";import{usePolygon as so}from"./usePolygon.js";import{useLatest as ro}from"ahooks";var lo=Object.defineProperty,ao=Object.defineProperties,co=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,uo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,xt=(e,t,i)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,L=(e,t)=>{for(var i in t||(t={}))uo.call(t,i)&&xt(e,i,t[i]);if(mt)for(var i of mt(t))po.call(t,i)&&xt(e,i,t[i]);return e},O=(e,t)=>ao(e,co(t)),st=(e,t,i)=>new Promise((d,o)=>{var a=u=>{try{c(i.next(u))}catch(P){o(P)}},g=u=>{try{c(i.throw(u))}catch(P){o(P)}},c=u=>u.done?d(u.value):Promise.resolve(u.value).then(a,g);c((i=i.apply(e,t)).next())});const J=5,K=90,ht=.01,v={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},rt=(e,t,i,d,o)=>{const{x:a,y:g}=V.transferCanvas2World(e,t),{defaultZ:c}=Qt,u={center:{x:a,y:g,z:c},id:e.id},P=d?L(L({},d),u):O(L({},u),{attribute:"",valid:!0});return o&&Object.assign(P,o),P},lt=(e,t,i,d,o,a)=>{let g=e.pointList.map(B=>V.transferCanvas2World(B,t)),c=0,u=1,P={};if(i){const B=i.getSensesPointZAxisInPolygon(g,void 0,a);a&&B.fittedCoordinates.length>0&&(g=B.fittedCoordinates),c=(B.maxZ+B.minZ)/2,u=B.maxZ-B.minZ,P={count:B.zCount}}const[h,S,F]=g,R=w.getLineCenterPoint([h,F]),z=w.getLineLength(h,S),A=w.getLineLength(S,F),N=w.getRadiusFromQuadrangle(e.pointList);d&&(c=d.center.z,u=d.depth);const T={center:{x:R.x,y:R.y,z:c},width:a?A+ht:A,height:a?z+ht:z,depth:u,rotation:N,id:e.id},j=L(d?L(L({},d),T):O(L({},T),{attribute:"",valid:!0}),P);o&&Object.assign(j,o);const E=g.map(B=>V.transferWorld2Canvas(B,t));return{boxParams:j,newPointList:E}},Lt=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x-d.x,y:i.center.y,z:i.center.z-d.y}})},yt=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j,{newBoxParams:B}=d.getNewBoxBySideUpdate(R,E,N,i);return B},go=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x,y:i.center.y-d.x,z:i.center.z-d.y}})},fo=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j;let{newBoxParams:B}=d.getNewBoxByBackUpdate(R,E,N,i);return B},vt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Left);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},Bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{width:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Left);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxSidePolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},wt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Back);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{height:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Back);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxBackPolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},It=(e,t,i,d)=>{if(!i||!d)return;d.generateSphere(e),d.updateCameraBySphere(e,Q.Top),d.render();const{toolInstance:o,pointCloudInstance:a}=i,{point2d:g}=a.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?O(L(L({},t),g),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},dt=(e,t,i,d)=>{var o,a;if(!i||!d)return;d.generateBox(e,t.id),d.render();const{pointCloud2dOperation:g,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),P=[...g.polygonList],h=P.find(S=>S.id===t.id);h?(h.pointList=u,h.valid=(o=e.valid)!=null?o:!0):P.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(a=e.valid)!=null?a:!0}),g.setResultAndSelectedID(P,t.id)},Co=()=>{const e=Xt(Yt),{topViewInstance:t,sideViewInstance:i,backViewInstance:d,mainViewInstance:o,addPointCloudBox:a,addPointCloudSphere:g,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:P,pointCloudSphereList:h,hideAttributes:S,setHighlight2DDataList:F,cuboidBoxIn2DView:R,imageSizes:z}=e,{addHistory:A,initHistory:N,pushHistoryUnderUpdatePolygon:T}=io(),{selectedPolygon:j}=so(),{getPointCloudSphereByID:E,updatePointCloudSphere:B,selectedSphere:X}=Jt(),{currentData:W,config:b}=Kt(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:ft(to.getCurrentStepInfo(p,s).config)}}),H=$t(),Dt=ro(R),$=n=>{if(!Dt.current){const{mappingImgList:s=[]}=W,p=s.map(r=>oo({pointCloudBox:n,mappingData:r,imageSizes:z}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:_,updateSelectedBox:St,updateSelectedBoxes:tt,getPointCloudByID:_t}=qt({generateRects:$}),{t:Vt}=no(),at=_==null?void 0:_.info;if(!t||!i||!d)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:ot}=t,Ot=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},kt=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},At=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const f={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(f,{trackID:V.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:h})});const C=rt(n,s,ot,void 0,f);c(n.id);const m=g(C);Y(v.Top,n,C,p,m,b),A({newSphereParams:C})},Ut=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:f})=>{var C,m;const x={attribute:(C=t.toolInstance.defaultAttribute)!=null?C:""};r===!0&&Object.assign(x,{trackID:V.getNextTrackID({imgList:[],extraBoxList:P,extraSphereList:h})});const I=t==null?void 0:t.toolInstance,D=L({},n);let{boxParams:y,newPointList:U}=lt(D,s,ot,void 0,x,f);if(y=H(it({tool:nt.PointCloud,dataList:[y],stepConfig:b,action:"viewUpdateBox"}))[0],(b==null?void 0:b.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<b.lowerLimitPointsNumInBox){eo.info(Vt("LowerLimitPointsNumInBox",{num:b.lowerLimitPointsNumInBox})),I.deletePolygon(y.id);return}f&&(U==null?void 0:U.length)&&(D.pointList=U);const k=S.includes(D.attribute);$(y);const G=a(y),et=(m=e==null?void 0:e.polygonList)!=null?m:[];t==null||t.updatePolygonList(G!=null?G:[],et),k?c([]):(c(y.id),I.selection.setSelectedIDs(D.id),M({omitView:v.Top,polygon:D,boxParams:y,zoom:l,newPointCloudBoxList:G}),f&&dt(y,D,t,o)),A({newBoxParams:y})},Rt=n=>{const{boxID:s,imageName:p,width:r,height:l,x:f,y:C}=n,m=P.find(x=>x.id===s);if(m==null?void 0:m.rects){const{rects:x=[]}=m,I=x.find(D=>D.imageName===p);if(I){let D=x;const y=O(L({},I),{width:r,height:l,x:f,y:C});D=x.map(k=>k===I?y:k);const U=O(L({},m),{rects:D}),Z=P.map(k=>k===m?U:k);return t==null||t.updatePolygonList(Z!=null?Z:[]),Z}}},zt=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const f=t==null?void 0:t.toolInstance;if(!(u.length===0||!f)){if(n||(_==null?void 0:_.info)){const C=n!=null?n:_==null?void 0:_.info;(l=f==null?void 0:f.selection)==null||l.setSelectedIDs(u[0]);const m=f.selectedPolygon;if(u.length===1&&C){M({omitView:v.Top,polygon:m,boxParams:C,newPointCloudBoxList:s});return}}if((p||X)&&u.length===1){const C=p!=null?p:X;f.setSelectedID(u[0]);const m=f.selectedPoint;C&&Y(v.Top,m,C,void 0,r,b)}}},ct=(n,s,p)=>{if(at){let r,l;switch(p){case v.Back:r=fo;break;case v.Side:r=yt;break;default:r=yt;break}l=r(n,s,at,i.pointCloudInstance);const C=H(it({tool:nt.PointCloud,dataList:[l],stepConfig:b,action:"viewUpdateBox"}))[0],m=l.valid!==C.valid;if(l=C,o){const{count:I}=o.getSensesPointZAxisInPolygon(Gt(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=O(L({},l),{count:I})}const x=St(l);return l=x.find(I=>I.id===l.id),M({omitView:m?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},ut=(n,s,p)=>{if(X){let r,l;switch(p){case v.Back:r=go;break;case v.Side:r=Lt;break;default:r=Lt;break}l=r(n,s,X);const f=B(l);return Y(p,n,l,void 0,f,b),f}},Tt=(n,s)=>{ut(n,s,v.Side)},jt=(n,s)=>{ut(n,s,v.Back)},Nt=(n,s)=>{ct(n,s,v.Side)},Et=(n,s)=>{ct(n,s,v.Back)},Ht=(n,s)=>{const p=E(n.id),r=rt(n,s,ot,p),l=B(r);Y(v.Top,n,r,void 0,l,b)},Ft=(n,s)=>{if(j){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>V.transferCanvas2World(l,s)),T(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=_t(r.id),{boxParams:f}=lt(r,s,t.pointCloudInstance,l);return f});if(p=H(it({tool:nt.PointCloud,dataList:p,stepConfig:b,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=tt(p);M({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=tt(p);r&&e.syncAllViewPointCloudColor(r)}},Wt=n=>{var s,p,r,l,f;if(_){const C=Number(n.widthDefault),m=Number(n.depthDefault),x=Number(n.heightDefault),I=_==null?void 0:_.info.trackID,y=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(q=>(q==null?void 0:q.trackID)===I),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(f=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:f.height},Z=y.pointList.map(q=>V.transferCanvas2World(q,U)),k=w.getModifiedRectangleCoordinates(Z,x,C),G=k[0],et=k[2],pt=w.getLineCenterPoint([G,et]),Zt=_.info.center.z-_.info.depth/2,gt=O(L({},_.info),{center:{x:pt.x,y:pt.y,z:Zt+m/2},width:C,height:x,depth:m,valid:!0}),Mt=tt([gt]);M({omitView:v["3D"],polygon:y,boxParams:gt,newPointCloudBoxList:Mt})}},Y=(n,s,p,r,l,f)=>st(void 0,null,function*(){const C=W==null?void 0:W.url,m={[v.Side]:()=>{vt(p,s,i,C,f)},[v.Back]:()=>{d&&wt(p,s,d,C,f)},[v.Top]:()=>{It(p,s,t,o)}};Object.keys(m).forEach(x=>{x!==n&&m[x]()}),r&&(o==null||o.updateCameraZoom(r)),kt(p)}),M=n=>st(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:f}=n,C=W==null?void 0:W.url;f&&(yield e.syncAllViewPointCloudColor(f));const m={[v.Side]:()=>{Bt(r,p,i,C)},[v.Back]:()=>{d&&bt(r,p,d,C)},[v.Top]:()=>{dt(r,p,t,o)}};Object.keys(m).forEach(x=>{x!==s&&m[x]()}),l&&(o==null||o.updateCameraZoom(l)),Ot(r)});return{topViewAddSphere:At,topViewAddBox:Ut,topViewSelectedChanged:zt,topViewUpdatePoint:Ht,sideViewUpdatePoint:Tt,backViewUpdatePoint:jt,topViewUpdateBox:Ft,sideViewUpdateBox:Nt,backViewUpdateBox:Et,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=V.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>st(void 0,[...n],function*(s=W){var p,r,l,f,C,m;if(!(s==null?void 0:s.url)||!o)return;F([]),Ct(H,!0),Pt(H,!0),yield o.loadPCDFile(s.url,(p=b==null?void 0:b.radius)!=null?p:K),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],I=[],D=[],y=[];o.updateTopCamera();const U=(l=(r=ft(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(f=e.sideViewInstance)==null||f.clearAllData(),(C=e.backViewInstance)==null||C.clearAllData(),t.updateData(s.url,s.result,{radius:(m=b==null?void 0:b.radius)!=null?m:K}),s.result&&(x=V.getBoxParamsFromResultList(s.result),D=V.getPolygonListFromResultList(s.result),I=V.getLineListFromResultList(s.result),y=V.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),N({pointCloudBoxList:x,polygonList:D,lineList:I,pointCloudSphereList:y}),Ct(H,!1),Pt(H,!1)}),updateViewsByDefaultSize:Wt,generateRects:$,update2DViewRect:Rt}};export{wt as syncBackViewByPoint,vt as syncSideViewByPoint,It as syncTopViewByPoint,bt as synchronizeBackView,Bt as synchronizeSideView,dt as synchronizeTopView,rt as topViewPoint2PointCloud,lt as topViewPolygon2PointCloud,Co as usePointCloudViews};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as
|
|
1
|
+
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as T,useState as h,useEffect as p}from"react";import I from"./PointCloud3DView.js";import B from"./PointCloudBackView.js";import F from"./PointCloudTopView.js";import y from"./PointCloudSideView.js";import R from"./PointCloud2DView.js";import _ from"./PointCloudListener.js";import G from"./PointCloudSegmentListener.js";import g from"./PointCloudSegment.js";import O from"./PointCloudSegmentStatus.js";import Z from"./PointCloudSegmentToolbar.js";import U from"./PointCloudSegment2DView.js";import{connect as W}from"react-redux";import{LabelBeeContext as $,useDispatch as q}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as z,AnnotatedAttributesPanelFixedRight as H}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as J}from"./PointCloudContext.js";import{PointCloudUtils as K,EPointCloudPattern as Q}from"@labelbee/lb-utils";import{useCustomToolInstance as X}from"../../hooks/annotation.js";import{jsonParser as Y}from"../../utils/index.js";import{a2MapStateToProps as k}from"../../store/annotation/map.js";import E from"classnames";import M from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as tt}from"../../store/annotation/actionCreators.js";const et=({currentData:s,imgList:L,drawLayerSlot:d,checkMode:i,intelligentFit:S,imgIndex:j,loadPCDFileLoading:nt,config:v})=>{const e=T(J),{globalPattern:c,setGlobalPattern:x,selectedIDs:C}=e,b=q(),[l,P]=h(!1),w=(C==null?void 0:C.length)>0&&l,V=Y(s.result),{toolInstanceRef:r,clearToolInstance:A}=X({basicInfo:V});if(p(()=>{r.current.setPointCloudGlobalPattern=o=>{o!==c&&(x(o),e.clearAllDetectionInstance(),A())}},[c]),p(()=>{var o;if(tt(b,!0),s){const{boxParamsList:a,polygonList:m,lineList:u,sphereParamsList:D,segmentation:N}=K.parsePointCloudCurrentResult((o=s==null?void 0:s.result)!=null?o:"");e.setPointCloudResult(a),e.setPolygonList(m),e.setLineList(u),e.setPointCloudSphereList(D),e.setSegmentation(N)}},[j]),p(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var o,a,m,u;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(a=e.lineList)!=null?a:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),L.length===0)return null;if(c===Q.Segmentation)return t.createElement(t.Fragment,null,t.createElement(G,{checkMode:i,toolInstanceRef:r}),t.createElement(Z,null),t.createElement("div",{className:n("point-cloud-layout")},t.createElement(g,{checkMode:i}),t.createElement(U,null)),t.createElement(g,{checkMode:i}),t.createElement(O,{config:v}),d==null?void 0:d({direct:!0}));let f=t.createElement("div",{className:n("point-cloud-container","left-bottom")},t.createElement(B,{checkMode:i}),t.createElement(y,{checkMode:i}));return l&&(f=t.createElement(M,{selectAndEnlarge:w,checkMode:i})),t.createElement(t.Fragment,null,t.createElement(_,{checkMode:i,toolInstanceRef:r}),t.createElement("div",{className:n("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:n("point-cloud-wrapper")},t.createElement(z,null),t.createElement("div",{className:n("point-cloud-content")},t.createElement("div",{className:n("point-cloud-container","left")},t.createElement(I,null),f),t.createElement("div",{className:E({[n("point-cloud-container","right")]:!0,[n("point-cloud-container","rightZoom")]:l})},t.createElement(F,{drawLayerSlot:d,checkMode:i,intelligentFit:S,setIsEnlargeTopView:P,onExitZoom:()=>{P(!1)},isEnlargeTopView:l}),t.createElement("div",{className:E({[n("point-cloud-container","right-bottom")]:!l,[n("point-cloud-container","right-bottom-floatLeft")]:l})},t.createElement(R,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:i})))),t.createElement(H,null))))};var ot=W(k,null,null,{context:$})(et);export{ot as default};
|
package/es/index.css
CHANGED
|
@@ -1964,6 +1964,13 @@
|
|
|
1964
1964
|
position: relative;
|
|
1965
1965
|
}
|
|
1966
1966
|
|
|
1967
|
+
.bee-point-cloud-container__title-button {
|
|
1968
|
+
border-radius: 2px;
|
|
1969
|
+
padding: 4px 8px;
|
|
1970
|
+
background-color: #fff;
|
|
1971
|
+
color: #000000;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1967
1974
|
.bee-point-cloud-wrapper {
|
|
1968
1975
|
display: flex;
|
|
1969
1976
|
height: 100%;
|
|
@@ -2061,12 +2068,6 @@
|
|
|
2061
2068
|
left: 16px;
|
|
2062
2069
|
z-index: 1000;
|
|
2063
2070
|
}
|
|
2064
|
-
.bee-point-cloud-wrapper .bee-point-cloud-container__title-button {
|
|
2065
|
-
border-radius: 2px;
|
|
2066
|
-
padding: 4px 8px;
|
|
2067
|
-
background-color: #fff;
|
|
2068
|
-
color: #000000;
|
|
2069
|
-
}
|
|
2070
2071
|
.bee-point-cloud-wrapper .bee-point-cloud-container__zoom {
|
|
2071
2072
|
position: absolute;
|
|
2072
2073
|
top: 0px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as
|
|
1
|
+
import e,{useContext as w,useState as k,useEffect as L}from"react";import{EditFilled as Z}from"@ant-design/icons";import{ToolIcons as ee}from"../ToolIcons.js";import{cTool as te}from"@labelbee/lb-annotation";import{PointCloudContext as T}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as V,Tag as oe,Input as ne,Select as $,message as h}from"antd";import le from"../../../../utils/StepUtils.js";import{connect as re}from"react-redux";import{jsonParser as ae,classnames as ie}from"../../../../utils/index.js";import{useStatus as se}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as F}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as B}from"react-i18next";import{LabelBeeContext as ce,useDispatch as ue}from"../../../../store/ctx.js";import de from"./components/batchUpdateModal/index.js";import{PointCloudUtils as me,EPointCloudSegmentStatus as pe}from"@labelbee/lb-utils";import R from"../../../../components/attributeList/index.js";import{useAttribute as ve}from"../../../../components/pointCloudView/hooks/useAttribute.js";import fe from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import ge from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Se from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Ce from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import _e from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import be from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as j}from"../index.js";import{SetTaskStepList as xe}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as ye}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";var Ee=Object.defineProperty,Ie=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,U=(n,t,l)=>t in n?Ee(n,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[t]=l,N=(n,t)=>{for(var l in t||(t={}))De.call(t,l)&&U(n,l,t[l]);if(z)for(var l of z(t))ke.call(t,l)&&U(n,l,t[l]);return n},O=(n,t)=>Ie(n,Pe(t));const we=({imgList:n,imgIndex:t})=>{const l=w(T),[p,c]=k([]),{t:r}=B();L(()=>{const d=n;let f=new Map;c(me.getAllPointCloudResult({imgList:d,extraBoxList:u,ignoreIndexList:[t]}).filter(a=>!a.trackID||f.get(a.trackID)?!1:(f.set(a.trackID,!0),!0)).sort((a,i)=>{var s,S;const m=(s=a==null?void 0:a.trackID)!=null?s:0,v=(S=i==null?void 0:i.trackID)!=null?S:0;return m-v}).map(a=>{var i;return(i=a==null?void 0:a.trackID)!=null?i:0}))},[l.pointCloudBoxList,n]);const{pointCloudBoxList:u}=l;return e.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},e.createElement("div",{style:{marginBottom:16}},r("AllTrackIDs")),e.createElement("div",null,p.map(d=>e.createElement(oe,{color:"#F3F4FF",key:d,style:{color:"#666",marginBottom:8}},d))))},Le=()=>{const[n,t]=k(!1),l=w(T),{pointCloudBoxList:p}=l,{selectedBox:c,updateSelectedBox:r}=F(),[u,d]=k(""),{t:f}=B(),a=c==null?void 0:c.info.trackID,i=m=>!!p.find(_=>_.trackID===m&&_.id!==(c==null?void 0:c.info.id)),s=(m=!1)=>{const v=parseInt(u,10);if(m&&t(!1),isNaN(v)){h.error(f("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){h.error(f("NotAllowDecimalPointsInTrackID"));return}if(i(v)){h.error(f("DuplicateTrackIDsExist"));return}if(!(v>0)){h.error(f("PositiveIntegerCheck"));return}S(v)};L(()=>{t(!1)},[a]);const S=m=>{var v;const _=r({trackID:m});(v=l==null?void 0:l.topViewInstance)==null||v.updatePolygonList(_!=null?_:[])};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,f("CurrentBoxTrackIDs")),a&&e.createElement(de,{id:a,updateCurrentPolygonList:m=>S(m)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n&&a?e.createElement(ne,{defaultValue:a,onChange:m=>{d(m.target.value)},disabled:!a,size:"small",onBlur:()=>{s()},onPressEnter:()=>{s(!0)}}):e.createElement("span",null,a),e.createElement(Z,{style:{color:"#999",marginLeft:16,cursor:typeof a!="undefined"?"pointer":"not-allowed"},onClick:()=>{a&&t(!n)}})))},M=({attributeList:n,subAttributeList:t,toolInstance:l,config:p,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[d,f]=k({segmentStatus:pe.Ready}),{selectedBox:a}=F(),i=w(T),{ptSegmentInstance:s}=i,{t:S}=B(),{defaultAttribute:m}=ve(),v=ye(),_=ue(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},q={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"};L(()=>{if(!!s)return s.on("syncPointCloudStatus",f),()=>{s.unbind("syncPointCloudStatus",f)}},[s]);const G=(o,x)=>{var y,E,I,P,D;const b=(y=p==null?void 0:p.attributeList)==null?void 0:y.map(C=>C.value===o?O(N({},C),{color:x}):C),g=O(N({},p),{attributeList:b}),X=JSON.stringify(g),Y=c==null?void 0:c.map(C=>(C==null?void 0:C.step)===(r==null?void 0:r.step)?O(N({},C),{config:X}):C);(E=i==null?void 0:i.topViewInstance)==null||E.updateAttributeList(b),(I=i==null?void 0:i.sideViewInstance)==null||I.updateAttributeList(b),(P=i==null?void 0:i.backViewInstance)==null||P.updateAttributeList(b),(D=i==null?void 0:i.mainViewInstance)==null||D.setConfig(g),_(xe({stepList:Y}))},H=o=>{v.updateViewsByDefaultSize&&v.updateViewsByDefaultSize(o)},K=o=>{l.setDefaultAttribute(o)},A=(o,x)=>{l.setSubAttribute(o,x)},Q=n.map(o=>({label:o.key,value:o.value,color:o==null?void 0:o.color,limit:o==null?void 0:o.limit,isDefault:o==null?void 0:o.isDefault}));return e.createElement("div",null,e.createElement("div",{style:J},S("Attribute")),e.createElement(R,{list:Q,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:o=>K(o),updateColorConfig:G,enableColorPicker:u,updateSize:H}),e.createElement(V,{style:{margin:0}}),(a||d.cacheSegData)&&e.createElement(e.Fragment,null,t.map(o=>{var x,y,E,I,P,D,b;return(o==null?void 0:o.subSelected)&&e.createElement("div",{style:{marginTop:12},key:o.value},e.createElement("div",{style:q},S("SubAttribute"),"-",o.key),((x=o.subSelected)==null?void 0:x.length)<5?e.createElement(R,{list:o.subSelected.map(g=>({label:g.key,value:g.value})),selectedAttribute:((E=(y=i.selectedPointCloudBox)==null?void 0:y.subAttribute)==null?void 0:E[o.value])||((P=(I=d.cacheSegData)==null?void 0:I.subAttribute)==null?void 0:P[o.value]),num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:g=>A(o.value,g),style:{marginBottom:12}}):e.createElement($,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(b=(D=i.selectedPointCloudBox)==null?void 0:D.subAttribute)==null?void 0:b[o.value],placeholder:S("PleaseSelect"),onChange:g=>A(o.value,g),allowClear:!0},o.subSelected.map(g=>e.createElement($.Option,{key:g.value,value:g.value},g.key))),e.createElement(V,{style:{margin:0}}))})))},Te=[{toolName:"LassoSelector",commonSvg:fe,selectedSvg:ge},{toolName:"RectSelector",commonSvg:_e,selectedSvg:be},{toolName:"CircleSelector",commonSvg:Se,selectedSvg:Ce}],W=({toolInstance:n})=>{const{ptSegmentInstance:t}=w(T),[l,p]=k("LassoSelector"),{t:c}=B();return L(()=>{if(!t)return;const r=()=>{p("LassoSelector")},u=()=>{p("RectSelector")},d=()=>{p("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",d),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",d)}},[t]),e.createElement("div",{className:`${j}__level`},Te.map(r=>{const u=l===r.toolName;return e.createElement("span",{className:`${j}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${j}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ie({[`${j}__toolOption__selected`]:u})},c(r.toolName)))}))},he=({stepInfo:n,toolInstance:t,imgList:l,imgIndex:p,stepList:c,enableColorPicker:r})=>{var u,d;const{updatePointCloudPattern:f,pointCloudPattern:a,isPointCloudSegmentationPattern:i}=se(),s=ae(n.config),S=(u=s==null?void 0:s.attributeList)!=null?u:[],m=(s==null?void 0:s.secondaryAttributeConfigurable)===!0?(d=s==null?void 0:s.inputList)!=null?d:[]:[];return i?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:s,stepList:c,stepInfo:n,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(ee,{toolName:te.EPointCloudName.PointCloud,selectedToolName:a,onChange:v=>f==null?void 0:f(v)}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:s,stepList:c,stepInfo:n,enableColorPicker:r}),(s==null?void 0:s.trackConfigurable)===!0&&e.createElement(e.Fragment,null,e.createElement(Le,null),e.createElement(V,{style:{margin:0}}),e.createElement(we,{imgList:l,imgIndex:p})))},Be=n=>{var t,l,p,c;const r=le.getCurrentStepInfo((t=n.annotation)==null?void 0:t.step,(l=n.annotation)==null?void 0:l.stepList),u=(p=n.annotation)==null?void 0:p.toolInstance,d=(c=n.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:n.annotation.imgList,imgIndex:n.annotation.imgIndex,stepList:d}};var je=re(Be,null,null,{context:ce})(he);export{W as PointCloudSegToolIcon,je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{backward as n,forward as e,scale as a,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import
|
|
1
|
+
import{backward as n,forward as e,scale as a,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import S from"../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js";import v from"../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js";import P from"../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import T from"../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js";import y from"../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import x from"../../../../../../assets/annotation/rectTool/icon_rect.svg.js";import R from"../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import $ from"../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js";import I from"../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js";import t from"react";import{ReloadOutlined as _,RotateLeftOutlined as B,RotateRightOutlined as b}from"@ant-design/icons";import{polygon as D,invalidPolygon as k,selectedPolygon as A,changePolygonAttribute as V,deletePolygon as M,insertPolygonPoint as O,deletePolygonPoint as w}from"../polygon/index.js";const r={name:"PointThickness",icon:t.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},i={name:"RotateAroundCenterPoint",icon:t.createElement(_,null),shortCut:[C],noticeInfo:"DragOperation"},c={name:"PointCloudViewTranslate",icon:s,shortCut:[o],noticeInfo:"Drag"},m={name:"TopViewTranslate",icon:s,shortCut:[o]},g={name:"ChangePointCloudValid",icon:d,shortCut:["V"]},E={name:"CopyBox",icon:l,shortCut:["Ctrl","C"]},H={name:"PasteBox",icon:h,shortCut:["Ctrl","V"]},K={name:"RotateLeft",icon:t.createElement(B,null),shortCut:["Q"]},L={name:"RotateRight",icon:t.createElement(b,null),shortCut:["E"]},G={name:"PreviousBox",icon:f,shortCut:["Shift","Tab"]},N={name:"NextBox",icon:p,shortCut:["Tab"]},z={name:"Rotate180",icon:S,shortCut:["G"],noticeInfo:"SelectedStatus"},F={name:"CopyPrevPage",icon:l,shortCut:["Alt","C"]},J={name:"ChangeBoxValid",icon:j,shortCut:["F"],noticeInfo:"SelectedStatus"},Q={name:"MultiSelect",icon:P,shortCut:["Ctrl",o]},U={name:"SelectAllBox",icon:v,shortCut:["Ctrl","A"]},Y={name:"Delete",icon:T,shortCut:["Del"],noticeInfo:"SelectedStatus"},q={name:"LassoSelector",icon:y,shortCut:["H"],noticeInfo:"SelectorMsg"},W={name:"RectSelector",icon:x,shortCut:["J"],noticeInfo:"SelectorMsg"},X={name:"CircleSelector",icon:R,shortCut:["K"],noticeInfo:"SelectorMsg"},Z={name:"PointCloudViewTranslate",icon:s,shortCut:["space",o]},oo={name:"AddPoint",icon:$,shortCut:["U"]},to={name:"DeletePoint",icon:I,shortCut:["I"]},no=[{name:"GeneralOperation"},n,e,r,a,i,c,m,g,{name:"RectPattern"},E,H,K,L,G,N,z,F,J,Y,Q,U,u],eo=[{name:"GeneralOperation"},n,e,r,a,i,c,m,g,{name:"PolygonPattern"},D,k,A,V,M,O,w],so=[n,e,i,Z,q,W,X,oo,to];export{no as default,eo as pointCloudShortCutTable_POLYGON,so as pointCloudShortCutTable_SEGMENT};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0-alpha.1",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
48
|
-
"@labelbee/wavesurfer": "1.0.0
|
|
46
|
+
"@labelbee/lb-annotation": "1.20.0-alpha.1",
|
|
47
|
+
"@labelbee/lb-utils": "1.13.0-alpha.1",
|
|
48
|
+
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"ahooks": "^3.4.0",
|
|
51
51
|
"classnames": "^2.3.0",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"rollup": "^2.43.1",
|
|
97
97
|
"rollup-plugin-esbuild": "^3.0.2",
|
|
98
98
|
"rollup-plugin-postcss": "^4.0.2",
|
|
99
|
+
"rollup-plugin-web-worker-loader": "^1.6.1",
|
|
99
100
|
"sass": "^1.53.0",
|
|
100
101
|
"typescript": "^4.2.3"
|
|
101
102
|
},
|