@labelbee/lb-components 1.6.0-alpha.11 → 1.6.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/customResizeHook/index.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/components/customResizeHook/index.js +1 -1
- package/es/components/customResizeHook/index.js.map +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js.map +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +1 -1
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/es/components/pointCloudView/hooks/useSingleBox.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js.map +1 -1
- package/package.json +4 -5
- package/LICENSE +0 -203
|
@@ -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"),ctx=require("../../store/ctx.js");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}),null,null,{context:ctx.LabelBeeContext})(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"),ctx=require("../../store/ctx.js");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()),t.keyCode===EKeyCode.C&&t.altKey===!0&&n(actionCreators.CopyBackWordResult())}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}),null,null,{context:ctx.LabelBeeContext})(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"),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"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(
|
|
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"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.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:d}=i,r={x:o.x+l*e/2,y:o.y+d*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:d}=useZoom.useZoom(),{selectNextBox:r,selectPrevBox:u}=useSingleBox.useSingleBox(),{updateRotate:c}=useRotate.useRotate({currentData:o}),m=2,p=()=>{c(-m)},C=()=>{c(m)},v=()=>{c(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:C,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:p,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:v,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:d,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:d}=useZoom.useZoom(),{addPolygon:r,deletePolygon:u}=usePolygon.usePolygon(),{deletePointCloudBox:c,changeBoxValidByID:m}=useSingleBox.useSingleBox(),[p,C]=React.useState(10),{t:v}=reactI18next.useTranslation(),f=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(!e.topViewInstance&&i.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const t={width:i.current.clientWidth,height:i.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:i.current,size:t,pcdPath:o.url});e.setTopViewInstance(a)}},[o]),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}f.topViewAddBox(n,l)}),t.singleOn("deletedObject",({id:n})=>{c(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=f.topViewUpdateBox)==null||s.call(f,n,l)});const a=n=>{m(n)};return t.on("validUpdate",a),()=>{t.unbind("validUpdate",a)}},[e,l,o,f]),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:a}}=e;a.singleOn("renderZoom",(n,s)=>{const{offsetX:x,offsetY:g}=TransferCanvas2WorldOffset(s,l,n);if(t.camera.zoom=n,s){const{x:w,y:P,z:h}=t.initCameraPosition;t.camera.position.set(w+g,P-x,h)}t.camera.updateProjectionMatrix(),t.render(),d(n)}),a.singleOn("dragMove",({currentPos:n,zoom:s})=>{const{offsetX:x,offsetY:g}=TransferCanvas2WorldOffset(n,l,s);t.camera.zoom=s;const{x:w,y:P,z:h}=t.initCameraPosition;t.camera.position.set(w+g,P-x,h),t.render()})},[l,e.topViewInstance]),React.useEffect(()=>{var t,a;(a=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance)==null||a.applyZAxisPoints(p)},[p]),React.useEffect(()=>{f.topViewSelectedChanged()},[e.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:v("TopView"),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:i}),React__default.default.createElement(PointCloudInfos.BoxInfos,null),React__default.default.createElement(ZAxisSlider,{zAxisLimit:p,setZAxisLimit:C}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.aMapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),_=require("lodash"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,n)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,__spreadValues=(e,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(e,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(e,n,o[n]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__async=(e,o,n)=>new Promise((a,t)=>{var i=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),_=require("lodash"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,n)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,__spreadValues=(e,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(e,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(e,n,o[n]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__async=(e,o,n)=>new Promise((a,t)=>{var i=s=>{try{u(n.next(s))}catch(g){t(g)}},v=s=>{try{u(n.throw(s))}catch(g){t(g)}},u=s=>s.done?a(s.value):Promise.resolve(s.value).then(i,v);u((n=n.apply(e,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},transferCanvas2World=(e,o)=>{const{width:n,height:a}=o,{x:t,y:i}=e;return{x:-i+a/2,y:-(t-n/2)}},topViewPolygon2PointCloud=(e,o,n,a,t)=>{const[i,v,u,s]=e.pointList.map(f=>transferCanvas2World(f,o)),g=lbAnnotation.MathUtils.getLineCenterPoint([i,u]),x=lbAnnotation.MathUtils.getLineLength(i,v),p=lbAnnotation.MathUtils.getLineLength(v,u),C=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);let m=0,y=1,w={};if(n){const f=n.getSensesPointZAxisInPolygon([i,v,u,s]);m=(f.maxZ+f.minZ)/2,y=f.maxZ-f.minZ,w={count:f.zCount}}a&&(m=a.center.z,y=a.depth);const h=__spreadValues({center:{x:g.x,y:g.y,z:m},width:p,height:x,depth:y,rotation:C,id:e.id,attribute:"",valid:!0},w);return t&&Object.assign(h,t),h},sideViewPolygon2PointCloud=(e,o,n,a)=>{const[t,i,v]=e.pointList,[u,s,g]=o.pointList,x=lbAnnotation.MathUtils.getLineCenterPoint([t,v]),p=lbAnnotation.MathUtils.getLineCenterPoint([u,g]),C={x:x.x-p.x,y:x.y-p.y},m=Math.cos(n.rotation),y=Math.sin(n.rotation),w={x:C.x,y:C.x*y+C.y*m,z:x.y-p.y},h=lbAnnotation.MathUtils.getLineLength(t,i),f=lbAnnotation.MathUtils.getLineLength(u,s),V=h-f,b=lbAnnotation.MathUtils.getLineLength(i,v),I=lbAnnotation.MathUtils.getLineLength(s,g),O=b-I,{newBoxParams:U}=a.getNewBoxBySideUpdate(w,O,V,n);return U},synchronizeSideView=(e,o,n,a)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:i}=n;i.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:v}=i.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);i.setInitCameraPosition(v);const{polygon2d:u,zoom:s}=i.getBoxSidePolygon2DCoordinate(e);i.camera.zoom=s,i.camera.updateProjectionMatrix(),i.render(),t.initPosition(),t.zoomChangeOnCenter(s),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:u,textAttribute:"",isRect:!0}],o.id)},synchronizeBackView=(e,o,n,a)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:i}=n;i.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:v}=i.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);i.setInitCameraPosition(v);const{polygon2d:u,zoom:s}=i.getBoxBackPolygon2DCoordinate(e);i.camera.zoom=s,i.camera.updateProjectionMatrix(),i.render(),t.initPosition(),t.zoomChangeOnCenter(s),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:u,textAttribute:"",isRect:!0}],o.id)},synchronizeTopView=(e,o,n,a)=>{var t;if(!n||!a)return;a.generateBox(e,o.id),a.updateCameraByBox(e,lbUtils.EPerspectiveView.Top),a.render();const{pointCloud2dOperation:i,pointCloudInstance:v}=n,{polygon2d:u}=v.getBoxTopPolygon2DCoordinate(e),s=[...i.polygonList],g=s.find(x=>x.id===o.id);g?g.pointList=u:s.push({id:o.id,pointList:u,textAttribute:"",isRect:!0,valid:(t=e.valid)!=null?t:!0}),i.setResultAndSelectedID(s,o.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:n,backViewInstance:a,mainViewInstance:t,addPointCloudBox:i,setSelectedIDs:v,selectedIDs:u,pointCloudBoxList:s,setPointCloudResult:g}=e,{updateSelectedBox:x}=useSingleBox.useSingleBox(),{currentData:p,config:C}=ctx.useSelector(r=>{const{stepList:l,step:c,imgList:d,imgIndex:P}=r.annotation;return{currentData:d[P],config:index.jsonParser(StepUtils.getCurrentStepInfo(c,l).config)}}),m=ctx.useDispatch(),{selectedBox:y}=useSingleBox.useSingleBox(),{t:w}=reactI18next.useTranslation(),h=y==null?void 0:y.info;if(!o||!n)return{topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{}};const{pointCloudInstance:f}=o,V=r=>{t==null||t.generateBox(r),t==null||t.controls.update(),t==null||t.render()},b=(r,l)=>{var c,d,P;const L=topViewPolygon2PointCloud(r,l,f,void 0,{attribute:(P=(d=(c=C==null?void 0:C.attributeList)==null?void 0:c[0])==null?void 0:d.value)!=null?P:""}),D=o==null?void 0:o.pointCloud2dOperation,B=L;if((C==null?void 0:C.lowerLimitPointsNumInBox)&&typeof L.count=="number"&&L.count<C.lowerLimitPointsNumInBox){antd.message.info(w("LowerLimitPointsNumInBox",{num:C.lowerLimitPointsNumInBox})),D.deletePolygon(L.id);return}D.setSelectedIDs([r.id]),v(B.id),S(PointCloudView.Top,r,B),i(B)},I=()=>{const r=y==null?void 0:y.info,l=o==null?void 0:o.pointCloud2dOperation;if(l.setSelectedIDs(u),!r||!l)return;const c=l.selectedPolygon;S(PointCloudView.Top,c,r)},O=(r,l,c)=>{if(h){let d=sideViewPolygon2PointCloud(r,l,h,n.pointCloudInstance);if(t){const{count:P}=t.getSensesPointZAxisInPolygon(t.getCuboidFromPointCloudBox(d).polygonPointList,[d.center.z-d.depth/2,d.center.z+d.depth/2]);d=__spreadProps(__spreadValues({},d),{count:P})}x(d),S(c,r,d)}},U=(r,l)=>{O(r,l,PointCloudView.Side)},j=(r,l)=>{O(r,l,PointCloudView.Back)},z=(r,l)=>{if(h){const c=topViewPolygon2PointCloud(r,l,o.pointCloudInstance,h);Object.assign(h,___default.default.pickBy(c,(d,P)=>["width","height","x","y"])),x(c),S(PointCloudView.Top,r,h)}},S=(r,l,c)=>{const d=p==null?void 0:p.url,P={[PointCloudView.Side]:()=>{synchronizeSideView(c,l,n,d)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(c,l,a,d)},[PointCloudView.Top]:()=>{synchronizeTopView(c,l,o,t)}};Object.keys(P).forEach(L=>{L!==r&&P[L]()}),V(c),t==null||t.highlightOriginPointCloud(c)};return{topViewAddBox:b,topViewSelectedChanged:I,topViewUpdateBox:z,sideViewUpdateBox:U,backViewUpdateBox:j,pointCloudBoxListUpdated:r=>{o.updatePolygonList(r),t==null||t.generateBoxes(r)},clearAllResult:()=>{s.forEach(r=>{t==null||t.removeObjectByName(r.id)}),t==null||t.render(),g([]),o.pointCloud2dOperation.clearActiveStatus(),o.pointCloud2dOperation.clearResult()},initPointCloud3d:()=>{!t||(t.initPerspectiveCamera(),t.initRenderer(),t.render())},updatePointCloudData:()=>__async(void 0,null,function*(){var r,l,c,d,P,L;if(!(p==null?void 0:p.url)||!t)return;if(actionCreators.SetPointCloudLoading(m,!0),yield t.loadPCDFile(p.url,(r=C==null?void 0:C.radius)!=null?r:DEFAULT_RADIUS),s.forEach(B=>{t==null||t.removeObjectByName(B.id)}),p.result){const B=lbUtils.PointCloudUtils.getBoxParamsFromResultList(p.result),A=lbUtils.PointCloudUtils.getPolygonListFromResultList(p.result);B.forEach(R=>{t==null||t.generateBox(R)}),e.setPointCloudResult(B),e.setPolygonList(A)}else e.setPointCloudResult([]),e.setPolygonList([]);t.updateTopCamera();const D=(c=(l=index.jsonParser(p.result))==null?void 0:l.valid)!=null?c:!0;e.setPointCloudValid(D),(d=e.sideViewInstance)==null||d.clearAllData(),(P=e.backViewInstance)==null||P.clearAllData(),o.updateData(p.url,p.result,{radius:(L=C==null?void 0:C.radius)!=null?L:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(m,!1)})}};exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.transferCanvas2World=transferCanvas2World,exports.usePointCloudViews=usePointCloudViews;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=()=>{const{pointCloudBoxList:e,setPointCloudResult:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=()=>{const{pointCloudBoxList:e,setPointCloudResult:a,topViewInstance:i,backViewInstance:c,sideViewInstance:u,selectedIDs:C,selectedID:r,mainViewInstance:d,setSelectedIDs:v}=React.useContext(PointCloudContext.PointCloudContext),l=React.useMemo(()=>{const t=e.findIndex(o=>o.id===r);if(t>-1)return{info:e[t],index:t}},[r,e]),f=React.useCallback(t=>{(l==null?void 0:l.info)&&(e.splice(l.index,1,___default.default.merge(l.info,t)),a(___default.default.cloneDeep(e)))},[r,e]),b=React.useCallback((t,o)=>{const n=e.findIndex(x=>x.id===o);n>-1&&(e.splice(n,1,___default.default.merge(e[n],t)),a(___default.default.cloneDeep(e)))},[e]),s=React.useCallback(t=>{i==null||i.pointCloud2dOperation.setPolygonValidAndRender(t,!0),u==null||u.pointCloud2dOperation.setPolygonValidAndRender(t,!0),c==null||c.pointCloud2dOperation.setPolygonValidAndRender(t,!0)},[i,u,c]),B=React.useCallback(()=>{if(l==null?void 0:l.info){const{id:t,valid:o=!0}=l.info;f({valid:!o}),s(t)}},[s,l]),I=React.useCallback(t=>{const o=e.find(n=>n.id===t);if(o){const{id:n,valid:x=!0}=o;b({valid:!x},n),s(n)}},[s,e]),p=React.useCallback((t=ESortDirection.ascend)=>{if(!i||C.length>1)return;const{pointCloud2dOperation:o}=i,n=o.switchToNextPolygon(t);n&&v(n)},[i]);return{selectedBox:l,updateSelectedBox:f,changeSelectedBoxValid:B,changeBoxValidByID:I,selectNextBox:p,selectPrevBox:()=>{p(ESortDirection.descend)},deletePointCloudBox:t=>{a(e.filter(o=>o.id!==t)),d==null||d.removeObjectByName(t),d==null||d.render()}}};exports.useSingleBox=useSingleBox;
|
|
@@ -7,6 +7,7 @@ export declare const useSingleBox: () => {
|
|
|
7
7
|
} | undefined;
|
|
8
8
|
updateSelectedBox: (params: Partial<IPointCloudBox>) => void;
|
|
9
9
|
changeSelectedBoxValid: () => void;
|
|
10
|
+
changeBoxValidByID: (id: string) => void;
|
|
10
11
|
selectNextBox: (sort?: any) => void;
|
|
11
12
|
selectPrevBox: () => void;
|
|
12
13
|
deletePointCloudBox: (id: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate180_black=require("../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),React=require("react"),icons=require("@ant-design/icons");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"
|
|
1
|
+
"use strict";var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate180_black=require("../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),React=require("react"),icons=require("@ant-design/icons");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate180={name:"Rotate180",icon:rotate180_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},pointCloudShortCutTable=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"RectPattern"},CopyBox,PasteBox,LeftRotate,RightRotate,PrevBox,NextBox,Rotate180,CopyPrevPage,ChangeBoxInvalid,SelectMulti,SelectAll,index.fullScreen];module.exports=pointCloudShortCutTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{editStepWidth as
|
|
1
|
+
import{editStepWidth as p,sidebarWidth as w,headerHeight as k,footerHeight as v}from"../../data/enums/AnnotationSize.js";import{cKeyCode as E,toolUtils as K}from"@labelbee/lb-annotation";import f,{useState as u,useEffect as P,useMemo as T}from"react";import{connect as x}from"react-redux";import{PageBackward as m,PageForward as g,UpdateRotate as H,CopyBackWordResult as L,UpdateToolInstance as S}from"../../store/annotation/actionCreators.js";import{message as W}from"antd";import{LabelBeeContext as b}from"../../store/ctx.js";const r=E.default,y=f.createContext({width:window.innerWidth,height:window.innerHeight}),C=n=>{const{children:s,dispatch:e,annotation:{skipBeforePageTurning:o}}=n,[a]=u(window.innerWidth),[i]=u(window.innerHeight),d=t=>{var h;if(!!K.hotkeyFilter(t)){if(!t.shiftKey&&!t.ctrlKey){if(t.keyCode===r.A){if(o){o(()=>e(m()));return}e(m())}if(t.keyCode===r.D){if(o){o(()=>e(g()));return}e(g())}t.keyCode===r.R&&e(H()),t.keyCode===r.C&&t.altKey===!0&&e(L())}if(t.shiftKey===!0&&t.ctrlKey===!0&&t.altKey===!0&&t.keyCode===r.C){W.success("DEVELOPMENT TESTING - Switch Last Two Canvas");const l=(h=n.annotation)==null?void 0:h.annotationEngine.switchLastTwoCanvas();if(!l)return;e(S(l))}}};P(()=>(window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}),[n.annotation.annotationEngine,n.annotation.skipBeforePageTurning]);const c=T(()=>({width:a,height:i}),[a,i]);return f.createElement(y.Provider,{value:c},s)},B=x(n=>({annotation:n.annotation}),null,null,{context:b})(C),R=(n,s=!1,e=!1)=>{const{width:o,height:a}=n,i=k+v,d=e?40+i+40:i,c=s?p+w:w;return{width:o-c,height:a-d}};export{B as ViewportProvider,C as ViewportProviderComponent,R 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';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const {\n children,\n dispatch,\n annotation: { skipBeforePageTurning },\n } = props;\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n\n if (!e.shiftKey && !e.ctrlKey) {\n if (e.keyCode === EKeyCode.A) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageBackward()));\n return;\n }\n\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageForward()));\n return;\n }\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine, props.annotation.skipBeforePageTurning]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\nexport const ViewportProvider = connect(\n (state: AppState) => ({\n annotation: state.annotation,\n }),\n null,\n null,\n { context: LabelBeeContext },\n)(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;;
|
|
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 CopyBackWordResult,\n} from '@/store/annotation/actionCreators';\nimport { ISize } from '@/types/main';\nimport { message } from 'antd';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst EKeyCode = cKeyCode.default;\n\nexport const viewportContext = React.createContext<{\n width: number;\n height: number;\n}>({\n width: window.innerWidth,\n height: window.innerHeight,\n});\n\nexport const ViewportProviderComponent = (props: any) => {\n const {\n children,\n dispatch,\n annotation: { skipBeforePageTurning },\n } = props;\n const [width] = useState(window.innerWidth);\n const [height] = useState(window.innerHeight);\n\n const keydown = (e: KeyboardEvent) => {\n if (!toolUtils.hotkeyFilter(e)) {\n return;\n }\n\n if (!e.shiftKey && !e.ctrlKey) {\n if (e.keyCode === EKeyCode.A) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageBackward()));\n return;\n }\n\n dispatch(PageBackward());\n }\n\n if (e.keyCode === EKeyCode.D) {\n if (skipBeforePageTurning) {\n skipBeforePageTurning(() => dispatch(PageForward()));\n return;\n }\n dispatch(PageForward());\n }\n if (e.keyCode === EKeyCode.R) {\n dispatch(UpdateRotate());\n }\n\n if (e.keyCode === EKeyCode.C && e.altKey === true) {\n dispatch(CopyBackWordResult());\n }\n }\n\n /**\n * Hidden Feature\n *\n * User: Software Engineer\n */\n if (\n e.shiftKey === true &&\n e.ctrlKey === true &&\n e.altKey === true &&\n e.keyCode === EKeyCode.C\n ) {\n message.success('DEVELOPMENT TESTING - Switch Last Two Canvas');\n const newInstance = props.annotation?.annotationEngine.switchLastTwoCanvas();\n if (!newInstance) {\n return;\n }\n dispatch(UpdateToolInstance(newInstance));\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keydown);\n\n return () => {\n window.removeEventListener('keydown', keydown);\n };\n }, [props.annotation.annotationEngine, props.annotation.skipBeforePageTurning]);\n\n const size = useMemo(() => ({ width, height }), [width, height]);\n\n return <viewportContext.Provider value={size}>{children}</viewportContext.Provider>;\n};\nexport const ViewportProvider = connect(\n (state: AppState) => ({\n annotation: state.annotation,\n }),\n null,\n null,\n { context: LabelBeeContext },\n)(ViewportProviderComponent);\n\nexport const useViewport = () => {\n const { width, height } = useContext(viewportContext);\n return { width, height };\n};\n\n/**\n * 获取当前 canvas 的大小\n * @param isEdit 是否为编辑模式\n * @param isTips 是否有 tips\n */\nexport const useCanvasViewPort = (isEdit = false, isTips = false) => {\n const { width, height } = useContext(viewportContext);\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n\n/**\n * 解析当前 windowSize 下的 canvasSize\n * @param size\n * @param isEdit\n * @param isTips\n */\nexport const getFormatSize = (windowSize: ISize, isEdit = false, isTips = false) => {\n const { width, height } = windowSize;\n const otherHeight = headerHeight + footerHeight;\n const placeholderHeight = isTips ? 40 + otherHeight + 40 : otherHeight;\n const placeholderWidth = isEdit ? editStepWidth + sidebarWidth : sidebarWidth;\n\n return {\n width: width - placeholderWidth,\n height: height - placeholderHeight,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,WAAW,QAAS,CAAA,OAAA,CAA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AC,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;AAEpC,MAAA,gBAAA,GAAmB,OAC9B,CAAA,CAAC,KAAqB,MAAA;AAAA,EACpB,YAAY,KAAM,CAAA,UAAA;AAAA,CAAA,CAAA,EAEpB,IACA,EAAA,IAAA,EACA,CAAE,OAAA,EAAS,eACX,CAAA,CAAA,CAAA,yBAAA,EAAA;AA8BK,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 p}from"../../utils/dom.js";import{FooterDivider as
|
|
1
|
+
import{getClassName as p}from"../../utils/dom.js";import{FooterDivider as E}from"../../views/MainView/toolFooter/index.js";import{ZoomController as k}from"../../views/MainView/toolFooter/ZoomController/index.js";import{UpSquareOutlined as B,DownSquareOutlined as T}from"@ant-design/icons";import{PointCloudAnnotation as b,cTool as N}from"@labelbee/lb-annotation";import o,{useRef as Z,useState as A,useLayoutEffect as R,useEffect as w}from"react";import{PointCloudContext as z}from"./PointCloudContext.js";import{useRotate as L}from"./hooks/useRotate.js";import{useSingleBox as S}from"./hooks/useSingleBox.js";import{PointCloudContainer as M}from"./PointCloudLayout.js";import{BoxInfos as U,PointCloudValidity as F}from"./PointCloudInfos.js";import{usePolygon as X}from"./hooks/usePolygon.js";import{useZoom as O}from"./hooks/useZoom.js";import{Slider as Y}from"antd";import{aMapStateToProps as _}from"../../store/annotation/map.js";import{connect as q}from"react-redux";import{usePointCloudViews as D}from"./hooks/usePointCloudViews.js";import W from"../../hooks/useSize.js";import{useTranslation as H}from"react-i18next";import{LabelBeeContext as $}from"../../store/ctx.js";const{EPolygonPattern:G}=N,j=(i,s,e=1)=>{const{width:l,height:m}=s,c={x:i.x+l*e/2,y:i.y+m*e/2},d={x:s.width/2,y:s.height/2};return{offsetX:(d.x-c.x)/e,offsetY:-(d.y-c.y)/e}},J=({currentData:i})=>{const{zoom:s,zoomIn:e,zoomOut:l,initialPosition:m}=O(),{selectNextBox:c,selectPrevBox:d}=S(),{updateRotate:u}=L({currentData:i}),x=2,f=()=>{u(-x)},g=()=>{u(x)},h=()=>{u(180)};return o.createElement(o.Fragment,null,o.createElement("span",{onClick:g,className:p("point-cloud","rotate-reserve")}),o.createElement("span",{onClick:f,className:p("point-cloud","rotate")}),o.createElement("span",{onClick:h,className:p("point-cloud","rotate-180")}),o.createElement(E,null),o.createElement(B,{onClick:()=>{d()},className:p("point-cloud","prev")}),o.createElement(T,{onClick:()=>{c()},className:p("point-cloud","next")}),o.createElement(E,null),o.createElement(k,{initialPosition:m,zoomIn:e,zoomOut:l,zoom:s}))},K=({setZAxisLimit:i,zAxisLimit:s})=>o.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},o.createElement(Y,{vertical:!0,step:.5,max:10,min:.5,defaultValue:s,onAfterChange:e=>{i(e)}})),Q=({currentData:i})=>{const s=Z(null),e=o.useContext(z),l=W(s),{setZoom:m}=O(),{addPolygon:c,deletePolygon:d}=X(),{deletePointCloudBox:u,changeBoxValidByID:x}=S(),[f,g]=A(10),{t:h}=H(),C=D();return R(()=>{if(!e.topViewInstance&&s.current&&(i==null?void 0:i.url)&&(i==null?void 0:i.result)){const t={width:s.current.clientWidth,height:s.current.clientHeight},r=new b({container:s.current,size:t,pcdPath:i.url});e.setTopViewInstance(r)}},[i]),w(()=>{if(!l||!e.topViewInstance||!e.sideViewInstance)return;const{pointCloud2dOperation:t}=e.topViewInstance;t.singleOn("polygonCreated",n=>{if(t.pattern===G.Normal||!(i==null?void 0:i.url)){c(n);return}C.topViewAddBox(n,l)}),t.singleOn("deletedObject",({id:n})=>{u(n),d(n)}),t.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),t.singleOn("addSelectedIDs",n=>{e.addSelectedID(n)}),t.singleOn("setSelectedIDs",n=>{e.setSelectedIDs(n)}),t.singleOn("updatePolygonByDrag",({newPolygon:n})=>{var a;(a=C.topViewUpdateBox)==null||a.call(C,n,l)});const r=n=>{x(n)};return t.on("validUpdate",r),()=>{t.unbind("validUpdate",r)}},[e,l,i,C]),w(()=>{if(!(l==null?void 0:l.width)||!e.topViewInstance)return;e.topViewInstance.initSize(l),e.topViewInstance.updatePolygonList(e.pointCloudBoxList);const{topViewInstance:{pointCloudInstance:t,pointCloud2dOperation:r}}=e;r.singleOn("renderZoom",(n,a)=>{const{offsetX:v,offsetY:P}=j(a,l,n);if(t.camera.zoom=n,a){const{x:V,y:I,z:y}=t.initCameraPosition;t.camera.position.set(V+P,I-v,y)}t.camera.updateProjectionMatrix(),t.render(),m(n)}),r.singleOn("dragMove",({currentPos:n,zoom:a})=>{const{offsetX:v,offsetY:P}=j(n,l,a);t.camera.zoom=a;const{x:V,y:I,z:y}=t.initCameraPosition;t.camera.position.set(V+P,I-v,y),t.render()})},[l,e.topViewInstance]),w(()=>{var t,r;(r=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance)==null||r.applyZAxisPoints(f)},[f]),w(()=>{C.topViewSelectedChanged()},[e.selectedIDs]),o.createElement(M,{className:p("point-cloud-container","top-view"),title:h("TopView"),toolbar:o.createElement(J,{currentData:i})},o.createElement("div",{style:{position:"relative",flex:1}},o.createElement("div",{style:{width:"100%",height:"100%"},ref:s}),o.createElement(U,null),o.createElement(K,{zAxisLimit:f,setZAxisLimit:g}),o.createElement(F,null)))};var ee=q(_,null,null,{context:$})(Q);export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudTopView.js","sources":["../../../src/components/pointCloudView/PointCloudTopView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n */\nimport { getClassName } from '@/utils/dom';\nimport { FooterDivider } from '@/views/MainView/toolFooter';\nimport { ZoomController } from '@/views/MainView/toolFooter/ZoomController';\nimport { DownSquareOutlined, UpSquareOutlined } from '@ant-design/icons';\nimport { cTool, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { IPolygonData } from '@labelbee/lb-utils';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { BoxInfos, PointCloudValidity } from './PointCloudInfos';\nimport { usePolygon } from './hooks/usePolygon';\nimport { useZoom } from './hooks/useZoom';\nimport { Slider } from 'antd';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst { EPolygonPattern } = cTool;\n\n/**\n * Get the offset from canvas2d-coordinate to world coordinate (Top View)\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst TopViewToolbar = ({ currentData }: IAnnotationStateProps) => {\n const { zoom, zoomIn, zoomOut, initialPosition } = useZoom();\n const { selectNextBox, selectPrevBox } = useSingleBox();\n const { updateRotate } = useRotate({ currentData });\n\n const ratio = 2;\n\n const clockwiseRotate = () => {\n updateRotate(-ratio);\n };\n const anticlockwiseRotate = () => {\n updateRotate(ratio);\n };\n\n const reverseRotate = () => {\n updateRotate(180);\n };\n\n return (\n <>\n <span\n onClick={anticlockwiseRotate}\n className={getClassName('point-cloud', 'rotate-reserve')}\n />\n <span onClick={clockwiseRotate} className={getClassName('point-cloud', 'rotate')} />\n <span onClick={reverseRotate} className={getClassName('point-cloud', 'rotate-180')} />\n <FooterDivider />\n <UpSquareOutlined\n onClick={() => {\n selectPrevBox();\n }}\n className={getClassName('point-cloud', 'prev')}\n />\n <DownSquareOutlined\n onClick={() => {\n selectNextBox();\n }}\n className={getClassName('point-cloud', 'next')}\n />\n <FooterDivider />\n <ZoomController\n initialPosition={initialPosition}\n zoomIn={zoomIn}\n zoomOut={zoomOut}\n zoom={zoom}\n />\n </>\n );\n};\n\n/**\n * Slider for filtering Z-axis points\n */\nconst ZAxisSlider = ({\n setZAxisLimit,\n zAxisLimit,\n}: {\n setZAxisLimit: (value: number) => void;\n zAxisLimit: number;\n}) => {\n return (\n <div style={{ position: 'absolute', top: 128, right: 8, height: '50%', zIndex: 20 }}>\n <Slider\n vertical\n step={0.5}\n max={10}\n min={0.5}\n defaultValue={zAxisLimit}\n onAfterChange={(v: number) => {\n setZAxisLimit(v);\n }}\n />\n </div>\n );\n};\n\nconst PointCloudTopView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ref = useRef<HTMLDivElement>(null);\n const ptCtx = React.useContext(PointCloudContext);\n const size = useSize(ref);\n const { setZoom } = useZoom();\n\n const { addPolygon, deletePolygon } = usePolygon();\n const { deletePointCloudBox } = useSingleBox();\n const [zAxisLimit, setZAxisLimit] = useState<number>(10);\n const { t } = useTranslation();\n const pointCloudViews = usePointCloudViews();\n\n useLayoutEffect(() => {\n if (ptCtx.topViewInstance) {\n return;\n }\n\n if (ref.current && currentData?.url && currentData?.result) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n pcdPath: currentData.url,\n });\n ptCtx.setTopViewInstance(pointCloudAnnotation);\n }\n }, [currentData]);\n\n useEffect(() => {\n if (!size || !ptCtx.topViewInstance || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopView2dOperation } = ptCtx.topViewInstance;\n\n TopView2dOperation.singleOn('polygonCreated', (polygon: IPolygonData) => {\n if (TopView2dOperation.pattern === EPolygonPattern.Normal || !currentData?.url) {\n addPolygon(polygon);\n return;\n }\n\n pointCloudViews.topViewAddBox(polygon, size);\n });\n\n TopView2dOperation.singleOn('deletedObject', ({ id }) => {\n deletePointCloudBox(id);\n deletePolygon(id);\n });\n\n TopView2dOperation.singleOn('deleteSelectedIDs', () => {\n ptCtx.setSelectedIDs([]);\n });\n\n TopView2dOperation.singleOn('addSelectedIDs', (selectedID: string) => {\n ptCtx.addSelectedID(selectedID);\n });\n\n TopView2dOperation.singleOn('setSelectedIDs', (selectedIDs: string[]) => {\n ptCtx.setSelectedIDs(selectedIDs);\n });\n\n TopView2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon }: any) => {\n pointCloudViews.topViewUpdateBox?.(newPolygon, size);\n });\n }, [ptCtx, size, currentData, pointCloudViews]);\n\n useEffect(() => {\n if (!size?.width || !ptCtx.topViewInstance) {\n return;\n }\n\n // 1. Update Size\n ptCtx.topViewInstance.initSize(size);\n ptCtx.topViewInstance.updatePolygonList(ptCtx.pointCloudBoxList);\n\n const {\n topViewInstance: { pointCloudInstance: pointCloud, pointCloud2dOperation: polygonOperation },\n } = ptCtx;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n polygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n if (currentPos) {\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n }\n\n pointCloud.camera.updateProjectionMatrix();\n pointCloud.render();\n\n setZoom(zoom);\n });\n\n // Synchronized 3d point cloud view displacement operations\n polygonOperation.singleOn('dragMove', ({ currentPos, zoom }) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n pointCloud.render();\n });\n }, [size, ptCtx.topViewInstance]);\n\n useEffect(() => {\n ptCtx.topViewInstance?.pointCloudInstance?.applyZAxisPoints(zAxisLimit);\n }, [zAxisLimit]);\n\n useEffect(() => {\n pointCloudViews.topViewSelectedChanged();\n }, [ptCtx.selectedIDs]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'top-view')}\n title={t('TopView')}\n toolbar={<TopViewToolbar currentData={currentData} />}\n >\n <div style={{ position: 'relative', flex: 1 }}>\n <div style={{ width: '100%', height: '100%' }} ref={ref} />\n\n <BoxInfos />\n <ZAxisSlider zAxisLimit={zAxisLimit} setZAxisLimit={setZAxisLimit} />\n <PointCloudValidity />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudTopView,\n);\n"],"names":[],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C,WAAD,EAAA;AAAA,IAAa,UAAA;AAAA,IAAwB,aAAA;AAAA,GAAA,CAAA,sCACpC,kBAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAMR,0BAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,iBAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"PointCloudTopView.js","sources":["../../../src/components/pointCloudView/PointCloudTopView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n */\nimport { getClassName } from '@/utils/dom';\nimport { FooterDivider } from '@/views/MainView/toolFooter';\nimport { ZoomController } from '@/views/MainView/toolFooter/ZoomController';\nimport { DownSquareOutlined, UpSquareOutlined } from '@ant-design/icons';\nimport { cTool, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { IPolygonData } from '@labelbee/lb-utils';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { BoxInfos, PointCloudValidity } from './PointCloudInfos';\nimport { usePolygon } from './hooks/usePolygon';\nimport { useZoom } from './hooks/useZoom';\nimport { Slider } from 'antd';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst { EPolygonPattern } = cTool;\n\n/**\n * Get the offset from canvas2d-coordinate to world coordinate (Top View)\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst TopViewToolbar = ({ currentData }: IAnnotationStateProps) => {\n const { zoom, zoomIn, zoomOut, initialPosition } = useZoom();\n const { selectNextBox, selectPrevBox } = useSingleBox();\n const { updateRotate } = useRotate({ currentData });\n\n const ratio = 2;\n\n const clockwiseRotate = () => {\n updateRotate(-ratio);\n };\n const anticlockwiseRotate = () => {\n updateRotate(ratio);\n };\n\n const reverseRotate = () => {\n updateRotate(180);\n };\n\n return (\n <>\n <span\n onClick={anticlockwiseRotate}\n className={getClassName('point-cloud', 'rotate-reserve')}\n />\n <span onClick={clockwiseRotate} className={getClassName('point-cloud', 'rotate')} />\n <span onClick={reverseRotate} className={getClassName('point-cloud', 'rotate-180')} />\n <FooterDivider />\n <UpSquareOutlined\n onClick={() => {\n selectPrevBox();\n }}\n className={getClassName('point-cloud', 'prev')}\n />\n <DownSquareOutlined\n onClick={() => {\n selectNextBox();\n }}\n className={getClassName('point-cloud', 'next')}\n />\n <FooterDivider />\n <ZoomController\n initialPosition={initialPosition}\n zoomIn={zoomIn}\n zoomOut={zoomOut}\n zoom={zoom}\n />\n </>\n );\n};\n\n/**\n * Slider for filtering Z-axis points\n */\nconst ZAxisSlider = ({\n setZAxisLimit,\n zAxisLimit,\n}: {\n setZAxisLimit: (value: number) => void;\n zAxisLimit: number;\n}) => {\n return (\n <div style={{ position: 'absolute', top: 128, right: 8, height: '50%', zIndex: 20 }}>\n <Slider\n vertical\n step={0.5}\n max={10}\n min={0.5}\n defaultValue={zAxisLimit}\n onAfterChange={(v: number) => {\n setZAxisLimit(v);\n }}\n />\n </div>\n );\n};\n\nconst PointCloudTopView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ref = useRef<HTMLDivElement>(null);\n const ptCtx = React.useContext(PointCloudContext);\n const size = useSize(ref);\n const { setZoom } = useZoom();\n\n const { addPolygon, deletePolygon } = usePolygon();\n const { deletePointCloudBox, changeBoxValidByID } = useSingleBox();\n const [zAxisLimit, setZAxisLimit] = useState<number>(10);\n const { t } = useTranslation();\n const pointCloudViews = usePointCloudViews();\n\n useLayoutEffect(() => {\n if (ptCtx.topViewInstance) {\n return;\n }\n\n if (ref.current && currentData?.url && currentData?.result) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n pcdPath: currentData.url,\n });\n ptCtx.setTopViewInstance(pointCloudAnnotation);\n }\n }, [currentData]);\n\n useEffect(() => {\n if (!size || !ptCtx.topViewInstance || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopView2dOperation } = ptCtx.topViewInstance;\n\n TopView2dOperation.singleOn('polygonCreated', (polygon: IPolygonData) => {\n if (TopView2dOperation.pattern === EPolygonPattern.Normal || !currentData?.url) {\n addPolygon(polygon);\n return;\n }\n\n pointCloudViews.topViewAddBox(polygon, size);\n });\n\n TopView2dOperation.singleOn('deletedObject', ({ id }) => {\n deletePointCloudBox(id);\n deletePolygon(id);\n });\n\n TopView2dOperation.singleOn('deleteSelectedIDs', () => {\n ptCtx.setSelectedIDs([]);\n });\n\n TopView2dOperation.singleOn('addSelectedIDs', (selectedID: string) => {\n ptCtx.addSelectedID(selectedID);\n });\n\n TopView2dOperation.singleOn('setSelectedIDs', (selectedIDs: string[]) => {\n ptCtx.setSelectedIDs(selectedIDs);\n });\n\n TopView2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon }: any) => {\n pointCloudViews.topViewUpdateBox?.(newPolygon, size);\n });\n\n const validUpdate = (id: string) => {\n changeBoxValidByID(id);\n };\n\n TopView2dOperation.on('validUpdate', validUpdate);\n\n return () => {\n TopView2dOperation.unbind('validUpdate', validUpdate);\n };\n }, [ptCtx, size, currentData, pointCloudViews]);\n\n useEffect(() => {\n if (!size?.width || !ptCtx.topViewInstance) {\n return;\n }\n\n // 1. Update Size\n ptCtx.topViewInstance.initSize(size);\n ptCtx.topViewInstance.updatePolygonList(ptCtx.pointCloudBoxList);\n\n const {\n topViewInstance: { pointCloudInstance: pointCloud, pointCloud2dOperation: polygonOperation },\n } = ptCtx;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n polygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n if (currentPos) {\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n }\n\n pointCloud.camera.updateProjectionMatrix();\n pointCloud.render();\n\n setZoom(zoom);\n });\n\n // Synchronized 3d point cloud view displacement operations\n polygonOperation.singleOn('dragMove', ({ currentPos, zoom }) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n pointCloud.render();\n });\n }, [size, ptCtx.topViewInstance]);\n\n useEffect(() => {\n ptCtx.topViewInstance?.pointCloudInstance?.applyZAxisPoints(zAxisLimit);\n }, [zAxisLimit]);\n\n useEffect(() => {\n pointCloudViews.topViewSelectedChanged();\n }, [ptCtx.selectedIDs]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'top-view')}\n title={t('TopView')}\n toolbar={<TopViewToolbar currentData={currentData} />}\n >\n <div style={{ position: 'relative', flex: 1 }}>\n <div style={{ width: '100%', height: '100%' }} ref={ref} />\n\n <BoxInfos />\n <ZAxisSlider zAxisLimit={zAxisLimit} setZAxisLimit={setZAxisLimit} />\n <PointCloudValidity />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudTopView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAS5B,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,CAAA,EAAG,KAAK,KAAQ,GAAA,CAAA;AAAA,IAChB,CAAA,EAAG,KAAK,MAAS,GAAA,CAAA;AAAA,GAAA,CAAA;AAGnB,EAAO,OAAA;AAAA,IACL,OAAU,EAAA,CAAA,gBAAA,CAAiB,CAAI,GAAA,iBAAA,CAAkB,CAAK,IAAA,IAAA;AAAA,IACtD,OAAS,EAAA,EAAmB,gBAAA,CAAA,CAAA,GAAI,kBAAkB,CAAK,CAAA,GAAA,IAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAI3D,MAAM,cAAA,GAAiB,CAAC,CAAE,WAAyC,CAAA,KAAA;AACjE,EAAA,MAAM,CAAE,IAAA,EAAM,MAAQ,EAAA,OAAA,EAAS,eAAoB,CAAA,GAAA,OAAA,EAAA,CAAA;AACnD,EAAM,MAAA,CAAE,eAAe,aAAkB,CAAA,GAAA,YAAA,EAAA,CAAA;AACzC,EAAM,M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AAO,CAAE,CAAA,SAAA,CAAA;AAAA,IACT,OAAA,sCAAU,cAAD,EAAA;AAAA,MAAgB,WAAA;AAAA,KAAA,CAAA;AAAA,GAAA,sCAExB,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,CAAE,QAAU,EAAA,UAAA,EAAY,IAAM,EAAA,CAAA,CAAA;AAAA,GAAA,sCACvC,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,CAAE,KAAO,EAAA,MAAA,EAAQ,MAAQ,EAAA,MAAA,CAAA;AAAA,IAAU,GAAA;AAAA,GAAA,CAAA,kBAE9C,KAAA,CAAA,aAAA,CAAA,QAAA,EAAD,IACA,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAD,EAAA;AAAA,IAAa,UAAA;AAAA,IAAwB,aAAA;AAAA,GAAA,CAAA,sCACpC,kBAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAMR,0BAAe,QAAQ,gBAAkB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC9D,CAAA,CAAA,CAAA,iBAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MathUtils as
|
|
1
|
+
import{MathUtils as y}from"@labelbee/lb-annotation";import{EPerspectiveView as U,PointCloudUtils as T}from"@labelbee/lb-utils";import{useContext as $}from"react";import{PointCloudContext as tt}from"../PointCloudContext.js";import{useSingleBox as k}from"./useSingleBox.js";import ot from"lodash";import{useSelector as et,useDispatch as nt}from"../../../store/ctx.js";import it from"../../../utils/StepUtils.js";import{jsonParser as E}from"../../../utils/index.js";import{SetPointCloudLoading as F}from"../../../store/annotation/actionCreators.js";import{message as st}from"antd";import{useTranslation as rt}from"react-i18next";var lt=Object.defineProperty,dt=Object.defineProperties,at=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,Z=(e,o,n)=>o in e?lt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,M=(e,o)=>{for(var n in o||(o={}))ct.call(o,n)&&Z(e,n,o[n]);if(N)for(var n of N(o))ut.call(o,n)&&Z(e,n,o[n]);return e},pt=(e,o)=>dt(e,at(o)),mt=(e,o,n)=>new Promise((d,t)=>{var i=r=>{try{u(n.next(r))}catch(g){t(g)}},m=r=>{try{u(n.throw(r))}catch(g){t(g)}},u=r=>r.done?d(r.value):Promise.resolve(r.value).then(i,m);u((n=n.apply(e,o)).next())});const b=5,W=90,O={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},H=(e,o)=>{const{width:n,height:d}=o,{x:t,y:i}=e;return{x:-i+d/2,y:-(t-n/2)}},z=(e,o,n,d,t)=>{const[i,m,u,r]=e.pointList.map(v=>H(v,o)),g=y.getLineCenterPoint([i,u]),h=y.getLineLength(i,m),p=y.getLineLength(m,u),f=y.getRadiusFromQuadrangle(e.pointList);let B=0,x=1,_={};if(n){const v=n.getSensesPointZAxisInPolygon([i,m,u,r]);B=(v.maxZ+v.minZ)/2,x=v.maxZ-v.minZ,_={count:v.zCount}}d&&(B=d.center.z,x=d.depth);const P=M({center:{x:g.x,y:g.y,z:B},width:p,height:h,depth:x,rotation:f,id:e.id,attribute:"",valid:!0},_);return t&&Object.assign(P,t),P},ft=(e,o,n,d)=>{const[t,i,m]=e.pointList,[u,r,g]=o.pointList,h=y.getLineCenterPoint([t,m]),p=y.getLineCenterPoint([u,g]),f={x:h.x-p.x,y:h.y-p.y},B=Math.cos(n.rotation),x=Math.sin(n.rotation),_={x:f.x,y:f.x*x+f.y*B,z:h.y-p.y},P=y.getLineLength(t,i),v=y.getLineLength(u,r),V=P-v,j=y.getLineLength(i,m),A=y.getLineLength(r,g),S=j-A,{newBoxParams:R}=d.getNewBoxBySideUpdate(_,S,V,n);return R},G=(e,o,n,d)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:i}=n;i.loadPCDFileByBox(d,e,{width:b,depth:b});const{cameraPositionVector:m}=i.updateOrthoCamera(e,U.Left);i.setInitCameraPosition(m);const{polygon2d:u,zoom:r}=i.getBoxSidePolygon2DCoordinate(e);i.camera.zoom=r,i.camera.updateProjectionMatrix(),i.render(),t.initPosition(),t.zoomChangeOnCenter(r),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:u,textAttribute:"",isRect:!0}],o.id)},Q=(e,o,n,d)=>{if(!n)return;const{pointCloud2dOperation:t,pointCloudInstance:i}=n;i.loadPCDFileByBox(d,e,{height:b,depth:b});const{cameraPositionVector:m}=i.updateOrthoCamera(e,U.Back);i.setInitCameraPosition(m);const{polygon2d:u,zoom:r}=i.getBoxBackPolygon2DCoordinate(e);i.camera.zoom=r,i.camera.updateProjectionMatrix(),i.render(),t.initPosition(),t.zoomChangeOnCenter(r),t.setResultAndSelectedID([{id:o.id,valid:e.valid,pointList:u,textAttribute:"",isRect:!0}],o.id)},q=(e,o,n,d)=>{var t;if(!n||!d)return;d.generateBox(e,o.id),d.updateCameraByBox(e,U.Top),d.render();const{pointCloud2dOperation:i,pointCloudInstance:m}=n,{polygon2d:u}=m.getBoxTopPolygon2DCoordinate(e),r=[...i.polygonList],g=r.find(h=>h.id===o.id);g?g.pointList=u:r.push({id:o.id,pointList:u,textAttribute:"",isRect:!0,valid:(t=e.valid)!=null?t:!0}),i.setResultAndSelectedID(r,o.id)},gt=()=>{const e=$(tt),{topViewInstance:o,sideViewInstance:n,backViewInstance:d,mainViewInstance:t,addPointCloudBox:i,setSelectedIDs:m,selectedIDs:u,pointCloudBoxList:r,setPointCloudResult:g}=e,{updateSelectedBox:h}=k(),{currentData:p,config:f}=et(s=>{const{stepList:l,step:c,imgList:a,imgIndex:C}=s.annotation;return{currentData:a[C],config:E(it.getCurrentStepInfo(c,l).config)}}),B=nt(),{selectedBox:x}=k(),{t:_}=rt(),P=x==null?void 0:x.info;if(!o||!n)return{topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{}};const{pointCloudInstance:v}=o,V=s=>{t==null||t.generateBox(s),t==null||t.controls.update(),t==null||t.render()},j=(s,l)=>{var c,a,C;const L=z(s,l,v,void 0,{attribute:(C=(a=(c=f==null?void 0:f.attributeList)==null?void 0:c[0])==null?void 0:a.value)!=null?C:""}),I=o==null?void 0:o.pointCloud2dOperation,w=L;if((f==null?void 0:f.lowerLimitPointsNumInBox)&&typeof L.count=="number"&&L.count<f.lowerLimitPointsNumInBox){st.info(_("LowerLimitPointsNumInBox",{num:f.lowerLimitPointsNumInBox})),I.deletePolygon(L.id);return}I.setSelectedIDs([s.id]),m(w.id),D(O.Top,s,w),i(w)},A=()=>{const s=x==null?void 0:x.info,l=o==null?void 0:o.pointCloud2dOperation;if(l.setSelectedIDs(u),!s||!l)return;const c=l.selectedPolygon;D(O.Top,c,s)},S=(s,l,c)=>{if(P){let a=ft(s,l,P,n.pointCloudInstance);if(t){const{count:C}=t.getSensesPointZAxisInPolygon(t.getCuboidFromPointCloudBox(a).polygonPointList,[a.center.z-a.depth/2,a.center.z+a.depth/2]);a=pt(M({},a),{count:C})}h(a),D(c,s,a)}},R=(s,l)=>{S(s,l,O.Side)},J=(s,l)=>{S(s,l,O.Back)},K=(s,l)=>{if(P){const c=z(s,l,o.pointCloudInstance,P);Object.assign(P,ot.pickBy(c,(a,C)=>["width","height","x","y"])),h(c),D(O.Top,s,P)}},D=(s,l,c)=>{const a=p==null?void 0:p.url,C={[O.Side]:()=>{G(c,l,n,a)},[O.Back]:()=>{d&&Q(c,l,d,a)},[O.Top]:()=>{q(c,l,o,t)}};Object.keys(C).forEach(L=>{L!==s&&C[L]()}),V(c),t==null||t.highlightOriginPointCloud(c)};return{topViewAddBox:j,topViewSelectedChanged:A,topViewUpdateBox:K,sideViewUpdateBox:R,backViewUpdateBox:J,pointCloudBoxListUpdated:s=>{o.updatePolygonList(s),t==null||t.generateBoxes(s)},clearAllResult:()=>{r.forEach(s=>{t==null||t.removeObjectByName(s.id)}),t==null||t.render(),g([]),o.pointCloud2dOperation.clearActiveStatus(),o.pointCloud2dOperation.clearResult()},initPointCloud3d:()=>{!t||(t.initPerspectiveCamera(),t.initRenderer(),t.render())},updatePointCloudData:()=>mt(void 0,null,function*(){var s,l,c,a,C,L;if(!(p==null?void 0:p.url)||!t)return;if(F(B,!0),yield t.loadPCDFile(p.url,(s=f==null?void 0:f.radius)!=null?s:W),r.forEach(w=>{t==null||t.removeObjectByName(w.id)}),p.result){const w=T.getBoxParamsFromResultList(p.result),X=T.getPolygonListFromResultList(p.result);w.forEach(Y=>{t==null||t.generateBox(Y)}),e.setPointCloudResult(w),e.setPolygonList(X)}else e.setPointCloudResult([]),e.setPolygonList([]);t.updateTopCamera();const I=(c=(l=E(p.result))==null?void 0:l.valid)!=null?c:!0;e.setPointCloudValid(I),(a=e.sideViewInstance)==null||a.clearAllData(),(C=e.backViewInstance)==null||C.clearAllData(),o.updateData(p.url,p.result,{radius:(L=f==null?void 0:f.radius)!=null?L:W}),F(B,!1)})}};export{Q as synchronizeBackView,G as synchronizeSideView,q as synchronizeTopView,z as topViewPolygon2PointCloud,H as transferCanvas2World,gt as usePointCloudViews};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePointCloudViews.js","sources":["../../../../src/components/pointCloudView/hooks/usePointCloudViews.ts"],"sourcesContent":["/**\n * @file Point cloud interface for crud\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @createdate 2022-08-17\n */\nimport { PointCloudAnnotation, PointCloud, MathUtils } from '@labelbee/lb-annotation';\nimport {\n IPointCloudBox,\n EPerspectiveView,\n PointCloudUtils,\n IPolygonPoint,\n} from '@labelbee/lb-utils';\nimport { useContext } from 'react';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { useSingleBox } from './useSingleBox';\nimport { ISize } from '@/types/main';\nimport _ from 'lodash';\nimport { useDispatch, useSelector } from '@/store/ctx';\nimport { AppState } from '@/store';\nimport StepUtils from '@/utils/StepUtils';\nimport { jsonParser } from '@/utils';\nimport { SetPointCloudLoading } from '@/store/annotation/actionCreators';\nimport { message } from 'antd';\nimport { useTranslation } from 'react-i18next';\n\nconst DEFAULT_SCOPE = 5;\nconst DEFAULT_RADIUS = 90;\n\nconst PointCloudView = {\n '3D': '3D',\n Top: 'Top',\n Side: 'Side',\n Back: 'Back',\n};\n\n/**\n * Get the coordinate from canvas2d-coordinate to world coordinate\n */\nexport const transferCanvas2World = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n) => {\n const { width: w, height: h } = size;\n const { x, y } = currentPos;\n\n // x-Axis is the Positive Direction, so the x-coordinates need to be swapped with the y-coordinates\n return {\n x: -y + h / 2,\n y: -(x - w / 2),\n };\n};\n\nexport const topViewPolygon2PointCloud = (\n newPolygon: any,\n size: ISize,\n pointCloud?: PointCloud,\n selectedPointCloudBox?: IPointCloudBox,\n defaultValue?: { [v: string]: any },\n) => {\n const [point1, point2, point3, point4] = newPolygon.pointList.map((v: any) =>\n transferCanvas2World(v, size),\n );\n\n const centerPoint = MathUtils.getLineCenterPoint([point1, point3]);\n const height = MathUtils.getLineLength(point1, point2);\n const width = MathUtils.getLineLength(point2, point3);\n const rotation = MathUtils.getRadiusFromQuadrangle(newPolygon.pointList);\n let z = 0;\n let depth = 1;\n let extraData = {};\n\n // Init PointCloud Data\n if (pointCloud) {\n const zInfo = pointCloud.getSensesPointZAxisInPolygon([point1, point2, point3, point4]);\n z = (zInfo.maxZ + zInfo.minZ) / 2;\n depth = zInfo.maxZ - zInfo.minZ;\n extraData = {\n count: zInfo.zCount,\n };\n }\n\n if (selectedPointCloudBox) {\n z = selectedPointCloudBox.center.z;\n depth = selectedPointCloudBox.depth;\n }\n\n /** TrackID will append before it pushed */\n const boxParams: Omit<IPointCloudBox, 'trackID'> = {\n center: {\n x: centerPoint.x,\n y: centerPoint.y,\n z,\n },\n width,\n height,\n depth,\n rotation: rotation,\n id: newPolygon.id,\n attribute: '',\n valid: true,\n ...extraData,\n };\n\n if (defaultValue) {\n Object.assign(boxParams, defaultValue);\n }\n\n return boxParams;\n};\n\nconst sideViewPolygon2PointCloud = (\n newPolygon: any,\n originPolygon: any,\n selectedPointCloudBox: IPointCloudBox,\n pointCloudInstance: PointCloud,\n) => {\n const [point1, point2, point3] = newPolygon.pointList;\n const [op1, op2, op3] = originPolygon.pointList;\n\n // 2D centerPoint => 3D x & z\n const newCenterPoint = MathUtils.getLineCenterPoint([point1, point3]);\n const oldCenterPoint = MathUtils.getLineCenterPoint([op1, op3]);\n\n const offset = {\n x: newCenterPoint.x - oldCenterPoint.x,\n y: newCenterPoint.y - oldCenterPoint.y,\n };\n\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n\n const offsetCenterPoint = {\n x: offset.x,\n y: offset.x * sin + offset.y * cos,\n z: newCenterPoint.y - oldCenterPoint.y,\n };\n\n // 2D height => 3D depth\n const height = MathUtils.getLineLength(point1, point2);\n const oldHeight = MathUtils.getLineLength(op1, op2);\n const offsetHeight = height - oldHeight; // 3D depth\n\n // 2D width => 3D width\n const width = MathUtils.getLineLength(point2, point3);\n const oldWidth = MathUtils.getLineLength(op2, op3);\n const offsetWidth = width - oldWidth; // 3D width\n\n const { newBoxParams } = pointCloudInstance.getNewBoxBySideUpdate(\n offsetCenterPoint,\n offsetWidth,\n offsetHeight,\n selectedPointCloudBox,\n );\n\n return newBoxParams;\n};\n\n/**\n * NewBox synchronize sideView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeSideView = (\n boxParams: IPointCloudBox,\n newPolygon: any,\n sideViewInstance: PointCloudAnnotation | undefined,\n url: string,\n) => {\n if (!sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation, pointCloudInstance } = sideViewInstance;\n\n // Create PointCloud\n pointCloudInstance.loadPCDFileByBox(url, boxParams, {\n width: DEFAULT_SCOPE,\n depth: DEFAULT_SCOPE,\n });\n const { cameraPositionVector } = pointCloudInstance.updateOrthoCamera(\n boxParams,\n EPerspectiveView.Left,\n );\n\n pointCloudInstance.setInitCameraPosition(cameraPositionVector);\n\n // Create Draw Polygon\n const { polygon2d, zoom } = pointCloudInstance.getBoxSidePolygon2DCoordinate(boxParams);\n\n // Synchronize SidePointCloud zoom with PointCloud2dOperation\n pointCloudInstance.camera.zoom = zoom;\n pointCloudInstance.camera.updateProjectionMatrix();\n pointCloudInstance.render();\n\n // Update PolygonView to default zoom and currentPos.\n pointCloud2dOperation.initPosition();\n pointCloud2dOperation.zoomChangeOnCenter(zoom);\n pointCloud2dOperation.setResultAndSelectedID(\n [\n {\n id: newPolygon.id,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n },\n ],\n newPolygon.id,\n );\n};\n\n/**\n * NewBox synchronize backView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeBackView = (\n boxParams: IPointCloudBox,\n newPolygon: any,\n BackViewInstance: PointCloudAnnotation,\n url: string,\n) => {\n if (!BackViewInstance) {\n return;\n }\n\n const {\n pointCloud2dOperation: backPointCloudPolygonOperation,\n pointCloudInstance: backPointCloud,\n } = BackViewInstance;\n\n // Create PointCloud\n backPointCloud.loadPCDFileByBox(url, boxParams, { height: DEFAULT_SCOPE, depth: DEFAULT_SCOPE });\n const { cameraPositionVector } = backPointCloud.updateOrthoCamera(\n boxParams,\n EPerspectiveView.Back,\n );\n\n backPointCloud.setInitCameraPosition(cameraPositionVector);\n\n // Create Draw Polygon\n const { polygon2d, zoom } = backPointCloud.getBoxBackPolygon2DCoordinate(boxParams);\n\n // Synchronize SidePointCloud zoom with PointCloud2dOperation\n backPointCloud.camera.zoom = zoom;\n backPointCloud.camera.updateProjectionMatrix();\n backPointCloud.render();\n\n // Update PolygonView to default zoom and currentPos.\n backPointCloudPolygonOperation.initPosition();\n backPointCloudPolygonOperation.zoomChangeOnCenter(zoom);\n backPointCloudPolygonOperation.setResultAndSelectedID(\n [\n {\n id: newPolygon.id,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n },\n ],\n newPolygon.id,\n );\n};\n\n/**\n * NewBox synchronize TopView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeTopView = (\n newBoxParams: IPointCloudBox,\n newPolygon: any,\n topViewInstance?: PointCloudAnnotation,\n mainViewInstance?: PointCloud,\n) => {\n if (!topViewInstance || !mainViewInstance) {\n return;\n }\n\n // Control the 3D view data to create box\n mainViewInstance.generateBox(newBoxParams, newPolygon.id);\n mainViewInstance.updateCameraByBox(newBoxParams, EPerspectiveView.Top);\n mainViewInstance.render();\n\n const { pointCloud2dOperation, pointCloudInstance } = topViewInstance;\n\n const { polygon2d } = pointCloudInstance.getBoxTopPolygon2DCoordinate(newBoxParams);\n\n const newPolygonList = [...pointCloud2dOperation.polygonList];\n const oldPolygon = newPolygonList.find((v) => v.id === newPolygon.id);\n if (oldPolygon) {\n oldPolygon.pointList = polygon2d;\n } else {\n newPolygonList.push({\n id: newPolygon.id,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n });\n }\n\n pointCloud2dOperation.setResultAndSelectedID(newPolygonList, newPolygon.id);\n};\n\nexport const usePointCloudViews = () => {\n const ptCtx = useContext(PointCloudContext);\n const {\n topViewInstance,\n sideViewInstance,\n backViewInstance,\n mainViewInstance,\n addPointCloudBox,\n setSelectedIDs,\n selectedIDs,\n pointCloudBoxList,\n setPointCloudResult,\n } = ptCtx;\n const { updateSelectedBox } = useSingleBox();\n const { currentData, config } = useSelector((state: AppState) => {\n const { stepList, step, imgList, imgIndex } = state.annotation;\n\n return {\n currentData: imgList[imgIndex],\n config: jsonParser(StepUtils.getCurrentStepInfo(step, stepList).config),\n };\n });\n const dispatch = useDispatch();\n const { selectedBox } = useSingleBox();\n const { t } = useTranslation();\n\n const selectedPointCloudBox = selectedBox?.info;\n\n if (!topViewInstance || !sideViewInstance) {\n return {\n topViewAddBox: () => {},\n topViewSelectedChanged: () => {},\n sideViewUpdateBox: () => {},\n };\n }\n\n const { pointCloudInstance: topViewPointCloud } = topViewInstance;\n\n // Temporarily hide\n // const getNextTrackID = () => {\n // if (pointCloudBoxList.length > 0) {\n // const sortedPcList = pointCloudBoxList.sort((a, b) => a.trackID - b.trackID);\n // return sortedPcList.slice(-1)[0]?.trackID + 1;\n // }\n\n // return 1;\n // };\n\n const mainViewGenBox = (boxParams: IPointCloudBox) => {\n mainViewInstance?.generateBox(boxParams);\n mainViewInstance?.controls.update();\n mainViewInstance?.render();\n };\n\n /** Top-view create box from 2D */\n const topViewAddBox = (newPolygon: any, size: ISize) => {\n const newParams = topViewPolygon2PointCloud(newPolygon, size, topViewPointCloud, undefined, {\n attribute: config?.attributeList?.[0]?.value ?? '',\n });\n const polygonOperation = topViewInstance?.pointCloud2dOperation;\n\n // Temporarily hide\n // const boxParams: IPointCloudBox = Object.assign(newParams, {\n // trackID: getNextTrackID(),\n // });\n const boxParams: IPointCloudBox = newParams;\n\n // If the count is less than lowerLimitPointsNumInBox, needs to delete it\n if (\n config?.lowerLimitPointsNumInBox &&\n typeof newParams.count === 'number' &&\n newParams.count < config.lowerLimitPointsNumInBox\n ) {\n message.info(t('LowerLimitPointsNumInBox', { num: config.lowerLimitPointsNumInBox }));\n polygonOperation.deletePolygon(newParams.id);\n return;\n }\n\n polygonOperation.setSelectedIDs([newPolygon.id]);\n setSelectedIDs(boxParams.id);\n syncPointCloudViews(PointCloudView.Top, newPolygon, boxParams);\n addPointCloudBox(boxParams);\n };\n\n /** Top-view selected changed and render to other view */\n const topViewSelectedChanged = () => {\n const boxParams = selectedBox?.info;\n const polygonOperation = topViewInstance?.pointCloud2dOperation;\n\n polygonOperation.setSelectedIDs(selectedIDs);\n if (!boxParams || !polygonOperation) {\n return;\n }\n\n const polygon = polygonOperation.selectedPolygon;\n syncPointCloudViews(PointCloudView.Top, polygon, boxParams);\n };\n\n /**\n * Update box from view\n * @param newPolygon\n * @param originPolygon\n * @param fromView Back or Side\n */\n const viewUpdateBox = (newPolygon: any, originPolygon: any, fromView: string) => {\n if (selectedPointCloudBox) {\n let newBoxParams = sideViewPolygon2PointCloud(\n newPolygon,\n originPolygon,\n selectedPointCloudBox,\n sideViewInstance.pointCloudInstance,\n );\n // Update count\n if (mainViewInstance) {\n const { count } = mainViewInstance.getSensesPointZAxisInPolygon(\n mainViewInstance.getCuboidFromPointCloudBox(newBoxParams)\n .polygonPointList as IPolygonPoint[],\n [\n newBoxParams.center.z - newBoxParams.depth / 2,\n newBoxParams.center.z + newBoxParams.depth / 2,\n ],\n );\n\n newBoxParams = {\n ...newBoxParams,\n count,\n };\n }\n\n updateSelectedBox(newBoxParams);\n syncPointCloudViews(fromView, newPolygon, newBoxParams);\n }\n };\n\n const sideViewUpdateBox = (newPolygon: any, originPolygon: any) => {\n viewUpdateBox(newPolygon, originPolygon, PointCloudView.Side);\n };\n\n const backViewUpdateBox = (newPolygon: any, originPolygon: any) => {\n viewUpdateBox(newPolygon, originPolygon, PointCloudView.Back);\n };\n\n /**\n * Top view box updated and sync views\n * @param polygon\n * @param size\n */\n const topViewUpdateBox = (polygon: any, size: ISize) => {\n if (selectedPointCloudBox) {\n const newBoxParams = topViewPolygon2PointCloud(\n polygon,\n size,\n topViewInstance.pointCloudInstance,\n selectedPointCloudBox,\n );\n\n Object.assign(\n selectedPointCloudBox,\n _.pickBy(newBoxParams, (v, k) => ['width', 'height', 'x', 'y']),\n );\n\n updateSelectedBox(newBoxParams);\n syncPointCloudViews(PointCloudView.Top, polygon, selectedPointCloudBox);\n }\n };\n\n /**\n * Sync views' data from omit view, regenerate and highlight box on 3D-view\n * @param omitView\n * @param polygon\n * @param boxParams\n */\n const syncPointCloudViews = (omitView: string, polygon: any, boxParams: IPointCloudBox) => {\n const dataUrl = currentData?.url;\n\n const viewToBeUpdated = {\n [PointCloudView.Side]: () => {\n synchronizeSideView(boxParams, polygon, sideViewInstance, dataUrl);\n },\n [PointCloudView.Back]: () => {\n if (backViewInstance) {\n synchronizeBackView(boxParams, polygon, backViewInstance, dataUrl);\n }\n },\n [PointCloudView.Top]: () => {\n synchronizeTopView(boxParams, polygon, topViewInstance, mainViewInstance);\n },\n };\n\n Object.keys(viewToBeUpdated).forEach((key) => {\n if (key !== omitView) {\n viewToBeUpdated[key]();\n }\n });\n mainViewGenBox(boxParams);\n mainViewInstance?.highlightOriginPointCloud(boxParams);\n };\n\n const pointCloudBoxListUpdated = (newBoxes: IPointCloudBox[]) => {\n topViewInstance.updatePolygonList(newBoxes);\n mainViewInstance?.generateBoxes(newBoxes);\n };\n\n const clearAllResult = () => {\n // Clear All PointView Data\n pointCloudBoxList.forEach((v) => {\n mainViewInstance?.removeObjectByName(v.id);\n });\n mainViewInstance?.render();\n\n setPointCloudResult([]);\n topViewInstance.pointCloud2dOperation.clearActiveStatus();\n topViewInstance.pointCloud2dOperation.clearResult();\n };\n\n const initPointCloud3d = () => {\n if (!mainViewInstance) {\n return;\n }\n\n mainViewInstance.initPerspectiveCamera();\n mainViewInstance.initRenderer();\n mainViewInstance.render();\n };\n\n /**\n * Update the data of pointCloudView when the page change.\n * @returns\n */\n const updatePointCloudData = async () => {\n if (!currentData?.url || !mainViewInstance) {\n return;\n }\n\n SetPointCloudLoading(dispatch, true);\n await mainViewInstance.loadPCDFile(currentData.url, config?.radius ?? DEFAULT_RADIUS);\n\n // Clear All Data\n pointCloudBoxList.forEach((v) => {\n mainViewInstance?.removeObjectByName(v.id);\n });\n\n if (currentData.result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n const polygonList = PointCloudUtils.getPolygonListFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n mainViewInstance?.generateBox(v);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n ptCtx.setPolygonList(polygonList);\n } else {\n ptCtx.setPointCloudResult([]);\n ptCtx.setPolygonList([]);\n }\n\n mainViewInstance.updateTopCamera();\n\n const valid = jsonParser(currentData.result)?.valid ?? true;\n ptCtx.setPointCloudValid(valid);\n\n // Clear other view data during initialization\n ptCtx.sideViewInstance?.clearAllData();\n ptCtx.backViewInstance?.clearAllData();\n\n // TopView Data Update\n /**\n * Listen to flip\n * 1. Init\n * 2. Reload PointCloud\n * 3. Clear Polygon\n */\n topViewInstance.updateData(currentData.url, currentData.result, {\n radius: config?.radius ?? DEFAULT_RADIUS,\n });\n SetPointCloudLoading(dispatch, false);\n };\n\n return {\n topViewAddBox,\n topViewSelectedChanged,\n topViewUpdateBox,\n sideViewUpdateBox,\n backViewUpdateBox,\n pointCloudBoxListUpdated,\n clearAllResult,\n initPointCloud3d,\n updatePointCloudData,\n };\n};\n"],"names":["this"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,aAAgB,GAAA,CAAA,CAAA;AACtB,MAAM,cAAiB,GAAA,EAAA,CAAA;AAEvB,MAAM,cAAiB,GAAA;AAAA,EACrB,IAAM,EAAA,IAAA;AAAA,EACN,GAAK,EAAA,KAAA;AAAA,EACL,IAAM,EAAA,MAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,CAAA,CAAA;AAMK,MAAA,oBAAA,GAAuB,CAClC,UAAA,EACA,IACG,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAChC,EAAM,MAAA,CAAE,GAAG,CAAM,CAAA,GAAA,UAAA,CAAA;AAGjB,EAAO,OAAA;AAAA,IACL,CAAA,EAAG,CAAC,CAAA,GAAI,CAAI,GAAA,CAAA;AAAA,IACZ,CAAA,EAAG,EAAE,CAAA,GAAI,CAAI,GAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,EAAA;AAIV,MAAM,4BAA4B,CACvC,UAAA,EACA,IACA,EAAA,UAAA,EACA,uBACA,YACG,KAAA;AACH,EAAM,MAAA,CAAC,MAAQ,EAAA,MAAA,EAAQ,MAAQ,EAAA,MAAA,CAAA,GAAU,UAAW,CAAA,SAAA,CAAU,GAAI,CAAA,CAAC,CACjE,K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AAAA,IACL,aAAA;AAAA,IACA,sBAAA;AAAA,IACA,gBAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,wBAAA;AAAA,IACA,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,oBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"usePointCloudViews.js","sources":["../../../../src/components/pointCloudView/hooks/usePointCloudViews.ts"],"sourcesContent":["/**\n * @file Point cloud interface for crud\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @createdate 2022-08-17\n */\nimport { PointCloudAnnotation, PointCloud, MathUtils } from '@labelbee/lb-annotation';\nimport {\n IPointCloudBox,\n EPerspectiveView,\n PointCloudUtils,\n IPolygonPoint,\n} from '@labelbee/lb-utils';\nimport { useContext } from 'react';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { useSingleBox } from './useSingleBox';\nimport { ISize } from '@/types/main';\nimport _ from 'lodash';\nimport { useDispatch, useSelector } from '@/store/ctx';\nimport { AppState } from '@/store';\nimport StepUtils from '@/utils/StepUtils';\nimport { jsonParser } from '@/utils';\nimport { SetPointCloudLoading } from '@/store/annotation/actionCreators';\nimport { message } from 'antd';\nimport { useTranslation } from 'react-i18next';\n\nconst DEFAULT_SCOPE = 5;\nconst DEFAULT_RADIUS = 90;\n\nconst PointCloudView = {\n '3D': '3D',\n Top: 'Top',\n Side: 'Side',\n Back: 'Back',\n};\n\n/**\n * Get the coordinate from canvas2d-coordinate to world coordinate\n */\nexport const transferCanvas2World = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n) => {\n const { width: w, height: h } = size;\n const { x, y } = currentPos;\n\n // x-Axis is the Positive Direction, so the x-coordinates need to be swapped with the y-coordinates\n return {\n x: -y + h / 2,\n y: -(x - w / 2),\n };\n};\n\nexport const topViewPolygon2PointCloud = (\n newPolygon: any,\n size: ISize,\n pointCloud?: PointCloud,\n selectedPointCloudBox?: IPointCloudBox,\n defaultValue?: { [v: string]: any },\n) => {\n const [point1, point2, point3, point4] = newPolygon.pointList.map((v: any) =>\n transferCanvas2World(v, size),\n );\n\n const centerPoint = MathUtils.getLineCenterPoint([point1, point3]);\n const height = MathUtils.getLineLength(point1, point2);\n const width = MathUtils.getLineLength(point2, point3);\n const rotation = MathUtils.getRadiusFromQuadrangle(newPolygon.pointList);\n let z = 0;\n let depth = 1;\n let extraData = {};\n\n // Init PointCloud Data\n if (pointCloud) {\n const zInfo = pointCloud.getSensesPointZAxisInPolygon([point1, point2, point3, point4]);\n z = (zInfo.maxZ + zInfo.minZ) / 2;\n depth = zInfo.maxZ - zInfo.minZ;\n extraData = {\n count: zInfo.zCount,\n };\n }\n\n if (selectedPointCloudBox) {\n z = selectedPointCloudBox.center.z;\n depth = selectedPointCloudBox.depth;\n }\n\n /** TrackID will append before it pushed */\n const boxParams: Omit<IPointCloudBox, 'trackID'> = {\n center: {\n x: centerPoint.x,\n y: centerPoint.y,\n z,\n },\n width,\n height,\n depth,\n rotation: rotation,\n id: newPolygon.id,\n attribute: '',\n valid: true,\n ...extraData,\n };\n\n if (defaultValue) {\n Object.assign(boxParams, defaultValue);\n }\n\n return boxParams;\n};\n\nconst sideViewPolygon2PointCloud = (\n newPolygon: any,\n originPolygon: any,\n selectedPointCloudBox: IPointCloudBox,\n pointCloudInstance: PointCloud,\n) => {\n const [point1, point2, point3] = newPolygon.pointList;\n const [op1, op2, op3] = originPolygon.pointList;\n\n // 2D centerPoint => 3D x & z\n const newCenterPoint = MathUtils.getLineCenterPoint([point1, point3]);\n const oldCenterPoint = MathUtils.getLineCenterPoint([op1, op3]);\n\n const offset = {\n x: newCenterPoint.x - oldCenterPoint.x,\n y: newCenterPoint.y - oldCenterPoint.y,\n };\n\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n\n const offsetCenterPoint = {\n x: offset.x,\n y: offset.x * sin + offset.y * cos,\n z: newCenterPoint.y - oldCenterPoint.y,\n };\n\n // 2D height => 3D depth\n const height = MathUtils.getLineLength(point1, point2);\n const oldHeight = MathUtils.getLineLength(op1, op2);\n const offsetHeight = height - oldHeight; // 3D depth\n\n // 2D width => 3D width\n const width = MathUtils.getLineLength(point2, point3);\n const oldWidth = MathUtils.getLineLength(op2, op3);\n const offsetWidth = width - oldWidth; // 3D width\n\n const { newBoxParams } = pointCloudInstance.getNewBoxBySideUpdate(\n offsetCenterPoint,\n offsetWidth,\n offsetHeight,\n selectedPointCloudBox,\n );\n\n return newBoxParams;\n};\n\n/**\n * NewBox synchronize sideView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeSideView = (\n boxParams: IPointCloudBox,\n newPolygon: any,\n sideViewInstance: PointCloudAnnotation | undefined,\n url: string,\n) => {\n if (!sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation, pointCloudInstance } = sideViewInstance;\n\n // Create PointCloud\n pointCloudInstance.loadPCDFileByBox(url, boxParams, {\n width: DEFAULT_SCOPE,\n depth: DEFAULT_SCOPE,\n });\n const { cameraPositionVector } = pointCloudInstance.updateOrthoCamera(\n boxParams,\n EPerspectiveView.Left,\n );\n\n pointCloudInstance.setInitCameraPosition(cameraPositionVector);\n\n // Create Draw Polygon\n const { polygon2d, zoom } = pointCloudInstance.getBoxSidePolygon2DCoordinate(boxParams);\n\n // Synchronize SidePointCloud zoom with PointCloud2dOperation\n pointCloudInstance.camera.zoom = zoom;\n pointCloudInstance.camera.updateProjectionMatrix();\n pointCloudInstance.render();\n\n // Update PolygonView to default zoom and currentPos.\n pointCloud2dOperation.initPosition();\n pointCloud2dOperation.zoomChangeOnCenter(zoom);\n pointCloud2dOperation.setResultAndSelectedID(\n [\n {\n id: newPolygon.id,\n valid: boxParams.valid,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n },\n ],\n newPolygon.id,\n );\n};\n\n/**\n * NewBox synchronize backView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeBackView = (\n boxParams: IPointCloudBox,\n newPolygon: any,\n BackViewInstance: PointCloudAnnotation,\n url: string,\n) => {\n if (!BackViewInstance) {\n return;\n }\n\n const {\n pointCloud2dOperation: backPointCloudPolygonOperation,\n pointCloudInstance: backPointCloud,\n } = BackViewInstance;\n\n // Create PointCloud\n backPointCloud.loadPCDFileByBox(url, boxParams, { height: DEFAULT_SCOPE, depth: DEFAULT_SCOPE });\n const { cameraPositionVector } = backPointCloud.updateOrthoCamera(\n boxParams,\n EPerspectiveView.Back,\n );\n\n backPointCloud.setInitCameraPosition(cameraPositionVector);\n\n // Create Draw Polygon\n const { polygon2d, zoom } = backPointCloud.getBoxBackPolygon2DCoordinate(boxParams);\n\n // Synchronize SidePointCloud zoom with PointCloud2dOperation\n backPointCloud.camera.zoom = zoom;\n backPointCloud.camera.updateProjectionMatrix();\n backPointCloud.render();\n\n // Update PolygonView to default zoom and currentPos.\n backPointCloudPolygonOperation.initPosition();\n backPointCloudPolygonOperation.zoomChangeOnCenter(zoom);\n backPointCloudPolygonOperation.setResultAndSelectedID(\n [\n {\n id: newPolygon.id,\n valid: boxParams.valid,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n },\n ],\n newPolygon.id,\n );\n};\n\n/**\n * NewBox synchronize TopView\n * @param boxParams\n * @param newPolygon TODO! Need to add type\n */\nexport const synchronizeTopView = (\n newBoxParams: IPointCloudBox,\n newPolygon: any,\n topViewInstance?: PointCloudAnnotation,\n mainViewInstance?: PointCloud,\n) => {\n if (!topViewInstance || !mainViewInstance) {\n return;\n }\n\n // Control the 3D view data to create box\n mainViewInstance.generateBox(newBoxParams, newPolygon.id);\n mainViewInstance.updateCameraByBox(newBoxParams, EPerspectiveView.Top);\n mainViewInstance.render();\n\n const { pointCloud2dOperation, pointCloudInstance } = topViewInstance;\n\n const { polygon2d } = pointCloudInstance.getBoxTopPolygon2DCoordinate(newBoxParams);\n\n const newPolygonList = [...pointCloud2dOperation.polygonList];\n const oldPolygon = newPolygonList.find((v) => v.id === newPolygon.id);\n if (oldPolygon) {\n oldPolygon.pointList = polygon2d;\n } else {\n newPolygonList.push({\n id: newPolygon.id,\n pointList: polygon2d,\n textAttribute: '',\n isRect: true,\n valid: newBoxParams.valid ?? true\n });\n }\n\n pointCloud2dOperation.setResultAndSelectedID(newPolygonList, newPolygon.id);\n};\n\nexport const usePointCloudViews = () => {\n const ptCtx = useContext(PointCloudContext);\n const {\n topViewInstance,\n sideViewInstance,\n backViewInstance,\n mainViewInstance,\n addPointCloudBox,\n setSelectedIDs,\n selectedIDs,\n pointCloudBoxList,\n setPointCloudResult,\n } = ptCtx;\n const { updateSelectedBox } = useSingleBox();\n const { currentData, config } = useSelector((state: AppState) => {\n const { stepList, step, imgList, imgIndex } = state.annotation;\n\n return {\n currentData: imgList[imgIndex],\n config: jsonParser(StepUtils.getCurrentStepInfo(step, stepList).config),\n };\n });\n const dispatch = useDispatch();\n const { selectedBox } = useSingleBox();\n const { t } = useTranslation();\n\n const selectedPointCloudBox = selectedBox?.info;\n\n if (!topViewInstance || !sideViewInstance) {\n return {\n topViewAddBox: () => {},\n topViewSelectedChanged: () => {},\n sideViewUpdateBox: () => {},\n };\n }\n\n const { pointCloudInstance: topViewPointCloud } = topViewInstance;\n\n // Temporarily hide\n // const getNextTrackID = () => {\n // if (pointCloudBoxList.length > 0) {\n // const sortedPcList = pointCloudBoxList.sort((a, b) => a.trackID - b.trackID);\n // return sortedPcList.slice(-1)[0]?.trackID + 1;\n // }\n\n // return 1;\n // };\n\n const mainViewGenBox = (boxParams: IPointCloudBox) => {\n mainViewInstance?.generateBox(boxParams);\n mainViewInstance?.controls.update();\n mainViewInstance?.render();\n };\n\n /** Top-view create box from 2D */\n const topViewAddBox = (newPolygon: any, size: ISize) => {\n const newParams = topViewPolygon2PointCloud(newPolygon, size, topViewPointCloud, undefined, {\n attribute: config?.attributeList?.[0]?.value ?? '',\n });\n const polygonOperation = topViewInstance?.pointCloud2dOperation;\n\n // Temporarily hide\n // const boxParams: IPointCloudBox = Object.assign(newParams, {\n // trackID: getNextTrackID(),\n // });\n const boxParams: IPointCloudBox = newParams;\n\n // If the count is less than lowerLimitPointsNumInBox, needs to delete it\n if (\n config?.lowerLimitPointsNumInBox &&\n typeof newParams.count === 'number' &&\n newParams.count < config.lowerLimitPointsNumInBox\n ) {\n message.info(t('LowerLimitPointsNumInBox', { num: config.lowerLimitPointsNumInBox }));\n polygonOperation.deletePolygon(newParams.id);\n return;\n }\n\n polygonOperation.setSelectedIDs([newPolygon.id]);\n setSelectedIDs(boxParams.id);\n syncPointCloudViews(PointCloudView.Top, newPolygon, boxParams);\n addPointCloudBox(boxParams);\n };\n\n /** Top-view selected changed and render to other view */\n const topViewSelectedChanged = () => {\n const boxParams = selectedBox?.info;\n const polygonOperation = topViewInstance?.pointCloud2dOperation;\n\n polygonOperation.setSelectedIDs(selectedIDs);\n if (!boxParams || !polygonOperation) {\n return;\n }\n\n const polygon = polygonOperation.selectedPolygon;\n syncPointCloudViews(PointCloudView.Top, polygon, boxParams);\n };\n\n /**\n * Update box from view\n * @param newPolygon\n * @param originPolygon\n * @param fromView Back or Side\n */\n const viewUpdateBox = (newPolygon: any, originPolygon: any, fromView: string) => {\n if (selectedPointCloudBox) {\n let newBoxParams = sideViewPolygon2PointCloud(\n newPolygon,\n originPolygon,\n selectedPointCloudBox,\n sideViewInstance.pointCloudInstance,\n );\n // Update count\n if (mainViewInstance) {\n const { count } = mainViewInstance.getSensesPointZAxisInPolygon(\n mainViewInstance.getCuboidFromPointCloudBox(newBoxParams)\n .polygonPointList as IPolygonPoint[],\n [\n newBoxParams.center.z - newBoxParams.depth / 2,\n newBoxParams.center.z + newBoxParams.depth / 2,\n ],\n );\n\n newBoxParams = {\n ...newBoxParams,\n count,\n };\n }\n\n updateSelectedBox(newBoxParams);\n syncPointCloudViews(fromView, newPolygon, newBoxParams);\n }\n };\n\n const sideViewUpdateBox = (newPolygon: any, originPolygon: any) => {\n viewUpdateBox(newPolygon, originPolygon, PointCloudView.Side);\n };\n\n const backViewUpdateBox = (newPolygon: any, originPolygon: any) => {\n viewUpdateBox(newPolygon, originPolygon, PointCloudView.Back);\n };\n\n /**\n * Top view box updated and sync views\n * @param polygon\n * @param size\n */\n const topViewUpdateBox = (polygon: any, size: ISize) => {\n if (selectedPointCloudBox) {\n const newBoxParams = topViewPolygon2PointCloud(\n polygon,\n size,\n topViewInstance.pointCloudInstance,\n selectedPointCloudBox,\n );\n\n Object.assign(\n selectedPointCloudBox,\n _.pickBy(newBoxParams, (v, k) => ['width', 'height', 'x', 'y']),\n );\n\n updateSelectedBox(newBoxParams);\n syncPointCloudViews(PointCloudView.Top, polygon, selectedPointCloudBox);\n }\n };\n\n /**\n * Sync views' data from omit view, regenerate and highlight box on 3D-view\n * @param omitView\n * @param polygon\n * @param boxParams\n */\n const syncPointCloudViews = (omitView: string, polygon: any, boxParams: IPointCloudBox) => {\n const dataUrl = currentData?.url;\n\n const viewToBeUpdated = {\n [PointCloudView.Side]: () => {\n synchronizeSideView(boxParams, polygon, sideViewInstance, dataUrl);\n },\n [PointCloudView.Back]: () => {\n if (backViewInstance) {\n synchronizeBackView(boxParams, polygon, backViewInstance, dataUrl);\n }\n },\n [PointCloudView.Top]: () => {\n synchronizeTopView(boxParams, polygon, topViewInstance, mainViewInstance);\n },\n };\n\n Object.keys(viewToBeUpdated).forEach((key) => {\n if (key !== omitView) {\n viewToBeUpdated[key]();\n }\n });\n mainViewGenBox(boxParams);\n mainViewInstance?.highlightOriginPointCloud(boxParams);\n };\n\n const pointCloudBoxListUpdated = (newBoxes: IPointCloudBox[]) => {\n topViewInstance.updatePolygonList(newBoxes);\n mainViewInstance?.generateBoxes(newBoxes);\n };\n\n const clearAllResult = () => {\n // Clear All PointView Data\n pointCloudBoxList.forEach((v) => {\n mainViewInstance?.removeObjectByName(v.id);\n });\n mainViewInstance?.render();\n\n setPointCloudResult([]);\n topViewInstance.pointCloud2dOperation.clearActiveStatus();\n topViewInstance.pointCloud2dOperation.clearResult();\n };\n\n const initPointCloud3d = () => {\n if (!mainViewInstance) {\n return;\n }\n\n mainViewInstance.initPerspectiveCamera();\n mainViewInstance.initRenderer();\n mainViewInstance.render();\n };\n\n /**\n * Update the data of pointCloudView when the page change.\n * @returns\n */\n const updatePointCloudData = async () => {\n if (!currentData?.url || !mainViewInstance) {\n return;\n }\n\n SetPointCloudLoading(dispatch, true);\n await mainViewInstance.loadPCDFile(currentData.url, config?.radius ?? DEFAULT_RADIUS);\n\n // Clear All Data\n pointCloudBoxList.forEach((v) => {\n mainViewInstance?.removeObjectByName(v.id);\n });\n\n if (currentData.result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n const polygonList = PointCloudUtils.getPolygonListFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n mainViewInstance?.generateBox(v);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n ptCtx.setPolygonList(polygonList);\n } else {\n ptCtx.setPointCloudResult([]);\n ptCtx.setPolygonList([]);\n }\n\n mainViewInstance.updateTopCamera();\n\n const valid = jsonParser(currentData.result)?.valid ?? true;\n ptCtx.setPointCloudValid(valid);\n\n // Clear other view data during initialization\n ptCtx.sideViewInstance?.clearAllData();\n ptCtx.backViewInstance?.clearAllData();\n\n // TopView Data Update\n /**\n * Listen to flip\n * 1. Init\n * 2. Reload PointCloud\n * 3. Clear Polygon\n */\n topViewInstance.updateData(currentData.url, currentData.result, {\n radius: config?.radius ?? DEFAULT_RADIUS,\n });\n SetPointCloudLoading(dispatch, false);\n };\n\n return {\n topViewAddBox,\n topViewSelectedChanged,\n topViewUpdateBox,\n sideViewUpdateBox,\n backViewUpdateBox,\n pointCloudBoxListUpdated,\n clearAllResult,\n initPointCloud3d,\n updatePointCloudData,\n };\n};\n"],"names":["this"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,aAAgB,GAAA,CAAA,CAAA;AACtB,MAAM,cAAiB,GA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back as l}from"react";import r from"lodash";import{PointCloudContext as w}from"../PointCloudContext.js";import{cAnnotation as y}from"@labelbee/lb-annotation";const{ESortDirection:m}=y,h=()=>{const{pointCloudBoxList:o,setPointCloudResult:a,topViewInstance:d,backViewInstance:u,sideViewInstance:x,selectedIDs:v,selectedID:f,mainViewInstance:s,setSelectedIDs:C}=b(w),i=D(()=>{const e=o.findIndex(n=>n.id===f);if(e>-1)return{info:o[e],index:e}},[f,o]),B=l(e=>{(i==null?void 0:i.info)&&(o.splice(i.index,1,r.merge(i.info,e)),a(r.cloneDeep(o)))},[f,o]),g=l((e,n)=>{const t=o.findIndex(p=>p.id===n);t>-1&&(o.splice(t,1,r.merge(o[t],e)),a(r.cloneDeep(o)))},[o]),c=l(e=>{d==null||d.pointCloud2dOperation.setPolygonValidAndRender(e,!0),x==null||x.pointCloud2dOperation.setPolygonValidAndRender(e,!0),u==null||u.pointCloud2dOperation.setPolygonValidAndRender(e,!0)},[d,x,u]),P=l(()=>{if(i==null?void 0:i.info){const{id:e,valid:n=!0}=i.info;B({valid:!n}),c(e)}},[c,i]),V=l(e=>{const n=o.find(t=>t.id===e);if(n){const{id:t,valid:p=!0}=n;g({valid:!p},t),c(t)}},[c,o]),I=l((e=m.ascend)=>{if(!d||v.length>1)return;const{pointCloud2dOperation:n}=d,t=n.switchToNextPolygon(e);t&&C(t)},[d]);return{selectedBox:i,updateSelectedBox:B,changeSelectedBoxValid:P,changeBoxValidByID:V,selectNextBox:I,selectPrevBox:()=>{I(m.descend)},deletePointCloudBox:e=>{a(o.filter(n=>n.id!==e)),s==null||s.removeObjectByName(e),s==null||s.render()}}};export{h as useSingleBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSingleBox.js","sources":["../../../../src/components/pointCloudView/hooks/useSingleBox.ts"],"sourcesContent":["import { IPointCloudBox } from '@labelbee/lb-utils';\nimport { useCallback, useContext, useMemo } from 'react';\nimport _ from 'lodash';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { cAnnotation } from '@labelbee/lb-annotation';\n\nconst { ESortDirection } = cAnnotation;\n\n/** Actions for single selected box */\nexport const useSingleBox = () => {\n const {\n pointCloudBoxList,\n setPointCloudResult,\n topViewInstance,\n selectedIDs,\n selectedID,\n mainViewInstance,\n setSelectedIDs,\n } = useContext(PointCloudContext);\n\n /** Returns { info: selected box, index: selected box index } */\n const selectedBox = useMemo(() => {\n const boxIndex = pointCloudBoxList.findIndex((i: { id: string }) => i.id === selectedID);\n if (boxIndex > -1) {\n return { info: pointCloudBoxList[boxIndex], index: boxIndex };\n }\n }, [selectedID, pointCloudBoxList]);\n\n /** Use Partial<IPointCloudBox> to update selected box */\n const updateSelectedBox = useCallback(\n (params: Partial<IPointCloudBox>) => {\n if (selectedBox?.info) {\n pointCloudBoxList.splice(selectedBox.index, 1, _.merge(selectedBox.info, params));\n setPointCloudResult(_.cloneDeep(pointCloudBoxList));\n }\n },\n [selectedID, pointCloudBoxList],\n );\n\n /** Toggle selected box‘s validity */\n const changeSelectedBoxValid = useCallback(() => {\n if (selectedBox?.info) {\n updateSelectedBox({ valid: !
|
|
1
|
+
{"version":3,"file":"useSingleBox.js","sources":["../../../../src/components/pointCloudView/hooks/useSingleBox.ts"],"sourcesContent":["import { IPointCloudBox } from '@labelbee/lb-utils';\nimport { useCallback, useContext, useMemo } from 'react';\nimport _ from 'lodash';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { cAnnotation } from '@labelbee/lb-annotation';\n\nconst { ESortDirection } = cAnnotation;\n\n/** Actions for single selected box */\nexport const useSingleBox = () => {\n const {\n pointCloudBoxList,\n setPointCloudResult,\n topViewInstance,\n backViewInstance,\n sideViewInstance,\n selectedIDs,\n selectedID,\n mainViewInstance,\n setSelectedIDs,\n } = useContext(PointCloudContext);\n\n /** Returns { info: selected box, index: selected box index } */\n const selectedBox = useMemo(() => {\n const boxIndex = pointCloudBoxList.findIndex((i: { id: string }) => i.id === selectedID);\n if (boxIndex > -1) {\n return { info: pointCloudBoxList[boxIndex], index: boxIndex };\n }\n }, [selectedID, pointCloudBoxList]);\n\n /** Use Partial<IPointCloudBox> to update selected box */\n const updateSelectedBox = useCallback(\n (params: Partial<IPointCloudBox>) => {\n if (selectedBox?.info) {\n pointCloudBoxList.splice(selectedBox.index, 1, _.merge(selectedBox.info, params));\n setPointCloudResult(_.cloneDeep(pointCloudBoxList));\n }\n },\n [selectedID, pointCloudBoxList],\n );\n\n /** Use Partial<IPointCloudBox> to update box by ID */\n const updateBoxByID = useCallback(\n (params: Partial<IPointCloudBox>, id: string) => {\n const boxIndex = pointCloudBoxList.findIndex((v) => v.id === id);\n\n if (boxIndex > -1) {\n pointCloudBoxList.splice(boxIndex, 1, _.merge(pointCloudBoxList[boxIndex], params));\n setPointCloudResult(_.cloneDeep(pointCloudBoxList));\n }\n },\n [pointCloudBoxList],\n );\n\n /**\n * Change all polygonView Valid.\n */\n const changePolygonViewValid = useCallback(\n (id: string) => {\n topViewInstance?.pointCloud2dOperation.setPolygonValidAndRender(id, true);\n sideViewInstance?.pointCloud2dOperation.setPolygonValidAndRender(id, true);\n backViewInstance?.pointCloud2dOperation.setPolygonValidAndRender(id, true);\n },\n [topViewInstance, sideViewInstance, backViewInstance],\n );\n\n /** Toggle selected box‘s validity */\n const changeSelectedBoxValid = useCallback(() => {\n if (selectedBox?.info) {\n const { id, valid = true } = selectedBox.info;\n\n // PointCloud\n updateSelectedBox({ valid: !valid });\n\n changePolygonViewValid(id);\n }\n }, [changePolygonViewValid, selectedBox]);\n\n const changeBoxValidByID = useCallback(\n (id: string) => {\n const boxInfo = pointCloudBoxList.find((v) => v.id === id);\n\n if (boxInfo) {\n const { id, valid = true } = boxInfo;\n\n // PointCloud\n updateBoxByID({ valid: !valid }, id);\n\n changePolygonViewValid(id);\n }\n },\n [changePolygonViewValid, pointCloudBoxList],\n );\n\n /** PointCloud select next/prev one */\n const switchToNextBox = useCallback(\n (sort = ESortDirection.ascend) => {\n if (!topViewInstance || selectedIDs.length > 1) {\n return;\n }\n\n const { pointCloud2dOperation } = topViewInstance;\n\n const newSelectedIDs = pointCloud2dOperation.switchToNextPolygon(sort);\n if (newSelectedIDs) {\n setSelectedIDs(newSelectedIDs);\n }\n },\n [topViewInstance],\n );\n\n const selectPrevBox = () => {\n switchToNextBox(ESortDirection.descend);\n };\n\n const deletePointCloudBox = (id: string) => {\n setPointCloudResult(pointCloudBoxList.filter((v) => v.id !== id));\n mainViewInstance?.removeObjectByName(id);\n mainViewInstance?.render();\n // TODO Clear Highlight.\n };\n\n return {\n selectedBox,\n updateSelectedBox,\n changeSelectedBoxValid,\n changeBoxValidByID,\n selectNextBox: switchToNextBox,\n selectPrevBox,\n deletePointCloudBox,\n };\n};\n"],"names":[],"mappings":";;;;;AAMA,MAAM,CAAE,cAAmB,CAAA,GAAA,WAAA,CAAA;AAGpB,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA;AAAA,IACJ,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,GAAA,GACE,UAAW,CAAA,iBAAA,CAAA,CAAA;AAGf,EAAM,MAAA,WAAA,GAAc,QAAQ,MAAM;AAChC,IAAA,MAAM,WAAW,iBAAkB,CAAA,SAAA,CAAU,CAAC,CAAA,KAAsB,EAAE,EAAO,KAAA,UAAA,CAAA,CAAA;AAC7E,IAAA,IAAI,WAAW,CAAI,CAAA,EAAA;AACjB,MAAA,OAAO,CAAE,IAAA,EAAM,iBAAkB,CAAA,QAAA,CAAA,EAAW,KAAO,EAAA,QAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,EAEpD,CAAC,UAAY,EAAA,iBAAA,CAAA,CAAA,CAAA;AAGhB,EAAM,MAAA,iBAAA,GAAoB,WACxB,CAAA,CAAC,MAAoC,KAAA;AACnC,IAAA,IAAI,2CAAa,IAAM,EAAA;AACrB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;AAClB,MAAe,cAAA,CAAA,cAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,EAGnB,CAAC,eAAA,CAAA,CAAA,CAAA;AAGH,EAAA,MAAM,gBAAgB,MAAM;AAC1B,IAAA,eAAA,CAAgB,cAAe,CAAA,OAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAM,MAAA,mBAAA,GAAsB,CAAC,EAAe,KAAA;AAC1C,IAAA,mBAAA,CAAoB,iBAAkB,CAAA,MAAA,CAAO,CAAC,CAAA,KAAM,EAAE,EAAO,KAAA,EAAA,CAAA,CAAA,CAAA;AAC7D,IAAA,gBAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAkB,kBAAmB,CAAA,EAAA,CAAA,CAAA;AACrC,IAAkB,gBAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAA,MAAA,EAAA,CAAA;AAAA,GAAA,CAAA;AAIpB,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,sBAAA;AAAA,IACA,kBAAA;AAAA,IACA,aAAe,EAAA,eAAA;AAAA,IACf,aAAA;AAAA,IACA,mBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{backward as
|
|
1
|
+
import{backward as a,forward as s,scale as i,fullScreen as r}from"../common/index.js";import n from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import l from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import c from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import e from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import m from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import u from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import C from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import g from"../../../../../../assets/annotation/pointCloudTool/rotate180_black.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import o from"react";import{ReloadOutlined as f,RotateLeftOutlined as v,RotateRightOutlined as x}from"@ant-design/icons";const j={name:"PointThickness",icon:o.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},R={name:"RotateAroundCenterPoint",icon:o.createElement(f,null),shortCut:[l],noticeInfo:"DragOperation"},T={name:"PointCloudViewTranslate",icon:n,shortCut:[t],noticeInfo:"Drag"},P={name:"TopViewTranslate",icon:n,shortCut:[t],noticeInfo:"Drag"},B={name:"ChangePointCloudValid",icon:c,shortCut:["V"]},S={name:"CopyBox",icon:e,shortCut:["Ctrl","C"]},y={name:"PasteBox",icon:u,shortCut:["Ctrl","V"]},b={name:"RotateLeft",icon:o.createElement(v,null),shortCut:["Q"]},I={name:"RotateRight",icon:o.createElement(x,null),shortCut:["E"]},_={name:"PreviousBox",icon:C,shortCut:["Shift","Tab"]},$={name:"NextBox",icon:m,shortCut:["Tab"]},k={name:"Rotate180",icon:g,shortCut:["G"],noticeInfo:"SelectedStatus"},V={name:"CopyPrevPage",icon:e,shortCut:["Alt","C"]},w={name:"ChangeBoxValid",icon:h,shortCut:["F"],noticeInfo:"SelectedStatus"},A={name:"MultiSelect",icon:d,shortCut:["Ctrl",t]},D={name:"SelectAllBox",icon:p,shortCut:["Ctrl","A"]},E=[{name:"GeneralOperation"},a,s,j,i,R,T,P,B,{name:"RectPattern"},S,y,b,I,_,$,k,V,w,A,D,r];export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx"],"sourcesContent":["import _ from 'lodash';\nimport { backward, forward, fullScreen, scale } from '../common';\nimport dragIcon from '@/assets/annotation/toolHotKeyIcon/icon_move_kj.svg';\nimport leftClick from '@/assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg';\nimport rightClick from '@/assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg';\nimport changePointCloudValid from '@/assets/annotation/pointCloudTool/changePointCloudValid.svg';\nimport copy from '@/assets/annotation/pointCloudTool/copy.svg';\nimport nextBox from '@/assets/annotation/pointCloudTool/nextBox.svg';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx"],"sourcesContent":["import _ from 'lodash';\nimport { backward, forward, fullScreen, scale } from '../common';\nimport dragIcon from '@/assets/annotation/toolHotKeyIcon/icon_move_kj.svg';\nimport leftClick from '@/assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg';\nimport rightClick from '@/assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg';\nimport changePointCloudValid from '@/assets/annotation/pointCloudTool/changePointCloudValid.svg';\nimport copy from '@/assets/annotation/pointCloudTool/copy.svg';\nimport nextBox from '@/assets/annotation/pointCloudTool/nextBox.svg';\nimport paste from '@/assets/annotation/pointCloudTool/patse.svg';\nimport prevBox from '@/assets/annotation/pointCloudTool/prevBox.svg';\nimport rotate180_black from '@/assets/annotation/pointCloudTool/rotate180_black.svg';\nimport selectAll from '@/assets/annotation/pointCloudTool/selectAll.svg';\nimport selectMultiple from '@/assets/annotation/pointCloudTool/selectMultiple.svg';\nimport TabChangeSelectedSvg from '@/assets/annotation/toolHotKeyIcon/icon_tab_kj.svg';\n\nimport { IShortcut } from '@/types/tool';\nimport React from 'react';\nimport { ReloadOutlined, RotateLeftOutlined, RotateRightOutlined } from '@ant-design/icons';\n\nconst changePointSize: IShortcut = {\n name: 'PointThickness',\n icon: (\n <span\n style={{\n display: ' inline-block',\n width: 14,\n height: 14,\n borderRadius: '50%',\n border: '1px solid',\n }}\n />\n ),\n shortCut: ['+', '-'],\n linkSymbol: '',\n};\n\nconst rotateRoundCenter: IShortcut = {\n name: 'RotateAroundCenterPoint',\n icon: <ReloadOutlined />,\n shortCut: [leftClick],\n noticeInfo: 'DragOperation',\n};\n\nconst Drag3D = {\n name: 'PointCloudViewTranslate',\n icon: dragIcon,\n shortCut: [rightClick],\n noticeInfo: 'Drag',\n};\n\nconst DragTopView = {\n name: 'TopViewTranslate',\n icon: dragIcon,\n shortCut: [rightClick],\n noticeInfo: 'Drag',\n};\n\nconst ChangeInvalid = {\n name: 'ChangePointCloudValid',\n icon: changePointCloudValid,\n shortCut: ['V'],\n};\n\nconst CopyBox = {\n name: 'CopyBox',\n icon: copy,\n shortCut: ['Ctrl', 'C'],\n};\n\nconst PasteBox = {\n name: 'PasteBox',\n icon: paste,\n shortCut: ['Ctrl', 'V'],\n};\n\nconst LeftRotate = {\n name: 'RotateLeft',\n icon: <RotateLeftOutlined />,\n shortCut: ['Q'],\n};\n\nconst RightRotate = {\n name: 'RotateRight',\n icon: <RotateRightOutlined />,\n shortCut: ['E'],\n};\n\nconst PrevBox = {\n name: 'PreviousBox',\n icon: prevBox,\n shortCut: ['Shift', 'Tab'],\n};\n\nconst NextBox = {\n name: 'NextBox',\n icon: nextBox,\n shortCut: ['Tab'],\n};\n\nconst Rotate180 = {\n name: 'Rotate180',\n icon: rotate180_black,\n shortCut: ['G'],\n noticeInfo: 'SelectedStatus',\n};\n\nconst CopyPrevPage = {\n name: 'CopyPrevPage',\n icon: copy,\n shortCut: ['Alt', 'C'],\n};\n\nconst ChangeBoxInvalid = {\n name: 'ChangeBoxValid',\n icon: TabChangeSelectedSvg,\n shortCut: ['F'],\n noticeInfo: 'SelectedStatus',\n};\n\nconst SelectMulti = {\n name: 'MultiSelect',\n icon: selectMultiple,\n shortCut: ['Ctrl', rightClick],\n};\n\nconst SelectAll = {\n name: 'SelectAllBox',\n icon: selectAll,\n shortCut: ['Ctrl', 'A'],\n};\n\nconst pointCloudShortCutTable: IShortcut[] = [\n { name: 'GeneralOperation' },\n backward,\n forward,\n changePointSize,\n scale,\n rotateRoundCenter,\n Drag3D,\n DragTopView,\n ChangeInvalid,\n { name: 'RectPattern' },\n CopyBox,\n PasteBox,\n LeftRotate,\n RightRotate,\n PrevBox,\n NextBox,\n Rotate180,\n CopyPrevPage,\n ChangeBoxInvalid,\n SelectMulti,\n SelectAll,\n fullScreen,\n];\n\nexport default pointCloudShortCutTable;\n"],"names":["leftClick","dragIcon","rightClick","changePointCloudValid","copy","paste","prevBox","nextBox","rotate180_black","TabChangeSelectedSvg","selectMultiple","selectAll"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAM,eAA6B,GAAA;AAAA,EACjC,IAAM,EAAA,gBAAA;AAAA,EACN,IAAA,sCACG,MAAD,EAAA;AAAA,IACE,KAAO,EAAA;AAAA,MACL,OAAS,EAAA,eAAA;AAAA,MACT,KAAO,EAAA,EAAA;AAAA,MACP,MAAQ,EAAA,EAAA;AAAA,MACR,YAAc,EAAA,KAAA;AAAA,MACd,MAAQ,EAAA,WAAA;AAAA,KAAA;AAAA,GAAA,CAAA;AAAA,EAId,QAAA,EAAU,CAAC,GAAK,EAAA,GAAA,CAAA;AAAA,EAChB,UAAY,EAAA,EAAA;AAAA,CAAA,CAAA;AAGd,MAAM,iBAA+B,GAAA;AAAA,EACnC,IAAM,EAAA,yBAAA;AAAA,EACN,IAAA,sCAAO,cAAD,EAAA,IAAA,CAAA;AAAA,EACN,UAAU,CAACA,GAAA,CAAA;AAAA,EACX,UAAY,EAAA,eAAA;AAAA,CAAA,CAAA;AAGd,MAAM,MAAS,GAAA;AAAA,EACb,IAAM,EAAA,yBAAA;AAAA,EACN,IAAM,EAAAC,KAAA;AAAA,EACN,UAAU,CAACC,KAAA,CAAA;AAAA,EACX,UAAY,EAAA,MAAA;AAAA,CAAA,CAAA;AAGd,MAAM,WAAc,GAAA;AAAA,EAClB,IAAM,EAAA,kBAAA;AAA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-1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.6.0-alpha.
|
|
3
|
+
"version": "1.6.0-alpha.13",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ant-design/icons": "^4.6.2",
|
|
44
|
-
"@labelbee/lb-annotation": "^1.9.0-alpha.
|
|
45
|
-
"@labelbee/lb-utils": "^1.3.0-alpha.
|
|
44
|
+
"@labelbee/lb-annotation": "^1.9.0-alpha.13",
|
|
45
|
+
"@labelbee/lb-utils": "^1.3.0-alpha.13",
|
|
46
46
|
"ahooks": "^3.4.0",
|
|
47
47
|
"classnames": "^2.3.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"commitizen": {
|
|
97
97
|
"path": "node_modules/cz-conventional-changelog"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
100
|
-
"gitHead": "2476ee3089282e14e354a7bcb5f7398d61f0c9e9"
|
|
99
|
+
}
|
|
101
100
|
}
|
package/LICENSE
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
Copyright 2018-2023 OpenMMLab. All rights reserved.
|
|
2
|
-
|
|
3
|
-
Apache License
|
|
4
|
-
Version 2.0, January 2004
|
|
5
|
-
http://www.apache.org/licenses/
|
|
6
|
-
|
|
7
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
-
|
|
9
|
-
1. Definitions.
|
|
10
|
-
|
|
11
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
-
|
|
14
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
-
the copyright owner that is granting the License.
|
|
16
|
-
|
|
17
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
-
other entities that control, are controlled by, or are under common
|
|
19
|
-
control with that entity. For the purposes of this definition,
|
|
20
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
-
direction or management of such entity, whether by contract or
|
|
22
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
-
|
|
25
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
-
exercising permissions granted by this License.
|
|
27
|
-
|
|
28
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
-
including but not limited to software source code, documentation
|
|
30
|
-
source, and configuration files.
|
|
31
|
-
|
|
32
|
-
"Object" form shall mean any form resulting from mechanical
|
|
33
|
-
transformation or translation of a Source form, including but
|
|
34
|
-
not limited to compiled object code, generated documentation,
|
|
35
|
-
and conversions to other media types.
|
|
36
|
-
|
|
37
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
-
Object form, made available under the License, as indicated by a
|
|
39
|
-
copyright notice that is included in or attached to the work
|
|
40
|
-
(an example is provided in the Appendix below).
|
|
41
|
-
|
|
42
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
-
form, that is based on (or derived from) the Work and for which the
|
|
44
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
-
of this License, Derivative Works shall not include works that remain
|
|
47
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
-
the Work and Derivative Works thereof.
|
|
49
|
-
|
|
50
|
-
"Contribution" shall mean any work of authorship, including
|
|
51
|
-
the original version of the Work and any modifications or additions
|
|
52
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
-
means any form of electronic, verbal, or written communication sent
|
|
57
|
-
to the Licensor or its representatives, including but not limited to
|
|
58
|
-
communication on electronic mailing lists, source code control systems,
|
|
59
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
-
excluding communication that is conspicuously marked or otherwise
|
|
62
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
-
|
|
64
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
-
subsequently incorporated within the Work.
|
|
67
|
-
|
|
68
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
-
Work and such Derivative Works in Source or Object form.
|
|
74
|
-
|
|
75
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
-
(except as stated in this section) patent license to make, have made,
|
|
79
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
-
where such license applies only to those patent claims licensable
|
|
81
|
-
by such Contributor that are necessarily infringed by their
|
|
82
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
-
institute patent litigation against any entity (including a
|
|
85
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
-
or contributory patent infringement, then any patent licenses
|
|
88
|
-
granted to You under this License for that Work shall terminate
|
|
89
|
-
as of the date such litigation is filed.
|
|
90
|
-
|
|
91
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
-
modifications, and in Source or Object form, provided that You
|
|
94
|
-
meet the following conditions:
|
|
95
|
-
|
|
96
|
-
(a) You must give any other recipients of the Work or
|
|
97
|
-
Derivative Works a copy of this License; and
|
|
98
|
-
|
|
99
|
-
(b) You must cause any modified files to carry prominent notices
|
|
100
|
-
stating that You changed the files; and
|
|
101
|
-
|
|
102
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
-
that You distribute, all copyright, patent, trademark, and
|
|
104
|
-
attribution notices from the Source form of the Work,
|
|
105
|
-
excluding those notices that do not pertain to any part of
|
|
106
|
-
the Derivative Works; and
|
|
107
|
-
|
|
108
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
-
distribution, then any Derivative Works that You distribute must
|
|
110
|
-
include a readable copy of the attribution notices contained
|
|
111
|
-
within such NOTICE file, excluding those notices that do not
|
|
112
|
-
pertain to any part of the Derivative Works, in at least one
|
|
113
|
-
of the following places: within a NOTICE text file distributed
|
|
114
|
-
as part of the Derivative Works; within the Source form or
|
|
115
|
-
documentation, if provided along with the Derivative Works; or,
|
|
116
|
-
within a display generated by the Derivative Works, if and
|
|
117
|
-
wherever such third-party notices normally appear. The contents
|
|
118
|
-
of the NOTICE file are for informational purposes only and
|
|
119
|
-
do not modify the License. You may add Your own attribution
|
|
120
|
-
notices within Derivative Works that You distribute, alongside
|
|
121
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
-
that such additional attribution notices cannot be construed
|
|
123
|
-
as modifying the License.
|
|
124
|
-
|
|
125
|
-
You may add Your own copyright statement to Your modifications and
|
|
126
|
-
may provide additional or different license terms and conditions
|
|
127
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
-
the conditions stated in this License.
|
|
131
|
-
|
|
132
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
-
this License, without any additional terms or conditions.
|
|
136
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
-
the terms of any separate license agreement you may have executed
|
|
138
|
-
with Licensor regarding such Contributions.
|
|
139
|
-
|
|
140
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
-
except as required for reasonable and customary use in describing the
|
|
143
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
-
|
|
145
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
-
implied, including, without limitation, any warranties or conditions
|
|
150
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
-
appropriateness of using or redistributing the Work and assume any
|
|
153
|
-
risks associated with Your exercise of permissions under this License.
|
|
154
|
-
|
|
155
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
-
unless required by applicable law (such as deliberate and grossly
|
|
158
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
-
liable to You for damages, including any direct, indirect, special,
|
|
160
|
-
incidental, or consequential damages of any character arising as a
|
|
161
|
-
result of this License or out of the use or inability to use the
|
|
162
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
-
other commercial damages or losses), even if such Contributor
|
|
165
|
-
has been advised of the possibility of such damages.
|
|
166
|
-
|
|
167
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
-
or other liability obligations and/or rights consistent with this
|
|
171
|
-
License. However, in accepting such obligations, You may act only
|
|
172
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
-
defend, and hold each Contributor harmless for any liability
|
|
175
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
-
of your accepting any such warranty or additional liability.
|
|
177
|
-
|
|
178
|
-
END OF TERMS AND CONDITIONS
|
|
179
|
-
|
|
180
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
-
|
|
182
|
-
To apply the Apache License to your work, attach the following
|
|
183
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
-
replaced with your own identifying information. (Don't include
|
|
185
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
-
comment syntax for the file format. We also recommend that a
|
|
187
|
-
file or class name and description of purpose be included on the
|
|
188
|
-
same "printed page" as the copyright notice for easier
|
|
189
|
-
identification within third-party archives.
|
|
190
|
-
|
|
191
|
-
Copyright 2018-2023 OpenMMLab.
|
|
192
|
-
|
|
193
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
-
you may not use this file except in compliance with the License.
|
|
195
|
-
You may obtain a copy of the License at
|
|
196
|
-
|
|
197
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
-
|
|
199
|
-
Unless required by applicable law or agreed to in writing, software
|
|
200
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
-
See the License for the specific language governing permissions and
|
|
203
|
-
limitations under the License.
|