@labelbee/lb-components 1.12.0-alpha.1 → 1.12.0-alpha.2

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"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{}}),PointCloudProvider=({children:r})=>{const[l,V]=React.useState([]),[S,x]=React.useState([]),[v,F]=React.useState([]),[L,k]=React.useState([]),[a,g]=React.useState([]),[D,z]=React.useState(!0),[B,Z]=React.useState(1),[o,U]=React.useState(),[R,J]=React.useState(),[E,K]=React.useState(),[n,Q]=React.useState(),[H,W]=React.useState(""),[m,X]=React.useState(lbAnnotation.EToolName.Rect),Y=React.useRef(new lbAnnotation.ActionsHistory).current,[s,y]=React.useState([]),[j,$]=React.useState(""),[A,tt]=React.useState(lbUtils.EPointCloudPattern.Segmentation),[d,_]=React.useState(void 0),[h,et]=React.useState([]),ot=ctx.useDispatch(),q=React.useMemo(()=>a.length===1?a[0]:"",[a]),G=React.useMemo(()=>{const c=l.find(t=>t.id===q),P=t=>{const e=l.concat(t);return V(e),e},I=t=>{const e=S.concat(t);return x(e),e},f=t=>{z(t!==!1)},i=t=>{t===void 0&&g([]),typeof t=="string"&&g([t]),Array.isArray(t)&&g(Array.from(new Set(t)))},st=t=>{a.includes(t)?i(a.filter(e=>e!==t)):i([...a,t])},it=()=>{if(m===lbAnnotation.EToolName.Rect){const t=l.map(e=>e.id);i(t),o==null||o.pointCloud2dOperation.setSelectedIDs(t)}},lt=t=>{i(l.filter(e=>e.attribute===t).map(e=>e.id))},M=l.filter(t=>!s.includes(t.attribute)),N=S.filter(t=>!s.includes(t.attribute)),O=L.filter(t=>t.attribute&&!s.includes(t.attribute)),at=t=>{if(s.includes(t))y(s.filter(e=>e!==t));else{const e=s.concat(t);y(e)}},rt=(t=M,e=v,C=N,u=O,b=h)=>{var p;l.forEach(w=>{n==null||n.removeObjectByName(w.id)}),S.forEach(w=>{n==null||n.removeObjectByName(w.id)}),o==null||o.updatePolygonList(t,e),o==null||o.updatePointList(C),o==null||o.updateLineList(u),n==null||n.generateBoxes(t),n==null||n.generateSpheres(C),(p=d==null?void 0:d.store)==null||p.updateCurrentSegment(b),T(t)},T=t=>{const e=n==null?void 0:n.highlightOriginPointCloud(t);return new Promise(C=>{e==null||e.then(u=>{[o].forEach(b=>{var p;u&&((p=b==null?void 0:b.pointCloudInstance)==null||p.updateColor(u),C({color:u}))})}).catch(u=>{console.error(u)})})};return{selectedID:q,pointCloudBoxList:l,pointCloudSphereList:S,displayPointCloudList:M,displaySphereList:N,displayLineList:O,selectedIDs:a,setPointCloudResult:V,setSelectedIDs:i,addPointCloudBox:P,addPointCloudSphere:I,setPointCloudSphereList:x,valid:D,selectedPointCloudBox:c,setPointCloudValid:f,addSelectedID:st,selectedAllBoxes:it,topViewInstance:o,setTopViewInstance:U,sideViewInstance:R,setSideViewInstance:J,backViewInstance:E,setBackViewInstance:K,mainViewInstance:n,setMainViewInstance:Q,polygonList:v,setPolygonList:F,lineList:L,setLineList:k,zoom:B,setZoom:Z,history:Y,toggleAttributesVisible:at,hideAttributes:s,setHideAttributes:y,reRender:rt,attrPanelLayout:j,setAttrPanelLayout:$,syncAllViewPointCloudColor:T,defaultAttribute:H,setDefaultAttribute:W,pointCloudPattern:m,setPointCloudPattern:X,selectSpecAttr:lt,globalPattern:A,setGlobalPattern:t=>{A!==t&&(ot(actionCreators.ChangeSave),tt(t),t===lbUtils.EPointCloudPattern.Detection&&_(void 0))},ptSegmentInstance:d,setPtSegmentInstance:_,segmentation:h,setSegmentation:et}},[D,a,l,S,v,L,o,R,E,n,B,s,j,H,m,A,d,h]),nt=()=>{const c=l.filter(i=>s.includes(i.attribute)),{setSelectedIDs:P,reRender:I}=G,f=c.map(i=>i.id);f.length>0&&P(a.filter(i=>!f.includes(i))),I()};return React.useEffect(()=>{var c,P;nt(),(c=o==null?void 0:o.toolInstance)==null||c.setHiddenAttributes(s),(P=d==null?void 0:d.store)==null||P.setHiddenAttributes(s)},[s]),React__default.default.createElement(PointCloudContext.Provider,{value:G},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"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{}}),PointCloudProvider=({children:r})=>{const[l,V]=React.useState([]),[p,x]=React.useState([]),[v,F]=React.useState([]),[L,k]=React.useState([]),[a,g]=React.useState([]),[D,z]=React.useState(!0),[B,Z]=React.useState(1),[o,U]=React.useState(),[R,J]=React.useState(),[E,K]=React.useState(),[n,Q]=React.useState(),[H,W]=React.useState(""),[m,X]=React.useState(lbAnnotation.EToolName.Rect),Y=React.useRef(new lbAnnotation.ActionsHistory).current,[s,y]=React.useState([]),[j,$]=React.useState(""),[A,tt]=React.useState(lbUtils.EPointCloudPattern.Detection),[d,_]=React.useState(void 0),[h,et]=React.useState([]),ot=ctx.useDispatch(),q=React.useMemo(()=>a.length===1?a[0]:"",[a]),G=React.useMemo(()=>{const c=l.find(t=>t.id===q),P=t=>{const e=l.concat(t);return V(e),e},I=t=>{const e=p.concat(t);return x(e),e},f=t=>{z(t!==!1)},i=t=>{t===void 0&&g([]),typeof t=="string"&&g([t]),Array.isArray(t)&&g(Array.from(new Set(t)))},st=t=>{a.includes(t)?i(a.filter(e=>e!==t)):i([...a,t])},it=()=>{if(m===lbAnnotation.EToolName.Rect){const t=l.map(e=>e.id);i(t),o==null||o.pointCloud2dOperation.setSelectedIDs(t)}},lt=t=>{i(l.filter(e=>e.attribute===t).map(e=>e.id))},M=l.filter(t=>!s.includes(t.attribute)),N=p.filter(t=>!s.includes(t.attribute)),O=L.filter(t=>t.attribute&&!s.includes(t.attribute)),at=t=>{if(s.includes(t))y(s.filter(e=>e!==t));else{const e=s.concat(t);y(e)}},rt=(t=M,e=v,C=N,u=O,b=h)=>{var S;l.forEach(w=>{n==null||n.removeObjectByName(w.id)}),p.forEach(w=>{n==null||n.removeObjectByName(w.id)}),o==null||o.updatePolygonList(t,e),o==null||o.updatePointList(C),o==null||o.updateLineList(u),n==null||n.generateBoxes(t),n==null||n.generateSpheres(C),(S=d==null?void 0:d.store)==null||S.updateCurrentSegment(b),T(t)},T=t=>{const e=n==null?void 0:n.highlightOriginPointCloud(t);return new Promise(C=>{e==null||e.then(u=>{[o].forEach(b=>{var S;u&&((S=b==null?void 0:b.pointCloudInstance)==null||S.updateColor(u),C({color:u}))})}).catch(u=>{console.error(u)})})};return{selectedID:q,pointCloudBoxList:l,pointCloudSphereList:p,displayPointCloudList:M,displaySphereList:N,displayLineList:O,selectedIDs:a,setPointCloudResult:V,setSelectedIDs:i,addPointCloudBox:P,addPointCloudSphere:I,setPointCloudSphereList:x,valid:D,selectedPointCloudBox:c,setPointCloudValid:f,addSelectedID:st,selectedAllBoxes:it,topViewInstance:o,setTopViewInstance:U,sideViewInstance:R,setSideViewInstance:J,backViewInstance:E,setBackViewInstance:K,mainViewInstance:n,setMainViewInstance:Q,polygonList:v,setPolygonList:F,lineList:L,setLineList:k,zoom:B,setZoom:Z,history:Y,toggleAttributesVisible:at,hideAttributes:s,setHideAttributes:y,reRender:rt,attrPanelLayout:j,setAttrPanelLayout:$,syncAllViewPointCloudColor:T,defaultAttribute:H,setDefaultAttribute:W,pointCloudPattern:m,setPointCloudPattern:X,selectSpecAttr:lt,globalPattern:A,setGlobalPattern:t=>{A!==t&&(ot(actionCreators.ChangeSave),tt(t),t===lbUtils.EPointCloudPattern.Detection&&_(void 0))},ptSegmentInstance:d,setPtSegmentInstance:_,segmentation:h,setSegmentation:et}},[D,a,l,p,v,L,o,R,E,n,B,s,j,H,m,A,d,h]),nt=()=>{const c=l.filter(i=>s.includes(i.attribute)),{setSelectedIDs:P,reRender:I}=G,f=c.map(i=>i.id);f.length>0&&P(a.filter(i=>!f.includes(i))),I()};return React.useEffect(()=>{var c,P;nt(),(c=o==null?void 0:o.toolInstance)==null||c.setHiddenAttributes(s),(P=d==null?void 0:d.store)==null||P.setHiddenAttributes(s)},[s]),React__default.default.createElement(PointCloudContext.Provider,{value:G},r)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
@@ -1 +1 @@
1
- "use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js");const PointCloudSegmentListener=({checkMode:d,currentData:r,imgIndex:c,highlightAttribute:u,config:m,toolInstanceRef:a})=>{const{updateSegmentAttribute:v}=useAttribute.useAttribute(),o=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:e,setSegmentation:b}=o;React.useEffect(()=>{var t;e&&r.url&&(e.loadPCDFile((t=r==null?void 0:r.url)!=null?t:"").then(()=>{var n,l;e.emit("clearAllSegmentData");const i=lbUtils.PointCloudUtils.getSegmentFromResultList((n=r==null?void 0:r.result)!=null?n:"");(l=e==null?void 0:e.store)==null||l.updateCurrentSegment(i)}),e.on("syncSegmentData",n=>{b(n)}))},[c,e]),React.useEffect(()=>{var t,n;let l=(t=m.attributeList.find(i=>(i==null?void 0:i.key)===u))==null?void 0:t.value;(n=e==null?void 0:e.store)==null||n.highlightPointsByAttribute(l!=null?l:"")},[u,e]);const S=(t,n)=>{var l,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Add);break;case"i":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("clearSelectedSegmentData",(i=(l=e.store)==null?void 0:l.cacheSegData)==null?void 0:i.id);break}},s=t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||d===!0)return;const n=t.key.toLocaleLowerCase();S(n)};return React.useEffect(()=>(window.addEventListener("keydown",s),a.current.setDefaultAttribute=t=>{v(t)},()=>{window.removeEventListener("keydown",s)}),[e]),React.useEffect(()=>{a.current.clearResult=()=>{!o.ptSegmentInstance||o.ptSegmentInstance.emit("clearAllSegmentData")}},[o.pointCloudBoxList,o.valid,o.polygonList,o.lineList,o.pointCloudSphereList,o.ptSegmentInstance]),null};var PointCloudSegmentListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegmentListener);module.exports=PointCloudSegmentListener$1;
1
+ "use strict";var React=require("react"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),useAttribute=require("./hooks/useAttribute.js");const PointCloudSegmentListener=({checkMode:c,currentData:r,imgIndex:m,highlightAttribute:u,config:v,toolInstanceRef:a})=>{const{updateSegmentAttribute:b}=useAttribute.useAttribute(),n=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:e,setSegmentation:s}=n;React.useEffect(()=>{var t;if(e&&r.url)return e.loadPCDFile((t=r==null?void 0:r.url)!=null?t:"").then(()=>{var o,l;e.emit("clearAllSegmentData");const i=lbUtils.PointCloudUtils.getSegmentFromResultList((o=r==null?void 0:r.result)!=null?o:"");(l=e==null?void 0:e.store)==null||l.updateCurrentSegment(i)}),e.on("syncSegmentData",s),()=>{e.unbind("syncSegmentData",s)}},[m,e]),React.useEffect(()=>{var t,o;let l=(t=v.attributeList.find(i=>(i==null?void 0:i.key)===u))==null?void 0:t.value;(o=e==null?void 0:e.store)==null||o.highlightPointsByAttribute(l!=null?l:"")},[u,e]);const S=(t,o)=>{var l,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Add);break;case"i":e==null||e.emit("setSegmentMode",lbUtils.EPointCloudSegmentMode.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(i=(l=e.store)==null?void 0:l.cacheSegData)==null?void 0:i.id);break}},d=t=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(t)||c===!0)return;const o=t.key.toLocaleLowerCase();S(o)};return React.useEffect(()=>(window.addEventListener("keydown",d),a.current.setDefaultAttribute=t=>{b(t)},()=>{window.removeEventListener("keydown",d)}),[e]),React.useEffect(()=>{a.current.clearResult=()=>{!n.ptSegmentInstance||n.ptSegmentInstance.emit("clearAllSegmentData")}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var PointCloudSegmentListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegmentListener);module.exports=PointCloudSegmentListener$1;
@@ -1 +1 @@
1
- "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({currentData:t,imgList:d,drawLayerSlot:c,checkMode:a,intelligentFit:m})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:o,setGlobalPattern:C,ptSegmentInstance:r}=e,f=index.jsonParser(t.result),{toolInstanceRef:l,clearToolInstance:P}=annotation.useCustomToolInstance({basicInfo:f});return React.useEffect(()=>{l.current.setPointCloudGlobalPattern=n=>{n!==o&&(C(n),P())},l.current.getPointCloudGlobalPattern=()=>o},[o]),React.useEffect(()=>{l.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],l.current.exportCustomData=()=>{var n,u,i,s;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(u=e.lineList)!=null?u:[],resultPoint:(i=e.pointCloudSphereList)!=null?i:[],segmentation:(s=r==null?void 0:r.store)==null?void 0:s.formatData}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance]),d.length===0?null:o===lbUtils.EPointCloudPattern.Segmentation?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:a,toolInstanceRef:l}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement(PointCloudSegment,null),React__default.default.createElement(PointCloudSegmentStatus,null)):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:a,toolInstanceRef:l}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:c,checkMode:a,intelligentFit:m}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,{checkMode:a}),React__default.default.createElement(PointCloudBackView,{checkMode:a})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
1
+ "use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({currentData:t,imgList:s,drawLayerSlot:d,checkMode:a,intelligentFit:c})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:o,setGlobalPattern:m}=e,C=index.jsonParser(t.result),{toolInstanceRef:l,clearToolInstance:f}=annotation.useCustomToolInstance({basicInfo:C});return React.useEffect(()=>{l.current.setPointCloudGlobalPattern=n=>{n!==o&&(m(n),f())},l.current.getPointCloudGlobalPattern=()=>o},[o]),React.useEffect(()=>{l.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],l.current.exportCustomData=()=>{var n,r,u,i;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(r=e.lineList)!=null?r:[],resultPoint:(u=e.pointCloudSphereList)!=null?u:[],segmentation:(i=e.segmentation)!=null?i:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),s.length===0?null:o===lbUtils.EPointCloudPattern.Segmentation?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:a,toolInstanceRef:l}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement(PointCloudSegment,null),React__default.default.createElement(PointCloudSegmentStatus,null)):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:a,toolInstanceRef:l}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:d,checkMode:a,intelligentFit:c}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,{checkMode:a}),React__default.default.createElement(PointCloudBackView,{checkMode:a})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
@@ -1 +1 @@
1
- import{EPointCloudPattern as V}from"@labelbee/lb-utils";import _,{useState as o,useRef as mt,useMemo as q,useEffect as bt}from"react";import{ActionsHistory as J,EToolName as x}from"@labelbee/lb-annotation";import{useDispatch as vt}from"../../store/ctx.js";import{ChangeSave as Lt}from"../../store/annotation/actionCreators.js";const K=_.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new J,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:x.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:V.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{}}),St=({children:Q})=>{const[r,B]=o([]),[P,D]=o([]),[v,U]=o([]),[L,W]=o([]),[a,S]=o([]),[R,X]=o(!0),[E,Y]=o(1),[n,$]=o(),[H,tt]=o(),[G,et]=o(),[i,ot]=o(),[j,nt]=o(""),[g,it]=o(x.Rect),st=mt(new J).current,[s,h]=o([]),[F,lt]=o(""),[A,rt]=o(V.Segmentation),[c,O]=o(void 0),[I,at]=o([]),dt=vt(),k=q(()=>a.length===1?a[0]:"",[a]),M=q(()=>{const u=r.find(t=>t.id===k),p=t=>{const e=r.concat(t);return B(e),e},y=t=>{const e=P.concat(t);return D(e),e},C=t=>{X(t!==!1)},l=t=>{t===void 0&&S([]),typeof t=="string"&&S([t]),Array.isArray(t)&&S(Array.from(new Set(t)))},ut=t=>{a.includes(t)?l(a.filter(e=>e!==t)):l([...a,t])},pt=()=>{if(g===x.Rect){const t=r.map(e=>e.id);l(t),n==null||n.pointCloud2dOperation.setSelectedIDs(t)}},Pt=t=>{l(r.filter(e=>e.attribute===t).map(e=>e.id))},N=r.filter(t=>!s.includes(t.attribute)),T=P.filter(t=>!s.includes(t.attribute)),z=L.filter(t=>t.attribute&&!s.includes(t.attribute)),ft=t=>{if(s.includes(t))h(s.filter(e=>e!==t));else{const e=s.concat(t);h(e)}},Ct=(t=N,e=v,m=T,d=z,b=I)=>{var f;r.forEach(w=>{i==null||i.removeObjectByName(w.id)}),P.forEach(w=>{i==null||i.removeObjectByName(w.id)}),n==null||n.updatePolygonList(t,e),n==null||n.updatePointList(m),n==null||n.updateLineList(d),i==null||i.generateBoxes(t),i==null||i.generateSpheres(m),(f=c==null?void 0:c.store)==null||f.updateCurrentSegment(b),Z(t)},Z=t=>{const e=i==null?void 0:i.highlightOriginPointCloud(t);return new Promise(m=>{e==null||e.then(d=>{[n].forEach(b=>{var f;d&&((f=b==null?void 0:b.pointCloudInstance)==null||f.updateColor(d),m({color:d}))})}).catch(d=>{console.error(d)})})};return{selectedID:k,pointCloudBoxList:r,pointCloudSphereList:P,displayPointCloudList:N,displaySphereList:T,displayLineList:z,selectedIDs:a,setPointCloudResult:B,setSelectedIDs:l,addPointCloudBox:p,addPointCloudSphere:y,setPointCloudSphereList:D,valid:R,selectedPointCloudBox:u,setPointCloudValid:C,addSelectedID:ut,selectedAllBoxes:pt,topViewInstance:n,setTopViewInstance:$,sideViewInstance:H,setSideViewInstance:tt,backViewInstance:G,setBackViewInstance:et,mainViewInstance:i,setMainViewInstance:ot,polygonList:v,setPolygonList:U,lineList:L,setLineList:W,zoom:E,setZoom:Y,history:st,toggleAttributesVisible:ft,hideAttributes:s,setHideAttributes:h,reRender:Ct,attrPanelLayout:F,setAttrPanelLayout:lt,syncAllViewPointCloudColor:Z,defaultAttribute:j,setDefaultAttribute:nt,pointCloudPattern:g,setPointCloudPattern:it,selectSpecAttr:Pt,globalPattern:A,setGlobalPattern:t=>{A!==t&&(dt(Lt),rt(t),t===V.Detection&&O(void 0))},ptSegmentInstance:c,setPtSegmentInstance:O,segmentation:I,setSegmentation:at}},[R,a,r,P,v,L,n,H,G,i,E,s,F,j,g,A,c,I]),ct=()=>{const u=r.filter(l=>s.includes(l.attribute)),{setSelectedIDs:p,reRender:y}=M,C=u.map(l=>l.id);C.length>0&&p(a.filter(l=>!C.includes(l))),y()};return bt(()=>{var u,p;ct(),(u=n==null?void 0:n.toolInstance)==null||u.setHiddenAttributes(s),(p=c==null?void 0:c.store)==null||p.setHiddenAttributes(s)},[s]),_.createElement(K.Provider,{value:M},Q)};export{K as PointCloudContext,St as PointCloudProvider};
1
+ import{EPointCloudPattern as V}from"@labelbee/lb-utils";import _,{useState as o,useRef as bt,useMemo as q,useEffect as mt}from"react";import{ActionsHistory as J,EToolName as x}from"@labelbee/lb-annotation";import{useDispatch as vt}from"../../store/ctx.js";import{ChangeSave as Lt}from"../../store/annotation/actionCreators.js";const K=_.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new J,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:x.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:V.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{}}),St=({children:Q})=>{const[r,D]=o([]),[P,B]=o([]),[v,U]=o([]),[L,W]=o([]),[a,S]=o([]),[R,X]=o(!0),[E,Y]=o(1),[n,$]=o(),[H,tt]=o(),[G,et]=o(),[i,ot]=o(),[j,nt]=o(""),[g,it]=o(x.Rect),st=bt(new J).current,[s,h]=o([]),[F,lt]=o(""),[A,rt]=o(V.Detection),[c,O]=o(void 0),[I,at]=o([]),dt=vt(),k=q(()=>a.length===1?a[0]:"",[a]),M=q(()=>{const u=r.find(t=>t.id===k),p=t=>{const e=r.concat(t);return D(e),e},y=t=>{const e=P.concat(t);return B(e),e},C=t=>{X(t!==!1)},l=t=>{t===void 0&&S([]),typeof t=="string"&&S([t]),Array.isArray(t)&&S(Array.from(new Set(t)))},ut=t=>{a.includes(t)?l(a.filter(e=>e!==t)):l([...a,t])},pt=()=>{if(g===x.Rect){const t=r.map(e=>e.id);l(t),n==null||n.pointCloud2dOperation.setSelectedIDs(t)}},Pt=t=>{l(r.filter(e=>e.attribute===t).map(e=>e.id))},N=r.filter(t=>!s.includes(t.attribute)),T=P.filter(t=>!s.includes(t.attribute)),z=L.filter(t=>t.attribute&&!s.includes(t.attribute)),ft=t=>{if(s.includes(t))h(s.filter(e=>e!==t));else{const e=s.concat(t);h(e)}},Ct=(t=N,e=v,b=T,d=z,m=I)=>{var f;r.forEach(w=>{i==null||i.removeObjectByName(w.id)}),P.forEach(w=>{i==null||i.removeObjectByName(w.id)}),n==null||n.updatePolygonList(t,e),n==null||n.updatePointList(b),n==null||n.updateLineList(d),i==null||i.generateBoxes(t),i==null||i.generateSpheres(b),(f=c==null?void 0:c.store)==null||f.updateCurrentSegment(m),Z(t)},Z=t=>{const e=i==null?void 0:i.highlightOriginPointCloud(t);return new Promise(b=>{e==null||e.then(d=>{[n].forEach(m=>{var f;d&&((f=m==null?void 0:m.pointCloudInstance)==null||f.updateColor(d),b({color:d}))})}).catch(d=>{console.error(d)})})};return{selectedID:k,pointCloudBoxList:r,pointCloudSphereList:P,displayPointCloudList:N,displaySphereList:T,displayLineList:z,selectedIDs:a,setPointCloudResult:D,setSelectedIDs:l,addPointCloudBox:p,addPointCloudSphere:y,setPointCloudSphereList:B,valid:R,selectedPointCloudBox:u,setPointCloudValid:C,addSelectedID:ut,selectedAllBoxes:pt,topViewInstance:n,setTopViewInstance:$,sideViewInstance:H,setSideViewInstance:tt,backViewInstance:G,setBackViewInstance:et,mainViewInstance:i,setMainViewInstance:ot,polygonList:v,setPolygonList:U,lineList:L,setLineList:W,zoom:E,setZoom:Y,history:st,toggleAttributesVisible:ft,hideAttributes:s,setHideAttributes:h,reRender:Ct,attrPanelLayout:F,setAttrPanelLayout:lt,syncAllViewPointCloudColor:Z,defaultAttribute:j,setDefaultAttribute:nt,pointCloudPattern:g,setPointCloudPattern:it,selectSpecAttr:Pt,globalPattern:A,setGlobalPattern:t=>{A!==t&&(dt(Lt),rt(t),t===V.Detection&&O(void 0))},ptSegmentInstance:c,setPtSegmentInstance:O,segmentation:I,setSegmentation:at}},[R,a,r,P,v,L,n,H,G,i,E,s,F,j,g,A,c,I]),ct=()=>{const u=r.filter(l=>s.includes(l.attribute)),{setSelectedIDs:p,reRender:y}=M,C=u.map(l=>l.id);C.length>0&&p(a.filter(l=>!C.includes(l))),y()};return mt(()=>{var u,p;ct(),(u=n==null?void 0:n.toolInstance)==null||u.setHiddenAttributes(s),(p=c==null?void 0:c.store)==null||p.setHiddenAttributes(s)},[s]),_.createElement(K.Provider,{value:M},Q)};export{K as PointCloudContext,St as PointCloudProvider};
@@ -1 +1 @@
1
- import{useContext as C,useEffect as a}from"react";import{a2MapStateToProps as f}from"../../store/annotation/map.js";import{connect as L}from"react-redux";import{LabelBeeContext as k}from"../../store/ctx.js";import{PointCloudContext as w}from"./PointCloudContext.js";import{CommonToolUtils as y}from"@labelbee/lb-annotation";import{PointCloudUtils as x,EPointCloudSegmentMode as d}from"@labelbee/lb-utils";import{useAttribute as P}from"./hooks/useAttribute.js";const h=({checkMode:c,currentData:r,imgIndex:v,highlightAttribute:s,config:p,toolInstanceRef:u})=>{const{updateSegmentAttribute:S}=P(),n=C(w),{ptSegmentInstance:e,setSegmentation:b}=n;a(()=>{var t;e&&r.url&&(e.loadPCDFile((t=r==null?void 0:r.url)!=null?t:"").then(()=>{var o,l;e.emit("clearAllSegmentData");const i=x.getSegmentFromResultList((o=r==null?void 0:r.result)!=null?o:"");(l=e==null?void 0:e.store)==null||l.updateCurrentSegment(i)}),e.on("syncSegmentData",o=>{b(o)}))},[v,e]),a(()=>{var t,o;let l=(t=p.attributeList.find(i=>(i==null?void 0:i.key)===s))==null?void 0:t.value;(o=e==null?void 0:e.store)==null||o.highlightPointsByAttribute(l!=null?l:"")},[s,e]);const g=(t,o)=>{var l,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",d.Add);break;case"i":e==null||e.emit("setSegmentMode",d.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("clearSelectedSegmentData",(i=(l=e.store)==null?void 0:l.cacheSegData)==null?void 0:i.id);break}},m=t=>{if(!y.hotkeyFilter(t)||c===!0)return;const o=t.key.toLocaleLowerCase();g(o)};return a(()=>(window.addEventListener("keydown",m),u.current.setDefaultAttribute=t=>{S(t)},()=>{window.removeEventListener("keydown",m)}),[e]),a(()=>{u.current.clearResult=()=>{!n.ptSegmentInstance||n.ptSegmentInstance.emit("clearAllSegmentData")}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var A=L(f,null,null,{context:k})(h);export{A as default};
1
+ import{useContext as C,useEffect as a}from"react";import{a2MapStateToProps as f}from"../../store/annotation/map.js";import{connect as L}from"react-redux";import{LabelBeeContext as k}from"../../store/ctx.js";import{PointCloudContext as y}from"./PointCloudContext.js";import{CommonToolUtils as w}from"@labelbee/lb-annotation";import{PointCloudUtils as x,EPointCloudSegmentMode as c}from"@labelbee/lb-utils";import{useAttribute as P}from"./hooks/useAttribute.js";const h=({checkMode:v,currentData:r,imgIndex:p,highlightAttribute:s,config:S,toolInstanceRef:u})=>{const{updateSegmentAttribute:b}=P(),n=C(y),{ptSegmentInstance:e,setSegmentation:d}=n;a(()=>{var t;if(e&&r.url)return e.loadPCDFile((t=r==null?void 0:r.url)!=null?t:"").then(()=>{var o,l;e.emit("clearAllSegmentData");const i=x.getSegmentFromResultList((o=r==null?void 0:r.result)!=null?o:"");(l=e==null?void 0:e.store)==null||l.updateCurrentSegment(i)}),e.on("syncSegmentData",d),()=>{e.unbind("syncSegmentData",d)}},[p,e]),a(()=>{var t,o;let l=(t=S.attributeList.find(i=>(i==null?void 0:i.key)===s))==null?void 0:t.value;(o=e==null?void 0:e.store)==null||o.highlightPointsByAttribute(l!=null?l:"")},[s,e]);const g=(t,o)=>{var l,i;switch(t){case"h":e==null||e.emit("LassoSelector");break;case"j":e==null||e.emit("CircleSelector");break;case"u":e==null||e.emit("setSegmentMode",c.Add);break;case"i":e==null||e.emit("setSegmentMode",c.Remove);break;case"enter":e==null||e.emit("updateCheck2Edit");break;case"delete":e==null||e.emit("deleteSelectedSegmentData",(i=(l=e.store)==null?void 0:l.cacheSegData)==null?void 0:i.id);break}},m=t=>{if(!w.hotkeyFilter(t)||v===!0)return;const o=t.key.toLocaleLowerCase();g(o)};return a(()=>(window.addEventListener("keydown",m),u.current.setDefaultAttribute=t=>{b(t)},()=>{window.removeEventListener("keydown",m)}),[e]),a(()=>{u.current.clearResult=()=>{!n.ptSegmentInstance||n.ptSegmentInstance.emit("clearAllSegmentData")}},[n.pointCloudBoxList,n.valid,n.polygonList,n.lineList,n.pointCloudSphereList,n.ptSegmentInstance]),null};var A=L(f,null,null,{context:k})(h);export{A as default};
@@ -1 +1 @@
1
- import{getClassName as l}from"../../utils/dom.js";import t,{useContext as j,useEffect as d}from"react";import x from"./PointCloud3DView.js";import S from"./PointCloudBackView.js";import b from"./PointCloudTopView.js";import v from"./PointCloudSideView.js";import w from"./PointCloud2DView.js";import L from"./PointCloudListener.js";import V from"./PointCloudSegmentListener.js";import D from"./PointCloudSegment.js";import N from"./PointCloudSegmentStatus.js";import T from"./PointCloudSegmentToolbar.js";import{connect as A}from"react-redux";import{LabelBeeContext as I}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as B,AnnotatedAttributesPanelFixedRight as F}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as y}from"./PointCloudContext.js";import{EPointCloudPattern as _}from"@labelbee/lb-utils";import{useCustomToolInstance as h}from"../../hooks/annotation.js";import{jsonParser as G}from"../../utils/index.js";import{a2MapStateToProps as R}from"../../store/annotation/map.js";const $=({currentData:c,imgList:p,drawLayerSlot:C,checkMode:r,intelligentFit:P})=>{const e=j(y),{globalPattern:i,setGlobalPattern:f,ptSegmentInstance:a}=e,g=G(c.result),{toolInstanceRef:n,clearToolInstance:E}=h({basicInfo:g});return d(()=>{n.current.setPointCloudGlobalPattern=o=>{o!==i&&(f(o),E())},n.current.getPointCloudGlobalPattern=()=>i},[i]),d(()=>{n.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],n.current.exportCustomData=()=>{var o,m,u,s;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(m=e.lineList)!=null?m:[],resultPoint:(u=e.pointCloudSphereList)!=null?u:[],segmentation:(s=a==null?void 0:a.store)==null?void 0:s.formatData}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance]),p.length===0?null:i===_.Segmentation?t.createElement(t.Fragment,null,t.createElement(V,{checkMode:r,toolInstanceRef:n}),t.createElement(T,null),t.createElement(D,null),t.createElement(N,null)):t.createElement(t.Fragment,null,t.createElement(L,{checkMode:r,toolInstanceRef:n}),t.createElement("div",{className:l("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:l("point-cloud-wrapper")},t.createElement(B,null),t.createElement("div",{className:l("point-cloud-content")},t.createElement("div",{className:l("point-cloud-container","left")},t.createElement(w,null),t.createElement(x,null)),t.createElement("div",{className:l("point-cloud-container","right")},t.createElement(b,{drawLayerSlot:C,checkMode:r,intelligentFit:P}),t.createElement("div",{className:l("point-cloud-container","right-bottom")},t.createElement(v,{checkMode:r}),t.createElement(S,{checkMode:r})))),t.createElement(F,null))))};var q=A(R,null,null,{context:I})($);export{q as default};
1
+ import{getClassName as l}from"../../utils/dom.js";import t,{useContext as E,useEffect as s}from"react";import j from"./PointCloud3DView.js";import x from"./PointCloudBackView.js";import S from"./PointCloudTopView.js";import b from"./PointCloudSideView.js";import w from"./PointCloud2DView.js";import L from"./PointCloudListener.js";import v from"./PointCloudSegmentListener.js";import V from"./PointCloudSegment.js";import D from"./PointCloudSegmentStatus.js";import N from"./PointCloudSegmentToolbar.js";import{connect as T}from"react-redux";import{LabelBeeContext as A}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as B,AnnotatedAttributesPanelFixedRight as F}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as I}from"./PointCloudContext.js";import{EPointCloudPattern as y}from"@labelbee/lb-utils";import{useCustomToolInstance as _}from"../../hooks/annotation.js";import{jsonParser as h}from"../../utils/index.js";import{a2MapStateToProps as G}from"../../store/annotation/map.js";const R=({currentData:d,imgList:c,drawLayerSlot:p,checkMode:i,intelligentFit:C})=>{const e=E(I),{globalPattern:r,setGlobalPattern:P}=e,f=h(d.result),{toolInstanceRef:n,clearToolInstance:g}=_({basicInfo:f});return s(()=>{n.current.setPointCloudGlobalPattern=o=>{o!==r&&(P(o),g())},n.current.getPointCloudGlobalPattern=()=>r},[r]),s(()=>{n.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],n.current.exportCustomData=()=>{var o,a,m,u;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(a=e.lineList)!=null?a:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),c.length===0?null:r===y.Segmentation?t.createElement(t.Fragment,null,t.createElement(v,{checkMode:i,toolInstanceRef:n}),t.createElement(N,null),t.createElement(V,null),t.createElement(D,null)):t.createElement(t.Fragment,null,t.createElement(L,{checkMode:i,toolInstanceRef:n}),t.createElement("div",{className:l("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:l("point-cloud-wrapper")},t.createElement(B,null),t.createElement("div",{className:l("point-cloud-content")},t.createElement("div",{className:l("point-cloud-container","left")},t.createElement(w,null),t.createElement(j,null)),t.createElement("div",{className:l("point-cloud-container","right")},t.createElement(S,{drawLayerSlot:p,checkMode:i,intelligentFit:C}),t.createElement("div",{className:l("point-cloud-container","right-bottom")},t.createElement(b,{checkMode:i}),t.createElement(x,{checkMode:i})))),t.createElement(F,null))))};var $=T(G,null,null,{context:A})(R);export{$ as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.12.0-alpha.1",
3
+ "version": "1.12.0-alpha.2",
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.16.0-alpha.1",
46
+ "@labelbee/lb-annotation": "1.16.0-alpha.2",
47
47
  "@labelbee/lb-utils": "1.8.0-alpha.2",
48
48
  "ahooks": "^3.4.0",
49
49
  "classnames": "^2.3.0",