From 3ea0dbf162eccfaf8b8b2ef8efd9ed7928963c74 Mon Sep 17 00:00:00 2001 From: laoluo Date: Mon, 14 Aug 2023 15:19:24 +0800 Subject: [PATCH 1/4] fix(pointcloud): Fix the pointSize cache of PointCloud --- packages/lb-annotation/src/core/pointCloud/index.ts | 2 +- packages/lb-components/src/index.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lb-annotation/src/core/pointCloud/index.ts b/packages/lb-annotation/src/core/pointCloud/index.ts index d441cd5e7..275a6f6d8 100644 --- a/packages/lb-annotation/src/core/pointCloud/index.ts +++ b/packages/lb-annotation/src/core/pointCloud/index.ts @@ -868,7 +868,7 @@ export class PointCloud extends EventListener { gl_FragColor = vec4(color, 1.0); }`, uniforms: { - pointSize: { value: 1.2 }, // Init size. + pointSize: { value: this.pointsMaterialSize }, // Init size. }, }; }; diff --git a/packages/lb-components/src/index.scss b/packages/lb-components/src/index.scss index 75bd8dbae..607ba34e4 100644 --- a/packages/lb-components/src/index.scss +++ b/packages/lb-components/src/index.scss @@ -1561,7 +1561,7 @@ $headerHeight: 40px; } &__slider { width: 70px; - padding: 0 4px; + padding: 0 4px 0 8px; } } From 093599c1a6b1ddccb3f33004f86e7f1fb320aae2 Mon Sep 17 00:00:00 2001 From: laoluo Date: Mon, 14 Aug 2023 15:36:26 +0800 Subject: [PATCH 2/4] style(pointcloud): Update the zIndex of hightlightView --- .../pointCloudView/components/HighlightVisible/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-components/src/components/pointCloudView/components/HighlightVisible/index.tsx b/packages/lb-components/src/components/pointCloudView/components/HighlightVisible/index.tsx index 699da2c63..b31af40d4 100644 --- a/packages/lb-components/src/components/pointCloudView/components/HighlightVisible/index.tsx +++ b/packages/lb-components/src/components/pointCloudView/components/HighlightVisible/index.tsx @@ -21,7 +21,7 @@ const HighlightVisible = ({ borderRadius: 2, padding: 6, fontSize: 16, - zIndex: 1001, + zIndex: 101, }; let ShowIcon = visible ? EyeFilled : EyeInvisibleFilled; From 705bc505517ca41d3bc3c3dd453f46acef449180 Mon Sep 17 00:00:00 2001 From: laoluo Date: Mon, 14 Aug 2023 20:00:55 +0800 Subject: [PATCH 3/4] fix(pointcloud): Loading need to include the highlight --- .../hooks/usePointCloudViews.ts | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts index 9a44a6af0..14abd0ea7 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts @@ -1201,8 +1201,29 @@ export const usePointCloudViews = () => { let boxParamsList: any[] = []; let lineList: any[] = []; - let polygonList = []; + let polygonList: any[] = []; let sphereParamsList: IPointCloudSphere[] = []; + + mainViewInstance.updateTopCamera(); + + const valid = jsonParser(newData.result)?.valid ?? true; + ptCtx.setPointCloudValid(valid); + + // Clear other view data during initialization + ptCtx.sideViewInstance?.clearAllData(); + ptCtx.backViewInstance?.clearAllData(); + + // TopView Data Update + /** + * Listen to flip + * 1. Init + * 2. Reload PointCloud + * 3. Clear Polygon + */ + topViewInstance.updateData(newData.url, newData.result, { + radius: config?.radius ?? DEFAULT_RADIUS, + }); + if (newData.result) { boxParamsList = PointCloudUtils.getBoxParamsFromResultList(newData.result); polygonList = PointCloudUtils.getPolygonListFromResultList(newData.result); @@ -1215,8 +1236,9 @@ export const usePointCloudViews = () => { /** * Use [] to replace the default highlight2DDataList. + * Need to await syncAllViewPointCloudColor before setLoading(false). */ - ptCtx.syncAllViewPointCloudColor(boxParamsList, []); + await ptCtx.syncAllViewPointCloudColor(boxParamsList, []); } initHistory({ @@ -1226,25 +1248,6 @@ export const usePointCloudViews = () => { pointCloudSphereList: sphereParamsList, }); - mainViewInstance.updateTopCamera(); - - const valid = jsonParser(newData.result)?.valid ?? true; - ptCtx.setPointCloudValid(valid); - - // Clear other view data during initialization - ptCtx.sideViewInstance?.clearAllData(); - ptCtx.backViewInstance?.clearAllData(); - - // TopView Data Update - /** - * Listen to flip - * 1. Init - * 2. Reload PointCloud - * 3. Clear Polygon - */ - topViewInstance.updateData(newData.url, newData.result, { - radius: config?.radius ?? DEFAULT_RADIUS, - }); SetPointCloudLoading(dispatch, false); }; From 6e93c2104302bbf838c5c4a36e461dc138427a32 Mon Sep 17 00:00:00 2001 From: laoluo Date: Mon, 14 Aug 2023 20:10:52 +0800 Subject: [PATCH 4/4] feat(spinning): Update the style of loading --- packages/lb-components/src/views/MainView/index.tsx | 10 +++++++++- packages/lb-utils/src/i18n/resources.json | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/lb-components/src/views/MainView/index.tsx b/packages/lb-components/src/views/MainView/index.tsx index bd234c88c..ecf7cbfd3 100644 --- a/packages/lb-components/src/views/MainView/index.tsx +++ b/packages/lb-components/src/views/MainView/index.tsx @@ -23,6 +23,8 @@ import PreviewResult from '@/components/predictTracking/previewResult'; import { LabelBeeContext } from '@/store/ctx'; import { EToolName } from '@/data/enums/ToolType'; import LLMLayout from './LLMLayout'; +import { LoadingOutlined } from '@ant-design/icons'; +import { useTranslation } from 'react-i18next'; interface IProps { path: string; @@ -74,11 +76,17 @@ const AnnotatedArea: React.FC = (props) => { }; const ViewportProviderLayout = (props: AppProps & IProps & { children: any }) => { + const { t } = useTranslation(); const { stepList, step } = props; const currentToolName = getStepConfig(stepList, step)?.tool; return ( - + } + tip={{t('LoadingTips')}} + delay={500} + >