From 6fe8af4f657461365006f07beaee3a16ce46e3aa Mon Sep 17 00:00:00 2001 From: laoluo Date: Fri, 25 Nov 2022 19:41:28 +0800 Subject: [PATCH] fix: Update the function of getCuboidFromPointCloudBox --- .../components/pointCloudView/PointCloudBackView.tsx | 10 +++++++--- .../pointCloudView/hooks/usePointCloudViews.ts | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudBackView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudBackView.tsx index 4b5e17da6..5694e03fb 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudBackView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudBackView.tsx @@ -4,7 +4,12 @@ * @LastEditors: Laoluo luozefeng@sensetime.com * @LastEditTime: 2022-07-08 11:08:02 */ -import { PointCloud, MathUtils, PointCloudAnnotation } from '@labelbee/lb-annotation'; +import { + PointCloud, + MathUtils, + PointCloudAnnotation, + getCuboidFromPointCloudBox, +} from '@labelbee/lb-annotation'; import { getClassName } from '@/utils/dom'; import { PointCloudContainer } from './PointCloudLayout'; import React, { useEffect, useRef } from 'react'; @@ -172,8 +177,7 @@ const PointCloudSideView = ({ currentData, config }: IA2MapStateProps) => { // Update count if (ptCtx.mainViewInstance) { const { count } = ptCtx.mainViewInstance.getSensesPointZAxisInPolygon( - ptCtx.mainViewInstance.getCuboidFromPointCloudBox(newBoxParams) - .polygonPointList as IPolygonPoint[], + getCuboidFromPointCloudBox(newBoxParams).polygonPointList as IPolygonPoint[], [ newBoxParams.center.z - newBoxParams.depth / 2, newBoxParams.center.z + newBoxParams.depth / 2, diff --git a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts index d24de78a1..c88fd7c37 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts @@ -3,7 +3,7 @@ * @author Glenfiddish * @createdate 2022-08-17 */ -import { PointCloudAnnotation, PointCloud, MathUtils } from '@labelbee/lb-annotation'; +import { PointCloudAnnotation, PointCloud, MathUtils, getCuboidFromPointCloudBox } from '@labelbee/lb-annotation'; import { IPointCloudBox, EPerspectiveView, @@ -453,7 +453,7 @@ export const usePointCloudViews = () => { // Update count if (mainViewInstance) { const { count } = mainViewInstance.getSensesPointZAxisInPolygon( - mainViewInstance.getCuboidFromPointCloudBox(newBoxParams) + getCuboidFromPointCloudBox(newBoxParams) .polygonPointList as IPolygonPoint[], [ newBoxParams.center.z - newBoxParams.depth / 2,