From 49cf007caa592d00f7d297ac8a8cd8a1a3d0d116 Mon Sep 17 00:00:00 2001 From: laoluo Date: Wed, 14 Sep 2022 14:53:08 +0800 Subject: [PATCH] feat(pointcloud-info): Sync pointCloud showing info --- .../src/core/toolOperation/ViewOperation.ts | 2 +- .../pointCloudView/PointCloudInfos.tsx | 21 +++++++++++++++---- .../pointCloudView/PointCloudTopView.tsx | 2 -- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts b/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts index 808427544..368b48662 100644 --- a/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts @@ -12,8 +12,8 @@ import MathUtils from '@/utils/MathUtils'; import RenderDomClass from '@/utils/tool/RenderDomClass'; import { DEFAULT_FONT, ELineTypes, SEGMENT_NUMBER } from '@/constant/tool'; import { DEFAULT_TEXT_SHADOW, DEFAULT_TEXT_OFFSET, TEXT_ATTRIBUTE_OFFSET } from '@/constant/annotation'; -import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation'; import ImgPosUtils from '@/utils/tool/ImgPosUtils'; +import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation'; const newScope = 3; const DEFAULT_RADIUS = 3; diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudInfos.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudInfos.tsx index 6ca0ab07a..b38b9d20f 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudInfos.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudInfos.tsx @@ -22,15 +22,28 @@ export const SizeInfoForView = ({ perspectiveView }: { perspectiveView: EPerspec const box = pointCloudBoxList.find((i) => i.id === selectedID); if (selectedID && box) { + const { length, width, height } = PointCloudUtils.transferBox2Kitti(box); const infos = perspectiveView === EPerspectiveView.Back ? [ - { label: '宽', value: box.width }, - { label: '高', value: box.depth }, + { + label: '宽', + value: width, + }, + { + label: '高', + value: height, + }, ] : [ - { label: '长', value: box.height }, - { label: '宽', value: box.width }, + { + label: '长', + value: length, + }, + { + label: '宽', + value: width, + }, ]; return ( diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudTopView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudTopView.tsx index 7eda7d89c..c57ba8ed0 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudTopView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudTopView.tsx @@ -150,8 +150,6 @@ const PointCloudTopView: React.FC = ({ currentData }) => height: ref.current.clientHeight, }; - console.error("asd'"); - const pointCloudAnnotation = new PointCloudAnnotation({ container: ref.current, size,