@labelbee/lb-components 1.6.0-alpha.4 → 1.6.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/components/AnnotationView/index.js +1 -1
  2. package/dist/components/customResizeHook/index.js +1 -1
  3. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  4. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  5. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  6. package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
  7. package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
  8. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  9. package/dist/components/pointCloudView/hooks/useZoom.js +1 -0
  10. package/dist/components/pointCloudView/index.js +1 -1
  11. package/dist/hooks/annotation.js +1 -1
  12. package/dist/index.css +0 -9
  13. package/dist/types/components/AnnotationView/index.d.ts +1 -0
  14. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +2 -0
  15. package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
  16. package/dist/types/components/pointCloudView/hooks/useZoom.d.ts +7 -0
  17. package/dist/types/hooks/annotation.d.ts +1 -0
  18. package/dist/types/views/MainView/toolFooter/ZoomController/ZoomLevel/index.d.ts +1 -0
  19. package/dist/types/views/MainView/toolFooter/ZoomController/index.d.ts +1 -0
  20. package/dist/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
  21. package/dist/views/MainView/toolFooter/ZoomController/index.js +1 -1
  22. package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
  23. package/es/assets/attributeIcon/eraser.svg.js +4 -0
  24. package/es/assets/attributeIcon/eraser.svg.js.map +1 -0
  25. package/es/assets/attributeIcon/eraser_a.svg.js +4 -0
  26. package/es/assets/attributeIcon/eraser_a.svg.js.map +1 -0
  27. package/es/assets/attributeIcon/pen.svg.js +4 -0
  28. package/es/assets/attributeIcon/pen.svg.js.map +1 -0
  29. package/es/assets/attributeIcon/pen_a.svg.js +4 -0
  30. package/es/assets/attributeIcon/pen_a.svg.js.map +1 -0
  31. package/es/components/AnnotationView/index.js +1 -1
  32. package/es/components/AnnotationView/index.js.map +1 -1
  33. package/es/components/customResizeHook/index.js +1 -1
  34. package/es/components/customResizeHook/index.js.map +1 -1
  35. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  36. package/es/components/pointCloudView/PointCloud2DView.js.map +1 -1
  37. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  38. package/es/components/pointCloudView/PointCloud3DView.js.map +1 -1
  39. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  40. package/es/components/pointCloudView/PointCloudContext.js.map +1 -1
  41. package/es/components/pointCloudView/PointCloudInfos.js +1 -1
  42. package/es/components/pointCloudView/PointCloudInfos.js.map +1 -1
  43. package/es/components/pointCloudView/PointCloudLayout.js +1 -1
  44. package/es/components/pointCloudView/PointCloudLayout.js.map +1 -1
  45. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  46. package/es/components/pointCloudView/PointCloudTopView.js.map +1 -1
  47. package/es/components/pointCloudView/hooks/useZoom.js +1 -0
  48. package/es/components/pointCloudView/hooks/useZoom.js.map +1 -0
  49. package/es/components/pointCloudView/index.js +1 -1
  50. package/es/components/pointCloudView/index.js.map +1 -1
  51. package/es/hooks/annotation.js +1 -1
  52. package/es/hooks/annotation.js.map +1 -1
  53. package/es/index.css +0 -9
  54. package/es/views/MainView/sidebar/ScribbleSidebar/index.js +60 -0
  55. package/es/views/MainView/sidebar/ScribbleSidebar/index.js.map +1 -0
  56. package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
  57. package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js.map +1 -1
  58. package/es/views/MainView/toolFooter/ZoomController/index.js +1 -1
  59. package/es/views/MainView/toolFooter/ZoomController/index.js.map +1 -1
  60. package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
  61. package/es/views/MainView/toolHeader/headerOption/index.js.map +1 -1
  62. package/package.json +4 -4
