@labelbee/lb-components 1.23.0-alpha.84 → 1.23.0-alpha.86

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash"),map=require("./utils/map.js"),useTimeoutFunc=require("./hooks/useTimeoutFunc.js"),useWindowKeydownListener=require("./hooks/useWindowKeydownListener.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,i,d)=>i in r?__defProp(r,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[i]=d,__spreadValues=(r,i)=>{for(var d in i||(i={}))__hasOwnProp.call(i,d)&&__defNormalProp(r,d,i[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(i))__propIsEnum.call(i,d)&&__defNormalProp(r,d,i[d]);return r},__spreadProps=(r,i)=>__defProps(r,__getOwnPropDescs(i)),__async=(r,i,d)=>new Promise((x,D)=>{var A=u=>{try{I(d.next(u))}catch(R){D(R)}},O=u=>{try{I(d.throw(u))}catch(R){D(R)}},I=u=>u.done?x(u.value):Promise.resolve(u.value).then(A,O);I((d=d.apply(r,i)).next())});const pickRectObject=r=>___default.default.pick(r,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:r=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:r=>!1,removeRectBySpecifyId:(r,i,d)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener()}),PointCloudProvider=({children:r})=>{const[i,d]=React.useState([]),[x,D]=React.useState([]),[A,O]=React.useState([]),[I,u]=React.useState([]),[R,Re]=React.useState([]),[v,N]=React.useState([]),[B,j]=React.useState([]),[U,xe]=React.useState(!0),[Z,Le]=React.useState(2),[J,De]=React.useState(!0),[Q,Ae]=React.useState(1),[f,X]=React.useState(),[Y,$]=React.useState(),[ee,te]=React.useState(),[g,oe]=React.useState(),[ne,Be]=React.useState(""),[F,_e]=React.useState(lbAnnotation.EToolName.Rect),q=React.useRef(new lbAnnotation.ActionsHistory).current,[p,T]=React.useState([]),[ie,Ve]=React.useState(""),[z,Ne]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,se]=React.useState(void 0),[W,He]=React.useState([]),[G,Me]=React.useState([]),[re,ke]=React.useState(!1),h=index(),[le,Ee]=React.useState({}),Oe=ctx.useDispatch(),je=o=>{const{imgNode:n,path:t}=o;t&&n&&Ee(a=>__spreadProps(__spreadValues({},a),{[t]:{width:n.width,height:n.height}}))},ae=React.useMemo(()=>v.length===1?v[0]:"",[v]),de=useWindowKeydownListener.default(),H=React.useCallback((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return u(c=>{let S=!1;const P=c.filter(k=>{const K=k[a],E=l.has(K)?k.imageName!==o:!0;return E||(S=!0),E});return S?P:c}),!0},[]),ce=React.useCallback(o=>{const n=i.map(t=>t.id);return H(o,n,"extId")},[i,H]),ue=React.useCallback(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:c}=t,S=t.rects.find(P=>P.imageName===o);if(S){const P=___default.default.pick(S,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},P),{id:lbAnnotation.uuid(),attribute:l,order:c,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const a=new Set(t.filter(c=>o===c.imageName).map(c=>c.extId)),l=n.filter(c=>a.has(c.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),ge=React.useMemo(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:c}=l;if(!c){console.warn("Missing image name"),console.trace(l,t);return}map.addMapIndirectWeakSetItem(n,c,t.id,t)}),n},new Map),[i]),fe=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),pe=React.useMemo(()=>I.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(map.addMapIndirectWeakSetItem(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,I),o)},new Map),[I]),{fn:Fe}=useTimeoutFunc.default(o=>{N(n=>{const t=o,a=new Set(t);let l=!1;const c=n.filter(S=>{const P=a.has(S);return P||(l=!0),P});return l?c:n})},200),he=React.useCallback(o=>{const n=o.map(t=>t.id);d(o),Fe(n)},[]),M=React.useMemo(()=>{const o=i.find(e=>e.id===ae),n=e=>{const s=i.concat(e);return he(s),s},t=e=>{const s=x.concat(e);return D(s),s},a=e=>{xe(e!==!1)},l=e=>{e===void 0&&N([]),typeof e=="string"&&N([e]),Array.isArray(e)&&N(Array.from(new Set(e)))},c=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},S=e=>{const s=pickRectObject(e);u(m=>[...m,s])},P=(e,s=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?s?__spreadValues(__spreadValues({},w),m):m:w))},k=e=>{u(s=>s.filter(m=>!e.find(C=>C.id===m.id)))},K=e=>{B.includes(e)?j([]):j([e])},E=()=>{if(F===lbAnnotation.EToolName.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Te=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},me=i.filter(e=>!p.includes(e.attribute)),ve=x.filter(e=>!p.includes(e.attribute)),Pe=R.filter(e=>e.attribute&&!p.includes(e.attribute)),ze=e=>{if(p.includes(e))T(p.filter(s=>s!==e));else{const s=p.concat(e);T(s)}},We=(e=me,s=A,m=ve,C=Pe,w=W)=>{var V;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(m),f==null||f.updateLineList(C),g==null||g.generateBoxes(e),g==null||g.generateSpheres(m),(V=L==null?void 0:L.store)==null||V.updateCurrentSegment(w),Ie(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Ge=()=>{X(void 0),$(void 0),te(void 0),oe(void 0)},Ie=(e,s,m)=>__async(void 0,null,function*(){var C,w,V;if(!g)return;const Se=g.pointCloudObject;if(!Se)return;let Ce=[],we=[];try{if(s&&q.record.length){const{record:y,recordIndex:b}=q;let ye=b;b>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&s.length===((C=y[b])==null?void 0:C.pointCloudBoxList.length))&&(ye=b-1);let Ke=(w=y[ye])==null?void 0:w.pointCloudBoxList;const be=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,s,Ke);Ce=be.modifiedBoxIds,we=be.resetAreas}}catch(y){console.error("call calcResetAreasAndBoxIds error",y)}try{const y=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:G,points:Se.geometry.attributes.position.array}),b=yield g==null?void 0:g.highlightOriginPointCloud(s,y,{modifiedBoxIds:Ce,resetAreas:we});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(y){console.error("call highlightOriginPointCloud error",y)}});return{selectedID:ae,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:me,displaySphereList:ve,displayLineList:Pe,selectedIDs:v,setPointCloudResult:he,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:D,valid:U,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:c,addHighlightID:K,selectedAllBoxes:E,topViewInstance:f,setTopViewInstance:X,sideViewInstance:Y,setSideViewInstance:$,backViewInstance:ee,setBackViewInstance:te,mainViewInstance:g,setMainViewInstance:oe,polygonList:A,setPolygonList:O,rectList:I,setRectList:u,addRectIn2DView:S,removeRectIn2DView:k,updateRectIn2DView:P,lineList:R,setLineList:Re,zoom:Q,setZoom:Ae,history:q,toggleAttributesVisible:ze,hideAttributes:p,setHideAttributes:T,reRender:We,attrPanelLayout:ie,setAttrPanelLayout:Ve,syncAllViewPointCloudColor:Ie,defaultAttribute:ne,setDefaultAttribute:Be,pointCloudPattern:F,setPointCloudPattern:_e,selectSpecAttr:Te,globalPattern:z,setGlobalPattern:e=>{z!==e&&(Oe(actionCreators.ChangeSave),Ne(e),e===lbUtils.EPointCloudPattern.Detection&&se(void 0))},ptSegmentInstance:L,setPtSegmentInstance:se,segmentation:W,setSegmentation:He,clearAllDetectionInstance:Ge,highlight2DDataList:G,setHighlight2DDataList:Me,highlight2DLoading:re,setHighlight2DLoading:ke,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:De,imageSizes:le,cacheImageNodeSize:je,highlightIDs:B,setHighlightIDs:j,removeRectByPointCloudBoxId:ce,removeRectBySpecifyId:H,addRectFromPointCloudBoxByImageName:ue,rectRotateSensitivity:Z,setRectRotateSensitivity:Le,imageNamePointCloudBoxMap:ge,linkageImageNameRectMap:pe,updateRectListByReducer:fe,windowKeydownListenerHook:de}},[U,v,i,x,A,R,I,f,Y,ee,g,Q,p,ie,ne,F,z,L,W,G,re,J,le,B,ce,H,ue,Z,ge,pe,fe,de]);React.useEffect(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,B),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,B]),React.useEffect(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const qe=()=>{const o=i.filter(l=>p.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return React.useEffect(()=>{var o,n,t,a;qe(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,p),(a=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,p)},[p]),React__default.default.createElement(PointCloudContext.Provider,{value:M},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),ToolPointCloudBoxRenderHelper=require("../../utils/ToolPointCloudBoxRenderHelper.js"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash"),map=require("./utils/map.js"),useTimeoutFunc=require("./hooks/useTimeoutFunc.js"),useWindowKeydownListener=require("./hooks/useWindowKeydownListener.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,i,d)=>i in r?__defProp(r,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[i]=d,__spreadValues=(r,i)=>{for(var d in i||(i={}))__hasOwnProp.call(i,d)&&__defNormalProp(r,d,i[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(i))__propIsEnum.call(i,d)&&__defNormalProp(r,d,i[d]);return r},__spreadProps=(r,i)=>__defProps(r,__getOwnPropDescs(i)),__async=(r,i,d)=>new Promise((x,D)=>{var A=u=>{try{I(d.next(u))}catch(R){D(R)}},O=u=>{try{I(d.throw(u))}catch(R){D(R)}},I=u=>u.done?x(u.value):Promise.resolve(u.value).then(A,O);I((d=d.apply(r,i)).next())});const pickRectObject=r=>___default.default.pick(r,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:r=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:r=>!1,removeRectBySpecifyId:(r,i,d)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener()}),PointCloudProvider=({children:r})=>{const[i,d]=React.useState([]),[x,D]=React.useState([]),[A,O]=React.useState([]),[I,u]=React.useState([]),[R,Re]=React.useState([]),[v,N]=React.useState([]),[B,j]=React.useState([]),[U,xe]=React.useState(!0),[Z,Le]=React.useState(2),[J,De]=React.useState(!0),[Q,Ae]=React.useState(1),[f,X]=React.useState(),[Y,$]=React.useState(),[ee,te]=React.useState(),[g,oe]=React.useState(),[ne,Be]=React.useState(""),[F,_e]=React.useState(lbAnnotation.EToolName.Rect),q=React.useRef(new lbAnnotation.ActionsHistory).current,[p,T]=React.useState([]),[ie,Ve]=React.useState(""),[z,Ne]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,se]=React.useState(void 0),[W,He]=React.useState([]),[G,Me]=React.useState([]),[re,ke]=React.useState(!1),h=index(),[le,Ee]=React.useState({}),Oe=ctx.useDispatch(),je=o=>{const{imgNode:n,path:t}=o;t&&n&&Ee(a=>__spreadProps(__spreadValues({},a),{[t]:{width:n.width,height:n.height}}))},ae=React.useMemo(()=>v.length===1?v[0]:"",[v]),de=useWindowKeydownListener.default(),H=React.useCallback((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return u(c=>{let S=!1;const P=c.filter(k=>{const K=k[a],E=l.has(K)?k.imageName!==o:!0;return E||(S=!0),E});return S?P:c}),!0},[]),ce=React.useCallback(o=>{const n=i.map(t=>t.id);return H(o,n,"extId")},[i,H]),ue=React.useCallback(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:c}=t,S=t.rects.find(P=>P.imageName===o);if(S){const P=___default.default.pick(S,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},P),{id:lbAnnotation.uuid(),attribute:l,order:c,extId:a})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const a=new Set(t.filter(c=>o===c.imageName).map(c=>c.extId)),l=n.filter(c=>a.has(c.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),ge=React.useMemo(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:c}=l;if(!c){console.warn("Missing image name"),console.trace(l,t);return}map.addMapIndirectWeakSetItem(n,c,t.id,t)}),n},new Map),[i]),fe=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),pe=React.useMemo(()=>I.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(map.addMapIndirectWeakSetItem(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,I),o)},new Map),[I]),{fn:Fe}=useTimeoutFunc.default(o=>{N(n=>{const t=o,a=new Set(t);let l=!1;const c=n.filter(S=>{const P=a.has(S);return P||(l=!0),P});return l?c:n})},200),he=React.useCallback(o=>{const n=o.map(t=>t.id);d(o),Fe(n)},[]),M=React.useMemo(()=>{const o=i.find(e=>e.id===ae),n=e=>{const s=i.concat(e);return he(s),s},t=e=>{const s=x.concat(e);return D(s),s},a=e=>{xe(e!==!1)},l=e=>{e===void 0&&N([]),typeof e=="string"&&N([e]),Array.isArray(e)&&N(Array.from(new Set(e)))},c=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},S=e=>{const s=pickRectObject(e);u(m=>[...m,s])},P=(e,s=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?s?__spreadValues(__spreadValues({},w),m):m:w))},k=e=>{u(s=>s.filter(m=>!e.find(C=>C.id===m.id)))},K=e=>{B.includes(e)?j([]):j([e])},E=()=>{if(F===lbAnnotation.EToolName.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Te=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},me=i.filter(e=>!p.includes(e.attribute)),ve=x.filter(e=>!p.includes(e.attribute)),Pe=R.filter(e=>e.attribute&&!p.includes(e.attribute)),ze=e=>{if(p.includes(e))T(p.filter(s=>s!==e));else{const s=p.concat(e);T(s)}},We=(e=me,s=A,m=ve,C=Pe,w=W)=>{var V;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(m),f==null||f.updateLineList(C),g==null||g.generateBoxes(e),g==null||g.generateSpheres(m),(V=L==null?void 0:L.store)==null||V.updateCurrentSegment(w),Ie(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Ge=()=>{X(void 0),$(void 0),te(void 0),oe(void 0)},Ie=(e,s,m)=>__async(void 0,null,function*(){var C,w,V;if(!g)return;const Se=g.pointCloudObject;if(!Se)return;let Ce=[],we=[];try{if(s&&q.record.length){const{record:y,recordIndex:b}=q;let ye=b;b>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&s.length===((C=y[b])==null?void 0:C.pointCloudBoxList.length))&&(ye=b-1);let Ke=(w=y[ye])==null?void 0:w.pointCloudBoxList;const be=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,s,Ke);Ce=be.modifiedBoxIds,we=be.resetAreas}}catch(y){console.error("call calcResetAreasAndBoxIds error",y)}try{const y=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:G,points:Se.geometry.attributes.position.array}),b=yield g==null?void 0:g.highlightOriginPointCloud(s,y,{modifiedBoxIds:Ce,resetAreas:we});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(y){console.error("call highlightOriginPointCloud error",y)}});return{selectedID:ae,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:me,displaySphereList:ve,displayLineList:Pe,selectedIDs:v,setPointCloudResult:he,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:D,valid:U,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:c,addHighlightID:K,selectedAllBoxes:E,topViewInstance:f,setTopViewInstance:X,sideViewInstance:Y,setSideViewInstance:$,backViewInstance:ee,setBackViewInstance:te,mainViewInstance:g,setMainViewInstance:oe,polygonList:A,setPolygonList:O,rectList:I,setRectList:u,addRectIn2DView:S,removeRectIn2DView:k,updateRectIn2DView:P,lineList:R,setLineList:Re,zoom:Q,setZoom:Ae,history:q,toggleAttributesVisible:ze,hideAttributes:p,setHideAttributes:T,reRender:We,attrPanelLayout:ie,setAttrPanelLayout:Ve,syncAllViewPointCloudColor:Ie,defaultAttribute:ne,setDefaultAttribute:Be,pointCloudPattern:F,setPointCloudPattern:_e,selectSpecAttr:Te,globalPattern:z,setGlobalPattern:e=>{z!==e&&(Oe(actionCreators.ChangeSave),Ne(e),e===lbUtils.EPointCloudPattern.Detection&&se(void 0))},ptSegmentInstance:L,setPtSegmentInstance:se,segmentation:W,setSegmentation:He,clearAllDetectionInstance:Ge,highlight2DDataList:G,setHighlight2DDataList:Me,highlight2DLoading:re,setHighlight2DLoading:ke,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:De,imageSizes:le,cacheImageNodeSize:je,highlightIDs:B,setHighlightIDs:j,removeRectByPointCloudBoxId:ce,removeRectBySpecifyId:H,addRectFromPointCloudBoxByImageName:ue,rectRotateSensitivity:Z,setRectRotateSensitivity:Le,imageNamePointCloudBoxMap:ge,linkageImageNameRectMap:pe,updateRectListByReducer:fe,windowKeydownListenerHook:de}},[U,v,i,x,A,R,I,f,Y,ee,g,Q,p,ie,ne,F,z,L,W,G,re,J,le,B,ce,H,ue,Z,ge,pe,fe,de]);React.useEffect(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,B),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,B]),React.useEffect(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const qe=()=>{const o=i.filter(l=>p.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return React.useEffect(()=>{var o,n,t,a;qe(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,p),(a=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,p)},[p]),React__default.default.createElement(PointCloudContext.Provider,{value:M},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate90_black=require("../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),icon_del_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js"),lassoSelector=require("../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),icon_rect=require("../../../../../../assets/annotation/rectTool/icon_rect.svg.js"),circleSelector=require("../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),addSvg=require("../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js"),clearSvg=require("../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js"),Image2DBoxScale$1=require("../../../../../../assets/annotation/pointCloudTool/Image2DBoxScale.svg.js"),React=require("react"),icons=require("@ant-design/icons"),index$1=require("../polygon/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj]},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate90={name:"Rotate90",icon:rotate90_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},deleteBox={name:"Delete",icon:icon_del_kj,shortCut:["Del"],noticeInfo:"SelectedStatus"},LassoSelector={name:"LassoSelector",icon:lassoSelector,shortCut:["H"],noticeInfo:"SelectorMsg"},RectSelector={name:"RectSelector",icon:icon_rect,shortCut:["J"],noticeInfo:"SelectorMsg"},CircleSelector={name:"CircleSelector",icon:circleSelector,shortCut:["K"],noticeInfo:"SelectorMsg"},Drag3DBySpace={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:["space",icon_mouse_right_kj]},AddMove={name:"AddPoint",icon:addSvg,shortCut:["U"]},DeletePoint={name:"DeletePoint",icon:clearSvg,shortCut:["I"]},Image2DBoxScale={name:"Image2DBoxScale",icon:Image2DBoxScale$1,shortCut:["P"],noticeInfo:"SelectedRect"},pointCloudShortCutTable=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"RectPattern"},CopyBox,PasteBox,LeftRotate,RightRotate,PrevBox,NextBox,Rotate90,CopyPrevPage,ChangeBoxInvalid,deleteBox,SelectMulti,SelectAll,index.fullScreen,Image2DBoxScale],pointCloudShortCutTable_POLYGON=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"PolygonPattern"},index$1.polygon,index$1.invalidPolygon,index$1.selectedPolygon,index$1.changePolygonAttribute,index$1.deletePolygon,index$1.insertPolygonPoint,index$1.deletePolygonPoint],pointCloudShortCutTable_SEGMENT=[index.backward,index.forward,rotateRoundCenter,Drag3DBySpace,LassoSelector,RectSelector,CircleSelector,AddMove,DeletePoint];exports.default=pointCloudShortCutTable,exports.pointCloudShortCutTable_POLYGON=pointCloudShortCutTable_POLYGON,exports.pointCloudShortCutTable_SEGMENT=pointCloudShortCutTable_SEGMENT;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate90_black=require("../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),icon_del_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js"),lassoSelector=require("../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),icon_rect=require("../../../../../../assets/annotation/rectTool/icon_rect.svg.js"),circleSelector=require("../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),addSvg=require("../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js"),clearSvg=require("../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js"),Image2DBoxScale$1=require("../../../../../../assets/annotation/pointCloudTool/Image2DBoxScale.svg.js"),React=require("react"),icons=require("@ant-design/icons"),index$1=require("../polygon/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj]},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate90={name:"Rotate90",icon:rotate90_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},deleteBox={name:"Delete",icon:icon_del_kj,shortCut:["Del"],noticeInfo:"SelectedStatus"},LassoSelector={name:"LassoSelector",icon:lassoSelector,shortCut:["H"],noticeInfo:"SelectorMsg"},RectSelector={name:"RectSelector",icon:icon_rect,shortCut:["J"],noticeInfo:"SelectorMsg"},CircleSelector={name:"CircleSelector",icon:circleSelector,shortCut:["K"],noticeInfo:"SelectorMsg"},Drag3DBySpace={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:["space",icon_mouse_right_kj]},AddMove={name:"AddPoint",icon:addSvg,shortCut:["U"]},DeletePoint={name:"DeletePoint",icon:clearSvg,shortCut:["I"]},Image2DBoxScale={name:"Image2DBoxScale",icon:Image2DBoxScale$1,shortCut:["R"],noticeInfo:"SelectedRect"},pointCloudShortCutTable=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"RectPattern"},CopyBox,PasteBox,LeftRotate,RightRotate,PrevBox,NextBox,Rotate90,CopyPrevPage,ChangeBoxInvalid,deleteBox,SelectMulti,SelectAll,index.fullScreen,Image2DBoxScale],pointCloudShortCutTable_POLYGON=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"PolygonPattern"},index$1.polygon,index$1.invalidPolygon,index$1.selectedPolygon,index$1.changePolygonAttribute,index$1.deletePolygon,index$1.insertPolygonPoint,index$1.deletePolygonPoint],pointCloudShortCutTable_SEGMENT=[index.backward,index.forward,rotateRoundCenter,Drag3DBySpace,LassoSelector,RectSelector,CircleSelector,AddMove,DeletePoint];exports.default=pointCloudShortCutTable,exports.pointCloudShortCutTable_POLYGON=pointCloudShortCutTable_POLYGON,exports.pointCloudShortCutTable_SEGMENT=pointCloudShortCutTable_SEGMENT;
@@ -1 +1 @@
1
- import{EPointCloudPattern as Y}from"@labelbee/lb-utils";import Ne,{useState as r,useRef as dt,useMemo as F,useCallback as N,useEffect as $}from"react";import{EPointCloudBoxRenderTrigger as E,calcResetAreasAndBoxIds as ct}from"../../utils/ToolPointCloudBoxRenderHelper.js";import{ActionsHistory as He,EToolName as ee,uuid as ut}from"@labelbee/lb-annotation";import{useDispatch as gt}from"../../store/ctx.js";import{ChangeSave as pt}from"../../store/annotation/actionCreators.js";import ft from"../../store/annotatedBox/index.js";import Oe from"lodash";import{addMapIndirectWeakSetItem as Me}from"./utils/map.js";import mt from"./hooks/useTimeoutFunc.js";import ht,{getEmptyUseWindowKeydownListener as It}from"./hooks/useWindowKeydownListener.js";var vt=Object.defineProperty,Pt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ke=(d,i,c)=>i in d?vt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c,z=(d,i)=>{for(var c in i||(i={}))yt.call(i,c)&&ke(d,c,i[c]);if(je)for(var c of je(i))Ct.call(i,c)&&ke(d,c,i[c]);return d},Fe=(d,i)=>Pt(d,wt(i)),Rt=(d,i,c)=>new Promise((x,A)=>{var B=g=>{try{w(c.next(g))}catch(L){A(L)}},K=g=>{try{w(c.throw(g))}catch(L){A(L)}},w=g=>g.done?x(g.value):Promise.resolve(g.value).then(B,K);w((c=c.apply(d,i)).next())});const G=d=>Oe.pick(d,["id","attribute","width","height","x","y","imageName"]),Ee=Ne.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new He,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:ee.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:Y.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:d=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:d=>!1,removeRectBySpecifyId:(d,i,c)=>!1,removeRectByPointCloudBoxId:d=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:It()}),St=({children:d})=>{const[i,c]=r([]),[x,A]=r([]),[B,K]=r([]),[w,g]=r([]),[L,ze]=r([]),[v,H]=r([]),[_,T]=r([]),[te,Ge]=r(!0),[oe,Ke]=r(2),[ne,Te]=r(!0),[ie,We]=r(1),[f,se]=r(),[re,le]=r(),[ae,de]=r(),[p,ce]=r(),[ue,Ze]=r(""),[W,Ue]=r(ee.Rect),Z=dt(new He).current,[m,U]=r([]),[ge,qe]=r(""),[q,Je]=r(Y.Detection),[D,pe]=r(void 0),[J,Qe]=r([]),[Q,Xe]=r([]),[fe,Ye]=r(!1),h=ft(),[me,$e]=r({}),et=gt(),tt=o=>{const{imgNode:n,path:t}=o;t&&n&&$e(a=>Fe(z({},a),{[t]:{width:n.width,height:n.height}}))},he=F(()=>v.length===1?v[0]:"",[v]),Ie=ht(),O=N((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return g(u=>{let y=!1;const P=u.filter(j=>{const X=j[a],k=l.has(X)?j.imageName!==o:!0;return k||(y=!0),k});return y?P:u}),!0},[]),ve=N(o=>{const n=i.map(t=>t.id);return O(o,n,"extId")},[i,O]),Pe=N(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:u}=t,y=t.rects.find(P=>P.imageName===o);if(y){const P=Oe.pick(y,["width","height","x","y","imageName"]);return Fe(z({},P),{id:ut(),attribute:l,order:u,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(g(t=>{const a=new Set(t.filter(u=>o===u.imageName).map(u=>u.extId)),l=n.filter(u=>a.has(u.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),we=F(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:u}=l;if(!u){console.warn("Missing image name"),console.trace(l,t);return}Me(n,u,t.id,t)}),n},new Map),[i]),ye=N(o=>{g(n=>o(n,G))},[G]),Ce=F(()=>w.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(Me(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,w),o)},new Map),[w]),{fn:ot}=mt(o=>{H(n=>{const t=o,a=new Set(t);let l=!1;const u=n.filter(y=>{const P=a.has(y);return P||(l=!0),P});return l?u:n})},200),Re=N(o=>{const n=o.map(t=>t.id);c(o),ot(n)},[]),M=F(()=>{const o=i.find(e=>e.id===he),n=e=>{const s=i.concat(e);return Re(s),s},t=e=>{const s=x.concat(e);return A(s),s},a=e=>{Ge(e!==!1)},l=e=>{e===void 0&&H([]),typeof e=="string"&&H([e]),Array.isArray(e)&&H(Array.from(new Set(e)))},u=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},y=e=>{const s=G(e);g(I=>[...I,s])},P=(e,s=!1)=>{const I=G(e);g(C=>C.map(R=>R.id===e.id?s?z(z({},R),I):I:R))},j=e=>{g(s=>s.filter(I=>!e.find(C=>C.id===I.id)))},X=e=>{_.includes(e)?T([]):T([e])},k=()=>{if(W===ee.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},it=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},Se=i.filter(e=>!m.includes(e.attribute)),be=x.filter(e=>!m.includes(e.attribute)),Le=L.filter(e=>e.attribute&&!m.includes(e.attribute)),st=e=>{if(m.includes(e))U(m.filter(s=>s!==e));else{const s=m.concat(e);U(s)}},rt=(e=Se,s=B,I=be,C=Le,R=J)=>{var V;p==null||p.clearAllBox(),p==null||p.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(I),f==null||f.updateLineList(C),p==null||p.generateBoxes(e),p==null||p.generateSpheres(I),(V=D==null?void 0:D.store)==null||V.updateCurrentSegment(R),xe(E.Default,e)},lt=()=>{se(void 0),le(void 0),de(void 0),ce(void 0)},xe=(e,s,I)=>Rt(void 0,null,function*(){var C,R,V;if(!p)return;const De=p.pointCloudObject;if(!De)return;let Ae=[],Be=[];try{if(s&&Z.record.length){const{record:S,recordIndex:b}=Z;let _e=b;b>0&&(e===E.SingleToggleValid||e===E.SingleRotate||e===E.Single&&s.length===((C=S[b])==null?void 0:C.pointCloudBoxList.length))&&(_e=b-1);let at=(R=S[_e])==null?void 0:R.pointCloudBoxList;const Ve=ct(e,s,at);Ae=Ve.modifiedBoxIds,Be=Ve.resetAreas}}catch(S){console.error("call calcResetAreasAndBoxIds error",S)}try{const S=yield p.getHighlightIndexByMappingImgList({mappingImgList:I!=null?I:Q,points:De.geometry.attributes.position.array}),b=yield p==null?void 0:p.highlightOriginPointCloud(s,S,{modifiedBoxIds:Ae,resetAreas:Be});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(S){console.error("call highlightOriginPointCloud error",S)}});return{selectedID:he,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:Se,displaySphereList:be,displayLineList:Le,selectedIDs:v,setPointCloudResult:Re,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:A,valid:te,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:u,addHighlightID:X,selectedAllBoxes:k,topViewInstance:f,setTopViewInstance:se,sideViewInstance:re,setSideViewInstance:le,backViewInstance:ae,setBackViewInstance:de,mainViewInstance:p,setMainViewInstance:ce,polygonList:B,setPolygonList:K,rectList:w,setRectList:g,addRectIn2DView:y,removeRectIn2DView:j,updateRectIn2DView:P,lineList:L,setLineList:ze,zoom:ie,setZoom:We,history:Z,toggleAttributesVisible:st,hideAttributes:m,setHideAttributes:U,reRender:rt,attrPanelLayout:ge,setAttrPanelLayout:qe,syncAllViewPointCloudColor:xe,defaultAttribute:ue,setDefaultAttribute:Ze,pointCloudPattern:W,setPointCloudPattern:Ue,selectSpecAttr:it,globalPattern:q,setGlobalPattern:e=>{q!==e&&(et(pt),Je(e),e===Y.Detection&&pe(void 0))},ptSegmentInstance:D,setPtSegmentInstance:pe,segmentation:J,setSegmentation:Qe,clearAllDetectionInstance:lt,highlight2DDataList:Q,setHighlight2DDataList:Xe,highlight2DLoading:fe,setHighlight2DLoading:Ye,cuboidBoxIn2DView:ne,setCuboidBoxIn2DView:Te,imageSizes:me,cacheImageNodeSize:tt,highlightIDs:_,setHighlightIDs:T,removeRectByPointCloudBoxId:ve,removeRectBySpecifyId:O,addRectFromPointCloudBoxByImageName:Pe,rectRotateSensitivity:oe,setRectRotateSensitivity:Ke,imageNamePointCloudBoxMap:we,linkageImageNameRectMap:Ce,updateRectListByReducer:ye,windowKeydownListenerHook:Ie}},[te,v,i,x,B,L,w,f,re,ae,p,ie,m,ge,ue,W,q,D,J,Q,fe,ne,me,_,ve,O,Pe,oe,we,Ce,ye,Ie]);$(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,_),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,_]),$(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const nt=()=>{const o=i.filter(l=>m.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return $(()=>{var o,n,t,a;nt(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,m),(a=(t=D==null?void 0:D.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,m)},[m]),Ne.createElement(Ee.Provider,{value:M},d)};export{Ee as PointCloudContext,St as PointCloudProvider};
1
+ import{EPointCloudPattern as Y}from"@labelbee/lb-utils";import Ne,{useState as r,useRef as dt,useMemo as F,useCallback as N,useEffect as $}from"react";import{EPointCloudBoxRenderTrigger as E,calcResetAreasAndBoxIds as ct}from"../../utils/ToolPointCloudBoxRenderHelper.js";import{ActionsHistory as He,EToolName as ee,uuid as ut}from"@labelbee/lb-annotation";import{useDispatch as gt}from"../../store/ctx.js";import{ChangeSave as pt}from"../../store/annotation/actionCreators.js";import ft from"../../store/annotatedBox/index.js";import Oe from"lodash";import{addMapIndirectWeakSetItem as Me}from"./utils/map.js";import mt from"./hooks/useTimeoutFunc.js";import ht,{getEmptyUseWindowKeydownListener as It}from"./hooks/useWindowKeydownListener.js";var vt=Object.defineProperty,Pt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ke=(d,i,c)=>i in d?vt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c,z=(d,i)=>{for(var c in i||(i={}))yt.call(i,c)&&ke(d,c,i[c]);if(je)for(var c of je(i))Ct.call(i,c)&&ke(d,c,i[c]);return d},Fe=(d,i)=>Pt(d,wt(i)),Rt=(d,i,c)=>new Promise((x,A)=>{var B=g=>{try{w(c.next(g))}catch(L){A(L)}},K=g=>{try{w(c.throw(g))}catch(L){A(L)}},w=g=>g.done?x(g.value):Promise.resolve(g.value).then(B,K);w((c=c.apply(d,i)).next())});const G=d=>Oe.pick(d,["id","attribute","width","height","x","y","imageName"]),Ee=Ne.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new He,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:ee.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:Y.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:d=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:d=>!1,removeRectBySpecifyId:(d,i,c)=>!1,removeRectByPointCloudBoxId:d=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:It()}),St=({children:d})=>{const[i,c]=r([]),[x,A]=r([]),[B,K]=r([]),[w,g]=r([]),[L,ze]=r([]),[v,H]=r([]),[_,T]=r([]),[te,Ge]=r(!0),[oe,Ke]=r(2),[ne,Te]=r(!0),[ie,We]=r(1),[f,se]=r(),[re,le]=r(),[ae,de]=r(),[p,ce]=r(),[ue,Ze]=r(""),[W,Ue]=r(ee.Rect),Z=dt(new He).current,[m,U]=r([]),[ge,qe]=r(""),[q,Je]=r(Y.Detection),[D,pe]=r(void 0),[J,Qe]=r([]),[Q,Xe]=r([]),[fe,Ye]=r(!1),h=ft(),[me,$e]=r({}),et=gt(),tt=o=>{const{imgNode:n,path:t}=o;t&&n&&$e(a=>Fe(z({},a),{[t]:{width:n.width,height:n.height}}))},he=F(()=>v.length===1?v[0]:"",[v]),Ie=ht(),O=N((o,n,t="extId")=>{const a=t||"id",l=new Set(n);return g(u=>{let y=!1;const P=u.filter(j=>{const X=j[a],k=l.has(X)?j.imageName!==o:!0;return k||(y=!0),k});return y?P:u}),!0},[]),ve=N(o=>{const n=i.map(t=>t.id);return O(o,n,"extId")},[i,O]),Pe=N(o=>{if(!o)return!1;const n=i.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:l,trackID:u}=t,y=t.rects.find(P=>P.imageName===o);if(y){const P=Oe.pick(y,["width","height","x","y","imageName"]);return Fe(z({},P),{id:ut(),attribute:l,order:u,extId:a})}return null}).filter(t=>t!==null);return n.length?(g(t=>{const a=new Set(t.filter(u=>o===u.imageName).map(u=>u.extId)),l=n.filter(u=>a.has(u.extId)===!1);return l.length?[...t,...l]:t}),!0):!1},[i]),we=F(()=>i.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(l=>{const{imageName:u}=l;if(!u){console.warn("Missing image name"),console.trace(l,t);return}Me(n,u,t.id,t)}),n},new Map),[i]),ye=N(o=>{g(n=>o(n,G))},[G]),Ce=F(()=>w.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(Me(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,w),o)},new Map),[w]),{fn:ot}=mt(o=>{H(n=>{const t=o,a=new Set(t);let l=!1;const u=n.filter(y=>{const P=a.has(y);return P||(l=!0),P});return l?u:n})},200),Re=N(o=>{const n=o.map(t=>t.id);c(o),ot(n)},[]),M=F(()=>{const o=i.find(e=>e.id===he),n=e=>{const s=i.concat(e);return Re(s),s},t=e=>{const s=x.concat(e);return A(s),s},a=e=>{Ge(e!==!1)},l=e=>{e===void 0&&H([]),typeof e=="string"&&H([e]),Array.isArray(e)&&H(Array.from(new Set(e)))},u=e=>{v.includes(e)?l(v.filter(s=>s!==e)):l([...v,e])},y=e=>{const s=G(e);g(I=>[...I,s])},P=(e,s=!1)=>{const I=G(e);g(C=>C.map(R=>R.id===e.id?s?z(z({},R),I):I:R))},j=e=>{g(s=>s.filter(I=>!e.find(C=>C.id===I.id)))},X=e=>{_.includes(e)?T([]):T([e])},k=()=>{if(W===ee.Rect){const e=i.map(s=>s.id);l(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},it=e=>{l(i.filter(s=>s.attribute===e).map(s=>s.id))},Se=i.filter(e=>!m.includes(e.attribute)),be=x.filter(e=>!m.includes(e.attribute)),Le=L.filter(e=>e.attribute&&!m.includes(e.attribute)),st=e=>{if(m.includes(e))U(m.filter(s=>s!==e));else{const s=m.concat(e);U(s)}},rt=(e=Se,s=B,I=be,C=Le,R=J)=>{var V;p==null||p.clearAllBox(),p==null||p.clearAllSphere(),f==null||f.updatePolygonList(e,s),f==null||f.updatePointList(I),f==null||f.updateLineList(C),p==null||p.generateBoxes(e),p==null||p.generateSpheres(I),(V=D==null?void 0:D.store)==null||V.updateCurrentSegment(R),xe(E.Default,e)},lt=()=>{se(void 0),le(void 0),de(void 0),ce(void 0)},xe=(e,s,I)=>Rt(void 0,null,function*(){var C,R,V;if(!p)return;const De=p.pointCloudObject;if(!De)return;let Ae=[],Be=[];try{if(s&&Z.record.length){const{record:S,recordIndex:b}=Z;let _e=b;b>0&&(e===E.SingleToggleValid||e===E.SingleRotate||e===E.Single&&s.length===((C=S[b])==null?void 0:C.pointCloudBoxList.length))&&(_e=b-1);let at=(R=S[_e])==null?void 0:R.pointCloudBoxList;const Ve=ct(e,s,at);Ae=Ve.modifiedBoxIds,Be=Ve.resetAreas}}catch(S){console.error("call calcResetAreasAndBoxIds error",S)}try{const S=yield p.getHighlightIndexByMappingImgList({mappingImgList:I!=null?I:Q,points:De.geometry.attributes.position.array}),b=yield p==null?void 0:p.highlightOriginPointCloud(s,S,{modifiedBoxIds:Ae,resetAreas:Be});return b&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(b)),b}catch(S){console.error("call highlightOriginPointCloud error",S)}});return{selectedID:he,pointCloudBoxList:i,pointCloudSphereList:x,displayPointCloudList:Se,displaySphereList:be,displayLineList:Le,selectedIDs:v,setPointCloudResult:Re,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:A,valid:te,selectedPointCloudBox:o,setPointCloudValid:a,addSelectedID:u,addHighlightID:X,selectedAllBoxes:k,topViewInstance:f,setTopViewInstance:se,sideViewInstance:re,setSideViewInstance:le,backViewInstance:ae,setBackViewInstance:de,mainViewInstance:p,setMainViewInstance:ce,polygonList:B,setPolygonList:K,rectList:w,setRectList:g,addRectIn2DView:y,removeRectIn2DView:j,updateRectIn2DView:P,lineList:L,setLineList:ze,zoom:ie,setZoom:We,history:Z,toggleAttributesVisible:st,hideAttributes:m,setHideAttributes:U,reRender:rt,attrPanelLayout:ge,setAttrPanelLayout:qe,syncAllViewPointCloudColor:xe,defaultAttribute:ue,setDefaultAttribute:Ze,pointCloudPattern:W,setPointCloudPattern:Ue,selectSpecAttr:it,globalPattern:q,setGlobalPattern:e=>{q!==e&&(et(pt),Je(e),e===Y.Detection&&pe(void 0))},ptSegmentInstance:D,setPtSegmentInstance:pe,segmentation:J,setSegmentation:Qe,clearAllDetectionInstance:lt,highlight2DDataList:Q,setHighlight2DDataList:Xe,highlight2DLoading:fe,setHighlight2DLoading:Ye,cuboidBoxIn2DView:ne,setCuboidBoxIn2DView:Te,imageSizes:me,cacheImageNodeSize:tt,highlightIDs:_,setHighlightIDs:T,removeRectByPointCloudBoxId:ve,removeRectBySpecifyId:O,addRectFromPointCloudBoxByImageName:Pe,rectRotateSensitivity:oe,setRectRotateSensitivity:Ke,imageNamePointCloudBoxMap:we,linkageImageNameRectMap:Ce,updateRectListByReducer:ye,windowKeydownListenerHook:Ie}},[te,v,i,x,B,L,w,f,re,ae,p,ie,m,ge,ue,W,q,D,J,Q,fe,ne,me,_,ve,O,Pe,oe,we,Ce,ye,Ie]);$(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,i),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,_),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[i,v,_]),$(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const nt=()=>{const o=i.filter(l=>m.includes(l.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(l=>l.id);a.length>0&&n(v.filter(l=>!a.includes(l))),t()};return $(()=>{var o,n,t,a;nt(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,m),(a=(t=D==null?void 0:D.store)==null?void 0:t.setHiddenAttributes)==null||a.call(t,m)},[m]),Ne.createElement(Ee.Provider,{value:M},d)};export{Ee as PointCloudContext,St as PointCloudProvider};
@@ -1 +1 @@
1
- import{backward as e,forward as n,scale as i,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import S from"../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js";import v from"../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js";import P from"../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import T from"../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js";import x from"../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import y from"../../../../../../assets/annotation/rectTool/icon_rect.svg.js";import I from"../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import R from"../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js";import B from"../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js";import _ from"../../../../../../assets/annotation/pointCloudTool/Image2DBoxScale.svg.js";import t from"react";import{ReloadOutlined as $,RotateLeftOutlined as b,RotateRightOutlined as D}from"@ant-design/icons";import{polygon as k,invalidPolygon as A,selectedPolygon as V,changePolygonAttribute as M,deletePolygon as O,insertPolygonPoint as w,deletePolygonPoint as E}from"../polygon/index.js";const r={name:"PointThickness",icon:t.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},a={name:"RotateAroundCenterPoint",icon:t.createElement($,null),shortCut:[C],noticeInfo:"DragOperation"},c={name:"PointCloudViewTranslate",icon:s,shortCut:[o],noticeInfo:"Drag"},m={name:"TopViewTranslate",icon:s,shortCut:[o]},g={name:"ChangePointCloudValid",icon:d,shortCut:["V"]},H={name:"CopyBox",icon:l,shortCut:["Ctrl","C"]},K={name:"PasteBox",icon:h,shortCut:["Ctrl","V"]},L={name:"RotateLeft",icon:t.createElement(b,null),shortCut:["Q"]},G={name:"RotateRight",icon:t.createElement(D,null),shortCut:["E"]},N={name:"PreviousBox",icon:f,shortCut:["Shift","Tab"]},z={name:"NextBox",icon:p,shortCut:["Tab"]},F={name:"Rotate90",icon:S,shortCut:["G"],noticeInfo:"SelectedStatus"},J={name:"CopyPrevPage",icon:l,shortCut:["Alt","C"]},Q={name:"ChangeBoxValid",icon:j,shortCut:["F"],noticeInfo:"SelectedStatus"},U={name:"MultiSelect",icon:P,shortCut:["Ctrl",o]},Y={name:"SelectAllBox",icon:v,shortCut:["Ctrl","A"]},q={name:"Delete",icon:T,shortCut:["Del"],noticeInfo:"SelectedStatus"},W={name:"LassoSelector",icon:x,shortCut:["H"],noticeInfo:"SelectorMsg"},X={name:"RectSelector",icon:y,shortCut:["J"],noticeInfo:"SelectorMsg"},Z={name:"CircleSelector",icon:I,shortCut:["K"],noticeInfo:"SelectorMsg"},oo={name:"PointCloudViewTranslate",icon:s,shortCut:["space",o]},to={name:"AddPoint",icon:R,shortCut:["U"]},eo={name:"DeletePoint",icon:B,shortCut:["I"]},no={name:"Image2DBoxScale",icon:_,shortCut:["P"],noticeInfo:"SelectedRect"},so=[{name:"GeneralOperation"},e,n,r,i,a,c,m,g,{name:"RectPattern"},H,K,L,G,N,z,F,J,Q,q,U,Y,u,no],ao=[{name:"GeneralOperation"},e,n,r,i,a,c,m,g,{name:"PolygonPattern"},k,A,V,M,O,w,E],io=[e,n,a,oo,W,X,Z,to,eo];export{so as default,ao as pointCloudShortCutTable_POLYGON,io as pointCloudShortCutTable_SEGMENT};
1
+ import{backward as e,forward as n,scale as i,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import S from"../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js";import v from"../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js";import P from"../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import T from"../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js";import x from"../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import y from"../../../../../../assets/annotation/rectTool/icon_rect.svg.js";import R from"../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import I from"../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js";import B from"../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js";import _ from"../../../../../../assets/annotation/pointCloudTool/Image2DBoxScale.svg.js";import t from"react";import{ReloadOutlined as $,RotateLeftOutlined as b,RotateRightOutlined as D}from"@ant-design/icons";import{polygon as k,invalidPolygon as A,selectedPolygon as V,changePolygonAttribute as M,deletePolygon as O,insertPolygonPoint as w,deletePolygonPoint as E}from"../polygon/index.js";const r={name:"PointThickness",icon:t.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},a={name:"RotateAroundCenterPoint",icon:t.createElement($,null),shortCut:[C],noticeInfo:"DragOperation"},c={name:"PointCloudViewTranslate",icon:s,shortCut:[o],noticeInfo:"Drag"},m={name:"TopViewTranslate",icon:s,shortCut:[o]},g={name:"ChangePointCloudValid",icon:d,shortCut:["V"]},H={name:"CopyBox",icon:l,shortCut:["Ctrl","C"]},K={name:"PasteBox",icon:h,shortCut:["Ctrl","V"]},L={name:"RotateLeft",icon:t.createElement(b,null),shortCut:["Q"]},G={name:"RotateRight",icon:t.createElement(D,null),shortCut:["E"]},N={name:"PreviousBox",icon:f,shortCut:["Shift","Tab"]},z={name:"NextBox",icon:p,shortCut:["Tab"]},F={name:"Rotate90",icon:S,shortCut:["G"],noticeInfo:"SelectedStatus"},J={name:"CopyPrevPage",icon:l,shortCut:["Alt","C"]},Q={name:"ChangeBoxValid",icon:j,shortCut:["F"],noticeInfo:"SelectedStatus"},U={name:"MultiSelect",icon:P,shortCut:["Ctrl",o]},Y={name:"SelectAllBox",icon:v,shortCut:["Ctrl","A"]},q={name:"Delete",icon:T,shortCut:["Del"],noticeInfo:"SelectedStatus"},W={name:"LassoSelector",icon:x,shortCut:["H"],noticeInfo:"SelectorMsg"},X={name:"RectSelector",icon:y,shortCut:["J"],noticeInfo:"SelectorMsg"},Z={name:"CircleSelector",icon:R,shortCut:["K"],noticeInfo:"SelectorMsg"},oo={name:"PointCloudViewTranslate",icon:s,shortCut:["space",o]},to={name:"AddPoint",icon:I,shortCut:["U"]},eo={name:"DeletePoint",icon:B,shortCut:["I"]},no={name:"Image2DBoxScale",icon:_,shortCut:["R"],noticeInfo:"SelectedRect"},so=[{name:"GeneralOperation"},e,n,r,i,a,c,m,g,{name:"RectPattern"},H,K,L,G,N,z,F,J,Q,q,U,Y,u,no],ao=[{name:"GeneralOperation"},e,n,r,i,a,c,m,g,{name:"PolygonPattern"},k,A,V,M,O,w,E],io=[e,n,a,oo,W,X,Z,to,eo];export{so as default,ao as pointCloudShortCutTable_POLYGON,io as pointCloudShortCutTable_SEGMENT};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.23.0-alpha.84",
3
+ "version": "1.23.0-alpha.86",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.27.0-alpha.43",
46
+ "@labelbee/lb-annotation": "1.27.0-alpha.45",
47
47
  "@labelbee/lb-utils": "1.19.0-alpha.19",
48
48
  "@labelbee/wavesurfer": "1.0.0",
49
49
  "@types/react-dom": "^18.2.7",