@labelbee/lb-components 1.10.0-alpha.2 → 1.10.0-alpha.20
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/App.js +1 -1
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/colorPalette/index.js +1 -0
- package/dist/components/colorTag/index.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useSphere.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/dist/components/predictTracking/previewResult/index.js +1 -1
- package/dist/components/predictTracking/previewResult/util.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/types/App.d.ts +1 -0
- package/dist/types/components/AnnotationView/pointCloudAnnotationView.d.ts +2 -1
- package/dist/types/components/annotationStepPopover/index.d.ts +2 -1
- package/dist/types/components/attributeList/index.d.ts +2 -0
- package/dist/types/components/checkboxList/index.d.ts +2 -1
- package/dist/types/components/colorPalette/index.d.ts +12 -0
- package/dist/types/components/colorTag/index.d.ts +2 -1
- package/dist/types/components/customAntd/IconWithText/index.d.ts +1 -1
- package/dist/types/components/customResizeHook/index.d.ts +2 -2
- package/dist/types/components/fileException/FileError.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
- package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +2 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudInfos.d.ts +4 -3
- package/dist/types/components/pointCloudView/components/EmptyPage/index.d.ts +7 -1
- package/dist/types/components/pointCloudView/components/UnifyParamsModal/index.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/useHistory.d.ts +6 -4
- package/dist/types/components/pointCloudView/hooks/useSphere.d.ts +1 -0
- package/dist/types/components/predictTracking/predictTrackingIcon/index.d.ts +2 -1
- package/dist/types/components/predictTracking/previewResult/index.d.ts +2 -1
- package/dist/types/components/predictTracking/previewResult/util.d.ts +2 -1
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.d.ts +2 -1
- package/dist/types/components/videoPlayer/components/controller/index.d.ts +2 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/store/annotation/actionCreators.d.ts +1 -1
- package/dist/types/utils/colorUtils.d.ts +20 -0
- package/dist/types/views/MainView/annotationTips/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/ClearIcon/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/ImgAttributeInfo/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/index.d.ts +3 -1
- package/dist/types/views/MainView/sidebar/TagSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/TextAreaFormat/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +2 -2
- package/dist/types/views/MainView/sidebar/ToolIcons.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/ToolStyle/index.d.ts +2 -1
- package/dist/types/views/MainView/sidebar/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/AnnotatedAttributes/index.d.ts +5 -4
- package/dist/types/views/MainView/toolFooter/FooterPopover.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/HiddenTips/index.d.ts +2 -1
- package/dist/types/views/MainView/toolFooter/PageNumber/index.d.ts +2 -1
- package/dist/types/views/MainView/toolFooter/Pagination.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/utils/colorUtils.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/es/App.js +1 -1
- package/es/components/attributeList/index.js +1 -1
- package/es/components/colorPalette/index.js +1 -0
- package/es/components/colorTag/index.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/useSphere.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/es/components/predictTracking/previewResult/index.js +1 -1
- package/es/components/predictTracking/previewResult/util.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/utils/colorUtils.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/package.json +10 -8
- package/LICENSE +0 -203
- package/dist/components/pointCloudView/hooks/useLine.js +0 -1
- package/dist/types/components/pointCloudView/hooks/useLine.d.ts +0 -12
- package/es/components/pointCloudView/hooks/useLine.js +0 -1
package/dist/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:
|
|
1
|
+
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),ctx=require("./store/ctx.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js"),es=require("antd/es"),zhCN=require("antd/es/locale/zh_CN"),enUS=require("antd/es/locale/en_US");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),zhCN__default=_interopDefaultLegacy(zhCN),enUS__default=_interopDefaultLegacy(enUS),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const App=e=>{const[t,a]=React.useState(0),{imgList:o,step:P=1,stepList:i,onSubmit:s,onSave:l,onPageChange:c,onStepChange:u,initialIndex:d=0,toolInstance:_,setToolInstance:h,getFileData:p,pageSize:f=10,loadFileList:r,defaultLang:g="cn",skipBeforePageTurning:I,beforeRotate:v,checkMode:m=!1,intelligentFit:O=!0}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:s,stepList:i,step:P,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,skipBeforePageTurning:I,beforeRotate:v,checkMode:m})),S(),lbUtils.i18n.changeLanguage(g);const n=()=>{a(L=>L+1)};return lbUtils.i18n.on("languageChanged",n),()=>{lbUtils.i18n.off("languageChanged",n),actionCreators.InitAnnotationState(index.store.dispatch)}},[]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateInjectFunc({onSubmit:s,stepList:i,getFileData:p,pageSize:f,loadFileList:r,onSave:l,onPageChange:c,onStepChange:u,beforeRotate:v})),lbUtils.i18n.changeLanguage(g)},[s,i,p,f,r,l,c,u,g,v]),React.useEffect(()=>{h==null||h(_)},[_]);const S=()=>{r?actionCreators.loadImgList(index.store.dispatch,index.store.getState,d,!0).then(n=>{n&&index.store.dispatch(reducer.LoadFileAndFileData(d))}):o&&o.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:o}}),index.store.dispatch(reducer.LoadFileAndFileData(d)))};return React__default.default.createElement("div",null,React__default.default.createElement(es.ConfigProvider,{locale:lbUtils.i18n.language==="en"?enUS__default.default:zhCN__default.default},React__default.default.createElement(index$1,__spreadProps(__spreadValues({},e),{intelligentFit:O}))))},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var App$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(App);module.exports=App$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Style=require("../../data/Style.js"),index=require("../colorTag/index.js"),es=require("antd/es"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ATTRIBUTE_COLORS=[Style.NULL_COLOR].concat(Style.COLORS_ARRAY),AttributeList=React__default.default.forwardRef((e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Style=require("../../data/Style.js"),index$1=require("../colorTag/index.js"),es=require("antd/es"),React=require("react"),antd=require("antd"),index=require("../colorPalette/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ATTRIBUTE_COLORS=[Style.NULL_COLOR].concat(Style.COLORS_ARRAY),AttributeList=React__default.default.forwardRef((e,f)=>{const c=React__default.default.useRef(),{t:s}=reactI18next.useTranslation(),v=e.list||[],[C,u]=React.useState(!1),[b,m]=React.useState(void 0);let n=[...ATTRIBUTE_COLORS];e.forbidDefault===!0&&(n=n.slice(1));let o="sensebee-radio-group";e.noHeightLimit&&(o="sensebee-radio-group-no-limit-height");const R=(t,l)=>{e.updateColorConfig&&e.updateColorConfig(t,l)};return React__default.default.createElement("div",{className:o,style:e.style},React__default.default.createElement(es.Radio.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,onChange:t=>e.attributeChanged(t.target.value),ref:f},v.map((t,l)=>{var d;let a=(d=e==null?void 0:e.num)!=null?d:l;e.forbidDefault===!0&&typeof a=="number"&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-");let i=l>8&&!e.forbidDefault?Style.COLORS_ARRAY[(l-1)%Style.COLORS_ARRAY.length]:n[l%n.length];return(t==null?void 0:t.color)&&(i=t.color),React__default.default.createElement(es.Radio,{value:t.value,ref:c,key:t.label+l},React__default.default.createElement("span",{className:"sensebee-radio-label",title:t.label},!(e==null?void 0:e.forbidColor)&&React__default.default.createElement(antd.Popover,{content:React__default.default.createElement(index,{defaultColor:i,setColor:r=>R(t.value,r)}),title:React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,s("Palette")),React__default.default.createElement(icons.CloseOutlined,{onClick:()=>u(!1)})),visible:C&&b===l,onVisibleChange:r=>{!r||u(r)}},React__default.default.createElement(index$1.ColorTag,{color:i,style:{cursor:"pointer",marginRight:"8px"},onClick:()=>{(e==null?void 0:e.enableColorPicker)&&(m(l),u(!0))}})),t.label),React__default.default.createElement("span",{className:"sensebee-radio-num"},a))})))});exports.ATTRIBUTE_COLORS=ATTRIBUTE_COLORS,exports.default=AttributeList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactColorful=require("react-colorful"),colorUtils=require("../../utils/colorUtils.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const Palette=t=>{const{setColor:r,defaultColor:e}=t;return React__default.default.createElement(reactColorful.RgbaColorPicker,{color:colorUtils.toRGBAObj(e),onChange:o=>{const l=colorUtils.toRGBAStr(o);r(l)}})};module.exports=Palette;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const ColorTag=({color:e,style:r})=>React__default.default.createElement("div",{style:__spreadValues({display:"inline-block",height:14,width:14,backgroundColor:e,verticalAlign:"middle"},r)});exports.ColorTag=ColorTag;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const ColorTag=({color:e,style:r,onClick:t})=>React__default.default.createElement("div",{style:__spreadValues({display:"inline-block",height:14,width:14,backgroundColor:e,verticalAlign:"middle"},r),onClick:t});exports.ColorTag=ColorTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(d){return d&&typeof d=="object"&&"default"in d?d:{default:d}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{}}),PointCloudProvider=({children:d})=>{const[l,h]=React.useState([]),[c,m]=React.useState([]),[C,T]=React.useState([]),[S,j]=React.useState([]),[u,L]=React.useState([]),[w,_]=React.useState(!0),[I,k]=React.useState(1),[o,q]=React.useState(),[V,z]=React.useState(),[g,F]=React.useState(),[n,Z]=React.useState(),[x,G]=React.useState(""),[v,J]=React.useState(lbAnnotation.EToolName.Rect),K=React.useRef(new lbAnnotation.ActionsHistory).current,[i,b]=React.useState([]),[B,Q]=React.useState(""),R=React.useMemo(()=>u.length===1?u[0]:"",[u]),D=React.useMemo(()=>{const r=l.find(t=>t.id===R),y=t=>{const e=l.concat(t);return h(e),e},A=t=>{const e=c.concat(t);return m(e),e},f=t=>{_(t!==!1)},s=t=>{t===void 0&&L([]),typeof t=="string"&&L([t]),Array.isArray(t)&&L(Array.from(new Set(t)))},W=t=>{u.includes(t)?s(u.filter(e=>e!==t)):s([...u,t])},X=()=>{if(v===lbAnnotation.EToolName.Rect){const t=l.map(e=>e.id);s(t),o==null||o.pointCloud2dOperation.setSelectedIDs(t)}},Y=t=>{s(l.filter(e=>e.attribute===t).map(e=>e.id))},E=l.filter(t=>!i.includes(t.attribute)),H=c.filter(t=>!i.includes(t.attribute)),O=S.filter(t=>t.attribute&&!i.includes(t.attribute)),$=t=>{if(i.includes(t))b(i.filter(e=>e!==t));else{const e=i.concat(t);b(e)}},tt=(t=E,e=C,P=H,p=O)=>{l.forEach(a=>{n==null||n.removeObjectByName(a.id)}),c.forEach(a=>{n==null||n.removeObjectByName(a.id)}),o==null||o.updatePolygonList(t,e),o==null||o.updatePointList(P),o==null||o.updateLineList(p),n==null||n.generateBoxes(t),n==null||n.generateSpheres(P),M(t)},M=t=>{const e=n==null?void 0:n.highlightOriginPointCloud(t);return new Promise(P=>{e==null||e.then(p=>{[o].forEach(a=>{var N;p&&((N=a==null?void 0:a.pointCloudInstance)==null||N.updateColor(p),P({color:p}))})})})};return{selectedID:R,pointCloudBoxList:l,pointCloudSphereList:c,displayPointCloudList:E,displaySphereList:H,displayLineList:O,selectedIDs:u,setPointCloudResult:h,setSelectedIDs:s,addPointCloudBox:y,addPointCloudSphere:A,setPointCloudSphereList:m,valid:w,selectedPointCloudBox:r,setPointCloudValid:f,addSelectedID:W,selectedAllBoxes:X,topViewInstance:o,setTopViewInstance:q,sideViewInstance:V,setSideViewInstance:z,backViewInstance:g,setBackViewInstance:F,mainViewInstance:n,setMainViewInstance:Z,polygonList:C,setPolygonList:T,lineList:S,setLineList:j,zoom:I,setZoom:k,history:K,toggleAttributesVisible:$,hideAttributes:i,setHideAttributes:b,reRender:tt,attrPanelLayout:B,setAttrPanelLayout:Q,syncAllViewPointCloudColor:M,defaultAttribute:x,setDefaultAttribute:G,pointCloudPattern:v,setPointCloudPattern:J,selectSpecAttr:Y}},[w,u,l,c,C,S,o,V,g,n,I,i,B,x,v]),U=()=>{const r=l.filter(s=>i.includes(s.attribute)),{setSelectedIDs:y,reRender:A}=D,f=r.map(s=>s.id);f.length>0&&y(u.filter(s=>!f.includes(s))),A()};return React.useEffect(()=>{var r;U(),(r=o==null?void 0:o.pointCloud2dOperation)==null||r.setHiddenAttributes(i)},[i]),React__default.default.createElement(PointCloudContext.Provider,{value:D},d)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),index$1=require("../../views/MainView/toolFooter/index.js"),index$2=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),index$1=require("../../views/MainView/toolFooter/index.js"),index$2=require("../../views/MainView/toolFooter/ZoomController/index.js"),icons=require("@ant-design/icons"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudInfos=require("./PointCloudInfos.js"),usePolygon=require("./hooks/usePolygon.js"),useSphere=require("./hooks/useSphere.js"),useZoom=require("./hooks/useZoom.js"),antd=require("antd"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),ToolUtils=require("../../utils/ToolUtils.js"),_=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,n,i)=>n in t?__defProp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,__spreadValues=(t,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(t,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(t,i,n[i]);return t},__spreadProps=(t,n)=>__defProps(t,__getOwnPropDescs(n));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,TransferCanvas2WorldOffset=(t,n,i=1)=>{const{width:v,height:C}=n,m={x:t.x+v*i/2,y:t.y+C*i/2},g={x:n.width/2,y:n.height/2};return{offsetX:(g.x-m.x)/i,offsetY:-(g.y-m.y)/i}},TopViewToolbar=({currentData:t})=>{var n,i;const{zoom:v,zoomIn:C,zoomOut:m,initialPosition:g}=useZoom.useZoom(),{selectNextBox:x,selectPrevBox:I}=useSingleBox.useSingleBox(),{switchToNextSphere:w}=useSphere.useSphere(),{updateRotate:d}=useRotate.useRotate({currentData:t}),e=React__default.default.useContext(PointCloudContext.PointCloudContext),a=(i=(n=e==null?void 0:e.topViewInstance)==null?void 0:n.toolScheduler)==null?void 0:i.getCurrentToolName(),p=2,h=()=>{d(-p)},y=()=>{d(p)},V=()=>{d(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:y,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:h,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:V,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{a===EToolName.PointCloudPolygon&&I(),a===EToolName.Point&&w(ESortDirection.descend)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{a===EToolName.PointCloudPolygon&&x(),a===EToolName.Point&&w(ESortDirection.ascend)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(index$2.ZoomController,{initialPosition:g,zoomIn:C,zoomOut:m,zoom:v}))},ZAxisSlider=({setZAxisLimit:t,zAxisLimit:n,checkMode:i})=>i?null:React__default.default.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},React__default.default.createElement(antd.Slider,{vertical:!0,step:.5,max:10,min:.5,defaultValue:n,onAfterChange:v=>{t(v)}})),PointCloudTopView=({currentData:t,imgList:n,stepInfo:i,drawLayerSlot:v,checkMode:C,intelligentFit:m})=>{var g,x;const[I,w]=React.useState({zoom:1,currentPos:{x:0,y:0}}),d=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),a=useSize(d),p=index.jsonParser(i.config),{setZoom:h,syncTopviewToolZoom:y}=useZoom.useZoom(),{hideAttributes:V}=e,{addPolygon:j,deletePolygon:T}=usePolygon.usePolygon(),{deletePointCloudSphere:N}=useSphere.useSphere(),{deletePointCloudBox:A,changeValidByID:B}=useSingleBox.useSingleBox(),[S,D]=React.useState(10),{t:k}=reactI18next.useTranslation(),P=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(!e.topViewInstance&&d.current&&(t==null?void 0:t.url)&&(t==null?void 0:t.result)){const l={width:d.current.clientWidth,height:d.current.clientHeight},c=new lbAnnotation.PointCloudAnnotation({container:d.current,size:l,pcdPath:t.url,config:__spreadProps(__spreadValues({},p),{pointCloudPattern:e.pointCloudPattern}),checkMode:C,toolName:ToolUtils.getPointCloudToolList(),proxyMode:C});e.setTopViewInstance(c)}},[t]),React.useEffect(()=>{if(!a||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:l}=e.topViewInstance;l.singleOn("dataUpdated",(o,s)=>{const u=___default.default.cloneDeep(o).map(r=>__spreadProps(__spreadValues({},r),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(r.pointList,a)}));e.setSelectedIDs(s),e.setLineList(u)}),l.singleOn("pointCreated",(o,s)=>{P.topViewAddSphere({newPoint:o,size:a,trackConfigurable:p.trackConfigurable,zoom:s})}),l.singleOn("pointDeleted",o=>{N(o)}),l.singleOn("pointSelected",o=>{e.setSelectedIDs([o])}),l.singleOn("updatePointByDrag",(o,s)=>{var u;(u=P.topViewUpdatePoint)==null||u.call(P,o,a)}),l.singleOn("polygonCreated",(o,s)=>{if(l.pattern===EPolygonPattern.Normal||!(t==null?void 0:t.url)){const u=__spreadProps(__spreadValues({},o),{pointList:o.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,a))});j(u),e.setSelectedIDs(V.includes(o.attribute)?"":o.id);return}P.topViewAddBox({polygon:o,size:a,imgList:n,trackConfigurable:p.trackConfigurable,zoom:s,intelligentFit:m})}),l.singleOn("deletedObject",({id:o})=>{A(o),T(o)}),l.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),l.singleOn("addSelectedIDs",o=>{e.addSelectedID(o)}),l.singleOn("setSelectedIDs",o=>{e.setSelectedIDs(o)}),l.singleOn("updatePolygonByDrag",o=>{var s;(s=P.topViewUpdateBox)==null||s.call(P,o,a)});const c=o=>{var s;const u=B(o);u&&e.syncAllViewPointCloudColor(u),e.polygonList.find(r=>r.id===o)&&((s=e.topViewInstance)==null||s.toolInstance.setPolygonValidAndRender(o,!0))};return l.on("validUpdate",c),()=>{l.unbind("validUpdate",c)}},[e,a,t,P,e.polygonList,e.lineList,(g=e.topViewInstance)==null?void 0:g.toolInstance]),React.useEffect(()=>{var l,c;if(!(a==null?void 0:a.width)||!e.topViewInstance)return;const o=(c=(l=p==null?void 0:p.attributeList)==null?void 0:l[0])==null?void 0:c.value;o&&e.topViewInstance.toolInstance.setDefaultAttribute(o),e.topViewInstance.initSize(a),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:s,toolInstance:u}}=e;u.singleOn("renderZoom",(r,f)=>{const{offsetX:b,offsetY:O}=TransferCanvas2WorldOffset(f,a,r);if(s.camera.zoom=r,f){const{x:L,y:E,z:q}=s.initCameraPosition;s.camera.position.set(L+O,E-b,q)}s.camera.updateProjectionMatrix(),s.render(),h(r),y(f,r,a),w({zoom:r,currentPos:f})}),u.singleOn("dragMove",({currentPos:r,zoom:f})=>{const{offsetX:b,offsetY:O}=TransferCanvas2WorldOffset(r,a,f);s.camera.zoom=f;const{x:L,y:E,z:q}=s.initCameraPosition;s.camera.position.set(L+O,E-b,q),s.render(),y(r,f,a),w({zoom:f,currentPos:r})})},[a,e.topViewInstance,(x=e.topViewInstance)==null?void 0:x.toolInstance]),React.useEffect(()=>{var l,c;(c=(l=e.topViewInstance)==null?void 0:l.pointCloudInstance)==null||c.applyZAxisPoints(S)},[S]),React.useEffect(()=>{P.topViewSelectedChanged({})},[e.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:k("TopView"),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:t})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:d},v==null?void 0:v(I)),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:C,config:p}),React__default.default.createElement(ZAxisSlider,{checkMode:C,zAxisLimit:S,setZAxisLimit:D}),React__default.default.createElement(PointCloudInfos.PointCloudValidity,null)))};var PointCloudTopView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudTopView);module.exports=PointCloudTopView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,s,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,s,l)=>s in e?__defProp(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l,__spreadValues=(e,s)=>{for(var l in s||(s={}))__hasOwnProp.call(s,l)&&__defNormalProp(e,l,s[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(s))__propIsEnum.call(s,l)&&__defNormalProp(e,l,s[l]);return e};const useHistory=()=>{const{history:e,setPointCloudResult:s,setSelectedIDs:l,pointCloudBoxList:p,pointCloudSphereList:L,setPointCloudSphereList:x,mainViewInstance:u,topViewInstance:y,polygonList:f,setPolygonList:P,lineList:C,setLineList:g,syncAllViewPointCloudColor:_}=React.useContext(PointCloudContext.PointCloudContext),S=({newBoxParams:t,newPolygon:o,newLine:i,newSphereParams:r})=>{const d={pointCloudBoxList:p,polygonList:f,lineList:C,pointCloudSphereList:L};t&&(d.pointCloudBoxList=p.concat(t)),o&&(d.polygonList=f.concat(o)),i&&(d.lineList=C.concat(i)),r&&(d.pointCloudSphereList=L.concat(r)),e.pushHistory(d)},B=t=>{const o={pointCloudBoxList:p,polygonList:f,lineList:C,pointCloudSphereList:L};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),t.lineList&&(o.lineList=t.lineList),t.pointCloudSphereList&&(o.pointCloudSphereList=t.pointCloudSphereList),e.pushHistory(o)},H=t=>{if(C.find(i=>i.id===t.id)){const i=C.map(r=>r.id===t.id?t:__spreadValues({},r));e.pushHistory({lineList:i}),g(i)}},O=t=>{if(f.find(i=>i.id===t.id)){const i=f.map(r=>r.id===t.id?t:__spreadValues({},r));e.pushHistory({pointCloudBoxList:p,polygonList:i}),P(i)}},w=({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i})=>{e.initRecord({pointCloudBoxList:t,polygonList:o,pointCloudSphereList:i},!0)},v=t=>{if(!t)return;const{pointCloudBoxList:o=[],polygonList:i=[],lineList:r=[],pointCloudSphereList:d=[]}=t;if(o){p.length!==o.length&&l();const h=p.filter(n=>o.every(c=>c.id!==n.id)),a=o.filter(n=>p.every(c=>c.id!==n.id));h.forEach(n=>{u==null||u.removeObjectByName(n.id)}),a.forEach(n=>{u==null||u.generateBox(n)}),s(o),_(o)}if(d){L.length!==d.length&&l();let h=L.filter(n=>d.every(c=>c.id!==n.id)),a=d.filter(n=>L.every(c=>c.id!==n.id));h.forEach(n=>{u==null||u.removeObjectByName(n.id)}),a.forEach(n=>{u==null||u.generateSphere(n)}),x(d)}i&&P(i),r&&g(r),y==null||y.updatePolygonList(o!=null?o:[],i!=null?i:[]),y==null||y.updateLineList(r!=null?r:[]),y==null||y.updatePointList(d)};return{addHistory:S,pushHistoryWithList:B,initHistory:w,pushHistoryUnderUpdatePolygon:O,pushHistoryUnderUpdateLine:H,redo:()=>{v(e.redo())},undo:()=>{v(e.undo())}}};exports.useHistory=useHistory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,o,i)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,__spreadValues=(t,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(t,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(t,i,o[i]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o)),__async=(t,o,i)=>new Promise((r,e)=>{var c=l=>{try{s(i.next(l))}catch(h){e(h)}},p=l=>{try{s(i.throw(l))}catch(h){e(h)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(c,p);s((i=i.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(t,o,i,r,e)=>{const{x:c,y:p}=lbUtils.PointCloudUtils.transferCanvas2World(t,o),{defaultZ:s}=lbUtils.DEFAULT_SPHERE_PARAMS,l={center:{x:c,y:p,z:s},id:t.id},h=r?__spreadValues(__spreadValues({},r),l):__spreadProps(__spreadValues({},l),{attribute:"",valid:!0});return e&&Object.assign(h,e),h},topViewPolygon2PointCloud=(t,o,i,r,e,c)=>{let p=t.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,o)),s=0,l=1,h={};if(i){const y=i.getSensesPointZAxisInPolygon(p,void 0,c);c&&y.fittedCoordinates.length>0&&(p=y.fittedCoordinates),s=(y.maxZ+y.minZ)/2,l=y.maxZ-y.minZ,h={count:y.zCount}}const[g,x,j]=p,b=lbAnnotation.MathUtils.getLineCenterPoint([g,j]),_=lbAnnotation.MathUtils.getLineLength(g,x),O=lbAnnotation.MathUtils.getLineLength(x,j),k=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);r&&(s=r.center.z,l=r.depth);const V={center:{x:b.x,y:b.y,z:s},width:O,height:_,depth:l,rotation:k,id:t.id},I=__spreadValues(r?__spreadValues(__spreadValues({},r),V):__spreadProps(__spreadValues({},V),{attribute:"",valid:!0}),h);e&&Object.assign(I,e);const D=p.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,o));return{boxParams:I,newPointList:D}},sideViewPoint2PointCloud=(t,o,i)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-r.x,y:i.center.y,z:i.center.z-r.y}})},sideViewPolygon2PointCloud=(t,o,i,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),b={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(s,l),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),I=lbAnnotation.MathUtils.getLineLength(l,h),D=V-I,{newBoxParams:y}=r.getNewBoxBySideUpdate(b,D,k,i);return y},backViewPoint2PointCloud=(t,o,i)=>{const r={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-r.x,z:i.center.z-r.y}})},backViewPolygon2PointCloud=(t,o,i,r)=>{const[e,c,p]=t.pointList,[s,l,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([s,h]),b={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(s,l),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),I=lbAnnotation.MathUtils.getLineLength(l,h),D=V-I;let{newBoxParams:y}=r.getNewBoxByBackUpdate(b,D,k,i);return y},syncSideViewByPoint=(t,o,i,r,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:s}=i;s.loadPCDFile(r,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:l}=s.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Left);s.setInitCameraPosition(l);const{point2d:h,zoom:g}=s.getSphereSidePoint2DCoordinate(t);s.camera.zoom=g,s.camera.updateProjectionMatrix(),s.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeSideView=(t,o,i,r)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(r,t,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(p);const{polygon2d:s,zoom:l}=c.getBoxSidePolygon2DCoordinate(t);c.camera.zoom=l,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:s,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncBackViewByPoint=(t,o,i,r,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:s}=i;s.loadPCDFile(r,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:l}=s.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Back);s.setInitCameraPosition(l);const{point2d:h,zoom:g}=s.getSphereBackPoint2DCoordinate(t);s.camera.zoom=g,s.camera.updateProjectionMatrix(),s.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeBackView=(t,o,i,r)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(r,t,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(p);const{polygon2d:s,zoom:l}=c.getBoxBackPolygon2DCoordinate(t);c.camera.zoom=l,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:s,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncTopViewByPoint=(t,o,i,r)=>{if(!i||!r)return;r.generateSphere(t),r.updateCameraBySphere(t,lbUtils.EPerspectiveView.Top),r.render();const{toolInstance:e,pointCloudInstance:c}=i,{point2d:p}=c.getSphereTopPoint2DCoordinate(t),s=[...e.pointList].map(l=>l.id===o.id?__spreadProps(__spreadValues(__spreadValues({},o),p),{valid:t.valid,textAttribute:"",attribute:t.attribute}):l);e.setResult(s),e.setSelectedID(o.id)},synchronizeTopView=(t,o,i,r)=>{var e;if(!i||!r)return;r.generateBox(t,o.id),r.render();const{pointCloud2dOperation:c,pointCloudInstance:p}=i,{polygon2d:s}=p.getBoxTopPolygon2DCoordinate(t),l=[...c.polygonList],h=l.find(g=>g.id===o.id);h?h.pointList=s:l.push({id:o.id,pointList:s,textAttribute:"",isRect:!0,valid:(e=t.valid)!=null?e:!0}),c.setResultAndSelectedID(l,o.id)},usePointCloudViews=()=>{const t=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:r,mainViewInstance:e,addPointCloudBox:c,addPointCloudSphere:p,setSelectedIDs:s,selectedIDs:l,pointCloudBoxList:h,pointCloudSphereList:g,hideAttributes:x}=t,{addHistory:j,initHistory:b,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdatePoint:O,pushHistoryUnderUpdateLine:k}=useHistory.useHistory(),{selectedPolygon:V}=usePolygon.usePolygon(),{updateSelectedBox:I,updateSelectedBoxes:D,getPointCloudByID:y}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:G,updatePointCloudSphere:H,selectedSphere:z}=useSphere.useSphere(),{currentData:w,config:L}=ctx.useSelector(n=>{const{stepList:a,step:P,imgList:u,imgIndex:d}=n.annotation;return{currentData:u[d],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,a).config)}}),F=ctx.useDispatch(),{selectedBox:T}=useSingleBox.useSingleBox(),{t:X}=reactI18next.useTranslation(),N=T==null?void 0:T.info;if(!o||!i||!r)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:E}=o,Y=n=>{e==null||e.generateBox(n),e==null||e.controls.update(),e==null||e.render()},Q=n=>{e==null||e.generateSphere(n),e==null||e.controls.update(),e==null||e.render()},J=({newPoint:n,size:a,zoom:P,trackConfigurable:u})=>{var d;const C={attribute:(d=o.toolInstance.defaultAttribute)!=null?d:""};u===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:g})});const f=topViewPoint2PointCloud(n,a,E,void 0,C);s(n.id);const v=p(f);M(PointCloudView.Top,n,f,P,v,L)},K=({polygon:n,size:a,imgList:P,trackConfigurable:u,zoom:d,intelligentFit:C})=>{var f;const v={attribute:(f=o.toolInstance.defaultAttribute)!=null?f:""};u===!0&&Object.assign(v,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:g})});const m=o==null?void 0:o.toolInstance,S=__spreadValues({},n),{boxParams:B,newPointList:A}=topViewPolygon2PointCloud(S,a,E,void 0,v,C);if((L==null?void 0:L.lowerLimitPointsNumInBox)&&typeof B.count=="number"&&B.count<L.lowerLimitPointsNumInBox){antd.message.info(X("LowerLimitPointsNumInBox",{num:L.lowerLimitPointsNumInBox})),m.deletePolygon(B.id);return}C&&(A==null?void 0:A.length)&&(S.pointList=A);const q=x.includes(S.attribute),U=c(B);q?s([]):(s(B.id),m.setSelectedIDs([S.id]),R(PointCloudView.Top,S,B,d,U),C&&synchronizeTopView(B,S,o,e)),j({newBoxParams:B})},$=({newSelectedBox:n,newPointCloudList:a,newSelectedSphere:P,newSphereList:u})=>{const d=o==null?void 0:o.toolInstance;if(!(l.length===0||!d)){if(n||(T==null?void 0:T.info)){const C=n!=null?n:T==null?void 0:T.info;d.setSelectedIDs(l);const f=d.selectedPolygon;if(l.length===1&&C){R(PointCloudView.Top,f,C,void 0,a);return}}if((P||z)&&l.length===1){const C=P!=null?P:z;d.setSelectedID(l[0]);const f=d.selectedPoint;C&&M(PointCloudView.Top,f,C,void 0,u,L)}}},W=(n,a,P)=>{if(N){let u,d;switch(P){case PointCloudView.Back:u=backViewPolygon2PointCloud;break;case PointCloudView.Side:u=sideViewPolygon2PointCloud;break;default:u=sideViewPolygon2PointCloud;break}if(d=u(n,a,N,i.pointCloudInstance),e){const{count:f}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(d).polygonPointList,[d.center.z-d.depth/2,d.center.z+d.depth/2]);d=__spreadProps(__spreadValues({},d),{count:f})}const C=I(d);return R(P,n,d,void 0,C),C}},Z=(n,a,P)=>{if(z){let u,d;switch(P){case PointCloudView.Back:u=backViewPoint2PointCloud;break;case PointCloudView.Side:u=sideViewPoint2PointCloud;break;default:u=sideViewPoint2PointCloud;break}d=u(n,a,z);const C=H(d);return M(P,n,d,void 0,C,L),C}},tt=(n,a)=>{Z(n,a,PointCloudView.Side)},et=(n,a)=>{Z(n,a,PointCloudView.Back)},ot=(n,a)=>{W(n,a,PointCloudView.Side)},it=(n,a)=>{W(n,a,PointCloudView.Back)},nt=(n,a)=>{k(n)},st=(n,a)=>{const{x:P,y:u}=lbUtils.PointCloudUtils.transferCanvas2World(n,a);O(__spreadProps(__spreadValues({},n),{x:P,y:u}));const d=G(n.id),C=topViewPoint2PointCloud(n,a,E,d),f=H(C);M(PointCloudView.Top,n,C,void 0,f,L)},rt=(n,a)=>{if(V){const u=n[0].newPolygon;u.pointList=u.pointList.map(d=>lbUtils.PointCloudUtils.transferCanvas2World(d,a)),_(n[0].newPolygon);return}const P=n.map(({newPolygon:u})=>{const d=y(u.id),{boxParams:C}=topViewPolygon2PointCloud(u,a,o.pointCloudInstance,d);return C});if(P.length===1){const{newPolygon:u}=n[0],d=D(P);R(PointCloudView.Top,u,P[0],void 0,d)}else{const u=D(P);u&&t.syncAllViewPointCloudColor(u)}},M=(n,a,P,u,d,C)=>__async(void 0,null,function*(){const f=w==null?void 0:w.url,v={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,a,i,f,C)},[PointCloudView.Back]:()=>{r&&syncBackViewByPoint(P,a,r,f,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,a,o,e)}};Object.keys(v).forEach(m=>{m!==n&&v[m]()}),u&&(e==null||e.updateCameraZoom(u)),Q(P)}),R=(n,a,P,u,d)=>__async(void 0,null,function*(){const C=w==null?void 0:w.url;d&&(yield t.syncAllViewPointCloudColor(d));const f={[PointCloudView.Side]:()=>{synchronizeSideView(P,a,i,C)},[PointCloudView.Back]:()=>{r&&synchronizeBackView(P,a,r,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,a,o,e)}};Object.keys(f).forEach(v=>{v!==n&&f[v]()}),u&&(e==null||e.updateCameraZoom(u)),Y(P)});return{topViewAddSphere:J,topViewAddBox:K,topViewSelectedChanged:$,topViewUpdatePoint:st,sideViewUpdatePoint:tt,backViewUpdatePoint:et,topViewUpdateBox:rt,topViewUpdateLine:nt,sideViewUpdateBox:ot,backViewUpdateBox:it,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),e==null||e.generateBoxes(n)},initPointCloud3d:n=>{if(!e)return;const a={left:-n.width/2,right:n.width/2,top:n.height/2,bottom:-n.height/2,near:100,far:-100};e.initOrthographicCamera(a),e.initRenderer(),e.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(a=w){var P,u,d,C,f,v;if(!(a==null?void 0:a.url)||!e)return;actionCreators.SetPointCloudLoading(F,!0),yield e.loadPCDFile(a.url,(P=L==null?void 0:L.radius)!=null?P:DEFAULT_RADIUS),h.forEach(U=>{e==null||e.removeObjectByName(U.id)}),g.forEach(U=>{e==null||e.removeObjectByName(U.id)});let m=[],S=[],B=[],A=[];w.result?(m=lbUtils.PointCloudUtils.getBoxParamsFromResultList(w.result),B=lbUtils.PointCloudUtils.getPolygonListFromResultList(w.result),S=lbUtils.PointCloudUtils.getLineListFromResultList(w.result),A=lbUtils.PointCloudUtils.getSphereParamsFromResultList(w.result),m.forEach(U=>{e==null||e.generateBox(U)}),A.forEach(U=>{e==null||e.generateSphere(U)}),t.syncAllViewPointCloudColor(m),t.setPointCloudResult(m),t.setPolygonList(B),t.setLineList(S),t.setPointCloudSphereList(A)):(t.setPointCloudResult([]),t.setPolygonList([]),t.setPointCloudSphereList([]),t.setLineList([])),b({pointCloudBoxList:m,polygonList:B}),e.updateTopCamera();const q=(d=(u=index.jsonParser(a.result))==null?void 0:u.valid)!=null?d:!0;t.setPointCloudValid(q),(C=t.sideViewInstance)==null||C.clearAllData(),(f=t.backViewInstance)==null||f.clearAllData(),o.updateData(a.url,a.result,{radius:(v=L==null?void 0:L.radius)!=null?v:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(F,!1)})}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,o,i)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,__spreadValues=(t,o)=>{for(var i in o||(o={}))__hasOwnProp.call(o,i)&&__defNormalProp(t,i,o[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(o))__propIsEnum.call(o,i)&&__defNormalProp(t,i,o[i]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o)),__async=(t,o,i)=>new Promise((l,e)=>{var c=d=>{try{r(i.next(d))}catch(h){e(h)}},p=d=>{try{r(i.throw(d))}catch(h){e(h)}},r=d=>d.done?l(d.value):Promise.resolve(d.value).then(c,p);r((i=i.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(t,o,i,l,e)=>{const{x:c,y:p}=lbUtils.PointCloudUtils.transferCanvas2World(t,o),{defaultZ:r}=lbUtils.DEFAULT_SPHERE_PARAMS,d={center:{x:c,y:p,z:r},id:t.id},h=l?__spreadValues(__spreadValues({},l),d):__spreadProps(__spreadValues({},d),{attribute:"",valid:!0});return e&&Object.assign(h,e),h},topViewPolygon2PointCloud=(t,o,i,l,e,c)=>{let p=t.pointList.map(y=>lbUtils.PointCloudUtils.transferCanvas2World(y,o)),r=0,d=1,h={};if(i){const y=i.getSensesPointZAxisInPolygon(p,void 0,c);c&&y.fittedCoordinates.length>0&&(p=y.fittedCoordinates),r=(y.maxZ+y.minZ)/2,d=y.maxZ-y.minZ,h={count:y.zCount}}const[g,x,D]=p,U=lbAnnotation.MathUtils.getLineCenterPoint([g,D]),_=lbAnnotation.MathUtils.getLineLength(g,x),O=lbAnnotation.MathUtils.getLineLength(x,D),k=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);l&&(r=l.center.z,d=l.depth);const V={center:{x:U.x,y:U.y,z:r},width:O,height:_,depth:d,rotation:k,id:t.id},S=__spreadValues(l?__spreadValues(__spreadValues({},l),V):__spreadProps(__spreadValues({},V),{attribute:"",valid:!0}),h);e&&Object.assign(S,e);const A=p.map(y=>lbUtils.PointCloudUtils.transferWorld2Canvas(y,o));return{boxParams:S,newPointList:A}},sideViewPoint2PointCloud=(t,o,i)=>{const l={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-l.x,y:i.center.y,z:i.center.z-l.y}})},sideViewPolygon2PointCloud=(t,o,i,l)=>{const[e,c,p]=t.pointList,[r,d,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([r,h]),U={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(r,d),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),S=lbAnnotation.MathUtils.getLineLength(d,h),A=V-S,{newBoxParams:y}=l.getNewBoxBySideUpdate(U,A,k,i);return y},backViewPoint2PointCloud=(t,o,i)=>{const l={x:t.x-o.x,y:t.y-o.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-l.x,z:i.center.z-l.y}})},backViewPolygon2PointCloud=(t,o,i,l)=>{const[e,c,p]=t.pointList,[r,d,h]=o.pointList,g=lbAnnotation.MathUtils.getLineCenterPoint([e,p]),x=lbAnnotation.MathUtils.getLineCenterPoint([r,h]),U={x:{x:g.x-x.x,y:g.y-x.y}.x,y:0,z:g.y-x.y},_=lbAnnotation.MathUtils.getLineLength(e,c),O=lbAnnotation.MathUtils.getLineLength(r,d),k=_-O,V=lbAnnotation.MathUtils.getLineLength(c,p),S=lbAnnotation.MathUtils.getLineLength(d,h),A=V-S;let{newBoxParams:y}=l.getNewBoxByBackUpdate(U,A,k,i);return y},syncSideViewByPoint=(t,o,i,l,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Left);r.setInitCameraPosition(d);const{point2d:h,zoom:g}=r.getSphereSidePoint2DCoordinate(t);r.camera.zoom=g,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeSideView=(t,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(l,t,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=c.getBoxSidePolygon2DCoordinate(t);c.camera.zoom=d,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(d),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:r,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncBackViewByPoint=(t,o,i,l,e)=>{var c;if(!i)return;const{toolInstance:p,pointCloudInstance:r}=i;r.loadPCDFile(l,(c=e==null?void 0:e.radius)!=null?c:DEFAULT_RADIUS);const{cameraPositionVector:d}=r.updateOrthoCameraBySphere(t,lbUtils.EPerspectiveView.Back);r.setInitCameraPosition(d);const{point2d:h,zoom:g}=r.getSphereBackPoint2DCoordinate(t);r.camera.zoom=g,r.camera.updateProjectionMatrix(),r.render(),p.initPosition(),p.zoomChangeOnCenter(g),p.setResult([__spreadProps(__spreadValues(__spreadValues({},o),h),{valid:t.valid,textAttribute:"",attribute:t.attribute})]),p.setSelectedID(o.id)},synchronizeBackView=(t,o,i,l)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:c}=i;c.loadPCDFileByBox(l,t,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:p}=c.updateOrthoCamera(t,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(p);const{polygon2d:r,zoom:d}=c.getBoxBackPolygon2DCoordinate(t);c.camera.zoom=d,c.camera.updateProjectionMatrix(),c.render(),e.initPosition(),e.zoomChangeOnCenter(d),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:r,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},syncTopViewByPoint=(t,o,i,l)=>{if(!i||!l)return;l.generateSphere(t),l.updateCameraBySphere(t,lbUtils.EPerspectiveView.Top),l.render();const{toolInstance:e,pointCloudInstance:c}=i,{point2d:p}=c.getSphereTopPoint2DCoordinate(t),r=[...e.pointList].map(d=>d.id===o.id?__spreadProps(__spreadValues(__spreadValues({},o),p),{valid:t.valid,textAttribute:"",attribute:t.attribute}):d);e.setResult(r),e.setSelectedID(o.id)},synchronizeTopView=(t,o,i,l)=>{var e;if(!i||!l)return;l.generateBox(t,o.id),l.render();const{pointCloud2dOperation:c,pointCloudInstance:p}=i,{polygon2d:r}=p.getBoxTopPolygon2DCoordinate(t),d=[...c.polygonList],h=d.find(g=>g.id===o.id);h?h.pointList=r:d.push({id:o.id,pointList:r,textAttribute:"",isRect:!0,valid:(e=t.valid)!=null?e:!0}),c.setResultAndSelectedID(d,o.id)},usePointCloudViews=()=>{const t=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:l,mainViewInstance:e,addPointCloudBox:c,addPointCloudSphere:p,setSelectedIDs:r,selectedIDs:d,pointCloudBoxList:h,pointCloudSphereList:g,hideAttributes:x}=t,{addHistory:D,initHistory:U,pushHistoryUnderUpdatePolygon:_,pushHistoryUnderUpdateLine:O}=useHistory.useHistory(),{selectedPolygon:k}=usePolygon.usePolygon(),{updateSelectedBox:V,updateSelectedBoxes:S,getPointCloudByID:A}=useSingleBox.useSingleBox(),{getPointCloudSphereByID:y,updatePointCloudSphere:H,selectedSphere:z}=useSphere.useSphere(),{currentData:T,config:L}=ctx.useSelector(n=>{const{stepList:s,step:P,imgList:u,imgIndex:a}=n.annotation;return{currentData:u[a],config:index.jsonParser(StepUtils.getCurrentStepInfo(P,s).config)}}),F=ctx.useDispatch(),{selectedBox:j}=useSingleBox.useSingleBox(),{t:G}=reactI18next.useTranslation(),N=j==null?void 0:j.info;if(!o||!i||!l)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:E}=o,Q=n=>{e==null||e.generateBox(n),e==null||e.controls.update(),e==null||e.render()},X=n=>{e==null||e.generateSphere(n),e==null||e.controls.update(),e==null||e.render()},Y=({newPoint:n,size:s,zoom:P,trackConfigurable:u})=>{var a;const C={attribute:(a=o.toolInstance.defaultAttribute)!=null?a:""};u===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:g})});const f=topViewPoint2PointCloud(n,s,E,void 0,C);r(n.id);const v=p(f);M(PointCloudView.Top,n,f,P,v,L),D({newSphereParams:f})},J=({polygon:n,size:s,imgList:P,trackConfigurable:u,zoom:a,intelligentFit:C})=>{var f;const v={attribute:(f=o.toolInstance.defaultAttribute)!=null?f:""};u===!0&&Object.assign(v,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:g})});const m=o==null?void 0:o.toolInstance,w=__spreadValues({},n),{boxParams:B,newPointList:I}=topViewPolygon2PointCloud(w,s,E,void 0,v,C);if((L==null?void 0:L.lowerLimitPointsNumInBox)&&typeof B.count=="number"&&B.count<L.lowerLimitPointsNumInBox){antd.message.info(G("LowerLimitPointsNumInBox",{num:L.lowerLimitPointsNumInBox})),m.deletePolygon(B.id);return}C&&(I==null?void 0:I.length)&&(w.pointList=I);const q=x.includes(w.attribute),b=c(B);q?r([]):(r(B.id),m.setSelectedIDs([w.id]),R(PointCloudView.Top,w,B,a,b),C&&synchronizeTopView(B,w,o,e)),D({newBoxParams:B})},K=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:P,newSphereList:u})=>{const a=o==null?void 0:o.toolInstance;if(!(d.length===0||!a)){if(n||(j==null?void 0:j.info)){const C=n!=null?n:j==null?void 0:j.info;a==null||a.setSelectedIDs(d);const f=a.selectedPolygon;if(d.length===1&&C){R(PointCloudView.Top,f,C,void 0,s);return}}if((P||z)&&d.length===1){const C=P!=null?P:z;a.setSelectedID(d[0]);const f=a.selectedPoint;C&&M(PointCloudView.Top,f,C,void 0,u,L)}}},Z=(n,s,P)=>{if(N){let u,a;switch(P){case PointCloudView.Back:u=backViewPolygon2PointCloud;break;case PointCloudView.Side:u=sideViewPolygon2PointCloud;break;default:u=sideViewPolygon2PointCloud;break}if(a=u(n,s,N,i.pointCloudInstance),e){const{count:f}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(a).polygonPointList,[a.center.z-a.depth/2,a.center.z+a.depth/2]);a=__spreadProps(__spreadValues({},a),{count:f})}const C=V(a);return R(P,n,a,void 0,C),C}},W=(n,s,P)=>{if(z){let u,a;switch(P){case PointCloudView.Back:u=backViewPoint2PointCloud;break;case PointCloudView.Side:u=sideViewPoint2PointCloud;break;default:u=sideViewPoint2PointCloud;break}a=u(n,s,z);const C=H(a);return M(P,n,a,void 0,C,L),C}},$=(n,s)=>{W(n,s,PointCloudView.Side)},tt=(n,s)=>{W(n,s,PointCloudView.Back)},et=(n,s)=>{Z(n,s,PointCloudView.Side)},ot=(n,s)=>{Z(n,s,PointCloudView.Back)},it=(n,s)=>{O(n)},nt=(n,s)=>{const P=y(n.id),u=topViewPoint2PointCloud(n,s,E,P),a=H(u);M(PointCloudView.Top,n,u,void 0,a,L)},st=(n,s)=>{if(k){const u=n[0].newPolygon;u.pointList=u.pointList.map(a=>lbUtils.PointCloudUtils.transferCanvas2World(a,s)),_(n[0].newPolygon);return}const P=n.map(({newPolygon:u})=>{const a=A(u.id),{boxParams:C}=topViewPolygon2PointCloud(u,s,o.pointCloudInstance,a);return C});if(P.length===1){const{newPolygon:u}=n[0],a=S(P);R(PointCloudView.Top,u,P[0],void 0,a)}else{const u=S(P);u&&t.syncAllViewPointCloudColor(u)}},M=(n,s,P,u,a,C)=>__async(void 0,null,function*(){const f=T==null?void 0:T.url,v={[PointCloudView.Side]:()=>{syncSideViewByPoint(P,s,i,f,C)},[PointCloudView.Back]:()=>{l&&syncBackViewByPoint(P,s,l,f,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(P,s,o,e)}};Object.keys(v).forEach(m=>{m!==n&&v[m]()}),u&&(e==null||e.updateCameraZoom(u)),X(P)}),R=(n,s,P,u,a)=>__async(void 0,null,function*(){const C=T==null?void 0:T.url;a&&(yield t.syncAllViewPointCloudColor(a));const f={[PointCloudView.Side]:()=>{synchronizeSideView(P,s,i,C)},[PointCloudView.Back]:()=>{l&&synchronizeBackView(P,s,l,C)},[PointCloudView.Top]:()=>{synchronizeTopView(P,s,o,e)}};Object.keys(f).forEach(v=>{v!==n&&f[v]()}),u&&(e==null||e.updateCameraZoom(u)),Q(P)});return{topViewAddSphere:Y,topViewAddBox:J,topViewSelectedChanged:K,topViewUpdatePoint:nt,sideViewUpdatePoint:$,backViewUpdatePoint:tt,topViewUpdateBox:st,topViewUpdateLine:it,sideViewUpdateBox:et,backViewUpdateBox:ot,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),e==null||e.generateBoxes(n)},initPointCloud3d:n=>{if(!e)return;const s={left:-n.width/2,right:n.width/2,top:n.height/2,bottom:-n.height/2,near:100,far:-100};e.initOrthographicCamera(s),e.initRenderer(),e.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=T){var P,u,a,C,f,v;if(!(s==null?void 0:s.url)||!e)return;actionCreators.SetPointCloudLoading(F,!0),yield e.loadPCDFile(s.url,(P=L==null?void 0:L.radius)!=null?P:DEFAULT_RADIUS),h.forEach(b=>{e==null||e.removeObjectByName(b.id)}),g.forEach(b=>{e==null||e.removeObjectByName(b.id)});let m=[],w=[],B=[],I=[];s.result?(m=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),B=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),w=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),I=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),m.forEach(b=>{e==null||e.generateBox(b)}),I.forEach(b=>{e==null||e.generateSphere(b)}),t.syncAllViewPointCloudColor(m),t.setPointCloudResult(m),t.setPolygonList(B),t.setLineList(w),t.setPointCloudSphereList(I)):(t.setPointCloudResult([]),t.setPolygonList([]),t.setPointCloudSphereList([]),t.setLineList([])),U({pointCloudBoxList:m,polygonList:B,pointCloudSphereList:I}),e.updateTopCamera();const q=(a=(u=index.jsonParser(s.result))==null?void 0:u.valid)!=null?a:!0;t.setPointCloudValid(q),(C=t.sideViewInstance)==null||C.clearAllData(),(f=t.backViewInstance)==null||f.clearAllData(),o.updateData(s.url,s.result,{radius:(v=L==null?void 0:L.radius)!=null?v:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(F,!1)})}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),_=require("lodash");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),_=require("lodash"),useHistory=require("./useHistory.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_);const{ESortDirection}=lbAnnotation.cAnnotation,useSphere=()=>{const{pointCloudSphereList:e,setPointCloudSphereList:l,selectedID:u,setSelectedIDs:a,mainViewInstance:s,topViewInstance:r}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:p}=useHistory.useHistory(),C=React.useMemo(()=>e.find(t=>t.id===u),[u,e]),f=React.useCallback(t=>e.find(n=>n.id===t),[e]),h=React.useCallback(t=>{const n=e.findIndex(o=>o.id===t.id);if(n>-1){e.splice(n,1,___default.default.merge(e[n],t));const o=___default.default.cloneDeep(e);return l(o),p({pointCloudSphereList:o}),o}return e},[e]),S=React.useCallback(t=>{const n=e.filter(o=>o.id!==t);l(n),s==null||s.removeObjectByName(t),s==null||s.render()},[e]),I=React.useCallback((t=ESortDirection.ascend)=>{if(!r)return;const n=r.toolInstance.pointList,o=r.toolInstance.selectedID,d=n.findIndex(i=>(i==null?void 0:i.id)===o);if(d>-1){let i=1;t===ESortDirection.descend&&(i=-1);const c=n.length,b=n[(d+i+c)%c];a(b.id)}},[r]);return{selectedSphere:C,getPointCloudSphereByID:f,updatePointCloudSphere:h,deletePointCloudSphere:S,switchToNextSphere:I}};exports.useSphere=useSphere;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:r,backViewInstance:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js");const{EToolName,EPolygonPattern}=lbAnnotation.cTool,useStatus=()=>{const{topViewInstance:i,sideViewInstance:r,backViewInstance:u,mainViewInstance:t,pointCloudBoxList:c,pointCloudSphereList:d,setPointCloudResult:P,setPointCloudSphereList:C,setPolygonList:v,pointCloudPattern:a,setPointCloudPattern:n,syncAllViewPointCloudColor:h,setLineList:p}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:y}=useHistory.useHistory(),L=()=>{c.forEach(e=>{t==null||t.removeObjectByName(e.id)}),d.forEach(e=>{t==null||t.removeObjectByName(e.id)}),t==null||t.render(),P([]),v([]),C([]),p([]),i==null||i.toolScheduler.clearStatusAndResult(),h([]),y({pointCloudBoxList:[],polygonList:[],pointCloudSphereList:[]})},l=()=>{r==null||r.toolInstance.clearResult(),u==null||u.toolInstance.clearResult()};return{clearAllResult:L,updatePointCloudPattern:e=>{if(e===a)return;const s=[i,r,u];switch(e){case EToolName.Rect:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Rect)}),n(EToolName.Rect);break;case EToolName.Polygon:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.PointCloudPolygon),o==null||o.toolInstance.setPattern(EPolygonPattern.Normal)}),n(EToolName.Polygon);break;case EToolName.Point:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Point)}),n(EToolName.Point);break;case EToolName.Line:l(),s.forEach(o=>{o==null||o.switchToCanvas(EToolName.Line)}),n(EToolName.Line);break}},pointCloudPattern:a}};exports.useStatus=useStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var antd=require("antd"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),icon=require("../../../assets/predictTracking/icon.svg.js"),useSingleBox=require("../../pointCloudView/hooks/useSingleBox.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),util=require("../previewResult/util.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var antd=require("antd"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),icon=require("../../../assets/predictTracking/icon.svg.js"),useSingleBox=require("../../pointCloudView/hooks/useSingleBox.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),util=require("../previewResult/util.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__async=(t,n,r)=>new Promise((c,a)=>{var l=e=>{try{i(r.next(e))}catch(o){a(o)}},s=e=>{try{i(r.throw(e))}catch(o){a(o)}},i=e=>e.done?c(e.value):Promise.resolve(e.value).then(l,s);i((r=r.apply(t,n)).next())});const PredictTrackingIcon=t=>{const n=ctx.useDispatch(),{t:r}=reactI18next.useTranslation(),{loading:c}=t,{selectedBox:a}=useSingleBox.useSingleBox(),l=()=>__async(void 0,null,function*(){if(c)return;const s=a==null?void 0:a.info.trackID;if(!s){antd.message.error(r("BeforePredictStarting"));return}yield n(actionCreators.ChangeSave);const i=a==null?void 0:a.info.id,e=yield n(actionCreators.GetBoxesByID(s,i));if(e.length<2){antd.message.error(r("MarkOnlyOne"));return}const o=e.findIndex(g=>g.id===i),u=e[o-1],d=e[o],f=d.index-u.index;if(f<2){antd.message.error(r("HaveNoNeed"));return}if(f>8){antd.message.error(r("ThePredictedPointCloud"));return}antd.message.success(r("PredictingDataFrom",{startPage:u.index+1,endPage:d.index+1,selectedBoxTrackID:s})),actionCreators.SetPointCloudLoading(n,!0);const x=util.predict(u,d);actionCreators.SetPredictResult(n,x),actionCreators.SetPredictResultVisible(n,!0)});return React__default.default.createElement(antd.Button,{type:"link",onClick:l,style:{display:"flex",flexDirection:"column",height:"auto",alignItems:"center"}},React__default.default.createElement("img",{src:icon,style:{alignSelf:"center"}}),React__default.default.createElement("span",{style:{color:"#797979"}},r("ComplementaryTracking")))},mapStateToProps=t=>({loading:t.annotation.loading});var PredictTrackingIcon$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PredictTrackingIcon);module.exports=PredictTrackingIcon$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var classNames=require("classnames"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),PointCloudContext=require("../../pointCloudView/PointCloudContext.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),dom=require("../../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),util=require("./util.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,a)=>new Promise((c,n)=>{var o=l=>{try{i(a.next(l))}catch(s){n(s)}},r=l=>{try{i(a.throw(l))}catch(s){n(s)}},i=l=>l.done?c(l.value):Promise.resolve(l.value).then(o,r);i((a=a.apply(e,t)).next())});const PreviewResult=e=>{const{predictionResult:t,predictionResultVisible:a,imgList:c}=e,[n,o]=React.useState([]),r=ctx.useDispatch(),{t:i}=reactI18next.useTranslation(),l=()=>{actionCreators.SetPredictResultVisible(r,!1),actionCreators.SetPredictResult(r,[]),o([])},s=()=>__async(void 0,null,function*(){actionCreators.SetPointCloudLoading(r,!0),yield r(actionCreators.BatchUpdateImgListResultByPredictResult()),actionCreators.SetPointCloudLoading(r,!1),l()});return a?React__default.default.createElement(React__default.default.Fragment,null,n.length>0&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","bar")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title")},React__default.default.createElement("div",null,i("ComplementaryTrackingPrediction"),n.length>0?`\uFF08${n.length}\uFF09`:""),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","option")},React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","cancelOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:l},i("Cancel")),React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","okOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:s},i("Apply")))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","content")},React__default.default.createElement(Result,{list:n})))),t.length>0&&React__default.default.createElement(GenerateViewsDataUrl,{result:t,imgList:c,setList:o})):null},Result=e=>{const{list:t}=e,{t:a}=reactI18next.useTranslation(),c=[a("TopView"),a("SideView"),a("BackView")];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","left")},c.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title"),key:n},n))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","right")},t.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","item"),key:n.id},util.views.map(o=>{const r=n[o];return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","view"),key:`${n.id}-${o}`},React__default.default.createElement("img",{src:r}))})))))},GenerateViewsDataUrl=e=>{const t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=ctx.useDispatch(),{result:c,imgList:n,setList:o}=e,r=React.useRef(null),i={width:600,height:600};return React.useEffect(()=>{(()=>__async(void 0,null,function*(){var s,f,g,v,C,h;const p=(s=t.mainViewInstance)==null?void 0:s.config;if(p&&r.current){const P={left:-i.width/2,right:i.width/2,top:i.height/2,bottom:-i.height/2,near:200,far:-200},u=new lbAnnotation.PointCloud({container:r.current,isOrthographicCamera:!0,orthographicParams:P,config:p});u.setShowDirection(!1);for(const d of c){const{index:m}=d,y=n[m].url?n[m].url:(C=(v=(g=(f=n[m])==null?void 0:f.webPointCloudFile)==null?void 0:g.lidar)==null?void 0:v.url)!=null?C:"";yield u.loadPCDFileByBox(y,d,{width:2,height:2,depth:2}),yield u.updateCameraZoom(t.zoom);const N=(h=lbUtils.toolStyleConverter.getColorFromConfig({attribute:d.attribute},__spreadProps(__spreadValues({},p),{attributeConfigurable:!0}),{}))==null?void 0:h.
|
|
1
|
+
"use strict";var classNames=require("classnames"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),PointCloudContext=require("../../pointCloudView/PointCloudContext.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),ctx=require("../../../store/ctx.js"),dom=require("../../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),util=require("./util.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,a)=>new Promise((c,n)=>{var o=l=>{try{i(a.next(l))}catch(s){n(s)}},r=l=>{try{i(a.throw(l))}catch(s){n(s)}},i=l=>l.done?c(l.value):Promise.resolve(l.value).then(o,r);i((a=a.apply(e,t)).next())});const PreviewResult=e=>{const{predictionResult:t,predictionResultVisible:a,imgList:c}=e,[n,o]=React.useState([]),r=ctx.useDispatch(),{t:i}=reactI18next.useTranslation(),l=()=>{actionCreators.SetPredictResultVisible(r,!1),actionCreators.SetPredictResult(r,[]),o([])},s=()=>__async(void 0,null,function*(){actionCreators.SetPointCloudLoading(r,!0),yield r(actionCreators.BatchUpdateImgListResultByPredictResult()),actionCreators.SetPointCloudLoading(r,!1),l()});return a?React__default.default.createElement(React__default.default.Fragment,null,n.length>0&&React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","bar")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title")},React__default.default.createElement("div",null,i("ComplementaryTrackingPrediction"),n.length>0?`\uFF08${n.length}\uFF09`:""),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","option")},React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","cancelOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:l},i("Cancel")),React__default.default.createElement("div",{className:classNames__default.default([dom.getClassName("point-cloud-predict-tracking-container","okOption"),dom.getClassName("point-cloud-predict-tracking-container","button")]),onClick:s},i("Apply")))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","content")},React__default.default.createElement(Result,{list:n})))),t.length>0&&React__default.default.createElement(GenerateViewsDataUrl,{result:t,imgList:c,setList:o})):null},Result=e=>{const{list:t}=e,{t:a}=reactI18next.useTranslation(),c=[a("TopView"),a("SideView"),a("BackView")];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","left")},c.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","title"),key:n},n))),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","right")},t.map(n=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","item"),key:n.id},util.views.map(o=>{const r=n[o];return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-predict-tracking-container","view"),key:`${n.id}-${o}`},React__default.default.createElement("img",{src:r}))})))))},GenerateViewsDataUrl=e=>{const t=React__default.default.useContext(PointCloudContext.PointCloudContext),a=ctx.useDispatch(),{result:c,imgList:n,setList:o}=e,r=React.useRef(null),i={width:600,height:600};return React.useEffect(()=>{(()=>__async(void 0,null,function*(){var s,f,g,v,C,h;const p=(s=t.mainViewInstance)==null?void 0:s.config;if(p&&r.current){const P={left:-i.width/2,right:i.width/2,top:i.height/2,bottom:-i.height/2,near:200,far:-200},u=new lbAnnotation.PointCloud({container:r.current,isOrthographicCamera:!0,orthographicParams:P,config:p});u.setShowDirection(!1);for(const d of c){const{index:m}=d,y=n[m].url?n[m].url:(C=(v=(g=(f=n[m])==null?void 0:f.webPointCloudFile)==null?void 0:g.lidar)==null?void 0:v.url)!=null?C:"";yield u.loadPCDFileByBox(y,d,{width:2,height:2,depth:2}),yield u.updateCameraZoom(t.zoom);const N=(h=lbUtils.toolStyleConverter.getColorFromConfig({attribute:d.attribute},__spreadProps(__spreadValues({},p),{attributeConfigurable:!0}),{}))==null?void 0:h.fill;u.generateBox(d,N),yield util.sleep(500),yield util.getViewsDataUrl(u,d,t.zoom),yield u.removeObjectByName(d.id),yield u.clearPointCloudAndRender()}o(c),actionCreators.SetPointCloudLoading(a,!1)}}))()},[]),React__default.default.createElement("div",{style:i,ref:r,className:"generate-view"})},mapStateToProps=e=>({predictionResult:e.annotation.predictionResult,predictionResultVisible:e.annotation.predictionResultVisible,imgList:e.annotation.imgList});var PreviewResult$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PreviewResult);module.exports=PreviewResult$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../utils/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../utils/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,r)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,__spreadValues=(t,e)=>{for(var r in e||(e={}))__hasOwnProp.call(e,r)&&__defNormalProp(t,r,e[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))__propIsEnum.call(e,r)&&__defNormalProp(t,r,e[r]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e)),__async=(t,e,r)=>new Promise((o,i)=>{var s=n=>{try{c(r.next(n))}catch(l){i(l)}},u=n=>{try{c(r.throw(n))}catch(l){i(l)}},c=n=>n.done?o(n.value):Promise.resolve(n.value).then(s,u);c((r=r.apply(t,e)).next())});const EXAMPLE_IMAGE_SIZE={width:160,height:110},getDataUrl=(t,e=2)=>__async(void 0,null,function*(){return cropAndEnlarge(t.domElement,EXAMPLE_IMAGE_SIZE.width,EXAMPLE_IMAGE_SIZE.height,e)}),sleep=(t=300)=>new Promise(e=>{setTimeout(()=>{e("")},t)}),views=[lbUtils.EPerspectiveView.Top,lbUtils.EPerspectiveView.Left,lbUtils.EPerspectiveView.Back],getViewsDataUrl=(t,e,r)=>__async(void 0,null,function*(){for(const o of views)yield t.updateCameraByBox(e,o),e[o]=yield getDataUrl(t.renderer,r)}),cropAndEnlarge=(t,e,r,o)=>{if(!t)return"";const i=t.width/2,s=t.height/2,u=i-e/2,c=s-r/2,n=document.createElement("canvas");n.width=e*o,n.height=r*o;const l=n.getContext("2d");return l==null||l.drawImage(t,u,c,e,r,0,0,e*o,r*o),n.toDataURL()},getBoxesByTrackID=(t,e,r,o)=>{const i=[];return t.some((s,u)=>{var c;const n=index.jsonParser(s==null?void 0:s.result),l=(c=n==null?void 0:n[`step_${e}`])==null?void 0:c.result,d=l==null?void 0:l.find(a=>a.trackID===r);return d&&i.push(__spreadProps(__spreadValues({},d),{index:u})),(d==null?void 0:d.id)===o}),i},predict=(t,e)=>{const o=e.index-t.index-1,i=[],s={},u=["x","y","z"],c=["center","depth","height","index","rotation","width"];u.forEach(n=>{s[n]=getInteriorNumbersByStartAndEnd(t.center[n],e.center[n],o)}),c.forEach(n=>{n!=="center"&&(s[n]=getInteriorNumbersByStartAndEnd(t[n],e[n],o))});for(let n=0;n<o;n++){const l=u.reduce((a,p)=>(a[p]=s[p][n],a),{x:0,y:0,z:0}),d=c.reduce((a,p)=>(p==="center"||(a[p]=s[p][n]),a),__spreadProps(__spreadValues({},e),{id:lbAnnotation.uuid(),center:l}));i.push(d)}return i},getInteriorNumbersByStartAndEnd=(t=0,e=0,r=0)=>{const o=(e-t)/(r+1),i=new Array(r);for(let s=0;s<r;s++)i[s]=t+o*(s+1);return i};exports.getBoxesByTrackID=getBoxesByTrackID,exports.getViewsDataUrl=getViewsDataUrl,exports.predict=predict,exports.sleep=sleep,exports.views=views;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(e,t,n)=>new Promise((a,o)=>{var i
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(e,t,n)=>new Promise((a,o)=>{var s=i=>{try{p(n.next(i))}catch(r){o(r)}},T=i=>{try{p(n.throw(i))}catch(r){o(r)}},p=i=>i.done?a(i.value):Promise.resolve(i.value).then(s,T);p((n=n.apply(e,t)).next())});const dispatchTasks=(e,t)=>t.map(n=>e(n)),getSubmitByPageOperation=e=>e===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:e===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:e===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(e,t)=>{var n,a;const{imgList:o,imgIndex:s}=e,{dataSourceStep:T}=reducer.getStepConfig(e.stepList,e.step);return((a=(n=index$1.jsonParser(o[s-1].result)[`step_${T}`])==null?void 0:n.result)==null?void 0:a.length)-1||t};function UpdateToolInstance(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:e}}}function SetTaskStepList({stepList:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:e}}}function SetTaskConfig({stepList:e,step:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:e,step:t}}}function UpdateOnSubmit(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:e}}}function UpdateOnSave(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:e}}}function UpdateOnPageChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:e}}}function UpdateOnStepChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:e}}}function UpdateGetFileData(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:e}}}function UpdatePageSize(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:e}}}function UpdateGetFileList(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:e}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(e){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:e}}}function UpdateBeforeRotate(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:e}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function BatchUpdateTrackID({id:e,newID:t,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:e,newID:t,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(e,t,n){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:e,newData:t,rangeIndex:n}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=e=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:e}});function InitTaskData({onSubmit:e,onSave:t,onPageChange:n,onStepChange:a,getFileData:o,pageSize:s,loadFileList:T,step:p,stepList:i,skipBeforePageTurning:r,beforeRotate:A,checkMode:N}){const u=[];return e&&u.push(UpdateOnSubmit(e)),t&&u.push(UpdateOnSave(t)),n&&u.push(UpdateOnPageChange(n)),a&&u.push(UpdateOnStepChange(a)),o&&u.push(UpdateGetFileData(o)),T&&u.push(UpdateGetFileList(T)),s&&u.push(UpdatePageSize(s)),r&&u.push(UpdateSkipBeforePageTurning(r)),A&&u.push(UpdateBeforeRotate(A)),typeof N=="boolean"&&u.push(UpdateCheckMode(N)),u.push(SetTaskConfig({stepList:i,step:p})),u.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),u.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),I=>dispatchTasks(I,u)}function UpdateInjectFunc({onSubmit:e,onSave:t,onPageChange:n,onStepChange:a,getFileData:o,pageSize:s,loadFileList:T,stepList:p,beforeRotate:i}){const r=[];return e&&r.push(UpdateOnSubmit(e)),t&&r.push(UpdateOnSave(t)),n&&r.push(UpdateOnPageChange(n)),a&&r.push(UpdateOnStepChange(a)),o&&r.push(UpdateGetFileData(o)),T&&r.push(UpdateGetFileList(T)),s&&r.push(UpdatePageSize(s)),i&&r.push(UpdateBeforeRotate(i)),r.push(SetTaskStepList({stepList:p})),A=>dispatchTasks(A,r)}const getNextStep=(e,t)=>{var n;const a=t==null?void 0:t.findIndex(o=>(o==null?void 0:o.step)===e);return(n=t[a+1])==null?void 0:n.step},ToNextStep=e=>(t,n)=>{const{annotation:a}=n(),{step:o,stepList:s}=a,T=getNextStep(o,s);return[t(UpdateProcessingStep(T,e))]},UpdateProcessingStep=(e,t)=>(n,a)=>{var o,s;const{annotation:T}=a();(o=T==null?void 0:T.onStepChange)==null||o.call(T,e);const p=(s=T==null?void 0:T.imgIndex)!=null?s:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:e}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(t!=null?t:p,0))]},ToSubmitFileData=e=>t=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:e}})],SubmitAndChangeFileIndex=(e,t,n,a)=>[e(ToSubmitFileData(n)),e(reducer.LoadFileAndFileData(t,a))],ChangeBasicIndex=(e,t)=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:t}})],ChangeTriggerEventAfterIndexChanged=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:t}})},PageBackward=(e=!1)=>(t,n)=>DispatcherTurning(t,n,AnnotationSize.EPageTurningOperation.Backward,e),PageForward=(e=!1)=>(t,n)=>DispatcherTurning(t,n,AnnotationSize.EPageTurningOperation.Forward,e),PageJump=(e,t=!1)=>(n,a)=>{if(e!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,t,e)},loadImgList=(e,t,n,a)=>__async(void 0,null,function*(){var o;const{loadFileList:s,imgList:T,pageSize:p}=t().annotation,i=Math.floor(n/p);SetAnnotationLoading(e,!0);try{const r=yield s(i,p);if(SetAnnotationLoading(e,!1),!((o=r==null?void 0:r.fileList)==null?void 0:o.length)||!(r==null?void 0:r.total))throw new Error("fileList and total are required");const A=a?new Array(r.total):[...T];return A.splice(i*p,p,...r.fileList),e({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:A}}),!0}catch(r){SetAnnotationLoading(e,!1),console.error(r)}}),DispatcherTurning=(e,t,n,a=!1,o)=>__async(void 0,null,function*(){var s;const T=t().annotation,{fileIndexChanged:p,fileIndex:i,basicIndexChanged:r,basicIndex:A}=PageOperator.getNextPageInfo(n,T,o),N=getSubmitByPageOperation(n);if(ChangeTriggerEventAfterIndexChanged(e,a),p){if(T.loading||!T.imgList[i]&&!(yield loadImgList(e,t,i)))return;(s=T.onPageChange)==null||s.call(T,i);const u=N===index.ESubmitType.Backward?getBasicIndex(t().annotation,A):A;return SubmitAndChangeFileIndex(e,i,N,u)}return r?ChangeBasicIndex(e,A):e(ToSubmitFileData(N))}),ChangeSave=e=>{e(ToSubmitFileData(index.ESubmitType.Save)),e({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:t}})},SetPointCloudLoading=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:t}})},InitAnnotationState=e=>{e({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:t}})},SetPredictResultVisible=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:t}})},GetBoxesByID=(e,t)=>(n,a)=>{const{imgList:o,step:s}=a().annotation;return util.getBoxesByTrackID(o,s,e,t)};exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetPointCloudLoading=SetPointCloudLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export interface AppProps {
|
|
|
68
68
|
customRenderStyle?: (data: any) => IAnnotationStyle;
|
|
69
69
|
checkMode?: boolean;
|
|
70
70
|
intelligentFit?: boolean;
|
|
71
|
+
enableColorPicker?: boolean;
|
|
71
72
|
}
|
|
72
73
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps>, import("react-redux").Omit<AppProps & {
|
|
73
74
|
children?: React.ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IProps {
|
|
2
3
|
src: string;
|
|
3
4
|
result: string;
|
|
@@ -8,5 +9,5 @@ interface IProps {
|
|
|
8
9
|
backgroundColor?: string;
|
|
9
10
|
isOrthographicCamera?: boolean;
|
|
10
11
|
}
|
|
11
|
-
declare const PointCloudAnnotationView: (props: IProps) => JSX.Element;
|
|
12
|
+
declare const PointCloudAnnotationView: (props: IProps) => React.JSX.Element;
|
|
12
13
|
export default PointCloudAnnotationView;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IStepInfo } from '@/types/step';
|
|
2
3
|
interface IProps {
|
|
3
4
|
stepList: IStepInfo[];
|
|
4
5
|
currentStep: number;
|
|
5
6
|
updateStep: (step: number) => void;
|
|
6
7
|
}
|
|
7
|
-
declare const AnnotationStepPopover: (props: IProps) => JSX.Element;
|
|
8
|
+
declare const AnnotationStepPopover: (props: IProps) => React.JSX.Element;
|
|
8
9
|
export default AnnotationStepPopover;
|
|
@@ -13,6 +13,8 @@ interface IProps {
|
|
|
13
13
|
noHeightLimit?: boolean;
|
|
14
14
|
num?: number | string;
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
|
+
enableColorPicker?: boolean;
|
|
17
|
+
updateColorConfig?: (value: string, color: string) => void;
|
|
16
18
|
}
|
|
17
19
|
declare const AttributeList: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
|
|
18
20
|
export default AttributeList;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IProps {
|
|
2
3
|
selectedAttribute: string[];
|
|
3
4
|
attributeChanged: () => void;
|
|
4
5
|
num?: any;
|
|
5
6
|
list?: any[];
|
|
6
7
|
}
|
|
7
|
-
declare const CheckboxList: (props: IProps) => JSX.Element;
|
|
8
|
+
declare const CheckboxList: (props: IProps) => React.JSX.Element;
|
|
8
9
|
export default CheckboxList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Color Palette
|
|
3
|
+
* @author lixinghua <lixinghua_vendor@sensetime.com>
|
|
4
|
+
* @date 2023.04.24
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
interface IProps {
|
|
8
|
+
defaultColor?: string;
|
|
9
|
+
setColor: (color: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Palette: (props: IProps) => React.JSX.Element;
|
|
12
|
+
export default Palette;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ColorTag: ({ color, style, onClick }: any) => React.JSX.Element;
|
|
@@ -4,8 +4,8 @@ export declare const viewportContext: React.Context<{
|
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const ViewportProviderComponent: (props: any) => JSX.Element;
|
|
8
|
-
export declare const ViewportProvider: import("react-redux").ConnectedComponent<(props: any) => JSX.Element, import("react-redux").Omit<any, "annotation" | "dispatch">>;
|
|
7
|
+
export declare const ViewportProviderComponent: (props: any) => React.JSX.Element;
|
|
8
|
+
export declare const ViewportProvider: import("react-redux").ConnectedComponent<(props: any) => React.JSX.Element, import("react-redux").Omit<any, "annotation" | "dispatch">>;
|
|
9
9
|
export declare const useViewport: () => {
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IA2MapStateProps } from '@/store/annotation/map';
|
|
2
|
-
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config }: IA2MapStateProps) => JSX.Element, import("react-redux").Omit<IA2MapStateProps, "imgIndex" | "imgList" | "config" | "currentData" | "stepInfo" | "configString">>;
|
|
3
|
+
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config }: IA2MapStateProps) => React.JSX.Element, import("react-redux").Omit<IA2MapStateProps, "imgIndex" | "imgList" | "config" | "currentData" | "stepInfo" | "configString">>;
|
|
3
4
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IA2MapStateProps } from '@/store/annotation/map';
|
|
2
3
|
interface IProps {
|
|
3
4
|
checkMode?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config, checkMode }: IA2MapStateProps & IProps) => JSX.Element, import("react-redux").Omit<IA2MapStateProps & IProps, "imgIndex" | "imgList" | "config" | "currentData" | "stepInfo" | "configString">>;
|
|
6
|
+
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config, checkMode }: IA2MapStateProps & IProps) => React.JSX.Element, import("react-redux").Omit<IA2MapStateProps & IProps, "imgIndex" | "imgList" | "config" | "currentData" | "stepInfo" | "configString">>;
|
|
6
7
|
export default _default;
|
|
@@ -17,6 +17,7 @@ export interface IPointCloudContext extends IPointCloudContextInstances {
|
|
|
17
17
|
pointCloudSphereList: IPointCloudSphereList;
|
|
18
18
|
displayPointCloudList: IPointCloudBoxList;
|
|
19
19
|
displaySphereList: IPointCloudSphereList;
|
|
20
|
+
displayLineList: ILine[];
|
|
20
21
|
selectedIDs: string[];
|
|
21
22
|
setSelectedIDs: (ids?: string[] | string) => void;
|
|
22
23
|
valid: boolean;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @createdate 2022-07-13
|
|
5
5
|
*/
|
|
6
6
|
import { EPerspectiveView, IPointCloudConfig } from '@labelbee/lb-utils';
|
|
7
|
+
import React from 'react';
|
|
7
8
|
/**
|
|
8
9
|
* Display size info for views
|
|
9
10
|
* @param param0
|
|
@@ -11,12 +12,12 @@ import { EPerspectiveView, IPointCloudConfig } from '@labelbee/lb-utils';
|
|
|
11
12
|
*/
|
|
12
13
|
export declare const SizeInfoForView: ({ perspectiveView }: {
|
|
13
14
|
perspectiveView: EPerspectiveView;
|
|
14
|
-
}) => JSX.Element | null;
|
|
15
|
+
}) => React.JSX.Element | null;
|
|
15
16
|
/**
|
|
16
17
|
* Display selected box's infos
|
|
17
18
|
*/
|
|
18
19
|
export declare const BoxInfos: ({ checkMode, config, }: {
|
|
19
20
|
checkMode?: boolean | undefined;
|
|
20
21
|
config: IPointCloudConfig;
|
|
21
|
-
}) => JSX.Element | null;
|
|
22
|
-
export declare const PointCloudValidity: () => JSX.Element | null;
|
|
22
|
+
}) => React.JSX.Element | null;
|
|
23
|
+
export declare const PointCloudValidity: () => React.JSX.Element | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IPointCloudConfig } from '@labelbee/lb-utils';
|
|
2
3
|
import { AnnotationFileList } from '@/types/data';
|
|
3
4
|
interface IProps {
|
|
@@ -8,5 +9,5 @@ interface IProps {
|
|
|
8
9
|
imgList: AnnotationFileList;
|
|
9
10
|
imgIndex: number;
|
|
10
11
|
}
|
|
11
|
-
declare const _default: import("react-redux").ConnectedComponent<({ id, visible, onCancel, config, imgList, imgIndex }: IProps) => JSX.Element, import("react-redux").Omit<IProps, "imgIndex">>;
|
|
12
|
+
declare const _default: import("react-redux").ConnectedComponent<({ id, visible, onCancel, config, imgList, imgIndex }: IProps) => React.JSX.Element, import("react-redux").Omit<IProps, "imgIndex">>;
|
|
12
13
|
export default _default;
|