@@ -1 +1 @@
1
- "use strict";var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),es=require("antd/es");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,r,o)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,__spreadValues=(e,r)=>{for(var o in r||(r={}))__hasOwnProp.call(r,o)&&__defNormalProp(e,o,r[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(r))__propIsEnum.call(r,o)&&__defNormalProp(e,o,r[o]);return e};const DEFAULT_SIZE={width:1280,height:720},sizeInitialized=e=>e?(e.width||(e.width=DEFAULT_SIZE.width),e.height||(e.height=DEFAULT_SIZE.height),e):DEFAULT_SIZE,AnnotationView=(e,r)=>{const{src:o,annotations:c=[],style:g={stroke:"blue",thickness:3},zoomChange:s,backgroundStyle:h={},onChange:d,showLoading:_=!1}=e,i=sizeInitialized(e.size),[p,f]=React.useState(!1),v=React.useRef(null),t=React.useRef();React.useImperativeHandle(r,()=>{const n=t.current;return n?{zoomIn:()=>n.zoomChanged(!0),zoomOut:()=>n.zoomChanged(!1),initImgPos:()=>n.initImgPos(),toolInstance:n}:{}},[t.current]),React.useEffect(()=>(v.current&&(t.current=new lbAnnotation.ViewOperation({container:v.current,size:i,style:g,annotations:c,config:"{}"}),t.current.init()),()=>{var n;(n=t.current)==null||n.destroy()}),[]),React.useEffect(()=>{var n;t.current&&(f(!0),(n=t.current)==null||n.setLoading(!0),lbAnnotation.ImgUtils.load(o).then(u=>{var a,l;(a=t.current)==null||a.setLoading(!1),f(!1),(l=t.current)==null||l.setImgNode(u)}).catch(()=>{var u;(u=t.current)==null||u.setLoading(!1),f(!1)}))},[o]),React.useEffect(()=>{t.current&&t.current.updateData(c)},[c]),React.useEffect(()=>{const n=t.current;(n==null?void 0:n.setSize)&&n.setSize(i)},[i==null?void 0:i.width,i==null?void 0:i.height]),React.useEffect(()=>{var n,u;return t.current&&((n=t.current)==null||n.on("onChange",(...a)=>{d==null||d.apply(null,a)}),(u=t.current)==null||u.on("renderZoom",a=>{s&&s(a)})),()=>{var a,l;(a=t.current)==null||a.unbindAll("onChange"),(l=t.current)==null||l.unbindAll("renderZoom")}},[s,d]);const m=React__default.default.createElement("div",{ref:v,style:__spreadValues(__spreadValues({position:"relative"},i),h)});return React__default.default.createElement(es.Spin,{spinning:_||p,delay:300},m)};var AnnotationView$1=React__default.default.forwardRef(AnnotationView);module.exports=AnnotationView$1;
1
+ "use strict";var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),es=require("antd/es");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:500,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,g;const{src:h,annotations:u=[],style:_={stroke:"blue",thickness:3},zoomChange:s,backgroundStyle:m={},onChange:c,showLoading:p=!1,globalStyle:w}=e,d=sizeInitialized(e.size),[b,f]=React.useState(!1),v=React.useRef(null),r=React.useRef();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:d,style:_,annotations:u,config:"{}"}),r.current.init()),()=>{var n;(n=r.current)==null||n.destroy()}),[]),React.useEffect(()=>{var n;r.current&&(f(!0),(n=r.current)==null||n.setLoading(!0),lbAnnotation.ImgUtils.load(h).then(a=>{var i,l;(i=r.current)==null||i.setLoading(!1),f(!1),(l=r.current)==null||l.setImgNode(a)}).catch(()=>{var a;(a=r.current)==null||a.setLoading(!1),f(!1)}))},[h]),React.useEffect(()=>{r.current&&r.current.updateData(u)},[u]),React.useEffect(()=>{const n=r.current;(n==null?void 0:n.setSize)&&(n.setSize(d),n.initPosition())},[(o=e.size)==null?void 0:o.width,(g=e.size)==null?void 0:g.height]),React.useEffect(()=>{var n,a;return r.current&&((n=r.current)==null||n.on("onChange",(...i)=>{c==null||c.apply(null,i)}),(a=r.current)==null||a.on("renderZoom",i=>{s&&s(i)})),()=>{var i,l;(i=r.current)==null||i.unbindAll("onChange"),(l=r.current)==null||l.unbindAll("renderZoom")}},[s,c]);const y=React__default.default.createElement("div",{ref:v,style:__spreadValues(__spreadValues({position:"relative"},d),m)});return React__default.default.createElement(es.Spin,{spinning:p||b,delay:300,style:w},y)};var AnnotationView$1=React__default.default.forwardRef(AnnotationView);module.exports=AnnotationView$1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var AnnotationSize=require("../../data/enums/AnnotationSize.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactRedux=require("react-redux"),actionCreators=require("../../store/annotation/actionCreators.js"),antd=require("antd");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const EKeyCode=lbAnnotation.cKeyCode.default,viewportContext=React__default.default.createContext({width:window.innerWidth,height:window.innerHeight}),ViewportProviderComponent=e=>{const{children:d,dispatch:n,annotation:{skipBeforePageTurning:o}}=e;console.log("viewport",e);const[i]=React.useState(window.innerWidth),[r]=React.useState(window.innerHeight),a=t=>{var c;if(!!lbAnnotation.toolUtils.hotkeyFilter(t)){if(!t.shiftKey||!t.ctrlKey){if(t.keyCode===EKeyCode.A){if(o){o(()=>n(actionCreators.PageBackward()));return}n(actionCreators.PageBackward())}if(t.keyCode===EKeyCode.D){if(o){o(()=>n(actionCreators.PageForward()));return}n(actionCreators.PageForward())}t.keyCode===EKeyCode.R&&n(actionCreators.UpdateRotate())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===EKeyCode.C){antd.message.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const u=(c=e.annotation)==null?void 0:c.annotationEngine.switchLastTwoCanvas();if(!u)return;n(actionCreators.UpdateToolInstance(u))}}};React.useEffect(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[e.annotation.annotationEngine,e.annotation.skipBeforePageTurning]);const s=React.useMemo(()=>({width:i,height:r}),[i,r]);return React__default.default.createElement(viewportContext.Provider,{value:s},d)},ViewportProvider=reactRedux.connect(e=>({annotation:e.annotation}))(ViewportProviderComponent),getFormatSize=(e,d=!1,n=!1)=>{const{width:o,height:i}=e,r=AnnotationSize.headerHeight+AnnotationSize.footerHeight,a=n?40+r+40:r,s=d?AnnotationSize.editStepWidth+AnnotationSize.sidebarWidth:AnnotationSize.sidebarWidth;return{width:o-s,height:i-a}};exports.ViewportProvider=ViewportProvider,exports.ViewportProviderComponent=ViewportProviderComponent,exports.getFormatSize=getFormatSize,exports.viewportContext=viewportContext;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var AnnotationSize=require("../../data/enums/AnnotationSize.js"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),reactRedux=require("react-redux"),actionCreators=require("../../store/annotation/actionCreators.js"),antd=require("antd");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const EKeyCode=lbAnnotation.cKeyCode.default,viewportContext=React__default.default.createContext({width:window.innerWidth,height:window.innerHeight}),ViewportProviderComponent=e=>{const{children:d,dispatch:n,annotation:{skipBeforePageTurning:o}}=e,[i]=React.useState(window.innerWidth),[r]=React.useState(window.innerHeight),a=t=>{var c;if(!!lbAnnotation.toolUtils.hotkeyFilter(t)){if(!t.shiftKey||!t.ctrlKey){if(t.keyCode===EKeyCode.A){if(o){o(()=>n(actionCreators.PageBackward()));return}n(actionCreators.PageBackward())}if(t.keyCode===EKeyCode.D){if(o){o(()=>n(actionCreators.PageForward()));return}n(actionCreators.PageForward())}t.keyCode===EKeyCode.R&&n(actionCreators.UpdateRotate())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===EKeyCode.C){antd.message.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const u=(c=e.annotation)==null?void 0:c.annotationEngine.switchLastTwoCanvas();if(!u)return;n(actionCreators.UpdateToolInstance(u))}}};React.useEffect(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[e.annotation.annotationEngine,e.annotation.skipBeforePageTurning]);const s=React.useMemo(()=>({width:i,height:r}),[i,r]);return React__default.default.createElement(viewportContext.Provider,{value:s},d)},ViewportProvider=reactRedux.connect(e=>({annotation:e.annotation}))(ViewportProviderComponent),getFormatSize=(e,d=!1,n=!1)=>{const{width:o,height:i}=e,r=AnnotationSize.headerHeight+AnnotationSize.footerHeight,a=n?40+r+40:r,s=d?AnnotationSize.editStepWidth+AnnotationSize.sidebarWidth:AnnotationSize.sidebarWidth;return{width:o-s,height:i-a}};exports.ViewportProvider=ViewportProvider,exports.ViewportProviderComponent=ViewportProviderComponent,exports.getFormatSize=getFormatSize,exports.viewportContext=viewportContext;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),index=require("../AnnotationView/index.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),icons=require("@ant-design/icons"),useSize=require("../../hooks/useSize.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,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e};const Toolbar=({onNext:e,onPrev:t,imgLength:n,imgIndex:i})=>React__default.default.createElement("div",null,React__default.default.createElement(icons.LeftOutlined,{onClick:t}),React__default.default.createElement("span",null," ",i+1," / ",n," "),React__default.default.createElement(icons.RightOutlined,{onClick:e})),PointCloud2DView=({imgInfo:e})=>{var t,n;const[i,f]=React.useState([]),{pointCloudBoxList:s,topViewInstance:c}=React.useContext(PointCloudContext.PointCloudContext),[a,l]=React.useState(0),d=React.useRef(null),m=useSize(d),r=(t=e==null?void 0:e.mappingImgList)==null?void 0:t[a];if(React.useEffect(()=>{l(0)},[e]),React.useEffect(()=>{if(c&&r){const{pointCloudInstance:o}=c,v={fill:"transparent",color:"green"},g=s.reduce((C,P)=>{const _=o.pointCloudLidar2image(P,r.calib);return[...C,..._.map(p=>({type:p.type,annotation:__spreadValues({pointList:p.pointList},v)}))]},[]);f(g)}},[s,r]),!e)return React__default.default.createElement("div",null);const{mappingImgList:u}=e;return u?React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-2d-container"),title:"2D\u89C6\u56FE",toolbar:React__default.default.createElement(Toolbar,{imgIndex:a,imgLength:u.length,onNext:()=>{a>=u.length-1||l(o=>o+1)},onPrev:()=>{a<=0||l(o=>o-1)}})},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:d},React__default.default.createElement(index,{src:(n=r==null?void 0:r.url)!=null?n:"",annotations:i,size:m}))):React__default.default.createElement("div",null)},mapStateToProps=e=>{const{imgList:t,imgIndex:n}=e.annotation;return{imgInfo:t[n]}};var PointCloud2DView$1=reactRedux.connect(mapStateToProps)(PointCloud2DView);module.exports=PointCloud2DView$1;
1
+ "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),index=require("../AnnotationView/index.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),icons=require("@ant-design/icons"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.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,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e};const Toolbar=({onNext:e,onPrev:t,imgLength:n,imgIndex:l})=>React__default.default.createElement("div",null,React__default.default.createElement(icons.LeftOutlined,{onClick:t}),React__default.default.createElement("span",null," ",l+1," / ",n," "),React__default.default.createElement(icons.RightOutlined,{onClick:e})),PointCloud2DView=({imgInfo:e})=>{var t,n,l,g,_;const[c,y]=React.useState([]),{pointCloudBoxList:C,topViewInstance:L}=React.useContext(PointCloudContext.PointCloudContext),[u,p]=React.useState(0),P=React.useRef(null),v=React.useRef(),{selectedBox:f}=useSingleBox.useSingleBox(),E=useSize(P),r=(t=e==null?void 0:e.mappingImgList)==null?void 0:t[u];React.useEffect(()=>{p(0)},[e]),React.useEffect(()=>{if(L&&r){const{pointCloudInstance:o}=L,i={fill:"transparent",color:"green"},s=C.reduce((a,d)=>{const w=o.pointCloudLidar2image(d,r.calib);return[...a,...w.map(x=>({type:x.type,annotation:__spreadValues({id:d.id,pointList:x.pointList},i)}))]},[]);y(s)}},[C,r]);const m=!e||!(e==null?void 0:e.mappingImgList)||!(((n=e==null?void 0:e.mappingImgList)==null?void 0:n.length)>0);return React.useEffect(()=>{var o,i;const s=(o=v.current)==null?void 0:o.toolInstance;if(!f||!s)return;const a=c.find(d=>d.annotation.id===f.info.id);((i=a==null?void 0:a.annotation.pointList)==null?void 0:i.length)>0&&s.focusPositionByPointList(a==null?void 0:a.annotation.pointList)},[f,v.current,c]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-2d-container"),title:"2D\u89C6\u56FE",toolbar:m?void 0:React__default.default.createElement(Toolbar,{imgIndex:u,imgLength:(g=(l=e.mappingImgList)==null?void 0:l.length)!=null?g:0,onNext:()=>{var o;!e||!(e==null?void 0:e.mappingImgList)||u>=((o=e==null?void 0:e.mappingImgList)==null?void 0:o.length)-1||p(i=>i+1)},onPrev:()=>{u<=0||p(o=>o-1)}}),style:{display:m?"none":"flex"}},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:P},React__default.default.createElement(index,{src:(_=r==null?void 0:r.url)!=null?_:"",annotations:c,size:E,ref:v,globalStyle:{display:m?"none":"block"}})))},mapStateToProps=e=>{const{imgList:t,imgIndex:n}=e.annotation;return{imgInfo:t[n]}};var PointCloud2DView$1=reactRedux.connect(mapStateToProps)(PointCloud2DView);module.exports=PointCloud2DView$1;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{}}),PointCloudViewIcon=({perspectiveView:e})=>{const{isActive:a,setTarget3DView:s}=React.useContext(PointCloud3DContext),r=o=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",o)]:!0,active:a});return React__default.default.createElement("span",{onClick:()=>{s(lbUtils.EPerspectiveView[e])},className:r(e.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:e}=React.useContext(PointCloud3DContext);return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Top"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Front"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Left"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Back"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Right"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"LFT"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"RBT"}),React__default.default.createElement("span",{onClick:()=>{e()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:e})=>{const a=React.useContext(PointCloudContext.PointCloudContext),[s,r]=React.useState(!0),o=React.useRef(null),{initPointCloud3d:u}=usePointCloudViews.usePointCloudViews(),d=useSize(o);React.useEffect(()=>{!a.mainViewInstance||u==null||u()},[d]);const{selectedBox:n}=useSingleBox.useSingleBox(),c=i=>{var t;const l=n==null?void 0:n.info;l&&((t=a.mainViewInstance)==null||t.updateCameraByBox(l,i))},m=()=>{var i;(i=a.mainViewInstance)==null||i.resetCamera()};React.useEffect(()=>{var i;if(o.current&&(e==null?void 0:e.url)){let t=a.mainViewInstance;if(t||(t=new lbAnnotation.PointCloud({container:o.current,backgroundColor:"#4c4c4c"})),e.result){const l=lbUtils.PointCloudUtils.getBoxParamsFromResultList(e.result);l.forEach(f=>{t==null||t.generateBox(f)}),a.setPointCloudResult(l),a.setPointCloudValid((i=index.jsonParser(e.result))==null?void 0:i.valid)}a.setMainViewInstance(t)}},[e]),React.useEffect(()=>{n&&c(lbUtils.EPerspectiveView.Top)},[n]);const v=React.useMemo(()=>({reset3DView:m,setTarget3DView:c,isActive:!!n}),[n]),C=React__default.default.createElement("div",null,React__default.default.createElement("span",{style:{marginRight:8}},"\u663E\u793A\u7BAD\u5934"),React__default.default.createElement(antd.Switch,{size:"small",checked:s,onChange:i=>{var t;r(i),(t=a.mainViewInstance)==null||t.setShowDirection(i)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:"3D\u89C6\u56FE",toolbar:C},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},React__default.default.createElement(PointCloud3DContext.Provider,{value:v},React__default.default.createElement(PointCloud3DSideBar,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-view"),id:pointCloudID,ref:o})))};var PointCloud3DView=reactRedux.connect(map.aMapStateToProps)(PointCloud3D);module.exports=PointCloud3DView;
1
+ "use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{}}),PointCloudViewIcon=({perspectiveView:e})=>{const{isActive:l,setTarget3DView:a}=React.useContext(PointCloud3DContext),r=u=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",u)]:!0,active:l});return React__default.default.createElement("span",{onClick:()=>{a(lbUtils.EPerspectiveView[e])},className:r(e.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:e}=React.useContext(PointCloud3DContext);return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Top"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Front"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Left"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Back"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Right"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"LFT"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"RBT"}),React__default.default.createElement("span",{onClick:()=>{e()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:e})=>{var l;const a=React.useContext(PointCloudContext.PointCloudContext),[r,u]=React.useState(!0),s=React.useRef(null),{initPointCloud3d:c}=usePointCloudViews.usePointCloudViews(),m=useSize(s);React.useEffect(()=>{!a.mainViewInstance||c==null||c()},[m]);const{selectedBox:n}=useSingleBox.useSingleBox(),d=i=>{var t;const o=n==null?void 0:n.info;o&&((t=a.mainViewInstance)==null||t.updateCameraByBox(o,i))},v=()=>{var i;(i=a.mainViewInstance)==null||i.resetCamera()};React.useEffect(()=>{var i;if(s.current&&(e==null?void 0:e.url)){let t=a.mainViewInstance;if(t||(t=new lbAnnotation.PointCloud({container:s.current,backgroundColor:"#4c4c4c"})),e.result){const o=lbUtils.PointCloudUtils.getBoxParamsFromResultList(e.result);o.forEach(p=>{t==null||t.generateBox(p)}),a.setPointCloudResult(o),a.setPointCloudValid((i=index.jsonParser(e.result))==null?void 0:i.valid)}a.setMainViewInstance(t)}},[e]),React.useEffect(()=>{n&&d(lbUtils.EPerspectiveView.Top)},[n]);const C=React.useMemo(()=>({reset3DView:v,setTarget3DView:d,isActive:!!n}),[n]),f=React__default.default.createElement("div",null,React__default.default.createElement("span",{style:{marginRight:8}},"\u663E\u793A\u7BAD\u5934"),React__default.default.createElement(antd.Switch,{size:"small",checked:r,onChange:i=>{var t;u(i),(t=a.mainViewInstance)==null||t.setShowDirection(i)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:"3D\u89C6\u56FE",toolbar:f,style:{height:e.mappingImgList&&((l=e.mappingImgList)==null?void 0:l.length)>0?"55%":"100%"}},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},React__default.default.createElement(PointCloud3DContext.Provider,{value:C},React__default.default.createElement(PointCloud3DSideBar,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-view"),id:pointCloudID,ref:s})))};var PointCloud3DView=reactRedux.connect(map.aMapStateToProps)(PointCloud3D);module.exports=PointCloud3DView;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],polygonList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>{},setPolygonList:()=>{}}),PointCloudProvider=({children:s})=>{const[o,a]=React.useState([]),[c,C]=React.useState([]),[t,i]=React.useState([]),[d,P]=React.useState(!0),[l,p]=React.useState(),[u,I]=React.useState(),[r,x]=React.useState(),[f,V]=React.useState(),S=React.useMemo(()=>t.length===1?t[0]:"",[t]),w=React.useMemo(()=>{const y=o.find(e=>e.id===S),v=e=>{a(o.concat(e))},B=e=>{P(e!==!1)},n=e=>{e===void 0&&i([]),typeof e=="string"&&i([e]),Array.isArray(e)&&i(Array.from(new Set(e)))};return{selectedID:S,pointCloudBoxList:o,selectedIDs:t,setPointCloudResult:a,setSelectedIDs:n,addPointCloudBox:v,valid:d,selectedPointCloudBox:y,setPointCloudValid:B,addSelectedID:e=>{t.includes(e)?n(t.filter(g=>g!==e)):n([...t,e])},selectedAllBoxes:()=>{n(o.map(e=>e.id))},topViewInstance:l,setTopViewInstance:p,sideViewInstance:u,setSideViewInstance:I,backViewInstance:r,setBackViewInstance:x,mainViewInstance:f,setMainViewInstance:V,polygonList:c,setPolygonList:C}},[d,t,o,c,l,u,r,f]);return React__default.default.createElement(PointCloudContext.Provider,{value:w},s)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],polygonList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>{},setPolygonList:()=>{},zoom:1,setZoom:()=>{}}),PointCloudProvider=({children:o})=>{const[s,a]=React.useState([]),[c,P]=React.useState([]),[t,i]=React.useState([]),[d,p]=React.useState(!0),[l,I]=React.useState(1),[u,x]=React.useState(),[r,V]=React.useState(),[f,w]=React.useState(),[S,y]=React.useState(),C=React.useMemo(()=>t.length===1?t[0]:"",[t]),m=React.useMemo(()=>{const v=s.find(e=>e.id===C),B=e=>{a(s.concat(e))},g=e=>{p(e!==!1)},n=e=>{e===void 0&&i([]),typeof e=="string"&&i([e]),Array.isArray(e)&&i(Array.from(new Set(e)))};return{selectedID:C,pointCloudBoxList:s,selectedIDs:t,setPointCloudResult:a,setSelectedIDs:n,addPointCloudBox:B,valid:d,selectedPointCloudBox:v,setPointCloudValid:g,addSelectedID:e=>{t.includes(e)?n(t.filter(L=>L!==e)):n([...t,e])},selectedAllBoxes:()=>{n(s.map(e=>e.id))},topViewInstance:u,setTopViewInstance:x,sideViewInstance:r,setSideViewInstance:V,backViewInstance:f,setBackViewInstance:w,mainViewInstance:S,setMainViewInstance:y,polygonList:c,setPolygonList:P,zoom:l,setZoom:I}},[d,t,s,c,u,r,f,S,l]);return React__default.default.createElement(PointCloudContext.Provider,{value:m},o)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const DECIMAL_PLACES=2,SizeInfoForView=({perspectiveView:e})=>{const{pointCloudBoxList:o,selectedID:n}=React__default.default.useContext(PointCloudContext.PointCloudContext),l=o.find(t=>t.id===n);if(n&&l){const t=e===lbUtils.EPerspectiveView.Back?[{label:"\u5BBD",value:l.width},{label:"\u9AD8",value:l.depth}]:[{label:"\u957F",value:l.height},{label:"\u5BBD",value:l.width}];return React__default.default.createElement(React__default.default.Fragment,null,t.map((u,i)=>React__default.default.createElement("span",{key:i,style:{marginRight:i===0?16:0,fontSize:12}},`${u.label}: ${u.value.toFixed(DECIMAL_PLACES)}`)))}return null},BoxInfos=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{selectedBox:o}=useSingleBox.useSingleBox(),[n,l]=React.useState([]);return React.useEffect(()=>{var t;if(!o)return;const{length:u,width:i,height:s,rotation_y:d}=lbUtils.PointCloudUtils.transferBox2Kitti(o.info);let a=[{label:"\u957F",value:u.toFixed(DECIMAL_PLACES)},{label:"\u5BBD",value:i.toFixed(DECIMAL_PLACES)},{label:"\u9AD8",value:s.toFixed(DECIMAL_PLACES)},{label:"\u671D\u5411\u89D2",value:lbAnnotation.UnitUtils.rad2deg(d).toFixed(DECIMAL_PLACES)}];(t=e.mainViewInstance)==null||t.filterPointsByBox(o.info).then(r=>{if(!r){l(a);return}a.push({label:"\u70B9\u6570",value:`${r.num}`}),l(a)})},[o]),o?React__default.default.createElement("div",{style:{position:"absolute",color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",right:8,top:8,fontSize:12,padding:8,zIndex:20}},n.map(t=>React__default.default.createElement("div",{key:t.label},`${t.label}: ${t.value}`))):null},PointCloudValidity=()=>React__default.default.useContext(PointCloudContext.PointCloudContext).valid===!1?React__default.default.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",left:0,top:0,fontSize:20,padding:"8px 16px",zIndex:20}},"\u65E0\u6548"):null;exports.BoxInfos=BoxInfos,exports.PointCloudValidity=PointCloudValidity,exports.SizeInfoForView=SizeInfoForView;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const DECIMAL_PLACES=2,SizeInfoForView=({perspectiveView:e})=>{const{pointCloudBoxList:l,selectedID:i}=React__default.default.useContext(PointCloudContext.PointCloudContext),n=l.find(t=>t.id===i);if(i&&n){const{length:t,width:u,height:r}=lbUtils.PointCloudUtils.transferBox2Kitti(n),s=e===lbUtils.EPerspectiveView.Back?[{label:"\u5BBD",value:u},{label:"\u9AD8",value:r}]:[{label:"\u957F",value:t},{label:"\u5BBD",value:u}];return React__default.default.createElement(React__default.default.Fragment,null,s.map((a,o)=>React__default.default.createElement("span",{key:o,style:{marginRight:o===0?16:0,fontSize:12}},`${a.label}: ${a.value.toFixed(DECIMAL_PLACES)}`)))}return null},BoxInfos=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{selectedBox:l}=useSingleBox.useSingleBox(),[i,n]=React.useState([]);return React.useEffect(()=>{var t;if(!l)return;const{length:u,width:r,height:s,rotation_y:a}=lbUtils.PointCloudUtils.transferBox2Kitti(l.info);let o=[{label:"\u957F",value:u.toFixed(DECIMAL_PLACES)},{label:"\u5BBD",value:r.toFixed(DECIMAL_PLACES)},{label:"\u9AD8",value:s.toFixed(DECIMAL_PLACES)},{label:"\u671D\u5411\u89D2",value:lbAnnotation.UnitUtils.rad2deg(a).toFixed(DECIMAL_PLACES)}];(t=e.mainViewInstance)==null||t.filterPointsByBox(l.info).then(d=>{if(!d){n(o);return}o.push({label:"\u70B9\u6570",value:`${d.num}`}),n(o)})},[l]),l?React__default.default.createElement("div",{style:{position:"absolute",color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",right:8,top:8,fontSize:12,padding:8,zIndex:20}},i.map(t=>React__default.default.createElement("div",{key:t.label},`${t.label}: ${t.value}`))):null},PointCloudValidity=()=>React__default.default.useContext(PointCloudContext.PointCloudContext).valid===!1?React__default.default.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",left:0,top:0,fontSize:20,padding:"8px 16px",zIndex:20}},"\u65E0\u6548"):null;exports.BoxInfos=BoxInfos,exports.PointCloudValidity=PointCloudValidity,exports.SizeInfoForView=SizeInfoForView;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:r})=>React__default.default.createElement("div",{className:classNames__default.default([r,dom.getClassName("point-cloud-container")])},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title")},e),a&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header-toolbar")},a)),t);exports.PointCloudContainer=PointCloudContainer;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var dom=require("../../utils/dom.js"),classNames=require("classnames"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React);const PointCloudContainer=({title:e,toolbar:a,children:t,className:r,style:l})=>React__default.default.createElement("div",{className:classNames__default.default([r,dom.getClassName("point-cloud-container")]),style:l},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header")},React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","header-title")},e),a&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","header-toolbar")},a)),t);exports.PointCloudContainer=PointCloudContainer;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),index=require("../../views/MainView/toolFooter/index.js"),index$1=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(t,l,e=1)=>{const{width:i,height:a}=l,r={x:t.x+i*e/2,y:t.y+a*e/2},u={x:l.width/2,y:l.height/2};return{offsetX:(u.x-r.x)/e,offsetY:-(u.y-r.y)/e}},TopViewToolbar=({currentData:t})=>{const{selectNextBox:l,selectPrevBox:e}=useSingleBox.useSingleBox(),{updateRotate:i}=useRotate.useRotate({currentData:t}),a=2,r=()=>{i(-a)},u=()=>{i(a)},d=()=>{i(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:u,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:d,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{e()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{l()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index.FooterDivider,null),React__default.default.createElement(index$1.ZoomController,null))},ZAxisSlider=({setZAxisLimit:t,zAxisLimit:l})=>React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:e=>{t(e)}})),PointCloudTopView=({currentData:t})=>{const l=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),i=useSize(l),{addPolygon:a,deletePolygon:r}=usePolygon.usePolygon(),{deletePointCloudBox:u}=useSingleBox.useSingleBox(),[d,x]=React.useState(10),c=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(l.current&&(t==null?void 0:t.url)&&(t==null?void 0:t.result)){const o={width:l.current.clientWidth,height:l.current.clientHeight};if(e.topViewInstance)return;const n=new lbAnnotation.PointCloudAnnotation({container:l.current,size:o,pcdPath:t.url});n.addPolygonListOnTopView(t.result),e.setTopViewInstance(n)}},[t]),React.useEffect(()=>{if(!i||!e.topViewInstance||!e.sideViewInstance)return;const{pointCloud2dOperation:o}=e.topViewInstance;o.singleOn("polygonCreated",n=>{if(o.pattern===EPolygonPattern.Normal||!(t==null?void 0:t.url)){a(n);return}c.topViewAddBox(n,i)}),o.singleOn("deletedObject",({id:n})=>{u(n),r(n)}),o.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),o.singleOn("addSelectedIDs",n=>{e.addSelectedID(n)}),o.singleOn("setSelectedIDs",n=>{e.setSelectedIDs(n)}),o.singleOn("updatePolygonByDrag",({newPolygon:n})=>{var s;(s=c.topViewUpdateBox)==null||s.call(c,n,i)})},[e,i,t,c]),React.useEffect(()=>{if(!(i==null?void 0:i.width)||!e.topViewInstance)return;e.topViewInstance.initSize(i),e.topViewInstance.updatePolygonList(e.pointCloudBoxList);const{topViewInstance:{pointCloudInstance:o,pointCloud2dOperation:n}}=e;n.singleOn("renderZoom",(s,f)=>{const{offsetX:p,offsetY:C}=TransferCanvas2WorldOffset(f,i,s);if(o.camera.zoom=s,f){const{x:m,y:v,z:g}=o.initCameraPosition;o.camera.position.set(m+C,v-p,g)}o.camera.updateProjectionMatrix(),o.render()}),n.singleOn("dragMove",({currentPos:s,zoom:f})=>{const{offsetX:p,offsetY:C}=TransferCanvas2WorldOffset(s,i,f);o.camera.zoom=f;const{x:m,y:v,z:g}=o.initCameraPosition;o.camera.position.set(m+C,v-p,g),o.render()})},[i]),React.useEffect(()=>{var o,n;(n=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null||n.applyZAxisPoints(d)},[d]),React.useEffect(()=>{c.topViewSelectedChanged()},[e.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:"\u4FEF\u89C6\u56FE",toolbar:React__default.default.createElement(TopViewToolbar,{currentData:t})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:l}),React__default.default.createElement(PointCloudInfos.BoxInfos,null),React__default.default.createElement(ZAxisSlider,{zAxisLimit:d,setZAxisLimit:x}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.aMapStateToProps)(PointCloudTopView);module.exports=PointCloudTopView$1;
1
+ "use strict";var dom=require("../../utils/dom.js"),index=require("../../views/MainView/toolFooter/index.js"),index$1=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(o,i,e=1)=>{const{width:l,height:c}=i,r={x:o.x+l*e/2,y:o.y+c*e/2},u={x:i.width/2,y:i.height/2};return{offsetX:(u.x-r.x)/e,offsetY:-(u.y-r.y)/e}},TopViewToolbar=({currentData:o})=>{const{zoom:i,zoomIn:e,zoomOut:l,initialPosition:c}=useZoom.useZoom(),{selectNextBox:r,selectPrevBox:u}=useSingleBox.useSingleBox(),{updateRotate:f}=useRotate.useRotate({currentData:o}),d=2,m=()=>{f(-d)},a=()=>{f(d)},t=()=>{f(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:a,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:m,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:t,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{u()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{r()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index.FooterDivider,null),React__default.default.createElement(index$1.ZoomController,{initialPosition:c,zoomIn:e,zoomOut:l,zoom:i}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:i})=>React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:i,onAfterChange:e=>{o(e)}})),PointCloudTopView=({currentData:o})=>{const i=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),l=useSize(i),{setZoom:c}=useZoom.useZoom(),{addPolygon:r,deletePolygon:u}=usePolygon.usePolygon(),{deletePointCloudBox:f}=useSingleBox.useSingleBox(),[d,m]=React.useState(10),a=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(i.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const t={width:i.current.clientWidth,height:i.current.clientHeight},n=new lbAnnotation.PointCloudAnnotation({container:i.current,size:t,pcdPath:o.url});e.setTopViewInstance(n)}},[]),React.useEffect(()=>{if(!l||!e.topViewInstance||!e.sideViewInstance)return;const{pointCloud2dOperation:t}=e.topViewInstance;t.singleOn("polygonCreated",n=>{if(t.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){r(n);return}a.topViewAddBox(n,l)}),t.singleOn("deletedObject",({id:n})=>{f(n),u(n)}),t.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),t.singleOn("addSelectedIDs",n=>{e.addSelectedID(n)}),t.singleOn("setSelectedIDs",n=>{e.setSelectedIDs(n)}),t.singleOn("updatePolygonByDrag",({newPolygon:n})=>{var s;(s=a.topViewUpdateBox)==null||s.call(a,n,l)})},[e,l,o,a]),React.useEffect(()=>{if(!(l==null?void 0:l.width)||!e.topViewInstance)return;e.topViewInstance.initSize(l),e.topViewInstance.updatePolygonList(e.pointCloudBoxList);const{topViewInstance:{pointCloudInstance:t,pointCloud2dOperation:n}}=e;n.singleOn("renderZoom",(s,p)=>{const{offsetX:C,offsetY:v}=TransferCanvas2WorldOffset(p,l,s);if(t.camera.zoom=s,p){const{x:g,y:x,z:w}=t.initCameraPosition;t.camera.position.set(g+v,x-C,w)}t.camera.updateProjectionMatrix(),t.render(),c(s)}),n.singleOn("dragMove",({currentPos:s,zoom:p})=>{const{offsetX:C,offsetY:v}=TransferCanvas2WorldOffset(s,l,p);t.camera.zoom=p;const{x:g,y:x,z:w}=t.initCameraPosition;t.camera.position.set(g+v,x-C,w),t.render()})},[l]),React.useEffect(()=>{var t,n;(n=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance)==null||n.applyZAxisPoints(d)},[d]),React.useEffect(()=>{a.topViewSelectedChanged()},[e.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:"\u4FEF\u89C6\u56FE",toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:i}),React__default.default.createElement(PointCloudInfos.BoxInfos,null),React__default.default.createElement(ZAxisSlider,{zAxisLimit:d,setZAxisLimit:m}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.aMapStateToProps)(PointCloudTopView);module.exports=PointCloudTopView$1;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js");const useZoom=()=>{const{topViewInstance:o}=React.useContext(PointCloudContext.PointCloudContext),{zoom:t,setZoom:e}=React.useContext(PointCloudContext.PointCloudContext);return{zoom:t,setZoom:e,initialPosition:()=>{o==null||o.pointCloud2dOperation.initImgPos()},zoomOut:()=>{o==null||o.pointCloud2dOperation.zoomChanged(!1)},zoomIn:()=>{o==null||o.pointCloud2dOperation.zoomChanged(!0)}}};exports.useZoom=useZoom;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({imgList:e})=>e.length===0?null:React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,null),React__default.default.createElement(PointCloudBackView,null)))))),mapStateToProps=e=>({imgList:e.annotation.imgList});var PointCloudView$1=reactRedux.connect(mapStateToProps)(PointCloudView);module.exports=PointCloudView$1;
1
+ "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({imgList:e})=>e.length===0?null:React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:t=>t.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,null),React__default.default.createElement(PointCloudBackView,null)))))),mapStateToProps=e=>({imgList:e.annotation.imgList});var PointCloudView$1=reactRedux.connect(mapStateToProps)(PointCloudView);module.exports=PointCloudView$1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:t}={})=>{var r;const s=reactRedux.useDispatch(),u=React.useRef({valid:(r=t==null?void 0:t.valid)!=null?r:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:e=>{},setSubAttribute:(e,a)=>{},setValid:()=>{}}),o=e=>{s({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:e}})},n=()=>{s({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})};return React.useEffect(()=>(o(u.current),()=>{n()}),[]),{toolInstanceRef:u}};exports.useCustomToolInstance=useCustomToolInstance;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:e}={})=>{var r;const s=reactRedux.useDispatch(),u=React.useRef({valid:(r=e==null?void 0:e.valid)!=null?r:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:t=>{},setSubAttribute:(t,n)=>{},setValid:()=>{},updateRotate:()=>{}}),o=t=>{s({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:t}})},a=()=>{s({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})};return React.useEffect(()=>(o(u.current),()=>{a()}),[]),{toolInstanceRef:u}};exports.useCustomToolInstance=useCustomToolInstance;
package/dist/index.css CHANGED
@@ -1235,18 +1235,9 @@
1235
1235
  }
