@labelbee/lb-components 1.23.0-alpha.140 → 1.23.0-alpha.141
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 React=require("react"),ctx=require("../../../store/ctx.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../store/annotation/actionCreators.js"),usePointCloudViews=require("./usePointCloudViews.js"),useSphere=require("./useSphere.js"),useHistory=require("./useHistory.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},useUpdatePointCloudColor=(v,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../../../store/ctx.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../store/annotation/actionCreators.js"),usePointCloudViews=require("./usePointCloudViews.js"),useSphere=require("./useSphere.js"),useHistory=require("./useHistory.js"),ToolPointCloudBoxRenderHelper=require("../../../utils/ToolPointCloudBoxRenderHelper.js");const PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},useUpdatePointCloudColor=(v,a)=>{const l=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:u,selectedIDs:t,pointCloudBoxList:s,mainViewInstance:c,selectedID:g}=l,f=ctx.useDispatch(),{selectedSphere:C}=useSphere.useSphere(),{syncPointCloudViews:p,syncPointCloudPoint:P,generateRects:h}=usePointCloudViews.usePointCloudViews({setResourceLoading:v}),{selectedBox:d,updateSelectedBox:x}=useSingleBox.useSingleBox({generateRects:h}),{pushHistoryWithList:V}=useHistory.useHistory(),q=({newSelectedSphere:i,newSphereList:o})=>{const n=u==null?void 0:u.toolInstance;if((i||C)&&t.length===1){const e=i!=null?i:C;n.setSelectedID(t[0]);const r=n.selectedPoint;e&&(P==null||P(PointCloudView.Top,r,e,void 0,o,a))}},y=({trigger:i,newSelectedBox:o})=>{const n=u==null?void 0:u.toolInstance;if(!(t.length===0||!n)&&(o||(d==null?void 0:d.info))){const e=o!=null?o:d==null?void 0:d.info,r=o;if(e){p==null||p({omitView:PointCloudView.Top,polygon:r,boxParams:e},i);return}}};return{updatePointCloudColor:i=>{if(s.forEach(o=>{var n,e,r;if(o&&t.includes(o.id)){o.attribute=i;const S=f(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[o],stepConfig:a,action:"viewUpdateBox"}));o.valid=S[0].valid,x(o),(r=(e=(n=l==null?void 0:l.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:e.setPolygonValidAndRender)==null||r.call(e,o.id,!0,o.valid),q({})}}),c){const o=t&&t.length>1?ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.MulitSelect:ToolPointCloudBoxRenderHelper.EPointCloudBoxRenderTrigger.Single;if(l.syncAllViewPointCloudColor(o,s),t&&t.length===1){const n=s.find(e=>e.id===t[0]);y({trigger:o,newSelectedBox:n})}c.generateBoxes(s)}g||V({pointCloudBoxList:s})}}};exports.useUpdatePointCloudColor=useUpdatePointCloudColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as w}from"react";import{useDispatch as D}from"../../../store/ctx.js";import{useSingleBox as b}from"./useSingleBox.js";import{PointCloudContext as T}from"../PointCloudContext.js";import{EPointCloudName as R}from"@labelbee/lb-annotation";import{PreDataProcess as
|
|
1
|
+
import{useContext as w}from"react";import{useDispatch as D}from"../../../store/ctx.js";import{useSingleBox as b}from"./useSingleBox.js";import{PointCloudContext as T}from"../PointCloudContext.js";import{EPointCloudName as R}from"@labelbee/lb-annotation";import{PreDataProcess as H}from"../../../store/annotation/actionCreators.js";import{usePointCloudViews as E}from"./usePointCloudViews.js";import{useSphere as L}from"./useSphere.js";import{useHistory as _}from"./useHistory.js";import{EPointCloudBoxRenderTrigger as f}from"../../../utils/ToolPointCloudBoxRenderHelper.js";const P={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},k=(g,a)=>{const r=w(T),{topViewInstance:d,selectedIDs:i,pointCloudBoxList:l,mainViewInstance:c,selectedID:v}=r,h=D(),{selectedSphere:p}=L(),{syncPointCloudViews:C,syncPointCloudPoint:m,generateRects:V}=E({setResourceLoading:g}),{selectedBox:u,updateSelectedBox:j}=b({generateRects:V}),{pushHistoryWithList:x}=_(),y=({newSelectedSphere:e,newSphereList:o})=>{const n=d==null?void 0:d.toolInstance;if((e||p)&&i.length===1){const t=e!=null?e:p;n.setSelectedID(i[0]);const s=n.selectedPoint;t&&(m==null||m(P.Top,s,t,void 0,o,a))}},I=({trigger:e,newSelectedBox:o})=>{const n=d==null?void 0:d.toolInstance;if(!(i.length===0||!n)&&(o||(u==null?void 0:u.info))){const t=o!=null?o:u==null?void 0:u.info,s=o;if(t){C==null||C({omitView:P.Top,polygon:s,boxParams:t},e);return}}};return{updatePointCloudColor:e=>{if(l.forEach(o=>{var n,t,s;if(o&&i.includes(o.id)){o.attribute=e;const S=h(H({tool:R.PointCloud,dataList:[o],stepConfig:a,action:"viewUpdateBox"}));o.valid=S[0].valid,j(o),(s=(t=(n=r==null?void 0:r.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:t.setPolygonValidAndRender)==null||s.call(t,o.id,!0,o.valid),y({})}}),c){const o=i&&i.length>1?f.MulitSelect:f.Single;if(r.syncAllViewPointCloudColor(o,l),i&&i.length===1){const n=l.find(t=>t.id===i[0]);I({trigger:o,newSelectedBox:n})}c.generateBoxes(l)}v||x({pointCloudBoxList:l})}}};export{k as useUpdatePointCloudColor};
|