@labelbee/lb-components 1.6.0-alpha.0 → 1.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/annotation/lineTool/icon_line.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/copy.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/patse.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
- package/dist/assets/annotation/pointTool/icon_point.svg.js +1 -0
- package/dist/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
- package/dist/assets/annotation/rectTool/icon_rect.svg.js +1 -0
- package/dist/assets/annotation/rectTool/{icon_rectPattern.svg.js → icon_rect_a.svg.js} +0 -0
- package/dist/assets/{cssIcon/annotation/icon_clearSmall.svg → icons/25541b4d.svg} +0 -0
- package/dist/assets/icons/25ef334b.svg +8 -0
- package/dist/assets/icons/7eadb9c4.svg +5 -0
- package/dist/assets/icons/9d70807.svg +5 -0
- package/dist/assets/icons/c5b4262e.png +0 -0
- package/dist/assets/{cssIcon/slide_btn.svg → icons/cc550fff.svg} +0 -0
- package/dist/assets/{cssIcon/annotation/icon_clearSmall_a.svg → icons/dc9b6bfc.svg} +0 -0
- package/dist/assets/icons/e4f0b7fe.png +0 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/customResizeHook/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -0
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -0
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -0
- package/dist/components/pointCloudView/PointCloudContext.js +1 -0
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -0
- package/dist/components/pointCloudView/PointCloudLayout.js +1 -0
- package/dist/components/pointCloudView/PointCloudListener.js +1 -0
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -0
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -0
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
- package/dist/components/pointCloudView/hooks/useRotate.js +1 -0
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -0
- package/dist/hooks/annotation.js +1 -0
- package/dist/index.css +259 -43
- package/dist/index.js +1 -1
- package/dist/store/annotation/map.js +1 -0
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +2 -2
- package/dist/types/components/AnnotationView/index.d.ts +2 -2
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +3 -0
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +29 -0
- package/dist/types/components/pointCloudView/PointCloudInfos.d.ts +19 -0
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +10 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +55 -0
- package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +8 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +13 -0
- package/dist/types/components/pointCloudView/index.d.ts +15 -0
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/hooks/annotation.d.ts +20 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +4 -4
- package/dist/types/store/annotation/map.d.ts +13 -0
- package/dist/types/store/annotation/reducer.d.ts +1 -1
- package/dist/types/utils/PageOperator.d.ts +1 -1
- package/dist/types/utils/StepUtils.d.ts +7 -0
- package/dist/types/utils/ToolUtils.d.ts +10 -0
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +5 -1
- package/dist/types/views/MainView/sidebar/GeneralOperation/useOperationList.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/index.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/ToolIcons.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/ToolStyle/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/Pagination.d.ts +12 -2
- package/dist/types/views/MainView/toolFooter/ZoomController/index.d.ts +14 -4
- package/dist/types/views/MainView/toolFooter/index.d.ts +5 -8
- package/dist/types/views/MainView/toolHeader/ExportData/index.d.ts +1 -1
- package/dist/utils/StepUtils.js +1 -1
- package/dist/utils/ToolUtils.js +1 -0
- package/dist/utils/dom.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/ToolIcons.js +1 -0
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
- package/dist/views/MainView/toolFooter/Pagination.js +1 -1
- package/dist/views/MainView/toolFooter/ZoomController/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/es/App.js.map +1 -1
- package/es/assets/annotation/lineTool/icon_line.svg.js +1 -0
- package/es/assets/annotation/lineTool/icon_line.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/copy.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/copy.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/nextBox.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/patse.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/patse.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/prevBox.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/selectAll.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js.map +1 -0
- package/es/assets/annotation/pointTool/icon_point.svg.js +1 -0
- package/es/assets/annotation/pointTool/icon_point.svg.js.map +1 -0
- package/es/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
- package/es/assets/annotation/polygonTool/icon_polygon.svg.js.map +1 -0
- package/es/assets/annotation/rectTool/icon_rect.svg.js +1 -0
- package/es/assets/annotation/rectTool/icon_rect.svg.js.map +1 -0
- package/es/assets/annotation/rectTool/icon_rectPattern.svg.js +4 -1
- package/es/assets/annotation/rectTool/icon_rect_a.svg.js +1 -0
- package/es/assets/annotation/rectTool/icon_rect_a.svg.js.map +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/AnnotationView/index.js.map +1 -1
- package/es/components/customResizeHook/index.js +1 -1
- package/es/components/customResizeHook/index.js.map +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -0
- package/es/components/pointCloudView/PointCloud2DView.js.map +1 -0
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudBackView.js +1 -0
- package/es/components/pointCloudView/PointCloudBackView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudContext.js +1 -0
- package/es/components/pointCloudView/PointCloudContext.js.map +1 -0
- package/es/components/pointCloudView/PointCloudInfos.js +1 -0
- package/es/components/pointCloudView/PointCloudInfos.js.map +1 -0
- package/es/components/pointCloudView/PointCloudLayout.js +1 -1
- package/es/components/pointCloudView/PointCloudLayout.js.map +1 -0
- package/es/components/pointCloudView/PointCloudListener.js +1 -0
- package/es/components/pointCloudView/PointCloudListener.js.map +1 -0
- package/es/components/pointCloudView/PointCloudSideView.js +1 -0
- package/es/components/pointCloudView/PointCloudSideView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js.map +1 -0
- package/es/components/pointCloudView/data.js +4 -0
- package/es/components/pointCloudView/data.js.map +1 -0
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -0
- package/es/components/pointCloudView/hooks/useBoxes.js.map +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +1 -0
- package/es/components/pointCloudView/hooks/useRotate.js +1 -0
- package/es/components/pointCloudView/hooks/useRotate.js.map +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js.map +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/index.js.map +1 -0
- package/es/hooks/annotation.js +1 -0
- package/es/hooks/annotation.js.map +1 -0
- package/es/hooks/useSize.js.map +1 -1
- package/es/index.css +1350 -0
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/store/annotation/map.js +1 -0
- package/es/store/annotation/map.js.map +1 -0
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/annotation/reducer.js.map +1 -1
- package/es/utils/StepUtils.js +1 -1
- package/es/utils/StepUtils.js.map +1 -1
- package/es/utils/ToolUtils.js.map +1 -0
- package/es/utils/dom.js +1 -1
- package/es/utils/dom.js.map +1 -1
- package/es/utils/index.js +1 -1
- package/es/utils/index.js.map +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js.map +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js.map +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js.map +1 -0
- package/es/views/MainView/sidebar/ToolIcons.js +1 -0
- package/es/views/MainView/sidebar/ToolIcons.js.map +1 -0
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js.map +1 -0
- package/es/views/MainView/toolFooter/Pagination.js +1 -1
- package/es/views/MainView/toolFooter/Pagination.js.map +1 -1
- package/es/views/MainView/toolFooter/ZoomController/index.js +1 -1
- package/es/views/MainView/toolFooter/ZoomController/index.js.map +1 -1
- package/es/views/MainView/toolFooter/index.js +1 -1
- package/es/views/MainView/toolFooter/index.js.map +1 -1
- package/package.json +11 -9
- package/dist/index.css.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudInfos.js","sources":["../../../src/components/pointCloudView/PointCloudInfos.tsx"],"sourcesContent":["/**\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @file Display selected box's infos\n * @createdate 2022-07-13\n */\n\nimport { EPerspectiveView } from '@labelbee/lb-utils';\nimport React from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { UnitUtils } from '@labelbee/lb-annotation';\n\nconst DECIMAL_PLACES = 2;\n\n/**\n * Display size info for views\n * @param param0\n * @returns\n */\nexport const SizeInfoForView = ({ perspectiveView }: { perspectiveView: EPerspectiveView }) => {\n const { pointCloudBoxList, selectedID } = React.useContext(PointCloudContext);\n const box = pointCloudBoxList.find((i) => i.id === selectedID);\n\n if (selectedID && box) {\n const infos =\n perspectiveView === EPerspectiveView.Back\n ? [\n { label: '宽', value: box.width },\n { label: '高', value: box.depth },\n ]\n : [\n { label: '长', value: box.height },\n { label: '宽', value: box.width },\n ];\n\n return (\n <>\n {infos.map((info, index) => (\n <span key={index} style={{ marginRight: index === 0 ? 16 : 0, fontSize: 12 }}>{`${\n info.label\n }: ${info.value.toFixed(DECIMAL_PLACES)}`}</span>\n ))}\n </>\n );\n }\n return null;\n};\n\n/**\n * Display selected box's infos\n */\nexport const BoxInfos = () => {\n const ptCtx = React.useContext(PointCloudContext);\n const { selectedID, pointCloudBoxList } = ptCtx;\n const box = pointCloudBoxList.find((i) => i.id === selectedID);\n\n if (selectedID && box) {\n const { width, depth, height, rotation } = box;\n const infos = [\n {\n label: '长',\n value: height.toFixed(DECIMAL_PLACES),\n },\n {\n label: '宽',\n value: width.toFixed(DECIMAL_PLACES),\n },\n {\n label: '高',\n value: depth.toFixed(DECIMAL_PLACES),\n },\n {\n label: '朝向角',\n value: UnitUtils.rad2deg(rotation).toFixed(DECIMAL_PLACES),\n },\n // TODO: 需要将结果存入到标注信息\n {\n label: '点数',\n value: 1000,\n },\n ];\n\n return (\n <div\n style={{\n position: 'absolute',\n color: 'white',\n backgroundColor: 'rgba(153, 153, 153, 0.3)',\n right: 8,\n top: 8,\n fontSize: 12,\n padding: 8,\n zIndex: 20,\n }}\n >\n {infos.map((i) => (\n <div key={i.label}>{`${i.label}: ${i.value}`}</div>\n ))}\n </div>\n );\n }\n\n return null;\n};\n\nexport const PointCloudValidity = () => {\n const ptCtx = React.useContext(PointCloudContext);\n\n if (ptCtx.valid === false) {\n return (\n <div\n style={{\n position: 'absolute',\n backgroundColor: 'red',\n left: 0,\n top: 0,\n fontSize: 24,\n padding: 8,\n zIndex: 20,\n }}\n >\n 无效\n </div>\n );\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;AAWA,MAAM,cAAiB,GAAA,CAAA,CAAA;AAOV,MAAA,eAAA,GAAkB,CAAC,CAAE,eAA6D,CAAA,KAAA;AAC7F,EAAA,MAAM,CAAE,iBAAA,EAAmB,UAAe,CAAA,GAAA,KAAA,CAAM,UAAW,CAAA,iBAAA,CAAA,CAAA;AAC3D,EAAA,MAAM,MAAM,iBAAkB,CAAA,IAAA,CAAK,CAAC,CAAA,KAAM,EAAE,EAAO,KAAA,UAAA,CAAA,CAAA;AAEnD,EAAA,IAAI,cAAc,GAAK,EAAA;AACrB,IAAM,MAAA,KAAA,GACJ,eAAoB,KAAA,gBAAA,CAAiB,IACjC,GAAA;AAAA,MACE,CAAE,KAAA,EAAO,QAA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A,2CACG,KAAD,EAAA;AAAA,MACE,KAAO,EAAA;AAAA,QACL,QAAU,EAAA,UAAA;AAAA,QACV,eAAiB,EAAA,KAAA;AAAA,QACjB,IAAM,EAAA,CAAA;AAAA,QACN,GAAK,EAAA,CAAA;AAAA,QACL,QAAU,EAAA,EAAA;AAAA,QACV,OAAS,EAAA,CAAA;AAAA,QACT,MAAQ,EAAA,EAAA;AAAA,OAAA;AAAA,KAEX,EAAA,cAAA,CAAA,CAAA;AAAA,GAAA;AAKL,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as e}from"../../utils/dom.js";import c from"classnames";import t from"react";const s=({title:o,toolbar:a,children:n,className:r})=>t.createElement("div",{className:c([r,e("point-cloud-container")])},t.createElement("div",{className:e("point-cloud-container","header")},t.createElement("span",{className:e("point-cloud-container","header-title")},o),a&&t.createElement("div",{className:e("point-cloud-container","header-toolbar")},a)),n);export{s as PointCloudContainer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudLayout.js","sources":["../../../src/components/pointCloudView/PointCloudLayout.tsx"],"sourcesContent":["import { getClassName } from '@/utils/dom';\nimport classNames from 'classnames';\nimport React from 'react';\n\nexport const PointCloudContainer: React.FC<{\n title: string;\n toolbar?: React.ReactElement;\n className?: string;\n}> = ({ title, toolbar, children, className }) => {\n return (\n <div className={classNames([className, getClassName('point-cloud-container')])}>\n <div className={getClassName('point-cloud-container', 'header')}>\n <span className={getClassName('point-cloud-container', 'header-title')}>{title}</span>\n\n {toolbar && (\n <div className={getClassName('point-cloud-container', 'header-toolbar')}>{toolbar}</div>\n )}\n </div>\n\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,sBAIR,CAAC,CAAE,KAAO,EAAA,OAAA,EAAS,UAAU,SAAgB,CAAA,KAAA;AAChD,EAAA,2CACG,KAAD,EAAA;AAAA,IAAK,SAAW,EAAA,UAAA,CAAW,CAAC,SAAA,EAAW,YAAa,CAAA,uBAAA,CAAA,CAAA,CAAA;AAAA,GAAA,sCACjD,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,QAAA,CAAA;AAAA,GAAA,sCACnD,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,aAAa,uBAAyB,EAAA,cAAA,CAAA;AAAA,GAAkB,EAAA,KAAA,CAAA,EAExE,OACC,oBAAA,KAAA,CAAA,aAAA,CAAC,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,gBAAA,CAAA;AAAA,GAAA,EAAoB,OAI7E,CAAA,CAAA,EAAA,QAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PointCloudContext as y}from"./PointCloudContext.js";import{useRotate as g}from"./hooks/useRotate.js";import{useBoxes as O}from"./hooks/useBoxes.js";import{useSingleBox as S}from"./hooks/useSingleBox.js";import{useContext as h,useEffect as d}from"react";import{cTool as I}from"@labelbee/lb-annotation";import{message as L}from"antd";import{connect as j}from"react-redux";import{aMapStateToProps as E}from"../../store/annotation/map.js";import{PointCloudUtils as R}from"@labelbee/lb-utils";import{useCustomToolInstance as A}from"../../hooks/annotation.js";var V=Object.defineProperty,N=Object.defineProperties,T=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,P=(t,e,a)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,z=(t,e)=>{for(var a in e||(e={}))D.call(e,a)&&P(t,a,e[a]);if(f)for(var a of f(e))K.call(e,a)&&P(t,a,e[a]);return t},F=(t,e)=>N(t,T(e));const{EPolygonPattern:i}=I,$=({currentData:t})=>{const e=h(y),{changeSelectedBoxValid:a,selectNextBox:b,selectPrevBox:v,updateSelectedBox:p}=S(),{copySelectedBoxes:x,pasteSelectedBoxes:w,copiedBoxes:C}=O(),{toolInstanceRef:c}=A(),{updateRotate:u}=g({currentData:t}),B=o=>{const{topViewInstance:n,mainViewInstance:r}=e;if(!n)return;const{pointCloud2dOperation:s}=n;switch(o){case"q":{u(2);break}case"e":u(-2);break;case"g":u(180);break;case"u":{const l=s.pattern===i.Normal?i.Rect:i.Normal;s.setPattern(l);const k={[i.Normal]:"Normal Pattern",[i.Rect]:"Rect Pattern"};L.success(`Change Pattern to ${k[l]} successfully`),s.clearActiveStatus(),s.clearDrawingStatus()}break;case"+":r==null||r.updatePointSize(!0);break;case"-":r==null||r.updatePointSize(!1);break;case"v":e.setPointCloudValid(!e.valid);break;case"z":b();break;case"c":v();break;case"f":a();break;default:return}},_=o=>{switch(o){case"c":x();break;case"v":w();break;case"a":e.selectedAllBoxes();break}},m=o=>{const n=o.key.toLocaleLowerCase();if(o.ctrlKey){_(n);return}B(n)};return d(()=>{const{topViewInstance:o}=e;if(!!o)return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[e,C]),d(()=>{var o,n;const r=e.mainViewInstance;if((t==null?void 0:t.url)&&r){if(r.loadPCDFile(t.url),e.pointCloudBoxList.forEach(s=>{r==null||r.removeObjectByName(s.id)}),t.result){const s=R.getBoxParamsFromResultList(t.result);s.forEach(l=>{r==null||r.generateBox(l)}),e.setPointCloudResult(s)}else e.setPointCloudResult([]);r.updateTopCamera(),(o=e.sideViewInstance)==null||o.clearAllData(),(n=e.backViewInstance)==null||n.clearAllData()}},[t,e.mainViewInstance]),d(()=>{c.current.exportData=()=>[e.pointCloudBoxList,{}],c.current.setDefaultAttribute=o=>{const n=e.selectedPointCloudBox;n&&(n.attribute=o,p(n))},c.current.setSubAttribute=(o,n)=>{var r;const s=e.selectedPointCloudBox;if(s){const l=(r=s==null?void 0:s.subAttribute)!=null?r:{};s.subAttribute=F(z({},l),{[o]:n}),p(s)}}},[e.pointCloudBoxList,e.selectedID]),null};var q=j(E)($);export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudListener.js","sources":["../../../src/components/pointCloudView/PointCloudListener.tsx"],"sourcesContent":["import { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useBoxes } from './hooks/useBoxes';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport React, { useContext, useEffect } from 'react';\nimport { cTool } from '@labelbee/lb-annotation';\nimport { message } from 'antd';\nimport { connect } from 'react-redux';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { IPointCloudBox, PointCloudUtils } from '@labelbee/lb-utils';\nimport { useCustomToolInstance } from '@/hooks/annotation';\n\nconst { EPolygonPattern } = cTool;\n\nconst PointCloudListener: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ptCtx = useContext(PointCloudContext);\n const { changeSelectedBoxValid, selectNextBox, selectPrevBox, updateSelectedBox } =\n useSingleBox();\n const { copySelectedBoxes, pasteSelectedBoxes, copiedBoxes } = useBoxes();\n const { toolInstanceRef } = useCustomToolInstance();\n const { updateRotate } = useRotate({ currentData });\n\n const keydownEvents = (lowerCaseKey: string) => {\n const { topViewInstance, mainViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopPointCloudPolygonOperation } = topViewInstance;\n\n switch (lowerCaseKey) {\n case 'q': {\n // Q - anticlockwise\n updateRotate(2);\n break;\n }\n\n case 'e':\n // E - closewise\n updateRotate(-2);\n\n break;\n\n case 'g':\n // G , overturn 180\n updateRotate(180);\n\n break;\n\n case 'u':\n {\n // U , change TopOpereation Pattern\n const newPattern =\n TopPointCloudPolygonOperation.pattern === EPolygonPattern.Normal\n ? EPolygonPattern.Rect\n : EPolygonPattern.Normal;\n TopPointCloudPolygonOperation.setPattern(newPattern);\n const POLYGON_PATTERN = {\n [EPolygonPattern.Normal]: 'Normal Pattern',\n [EPolygonPattern.Rect]: 'Rect Pattern',\n };\n message.success(`Change Pattern to ${POLYGON_PATTERN[newPattern]} successfully`);\n\n // Clear Status\n TopPointCloudPolygonOperation.clearActiveStatus();\n TopPointCloudPolygonOperation.clearDrawingStatus();\n }\n\n break;\n\n // +: Increase points size\n case '+':\n mainViewInstance?.updatePointSize(true);\n break;\n\n // -: Reduce points size\n case '-':\n mainViewInstance?.updatePointSize(false);\n break;\n\n case 'v':\n ptCtx.setPointCloudValid(!ptCtx.valid);\n break;\n\n case 'z':\n selectNextBox();\n break;\n\n case 'c':\n selectPrevBox();\n break;\n\n case 'f':\n changeSelectedBoxValid();\n break;\n\n default: {\n return;\n }\n }\n };\n\n const ctrlKeydownEvents = (lowerCaseKey: string) => {\n switch (lowerCaseKey) {\n case 'c':\n copySelectedBoxes();\n break;\n case 'v':\n pasteSelectedBoxes();\n break;\n case 'a':\n ptCtx.selectedAllBoxes();\n break;\n default:\n break;\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n const lowerCaseKey = e.key.toLocaleLowerCase();\n\n if (e.ctrlKey) {\n ctrlKeydownEvents(lowerCaseKey);\n return;\n }\n\n keydownEvents(lowerCaseKey);\n };\n\n useEffect(() => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n window.addEventListener('keydown', onKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [ptCtx, copiedBoxes]);\n\n // Page switch data initialization\n useEffect(() => {\n const pointCloud = ptCtx.mainViewInstance;\n if (currentData?.url && pointCloud) {\n pointCloud.loadPCDFile(currentData.url);\n\n // Clear All Data\n ptCtx.pointCloudBoxList.forEach((v) => {\n pointCloud?.removeObjectByName(v.id);\n });\n\n if (currentData.result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n pointCloud?.generateBox(v);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n } else {\n ptCtx.setPointCloudResult([]);\n }\n\n pointCloud.updateTopCamera();\n\n // Clear other view data during initialization\n ptCtx.sideViewInstance?.clearAllData();\n ptCtx.backViewInstance?.clearAllData();\n }\n }, [currentData, ptCtx.mainViewInstance]);\n\n useEffect(() => {\n toolInstanceRef.current.exportData = () => {\n return [ptCtx.pointCloudBoxList, {}];\n };\n\n toolInstanceRef.current.setDefaultAttribute = (newAttribute: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n selectBox.attribute = newAttribute;\n\n updateSelectedBox(selectBox);\n }\n };\n\n toolInstanceRef.current.setSubAttribute = (key: string, value: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n const originSubAttribute = selectBox?.subAttribute ?? {};\n\n selectBox.subAttribute = {\n ...originSubAttribute,\n [key]: value,\n };\n\n updateSelectedBox(selectBox);\n }\n };\n }, [ptCtx.pointCloudBoxList, ptCtx.selectedID]);\n\n return null;\n};\n\nexport default connect(aMapStateToProps)(PointCloudListener);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAE5B,MAAM,kBAAA,GAAsD,CAAC,CAAE,WAAkB,CAAA,KAAA;AAC/E,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAA,MAAM,CAAE,sBAAA,EAAwB,aAAe,EAAA,aAAA,EAAe,iBAC5D,CAAA,GAAA,YAAA,EAAA,CAAA;AACF,EAAM,MAAA,CAAE,iBAAmB,EAAA,kBAAA,EAAoB,WAAgB,CAAA,GAAA,QAAA,EAAA,CAAA;AAC/D,EAAA,MAAM,CAAE,eAAoB,CAAA,GAAA,qBAAA,EAAA,CAAA;AAC5B,EAAM,MAAA,CAAE,YAAiB,CAAA,GAAA,SAAA,CAAU,CAAE,WAAA,CAAA,CAAA,CAAA;AAErC,EAAM,MAAA,aAAA,GAAgB,CAAC,YAAyB,KAAA;AAC9C,IAAM,MAAA,CAAE,iBAAiB,gBAAqB,CAAA,G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A,CAAA,CAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,GAGrB,EAAA,CAAC,KAAM,CAAA,iBAAA,EAAmB,KAAM,CAAA,UAAA,CAAA,CAAA,CAAA;AAEnC,EAAO,OAAA,IAAA,CAAA;AAAA,CAAA,CAAA;AAGT,2BAAe,QAAQ,gBAAkB,CAAA,CAAA,kBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PointCloudAnnotation as h}from"@labelbee/lb-annotation";import{getClassName as x}from"../../utils/dom.js";import{PointCloudContainer as P}from"./PointCloudLayout.js";import d,{useState as g,useRef as y,useEffect as u}from"react";import{EPerspectiveView as V}from"@labelbee/lb-utils";import{PointCloudContext as v}from"./PointCloudContext.js";import{SizeInfoForView as b}from"./PointCloudInfos.js";import{connect as j}from"react-redux";import{aMapStateToProps as E}from"../../store/annotation/map.js";import{usePointCloudViews as B}from"./hooks/usePointCloudViews.js";const I=(a,t,e=1)=>{const{width:c,height:i}=t,o={x:a.x+c*e/2,y:a.y+i*e/2},n={x:t.width/2,y:t.height/2};return{offsetX:(n.x-o.x)/e,offsetY:-(n.y-o.y)/e}},f=(a,t,e,c,i)=>{const{offsetX:o,offsetY:n}=I(a,e,t);if(i.camera.zoom=t,a){const l=Math.cos(c.rotation),s=Math.sin(c.rotation),r=o*l,m=o*s,{x:p,y:C,z:w}=i.initCameraPosition;i.camera.position.set(p-r,C-m,w+n)}i.camera.updateProjectionMatrix(),i.render()},M=({currentData:a})=>{const t=d.useContext(v),[e,c]=g(null),{sideViewUpdateBox:i}=B(),o=y(null);return u(()=>{if(o.current){const n={width:o.current.clientWidth,height:o.current.clientHeight},l=new h({container:o.current,size:n});t.setSideViewInstance(l),c(n)}},[]),u(()=>{if(!e||!t.sideViewInstance)return;const{pointCloud2dOperation:n,pointCloudInstance:l}=t.sideViewInstance;n.singleOn("renderZoom",(s,r)=>{!t.selectedPointCloudBox||f(r,s,e,t.selectedPointCloudBox,l)}),n.singleOn("dragMove",({currentPos:s,zoom:r})=>{!t.selectedPointCloudBox||f(s,r,e,t.selectedPointCloudBox,l)}),n.singleOn("updatePolygonByDrag",({newPolygon:s,originPolygon:r})=>{i(s,r)})},[t,e]),d.createElement(P,{className:x("point-cloud-container","side-view"),title:"\u4FA7\u89C6\u56FE",toolbar:d.createElement(b,{perspectiveView:V.Left})},d.createElement("div",{style:{width:"100%",height:300},ref:o}),d.createElement("div",{style:{position:"absolute",right:0,top:0,width:200,color:"white"}}))};var O=j(E)(M);export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudSideView.js","sources":["../../../src/components/pointCloudView/PointCloudSideView.tsx"],"sourcesContent":["/**\n * @file PointCloud sideView - React Component\n * @createdate 2022-07-11\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { EPerspectiveView, IPointCloudBox } from '@labelbee/lb-utils';\nimport { PointCloudContext } from './PointCloudContext';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\n\n/**\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2, // 放大倍数之后的中心点的偏移量\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst updateSideViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n SidePointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n SidePointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = SidePointCloud.initCameraPosition;\n SidePointCloud.camera.position.set(x - offsetXX, y - offsetXY, z + offsetY);\n }\n SidePointCloud.camera.updateProjectionMatrix();\n SidePointCloud.render();\n};\n\nconst PointCloudSideView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ptCtx = React.useContext(PointCloudContext);\n const [size, setSize] = useState<{ width: number; height: number } | null>(null);\n const { sideViewUpdateBox } = usePointCloudViews();\n\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({ container: ref.current, size });\n ptCtx.setSideViewInstance(pointCloudAnnotation);\n setSize(size);\n // };\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation, pointCloudInstance } = ptCtx.sideViewInstance;\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n pointCloud2dOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n // Synchronized 3d point cloud view displacement operations\n pointCloud2dOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n pointCloud2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon, originPolygon }: any) => {\n sideViewUpdateBox(newPolygon, originPolygon);\n });\n }, [ptCtx, size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'side-view')}\n title='侧视图'\n toolbar={<SizeInfoForView perspectiveView={EPerspectiveView.Left} />}\n >\n <div style={{ width: '100%', height: 300 }} ref={ref} />\n <div\n style={{\n position: 'absolute',\n right: 0,\n top: 0,\n width: 200,\n color: 'white',\n }}\n />\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps)(PointCloudSideView);\n"],"names":[],"mappings":";;;;;;;;;;;AAuBA,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,CAAA,EAAG,KAAK,KAAQ,GAAA,CAAA;AAAA,IAChB,CAAA,EAAG,KAAK,MAAS,GAAA,CAAA;AAAA,GAAA,CAAA;AAGnB,EAAO,OAAA;AAAA,IACL,OAAU,EAAA,CAAA,gBAAA,CAAiB,CAAI,GAAA,iBAAA,CAAkB,CAAK,IAAA,IAAA;AAAA,IACtD,OAAS,EAAA,EAAmB,gBAAA,CAAA,CAAA,GAAI,kBAAkB,CAAK,CAA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AA,KAAA,CAAM,qBACN,EAAA,kBAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAIJ,IAAA,qBAAA,CAAsB,QAAS,CAAA,qBAAA,EAAuB,CAAC,CAAE,YAAY,aAAyB,CAAA,KAAA;AAC5F,MAAA,iBAAA,CAAkB,UAAY,EAAA,aAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAAA,GAAA,EAE/B,CAAC,KAAO,EAAA,IAAA,CAAA,CAAA,CAAA;AAEX,EAAA,2CACG,mBAAD,EAAA;AAAA,IACE,SAAA,EAAW,aAAa,uBAAyB,EAAA,WAAA,CAAA;AAAA,IACjD,KAAM,EAAA,oBAAA;AAAA,IACN,OAAA,sCAAU,eAAD,EAAA;AAAA,MAAiB,iBAAiB,gBAAiB,CAAA,IAAA;AAAA,KAAA,CAAA;AAAA,GAAA,sCAE3D,KAAD,EAAA;AAAA,IAAK,KAAO,EAAA,CAAE,KAAO,EAAA,MAAA,EAAQ,MAAQ,EAAA,GAAA,CAAA;AAAA,IAAO,GAAA;AAAA,GAAA,CAAA,sCAC3C,KAAD,EAAA;AAAA,IACE,KAAO,EAAA;AAAA,MACL,QAAU,EAAA,UAAA;AAAA,MACV,KAAO,EAAA,CAAA;AAAA,MACP,GAAK,EAAA,CAAA;AAAA,MACL,KAAO,EAAA,GAAA;AAAA,MACP,KAAO,EAAA,OAAA;AAAA,KAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOjB,2BAAe,QAAQ,gBAAkB,CAAA,CAAA,kBAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getClassName as p}from"../../utils/dom.js";import{FooterDivider as V}from"../../views/MainView/toolFooter/index.js";import{ZoomController as k}from"../../views/MainView/toolFooter/ZoomController/index.js";import{UpSquareOutlined as T,DownSquareOutlined as B}from"@ant-design/icons";import{PointCloudAnnotation as N,cTool as R}from"@labelbee/lb-annotation";import o,{useRef as y,useState as I,useEffect as x}from"react";import{PointCloudContext as A}from"./PointCloudContext.js";import{useRotate as b}from"./hooks/useRotate.js";import{useSingleBox as O}from"./hooks/useSingleBox.js";import{PointCloudContainer as F}from"./PointCloudLayout.js";import{BoxInfos as Z,PointCloudValidity as M}from"./PointCloudInfos.js";import{Slider as L}from"antd";import{aMapStateToProps as z}from"../../store/annotation/map.js";import{connect as X}from"react-redux";import{usePointCloudViews as Y}from"./hooks/usePointCloudViews.js";const{EPolygonPattern:q}=R,S=(e,i,t=1)=>{const{width:r,height:c}=i,a={x:e.x+r*t/2,y:e.y+c*t/2},d={x:i.width/2,y:i.height/2};return{offsetX:(d.x-a.x)/t,offsetY:-(d.y-a.y)/t}},U=({currentData:e})=>{const{selectNextBox:i,selectPrevBox:t}=O(),{updateRotate:r}=b({currentData:e}),c=2,a=()=>{r(-c)},d=()=>{r(c)},u=()=>{r(180)};return o.createElement(o.Fragment,null,o.createElement("span",{onClick:d,className:p("point-cloud","rotate-reserve")}),o.createElement("span",{onClick:a,className:p("point-cloud","rotate")}),o.createElement("span",{onClick:u,className:p("point-cloud","rotate-180")}),o.createElement(V,null),o.createElement(T,{onClick:()=>{t()},className:p("point-cloud","prev")}),o.createElement(B,{onClick:()=>{i()},className:p("point-cloud","next")}),o.createElement(V,null),o.createElement(k,null))},W=({setZAxisLimit:e,zAxisLimit:i})=>o.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},o.createElement(L,{vertical:!0,step:.5,max:10,min:.5,defaultValue:i,onAfterChange:t=>{e(t)}})),H=({currentData:e})=>{const i=y(null),t=o.useContext(A),r=y(),{deletePointCloudBox:c}=O(),[a,d]=I(null),[u,j]=I(10),m=Y();return x(()=>{if(i.current&&(e==null?void 0:e.url)&&(e==null?void 0:e.result)){const s={width:i.current.clientWidth,height:i.current.clientHeight};if(t.topViewInstance){t.topViewInstance.updateData(e.url,e.result);return}const n=new N({container:i.current,size:s,pcdPath:e.url});n.addPolygonListOnTopView(e.result),t.setTopViewInstance(n);const l=n.pointCloudInstance,E=n.pointCloud2dOperation;r.current=l,E.singleOn("renderZoom",(C,f)=>{const{offsetX:w,offsetY:g}=S(f,s,C);if(l.camera.zoom=C,f){const{x:h,y:P,z:v}=l.initCameraPosition;l.camera.position.set(h+g,P-w,v)}l.camera.updateProjectionMatrix(),l.render()}),E.singleOn("dragMove",({currentPos:C,zoom:f})=>{const{offsetX:w,offsetY:g}=S(C,s,f);l.camera.zoom=f;const{x:h,y:P,z:v}=l.initCameraPosition;l.camera.position.set(h+g,P-w,v),l.render()}),d(s)}},[e]),x(()=>{if(!a||!t.topViewInstance||!t.sideViewInstance)return;const{pointCloud2dOperation:s}=t.topViewInstance;s.singleOn("polygonCreated",n=>{s.pattern===q.Normal||!(e==null?void 0:e.url)||m.topViewAddBox(n,a)}),s.singleOn("deletedObject",({id:n})=>{c(n)}),s.singleOn("deleteSelectedIDs",()=>{t.setSelectedIDs([])}),s.singleOn("addSelectedIDs",n=>{t.addSelectedID(n)}),s.singleOn("setSelectedIDs",n=>{t.setSelectedIDs(n)}),s.singleOn("updatePolygonByDrag",({newPolygon:n})=>{var l;(l=m.topViewUpdateBox)==null||l.call(m,n,a)})},[t,a,e,m]),x(()=>{r.current&&r.current.applyZAxisPoints(u)},[u]),x(()=>{m.topViewSelectedChanged()},[t.selectedIDs]),o.createElement(F,{className:p("point-cloud-container","top-view"),title:"\u4FEF\u89C6\u56FE",toolbar:o.createElement(U,{currentData:e})},o.createElement("div",{style:{position:"relative",flex:1}},o.createElement("div",{style:{width:"100%",height:"100%"},ref:i}),o.createElement(Z,null),o.createElement(W,{zAxisLimit:u,setZAxisLimit:j}),o.createElement(M,null)))};var _=X(z)(H);export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloudTopView.js","sources":["../../../src/components/pointCloudView/PointCloudTopView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n */\nimport { getClassName } from '@/utils/dom';\nimport { FooterDivider } from '@/views/MainView/toolFooter';\nimport { ZoomController } from '@/views/MainView/toolFooter/ZoomController';\nimport { DownSquareOutlined, UpSquareOutlined } from '@ant-design/icons';\nimport { cTool, PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { BoxInfos, PointCloudValidity } from './PointCloudInfos';\nimport { Slider } from 'antd';\nimport { aMapStateToProps, IAnnotationStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\n\nconst { EPolygonPattern } = cTool;\n\n/**\n * Get the offset from canvas2d-coordinate to world coordinate (Top View)\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst TopViewToolbar = ({ currentData }: IAnnotationStateProps) => {\n const { selectNextBox, selectPrevBox } = useSingleBox();\n const { updateRotate } = useRotate({ currentData });\n const ratio = 2;\n\n const clockwiseRotate = () => {\n updateRotate(-ratio);\n };\n const anticlockwiseRotate = () => {\n updateRotate(ratio);\n };\n\n const reverseRotate = () => {\n updateRotate(180);\n };\n\n return (\n <>\n <span\n onClick={anticlockwiseRotate}\n className={getClassName('point-cloud', 'rotate-reserve')}\n />\n <span onClick={clockwiseRotate} className={getClassName('point-cloud', 'rotate')} />\n <span onClick={reverseRotate} className={getClassName('point-cloud', 'rotate-180')} />\n <FooterDivider />\n <UpSquareOutlined\n onClick={() => {\n selectPrevBox();\n }}\n className={getClassName('point-cloud', 'prev')}\n />\n <DownSquareOutlined\n onClick={() => {\n selectNextBox();\n }}\n className={getClassName('point-cloud', 'next')}\n />\n <FooterDivider />\n <ZoomController />\n </>\n );\n};\n\n/**\n * Slider for filtering Z-axis points\n */\nconst ZAxisSlider = ({\n setZAxisLimit,\n zAxisLimit,\n}: {\n setZAxisLimit: (value: number) => void;\n zAxisLimit: number;\n}) => {\n return (\n <div style={{ position: 'absolute', top: 128, right: 8, height: '50%', zIndex: 20 }}>\n <Slider\n vertical\n step={0.5}\n max={10}\n min={0.5}\n defaultValue={zAxisLimit}\n onAfterChange={(v: number) => {\n setZAxisLimit(v);\n }}\n />\n </div>\n );\n};\n\nconst PointCloudTopView: React.FC<IAnnotationStateProps> = ({ currentData }) => {\n const ref = useRef<HTMLDivElement>(null);\n const ptCtx = React.useContext(PointCloudContext);\n const pointCloudRef = useRef<PointCloud | null>();\n const { deletePointCloudBox } = useSingleBox();\n\n const [size, setSize] = useState<{ width: number; height: number } | null>(null);\n const [zAxisLimit, setZAxisLimit] = useState<number>(10);\n\n const pointCloudViews = usePointCloudViews();\n\n useEffect(() => {\n if (ref.current && currentData?.url && currentData?.result) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n if (ptCtx.topViewInstance) {\n /**\n * Listen to flip\n * 1. Init\n * 2. Reload PointCloud\n * 3. Clear Polygon\n */\n ptCtx.topViewInstance.updateData(currentData.url, currentData.result);\n return;\n }\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n pcdPath: currentData.url,\n });\n pointCloudAnnotation.addPolygonListOnTopView(currentData.result);\n\n ptCtx.setTopViewInstance(pointCloudAnnotation);\n\n const pointCloud = pointCloudAnnotation.pointCloudInstance;\n const polygonOperation = pointCloudAnnotation.pointCloud2dOperation;\n\n pointCloudRef.current = pointCloud;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n polygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n if (currentPos) {\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n }\n\n pointCloud.camera.updateProjectionMatrix();\n pointCloud.render();\n });\n\n // Synchronized 3d point cloud view displacement operations\n polygonOperation.singleOn('dragMove', ({ currentPos, zoom }) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n pointCloud.camera.zoom = zoom;\n const { x, y, z } = pointCloud.initCameraPosition;\n pointCloud.camera.position.set(x + offsetY, y - offsetX, z);\n pointCloud.render();\n });\n\n setSize(size);\n }\n }, [currentData]);\n\n useEffect(() => {\n if (!size || !ptCtx.topViewInstance || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopView2dOperation } = ptCtx.topViewInstance;\n\n TopView2dOperation.singleOn('polygonCreated', (polygon: any) => {\n if (TopView2dOperation.pattern === EPolygonPattern.Normal || !currentData?.url) {\n return;\n }\n\n pointCloudViews.topViewAddBox(polygon, size);\n });\n\n TopView2dOperation.singleOn('deletedObject', ({ id }) => {\n deletePointCloudBox(id);\n });\n\n TopView2dOperation.singleOn('deleteSelectedIDs', () => {\n ptCtx.setSelectedIDs([]);\n });\n\n TopView2dOperation.singleOn('addSelectedIDs', (selectedID: string) => {\n ptCtx.addSelectedID(selectedID);\n });\n\n TopView2dOperation.singleOn('setSelectedIDs', (selectedIDs: string[]) => {\n ptCtx.setSelectedIDs(selectedIDs);\n });\n\n TopView2dOperation.singleOn('updatePolygonByDrag', ({ newPolygon }: any) => {\n pointCloudViews.topViewUpdateBox?.(newPolygon, size);\n });\n }, [ptCtx, size, currentData, pointCloudViews]);\n\n useEffect(() => {\n if (pointCloudRef.current) {\n pointCloudRef.current.applyZAxisPoints(zAxisLimit);\n }\n }, [zAxisLimit]);\n\n useEffect(() => {\n pointCloudViews.topViewSelectedChanged();\n }, [ptCtx.selectedIDs]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'top-view')}\n title='俯视图'\n toolbar={<TopViewToolbar currentData={currentData} />}\n >\n <div style={{ position: 'relative', flex: 1 }}>\n <div style={{ width: '100%', height: '100%' }} ref={ref} />\n\n <BoxInfos />\n <ZAxisSlider zAxisLimit={zAxisLimit} setZAxisLimit={setZAxisLimit} />\n <PointCloudValidity />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(aMapStateToProps)(PointCloudTopView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAS5B,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,CAAA,EAAG,KAAK,KAAQ,GAAA,CAAA;AAAA,IAChB,CAAA,EAAG,KAAK,MAAS,GAAA,CAAA;AAAA,GAAA,CAAA;AAGnB,EAAO,OAAA;AAAA,IACL,OAAU,EAAA,CAAA,gBAAA,CAAiB,CAAI,GAAA,iBAAA,CAAkB,CAAK,IAAA,IAAA;AAAA,IACtD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