1236
1236
  .bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-2d-container .bee-point-cloud-2d-image {
1237
1237
  flex: 1;
1238
- display: flex;
1239
- align-items: center;
1240
1238
  background-color: #4c4c4c;
1241
- overflow: hidden;
1242
- }
1243
- .bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-2d-container .bee-point-cloud-2d-image > img {
1244
- object-fit: scale-down;
1245
- width: 100%;
1246
- height: 100%;
1247
1239
  }
1248
1240
  .bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-3d-container {
1249
- height: 55%;
1250
1241
  display: flex;
1251
1242
  flex-direction: column;
1252
1243
  overflow: hidden;
@@ -19,6 +19,7 @@ interface IProps {
19
19
  backgroundStyle?: React.CSSProperties;
20
20
  onChange?: (type: 'hover' | 'selected', ids: string[]) => void;
21
21
  showLoading?: boolean;
22
+ globalStyle?: React.CSSProperties;
22
23
  }
23
24
  declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
24
25
  export default _default;
@@ -25,6 +25,8 @@ export interface IPointCloudContext extends IPointCloudContextInstances {
25
25
  addPointCloudBox: (boxParams: IPointCloudBox) => void;
26
26
  polygonList: IPolygonData[];
27
27
  setPolygonList: (polygonList: IPolygonData[]) => void;
28
+ zoom: number;
29
+ setZoom: (zoom: number) => void;
28
30
  }
29
31
  export declare const PointCloudContext: React.Context<IPointCloudContext>;
30
32
  export declare const PointCloudProvider: React.FC<{}>;
@@ -3,4 +3,5 @@ export declare const PointCloudContainer: React.FC<{
3
3
  title: string;
4
4
  toolbar?: React.ReactElement;
5
5
  className?: string;
6
+ style?: React.CSSProperties;
6
7
  }>;
@@ -0,0 +1,7 @@
1
+ export declare const useZoom: () => {
2
+ zoom: number;
3
+ setZoom: (zoom: number) => void;
4
+ initialPosition: () => void;
5
+ zoomOut: () => void;
6
+ zoomIn: () => void;
7
+ };
@@ -14,6 +14,7 @@ export interface ICustomToolInstance {
14
14
  };
15
15
  setDefaultAttribute: (attribute: string) => void;
16
16
  setSubAttribute: (key: string, value: string) => void;
17
+ updateRotate: () => void;
17
18
  }
