From ae60d8361595195b241ef5884013f5b11b15ea9a Mon Sep 17 00:00:00 2001 From: zhangyang8 Date: Mon, 8 Jun 2026 16:18:15 +0800 Subject: [PATCH] feat: Improve point cloud validity check by considering previous results --- .../src/components/pointCloudView/PointCloud3DView.tsx | 4 +++- .../src/components/pointCloudView/hooks/usePointCloudViews.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx index 9c72f7fe..67851bd6 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx @@ -231,7 +231,9 @@ const PointCloud3D: React.FC = ({ // Because updatePolygonList will reset the selected state, it is necessary to reset the current rectangle selection ptCtx.setSelectedIDs(currentSelectInfo.id); } - ptCtx.setPointCloudValid(jsonParser(currentData.result)?.valid); + const resultObj = jsonParser(currentData.result); + const preResultObj = jsonParser(currentData.preResult); + ptCtx.setPointCloudValid(resultObj?.valid ?? preResultObj?.valid); ptCtx.setPointCloudResult(boxParamsList); ptCtx.setRectList(rectParamsList); // Update the box of 3D view diff --git a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts index fa932a1e..803e9b16 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts @@ -1353,7 +1353,9 @@ export const usePointCloudViews = (params?: IUsePointCloudViewsParams) => { mainViewInstance.updateTopCamera(); - const valid = jsonParser(newData.result)?.valid ?? true; + const resultObj = jsonParser(newData.result); + const preResultObj = jsonParser(newData.preResult); + const valid = resultObj?.valid ?? preResultObj?.valid ?? true; ptCtx.setPointCloudValid(valid); // Clear other view data during initialization