@labelbee/lb-components 1.24.0-alpha.23 → 1.24.0-alpha.24
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,s,c)=>s in r?__defProp(r,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[s]=c,__spreadValues=(r,s)=>{for(var c in s||(s={}))__hasOwnProp.call(s,c)&&__defNormalProp(r,c,s[c]);if(__getOwnPropSymbols)for(var c of __getOwnPropSymbols(s))__propIsEnum.call(s,c)&&__defNormalProp(r,c,s[c]);return r},__spreadProps=(r,s)=>__defProps(r,__getOwnPropDescs(s)),__async=(r,s,c)=>new Promise((x,B)=>{var D=u=>{try{P(c.next(u))}catch(R){B(R)}},E=u=>{try{P(c.throw(u))}catch(R){B(R)}},P=u=>u.done?x(u.value):Promise.resolve(u.value).then(D,E);P((c=c.apply(r,s)).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,visibleBatchSetValid:!1,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setBatchSetValidModal:()=>{},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,s,c)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener(),isLargeStatus:!1,setIsLargeStatus:()=>{}}),PointCloudProvider=({children:r})=>{const[s,c]=React.useState([]),[x,B]=React.useState([]),[D,E]=React.useState([]),[P,u]=React.useState([]),[R,Be]=React.useState([]),[v,K]=React.useState([]),[A,O]=React.useState([]),[U,De]=React.useState(!0),[Z,Ae]=React.useState(2),[J,_e]=React.useState(!0),[Q,Ve]=React.useState(1),[f,X]=React.useState(),[Y,$]=React.useState(),[ee,te]=React.useState(),[g,oe]=React.useState(),[ne,Ne]=React.useState(""),[j,He]=React.useState(lbAnnotation.EToolName.Rect),F=React.useRef(new lbAnnotation.ActionsHistory).current,[h,q]=React.useState([]),[ie,Me]=React.useState(""),[T,ke]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,se]=React.useState(void 0),[z,Ee]=React.useState([]),[W,Oe]=React.useState([]),[re,je]=React.useState(!1),[ae,le]=React.useState(!1),p=index(),[de,Fe]=React.useState(!1),[ce,qe]=React.useState({}),Te=ctx.useDispatch(),ze=o=>{const{imgNode:n,path:t}=o;t&&n&&qe(l=>__spreadProps(__spreadValues({},l),{[t]:{width:n.width,height:n.height}}))},ue=React.useMemo(()=>v.length===1?v[0]:"",[v]),ge=useWindowKeydownListener.default(),N=React.useCallback((o,n,t="extId")=>{const l=t||"id",d=new Set(n);return u(a=>{let I=!1;const S=a.filter(M=>{const G=M[l],k=d.has(G)?M.imageName!==o:!0;return k||(I=!0),k});return I?S:a}),!0},[]),fe=React.useCallback(o=>{const n=s.map(t=>t.id);return N(o,n,"extId")},[s,N]),he=React.useCallback(o=>{if(!o)return!1;const n=s.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:l,attribute:d,trackID:a}=t,I=t.rects.find(S=>S.imageName===o);if(I){const S=___default.default.pick(I,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},S),{id:lbAnnotation.uuid(),attribute:d,order:a,extId:l,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const l=new Set(t.filter(a=>o===a.imageName).map(a=>a.extId)),d=n.filter(a=>l.has(a.extId)===!1);return d.length?[...t,...d]:t}),!0):!1},[s]),pe=React.useMemo(()=>s.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var l;return(l=t.rects)==null||l.forEach(d=>{const{imageName:a}=d;if(!a){console.warn("Missing image name"),console.trace(d,t);return}map.addMapIndirectWeakSetItem(n,a,t.id,t)}),n},new Map),[s]),me=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),ve=React.useMemo(()=>P.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,P),o)},new Map),[P]),{fn:We}=useTimeoutFunc.default(o=>{K(n=>{const t=o,l=new Set(t);let d=!1;const a=n.filter(I=>{const S=l.has(I);return S||(d=!0),S});return d?a:n})},200),Se=React.useCallback(o=>{const n=o.map(t=>t.id);c(o),We(n)},[]),H=React.useMemo(()=>{const o=s.find(e=>e.id===ue),n=e=>{const i=s.concat(e);return Se(i),i},t=e=>{const i=x.concat(e);return B(i),i},l=e=>{De(e!==!1)},d=e=>{Fe(e)},a=e=>{let i=[];e===void 0||e===""?i=[]:typeof e=="string"?i=[e]:Array.isArray(e)&&(i=e.length>1?Array.from(new Set(e)):e),K(i)},I=e=>{v.includes(e)?a(v.filter(i=>i!==e)):a([...v,e])},S=e=>{const i=pickRectObject(e);u(m=>[...m,i])},M=(e,i=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?i?__spreadValues(__spreadValues({},w),m):m:w))},G=e=>{u(i=>i.filter(m=>!e.find(C=>C.id===m.id)))},k=e=>{A.includes(e)?O([]):O([e])},Ke=()=>{if(j===lbAnnotation.EToolName.Rect){const e=s.map(i=>i.id);a(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Ue=e=>{a(s.filter(i=>i.attribute===e).map(i=>i.id))},Pe=s.filter(e=>!h.includes(e.attribute)),Ie=x.filter(e=>!h.includes(e.attribute)),Ce=R.filter(e=>e.attribute&&!h.includes(e.attribute)),Ze=e=>{if(h.includes(e))q(h.filter(i=>i!==e));else{const i=h.concat(e);q(i)}},Je=(e=Pe,i=D,m=Ie,C=Ce,w=z)=>{var V;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,i),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),we(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Qe=()=>{X(void 0),$(void 0),te(void 0),oe(void 0)},we=(e,i,m)=>__async(void 0,null,function*(){var C,w,V;if(!g)return;const be=g.pointCloudObject;if(!be)return;let ye=[],Re=[];try{if(i&&F.record.length){const{record:b,recordIndex:y}=F;let xe=y;y>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&i.length===((C=b[y])==null?void 0:C.pointCloudBoxList.length))&&(xe=y-1);let Xe=(w=b[xe])==null?void 0:w.pointCloudBoxList;const Le=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,i,Xe);ye=Le.modifiedBoxIds,Re=Le.resetAreas}}catch(b){console.error("call calcResetAreasAndBoxIds error",b)}try{const b=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:W,points:be.geometry.attributes.position.array}),y=yield g==null?void 0:g.highlightOriginPointCloud(i,b,{modifiedBoxIds:ye,resetAreas:Re});return y&&((V=f==null?void 0:f.pointCloudInstance)==null||V.updateColor(y)),y}catch(b){console.error("call highlightOriginPointCloud error",b)}});return{selectedID:ue,pointCloudBoxList:s,pointCloudSphereList:x,displayPointCloudList:Pe,displaySphereList:Ie,displayLineList:Ce,selectedIDs:v,setPointCloudResult:Se,setSelectedIDs:a,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:B,valid:U,visibleBatchSetValid:de,selectedPointCloudBox:o,setPointCloudValid:l,setBatchSetValidModal:d,addSelectedID:I,addHighlightID:k,selectedAllBoxes:Ke,topViewInstance:f,setTopViewInstance:X,sideViewInstance:Y,setSideViewInstance:$,backViewInstance:ee,setBackViewInstance:te,mainViewInstance:g,setMainViewInstance:oe,polygonList:D,setPolygonList:E,rectList:P,setRectList:u,addRectIn2DView:S,removeRectIn2DView:G,updateRectIn2DView:M,lineList:R,setLineList:Be,zoom:Q,setZoom:Ve,history:F,toggleAttributesVisible:Ze,hideAttributes:h,setHideAttributes:q,reRender:Je,attrPanelLayout:ie,setAttrPanelLayout:Me,syncAllViewPointCloudColor:we,defaultAttribute:ne,setDefaultAttribute:Ne,pointCloudPattern:j,setPointCloudPattern:He,selectSpecAttr:Ue,globalPattern:T,setGlobalPattern:e=>{T!==e&&(Te(actionCreators.ChangeSave),ke(e),e===lbUtils.EPointCloudPattern.Detection&&se(void 0))},ptSegmentInstance:L,setPtSegmentInstance:se,segmentation:z,setSegmentation:Ee,clearAllDetectionInstance:Qe,highlight2DDataList:W,setHighlight2DDataList:Oe,highlight2DLoading:re,setHighlight2DLoading:je,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:_e,imageSizes:ce,cacheImageNodeSize:ze,highlightIDs:A,setHighlightIDs:O,removeRectByPointCloudBoxId:fe,removeRectBySpecifyId:N,addRectFromPointCloudBoxByImageName:he,rectRotateSensitivity:Z,setRectRotateSensitivity:Ae,imageNamePointCloudBoxMap:pe,linkageImageNameRectMap:ve,updateRectListByReducer:me,windowKeydownListenerHook:ge,isLargeStatus:ae,setIsLargeStatus:le}},[U,de,v,s,x,D,R,P,f,Y,ee,g,Q,h,ie,ne,j,T,L,z,W,re,J,ce,A,fe,N,he,Z,pe,ve,me,ge,ae,le]);React.useEffect(()=>{var o,n,t;(o=p==null?void 0:p.setPointCloudBoxList)==null||o.call(p,s),(n=p==null?void 0:p.setHighlightIDs)==null||n.call(p,A),(t=p==null?void 0:p.setSelectedIDs)==null||t.call(p,v)},[s,v,A]),React.useEffect(()=>{var o;(o=p==null?void 0:p.setPtCtx)==null||o.call(p,H)},[H]);const Ge=()=>{const o=s.filter(d=>h.includes(d.attribute)),{setSelectedIDs:n,reRender:t}=H,l=o.map(d=>d.id);l.length>0&&n(v.filter(d=>!l.includes(d))),t()};return React.useEffect(()=>{var o,n,t,l;Ge(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,h),(l=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||l.call(t,h)},[h]),React__default.default.createElement(PointCloudContext.Provider,{value:H},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,s,c)=>s in r?__defProp(r,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[s]=c,__spreadValues=(r,s)=>{for(var c in s||(s={}))__hasOwnProp.call(s,c)&&__defNormalProp(r,c,s[c]);if(__getOwnPropSymbols)for(var c of __getOwnPropSymbols(s))__propIsEnum.call(s,c)&&__defNormalProp(r,c,s[c]);return r},__spreadProps=(r,s)=>__defProps(r,__getOwnPropDescs(s)),__async=(r,s,c)=>new Promise((x,B)=>{var A=u=>{try{P(c.next(u))}catch(y){B(y)}},O=u=>{try{P(c.throw(u))}catch(y){B(y)}},P=u=>u.done?x(u.value):Promise.resolve(u.value).then(A,O);P((c=c.apply(r,s)).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,visibleBatchSetValid:!1,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setBatchSetValidModal:()=>{},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,s,c)=>!1,removeRectByPointCloudBoxId:r=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:useWindowKeydownListener.getEmptyUseWindowKeydownListener(),isLargeStatus:!1,setIsLargeStatus:()=>{}}),PointCloudProvider=({children:r})=>{const[s,c]=React.useState([]),[x,B]=React.useState([]),[A,O]=React.useState([]),[P,u]=React.useState([]),[y,Be]=React.useState([]),[v,Z]=React.useState([]),[V,j]=React.useState([]),[J,Ae]=React.useState(!0),[Q,_e]=React.useState(2),[X,Ve]=React.useState(!0),[Y,Ne]=React.useState(1),[f,$]=React.useState(),[ee,te]=React.useState(),[oe,ne]=React.useState(),[g,ie]=React.useState(),[se,He]=React.useState(""),[F,Me]=React.useState(lbAnnotation.EToolName.Rect),q=React.useRef(new lbAnnotation.ActionsHistory).current,[h,T]=React.useState([]),[re,ke]=React.useState(""),[z,Ee]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,ae]=React.useState(void 0),[W,Oe]=React.useState([]),[G,je]=React.useState([]),[le,Fe]=React.useState(!1),[de,ce]=React.useState(!1),p=index(),[ue,qe]=React.useState(!1),[ge,Te]=React.useState({}),ze=ctx.useDispatch(),We=o=>{const{imgNode:n,path:t}=o;t&&n&&Te(l=>__spreadProps(__spreadValues({},l),{[t]:{width:n.width,height:n.height}}))},fe=React.useMemo(()=>v.length===1?v[0]:"",[v]),he=useWindowKeydownListener.default(),H=React.useCallback((o,n,t="extId")=>{const l=t||"id",d=new Set(n);return u(a=>{let I=!1;const S=a.filter(k=>{const K=k[l],E=d.has(K)?k.imageName!==o:!0;return E||(I=!0),E});return I?S:a}),!0},[]),pe=React.useCallback(o=>{const n=s.map(t=>t.id);return H(o,n,"extId")},[s,H]),me=React.useCallback(o=>{if(!o)return!1;const n=s.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:l,attribute:d,trackID:a}=t,I=t.rects.find(S=>S.imageName===o);if(I){const S=___default.default.pick(I,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},S),{id:lbAnnotation.uuid(),attribute:d,order:a,extId:l,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(u(t=>{const l=new Set(t.filter(a=>o===a.imageName).map(a=>a.extId)),d=n.filter(a=>l.has(a.extId)===!1);return d.length?[...t,...d]:t}),!0):!1},[s]),ve=React.useMemo(()=>s.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var l;return(l=t.rects)==null||l.forEach(d=>{const{imageName:a}=d;if(!a){console.warn("Missing image name"),console.trace(d,t);return}map.addMapIndirectWeakSetItem(n,a,t.id,t)}),n},new Map),[s]),Se=React.useCallback(o=>{u(n=>o(n,pickRectObject))},[pickRectObject]),Pe=React.useMemo(()=>P.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,P),o)},new Map),[P]),{fn:Ge}=useTimeoutFunc.default(o=>{Z(n=>{const t=o,l=new Set(t);let d=!1;const a=n.filter(I=>{const S=l.has(I);return S||(d=!0),S});return d?a:n})},200),Ie=React.useCallback(o=>{const n=o.map(t=>t.id);c(o),Ge(n)},[]),M=React.useMemo(()=>{const o=s.find(e=>e.id===fe),n=e=>{const i=s.concat(e);return Ie(i),i},t=e=>{const i=x.concat(e);return B(i),i},l=e=>{Ae(e!==!1)},d=e=>{qe(e)},a=e=>{let i=[];e===void 0||e===""?i=[]:typeof e=="string"?i=[e]:Array.isArray(e)&&(i=e.length>1?Array.from(new Set(e)):e),Z(i)},I=e=>{v.includes(e)?a(v.filter(i=>i!==e)):a([...v,e])},S=e=>{const i=pickRectObject(e);u(m=>[...m,i])},k=(e,i=!1)=>{const m=pickRectObject(e);u(C=>C.map(w=>w.id===e.id?i?__spreadValues(__spreadValues({},w),m):m:w))},K=e=>{u(i=>i.filter(m=>!e.find(C=>C.id===m.id)))},E=e=>{V.includes(e)?j([]):j([e])},Ue=()=>{if(F===lbAnnotation.EToolName.Rect){const e=s.map(i=>i.id);a(e),f==null||f.pointCloud2dOperation.setSelectedIDs(e)}},Ze=e=>{a(s.filter(i=>i.attribute===e).map(i=>i.id))},Ce=s.filter(e=>!h.includes(e.attribute)),we=x.filter(e=>!h.includes(e.attribute)),be=y.filter(e=>e.attribute&&!h.includes(e.attribute)),Je=e=>{if(h.includes(e))T(h.filter(i=>i!==e));else{const i=h.concat(e);T(i)}},Qe=(e=Ce,i=A,m=we,C=be,w=W)=>{var N;g==null||g.clearAllBox(),g==null||g.clearAllSphere(),f==null||f.updatePolygonList(e,i),f==null||f.updatePointList(m),f==null||f.updateLineList(C),g==null||g.generateBoxes(e),g==null||g.generateSpheres(m),(N=L==null?void 0:L.store)==null||N.updateCurrentSegment(w),ye(ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Default,e)},Xe=()=>{$(void 0),te(void 0),ne(void 0),ie(void 0)},ye=(e,i,m)=>__async(void 0,null,function*(){var C,w,N;if(!g)return;const Re=g.pointCloudObject;if(!Re)return;let xe=[],Le=[];try{if(i&&q.record.length){const{record:b,recordIndex:R}=q;let D=R;R>0&&(e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleToggleValid||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.SingleRotate||e===ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single&&i.length===((C=b[R])==null?void 0:C.pointCloudBoxList.length))&&(D=R-1);let U=(w=b[D])==null?void 0:w.pointCloudBoxList;const De=ToolPointCloudBoxRenderHelper.calcResetAreasAndBoxIds(e,i,U);xe=De.modifiedBoxIds,Le=De.resetAreas}}catch(b){console.error("call calcResetAreasAndBoxIds error",b)}try{const b=yield g.getHighlightIndexByMappingImgList({mappingImgList:m!=null?m:G,points:Re.geometry.attributes.position.array}),R=yield g==null?void 0:g.highlightOriginPointCloud(i,b,{modifiedBoxIds:xe,resetAreas:Le}),{color:D,currentPCDSrc:U}=R!=null?R:{};return D&&((N=f==null?void 0:f.pointCloudInstance)==null||N.updateColor(D,U)),D}catch(b){console.error("call highlightOriginPointCloud error",b)}});return{selectedID:fe,pointCloudBoxList:s,pointCloudSphereList:x,displayPointCloudList:Ce,displaySphereList:we,displayLineList:be,selectedIDs:v,setPointCloudResult:Ie,setSelectedIDs:a,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:B,valid:J,visibleBatchSetValid:ue,selectedPointCloudBox:o,setPointCloudValid:l,setBatchSetValidModal:d,addSelectedID:I,addHighlightID:E,selectedAllBoxes:Ue,topViewInstance:f,setTopViewInstance:$,sideViewInstance:ee,setSideViewInstance:te,backViewInstance:oe,setBackViewInstance:ne,mainViewInstance:g,setMainViewInstance:ie,polygonList:A,setPolygonList:O,rectList:P,setRectList:u,addRectIn2DView:S,removeRectIn2DView:K,updateRectIn2DView:k,lineList:y,setLineList:Be,zoom:Y,setZoom:Ne,history:q,toggleAttributesVisible:Je,hideAttributes:h,setHideAttributes:T,reRender:Qe,attrPanelLayout:re,setAttrPanelLayout:ke,syncAllViewPointCloudColor:ye,defaultAttribute:se,setDefaultAttribute:He,pointCloudPattern:F,setPointCloudPattern:Me,selectSpecAttr:Ze,globalPattern:z,setGlobalPattern:e=>{z!==e&&(ze(actionCreators.ChangeSave),Ee(e),e===lbUtils.EPointCloudPattern.Detection&&ae(void 0))},ptSegmentInstance:L,setPtSegmentInstance:ae,segmentation:W,setSegmentation:Oe,clearAllDetectionInstance:Xe,highlight2DDataList:G,setHighlight2DDataList:je,highlight2DLoading:le,setHighlight2DLoading:Fe,cuboidBoxIn2DView:X,setCuboidBoxIn2DView:Ve,imageSizes:ge,cacheImageNodeSize:We,highlightIDs:V,setHighlightIDs:j,removeRectByPointCloudBoxId:pe,removeRectBySpecifyId:H,addRectFromPointCloudBoxByImageName:me,rectRotateSensitivity:Q,setRectRotateSensitivity:_e,imageNamePointCloudBoxMap:ve,linkageImageNameRectMap:Pe,updateRectListByReducer:Se,windowKeydownListenerHook:he,isLargeStatus:de,setIsLargeStatus:ce}},[J,ue,v,s,x,A,y,P,f,ee,oe,g,Y,h,re,se,F,z,L,W,G,le,X,ge,V,pe,H,me,Q,ve,Pe,Se,he,de,ce]);React.useEffect(()=>{var o,n,t;(o=p==null?void 0:p.setPointCloudBoxList)==null||o.call(p,s),(n=p==null?void 0:p.setHighlightIDs)==null||n.call(p,V),(t=p==null?void 0:p.setSelectedIDs)==null||t.call(p,v)},[s,v,V]),React.useEffect(()=>{var o;(o=p==null?void 0:p.setPtCtx)==null||o.call(p,M)},[M]);const Ke=()=>{const o=s.filter(d=>h.includes(d.attribute)),{setSelectedIDs:n,reRender:t}=M,l=o.map(d=>d.id);l.length>0&&n(v.filter(d=>!l.includes(d))),t()};return React.useEffect(()=>{var o,n,t,l;Ke(),(n=(o=f==null?void 0:f.toolInstance)==null?void 0:o.setHiddenAttributes)==null||n.call(o,h),(l=(t=L==null?void 0:L.store)==null?void 0:t.setHiddenAttributes)==null||l.call(t,h)},[h]),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 React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__async=(s,u,t)=>new Promise((g,a)=>{var n=i=>{try{o(t.next(i))}catch(l){a(l)}},d=i=>{try{o(t.throw(i))}catch(l){a(l)}},o=i=>i.done?g(i.value):Promise.resolve(i.value).then(n,d);o((t=t.apply(s,u)).next())});const useHighlight=({currentData:s})=>{var u;const{mainViewInstance:t,topViewInstance:g,pointCloudBoxList:a,highlight2DDataList:n,setHighlight2DDataList:d}=React.useContext(PointCloudContext.PointCloudContext),o=(u=s==null?void 0:s.mappingImgList)!=null?u:[],i=(r,c,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__async=(s,u,t)=>new Promise((g,a)=>{var n=i=>{try{o(t.next(i))}catch(l){a(l)}},d=i=>{try{o(t.throw(i))}catch(l){a(l)}},o=i=>i.done?g(i.value):Promise.resolve(i.value).then(n,d);o((t=t.apply(s,u)).next())});const useHighlight=({currentData:s})=>{var u;const{mainViewInstance:t,topViewInstance:g,pointCloudBoxList:a,highlight2DDataList:n,setHighlight2DDataList:d}=React.useContext(PointCloudContext.PointCloudContext),o=(u=s==null?void 0:s.mappingImgList)!=null?u:[],i=(r,c,f)=>__async(void 0,null,function*(){var p;let h=[...n];if(n.find(e=>e.url===r)?h=n.filter(e=>e.url!==r):h.push({url:r,fallbackUrl:c,calib:f}),d(h),!t||(o==null?void 0:o.length)===0)return;const v=t.pointCloudObject;if(!v)return;const m=yield t.getHighlightIndexByMappingImgList({mappingImgList:h,points:v.geometry.attributes.position.array});try{const e=yield t.highlightOriginPointCloud(a,m),{color:C}=e!=null?e:{};C&&((p=g==null?void 0:g.pointCloudInstance)==null||p.updateColor(C))}catch(e){console.error("toggle2dVisible highlightOriginPointCloud error:",e)}}),l=React.useCallback(r=>n.findIndex(c=>c.url===r)>=0,[n]);return{toggle2dVisible:i,isHighlightVisible:l}};exports.useHighlight=useHighlight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudPattern as
|
|
1
|
+
import{EPointCloudPattern as $}from"@labelbee/lb-utils";import je,{useState as r,useRef as pt,useMemo as F,useCallback as H,useEffect as ee}from"react";import{EPointCloudBoxRenderTrigger as E,calcResetAreasAndBoxIds as mt}from"../../utils/ToolPointCloudBoxRenderHelper.js";import{ActionsHistory as ke,EToolName as te,uuid as ht}from"@labelbee/lb-annotation";import{useDispatch as It}from"../../store/ctx.js";import{ChangeSave as vt}from"../../store/annotation/actionCreators.js";import Pt from"../../store/annotatedBox/index.js";import Fe from"lodash";import{addMapIndirectWeakSetItem as Ee}from"./utils/map.js";import wt from"./hooks/useTimeoutFunc.js";import St,{getEmptyUseWindowKeydownListener as yt}from"./hooks/useWindowKeydownListener.js";var Ct=Object.defineProperty,Lt=Object.defineProperties,bt=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,Ge=(c,s,u)=>s in c?Ct(c,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[s]=u,z=(c,s)=>{for(var u in s||(s={}))Rt.call(s,u)&&Ge(c,u,s[u]);if(ze)for(var u of ze(s))xt.call(s,u)&&Ge(c,u,s[u]);return c},Ke=(c,s)=>Lt(c,bt(s)),Dt=(c,s,u)=>new Promise((x,A)=>{var V=g=>{try{w(u.next(g))}catch(b){A(b)}},K=g=>{try{w(u.throw(g))}catch(b){A(b)}},w=g=>g.done?x(g.value):Promise.resolve(g.value).then(V,K);w((u=u.apply(c,s)).next())});const G=c=>Fe.pick(c,["id","attribute","width","height","x","y","imageName"]),Te=je.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,visibleBatchSetValid:!1,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setBatchSetValidModal:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new ke,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:te.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:$.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},highlight2DLoading:!1,setHighlight2DLoading:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:c=>{},imageSizes:{},cacheImageNodeSize:()=>{},addRectFromPointCloudBoxByImageName:c=>!1,removeRectBySpecifyId:(c,s,u)=>!1,removeRectByPointCloudBoxId:c=>!1,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{},imageNamePointCloudBoxMap:new Map,linkageImageNameRectMap:new Map,updateRectListByReducer:()=>{},windowKeydownListenerHook:yt(),isLargeStatus:!1,setIsLargeStatus:()=>{}}),Bt=({children:c})=>{const[s,u]=r([]),[x,A]=r([]),[V,K]=r([]),[w,g]=r([]),[b,We]=r([]),[v,oe]=r([]),[_,T]=r([]),[ne,Ze]=r(!0),[ie,Ue]=r(2),[se,qe]=r(!0),[re,Je]=r(1),[p,le]=r(),[ae,de]=r(),[ce,ue]=r(),[f,ge]=r(),[fe,Qe]=r(""),[W,Xe]=r(te.Rect),Z=pt(new ke).current,[m,U]=r([]),[pe,Ye]=r(""),[q,$e]=r($.Detection),[D,me]=r(void 0),[J,et]=r([]),[Q,tt]=r([]),[he,ot]=r(!1),[Ie,ve]=r(!1),h=Pt(),[Pe,nt]=r(!1),[we,it]=r({}),st=It(),rt=o=>{const{imgNode:n,path:t}=o;t&&n&&it(a=>Ke(z({},a),{[t]:{width:n.width,height:n.height}}))},Se=F(()=>v.length===1?v[0]:"",[v]),ye=St(),O=H((o,n,t="extId")=>{const a=t||"id",d=new Set(n);return g(l=>{let S=!1;const P=l.filter(j=>{const X=j[a],k=d.has(X)?j.imageName!==o:!0;return k||(S=!0),k});return S?P:l}),!0},[]),Ce=H(o=>{const n=s.map(t=>t.id);return O(o,n,"extId")},[s,O]),Le=H(o=>{if(!o)return!1;const n=s.filter(t=>Array.isArray(t.rects)).map(t=>{const{id:a,attribute:d,trackID:l}=t,S=t.rects.find(P=>P.imageName===o);if(S){const P=Fe.pick(S,["width","height","x","y","imageName"]);return Ke(z({},P),{id:ht(),attribute:d,order:l,extId:a,lineDash:[]})}return null}).filter(t=>t!==null);return n.length?(g(t=>{const a=new Set(t.filter(l=>o===l.imageName).map(l=>l.extId)),d=n.filter(l=>a.has(l.extId)===!1);return d.length?[...t,...d]:t}),!0):!1},[s]),be=F(()=>s.filter(n=>Array.isArray(n.rects)&&n.rects.length>0).reduce((n,t)=>{var a;return(a=t.rects)==null||a.forEach(d=>{const{imageName:l}=d;if(!l){console.warn("Missing image name"),console.trace(d,t);return}Ee(n,l,t.id,t)}),n},new Map),[s]),Re=H(o=>{g(n=>o(n,G))},[G]),xe=F(()=>w.filter(o=>o.extId!==void 0&&o.id!==void 0).reduce((o,n)=>{const t=n.imageName;return t?(Ee(o,t,n.extId,n),o):(console.warn("missing image name"),console.log(n,w),o)},new Map),[w]),{fn:lt}=wt(o=>{oe(n=>{const t=o,a=new Set(t);let d=!1;const l=n.filter(S=>{const P=a.has(S);return P||(d=!0),P});return d?l:n})},200),De=H(o=>{const n=o.map(t=>t.id);u(o),lt(n)},[]),M=F(()=>{const o=s.find(e=>e.id===Se),n=e=>{const i=s.concat(e);return De(i),i},t=e=>{const i=x.concat(e);return A(i),i},a=e=>{Ze(e!==!1)},d=e=>{nt(e)},l=e=>{let i=[];e===void 0||e===""?i=[]:typeof e=="string"?i=[e]:Array.isArray(e)&&(i=e.length>1?Array.from(new Set(e)):e),oe(i)},S=e=>{v.includes(e)?l(v.filter(i=>i!==e)):l([...v,e])},P=e=>{const i=G(e);g(I=>[...I,i])},j=(e,i=!1)=>{const I=G(e);g(y=>y.map(C=>C.id===e.id?i?z(z({},C),I):I:C))},X=e=>{g(i=>i.filter(I=>!e.find(y=>y.id===I.id)))},k=e=>{_.includes(e)?T([]):T([e])},dt=()=>{if(W===te.Rect){const e=s.map(i=>i.id);l(e),p==null||p.pointCloud2dOperation.setSelectedIDs(e)}},ct=e=>{l(s.filter(i=>i.attribute===e).map(i=>i.id))},Be=s.filter(e=>!m.includes(e.attribute)),Ae=x.filter(e=>!m.includes(e.attribute)),Ve=b.filter(e=>e.attribute&&!m.includes(e.attribute)),ut=e=>{if(m.includes(e))U(m.filter(i=>i!==e));else{const i=m.concat(e);U(i)}},gt=(e=Be,i=V,I=Ae,y=Ve,C=J)=>{var N;f==null||f.clearAllBox(),f==null||f.clearAllSphere(),p==null||p.updatePolygonList(e,i),p==null||p.updatePointList(I),p==null||p.updateLineList(y),f==null||f.generateBoxes(e),f==null||f.generateSpheres(I),(N=D==null?void 0:D.store)==null||N.updateCurrentSegment(C),_e(E.Default,e)},ft=()=>{le(void 0),de(void 0),ue(void 0),ge(void 0)},_e=(e,i,I)=>Dt(void 0,null,function*(){var y,C,N;if(!f)return;const Ne=f.pointCloudObject;if(!Ne)return;let He=[],Oe=[];try{if(i&&Z.record.length){const{record:L,recordIndex:R}=Z;let B=R;R>0&&(e===E.SingleToggleValid||e===E.SingleRotate||e===E.Single&&i.length===((y=L[R])==null?void 0:y.pointCloudBoxList.length))&&(B=R-1);let Y=(C=L[B])==null?void 0:C.pointCloudBoxList;const Me=mt(e,i,Y);He=Me.modifiedBoxIds,Oe=Me.resetAreas}}catch(L){console.error("call calcResetAreasAndBoxIds error",L)}try{const L=yield f.getHighlightIndexByMappingImgList({mappingImgList:I!=null?I:Q,points:Ne.geometry.attributes.position.array}),R=yield f==null?void 0:f.highlightOriginPointCloud(i,L,{modifiedBoxIds:He,resetAreas:Oe}),{color:B,currentPCDSrc:Y}=R!=null?R:{};return B&&((N=p==null?void 0:p.pointCloudInstance)==null||N.updateColor(B,Y)),B}catch(L){console.error("call highlightOriginPointCloud error",L)}});return{selectedID:Se,pointCloudBoxList:s,pointCloudSphereList:x,displayPointCloudList:Be,displaySphereList:Ae,displayLineList:Ve,selectedIDs:v,setPointCloudResult:De,setSelectedIDs:l,addPointCloudBox:n,addPointCloudSphere:t,setPointCloudSphereList:A,valid:ne,visibleBatchSetValid:Pe,selectedPointCloudBox:o,setPointCloudValid:a,setBatchSetValidModal:d,addSelectedID:S,addHighlightID:k,selectedAllBoxes:dt,topViewInstance:p,setTopViewInstance:le,sideViewInstance:ae,setSideViewInstance:de,backViewInstance:ce,setBackViewInstance:ue,mainViewInstance:f,setMainViewInstance:ge,polygonList:V,setPolygonList:K,rectList:w,setRectList:g,addRectIn2DView:P,removeRectIn2DView:X,updateRectIn2DView:j,lineList:b,setLineList:We,zoom:re,setZoom:Je,history:Z,toggleAttributesVisible:ut,hideAttributes:m,setHideAttributes:U,reRender:gt,attrPanelLayout:pe,setAttrPanelLayout:Ye,syncAllViewPointCloudColor:_e,defaultAttribute:fe,setDefaultAttribute:Qe,pointCloudPattern:W,setPointCloudPattern:Xe,selectSpecAttr:ct,globalPattern:q,setGlobalPattern:e=>{q!==e&&(st(vt),$e(e),e===$.Detection&&me(void 0))},ptSegmentInstance:D,setPtSegmentInstance:me,segmentation:J,setSegmentation:et,clearAllDetectionInstance:ft,highlight2DDataList:Q,setHighlight2DDataList:tt,highlight2DLoading:he,setHighlight2DLoading:ot,cuboidBoxIn2DView:se,setCuboidBoxIn2DView:qe,imageSizes:we,cacheImageNodeSize:rt,highlightIDs:_,setHighlightIDs:T,removeRectByPointCloudBoxId:Ce,removeRectBySpecifyId:O,addRectFromPointCloudBoxByImageName:Le,rectRotateSensitivity:ie,setRectRotateSensitivity:Ue,imageNamePointCloudBoxMap:be,linkageImageNameRectMap:xe,updateRectListByReducer:Re,windowKeydownListenerHook:ye,isLargeStatus:Ie,setIsLargeStatus:ve}},[ne,Pe,v,s,x,V,b,w,p,ae,ce,f,re,m,pe,fe,W,q,D,J,Q,he,se,we,_,Ce,O,Le,ie,be,xe,Re,ye,Ie,ve]);ee(()=>{var o,n,t;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,s),(n=h==null?void 0:h.setHighlightIDs)==null||n.call(h,_),(t=h==null?void 0:h.setSelectedIDs)==null||t.call(h,v)},[s,v,_]),ee(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,M)},[M]);const at=()=>{const o=s.filter(d=>m.includes(d.attribute)),{setSelectedIDs:n,reRender:t}=M,a=o.map(d=>d.id);a.length>0&&n(v.filter(d=>!a.includes(d))),t()};return ee(()=>{var o,n,t,a;at(),(n=(o=p==null?void 0:p.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]),je.createElement(Te.Provider,{value:M},c)};export{Te as PointCloudContext,Bt as PointCloudProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as I,useCallback as y}from"react";import{PointCloudContext as x}from"../PointCloudContext.js";var L=(s,g,t)=>new Promise((u,a)=>{var o=i=>{try{e(t.next(i))}catch(l){a(l)}},d=i=>{try{e(t.throw(i))}catch(l){a(l)}},e=i=>i.done?u(i.value):Promise.resolve(i.value).then(o,d);e((t=t.apply(s,g)).next())});const b=({currentData:s})=>{var g;const{mainViewInstance:t,topViewInstance:u,pointCloudBoxList:a,highlight2DDataList:o,setHighlight2DDataList:d}=I(x),e=(g=s==null?void 0:s.mappingImgList)!=null?g:[],i=(r,c,v)=>L(void 0,null,function*(){var p;let h=[...o];if(o.find(n=>n.url===r)?h=o.filter(n=>n.url!==r):h.push({url:r,fallbackUrl:c,calib:v}),d(h),!t||(e==null?void 0:e.length)===0)return;const m=t.pointCloudObject;if(!m)return;const C=yield t.getHighlightIndexByMappingImgList({mappingImgList:h,points:m.geometry.attributes.position.array});try{const n=yield t.highlightOriginPointCloud(a,C),{color:f}=n!=null?n:{};f&&((p=u==null?void 0:u.pointCloudInstance)==null||p.updateColor(f))}catch(n){console.error("toggle2dVisible highlightOriginPointCloud error:",n)}}),l=y(r=>o.findIndex(c=>c.url===r)>=0,[o]);return{toggle2dVisible:i,isHighlightVisible:l}};export{b as useHighlight};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.24.0-alpha.
|
|
3
|
+
"version": "1.24.0-alpha.24",
|
|
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.28.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.28.0-alpha.13",
|
|
47
47
|
"@labelbee/lb-utils": "1.20.0-alpha.1",
|
|
48
48
|
"@labelbee/wavesurfer": "1.1.0",
|
|
49
49
|
"@types/react-dom": "18.3.1",
|