18
19
  export interface ICustomToolInstanceProps {
19
20
  basicInfo?: {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { ToolInstance } from '@/store/annotation/types';
3
3
  interface IProps {
4
4
  toolInstance: ToolInstance;
5
+ zoom?: number;
5
6
  }
6
7
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
7
8
  children?: React.ReactNode;
@@ -6,6 +6,7 @@ interface IZoomControllerProps {
6
6
  initialPosition?: () => void;
7
7
  zoomIn?: () => void;
8
8
  zoomOut?: () => void;
9
+ zoom?: number;
9
10
  }
10
11
  export declare const ZoomController: React.FC<IZoomControllerProps>;
11
12
  declare const _default: import("react-redux").ConnectedComponent<React.FC<{
@@ -1 +1 @@
1
- "use strict";var React=require("react"),reactRedux=require("react-redux"),useSafeSate=require("../../../../../hooks/useSafeSate.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ZoomLevel=({toolInstance:e})=>{var t;const[,a]=useSafeSate(0);React.useEffect(()=>{e&&e.on("renderZoom",()=>{a(r=>r+1)})},[e]);const o=(t=e==null?void 0:e.zoom)!=null?t:1;return React__default.default.createElement("span",{className:"zoomValue"},(o*100).toFixed(1),"%")},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var ZoomLevel$1=reactRedux.connect(mapStateToProps)(ZoomLevel);module.exports=ZoomLevel$1;
1
+ "use strict";var React=require("react"),reactRedux=require("react-redux"),useSafeSate=require("../../../../../hooks/useSafeSate.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ZoomLevel=({toolInstance:e,zoom:t})=>{var o;const[,r]=useSafeSate(0);React.useEffect(()=>{e&&e.on("renderZoom",()=>{r(u=>u+1)})},[e]);const a=(o=t!=null?t:e==null?void 0:e.zoom)!=null?o:1;return React__default.default.createElement("span",{className:"zoomValue"},(a*100).toFixed(1),"%")},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var ZoomLevel$1=reactRedux.connect(mapStateToProps)(ZoomLevel);module.exports=ZoomLevel$1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icon_adapt=require("../../../../assets/annotation/common/icon_adapt.svg.js"),icon_adapt_black=require("../../../../assets/annotation/common/icon_adapt_black.svg.js"),icons=require("@ant-design/icons"),reactRedux=require("react-redux"),index$1=require("./ZoomLevel/index.js"),index=require("../index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ZoomController=({mode:e,initialPosition:t,zoomOut:o,zoomIn:a})=>{const n=e==="light"?icon_adapt:icon_adapt_black;return React__default.default.createElement("div",null,React__default.default.createElement("span",{className:`${index.footerCls}__zoomController`},React__default.default.createElement(icons.MinusOutlined,{className:`${index.footerCls}__highlight`,onClick:()=>{o==null||o()}}),React__default.default.createElement("span",{className:`${index.footerCls}__zoomText`,onClick:()=>{t==null||t()}},React__default.default.createElement("img",{src:n,className:"adaptIcon"}),React__default.default.createElement(index$1,null)),React__default.default.createElement(icons.PlusOutlined,{className:`${index.footerCls}__highlight`,onClick:()=>{a==null||a()}})))},ZoomControllerWithToolInstance=({toolInstance:e})=>{const t=()=>{e.initImgPos()},o=()=>{e.zoomChanged(!1)},a=()=>{e.zoomChanged(!0)};return React__default.default.createElement(ZoomController,{initialPosition:t,zoomIn:a,zoomOut:o})};var ZoomController$1=reactRedux.connect(e=>({toolInstance:e.annotation.toolInstance}))(ZoomControllerWithToolInstance);exports.ZoomController=ZoomController,exports.default=ZoomController$1;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icon_adapt=require("../../../../assets/annotation/common/icon_adapt.svg.js"),icon_adapt_black=require("../../../../assets/annotation/common/icon_adapt_black.svg.js"),icons=require("@ant-design/icons"),reactRedux=require("react-redux"),index$1=require("./ZoomLevel/index.js"),index=require("../index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ZoomController=({mode:e,initialPosition:t,zoomOut:o,zoomIn:a,zoom:n})=>{const l=e==="light"?icon_adapt:icon_adapt_black;return React__default.default.createElement("div",null,React__default.default.createElement("span",{className:`${index.footerCls}__zoomController`},React__default.default.createElement(icons.MinusOutlined,{className:`${index.footerCls}__highlight`,onClick:()=>{o==null||o()}}),React__default.default.createElement("span",{className:`${index.footerCls}__zoomText`,onClick:()=>{t==null||t()}},React__default.default.createElement("img",{src:l,className:"adaptIcon"}),React__default.default.createElement(index$1,{zoom:n})),React__default.default.createElement(icons.PlusOutlined,{className:`${index.footerCls}__highlight`,onClick:()=>{a==null||a()}})))},ZoomControllerWithToolInstance=({toolInstance:e})=>{const t=()=>{e.initImgPos()},o=()=>{e.zoomChanged(!1)},a=()=>{e.zoomChanged(!0)};return React__default.default.createElement(ZoomController,{initialPosition:t,zoomIn:a,zoomOut:o})};var ZoomController$1=reactRedux.connect(e=>({toolInstance:e.annotation.toolInstance}))(ZoomControllerWithToolInstance);exports.ZoomController=ZoomController,exports.default=ZoomController$1;
@@ -1 +1 @@
1
- "use strict";var React=require("react"),reactRedux=require("react-redux"),icon_r=require("../../../../assets/annotation/common/icon_r.svg.js"),icon_next=require("../../../../assets/annotation/common/icon_next.svg.js"),icon_back=require("../../../../assets/annotation/common/icon_back.svg.js"),icon_rA=require("../../../../assets/annotation/common/icon_rA.svg.js"),icon_nextA=require("../../../../assets/annotation/common/icon_nextA.svg.js"),icon_backA=require("../../../../assets/annotation/common/icon_backA.svg.js"),icon_save=require("../../../../assets/annotation/common/icon_save.svg.js"),icon_saveA=require("../../../../assets/annotation/common/icon_saveA.svg.js"),index=require("../../../../constant/index.js"),ToolType=require("../../../../data/enums/ToolType.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const{EVideoToolName}=lbAnnotation.cTool;var EColor;(function(o){o.Hover="#666fff",o.Normal="#cccccc"})(EColor||(EColor={}));const HeaderOption=o=>{const[r,c]=React.useState(""),{stepInfo:a}=o,l=reactRedux.useDispatch(),{annotation:{toolInstance:t,onSave:u}}=reactRedux.useSelector(e=>({annotation:e.annotation,imgAttribute:e.imgAttribute})),{t:v}=reactI18next.useTranslation(),s=[ToolType.EToolName.Tag,EVideoToolName.VideoTagTool].includes(a==null?void 0:a.tool),i=[EVideoToolName.VideoTagTool].includes(a==null?void 0:a.tool),n=o.isBegin||s,m=()=>{a.dataSourceStep!==0&&a.dataSourceStep!==void 0||t==null||t.updateRotate()},d=React.useCallback(()=>{t==null||t.undo()},[t]),g=React.useCallback(()=>{t==null||t.redo()},[t]),S=[{toolName:"save",title:"Save",show:!!u,commonSvg:icon_save,selectedSvg:icon_saveA,click:()=>{l(actionCreators.ChangeSave)},style:{fontSize:"12px",color:!n&&r==="save"?EColor.Hover:EColor.Normal}},{toolName:"revocation",title:"Undo",show:!0,commonSvg:icon_back,selectedSvg:icon_backA,click:()=>{s||d()},style:{opacity:n===!0?.4:1,fontSize:"12px",color:!n&&r==="revocation"?EColor.Hover:EColor.Normal}},{toolName:"restore",title:"Redo",show:!0,commonSvg:icon_next,selectedSvg:icon_nextA,click:()=>{s||g()},style:{opacity:n===!0?.4:1,fontSize:"12px",color:!n&&r==="restore"?EColor.Hover:EColor.Normal}},{toolName:"rotate",title:"Rotate",show:!0,selectedSvg:icon_rA,commonSvg:icon_r,click:()=>{i||m()},style:{opacity:i===!0?.4:1,fontSize:"12px",color:!n&&r==="rotate"?EColor.Hover:EColor.Normal}}];return React__default.default.createElement("div",{className:`${index.prefix}-header__hotKey`},S.map(e=>e.show&&React__default.default.createElement("div",{key:e.toolName,className:"item",onMouseEnter:()=>c(e.toolName),onMouseLeave:()=>c("")},React__default.default.createElement("a",{className:"item",onClick:e.click},React__default.default.createElement("img",{className:"singleTool",src:r===e.toolName?e.selectedSvg:e.commonSvg,style:e.style}),React__default.default.createElement("div",{style:e.style},v(e.title))))))};module.exports=HeaderOption;
1
+ "use strict";var React=require("react"),reactRedux=require("react-redux"),icon_r=require("../../../../assets/annotation/common/icon_r.svg.js"),icon_next=require("../../../../assets/annotation/common/icon_next.svg.js"),icon_back=require("../../../../assets/annotation/common/icon_back.svg.js"),icon_rA=require("../../../../assets/annotation/common/icon_rA.svg.js"),icon_nextA=require("../../../../assets/annotation/common/icon_nextA.svg.js"),icon_backA=require("../../../../assets/annotation/common/icon_backA.svg.js"),icon_save=require("../../../../assets/annotation/common/icon_save.svg.js"),icon_saveA=require("../../../../assets/annotation/common/icon_saveA.svg.js"),index=require("../../../../constant/index.js"),ToolType=require("../../../../data/enums/ToolType.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const{EVideoToolName,EPointCloudName}=lbAnnotation.cTool;var EColor;(function(o){o.Hover="#666fff",o.Normal="#cccccc"})(EColor||(EColor={}));const HeaderOption=o=>{const[r,i]=React.useState(""),{stepInfo:t}=o,u=reactRedux.useDispatch(),{annotation:{toolInstance:a,onSave:v}}=reactRedux.useSelector(e=>({annotation:e.annotation,imgAttribute:e.imgAttribute})),{t:m}=reactI18next.useTranslation(),s=[ToolType.EToolName.Tag,EVideoToolName.VideoTagTool].includes(t==null?void 0:t.tool),l=[EVideoToolName.VideoTagTool].includes(t==null?void 0:t.tool),d=[EPointCloudName.PointCloud].includes(t==null?void 0:t.tool),n=o.isBegin||s,g=()=>{t.dataSourceStep!==0&&t.dataSourceStep!==void 0||a==null||a.updateRotate()},S=React.useCallback(()=>{a==null||a.undo()},[a]),p=React.useCallback(()=>{a==null||a.redo()},[a]);let c=[{toolName:"save",title:"Save",show:!!v,commonSvg:icon_save,selectedSvg:icon_saveA,click:()=>{u(actionCreators.ChangeSave)},style:{fontSize:"12px",color:!n&&r==="save"?EColor.Hover:EColor.Normal}},{toolName:"revocation",title:"Undo",show:!0,commonSvg:icon_back,selectedSvg:icon_backA,click:()=>{s||S()},style:{opacity:n===!0?.4:1,fontSize:"12px",color:!n&&r==="revocation"?EColor.Hover:EColor.Normal}},{toolName:"restore",title:"Redo",show:!0,commonSvg:icon_next,selectedSvg:icon_nextA,click:()=>{s||p()},style:{opacity:n===!0?.4:1,fontSize:"12px",color:!n&&r==="restore"?EColor.Hover:EColor.Normal}},{toolName:"rotate",title:"Rotate",show:!0,selectedSvg:icon_rA,commonSvg:icon_r,click:()=>{l||g()},style:{opacity:l===!0?.4:1,fontSize:"12px",color:!n&&r==="rotate"?EColor.Hover:EColor.Normal}}];return d&&(c=c.slice(0,1)),React__default.default.createElement("div",{className:`${index.prefix}-header__hotKey`},c.map(e=>e.show&&React__default.default.createElement("div",{key:e.toolName,className:"item",onMouseEnter:()=>i(e.toolName),onMouseLeave:()=>i("")},React__default.default.createElement("a",{className:"item",onClick:e.click},React__default.default.createElement("img",{className:"singleTool",src:r===e.toolName?e.selectedSvg:e.commonSvg,style:e.style}),React__default.default.createElement("div",{style:e.style},m(e.title))))))};module.exports=HeaderOption;
@@ -0,0 +1,4 @@
1
+ var img = "data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%23E6E6E6' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%23BAB8B8' stroke-width='0.5' /%3e%3c/svg%3e";
2
+
3
+ export { img as default };
4
+ //# sourceMappingURL=eraser.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eraser.svg.js","sources":["../../../src/assets/attributeIcon/eraser.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%23E6E6E6' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%23BAB8B8' stroke-width='0.5' /%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
@@ -0,0 +1,4 @@
1
+ var img = "data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%236272FB' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%236272FB' stroke-width='0.5' /%3e%3c/svg%3e";
2
+
3
+ export { img as default };
4
+ //# sourceMappingURL=eraser_a.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eraser_a.svg.js","sources":["../../../src/assets/attributeIcon/eraser_a.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%236272FB' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%236272FB' stroke-width='0.5' /%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
@@ -0,0 +1,4 @@
1
+ var img = "data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%23BAB8B8' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%23BAB8B8' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%23BAB8B8' /%3e%3c/svg%3e";
2
+
3
+ export { img as default };
4
+ //# sourceMappingURL=pen.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pen.svg.js","sources":["../../../src/assets/attributeIcon/pen.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%23BAB8B8' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%23BAB8B8' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%23BAB8B8' /%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
@@ -0,0 +1,4 @@
1
+ var img = "data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%236272FB' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%236272FB' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%236272FB' /%3e%3c/svg%3e";
2
+
3
+ export { img as default };
4
+ //# sourceMappingURL=pen_a.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pen_a.svg.js","sources":["../../../src/assets/attributeIcon/pen_a.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%236272FB' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%236272FB' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%236272FB' /%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
@@ -1 +1 @@
1
- import h,{useState as E,useRef as p,useImperativeHandle as z,useEffect as c}from"react";import{ViewOperation as C,ImgUtils as L}from"@labelbee/lb-annotation";import{Spin as A}from"antd/es";var R=Object.defineProperty,_=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,w=(t,r,o)=>r in t?R(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,b=(t,r)=>{for(var o in r||(r={}))V.call(r,o)&&w(t,o,r[o]);if(_)for(var o of _(r))Z.call(r,o)&&w(t,o,r[o]);return t};const m={width:1280,height:720},j=t=>t?(t.width||(t.width=m.width),t.height||(t.height=m.height),t):m,D=(t,r)=>{const{src:o,annotations:s=[],style:y={stroke:"blue",thickness:3},zoomChange:d,backgroundStyle:I={},onChange:f,showLoading:O=!1}=t,a=j(t.size),[P,v]=E(!1),g=p(null),e=p();z(r,()=>{const n=e.current;return n?{zoomIn:()=>n.zoomChanged(!0),zoomOut:()=>n.zoomChanged(!1),initImgPos:()=>n.initImgPos(),toolInstance:n}:{}},[e.current]),c(()=>(g.current&&(e.current=new C({container:g.current,size:a,style:y,annotations:s,config:"{}"}),e.current.init()),()=>{var n;(n=e.current)==null||n.destroy()}),[]),c(()=>{var n;e.current&&(v(!0),(n=e.current)==null||n.setLoading(!0),L.load(o).then(l=>{var i,u;(i=e.current)==null||i.setLoading(!1),v(!1),(u=e.current)==null||u.setImgNode(l)}).catch(()=>{var l;(l=e.current)==null||l.setLoading(!1),v(!1)}))},[o]),c(()=>{e.current&&e.current.updateData(s)},[s]),c(()=>{const n=e.current;(n==null?void 0:n.setSize)&&n.setSize(a)},[a==null?void 0:a.width,a==null?void 0:a.height]),c(()=>{var n,l;return e.current&&((n=e.current)==null||n.on("onChange",(...i)=>{f==null||f.apply(null,i)}),(l=e.current)==null||l.on("renderZoom",i=>{d&&d(i)})),()=>{var i,u;(i=e.current)==null||i.unbindAll("onChange"),(u=e.current)==null||u.unbindAll("renderZoom")}},[d,f]);const S=h.createElement("div",{ref:g,style:b(b({position:"relative"},a),I)});return h.createElement(A,{spinning:O||P,delay:300},S)};var N=h.forwardRef(D);export{N as default};
1
+ import g,{useState as L,useRef as b,useImperativeHandle as A,useEffect as u}from"react";import{ViewOperation as R,ImgUtils as V}from"@labelbee/lb-annotation";import{Spin as Z}from"antd/es";var j=Object.defineProperty,y=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,I=(t,e,o)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))D.call(e,o)&&I(t,o,e[o]);if(y)for(var o of y(e))N.call(e,o)&&I(t,o,e[o]);return t};const _={width:500,height:100},U=t=>{if(!t)return _;if(t.width&&t.height)return t;const e=m({},t);return e.width||(e.width=_.width),e.height||(e.height=_.height),e},k=(t,e)=>{var o,p;const{src:w,annotations:s=[],style:O={stroke:"blue",thickness:3},zoomChange:c,backgroundStyle:z={},onChange:d,showLoading:P=!1,globalStyle:S}=t,f=U(t.size),[E,v]=L(!1),h=b(null),r=b();A(e,()=>{const n=r.current;return n?{zoomIn:()=>n.zoomChanged(!0),zoomOut:()=>n.zoomChanged(!1),initImgPos:()=>n.initImgPos(),toolInstance:n}:{}},[r.current]),u(()=>(h.current&&(r.current=new R({container:h.current,size:f,style:O,annotations:s,config:"{}"}),r.current.init()),()=>{var n;(n=r.current)==null||n.destroy()}),[]),u(()=>{var n;r.current&&(v(!0),(n=r.current)==null||n.setLoading(!0),V.load(w).then(a=>{var i,l;(i=r.current)==null||i.setLoading(!1),v(!1),(l=r.current)==null||l.setImgNode(a)}).catch(()=>{var a;(a=r.current)==null||a.setLoading(!1),v(!1)}))},[w]),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=t.size)==null?void 0:o.width,(p=t.size)==null?void 0:p.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 C=g.createElement("div",{ref:h,style:m(m({position:"relative"},f),z)});return g.createElement(Z,{spinning:P||E,delay:300,style:S},C)};var x=g.forwardRef(k);export{x as default};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/AnnotationView/index.tsx"],"sourcesContent":["/**\n * 用于标注查看模式\n * @author laoluo\n */\n\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react';\nimport { ViewOperation, ImgUtils } from '@labelbee/lb-annotation';\nimport { Spin } from 'antd/es';\n\ninterface IProps {\n src: string; // 图片路径\n size?: {\n width?: number;\n height?: number;\n };\n style?: {\n color?: string;\n fill?: string;\n thickness?: number;\n };\n annotations: any[]; // TODO\n zoomChange?: (zoom: number) => void;\n backgroundStyle?: React.CSSProperties;\n onChange?: (type: 'hover' | 'selected', ids: string[]) => void;\n\n showLoading?: boolean;\n}\n\nconst DEFAULT_SIZE = {\n width: 1280,\n height: 720,\n};\n\nconst sizeInitialized = (size?: { width?: number; height?: number }) => {\n if (!size) {\n return DEFAULT_SIZE;\n }\n\n if (!size.width) {\n size.width = DEFAULT_SIZE.width;\n }\n\n if (!size.height) {\n size.height = DEFAULT_SIZE.height;\n }\n\n return size;\n};\n\nconst AnnotationView = (props: IProps, ref: any) => {\n const {\n src,\n annotations = [],\n style = {\n stroke: 'blue',\n thickness: 3,\n },\n zoomChange,\n backgroundStyle = {},\n onChange,\n showLoading = false,\n } = props;\n const size = sizeInitialized(props.size);\n const [loading, setLoading] = useState(false);\n const annotationRef = useRef<HTMLDivElement>(null);\n const viewOperation = useRef<ViewOperation>();\n\n useImperativeHandle(\n ref,\n () => {\n const toolInstance = viewOperation.current;\n if (!toolInstance) {\n return {};\n }\n\n return {\n zoomIn: () => toolInstance.zoomChanged(true), // 放大\n zoomOut: () => toolInstance.zoomChanged(false), // 缩小\n initImgPos: () => toolInstance.initImgPos(),\n toolInstance,\n };\n },\n [viewOperation.current],\n );\n\n useEffect(() => {\n if (annotationRef.current) {\n viewOperation.current = new ViewOperation({\n container: annotationRef.current,\n size,\n style,\n annotations,\n config: '{}', // TODO,暂时不需要\n });\n\n viewOperation.current.init();\n }\n\n return () => {\n viewOperation.current?.destroy();\n };\n }, []);\n\n useEffect(() => {\n if (viewOperation.current) {\n setLoading(true);\n viewOperation.current?.setLoading(true);\n ImgUtils.load(src)\n .then((imgNode: HTMLImageElement) => {\n viewOperation.current?.setLoading(false);\n setLoading(false);\n\n viewOperation.current?.setImgNode(imgNode);\n })\n .catch(() => {\n viewOperation.current?.setLoading(false);\n setLoading(false);\n });\n }\n }, [src]);\n\n /**\n * 基础数据绘制监听\n */\n useEffect(() => {\n if (viewOperation.current) {\n viewOperation.current.updateData(annotations);\n }\n }, [annotations]);\n\n /** 窗口大小监听 */\n useEffect(() => {\n const toolInstance = viewOperation.current;\n\n if (toolInstance?.setSize) {\n toolInstance.setSize(size);\n }\n }, [size?.width, size?.height]);\n\n useEffect(() => {\n if (viewOperation.current) {\n viewOperation.current?.on('onChange', (...args: any) => {\n onChange?.apply(null, args);\n });\n\n viewOperation.current?.on('renderZoom', (zoom: number) => {\n if (zoomChange) {\n zoomChange(zoom);\n }\n });\n }\n return () => {\n viewOperation.current?.unbindAll('onChange');\n viewOperation.current?.unbindAll('renderZoom');\n };\n }, [zoomChange, onChange]);\n\n const mainRender = (\n <div ref={annotationRef} style={{ position: 'relative', ...size, ...backgroundStyle }} />\n );\n\n return (\n <Spin spinning={showLoading || loading} delay={300}>\n {mainRender}\n </Spin>\n );\n\n // return mainRender;\n};\n\nexport default React.forwardRef(AnnotationView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,YAAe,GAAA;AAAA,EACnB,KAAO,EAAA,IAAA;AAAA,EACP,MAAQ,EAAA,GAAA;AAAA,CAAA,CAAA;AAGV,MAAM,eAAA,GAAkB,CAAC,IAA+C,KAAA;AACtE,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,YAAA,CAAA;AAAA,GAAA;AAGT,EAAI,IAAA,CAAC,KAAK,KAAO,EAAA;AACf,IAAA,IAAA,CAAK,QAAQ,YAAa,CAAA,KAAA,CAAA;AAAA,GAAA;AAG5B,EAAI,IAAA,CAAC,KAAK,MAAQ,EAAA;AAChB,IAAA,IAAA,CAAK,SAAS,YAAa,CAAA,MAAA,CAAA;AAAA,GAAA;AAG7B,EAAO,OAAA,IAAA,CAAA;AAAA,CAAA,CAAA;AAGT,MAAM,cAAA,GAAiB,CAAC,KAAA,EAAe,GAAa,KAAA;AAClD,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,WAAc,GAAA,EAAA;AAAA,IACd,KAAQ,GAAA;AAAA,MACN,MAAQ,EAAA,MAAA;AAAA,MACR,SAAW,EAAA,CAAA;AAAA,KAAA;AAAA,IAEb,UAAA;AAAA,IACA,eAAkB,GAAA,EAAA;AAAA,IAClB,QAAA;AAAA,IACA,WAAc,GAAA,KAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,IAAA,GAAO,gBAAgB,KAAM,CAAA,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A;AAAA,IAAe,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,CAAE,QAAU,EAAA,UAAA,CAAA,EAAe,IAAS,CAAA,EAAA,eAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAGtE,EAAA,2CACG,IAAD,EAAA;AAAA,IAAM,UAAU,WAAe,IAAA,OAAA;AAAA,IAAS,KAAO,EAAA,GAAA;AAAA,GAC5C,EAAA,UAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOP,uBAAe,MAAM,UAAW,CAAA,cAAA,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/AnnotationView/index.tsx"],"sourcesContent":["/**\n * 用于标注查看模式\n * @author laoluo\n */\n\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react';\nimport { ViewOperation, ImgUtils } from '@labelbee/lb-annotation';\nimport { Spin } from 'antd/es';\n\ninterface IProps {\n src: string; // 图片路径\n size?: {\n width?: number;\n height?: number;\n };\n style?: {\n color?: string;\n fill?: string;\n thickness?: number;\n };\n annotations: any[]; // TODO\n zoomChange?: (zoom: number) => void;\n backgroundStyle?: React.CSSProperties;\n onChange?: (type: 'hover' | 'selected', ids: string[]) => void;\n\n showLoading?: boolean;\n globalStyle?: React.CSSProperties; // Custom global style.\n}\n\nconst DEFAULT_SIZE = {\n width: 500,\n height: 100, // Most Important, If the outer size is smaller than this will not take effect by default\n};\n\nconst sizeInitialized = (size?: { width?: number; height?: number }) => {\n if (!size) {\n return DEFAULT_SIZE;\n }\n if (size.width && size.height) {\n return size;\n }\n\n const newSize = {\n ...size,\n };\n\n if (!newSize.width) {\n newSize.width = DEFAULT_SIZE.width;\n }\n\n if (!newSize.height) {\n newSize.height = DEFAULT_SIZE.height;\n }\n\n return newSize;\n};\n\nconst AnnotationView = (props: IProps, ref: any) => {\n const {\n src,\n annotations = [],\n style = {\n stroke: 'blue',\n thickness: 3,\n },\n zoomChange,\n backgroundStyle = {},\n onChange,\n showLoading = false,\n globalStyle,\n } = props;\n const size = sizeInitialized(props.size);\n const [loading, setLoading] = useState(false);\n const annotationRef = useRef<HTMLDivElement>(null);\n const viewOperation = useRef<ViewOperation>();\n\n useImperativeHandle(\n ref,\n () => {\n const toolInstance = viewOperation.current;\n if (!toolInstance) {\n return {};\n }\n\n return {\n zoomIn: () => toolInstance.zoomChanged(true), // 放大\n zoomOut: () => toolInstance.zoomChanged(false), // 缩小\n initImgPos: () => toolInstance.initImgPos(),\n toolInstance,\n };\n },\n [viewOperation.current],\n );\n\n useEffect(() => {\n if (annotationRef.current) {\n viewOperation.current = new ViewOperation({\n container: annotationRef.current,\n size,\n style,\n annotations,\n config: '{}', // TODO,暂时不需要\n });\n\n viewOperation.current.init();\n }\n\n return () => {\n viewOperation.current?.destroy();\n };\n }, []);\n\n useEffect(() => {\n if (viewOperation.current) {\n setLoading(true);\n viewOperation.current?.setLoading(true);\n ImgUtils.load(src)\n .then((imgNode: HTMLImageElement) => {\n viewOperation.current?.setLoading(false);\n setLoading(false);\n\n viewOperation.current?.setImgNode(imgNode);\n })\n .catch(() => {\n viewOperation.current?.setLoading(false);\n setLoading(false);\n });\n }\n }, [src]);\n\n /**\n * 基础数据绘制监听\n */\n useEffect(() => {\n if (viewOperation.current) {\n viewOperation.current.updateData(annotations);\n }\n }, [annotations]);\n\n /** 窗口大小监听 */\n useEffect(() => {\n const toolInstance = viewOperation.current;\n\n if (toolInstance?.setSize) {\n toolInstance.setSize(size);\n toolInstance.initPosition();\n }\n }, [props.size?.width, props.size?.height]);\n\n useEffect(() => {\n if (viewOperation.current) {\n viewOperation.current?.on('onChange', (...args: any) => {\n onChange?.apply(null, args);\n });\n\n viewOperation.current?.on('renderZoom', (zoom: number) => {\n if (zoomChange) {\n zoomChange(zoom);\n }\n });\n }\n return () => {\n viewOperation.current?.unbindAll('onChange');\n viewOperation.current?.unbindAll('renderZoom');\n };\n }, [zoomChange, onChange]);\n\n const mainRender = (\n <div ref={annotationRef} style={{ position: 'relative', ...size, ...backgroundStyle }} />\n );\n\n return (\n <Spin spinning={showLoading || loading} delay={300} style={globalStyle}>\n {mainRender}\n </Spin>\n );\n\n // return mainRender;\n};\n\nexport default React.forwardRef(AnnotationView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,YAAe,GAAA;AAAA,EACnB,KAAO,EAAA,GAAA;AAAA,EACP,MAAQ,EAAA,GAAA;AAAA,CAAA,CAAA;AAGV,MAAM,eAAA,GAAkB,CAAC,IAA+C,KAAA;AACtE,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,YAAA,CAAA;AAAA,GAAA;AAET,EAAI,IAAA,IAAA,CAAK,KAAS,IAAA,IAAA,CAAK,MAAQ,EAAA;AAC7B,IAAO,OAAA,IAAA,CAAA;AAAA,GAAA;AAGT,EAAA,MAAM,UAAU,cACX,CAAA,EAAA,EAAA,IAAA,CAAA,CAAA;AAGL,EAAI,IAAA,CAAC,QAAQ,KAAO,EAAA;AAClB,IAAA,OAAA,CAAQ,QAAQ,YAAa,CAAA,KAAA,CAAA;AAAA,GAAA;AAG/B,EAAI,IAAA,CAAC,QAAQ,MAAQ,EAAA;AACnB,IAAA,OAAA,CAAQ,SAAS,YAAa,CAAA,MAAA,CAAA;AAAA,GAAA;AAGhC,EAAO,OAAA,OAAA,CAAA;AAAA,CAAA,CAAA;AAGT,MAAM,cAAA,GAAiB,CAAC,KAAA,EAAe,GAAa,KAAA;AAzDpD,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA0DE,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,WAAc,GAAA,EAAA;AAAA,IACd,KAAQ,GAAA;AAAA,MACN,MAAQ,EAAA,MAAA;AAAA,MACR,SAAW,EAAA,CAAA;AAAA,KAAA;AAAA,IAEb,UAAA;AAAA,IACA,eAAkB,GAAA,EAAA;AAAA,IAClB,QAAA;AAAA,IACA,WAAc,GAAA,KAAA;AAAA,IACd,WAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ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AAY,EAAA,QAAA,CAAA,CAAA,CAAA;AAEhB,EAAM,MAAA,UAAA,uCACH,KAAD,EAAA;AAAA,IAAK,GAAK,EAAA,aAAA;AAAA,IAAe,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,CAAE,QAAU,EAAA,UAAA,CAAA,EAAe,IAAS,CAAA,EAAA,eAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAGtE,EAAA,2CACG,IAAD,EAAA;AAAA,IAAM,UAAU,WAAe,IAAA,OAAA;AAAA,IAAS,KAAO,EAAA,GAAA;AAAA,IAAK,KAAO,EAAA,WAAA;AAAA,GACxD,EAAA,UAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOP,uBAAe,MAAM,UAAW,CAAA,cAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- import{editStepWidth as C,sidebarWidth as f,headerHeight as p,footerHeight as k}from"../../data/enums/AnnotationSize.js";import{cKeyCode as E,toolUtils as P}from"@labelbee/lb-annotation";import l,{useState as g,useEffect as T,useMemo as K}from"react";import{connect as H}from"react-redux";import{PageBackward as u,PageForward as m,UpdateRotate as S,UpdateToolInstance as L}from"../../store/annotation/actionCreators.js";import{message as W}from"antd";const d=E.default,y=l.createContext({width:window.innerWidth,height:window.innerHeight}),v=e=>{const{children:s,dispatch:n,annotation:{skipBeforePageTurning:o}}=e;console.log("viewport",e);const[r]=g(window.innerWidth),[i]=g(window.innerHeight),a=t=>{var h;if(!!P.hotkeyFilter(t)){if(!t.shiftKey||!t.ctrlKey){if(t.keyCode===d.A){if(o){o(()=>n(u()));return}n(u())}if(t.keyCode===d.D){if(o){o(()=>n(m()));return}n(m())}t.keyCode===d.R&&n(S())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===d.C){W.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const w=(h=e.annotation)==null?void 0:h.annotationEngine.switchLastTwoCanvas();if(!w)return;n(L(w))}}};T(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[e.annotation.annotationEngine,e.annotation.skipBeforePageTurning]);const c=K(()=>({width:r,height:i}),[r,i]);return l.createElement(y.Provider,{value:c},s)},b=H(e=>({annotation:e.annotation}))(v),x=(e,s=!1,n=!1)=>{const{width:o,height:r}=e,i=p+k,a=n?40+i+40:i,c=s?C+f:f;return{width:o-c,height:r-a}};export{b as ViewportProvider,v as ViewportProviderComponent,x as getFormatSize,y as viewportContext};
1
+ import{editStepWidth as C,sidebarWidth as f,headerHeight as v,footerHeight as k}from"../../data/enums/AnnotationSize.js";import{cKeyCode as E,toolUtils as P}from"@labelbee/lb-annotation";import l,{useState as u,useEffect as T,useMemo as K}from"react";import{connect as H}from"react-redux";import{PageBackward as g,PageForward as m,UpdateRotate as S,UpdateToolInstance as L}from"../../store/annotation/actionCreators.js";import{message as W}from"antd";const d=E.default,y=l.createContext({width:window.innerWidth,height:window.innerHeight}),p=e=>{const{children:s,dispatch:n,annotation:{skipBeforePageTurning:o}}=e,[r]=u(window.innerWidth),[i]=u(window.innerHeight),a=t=>{var h;if(!!P.hotkeyFilter(t)){if(!t.shiftKey||!t.ctrlKey){if(t.keyCode===d.A){if(o){o(()=>n(g()));return}n(g())}if(t.keyCode===d.D){if(o){o(()=>n(m()));return}n(m())}t.keyCode===d.R&&n(S())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===d.C){W.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const w=(h=e.annotation)==null?void 0:h.annotationEngine.switchLastTwoCanvas();if(!w)return;n(L(w))}}};T(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[e.annotation.annotationEngine,e.annotation.skipBeforePageTurning]);const c=K(()=>({width:r,height:i}),[r,i]);return l.createElement(y.Provider,{value:c},s)},b=H(e=>({annotation:e.annotation}))(p),x=(e,s=!1,n=!1)=>{const{width:o,height:r}=e,i=v+k,a=n?40+i+40:i,c=s?C+f:f;return{width:o-c,height:r-a}};export{b as ViewportProvider,p as ViewportProviderComponent,x as getFormatSize,y as viewportContext};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/customResizeHook/index.tsx"],"sourcesContent":["import {\n editStepWidth,\n footerHeight,\n headerHeight,\n sidebarWidth,\n} from '@/data/enums/AnnotationSize';\nimport { cKeyCode, toolUtils } from '@labelbee/lb-annotation';\n\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport {\n UpdateRotate,\n PageBackward,\n PageForward,\n UpdateToolInstance,\n} from '@/store/annotation/actionCreators';\nimport { ISize } from '@/types/main';\nimport { message } from 'antd';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const {\n children,\n dispatch,\n annotation: { skipBeforePageTurning },\n } = props;\n console.log('viewport', props);\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n\n if (!e.shiftKey || !e.ctrlKey) {\n if (e.keyCode === EKeyCode.A) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageBackward()));\n return;\n }\n\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageForward()));\n return;\n }\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine, props.annotation.skipBeforePageTurning]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\n\nexport const ViewportProvider = connect((state: AppState) => ({\n annotation: state.annotation,\n}))(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,WAAW,QAAS,CAAA,OAAA,CAAA;AAEb,MAAA,eAAA,GAAkB,MAAM,aAGlC,CAAA;AAAA,EACD,OAAO,MAAO,CAAA,UAAA;AAAA,EACd,QAAQ,MAAO,CAAA,WAAA;AAAA,CAAA,EAAA;AAGJ,MAAA,yBAAA,GAA4B,CAAC,KAAe,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AA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8BG,MAAM,gBAAgB,CAAC,UAAA,EAAmB,MAAS,GAAA,KAAA,EAAO,SAAS,KAAU,KAAA;AAClF,EAAM,MAAA,CAAE,OAAO,MAAW,CAAA,GAAA,UAAA,CAAA;AAC1B,EAAA,MAAM,cAAc,YAAe,GAAA,YAAA,CAAA;AACnC,EAAA,MAAM,iBAAoB,GAAA,MAAA,GAAS,EAAK,GAAA,WAAA,GAAc,EAAK,GAAA,WAAA,CAAA;AAC3D,EAAM,MAAA,gBAAA,GAAmB,MAAS,GAAA,aAAA,GAAgB,YAAe,GAAA,YAAA,CAAA;AAEjE,EAAO,OAAA;AAAA,IACL,OAAO,KAAQ,GAAA,gBAAA;AAAA,IACf,QAAQ,MAAS,GAAA,iBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/customResizeHook/index.tsx"],"sourcesContent":["import {\n editStepWidth,\n footerHeight,\n headerHeight,\n sidebarWidth,\n} from '@/data/enums/AnnotationSize';\nimport { cKeyCode, toolUtils } from '@labelbee/lb-annotation';\n\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport {\n UpdateRotate,\n PageBackward,\n PageForward,\n UpdateToolInstance,\n} from '@/store/annotation/actionCreators';\nimport { ISize } from '@/types/main';\nimport { message } from 'antd';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const {\n children,\n dispatch,\n annotation: { skipBeforePageTurning },\n } = props;\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n\n if (!e.shiftKey || !e.ctrlKey) {\n if (e.keyCode === EKeyCode.A) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageBackward()));\n return;\n }\n\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageForward()));\n return;\n }\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine, props.annotation.skipBeforePageTurning]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\n\nexport const ViewportProvider = connect((state: AppState) => ({\n annotation: state.annotation,\n}))(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,WAAW,QAAS,CAAA,OAAA,CAAA;AAEb,MAAA,eAAA,GAAkB,MAAM,aAGlC,CAAA;AAAA,EACD,OAAO,MAAO,CAAA,UAAA;AAAA,EACd,QAAQ,MAAO,CAAA,WAAA;AAAA,CAAA,EAAA;AAGJ,MAAA,yBAAA,GAA4B,CAAC,KAAe,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAY,CAAE,qBAAA,CAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,CAAC,KAAS,CAAA,GAAA,QAAA,CAAS,MAAO,CAAA,UAAA,CAAA,CAAA;AAChC,EAAM,MAAA,CAAC,MAAU,CAAA,GAAA,QAAA,CAAS,MAAO,CAAA,WAAA,CAAA,CAAA;AAEjC,EAAM,MAAA,OAAA,GAAU,CAAC,CAAqB,KAAA;AAvCxC,IAAA,IAAA,EAAA,CAAA;AAwCI,IAAI,IAAA,CAAC,SAAU,CAAA,YAAA,CAAa,CAAI,CAAA,EAAA;AAC9B,MAAA,OAAA;AAAA,KAAA;AAGF,IAAA,IAAI,CAAC,CAAA,CAAE,QAAY,IAAA,CAAC,EAAE,OAAS,EAAA;AAC7B,MAAI,IAAA,CAAA,CAAE,OAAY,KAAA,QAAA,CAAS,CAAG,EAAA;AAC5B,QAAA,IAAI,qBAAuB,EAAA;AACzB,UAAA,qBAAA,CAAsB,MAAM,QAAS,CAAA,YAAA,EAAA,CAAA,CAAA,CAAA;AACrC,UAAA,OAAA;AAAA,SAAA;AAGF,QAAS,QAAA,CAAA,YAAA,EAAA,CAAA,CAAA;AAAA,OAAA;AAGX,MAAI,IAAA,CAAA,CAAE,OAAY,KAAA,QAAA,CAAS,CAAG,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AAA,MAAA,CAAA,CAAA,EAAW,CAAC,KAAO,EAAA,MAAA,CAAA,CAAA,CAAA;AAExD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAgB,QAAjB,EAAA;AAAA,IAA0B,KAAO,EAAA,IAAA;AAAA,GAAO,EAAA,QAAA,CAAA,CAAA;AAAA,EAAA;AAGpC,MAAA,gBAAA,GAAmB,OAAQ,CAAA,CAAC,KAAqB,MAAA;AAAA,EAC5D,YAAY,KAAM,CAAA,UAAA;AAAA,CAChB,CAAA,CAAA,CAAA,yBAAA,EAAA;AA8BG,MAAM,gBAAgB,CAAC,UAAA,EAAmB,MAAS,GAAA,KAAA,EAAO,SAAS,KAAU,KAAA;AAClF,EAAM,MAAA,CAAE,OAAO,MAAW,CAAA,GAAA,UAAA,CAAA;AAC1B,EAAA,MAAM,cAAc,YAAe,GAAA,YAAA,CAAA;AACnC,EAAA,MAAM,iBAAoB,GAAA,MAAA,GAAS,EAAK,GAAA,WAAA,GAAc,EAAK,GAAA,WAAA,CAAA;AAC3D,EAAM,MAAA,gBAAA,GAAmB,MAAS,GAAA,aAAA,GAAgB,YAAe,GAAA,YAAA,CAAA;AAEjE,EAAO,OAAA;AAAA,IACL,OAAO,KAAQ,GAAA,gBAAA;AAAA,IACf,QAAQ,MAAS,GAAA,iBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- import{getClassName as f}from"../../utils/dom.js";import o,{useState as g,useContext as h,useRef as j,useEffect as v}from"react";import{PointCloudContainer as I}from"./PointCloudLayout.js";import S from"../AnnotationView/index.js";import{PointCloudContext as V}from"./PointCloudContext.js";import{connect as b}from"react-redux";import{LeftOutlined as D,RightOutlined as N}from"@ant-design/icons";import A from"../../hooks/useSize.js";var z=Object.defineProperty,C=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,P=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t)=>{for(var n in t||(t={}))R.call(t,n)&&P(e,n,t[n]);if(C)for(var n of C(t))T.call(t,n)&&P(e,n,t[n]);return e};const B=({onNext:e,onPrev:t,imgLength:n,imgIndex:l})=>o.createElement("div",null,o.createElement(D,{onClick:t}),o.createElement("span",null," ",l+1," / ",n," "),o.createElement(N,{onClick:e})),F=({imgInfo:e})=>{var t,n;const[l,E]=g([]),{pointCloudBoxList:c,topViewInstance:p}=h(V),[a,s]=g(0),m=j(null),_=A(m),r=(t=e==null?void 0:e.mappingImgList)==null?void 0:t[a];if(v(()=>{s(0)},[e]),v(()=>{if(p&&r){const{pointCloudInstance:i}=p,w={fill:"transparent",color:"green"},x=c.reduce((L,y)=>{const O=i.pointCloudLidar2image(y,r.calib);return[...L,...O.map(d=>({type:d.type,annotation:k({pointList:d.pointList},w)}))]},[]);E(x)}},[c,r]),!e)return o.createElement("div",null);const{mappingImgList:u}=e;return u?o.createElement(I,{className:f("point-cloud-2d-container"),title:"2D\u89C6\u56FE",toolbar:o.createElement(B,{imgIndex:a,imgLength:u.length,onNext:()=>{a>=u.length-1||s(i=>i+1)},onPrev:()=>{a<=0||s(i=>i-1)}})},o.createElement("div",{className:f("point-cloud-2d-image"),ref:m},o.createElement(S,{src:(n=r==null?void 0:r.url)!=null?n:"",annotations:l,size:_}))):o.createElement("div",null)},M=e=>{const{imgList:t,imgIndex:n}=e.annotation;return{imgInfo:t[n]}};var $=b(M)(F);export{$ as default};
1
+ import{getClassName as E}from"../../utils/dom.js";import i,{useState as h,useContext as N,useRef as O,useEffect as _}from"react";import{PointCloudContainer as A}from"./PointCloudLayout.js";import B from"../AnnotationView/index.js";import{PointCloudContext as I}from"./PointCloudContext.js";import{connect as R}from"react-redux";import{LeftOutlined as k,RightOutlined as z}from"@ant-design/icons";import T from"../../hooks/useSize.js";import{useSingleBox as F}from"./hooks/useSingleBox.js";var M=Object.defineProperty,S=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,b=(t,n,e)=>n in t?M(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,G=(t,n)=>{for(var e in n||(n={}))$.call(n,e)&&b(t,e,n[e]);if(S)for(var e of S(n))q.call(n,e)&&b(t,e,n[e]);return t};const H=({onNext:t,onPrev:n,imgLength:e,imgIndex:s})=>i.createElement("div",null,i.createElement(k,{onClick:n}),i.createElement("span",null," ",s+1," / ",e," "),i.createElement(z,{onClick:t})),J=({imgInfo:t})=>{var n,e,s,L,P;const[p,j]=h([]),{pointCloudBoxList:C,topViewInstance:x}=N(I),[u,m]=h(0),y=O(null),v=O(),{selectedBox:f}=F(),V=T(y),a=(n=t==null?void 0:t.mappingImgList)==null?void 0:n[u];_(()=>{m(0)},[t]),_(()=>{if(x&&a){const{pointCloudInstance:o}=x,r={fill:"transparent",color:"green"},c=C.reduce((l,d)=>{const D=o.pointCloudLidar2image(d,a.calib);return[...l,...D.map(w=>({type:w.type,annotation:G({id:d.id,pointList:w.pointList},r)}))]},[]);j(c)}},[C,a]);const g=!t||!(t==null?void 0:t.mappingImgList)||!(((e=t==null?void 0:t.mappingImgList)==null?void 0:e.length)>0);return _(()=>{var o,r;const c=(o=v.current)==null?void 0:o.toolInstance;if(!f||!c)return;const l=p.find(d=>d.annotation.id===f.info.id);((r=l==null?void 0:l.annotation.pointList)==null?void 0:r.length)>0&&c.focusPositionByPointList(l==null?void 0:l.annotation.pointList)},[f,v.current,p]),i.createElement(A,{className:E("point-cloud-2d-container"),title:"2D\u89C6\u56FE",toolbar:g?void 0:i.createElement(H,{imgIndex:u,imgLength:(L=(s=t.mappingImgList)==null?void 0:s.length)!=null?L:0,onNext:()=>{var o;!t||!(t==null?void 0:t.mappingImgList)||u>=((o=t==null?void 0:t.mappingImgList)==null?void 0:o.length)-1||m(r=>r+1)},onPrev:()=>{u<=0||m(o=>o-1)}}),style:{display:g?"none":"flex"}},i.createElement("div",{className:E("point-cloud-2d-image"),ref:y},i.createElement(B,{src:(P=a==null?void 0:a.url)!=null?P:"",annotations:p,size:V,ref:v,globalStyle:{display:g?"none":"block"}})))},K=t=>{const{imgList:n,imgIndex:e}=t.annotation;return{imgInfo:n[e]}};var Q=R(K)(J);export{Q as default};
@@ -1 +1 @@
1
- {"version":3,"file":"PointCloud2DView.js","sources":["../../../src/components/pointCloudView/PointCloud2DView.tsx"],"sourcesContent":["import { getClassName } from '@/utils/dom';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport AnnotationView from '@/components/AnnotationView';\nimport { PointCloudContext } from './PointCloudContext';\nimport { AppState } from '@/store';\nimport { connect } from 'react-redux';\nimport { IFileItem } from '@/types/data';\nimport { LeftOutlined, RightOutlined } from '@ant-design/icons';\nimport useSize from '@/hooks/useSize';\n\ninterface IProps {\n imgInfo: IFileItem;\n}\n\nconst Toolbar = ({\n onNext,\n onPrev,\n imgLength,\n imgIndex,\n}: {\n onNext: () => void;\n onPrev: () => void;\n imgLength: number;\n imgIndex: number;\n}) => {\n return (\n <div>\n <LeftOutlined onClick={onPrev} />\n <span>\n {' '}\n {imgIndex + 1} / {imgLength}{' '}\n </span>\n\n <RightOutlined onClick={onNext} />\n </div>\n );\n};\n\n// TODO, It will be deleted when the exported type of lb-annotation is work.\ninterface IAnnotationDataTemporarily {\n type: string;\n annotation: any;\n}\n\nconst PointCloud2DView = ({ imgInfo }: IProps) => {\n const [annotations2d, setAnnotations2d] = useState<IAnnotationDataTemporarily[]>([]);\n const { pointCloudBoxList, topViewInstance } = useContext(PointCloudContext);\n const [mappingIndex, setMappingIndex] = useState(0);\n const ref = useRef(null);\n const size = useSize(ref);\n\n const mappingData = imgInfo?.mappingImgList?.[mappingIndex];\n\n useEffect(() => {\n setMappingIndex(0);\n }, [imgInfo]);\n\n useEffect(() => {\n if (topViewInstance && mappingData) {\n const { pointCloudInstance } = topViewInstance;\n const defaultViewStyle = {\n fill: 'transparent',\n color: 'green',\n };\n const newAnnotations2d: IAnnotationDataTemporarily[] = pointCloudBoxList.reduce(\n (acc: IAnnotationDataTemporarily[], pointCloudBox) => {\n const viewDataPointList = pointCloudInstance.pointCloudLidar2image(\n pointCloudBox,\n mappingData.calib,\n );\n return [\n ...acc,\n ...viewDataPointList.map((v: any) => {\n return {\n type: v.type,\n annotation: {\n pointList: v.pointList,\n ...defaultViewStyle,\n },\n };\n }),\n ];\n },\n [],\n );\n\n setAnnotations2d(newAnnotations2d);\n }\n }, [pointCloudBoxList, mappingData]);\n\n if (!imgInfo) {\n return <div />;\n }\n\n const { mappingImgList } = imgInfo;\n\n if (!mappingImgList) {\n return <div />;\n }\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-2d-container')}\n title='2D视图'\n toolbar={\n <Toolbar\n imgIndex={mappingIndex}\n imgLength={mappingImgList.length}\n onNext={() => {\n if (mappingIndex >= mappingImgList.length - 1) {\n return;\n }\n setMappingIndex((v) => v + 1);\n }}\n onPrev={() => {\n if (mappingIndex <= 0) {\n return;\n }\n setMappingIndex((v) => v - 1);\n }}\n />\n }\n >\n <div className={getClassName('point-cloud-2d-image')} ref={ref}>\n <AnnotationView src={mappingData?.url ?? ''} annotations={annotations2d} size={size} />\n </div>\n </PointCloudContainer>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const { imgList, imgIndex } = state.annotation;\n\n return {\n imgInfo: imgList[imgIndex],\n };\n};\n\nexport default connect(mapStateToProps)(PointCloud2DView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,UAAU,CAAC;AAAA,EACf,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,CAMI,KAAA;AACJ,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAD,IACE,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAD,EAAA;AAAA,IAAc,OAAS,EAAA,MAAA;AAAA,GACvB,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MA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AgB,eAAA,CAAA,CAAC,MAAM,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,OAAA;AAAA,MAE7B,QAAQ,MAAM;AACZ,QAAA,IAAI,gBAAgB,CAAG,EAAA;AACrB,UAAA,OAAA;AAAA,SAAA;AAEF,QAAgB,eAAA,CAAA,CAAC,MAAM,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,GAAA,sCAKhC,KAAD,EAAA;AAAA,IAAK,WAAW,YAAa,CAAA,sBAAA,CAAA;AAAA,IAAyB,GAAA;AAAA,GAAA,sCACnD,cAAD,EAAA;AAAA,IAAgB,GAAA,EAAK,CAAa,EAAA,GAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAA,GAAA,KAAb,IAAoB,GAAA,EAAA,GAAA,EAAA;AAAA,IAAI,WAAa,EAAA,aAAA;AAAA,IAAe,IAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAMjF,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAM,MAAA,CAAE,OAAS,EAAA,QAAA,CAAA,GAAa,KAAM,CAAA,UAAA,CAAA;AAEpC,EAAO,OAAA;AAAA,IACL,SAAS,OAAQ,CAAA,QAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAIrB,yBAAe,QAAQ,eAAiB,CAAA,CAAA,gBAAA,CAAA;;;;"}
1
+ {"version":3,"file":"PointCloud2DView.js","sources":["../../../src/components/pointCloudView/PointCloud2DView.tsx"],"sourcesContent":["import { getClassName } from '@/utils/dom';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport AnnotationView from '@/components/AnnotationView';\nimport { PointCloudContext } from './PointCloudContext';\nimport { AppState } from '@/store';\nimport { connect } from 'react-redux';\nimport { IFileItem } from '@/types/data';\nimport { LeftOutlined, RightOutlined } from '@ant-design/icons';\nimport useSize from '@/hooks/useSize';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { ViewOperation } from '@labelbee/lb-annotation';\n\ninterface IProps {\n imgInfo: IFileItem;\n}\n\nconst Toolbar = ({\n onNext,\n onPrev,\n imgLength,\n imgIndex,\n}: {\n onNext: () => void;\n onPrev: () => void;\n imgLength: number;\n imgIndex: number;\n}) => {\n return (\n <div>\n <LeftOutlined onClick={onPrev} />\n <span>\n {' '}\n {imgIndex + 1} / {imgLength}{' '}\n </span>\n\n <RightOutlined onClick={onNext} />\n </div>\n );\n};\n\n// TODO, It will be deleted when the exported type of lb-annotation is work.\ninterface IAnnotationDataTemporarily {\n type: string;\n annotation: any;\n}\n\nconst PointCloud2DView = ({ imgInfo }: IProps) => {\n const [annotations2d, setAnnotations2d] = useState<IAnnotationDataTemporarily[]>([]);\n const { pointCloudBoxList, topViewInstance } = useContext(PointCloudContext);\n const [mappingIndex, setMappingIndex] = useState(0);\n const ref = useRef(null);\n const viewRef = useRef<{ toolInstance: ViewOperation }>();\n const { selectedBox } = useSingleBox();\n const size = useSize(ref);\n\n const mappingData = imgInfo?.mappingImgList?.[mappingIndex];\n\n useEffect(() => {\n setMappingIndex(0);\n }, [imgInfo]);\n\n useEffect(() => {\n if (topViewInstance && mappingData) {\n const { pointCloudInstance } = topViewInstance;\n const defaultViewStyle = {\n fill: 'transparent',\n color: 'green',\n };\n const newAnnotations2d: IAnnotationDataTemporarily[] = pointCloudBoxList.reduce(\n (acc: IAnnotationDataTemporarily[], pointCloudBox) => {\n const viewDataPointList = pointCloudInstance.pointCloudLidar2image(\n pointCloudBox,\n mappingData.calib,\n );\n return [\n ...acc,\n ...viewDataPointList.map((v: any) => {\n return {\n type: v.type,\n annotation: {\n id: pointCloudBox.id,\n pointList: v.pointList,\n ...defaultViewStyle,\n },\n };\n }),\n ];\n },\n [],\n );\n\n setAnnotations2d(newAnnotations2d);\n }\n }, [pointCloudBoxList, mappingData]);\n\n const hiddenData = !imgInfo || !imgInfo?.mappingImgList || !(imgInfo?.mappingImgList?.length > 0);\n\n useEffect(() => {\n const toolInstance = viewRef.current?.toolInstance;\n\n if (!selectedBox || !toolInstance) {\n return;\n }\n const selected2data = annotations2d.find((v) => v.annotation.id === selectedBox.info.id);\n\n if (selected2data?.annotation.pointList?.length > 0) {\n toolInstance.focusPositionByPointList(selected2data?.annotation.pointList);\n }\n }, [selectedBox, viewRef.current, annotations2d]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-2d-container')}\n title='2D视图'\n toolbar={\n hiddenData ? undefined : (\n <Toolbar\n imgIndex={mappingIndex}\n imgLength={imgInfo.mappingImgList?.length ?? 0}\n onNext={() => {\n if (!imgInfo || !imgInfo?.mappingImgList) {\n return;\n }\n\n if (mappingIndex >= imgInfo?.mappingImgList?.length - 1) {\n return;\n }\n setMappingIndex((v) => v + 1);\n }}\n onPrev={() => {\n if (mappingIndex <= 0) {\n return;\n }\n setMappingIndex((v) => v - 1);\n }}\n />\n )\n }\n style={{ display: hiddenData ? 'none' : 'flex' }}\n >\n <div className={getClassName('point-cloud-2d-image')} ref={ref}>\n <AnnotationView\n src={mappingData?.url ?? ''}\n annotations={annotations2d}\n size={size}\n ref={viewRef}\n globalStyle={{ display: hiddenData ? 'none' : 'block' }}\n />\n </div>\n </PointCloudContainer>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const { imgList, imgIndex } = state.annotation;\n\n return {\n imgInfo: imgList[imgIndex],\n };\n};\n\nexport default connect(mapStateToProps)(PointCloud2DView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,UAAU,CAAC;AAAA,EACf,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,CAMI,KAAA;AACJ,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAD,IACE,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAD,EAAA;AAAA,IAAc,OAAS,EAAA,MAAA;A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