From 1c3ee03b1dd3af8e2916e048b24f0fa4b5b8b874 Mon Sep 17 00:00:00 2001 From: lihqi <455711093@qq.com> Date: Wed, 11 Dec 2024 18:43:49 +0800 Subject: [PATCH] feat(lb-components): UnifySize add current frame size --- .../components/UnifyParamsModal/index.tsx | 132 +++++++++++++----- 1 file changed, 95 insertions(+), 37 deletions(-) diff --git a/packages/lb-components/src/components/pointCloudView/components/UnifyParamsModal/index.tsx b/packages/lb-components/src/components/pointCloudView/components/UnifyParamsModal/index.tsx index a3a33e2d..4e8dd2fa 100644 --- a/packages/lb-components/src/components/pointCloudView/components/UnifyParamsModal/index.tsx +++ b/packages/lb-components/src/components/pointCloudView/components/UnifyParamsModal/index.tsx @@ -1,11 +1,10 @@ -import { ESubmitType } from '@/constant'; -import { BatchUpdateResultByTrackID, ToSubmitFileData } from '@/store/annotation/actionCreators'; +import { BatchUpdateResultByTrackID } from '@/store/annotation/actionCreators'; import { LabelBeeContext, useDispatch } from '@/store/ctx'; -import { Form, InputNumber, message, Modal, Popover, Select } from 'antd'; +import { Form, InputNumber, message, Modal, Popover, Radio, Select } from 'antd'; import React, { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { QuestionCircleOutlined } from '@ant-design/icons'; -import { IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils'; +import { IPointCloudBox, IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils'; import { connect } from 'react-redux'; import { AppState } from '@/store'; import { AnnotationFileList } from '@/types/data'; @@ -49,6 +48,65 @@ const PrefixTag: React.FC<{ text: string }> = ({ text }) => { ); }; +interface ISizeShowProps { + size?: { + width: number; + height: number; + depth: number; + }; + isMax: boolean; + selectedBox?: IPointCloudBox; +} + +const SizeShow = (props: ISizeShowProps) => { + const { t } = useTranslation(); + + const { size, isMax, selectedBox } = props; + + if (!size || !selectedBox) { + return null; + } + const style = { marginRight: 16 }; + + const params = { + ...selectedBox, + ...(isMax && size), + }; + + const { length, width, height } = PointCloudUtils.transferBox2Kitti(params); + + return ( +