@labelbee/lb-components 1.8.0 → 1.9.0-alpha.0
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/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/index.css +43 -0
- package/dist/store/annotation/selectors.js +1 -0
- package/dist/types/components/AnnotationView/index.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +8 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +3 -16
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +4 -1
- package/dist/types/components/videoPlayer/types.d.ts +1 -1
- package/dist/types/store/annotation/selectors.d.ts +7 -0
- package/dist/types/store/annotation/types.d.ts +3 -3
- package/dist/types/store/imgAttribute/types.d.ts +1 -1
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/toolStyle/types.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +2 -2
- package/dist/types/views/MainView/toolFooter/AnnotatedAttributes/index.d.ts +4 -0
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -0
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/es/assets/annotation/rectTool/icon_rectPattern.svg.js +1 -4
- package/es/components/ImageError/index.js +1 -53
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js.map +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js.map +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js.map +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js.map +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js.map +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js.map +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js.map +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudBoxes.js +119 -0
- package/es/components/pointCloudView/hooks/usePointCloudBoxes.js.map +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +1 -1
- package/es/components/pointCloudView/hooks/usePolygon.js.map +1 -1
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/es/components/pointCloudView/hooks/useSingleBox.js.map +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js.map +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/index.js.map +1 -1
- package/es/components/pointCloudView/useSingleBox.js +44 -0
- package/es/components/pointCloudView/useSingleBox.js.map +1 -0
- package/es/index.css +43 -0
- package/es/store/annotation/selectors.js +1 -0
- package/es/store/annotation/selectors.js.map +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/OperationList.js +77 -0
- package/es/views/MainView/sidebar/GeneralOperation/OperationList.js.map +1 -0
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -0
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js.map +1 -0
- package/es/views/MainView/toolFooter/index.js +1 -1
- package/es/views/MainView/toolFooter/index.js.map +1 -1
- package/package.json +4 -4
- package/es/assets/annotation/toolHotKeyIcon/icon_copyBackwardResult.svg.js +0 -4
- package/es/assets/annotation/toolHotKeyIcon/icon_copyBackwardResult.svg.js.map +0 -1
- package/es/assets/cssIcon/annotation/icon_clearSmall.svg +0 -10
- package/es/assets/cssIcon/annotation/icon_clearSmall_a.svg +0 -10
- package/es/assets/cssIcon/slide_btn.svg +0 -23
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js +0 -228
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js.map +0 -1
- package/es/components/pointCloudView/data.js +0 -4
- package/es/components/pointCloudView/data.js.map +0 -1
- package/es/hooks/useConfig.js +0 -18
- package/es/hooks/useConfig.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),index=require("../AnnotationView/index.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),icons=require("@ant-design/icons"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var 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,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const Toolbar=({onNext:e,onPrev:t,imgLength:n,imgIndex:s})=>React__default.default.createElement("div",null,React__default.default.createElement(icons.LeftOutlined,{onClick:t}),React__default.default.createElement("span",null," ",s+1," / ",n," "),React__default.default.createElement(icons.RightOutlined,{onClick:e})),PointCloud2DView=({currentData:e,config:t})=>{var n,s,_,b,P;const[c,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),index=require("../AnnotationView/index.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),icons=require("@ant-design/icons"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var 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,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const Toolbar=({onNext:e,onPrev:t,imgLength:n,imgIndex:s})=>React__default.default.createElement("div",null,React__default.default.createElement(icons.LeftOutlined,{onClick:t}),React__default.default.createElement("span",null," ",s+1," / ",n," "),React__default.default.createElement(icons.RightOutlined,{onClick:e})),PointCloud2DView=({currentData:e,config:t})=>{var n,s,_,b,P;const[c,L]=React.useState([]),{topViewInstance:w,displayPointCloudList:C}=React.useContext(PointCloudContext.PointCloudContext),[r,p]=React.useState(0),x=React.useRef(null),f=React.useRef(),{selectedBox:v}=useSingleBox.useSingleBox(),I=useSize(x),{t:O}=reactI18next.useTranslation(),a=(n=e==null?void 0:e.mappingImgList)==null?void 0:n[r];React.useEffect(()=>{p(0)},[e]),React.useEffect(()=>{if(w&&a){const o={fill:"transparent",color:"green"},l=C.reduce((u,i)=>{var d;const q=lbAnnotation.pointCloudLidar2image(i,a.calib),j=(d=lbUtils.toolStyleConverter.getColorFromConfig({attribute:i.attribute},__spreadProps(__spreadValues({},t),{attributeConfigurable:!0}),{}))==null?void 0:d.stroke;return[...u,...q.map(y=>({type:y.type,annotation:__spreadProps(__spreadValues({id:i.id,pointList:y.pointList},o),{stroke:j})}))]},[]);L(l)}},[C,a]);const m=!e||!(e==null?void 0:e.mappingImgList)||!(((s=e==null?void 0:e.mappingImgList)==null?void 0:s.length)>0),g=React.useCallback(()=>{var o,l;const u=(o=f.current)==null?void 0:o.toolInstance;if(!v||!u)return;const i=c.find(d=>d.annotation.id===v.info.id);((l=i==null?void 0:i.annotation.pointList)==null?void 0:l.length)>0&&u.focusPositionByPointList(i==null?void 0:i.annotation.pointList)},[v,f.current,c,r]);return React.useEffect(()=>{g()},[g]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-2d-container"),title:O("2DView"),toolbar:m?void 0:React__default.default.createElement(Toolbar,{imgIndex:r,imgLength:(b=(_=e.mappingImgList)==null?void 0:_.length)!=null?b:0,onNext:()=>{var o;!e||!(e==null?void 0:e.mappingImgList)||r>=((o=e==null?void 0:e.mappingImgList)==null?void 0:o.length)-1||p(l=>l+1)},onPrev:()=>{r<=0||p(o=>o-1)}}),style:{display:m?"none":"flex"}},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:x},React__default.default.createElement(index,{src:(P=a==null?void 0:a.url)!=null?P:"",annotations:c,size:I,ref:f,globalStyle:{display:m?"none":"block"},afterImgOnLoad:g})))};var PointCloud2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DView);module.exports=PointCloud2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var 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=(t,n,o)=>n in t?__defProp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,__spreadValues=(t,n)=>{for(var o in n||(n={}))__hasOwnProp.call(n,o)&&__defNormalProp(t,o,n[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(n))__propIsEnum.call(n,o)&&__defNormalProp(t,o,n[o]);return t},__spreadProps=(t,n)=>__defProps(t,__getOwnPropDescs(n));const TransferCanvas2WorldOffset=(t,n,o=1)=>{const{width:e,height:i}=n,s={x:t.x+e*o/2,y:t.y+i*o/2},d={x:n.width/2,y:n.height/2};return{offsetX:(d.x-s.x)/o,offsetY:-(d.y-s.y)/o}},updateBackViewByCanvas2D=(t,n,o,e,i)=>{const{offsetX:s,offsetY:d}=TransferCanvas2WorldOffset(t,o,n);if(i.camera.zoom=n,t){const p=Math.cos(e.rotation),P=Math.sin(e.rotation),g=s*p,h=s*P,{x:r,y:u,z:c}=i.initCameraPosition;i.camera.position.set(r+h,u-g,c+d)}i.camera.updateProjectionMatrix(),i.render()},PointCloudSideView=({currentData:t,config:n,checkMode:o})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),i=React.useRef(null),s=useSize(i),{selectedBox:d,updateSelectedBox:p}=useSingleBox.useSingleBox(),{t:P}=reactI18next.useTranslation(),{backViewUpdateBox:g}=usePointCloudViews.usePointCloudViews(),h=(r,u)=>{if(!e.selectedPointCloudBox||!e.mainViewInstance||!t.url||!e.backViewInstance)return;const{pointCloudInstance:c}=e.backViewInstance,[l,f,x]=r.pointList,[v,m,y]=u.pointList,w=lbAnnotation.MathUtils.getLineCenterPoint([l,x]),C=lbAnnotation.MathUtils.getLineCenterPoint([v,y]),V={x:{x:w.x-C.x,y:w.y-C.y}.x,y:0,z:w.y-C.y},B=lbAnnotation.MathUtils.getLineLength(l,f),b=lbAnnotation.MathUtils.getLineLength(v,m),I=B-b,_=lbAnnotation.MathUtils.getLineLength(f,x),O=lbAnnotation.MathUtils.getLineLength(m,y),L=_-O;let{newBoxParams:a}=c.getNewBoxByBackUpdate(V,L,I,e.selectedPointCloudBox);if(e.mainViewInstance){const{count:j}=e.mainViewInstance.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(a).polygonPointList,[a.center.z-a.depth/2,a.center.z+a.depth/2]);a=__spreadProps(__spreadValues({},a),{count:j})}usePointCloudViews.synchronizeTopView(a,r,e.topViewInstance,e.mainViewInstance),usePointCloudViews.synchronizeSideView(a,r,e.sideViewInstance,t.url),e.mainViewInstance.highlightOriginPointCloud([a]),p(a)};return React.useEffect(()=>{if(i.current){const r={width:i.current.clientWidth,height:i.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:i.current,size:r,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:n,checkMode:o});e.setBackViewInstance(u)}},[]),React.useEffect(()=>{if(!s||!e.backViewInstance)return;const{pointCloud2dOperation:r,pointCloudInstance:u}=e.backViewInstance;r.singleOn("renderZoom",(c,l)=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(l,c,s,e.selectedPointCloudBox,u)}),r.singleOn("dragMove",({currentPos:c,zoom:l})=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(c,l,s,e.selectedPointCloudBox,u)}),r.singleOn("updatePolygonByDrag",c=>{if(e.selectedIDs.length===1&&c.length===1){const{newPolygon:l,originPolygon:f}=c[0];l&&f&&(h(l,f),g(l,f))}})},[e,s]),React.useEffect(()=>{var r;(r=e==null?void 0:e.backViewInstance)==null||r.initSize(s)},[s]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:P("BackView"),toolbar:React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Back})},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:i}),!d&&React__default.default.createElement(index,null)))};var PointCloudBackView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudBackView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var React__default=_interopDefaultLegacy(React);const PointCloudContext=React__default.default.createContext({pointCloudBoxList:[],displayPointCloudList:[],polygonList:[],selectedID:"",selectedIDs:[],valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],setPolygonList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>{},defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{}}),PointCloudProvider=({children:i})=>{const[l,S]=React.useState([]),[c,D]=React.useState([]),[o,f]=React.useState([]),[b,E]=React.useState(!0),[v,H]=React.useState(1),[u,M]=React.useState(),[V,_]=React.useState(),[w,O]=React.useState(),[s,T]=React.useState(),[g,j]=React.useState(""),[I,k]=React.useState(lbAnnotation.EToolName.Rect),N=React.useRef(new lbAnnotation.ActionsHistory).current,[n,P]=React.useState([]),[m,q]=React.useState(""),x=React.useMemo(()=>o.length===1?o[0]:"",[o]),L=React.useMemo(()=>{const d=l.find(t=>t.id===x),C=t=>{const e=l.concat(t);return S(e),e},p=t=>{E(t!==!1)},a=t=>{t===void 0&&f([]),typeof t=="string"&&f([t]),Array.isArray(t)&&f(Array.from(new Set(t)))},r=t=>{o.includes(t)?a(o.filter(e=>e!==t)):a([...o,t])},F=()=>{a(l.map(t=>t.id))},h=l.filter(t=>!n.includes(t.attribute));return{selectedID:x,pointCloudBoxList:l,displayPointCloudList:h,selectedIDs:o,setPointCloudResult:S,setSelectedIDs:a,addPointCloudBox:C,valid:b,selectedPointCloudBox:d,setPointCloudValid:p,addSelectedID:r,selectedAllBoxes:F,topViewInstance:u,setTopViewInstance:M,sideViewInstance:V,setSideViewInstance:_,backViewInstance:w,setBackViewInstance:O,mainViewInstance:s,setMainViewInstance:T,polygonList:c,setPolygonList:D,zoom:v,setZoom:H,history:N,toggleAttributesVisible:t=>{if(n.includes(t))P(n.filter(e=>e!==t));else{const e=n.concat(t);P(e)}},hideAttributes:n,setHideAttributes:P,reRender:(t=h,e=c)=>{t.forEach(A=>{s==null||s.removeObjectByName(A.id)}),u==null||u.updatePolygonList(t,e),s==null||s.generateBoxes(t)},attrPanelLayout:m,setAttrPanelLayout:q,syncAllViewPointCloudColor:t=>{const e=s==null?void 0:s.highlightOriginPointCloud(t);return new Promise(A=>{e==null||e.then(y=>{[u].forEach(R=>{var B;y&&((B=R==null?void 0:R.pointCloudInstance)==null||B.updateColor(y),A({color:y}))})})})},defaultAttribute:g,setDefaultAttribute:j,pointCloudPattern:I,setPointCloudPattern:k}},[b,o,l,c,u,V,w,s,v,n,m,g,I]),z=()=>{const d=l.filter(r=>n.includes(r.attribute)),{setSelectedIDs:C,reRender:p}=L,a=d.map(r=>r.id);a.length>0&&C(o.filter(r=>!a.includes(r))),p()};return React.useEffect(()=>{var d;z(),(d=u==null?void 0:u.pointCloud2dOperation)==null||d.setHiddenAttributes(n)},[n]),React__default.default.createElement(PointCloudContext.Provider,{value:L},i)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(i,r,n)=>r in i?__defProp(i,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[r]=n,__spreadValues=(i,r)=>{for(var n in r||(r={}))__hasOwnProp.call(r,n)&&__defNormalProp(i,n,r[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(r))__propIsEnum.call(r,n)&&__defNormalProp(i,n,r[n]);return i},__spreadProps=(i,r)=>__defProps(i,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:i,config:r,checkMode:n,configString:
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(i,r,n)=>r in i?__defProp(i,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[r]=n,__spreadValues=(i,r)=>{for(var n in r||(r={}))__hasOwnProp.call(r,n)&&__defNormalProp(i,n,r[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(r))__propIsEnum.call(r,n)&&__defNormalProp(i,n,r[n]);return i},__spreadProps=(i,r)=>__defProps(i,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:i,config:r,checkMode:n,configString:k,imgIndex:h})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:_,selectNextBox:B,selectPrevBox:S,updateSelectedBox:P,deleteSelectedPointCloudBoxAndPolygon:I}=useSingleBox.useSingleBox(),{clearAllResult:v,updatePointCloudPattern:V}=useStatus.useStatus(),E=index.jsonParser(i.result),{copySelectedBoxes:O,pasteSelectedBoxes:A,copiedBoxes:q}=useBoxes.useBoxes({config:r}),{toolInstanceRef:a}=annotation.useCustomToolInstance({basicInfo:E}),{updateRotate:b}=useRotate.useRotate({currentData:i}),{updatePointCloudData:y,topViewSelectedChanged:j}=usePointCloudViews.usePointCloudViews(),{redo:C,undo:w,pushHistoryWithList:L,pushHistoryUnderUpdatePolygon:R}=useHistory.useHistory(),{syncThreeViewsAttribute:x}=useAttribute.useAttribute(),{syncAllViewsConfig:T,reRenderTopViewRange:D}=useConfig.useConfig(),{selectedPolygon:g}=usePolygon.usePolygon(),{t:f}=reactI18next.useTranslation(),p=e=>{var t;const{topViewInstance:s}=o;!s||(t=s.pointCloud2dOperation)==null||t.updateSelectedPolygonsPoints(e)},N=(e,t)=>{var s;const{topViewInstance:u,mainViewInstance:l}=o;if(!u)return;const{pointCloud2dOperation:c}=u;switch(e){case"q":{b(2);break}case"e":b(-2);break;case"g":b(180);break;case"u":{const d=c.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;V(d);const H={[lbAnnotation.EToolName.Polygon]:f("PolygonPattern"),[lbAnnotation.EToolName.Rect]:f("RectPattern")};antd.message.success(f("ChangePatternMsg",{pattern:H[d]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize(!0);break;case"-":l==null||l.updatePointSize(!1);break;case"v":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){S();break}B(),t.preventDefault();break;case"f":_();break;case"arrowup":p({y:-1});break;case"arrowdown":p({y:1});break;case"arrowleft":p({x:-1});break;case"arrowright":p({x:1});break;case"delete":I();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(t.keyCode,r.attributeList);d!==void 0&&a.current.setDefaultAttribute(d)}return}}},K=(e,t)=>{switch(e){case"c":O();break;case"v":A();break;case"a":o.selectedAllBoxes();break;case"z":{t.shiftKey?C():w();break}}},m=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||n===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){K(t,e);return}N(t,e)};return React.useEffect(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[o,q,r,o.pointCloudBoxList,o.polygonList]),React.useEffect(()=>{T(r)},[k]),React.useEffect(()=>{(r==null?void 0:r.radius)&&D(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{y==null||y()},[h,o.mainViewInstance]),React.useEffect(()=>{a.current.exportData=()=>[o.pointCloudBoxList,{valid:o.valid}],a.current.exportCustomData=()=>{var e;return{resultPolygon:(e=o.polygonList)!=null?e:[]}},a.current.setDefaultAttribute=e=>{x(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=P(t);o.mainViewInstance&&j(t,s)}g&&R(__spreadProps(__spreadValues({},g),{attribute:e}))},a.current.setSubAttribute=(e,t)=>{var s;const u=o.selectedPointCloudBox;if(u){const l=(s=u==null?void 0:u.subAttribute)!=null?s:{};u.subAttribute=__spreadProps(__spreadValues({},l),{[e]:t}),P(u)}},a.current.clearResult=()=>{v==null||v()},a.current.redo=()=>{C()},a.current.undo=()=>{w()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&v()})},a.current.setForbidOperation=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&o.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)}},[o.pointCloudBoxList,o.selectedID,o.valid,o.polygonList,o.mainViewInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{L({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||n)return;const s=c=>{x(c)},u=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return t.on("syncAttribute",s),t.on("messageError",u),t.on("messageInfo",l),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",u),t.unbind("messageInfo",l)}},[o.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,s,e=1)=>{const{width:
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,s,e=1)=>{const{width:c,height:r}=s,n={x:t.x+c*e/2,y:t.y+r*e/2},o={x:s.width/2,y:s.height/2};return{offsetX:(o.x-n.x)/e,offsetY:-(o.y-n.y)/e}},updateSideViewByCanvas2D=(t,s,e,c,r)=>{const{offsetX:n,offsetY:o}=TransferCanvas2WorldOffset(t,e,s);if(r.camera.zoom=s,t){const d=Math.cos(c.rotation),i=Math.sin(c.rotation),u=n*d,a=n*i,{x:l,y:f,z:x}=r.initCameraPosition;r.camera.position.set(l-u,f-a,x+o)}r.camera.updateProjectionMatrix(),r.render()},PointCloudSideView=({config:t,checkMode:s})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:c}=usePointCloudViews.usePointCloudViews(),{selectedBox:r}=useSingleBox.useSingleBox(),n=React.useRef(null),o=useSize(n),{t:d}=reactI18next.useTranslation();return React.useEffect(()=>{if(n.current){const i={width:n.current.clientWidth,height:n.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:n.current,size:i,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:t,checkMode:s});e.setSideViewInstance(u)}},[]),React.useEffect(()=>{if(!o||!e.sideViewInstance)return;const{pointCloud2dOperation:i,pointCloudInstance:u}=e.sideViewInstance;i.singleOn("renderZoom",(a,l)=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(l,a,o,e.selectedPointCloudBox,u)}),i.singleOn("dragMove",({currentPos:a,zoom:l})=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(a,l,o,e.selectedPointCloudBox,u)}),i.singleOn("updatePolygonByDrag",a=>{if(e.selectedIDs.length===1&&a.length===1){const{newPolygon:l,originPolygon:f}=a[0];c(l,f)}})},[e,o]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(o)},[o]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:d("SideView"),toolbar:React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:n}),!r&&React__default.default.createElement(index,null)))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
@@ -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"),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");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var 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,o,n)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,__spreadValues=(e,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(e,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(e,n,o[n]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o));const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(e,o,n=1)=>{const{width:c,height:p}=o,g={x:e.x+c*n/2,y:e.y+p*n/2},f={x:o.width/2,y:o.height/2};return{offsetX:(f.x-g.x)/n,offsetY:-(f.y-g.y)/n}},TopViewToolbar=({currentData:e})=>{const{zoom:o,zoomIn:n,zoomOut:c,initialPosition:p}=useZoom.useZoom(),{selectNextBox:g,selectPrevBox:f}=useSingleBox.useSingleBox(),{updateRotate:u}=useRotate.useRotate({currentData:e}),t=2,s=()=>{u(-t)},v=()=>{u(t)},w=()=>{u(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:v,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:s,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:w,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{f()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{g()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(index$2.ZoomController,{initialPosition:p,zoomIn:n,zoomOut:c,zoom:o}))},ZAxisSlider=({setZAxisLimit:e,zAxisLimit:o,checkMode:n})=>n?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:o,onAfterChange:c=>{e(c)}})),PointCloudTopView=({currentData:e,imgList:o,stepInfo:n,drawLayerSlot:c,checkMode:p})=>{const[g,f]=React.useState({zoom:1,currentPos:{x:0,y:0}}),u=React.useRef(null),t=React__default.default.useContext(PointCloudContext.PointCloudContext),s=useSize(u),v=index.jsonParser(n.config),{setZoom:w}=useZoom.useZoom(),{addPolygon:_,deletePolygon:
|
|
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"),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");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var 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,o,n)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,__spreadValues=(e,o)=>{for(var n in o||(o={}))__hasOwnProp.call(o,n)&&__defNormalProp(e,n,o[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(o))__propIsEnum.call(o,n)&&__defNormalProp(e,n,o[n]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o));const{EPolygonPattern}=lbAnnotation.cTool,TransferCanvas2WorldOffset=(e,o,n=1)=>{const{width:c,height:p}=o,g={x:e.x+c*n/2,y:e.y+p*n/2},f={x:o.width/2,y:o.height/2};return{offsetX:(f.x-g.x)/n,offsetY:-(f.y-g.y)/n}},TopViewToolbar=({currentData:e})=>{const{zoom:o,zoomIn:n,zoomOut:c,initialPosition:p}=useZoom.useZoom(),{selectNextBox:g,selectPrevBox:f}=useSingleBox.useSingleBox(),{updateRotate:u}=useRotate.useRotate({currentData:e}),t=2,s=()=>{u(-t)},v=()=>{u(t)},w=()=>{u(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("span",{onClick:v,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:s,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:w,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{f()},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{g()},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$1.FooterDivider,null),React__default.default.createElement(index$2.ZoomController,{initialPosition:p,zoomIn:n,zoomOut:c,zoom:o}))},ZAxisSlider=({setZAxisLimit:e,zAxisLimit:o,checkMode:n})=>n?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:o,onAfterChange:c=>{e(c)}})),PointCloudTopView=({currentData:e,imgList:o,stepInfo:n,drawLayerSlot:c,checkMode:p})=>{const[g,f]=React.useState({zoom:1,currentPos:{x:0,y:0}}),u=React.useRef(null),t=React__default.default.useContext(PointCloudContext.PointCloudContext),s=useSize(u),v=index.jsonParser(n.config),{setZoom:w}=useZoom.useZoom(),{hideAttributes:b}=t,{addPolygon:_,deletePolygon:E}=usePolygon.usePolygon(),{deletePointCloudBox:q,changeValidByID:j}=useSingleBox.useSingleBox(),[x,S]=React.useState(10),{t:A}=reactI18next.useTranslation(),P=usePointCloudViews.usePointCloudViews();return React.useLayoutEffect(()=>{if(!t.topViewInstance&&u.current&&(e==null?void 0:e.url)&&(e==null?void 0:e.result)){const l={width:u.current.clientWidth,height:u.current.clientHeight},d=new lbAnnotation.PointCloudAnnotation({container:u.current,size:l,pcdPath:e.url,config:v,checkMode:p});t.setTopViewInstance(d)}},[e]),React.useEffect(()=>{if(!s||!t.topViewInstance||!t.sideViewInstance)return;const{pointCloud2dOperation:l}=t.topViewInstance;l.singleOn("polygonCreated",(i,a)=>{if(l.pattern===EPolygonPattern.Normal||!(e==null?void 0:e.url)){const m=__spreadProps(__spreadValues({},i),{pointList:i.pointList.map(r=>lbUtils.PointCloudUtils.transferCanvas2World(r,s))});_(m),t.setSelectedIDs(b.includes(i.attribute)?"":i.id);return}P.topViewAddBox({newPolygon:i,size:s,imgList:o,trackConfigurable:v.trackConfigurable,zoom:a})}),l.singleOn("deletedObject",({id:i})=>{q(i),E(i)}),l.singleOn("deleteSelectedIDs",()=>{t.setSelectedIDs([])}),l.singleOn("addSelectedIDs",i=>{t.addSelectedID(i)}),l.singleOn("setSelectedIDs",i=>{t.setSelectedIDs(i)}),l.singleOn("updatePolygonByDrag",i=>{var a;(a=P.topViewUpdateBox)==null||a.call(P,i,s)});const d=i=>{var a;const m=j(i);m&&t.syncAllViewPointCloudColor(m),t.polygonList.find(r=>r.id===i)&&((a=t.topViewInstance)==null||a.pointCloud2dOperation.setPolygonValidAndRender(i,!0))};return l.on("validUpdate",d),()=>{l.unbind("validUpdate",d)}},[t,s,e,P,t.polygonList]),React.useEffect(()=>{var l,d;if(!(s==null?void 0:s.width)||!t.topViewInstance)return;const i=(d=(l=v==null?void 0:v.attributeList)==null?void 0:l[0])==null?void 0:d.value;i&&t.topViewInstance.pointCloud2dOperation.setDefaultAttribute(i),t.topViewInstance.initSize(s),t.topViewInstance.updatePolygonList(t.displayPointCloudList,t.polygonList);const{topViewInstance:{pointCloudInstance:a,pointCloud2dOperation:m}}=t;m.singleOn("renderZoom",(r,C)=>{const{offsetX:y,offsetY:V}=TransferCanvas2WorldOffset(C,s,r);if(a.camera.zoom=r,C){const{x:I,y:O,z:h}=a.initCameraPosition;a.camera.position.set(I+V,O-y,h)}a.camera.updateProjectionMatrix(),a.render(),w(r),f({zoom:r,currentPos:C})}),m.singleOn("dragMove",({currentPos:r,zoom:C})=>{const{offsetX:y,offsetY:V}=TransferCanvas2WorldOffset(r,s,C);a.camera.zoom=C;const{x:I,y:O,z:h}=a.initCameraPosition;a.camera.position.set(I+V,O-y,h),a.render(),f({zoom:C,currentPos:r})})},[s,t.topViewInstance]),React.useEffect(()=>{var l,d;(d=(l=t.topViewInstance)==null?void 0:l.pointCloudInstance)==null||d.applyZAxisPoints(x)},[x]),React.useEffect(()=>{P.topViewSelectedChanged()},[t.selectedIDs]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:A("TopView"),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:e})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:u},c==null?void 0:c(g)),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:p,config:v}),React__default.default.createElement(ZAxisSlider,{checkMode:p,zAxisLimit:x,setZAxisLimit:S}),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"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);const useBoxes=({config:t})=>{const{selectedIDs:l,pointCloudBoxList:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);const useBoxes=({config:t})=>{const{selectedIDs:l,pointCloudBoxList:c,displayPointCloudList:s,setPointCloudResult:p,syncAllViewPointCloudColor:f}=React.useContext(PointCloudContext.PointCloudContext),[o,a]=React.useState([]),{pointCloudBoxListUpdated:d}=usePointCloudViews.usePointCloudViews(),{t:r,i18n:C}=reactI18next.useTranslation(),x=n=>t.trackConfigurable!==!0?!1:c.some(u=>n.some(e=>e.trackID===u.trackID)),i=React.useMemo(()=>s.filter(n=>l.includes(n.id)),[l,s]),D=React.useCallback(()=>{i.length>0?a(___default.default.cloneDeep(i)):(a([]),antd.message.error(r("CopyEmptyInPointCloud")))},[l,s,C.language]),P=React.useCallback(()=>{if(o.length===0){antd.message.error(r("PasteEmptyInPointCloud"));return}const n=x(o),u=e=>{p(e),d==null||d(e),a([]),f(e)};if(n)antd.Modal.confirm({title:r("HasDuplicateIDHeader"),content:r("HasDuplicateIDMsg"),onOk:()=>{const e=c.filter(g=>!o.find(I=>I.trackID===g.trackID)).concat(o);u(e)}});else{const e=[...s,...o];u(e)}},[o,s,C.language]);return{copySelectedBoxes:D,pasteSelectedBoxes:P,copiedBoxes:o,selectedBoxes:i}};exports.useBoxes=useBoxes;
|
|
@@ -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"),
|
|
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"),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((d,e)=>{var s=l=>{try{c(i.next(l))}catch(h){e(h)}},g=l=>{try{c(i.throw(l))}catch(h){e(h)}},c=l=>l.done?d(l.value):Promise.resolve(l.value).then(s,g);c((i=i.apply(t,o)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPolygon2PointCloud=(t,o,i,d,e)=>{const[s,g,c,l]=t.pointList.map(P=>lbUtils.PointCloudUtils.transferCanvas2World(P,o)),h=lbAnnotation.MathUtils.getLineCenterPoint([s,c]),f=lbAnnotation.MathUtils.getLineLength(s,g),v=lbAnnotation.MathUtils.getLineLength(g,c),V=lbAnnotation.MathUtils.getRadiusFromQuadrangle(t.pointList);let w=0,m=1,B={};if(i){const P=i.getSensesPointZAxisInPolygon([s,g,c,l]);w=(P.maxZ+P.minZ)/2,m=P.maxZ-P.minZ,B={count:P.zCount}}d&&(w=d.center.z,m=d.depth);const U={center:{x:h.x,y:h.y,z:w},width:v,height:f,depth:m,rotation:V,id:t.id},C=__spreadValues(d?__spreadValues(__spreadValues({},d),U):__spreadProps(__spreadValues({},U),{attribute:"",valid:!0}),B);return e&&Object.assign(C,e),C},sideViewPolygon2PointCloud=(t,o,i,d)=>{const[e,s,g]=t.pointList,[c,l,h]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([e,g]),v=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),w={x:{x:f.x-v.x,y:f.y-v.y}.x,y:0,z:f.y-v.y},m=lbAnnotation.MathUtils.getLineLength(e,s),B=lbAnnotation.MathUtils.getLineLength(c,l),U=m-B,C=lbAnnotation.MathUtils.getLineLength(s,g),P=lbAnnotation.MathUtils.getLineLength(l,h),D=C-P,{newBoxParams:b}=d.getNewBoxBySideUpdate(w,D,U,i);return b},backViewPolygon2PointCloud=(t,o,i,d)=>{const[e,s,g]=t.pointList,[c,l,h]=o.pointList,f=lbAnnotation.MathUtils.getLineCenterPoint([e,g]),v=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),w={x:{x:f.x-v.x,y:f.y-v.y}.x,y:0,z:f.y-v.y},m=lbAnnotation.MathUtils.getLineLength(e,s),B=lbAnnotation.MathUtils.getLineLength(c,l),U=m-B,C=lbAnnotation.MathUtils.getLineLength(s,g),P=lbAnnotation.MathUtils.getLineLength(l,h),D=C-P;let{newBoxParams:b}=d.getNewBoxByBackUpdate(w,D,U,i);return b},synchronizeSideView=(t,o,i,d)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:s}=i;s.loadPCDFileByBox(d,t,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:g}=s.updateOrthoCamera(t,lbUtils.EPerspectiveView.Left);s.setInitCameraPosition(g);const{polygon2d:c,zoom:l}=s.getBoxSidePolygon2DCoordinate(t);s.camera.zoom=l,s.camera.updateProjectionMatrix(),s.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:c,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},synchronizeBackView=(t,o,i,d)=>{if(!i)return;const{pointCloud2dOperation:e,pointCloudInstance:s}=i;s.loadPCDFileByBox(d,t,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:g}=s.updateOrthoCamera(t,lbUtils.EPerspectiveView.Back);s.setInitCameraPosition(g);const{polygon2d:c,zoom:l}=s.getBoxBackPolygon2DCoordinate(t);s.camera.zoom=l,s.camera.updateProjectionMatrix(),s.render(),e.initPosition(),e.zoomChangeOnCenter(l),e.setResultAndSelectedID([{id:o.id,valid:t.valid,pointList:c,textAttribute:"",isRect:!0,attribute:t.attribute}],o.id)},synchronizeTopView=(t,o,i,d)=>{var e;if(!i||!d)return;d.generateBox(t,o.id),d.updateCameraByBox(t,lbUtils.EPerspectiveView.Top),d.render();const{pointCloud2dOperation:s,pointCloudInstance:g}=i,{polygon2d:c}=g.getBoxTopPolygon2DCoordinate(t),l=[...s.polygonList],h=l.find(f=>f.id===o.id);h?h.pointList=c:l.push({id:o.id,pointList:c,textAttribute:"",isRect:!0,valid:(e=t.valid)!=null?e:!0}),s.setResultAndSelectedID(l,o.id)},usePointCloudViews=()=>{const t=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:o,sideViewInstance:i,backViewInstance:d,mainViewInstance:e,addPointCloudBox:s,setSelectedIDs:g,selectedIDs:c,pointCloudBoxList:l,hideAttributes:h}=t,{addHistory:f,initHistory:v,pushHistoryUnderUpdatePolygon:V}=useHistory.useHistory(),{selectedPolygon:w}=usePolygon.usePolygon(),{updateSelectedBox:m,updateSelectedBoxes:B,getPointCloudByID:U}=useSingleBox.useSingleBox(),{currentData:C,config:P}=ctx.useSelector(n=>{const{stepList:u,step:p,imgList:r,imgIndex:a}=n.annotation;return{currentData:r[a],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,u).config)}}),D=ctx.useDispatch(),{selectedBox:b}=useSingleBox.useSingleBox(),{t:A}=reactI18next.useTranslation(),I=b==null?void 0:b.info;if(!o||!i||!d)return{topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:k}=o,M=n=>{e==null||e.generateBox(n),e==null||e.controls.update(),e==null||e.render()},T=({newPolygon:n,size:u,imgList:p,trackConfigurable:r,zoom:a})=>{var y;const x={attribute:(y=o.pointCloud2dOperation.defaultAttribute)!=null?y:""};r===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:l})});const L=topViewPolygon2PointCloud(n,u,k,void 0,x),_=o==null?void 0:o.pointCloud2dOperation,S=L;if((P==null?void 0:P.lowerLimitPointsNumInBox)&&typeof L.count=="number"&&L.count<P.lowerLimitPointsNumInBox){antd.message.info(A("LowerLimitPointsNumInBox",{num:P.lowerLimitPointsNumInBox})),_.deletePolygon(L.id);return}const H=h.includes(n.attribute),F=s(S);H?g([]):(g(S.id),_.setSelectedIDs([n.id]),O(PointCloudView.Top,n,S,a,F)),f({newBoxParams:S})},z=(n,u)=>{const p=n!=null?n:b==null?void 0:b.info,r=o==null?void 0:o.pointCloud2dOperation;if(r.setSelectedIDs(c),c.length===0||!r)return;const a=r.selectedPolygon;if(c.length===1&&p){O(PointCloudView.Top,a,p,void 0,u);return}},j=(n,u,p)=>{if(I){let r,a;switch(p){case PointCloudView.Back:r=backViewPolygon2PointCloud;break;case PointCloudView.Side:r=sideViewPolygon2PointCloud;break;default:r=sideViewPolygon2PointCloud;break}if(a=r(n,u,I,i.pointCloudInstance),e){const{count:x}=e.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(a).polygonPointList,[a.center.z-a.depth/2,a.center.z+a.depth/2]);a=__spreadProps(__spreadValues({},a),{count:x})}const y=m(a);return O(p,n,a,void 0,y),y}},R=(n,u)=>{j(n,u,PointCloudView.Side)},q=(n,u)=>{j(n,u,PointCloudView.Back)},E=(n,u)=>{if(w){const r=n[0].newPolygon;r.pointList=r.pointList.map(a=>lbUtils.PointCloudUtils.transferCanvas2World(a,u)),V(n[0].newPolygon);return}const p=n.map(({newPolygon:r})=>{const a=U(r.id);return topViewPolygon2PointCloud(r,u,o.pointCloudInstance,a)});if(p.length===1){const{newPolygon:r}=n[0],a=B(p);O(PointCloudView.Top,r,p[0],void 0,a)}else{const r=B(p);r&&t.syncAllViewPointCloudColor(r)}},O=(n,u,p,r,a)=>__async(void 0,null,function*(){const y=C==null?void 0:C.url;a&&(yield t.syncAllViewPointCloudColor(a));const x={[PointCloudView.Side]:()=>{synchronizeSideView(p,u,i,y)},[PointCloudView.Back]:()=>{d&&synchronizeBackView(p,u,d,y)},[PointCloudView.Top]:()=>{synchronizeTopView(p,u,o,e)}};Object.keys(x).forEach(L=>{L!==n&&x[L]()}),r&&(e==null||e.updateCameraZoom(r)),M(p)});return{topViewAddBox:T,topViewSelectedChanged:z,topViewUpdateBox:E,sideViewUpdateBox:R,backViewUpdateBox:q,pointCloudBoxListUpdated:n=>{o.updatePolygonList(n),e==null||e.generateBoxes(n)},initPointCloud3d:n=>{if(!e)return;const u={left:-n.width/2,right:n.width/2,top:n.height/2,bottom:-n.height/2,near:100,far:-100};e.initOrthographicCamera(u),e.initRenderer(),e.render()},updatePointCloudData:()=>__async(void 0,null,function*(){var n,u,p,r,a,y;if(!(C==null?void 0:C.url)||!e)return;actionCreators.SetPointCloudLoading(D,!0),yield e.loadPCDFile(C.url,(n=P==null?void 0:P.radius)!=null?n:DEFAULT_RADIUS),l.forEach(S=>{e==null||e.removeObjectByName(S.id)});let x=[],L=[];C.result?(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(C.result),L=lbUtils.PointCloudUtils.getPolygonListFromResultList(C.result),x.forEach(S=>{e==null||e.generateBox(S)}),t.syncAllViewPointCloudColor(x),t.setPointCloudResult(x),t.setPolygonList(L)):(t.setPointCloudResult([]),t.setPolygonList([])),v({pointCloudBoxList:x,polygonList:L}),e.updateTopCamera();const _=(p=(u=index.jsonParser(C.result))==null?void 0:u.valid)!=null?p:!0;t.setPointCloudValid(_),(r=t.sideViewInstance)==null||r.clearAllData(),(a=t.backViewInstance)==null||a.clearAllData(),o.updateData(C.url,C.result,{radius:(y=P==null?void 0:P.radius)!=null?y:DEFAULT_RADIUS}),actionCreators.SetPointCloudLoading(D,!1)})}};exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),PointCloudContext=require("../PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,l,n)=>l in e?__defProp(e,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[l]=n,__spreadValues=(e,l)=>{for(var n in l||(l={}))__hasOwnProp.call(l,n)&&__defNormalProp(e,n,l[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(l))__propIsEnum.call(l,n)&&__defNormalProp(e,n,l[n]);return e},__spreadProps=(e,l)=>__defProps(e,__getOwnPropDescs(l));const{ESortDirection}=lbAnnotation.cAnnotation,useSingleBox=()=>{const{pointCloudBoxList:e,setPointCloudResult:l,topViewInstance:n,backViewInstance:P,sideViewInstance:x,selectedIDs:c,selectedID:v,mainViewInstance:s,setSelectedIDs:w,syncAllViewPointCloudColor:y,polygonList:O}=React.useContext(PointCloudContext.PointCloudContext),{selectedPolygon:u,updateSelectedPolygon:I,updatePolygonValidByID:m,deletePolygon:D}=usePolygon.usePolygon(),{pushHistoryWithList:C}=useHistory.useHistory(),d=React.useMemo(()=>{const o=e.findIndex(t=>t.id===v);if(o>-1)return{info:e[o],index:o}},[v,e]),g=React.useCallback(o=>{if(d==null?void 0:d.info){e.splice(d.index,1,___default.default.merge(d.info,o));const t=___default.default.cloneDeep(e);return l(t),C({pointCloudBoxList:t}),t}return e},[v,e]),V=React.useCallback((o,t)=>{const i=e.findIndex(r=>r.id===t);if(i>-1){e.splice(i,1,___default.default.merge(e[i],o));const r=___default.default.cloneDeep(e);return l(r),r}return e},[e]),p=React.useCallback(o=>{n==null||n.pointCloud2dOperation.setPolygonValidAndRender(o,!0),x==null||x.pointCloud2dOperation.setPolygonValidAndRender(o,!0),P==null||P.pointCloud2dOperation.setPolygonValidAndRender(o,!0)},[n,x,P]),h=React.useCallback(()=>{if(d==null?void 0:d.info){const{id:o,valid:t=!0}=d.info,i=g({valid:!t});y(i),p(o)}u&&(I(__spreadProps(__spreadValues({},u),{valid:!u.valid})),n==null||n.pointCloud2dOperation.setPolygonValidAndRender(u.id,!0))},[p,d,u]),L=React.useCallback(o=>{const t=e.find(i=>i.id===o);if(t){const{id:i,valid:r=!0}=t,a=V({valid:!r},i);return p(i),a}m(o)},[p,e,O]),B=React.useCallback((o=ESortDirection.ascend)=>{if(!n||c.length>1)return;const{pointCloud2dOperation:t}=n,i=t.switchToNextPolygon(o);i&&w(i)},[n]),S=()=>{B(ESortDirection.descend)},b=o=>{const t=e.filter(i=>i.id!==o);l(t),s==null||s.removeObjectByName(o),s==null||s.render(),y(t)},j=()=>{d&&(b(d.info.id),n==null||n.pointCloud2dOperation.deletePolygon(d.info.id)),u&&(D(u.id),n==null||n.pointCloud2dOperation.deletePolygon(u.id))},A=React.useMemo(()=>e.filter(o=>c.includes(o.id)),[c,e]),k=React.useCallback(o=>{const t=___default.default.cloneDeep(e);let i=!1;if(o.forEach(r=>{const a=t.findIndex(f=>f.id===r.id);if(a>-1){const f=___default.default.merge(t[a],r);t.splice(a,1,f),s==null||s.generateBox(f),i=!0}}),i)return l(t),C({pointCloudBoxList:t}),s==null||s.render(),t},[c,e]),q=React.useCallback(o=>e.find(t=>t.id===o),[e]);return{selectedBox:d,updateSelectedBox:g,changeSelectedBoxValid:h,changeValidByID:L,selectNextBox:B,selectPrevBox:S,deletePointCloudBox:b,selectedBoxes:A,updateSelectedBoxes:k,getPointCloudByID:q,deleteSelectedPointCloudBoxAndPolygon:j}};exports.useSingleBox=useSingleBox;
|
|
@@ -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:t,mainViewInstance:e,pointCloudBoxList:
|
|
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:t,mainViewInstance:e,pointCloudBoxList:i,setPointCloudResult:s,setPolygonList:u,pointCloudPattern:l,setPointCloudPattern:r,syncAllViewPointCloudColor:a}=React.useContext(PointCloudContext.PointCloudContext),{pushHistoryWithList:c}=useHistory.useHistory();return{clearAllResult:()=>{i.forEach(o=>{e==null||e.removeObjectByName(o.id)}),e==null||e.render(),s([]),u([]),t==null||t.pointCloud2dOperation.clearActiveStatus(),t==null||t.pointCloud2dOperation.clearResult(),a([]),c({pointCloudBoxList:[],polygonList:[]})},updatePointCloudPattern:o=>{const n=t==null?void 0:t.pointCloud2dOperation;if(!!n&&(n.clearActiveStatus(),o!==l))switch(o){case EToolName.Rect:n.setPattern(EPolygonPattern.Rect),r(EToolName.Rect);break;case EToolName.Polygon:n.setPattern(EPolygonPattern.Normal),r(EToolName.Polygon);break}},pointCloudPattern:l}};exports.useStatus=useStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({imgList:e,drawLayerSlot:a,checkMode:t})=>e.length===0?null:React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:t}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:l=>l.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:a,checkMode:t}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PointCloudView=({imgList:e,drawLayerSlot:a,checkMode:t})=>e.length===0?null:React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:t}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:l=>l.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud2DView,null),React__default.default.createElement(PointCloud3DView,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right")},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:a,checkMode:t}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","right-bottom")},React__default.default.createElement(PointCloudSideView,null),React__default.default.createElement(PointCloudBackView,null)))),React__default.default.createElement(index.AnnotatedAttributesPanelFixedRight,null)))),mapStateToProps=e=>({imgList:e.annotation.imgList});var PointCloudView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
|
package/dist/index.css
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
position: relative;
|
|
22
22
|
z-index: 10;
|
|
23
23
|
border-top: 1px solid #e2e2e2;
|
|
24
|
+
border-left: 1px solid #e2e2e2;
|
|
24
25
|
}
|
|
25
26
|
.bee-layout__side .ant-collapse-borderless > .ant-collapse-item {
|
|
26
27
|
border-bottom: 1px solid #eee;
|
|
@@ -1062,6 +1063,44 @@
|
|
|
1062
1063
|
min-width: 116px;
|
|
1063
1064
|
}
|
|
1064
1065
|
|
|
1066
|
+
.bee-annotated-attribute {
|
|
1067
|
+
width: 240px;
|
|
1068
|
+
background: white;
|
|
1069
|
+
}
|
|
1070
|
+
.bee-annotated-attribute__popover .ant-popover-inner-content {
|
|
1071
|
+
padding: 0;
|
|
1072
|
+
}
|
|
1073
|
+
.bee-annotated-attribute__pin {
|
|
1074
|
+
cursor: pointer;
|
|
1075
|
+
color: #666fff;
|
|
1076
|
+
}
|
|
1077
|
+
.bee-annotated-attribute__pin .anticon {
|
|
1078
|
+
margin-right: 4px;
|
|
1079
|
+
}
|
|
1080
|
+
.bee-annotated-attribute__text {
|
|
1081
|
+
display: flex;
|
|
1082
|
+
justify-content: space-between;
|
|
1083
|
+
padding: 8px 20px;
|
|
1084
|
+
color: #333;
|
|
1085
|
+
}
|
|
1086
|
+
.bee-annotated-attribute__item {
|
|
1087
|
+
height: 40px;
|
|
1088
|
+
line-height: 40px;
|
|
1089
|
+
padding: 12px;
|
|
1090
|
+
display: flex;
|
|
1091
|
+
align-items: center;
|
|
1092
|
+
}
|
|
1093
|
+
.bee-annotated-attribute__item .anticon {
|
|
1094
|
+
cursor: pointer;
|
|
1095
|
+
}
|
|
1096
|
+
.bee-annotated-attribute__item .anticon-eye,
|
|
1097
|
+
.bee-annotated-attribute__item .anticon-caret-down {
|
|
1098
|
+
margin-right: 8px;
|
|
1099
|
+
}
|
|
1100
|
+
.bee-annotated-attribute__item__text {
|
|
1101
|
+
flex: 1;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1065
1104
|
/** VideoPlayer样式 start */
|
|
1066
1105
|
.bee-video-wrapper {
|
|
1067
1106
|
width: 100%;
|
|
@@ -1201,6 +1240,10 @@
|
|
|
1201
1240
|
overflow: hidden;
|
|
1202
1241
|
flex: 1;
|
|
1203
1242
|
}
|
|
1243
|
+
.bee-point-cloud-wrapper .bee-point-cloud-content {
|
|
1244
|
+
flex: 1;
|
|
1245
|
+
display: flex;
|
|
1246
|
+
}
|
|
1204
1247
|
.bee-point-cloud-wrapper .bee-point-cloud-container {
|
|
1205
1248
|
position: relative;
|
|
1206
1249
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../utils/index.js"),reducer=require("./reducer.js");const stepConfigSelector=({annotation:r})=>{var e;const{stepList:t,step:s}=r;return index.jsonParser((e=reducer.getStepConfig(t,s))==null?void 0:e.config)};exports.stepConfigSelector=stepConfigSelector;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';
|
|
2
|
-
import { PointCloud, PointCloudAnnotation, ActionsHistory, EToolName } from '@labelbee/lb-annotation';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { PointCloud, PointCloudAnnotation, ActionsHistory, EToolName } from '@labelbee/lb-annotation';
|
|
4
4
|
interface IPointCloudContextInstances {
|
|
5
5
|
topViewInstance?: PointCloudAnnotation;
|
|
6
6
|
sideViewInstance?: PointCloudAnnotation;
|
|
@@ -11,8 +11,10 @@ interface IPointCloudContextInstances {
|
|
|
11
11
|
setBackViewInstance: (instance: PointCloudAnnotation) => void;
|
|
12
12
|
setMainViewInstance: (instance: PointCloud) => void;
|
|
13
13
|
}
|
|
14
|
+
declare type AttrPanelLayout = '' | 'left' | 'right';
|
|
14
15
|
export interface IPointCloudContext extends IPointCloudContextInstances {
|
|
15
16
|
pointCloudBoxList: IPointCloudBoxList;
|
|
17
|
+
displayPointCloudList: IPointCloudBoxList;
|
|
16
18
|
selectedIDs: string[];
|
|
17
19
|
setSelectedIDs: (ids?: string[] | string) => void;
|
|
18
20
|
valid: boolean;
|
|
@@ -28,6 +30,11 @@ export interface IPointCloudContext extends IPointCloudContextInstances {
|
|
|
28
30
|
zoom: number;
|
|
29
31
|
setZoom: (zoom: number) => void;
|
|
30
32
|
history: ActionsHistory;
|
|
33
|
+
hideAttributes: string[];
|
|
34
|
+
toggleAttributesVisible: (attribute: string) => void;
|
|
35
|
+
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[]) => void;
|
|
36
|
+
attrPanelLayout: AttrPanelLayout;
|
|
37
|
+
setAttrPanelLayout: (layout: AttrPanelLayout) => void;
|
|
31
38
|
syncAllViewPointCloudColor: (newPointCloudList?: IPointCloudBox[]) => void;
|
|
32
39
|
defaultAttribute: string;
|
|
33
40
|
setDefaultAttribute: (defaultAttribute: string) => void;
|
|
@@ -4,22 +4,9 @@
|
|
|
4
4
|
* @createdate 2022-08-17
|
|
5
5
|
*/
|
|
6
6
|
import { PointCloudAnnotation, PointCloud } from '@labelbee/lb-annotation';
|
|
7
|
-
import { IPointCloudBox,
|
|
7
|
+
import { IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';
|
|
8
8
|
import { ISize } from '@/types/main';
|
|
9
9
|
import { IFileItem } from '@/types/data';
|
|
10
|
-
/**
|
|
11
|
-
* Get the coordinate from canvas2d-coordinate to world coordinate
|
|
12
|
-
*/
|
|
13
|
-
export declare const transferCanvas2World: (currentPos: {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
}, size: {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
}) => {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
};
|
|
23
10
|
export declare const topViewPolygon2PointCloud: (newPolygon: any, size: ISize, pointCloud?: PointCloud, selectedPointCloudBox?: IPointCloudBox, defaultValue?: {
|
|
24
11
|
[v: string]: any;
|
|
25
12
|
} | undefined) => Omit<IPointCloudBox, "trackID">;
|
|
@@ -45,8 +32,8 @@ export declare const usePointCloudViews: () => {
|
|
|
45
32
|
topViewAddBox: () => void;
|
|
46
33
|
topViewSelectedChanged: () => void;
|
|
47
34
|
sideViewUpdateBox: () => void;
|
|
35
|
+
backViewUpdateBox: () => void;
|
|
48
36
|
topViewUpdateBox?: undefined;
|
|
49
|
-
backViewUpdateBox?: undefined;
|
|
50
37
|
pointCloudBoxListUpdated?: undefined;
|
|
51
38
|
initPointCloud3d?: undefined;
|
|
52
39
|
updatePointCloudData?: undefined;
|
|
@@ -59,7 +46,7 @@ export declare const usePointCloudViews: () => {
|
|
|
59
46
|
zoom: number;
|
|
60
47
|
}) => void;
|
|
61
48
|
topViewSelectedChanged: (newSelectedBox?: IPointCloudBox, newPointCloudList?: IPointCloudBox[]) => void;
|
|
62
|
-
topViewUpdateBox: (
|
|
49
|
+
topViewUpdateBox: (updateList: UpdatePolygonByDragList, size: ISize) => void;
|
|
63
50
|
sideViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
64
51
|
backViewUpdateBox: (newPolygon: any, originPolygon: any) => void;
|
|
65
52
|
pointCloudBoxListUpdated: (newBoxes: IPointCloudBox[]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointCloudBox } from '@labelbee/lb-utils';
|
|
1
|
+
import { IPointCloudBox, PartialIPointCloudBoxList } from '@labelbee/lb-utils';
|
|
2
2
|
/** Actions for single selected box */
|
|
3
3
|
export declare const useSingleBox: () => {
|
|
4
4
|
selectedBox: {
|
|
@@ -11,5 +11,8 @@ export declare const useSingleBox: () => {
|
|
|
11
11
|
selectNextBox: (sort?: any) => void;
|
|
12
12
|
selectPrevBox: () => void;
|
|
13
13
|
deletePointCloudBox: (id: string) => void;
|
|
14
|
+
selectedBoxes: IPointCloudBox[];
|
|
15
|
+
updateSelectedBoxes: (updateList: PartialIPointCloudBoxList) => import("@labelbee/lb-utils").IPointCloudBoxList | undefined;
|
|
16
|
+
getPointCloudByID: (id: string) => IPointCloudBox | undefined;
|
|
14
17
|
deleteSelectedPointCloudBoxAndPolygon: () => void;
|
|
15
18
|
};
|
|
@@ -4,8 +4,8 @@ import { IStepInfo } from '@/types/step';
|
|
|
4
4
|
import { OnSubmit, IFileItem, GetFileData, OnSave, OnPageChange, OnStepChange, LoadFileList } from '@/types/data';
|
|
5
5
|
import { ESubmitType } from '@/constant';
|
|
6
6
|
import { IPointCloudBox } from '@labelbee/lb-utils';
|
|
7
|
-
export type GraphToolInstance = RectOperation | PointOperation | PolygonOperation | LineToolOperation;
|
|
8
|
-
export type ToolInstance = GraphToolInstance | TagOperation | TextToolOperation;
|
|
7
|
+
export declare type GraphToolInstance = RectOperation | PointOperation | PolygonOperation | LineToolOperation;
|
|
8
|
+
export declare type ToolInstance = GraphToolInstance | TagOperation | TextToolOperation;
|
|
9
9
|
interface CommonActions {
|
|
10
10
|
type: string;
|
|
11
11
|
payload?: any;
|
|
@@ -149,5 +149,5 @@ interface BatchUpdateResultByTrackID {
|
|
|
149
149
|
range: [number, number];
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
export type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave | BatchUpdateTrackID | BatchUpdateResultByTrackID | InitAnnotationState;
|
|
152
|
+
export declare type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave | BatchUpdateTrackID | BatchUpdateResultByTrackID | InitAnnotationState;
|
|
153
153
|
export {};
|
|
@@ -19,5 +19,5 @@ interface InitImgAttribute {
|
|
|
19
19
|
type: typeof IMAGE_ATTRIBUTE_ACTIONS.INIT_IMG_ATTRIBUTE;
|
|
20
20
|
payload: {};
|
|
21
21
|
}
|
|
22
|
-
export type ImgAttributeActionTypes = UpdateImgAttribute | InitImgAttribute;
|
|
22
|
+
export declare type ImgAttributeActionTypes = UpdateImgAttribute | InitImgAttribute;
|
|
23
23
|
export {};
|
|
@@ -19,5 +19,5 @@ interface InitToolStyleConfig {
|
|
|
19
19
|
type: typeof TOOL_STYLE_ACTIONS.INIT_TOOL_STYLE_CONFIG;
|
|
20
20
|
payload: undefined;
|
|
21
21
|
}
|
|
22
|
-
export type ToolStyleActionTypes = InitToolStyleConfig | UpdateToolStyleConfig;
|
|
22
|
+
export declare type ToolStyleActionTypes = InitToolStyleConfig | UpdateToolStyleConfig;
|
|
23
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
export type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | null | undefined>;
|
|
3
|
-
type TargetElement = HTMLElement | Element | Document | Window;
|
|
2
|
+
export declare type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | null | undefined>;
|
|
3
|
+
declare type TargetElement = HTMLElement | Element | Document | Window;
|
|
4
4
|
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined | null;
|
|
5
5
|
/**
|
|
6
6
|
* Get class like BEM
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const AnnotatedAttributesPanel: () => JSX.Element;
|
|
2
|
+
export declare const AnnotatedAttributesPanelFixedLeft: () => JSX.Element | null;
|
|
3
|
+
export declare const AnnotatedAttributesPanelFixedRight: () => JSX.Element | null;
|
|
4
|
+
export declare const AnnotatedAttributesIcon: () => JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RenderFooter } from '@/types/main';
|
|
2
2
|
import { IStepInfo } from '@/types/step';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export type FooterTheme = 'light' | 'dark';
|
|
4
|
+
export declare type FooterTheme = 'light' | 'dark';
|
|
5
5
|
interface IProps {
|
|
6
6
|
totalPage: number;
|
|
7
7
|
imgIndex: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),React=require("react"),selectors=require("../../../../store/annotation/selectors.js"),ctx=require("../../../../store/ctx.js"),icons=require("@ant-design/icons"),useHistory=require("../../../../components/pointCloudView/hooks/useHistory.js"),dom=require("../../../../utils/dom.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const AnnotatedAttributesItem=({attribute:e})=>{const u=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:n,hideAttributes:l,toggleAttributesVisible:C,polygonList:r,setPolygonList:f,setPointCloudResult:p,reRender:E}=u,[i,x]=React.useState(!1),{pushHistoryWithList:A}=useHistory.useHistory(),d=[...n,...r].filter(t=>t.attribute===e.value),c=()=>{C(e.value)},g=l.includes(e.value),m=({trackID:t,order:a})=>t||a,P=t=>{if(d.length===0)return;const a=r.filter(s=>t!==s.attribute),o=n.filter(s=>t!==s.attribute);f(a),p(o),E(o,a),A({pointCloudBoxList:o,polygonList:a})};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","item")},g?React__default.default.createElement(icons.EyeInvisibleFilled,{onClick:c}):React__default.default.createElement(icons.EyeFilled,{onClick:c}),React__default.default.createElement(icons.CaretDownFilled,{rotate:i?270:0,onClick:()=>{x(!i)}}),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","item","text")},e.key),React__default.default.createElement(icons.DeleteOutlined,{onClick:()=>P(e.value)})),d.map(t=>React__default.default.createElement("div",{key:m(t),style:{paddingLeft:54}},`${m(t)}.${e.key}`)))},AnnotatedAttributesPanel=()=>{const e=ctx.useSelector(selectors.stepConfigSelector),{attrPanelLayout:u,setAttrPanelLayout:n}=React.useContext(PointCloudContext.PointCloudContext);return React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute")},u?React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",null,"\u6807\u6CE8\u7ED3\u679C"),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","pin"),onClick:()=>{n("")}},React__default.default.createElement(icons.PushpinFilled,null),"\u53D6\u6D88\u56FA\u5B9A")):React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",{onClick:()=>{n("left")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),"\u56FA\u5B9A\u5728\u5DE6\u4FA7"),React__default.default.createElement("span",{onClick:()=>{n("right")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),"\u56FA\u5B9A\u5728\u53F3\u4FA7")),React__default.default.createElement("div",null,e.attributeList.map(l=>React__default.default.createElement(AnnotatedAttributesItem,{attribute:l,key:l.value}))))},AnnotatedAttributesPanelFixedLeft=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext);return e==="left"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesPanelFixedRight=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext);return e==="right"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesIcon=()=>{const{attrPanelLayout:e}=React.useContext(PointCloudContext.PointCloudContext);return e?null:React__default.default.createElement(antd.Popover,{placement:"topLeft",content:React__default.default.createElement(AnnotatedAttributesPanel,null),overlayClassName:dom.getClassName("annotated-attribute","popover")},React__default.default.createElement("span",null,"\u56FE\u7247\u5217\u8868"))};exports.AnnotatedAttributesIcon=AnnotatedAttributesIcon,exports.AnnotatedAttributesPanel=AnnotatedAttributesPanel,exports.AnnotatedAttributesPanelFixedLeft=AnnotatedAttributesPanelFixedLeft,exports.AnnotatedAttributesPanelFixedRight=AnnotatedAttributesPanelFixedRight;
|