@labelbee/lb-components 1.23.0-alpha.44 → 1.23.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/dist/assets/icons/ad33251.svg +26 -0
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/dist/index.css +2 -2
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +1 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/es/index.css +2 -2
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/package.json +3 -3
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1717751173252' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3511' width='16' height='16'%3e %3cpath d='M490.666667 59.733333C240.896 59.733333 38.4 262.229333 38.4 512c0 249.770667 202.496 452.266667 452.266667 452.266667a452.266667 452.266667 0 0 0 406.954666-254.72 25.6 25.6 0 0 0-46.08-22.4A401.066667 401.066667 0 1 1 891.733333 512a25.6 25.6 0 0 0 51.242667 0c0-249.770667-202.496-452.266667-452.266667-452.266667z' fill='black' p-id='3512' %3e%3c/path%3e %3cpath d='M917.333333 192a21.333333 21.333333 0 0 0-20.992 17.493333L896 213.333333v298.666667a21.333333 21.333333 0 0 0 42.325333 3.84L938.666667 512V213.333333a21.333333 21.333333 0 0 0-21.333334-21.333333z' fill='black' p-id='3513' %3e%3c/path%3e %3cpath d='M322.688 523.093333c-29.568 0-45.696-20.736-45.696-56.832 0-36.864 19.2-58.752 43.392-58.752 30.72 0 51.84 25.344 56.064 81.024-16.896 24.576-36.48 34.56-53.76 34.56z m-82.176 113.28c16.512 16.896 39.552 29.952 72.192 29.952 54.528 0 105.216-44.544 105.216-155.904 0-93.312-43.776-137.088-97.92-137.088-45.696 0-84.096 36.864-84.096 92.928 0 59.136 31.872 88.704 79.104 88.704 21.504 0 45.696-12.672 62.208-33.024-2.688 80.64-32.256 108.288-66.432 108.288-18.048 0-35.328-8.448-46.464-21.12l-23.808 27.264zM547.712 666.325333c55.296 0 91.392-49.152 91.392-147.456 0-97.536-36.096-145.536-91.392-145.536-55.68 0-91.392 47.616-91.392 145.536 0 98.304 35.712 147.456 91.392 147.456z m0-34.944c-28.8 0-49.152-30.72-49.152-112.512 0-81.024 20.352-110.592 49.152-110.592 28.8 0 49.152 29.568 49.152 110.592 0 81.792-20.352 112.512-49.152 112.512zM730.88 480.085333c31.104 0 56.832-23.04 56.832-57.216 0-34.176-25.728-57.216-56.832-57.216-30.336 0-56.448 23.04-56.448 57.216 0 34.176 26.112 57.216 56.448 57.216z m0-23.04c-18.432 0-31.104-14.208-31.104-34.176 0-20.352 12.672-34.56 31.104-34.56 18.816 0 31.488 14.208 31.488 34.56 0 19.968-12.672 34.176-31.488 34.176z' fill='black' p-id='3514' %3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
t="1717751173252"
|
|
3
|
+
class="icon"
|
|
4
|
+
viewBox="0 0 1024 1024"
|
|
5
|
+
version="1.1"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
p-id="3511"
|
|
8
|
+
width="24"
|
|
9
|
+
height="24"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d="M490.666667 59.733333C240.896 59.733333 38.4 262.229333 38.4 512c0 249.770667 202.496 452.266667 452.266667 452.266667a452.266667 452.266667 0 0 0 406.954666-254.72 25.6 25.6 0 0 0-46.08-22.4A401.066667 401.066667 0 1 1 891.733333 512a25.6 25.6 0 0 0 51.242667 0c0-249.770667-202.496-452.266667-452.266667-452.266667z"
|
|
13
|
+
fill="#ffffff"
|
|
14
|
+
p-id="3512"
|
|
15
|
+
></path>
|
|
16
|
+
<path
|
|
17
|
+
d="M917.333333 192a21.333333 21.333333 0 0 0-20.992 17.493333L896 213.333333v298.666667a21.333333 21.333333 0 0 0 42.325333 3.84L938.666667 512V213.333333a21.333333 21.333333 0 0 0-21.333334-21.333333z"
|
|
18
|
+
fill="#ffffff"
|
|
19
|
+
p-id="3513"
|
|
20
|
+
></path>
|
|
21
|
+
<path
|
|
22
|
+
d="M322.688 523.093333c-29.568 0-45.696-20.736-45.696-56.832 0-36.864 19.2-58.752 43.392-58.752 30.72 0 51.84 25.344 56.064 81.024-16.896 24.576-36.48 34.56-53.76 34.56z m-82.176 113.28c16.512 16.896 39.552 29.952 72.192 29.952 54.528 0 105.216-44.544 105.216-155.904 0-93.312-43.776-137.088-97.92-137.088-45.696 0-84.096 36.864-84.096 92.928 0 59.136 31.872 88.704 79.104 88.704 21.504 0 45.696-12.672 62.208-33.024-2.688 80.64-32.256 108.288-66.432 108.288-18.048 0-35.328-8.448-46.464-21.12l-23.808 27.264zM547.712 666.325333c55.296 0 91.392-49.152 91.392-147.456 0-97.536-36.096-145.536-91.392-145.536-55.68 0-91.392 47.616-91.392 145.536 0 98.304 35.712 147.456 91.392 147.456z m0-34.944c-28.8 0-49.152-30.72-49.152-112.512 0-81.024 20.352-110.592 49.152-110.592 28.8 0 49.152 29.568 49.152 110.592 0 81.792-20.352 112.512-49.152 112.512zM730.88 480.085333c31.104 0 56.832-23.04 56.832-57.216 0-34.176-25.728-57.216-56.832-57.216-30.336 0-56.448 23.04-56.448 57.216 0 34.176 26.112 57.216 56.448 57.216z m0-23.04c-18.432 0-31.104-14.208-31.104-34.176 0-20.352 12.672-34.56 31.104-34.56 18.816 0 31.488 14.208 31.488 34.56 0 19.968-12.672 34.176-31.488 34.176z"
|
|
23
|
+
fill="#ffffff"
|
|
24
|
+
p-id="3514"
|
|
25
|
+
></path>
|
|
26
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}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=(u,i,
|
|
1
|
+
"use strict";var ahooks=require("ahooks"),es=require("antd/es"),React=require("react"),reactRedux=require("react-redux"),usePointCloudViews=require("../pointCloudView/hooks/usePointCloudViews.js"),PointCloudContext=require("../pointCloudView/PointCloudContext.js"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}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=(u,i,l)=>i in u?__defProp(u,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[i]=l,__spreadValues=(u,i)=>{for(var l in i||(i={}))__hasOwnProp.call(i,l)&&__defNormalProp(u,l,i[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(i))__propIsEnum.call(i,l)&&__defNormalProp(u,l,i[l]);return u},__spreadProps=(u,i)=>__defProps(u,__getOwnPropDescs(i)),__async=(u,i,l)=>new Promise((c,d)=>{var v=a=>{try{p(l.next(a))}catch(f){d(f)}},R=a=>{try{p(l.throw(a))}catch(f){d(f)}},p=a=>a.done?c(a.value):Promise.resolve(a.value).then(v,R);p((l=l.apply(u,i)).next())});const PointCloud2DRectOperationView=u=>{var i,l;const{mappingData:c,size:d,config:v,checkMode:R,afterImgOnLoad:p,shouldExcludePointCloudBoxListUpdate:a}=u,f=(i=c==null?void 0:c.url)!=null?i:"",m=(l=c==null?void 0:c.fallbackUrl)!=null?l:"",{pointCloudBoxList:b,setPointCloudResult:y,defaultAttribute:D,rectList:w,addRectIn2DView:N,updateRectIn2DView:x,removeRectIn2DView:B}=React.useContext(PointCloudContext.PointCloudContext),{update2DViewRect:M,remove2DViewRect:z}=usePointCloudViews.usePointCloudViews(),P=React__default.default.useRef(null),n=React.useRef(null),O=ahooks.useMemoizedFn(M),L=ahooks.useMemoizedFn(z),C=React.useRef(null),[A,E]=React.useState(!0),h=React.useMemo(()=>w==null?void 0:w.filter(e=>e.imageName===(c==null?void 0:c.path)),[c==null?void 0:c.path,w]),g=ahooks.useLatest(c==null?void 0:c.path),V=e=>{const{boxID:o}=e;if(!a&&o){const t=O==null?void 0:O(e);C.current=t,y(t);return}x(e,!0)},S=e=>{g.current&&N(__spreadProps(__spreadValues({},e),{imageName:g.current}))},j=e=>{if(!a){const o=e.find(t=>t.boxID);if(o){const t=L==null?void 0:L(o);C.current=t,y(t),_();return}}B(e)},F=ahooks.useMemoizedFn(()=>{let e=[];return b.forEach(o=>{const{rects:t=[],id:r,attribute:s,trackID:I}=o,q=t.find(k=>k.imageName===g.current),U=r+"_"+g.current;q&&(e=[...e,__spreadProps(__spreadValues({},q),{boxID:r,id:U,attribute:s,order:I})])}),e}),_=ahooks.useMemoizedFn(()=>{var e,o,t;const r=a?[]:F(),s=(e=n.current)==null?void 0:e.selectedRectID;(o=n.current)==null||o.setResult([...r,...h]),s&&((t=n.current)==null||t.setSelectedRectID(s))});return React.useEffect(()=>{if(P.current){const e=new lbAnnotation.PointCloud2DRectOperation({container:P.current,size:d,config:__spreadProps(__spreadValues({},v),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:R});return n.current=e,n.current.init(),n.current.on("updateDragResult",V),n.current.on("afterAddingDrawingRect",S),n.current.on("deleteSelectedRects",j),()=>{var o,t,r,s;(o=n.current)==null||o.unbind("updateDragResult",V),(t=n.current)==null||t.unbind("afterAddingDrawingRect",S),(r=n.current)==null||r.unbind("deleteSelectedRects",j),(s=n.current)==null||s.destroy()}}},[]),React.useEffect(()=>{const e=t=>__async(void 0,null,function*(){try{return yield lbAnnotation.ImgUtils.load(t)}catch(r){return console.error("Error loading image:",r),null}}),o=()=>__async(void 0,null,function*(){var t;E(!0);let r=yield e(f);!r&&m&&(r=yield e(m)),r&&((t=n.current)==null||t.setImgNode(r),p(r)),E(!1)});n.current&&(f||m)&&o()},[f,m]),React.useEffect(()=>{var e;(e=n.current)==null||e.setSize(d)},[d]),React.useEffect(()=>{b!==C.current&&_()},[b]),React.useEffect(()=>{var e,o,t;const r=h.find(s=>s.id===n.current.selectedRectID);(o=(e=n.current)==null?void 0:e.setDefaultAttribute)==null||o.call(e,D),r&&x(__spreadProps(__spreadValues({},(t=n.current)==null?void 0:t.selectedRect),{attribute:D})),_()},[D]),React.useEffect(()=>{_()},[h]),React.useEffect(()=>{_()},[a]),React.useEffect(()=>{var e,o,t,r;const s=(o=(e=n.current)==null?void 0:e.config)!=null?o:{},I=__spreadProps(__spreadValues({},s),{attributeList:(t=v.attributeList)!=null?t:[]});(r=n.current)==null||r.setConfig(JSON.stringify(I))},[v.attributeList]),React__default.default.createElement(es.Spin,{spinning:A},React__default.default.createElement("div",{ref:P,style:__spreadValues({position:"relative"},d)}))};var PointCloud2DRectOperationView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DRectOperationView);module.exports=PointCloud2DRectOperationView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),useDataLinkSwitch=require("./hooks/useDataLinkSwitch.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,a,i)=>new Promise((l,u)=>{var f=t=>{try{o(i.next(t))}catch(n){u(n)}},r=t=>{try{o(i.throw(t))}catch(n){u(n)}},o=t=>t.done?l(t.value):Promise.resolve(t.value).then(f,r);o((i=i.apply(e,a)).next())});const PointCloud2DSingleView=({view2dData:e,setSelectedID:a,currentData:i,showEnlarge:l,checkMode:u=!1,measureVisible:f})=>{var r,o;const t=React.useRef(null),n=React.useRef(),{selectedBox:c}=useSingleBox.useSingleBox(),m=useSize(t),{url:p,
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),index=require("../AnnotationView/index.js"),useSize=require("../../hooks/useSize.js"),useSingleBox=require("./hooks/useSingleBox.js"),useHighlight=require("./hooks/useHighlight.js"),index$2=require("./components/HighlightVisible/index.js"),PointCloudContext=require("./PointCloudContext.js"),useDataLinkSwitch=require("./hooks/useDataLinkSwitch.js"),index$1=require("../pointCloud2DRectOperationView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__async=(e,a,i)=>new Promise((l,u)=>{var f=t=>{try{o(i.next(t))}catch(n){u(n)}},r=t=>{try{o(i.throw(t))}catch(n){u(n)}},o=t=>t.done?l(t.value):Promise.resolve(t.value).then(f,r);o((i=i.apply(e,a)).next())});const PointCloud2DSingleView=({view2dData:e,setSelectedID:a,currentData:i,showEnlarge:l,checkMode:u=!1,measureVisible:f})=>{var r,o;const t=React.useRef(null),n=React.useRef(),{selectedBox:c}=useSingleBox.useSingleBox(),m=useSize(t),{url:p,fallbackUrl:x,calib:v,path:y}=e,{toggle2dVisible:j,isHighlightVisible:q}=useHighlight.useHighlight({currentData:i}),[P,k]=React.useState(!1),{cuboidBoxIn2DView:h,cacheImageNodeSize:_}=React.useContext(PointCloudContext.PointCloudContext),B=!e,V=React.useMemo(()=>({zIndex:l?-1:101,is2DView:!h,imageName:e.path}),[l,h,e.path]),{rendered:z,isLinking:I}=useDataLinkSwitch(V),b=d=>{g(),_({path:y,imgNode:d})},g=React.useCallback(()=>{var d,C;const L=(d=n.current)==null?void 0:d.toolInstance;if(a(""),!c||!L)return;const s=e.annotations.find(E=>E.annotation.id===c.info.id);let S="";s&&((C=s==null?void 0:s.annotation.pointList)==null?void 0:C.length)>0&&(L.focusPositionByPointList(s==null?void 0:s.annotation.pointList),S=c.info.id,a(S))},[c,n.current,e.annotations]);React.useEffect(()=>{g()},[g]);const R=()=>__async(void 0,null,function*(){k(!0),yield j(p,x!=null?x:"",v),k(!1)});return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-2d-image"),ref:t},h?React__default.default.createElement(index,{src:(r=e==null?void 0:e.url)!=null?r:"",fallbackSrc:(o=e==null?void 0:e.fallbackUrl)!=null?o:"",annotations:e.annotations,size:m,ref:n,globalStyle:{display:B?"none":"block"},afterImgOnLoad:b,zoomInfo:{min:.01,max:1e3,ratio:.4},measureVisible:f}):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$1,{shouldExcludePointCloudBoxListUpdate:!I,mappingData:e,size:m,checkMode:u,afterImgOnLoad:b}),z),v&&React__default.default.createElement(index$2,{visible:q(p),onClick:R,loading:P,style:{position:"absolute",right:16,top:16,zIndex:l?-1:101}}))};module.exports=PointCloud2DSingleView;
|
|
@@ -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"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.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"),useLine=require("./hooks/useLine.js"),reactI18next=require("react-i18next"),actionCreators=require("../../store/annotation/actionCreators.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,r,u)=>r in l?__defProp(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,__spreadValues=(l,r)=>{for(var u in r||(r={}))__hasOwnProp.call(r,u)&&__defNormalProp(l,u,r[u]);if(__getOwnPropSymbols)for(var u of __getOwnPropSymbols(r))__propIsEnum.call(r,u)&&__defNormalProp(l,u,r[u]);return l},__spreadProps=(l,r)=>__defProps(l,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:l,config:r,checkMode:u,configString:
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useRotateEdge=require("./hooks/useRotateEdge.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),useSphere=require("./hooks/useSphere.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),useStatus=require("./hooks/useStatus.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"),useLine=require("./hooks/useLine.js"),reactI18next=require("react-i18next"),actionCreators=require("../../store/annotation/actionCreators.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(l,r,u)=>r in l?__defProp(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,__spreadValues=(l,r)=>{for(var u in r||(r={}))__hasOwnProp.call(r,u)&&__defNormalProp(l,u,r[u]);if(__getOwnPropSymbols)for(var u of __getOwnPropSymbols(r))__propIsEnum.call(r,u)&&__defNormalProp(l,u,r[u]);return l},__spreadProps=(l,r)=>__defProps(l,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:l,config:r,checkMode:u,configString:V,imgIndex:C,toolInstanceRef:a})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:B,selectNextBox:L,selectPrevBox:q,updateSelectedBox:f,deleteSelectedPointCloudBoxAndPolygon:O}=useSingleBox.useSingleBox(),{selectedSphere:P,updatePointCloudSphere:A}=useSphere.useSphere(),{clearAllResult:y,updatePointCloudPattern:j}=useStatus.useStatus(),{copySelectedBoxes:I,pasteSelectedBoxes:T,copiedBoxes:D}=useBoxes.useBoxes({config:r}),{updateRotate:g}=useRotate.useRotate({currentData:l}),{updateRotateEdge:N}=useRotateEdge.useRotateEdge({currentData:l}),{updatePointCloudData:v,topViewSelectedChanged:m}=usePointCloudViews.usePointCloudViews(),{redo:h,undo:S,pushHistoryWithList:R,pushHistoryUnderUpdatePolygon:H,pushHistoryUnderUpdateLine:K}=useHistory.useHistory(),U=ctx.useDispatch(),{syncThreeViewsAttribute:x}=useAttribute.useAttribute(),{syncAllViewsConfig:z,reRenderTopViewRange:F}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{selectedLine:_}=useLine.useLine(),{t:w}=reactI18next.useTranslation(),b=e=>{var o;const{topViewInstance:s}=t;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},G=(e,o)=>{var s,i;const{topViewInstance:c,mainViewInstance:n}=t;if(!c)return;const{pointCloud2dOperation:d}=c;switch(e){case"q":{g(t.rectRotateSensitivity);break}case"e":g(-Number(t.rectRotateSensitivity));break;case"g":N(-90);break;case"u":{const p=d.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;j(p);const W={[lbAnnotation.EToolName.Polygon]:w("PolygonPattern"),[lbAnnotation.EToolName.Rect]:w("RectPattern")};antd.message.success(w("ChangePatternMsg",{pattern:W[p]})),d.clearActiveStatus(),d.clearDrawingStatus()}break;case"+":n==null||n.updatePointSize({zoomIn:!0});break;case"-":n==null||n.updatePointSize({zoomIn:!1});break;case"v":t.setPointCloudValid(!t.valid);break;case"tab":if(o.shiftKey){q();break}L(),o.preventDefault();break;case"f":B();break;case"arrowup":b({y:-1});break;case"arrowdown":b({y:1});break;case"arrowleft":b({x:-1});break;case"arrowright":b({x:1});break;case"delete":O();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const p=lbAnnotation.AttributeUtils.getAttributeByKeycode(o.keyCode,r.attributeList);p!==void 0&&((i=a.current)==null||i.setDefaultAttribute(p))}return}}},M=(e,o)=>{switch(e){case"c":I();break;case"v":T();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?h():S();break}}},E=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||u===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){M(o,e);return}G(o,e)};return React.useEffect(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E)}},[t,D,r,t.pointCloudBoxList,t.polygonList]),React.useEffect(()=>{z(r)},[V]),React.useEffect(()=>{(r==null?void 0:r.radius)&&F(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{v==null||v()},[C,t.mainViewInstance]),React.useEffect(()=>{t.setHideAttributes([])},[C]),React.useEffect(()=>{a.current.setDefaultAttribute=e=>{var o,s,i,c;x(e);const n=t.selectedPointCloudBox;if(n){n.attribute=e;const d=U(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[n],stepConfig:r,action:"viewUpdateBox"}));n.valid=d[0].valid;const p=f(n);(i=(s=(o=t==null?void 0:t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:s.setPolygonValidAndRender)==null||i.call(s,n.id,!0,n.valid),t.mainViewInstance&&m({newSelectedBox:n,newPointCloudList:p})}if(k&&H(__spreadProps(__spreadValues({},k),{attribute:e})),_&&K(__spreadProps(__spreadValues({},_),{attribute:e})),P){const d=A(__spreadProps(__spreadValues({},P),{attribute:e}));t.mainViewInstance&&((c=t.mainViewInstance)==null||c.generateSpheres(d),m({newSelectedSphere:P,newSphereList:d}))}},a.current.setSubAttribute=(e,o)=>{var s;const i=t.selectedPointCloudBox;if(i){const c=(s=i==null?void 0:i.subAttribute)!=null?s:{};i.subAttribute=__spreadProps(__spreadValues({},c),{[e]:o}),f(i)}},a.current.clearResult=()=>{y==null||y()},a.current.redo=()=>{h()},a.current.undo=()=>{S()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{t.setPointCloudValid(e),e===!1&&y()})},a.current.setForbidOperation=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&t.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var o,s;(s=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)},a.current.asyncData=e=>{setTimeout(()=>{v==null||v(e)})}},[t.pointCloudBoxList,t.pointCloudSphereList,t.selectedID,t.valid,t.polygonList,t.lineList,t.mainViewInstance,t.ptSegmentInstance]),React.useEffect(()=>{a.current.updateSegmentTool=e=>{var o;(o=t.ptSegmentInstance)==null||o.emit(e)},a.current.segmentInstance=t.ptSegmentInstance},[t.ptSegmentInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{R({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const o=(e=t.topViewInstance)==null?void 0:e.toolInstance;if(!o||u)return;const s=n=>{x(n)},i=n=>{antd.message.error(n)},c=n=>{antd.message.info(n)};return o.on("syncAttribute",s),o.on("messageError",i),o.on("messageInfo",c),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",i),o.unbind("messageInfo",c)}},[t.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 map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");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,
|
|
1
|
+
"use strict";var map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),React=require("react"),index$1=require("../AnnotationView/index.js"),reactRedux=require("react-redux"),PointCloudContext=require("./PointCloudContext.js"),index=require("./components/TitleButton/index.js"),antd=require("antd"),highlightSegmentWorker=require("../../_virtual/highlightSegmentWorker.js"),lbAnnotation=require("@labelbee/lb-annotation"),_=require("lodash");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,r,o)=>r in t?__defProp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,__spreadValues=(t,r)=>{for(var o in r||(r={}))__hasOwnProp.call(r,o)&&__defNormalProp(t,o,r[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(r))__propIsEnum.call(r,o)&&__defNormalProp(t,o,r[o]);return t},__spreadProps=(t,r)=>__defProps(t,__getOwnPropDescs(r));const PointCloudSegment2DSingleView=({path:t,url:r,fallbackUrl:o,calib:s,pcdUrl:u,highlightAttribute:c})=>{const{ptSegmentInstance:e,cacheImageNodeSize:y,imageSizes:x}=React.useContext(PointCloudContext.PointCloudContext),w=React.useRef(null),p=React.useRef(0),g=React.useRef({}),d=React.useRef(),[v,m]=React.useState([]),[D,P]=React.useState(!1),b=React.useRef(void 0);React.useEffect(()=>()=>{p.current=0,g.current={},d.current=void 0},[u]);const h=React.useCallback(()=>{var n,l,i;if(p.current=p.current+1,p.current===2){const a=(n=e==null?void 0:e.store)==null?void 0:n.originPoints;if(!a||!d.current){console.error("cacheMappingPCD2Img Error",{path:t,points:a,filterSize:d.current});return}g.current=(i=(l=lbAnnotation.pointMappingLidar2image(a,s,d.current))==null?void 0:l.pcdMapping)!=null?i:{}}},[e]),C=React.useMemo(()=>{const n=(l,i)=>{var a,S;if(l&&d.current){b.current&&((S=(a=b.current)==null?void 0:a.terminate)==null||S.call(a));const k=g.current,f=new highlightSegmentWorker;f.current=f,P(!0),f.postMessage({cacheMap:k,indexes:l,defaultRGBA:i}),f.onmessage=O=>{m(O.data.annotations),f.terminate(),P(!1),f.current=void 0}}};return _.debounce(n,100)},[]);React.useEffect(()=>{if(!(e==null?void 0:e.store))return;const n=e.store.getHighlightAttribute(c!=null?c:""),l=e==null?void 0:e.getColorFromConfig(c!=null?c:"");C(n.flat(),l.stroke)},[c,e]),React.useEffect(()=>{if(e){const n=({newAttribute:l})=>{const i=e==null?void 0:e.getColorFromConfig(l);i&&m(v.map(a=>__spreadProps(__spreadValues({},a),{defaultRGBA:i.stroke})))};return e.on("updateDefaultAttribute",n),()=>{e.unbind("updateDefaultAttribute",n)}}},[e,v]),React.useEffect(()=>{if(e){const n=l=>{if(l.cacheSegData){const{cacheSegData:i}=l;if(i==null?void 0:i.indexes){const a=e.getColorFromConfig(i.attribute);C(i==null?void 0:i.indexes,a.stroke)}}else m([])};return e.on("syncPointCloudStatus",n),e.on("loadPCDFileEnd",h),()=>{e.unbind("syncPointCloudStatus",n),e.unbind("loadPCDFileEnd",h)}}},[e,u,x]);const E=n=>{y({path:t,imgNode:n}),d.current={width:n.width,height:n.height},h()};return React__default.default.createElement("div",{key:t,style:{position:"relative"},ref:w},React__default.default.createElement(index,{title:s.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),React__default.default.createElement(antd.Spin,{spinning:D,delay:1e3},React__default.default.createElement(index$1,{size:{width:300,height:200},key:t,src:r,fallbackSrc:o,annotations:v,afterImgOnLoad:E})))},PointCloudSegment2DView=({currentData:t,highlightAttribute:r})=>{var o;const s=(o=t.mappingImgList)!=null?o:[];return(s==null?void 0:s.length)>0?React__default.default.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},s==null?void 0:s.map((u,c)=>{var e;return u.calib&&React__default.default.createElement(PointCloudSegment2DSingleView,{key:u.path+c,path:u.path,url:u.url,fallbackUrl:(e=u.fallbackUrl)!=null?e:"",calib:u.calib,pcdUrl:t.url,highlightAttribute:r})})):null};var PointCloudSegment2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSegment2DView);module.exports=PointCloudSegment2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=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"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}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=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:v,height:c}=l,g={x:o.x+v*s/2,y:o.y+c*s/2},P={x:l.width/2,y:l.height/2};return{offsetX:(P.x-g.x)/s,offsetY:-(P.y-g.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:v,zoomIn:c,zoomOut:g,initialPosition:P}=useZoom.useZoom(),{selectNextBox:h,selectPrevBox:S}=useSingleBox.useSingleBox(),{switchToNextSphere:y}=useSphere.useSphere(),{updateRotate:x}=useRotate.useRotate({currentData:o}),C=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:V}=C,I=(s=(l=C==null?void 0:C.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),m=()=>{x(-Number(C.rectRotateSensitivity))},e=()=>{x(C.rectRotateSensitivity)},r=()=>{x(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:p=>{var E;(E=V==null?void 0:V.pointCloudInstance)==null||E.updatePointSize({customSize:p})}}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:m,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate-180")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.descend);return}S(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(I===EToolName.Point){y(ESortDirection.ascend);return}h(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:P,zoomIn:c,zoomOut:g,zoom:v}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?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:l,onAfterChange:v=>{o(v)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:v,checkMode:c,intelligentFit:g,setIsEnlargeTopView:P,isEnlargeTopView:h,onExitZoom:S,highlightAttribute:y})=>{var x,C;const[V,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),m=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),r=useSize(m),p=index.jsonParser(s.config),{setZoom:E,syncTopviewToolZoom:N}=useZoom.useZoom(),{hideAttributes:D}=e,{addPolygon:B,deletePolygon:R}=usePolygon.usePolygon(),{deletePointCloudSphere:U}=useSphere.useSphere(),{deletePointCloudBox:Z,changeValidByID:z}=useSingleBox.useSingleBox(),[b,H]=React.useState(10),{t:k}=reactI18next.useTranslation(),w=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:F}=useHistory.useHistory();React.useLayoutEffect(()=>{if(!e.topViewInstance&&m.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:m.current.clientWidth,height:m.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:m.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},p),{pointCloudPattern:e.pointCloudPattern}),checkMode:c,toolName:ToolUtils.getPointCloudToolList(),proxyMode:c});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!r||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(u=>__spreadProps(__spreadValues({},u),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(u.pointList,r)}));e.setSelectedIDs(i),e.setLineList(d),F({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{w.topViewAddSphere({newPoint:t,size:r,trackConfigurable:p.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{U(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=w.topViewUpdatePoint)==null||d.call(w,t,r)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,r))});B(d),e.setSelectedIDs(D.includes(t.attribute)?"":t.id);return}w.topViewAddBox({polygon:t,size:r,imgList:l,trackConfigurable:p.trackConfigurable,zoom:i,intelligentFit:g})}),n.singleOn("deletedObject",({id:t})=>{Z(t),R(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=w.topViewUpdateBox)==null||i.call(w,t,r)});const a=t=>{var i;const d=z(t);d&&e.syncAllViewPointCloudColor(d),e.polygonList.find(u=>u.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,r,o,w,e.polygonList,e.lineList,(x=e.topViewInstance)==null?void 0:x.toolInstance]),React.useEffect(()=>{var n,a;if(!(r==null?void 0:r.width)||!e.topViewInstance)return;const t=(a=(n=p==null?void 0:p.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(r),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(u,f)=>{const{offsetX:L,offsetY:O}=TransferCanvas2WorldOffset(f,r,u);if(i.camera.zoom=u,f){const{x:q,y:j,z:T}=i.initCameraPosition;i.camera.position.set(q+O,j-L,T)}i.camera.updateProjectionMatrix(),i.render(),E(u),N(f,u,r),I({zoom:u,currentPos:f})}),d.singleOn("dragMove",({currentPos:u,zoom:f})=>{const{offsetX:L,offsetY:O}=TransferCanvas2WorldOffset(u,r,f);i.camera.zoom=f;const{x:q,y:j,z:T}=i.initCameraPosition;i.camera.position.set(q+O,j-L,T),i.render(),N(u,f,r),I({zoom:f,currentPos:u})})},[r,e.topViewInstance,(C=e.topViewInstance)==null?void 0:C.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(b)},[b]),React.useEffect(()=>{var n,a,t,i;w.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>(window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}),[]);const A=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&S()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,y)},[e.topViewInstance,y]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:h?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{S()}}),React__default.default.createElement("span",null,k("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:p,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:k("TopView"),onClick:()=>{P(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:m},v==null?void 0:v(V)),!h&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:p}),React__default.default.createElement(ZAxisSlider,{checkMode:c,zAxisLimit:b,setZAxisLimit:H}),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
|
+
"use strict";var dom=require("../../utils/dom.js"),index$3=require("../../views/MainView/toolFooter/index.js"),index$4=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"),useRotateEdge=require("./hooks/useRotateEdge.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"),index$2=require("./components/PointCloudSizeSlider/index.js"),useHistory=require("./hooks/useHistory.js"),index$1=require("./components/TitleButton/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}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=(o,l,s)=>l in o?__defProp(o,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[l]=s,__spreadValues=(o,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(o,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(o,s,l[s]);return o},__spreadProps=(o,l)=>__defProps(o,__getOwnPropDescs(l));const{EPolygonPattern,EToolName}=lbAnnotation.cTool,{ESortDirection}=lbAnnotation.cAnnotation,EKeyCode=lbAnnotation.cKeyCode.default,TransferCanvas2WorldOffset=(o,l,s=1)=>{const{width:C,height:c}=l,w={x:o.x+C*s/2,y:o.y+c*s/2},P={x:l.width/2,y:l.height/2};return{offsetX:(P.x-w.x)/s,offsetY:-(P.y-w.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:C,zoomIn:c,zoomOut:w,initialPosition:P}=useZoom.useZoom(),{selectNextBox:S,selectPrevBox:V}=useSingleBox.useSingleBox(),{switchToNextSphere:x}=useSphere.useSphere(),{updateRotate:y}=useRotate.useRotate({currentData:o}),{updateRotateEdge:E}=useRotateEdge.useRotateEdge({currentData:o}),g=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:I}=g,p=(s=(l=g==null?void 0:g.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),e=()=>{y(-Number(g.rectRotateSensitivity))},r=()=>{y(g.rectRotateSensitivity)},f=()=>{E(-90)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:b=>{var h;(h=I==null?void 0:I.pointCloudInstance)==null||h.updatePointSize({customSize:b})}}),React__default.default.createElement("span",{onClick:r,className:dom.getClassName("point-cloud","rotate-reserve")}),React__default.default.createElement("span",{onClick:e,className:dom.getClassName("point-cloud","rotate")}),React__default.default.createElement("span",{onClick:f,className:dom.getClassName("point-cloud","rotate-90")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(icons.UpSquareOutlined,{onClick:()=>{if(p===EToolName.Point){x(ESortDirection.descend);return}V(!0)},className:dom.getClassName("point-cloud","prev")}),React__default.default.createElement(icons.DownSquareOutlined,{onClick:()=>{if(p===EToolName.Point){x(ESortDirection.ascend);return}S(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:P,zoomIn:c,zoomOut:w,zoom:C}))},ZAxisSlider=({setZAxisLimit:o,zAxisLimit:l,checkMode:s})=>s?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:l,onAfterChange:C=>{o(C)}})),PointCloudTopView=({currentData:o,imgList:l,stepInfo:s,drawLayerSlot:C,checkMode:c,intelligentFit:w,setIsEnlargeTopView:P,isEnlargeTopView:S,onExitZoom:V,highlightAttribute:x})=>{var y,E;const[g,I]=React.useState({zoom:1,currentPos:{x:0,y:0}}),p=React.useRef(null),e=React__default.default.useContext(PointCloudContext.PointCloudContext),r=useSize(p),f=index.jsonParser(s.config),{setZoom:b,syncTopviewToolZoom:h}=useZoom.useZoom(),{hideAttributes:A}=e,{addPolygon:B,deletePolygon:D}=usePolygon.usePolygon(),{deletePointCloudSphere:U}=useSphere.useSphere(),{deletePointCloudBox:Z,changeValidByID:z}=useSingleBox.useSingleBox(),[L,H]=React.useState(10),{t:k}=reactI18next.useTranslation(),m=usePointCloudViews.usePointCloudViews(),{pushHistoryWithList:F}=useHistory.useHistory();React.useLayoutEffect(()=>{if(!e.topViewInstance&&p.current&&(o==null?void 0:o.url)&&(o==null?void 0:o.result)){const n={width:p.current.clientWidth,height:p.current.clientHeight},a=new lbAnnotation.PointCloudAnnotation({container:p.current,size:n,pcdPath:o.url,config:__spreadProps(__spreadValues({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:c,toolName:ToolUtils.getPointCloudToolList(),proxyMode:c});e.setTopViewInstance(a)}},[o]),React.useEffect(()=>{if(!r||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:n}=e.topViewInstance;n.singleOn("dataUpdated",(t,i)=>{const d=___default.default.cloneDeep(t).map(u=>__spreadProps(__spreadValues({},u),{pointList:lbUtils.PointCloudUtils.pointListTransferCanvas2World(u.pointList,r)}));e.setSelectedIDs(i),e.setLineList(d),F({lineList:d})}),n.singleOn("pointCreated",(t,i)=>{m.topViewAddSphere({newPoint:t,size:r,trackConfigurable:f.trackConfigurable,zoom:i})}),n.singleOn("pointDeleted",t=>{U(t)}),n.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),n.singleOn("updatePointByDrag",(t,i)=>{var d;(d=m.topViewUpdatePoint)==null||d.call(m,t,r)}),n.singleOn("polygonCreated",(t,i)=>{if(n.pattern===EPolygonPattern.Normal||!(o==null?void 0:o.url)){const d=__spreadProps(__spreadValues({},t),{pointList:t.pointList.map(u=>lbUtils.PointCloudUtils.transferCanvas2World(u,r))});B(d),e.setSelectedIDs(A.includes(t.attribute)?"":t.id);return}m.topViewAddBox({polygon:t,size:r,imgList:l,trackConfigurable:f.trackConfigurable,zoom:i,intelligentFit:w})}),n.singleOn("deletedObject",({id:t})=>{Z(t),D(t)}),n.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),n.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),n.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),n.singleOn("updatePolygonByDrag",t=>{var i;(i=m.topViewUpdateBox)==null||i.call(m,t,r)});const a=t=>{var i;const d=z(t);d&&e.syncAllViewPointCloudColor(d),e.polygonList.find(u=>u.id===t)&&((i=e.topViewInstance)==null||i.toolInstance.setPolygonValidAndRender(t,!0))};return n.on("validUpdate",a),()=>{n.unbind("validUpdate",a)}},[e,r,o,m,e.polygonList,e.lineList,(y=e.topViewInstance)==null?void 0:y.toolInstance]),React.useEffect(()=>{var n,a;if(!(r==null?void 0:r.width)||!e.topViewInstance)return;const t=(a=(n=f==null?void 0:f.attributeList)==null?void 0:n[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(r),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:i,toolInstance:d}}=e;d.singleOn("renderZoom",(u,v)=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(v,r,u);if(i.camera.zoom=u,v){const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N)}i.camera.updateProjectionMatrix(),i.render(),b(u),h(v,u,r),I({zoom:u,currentPos:v})}),d.singleOn("dragMove",({currentPos:u,zoom:v})=>{const{offsetX:O,offsetY:q}=TransferCanvas2WorldOffset(u,r,v);i.camera.zoom=v;const{x:j,y:T,z:N}=i.initCameraPosition;i.camera.position.set(j+q,T-O,N),i.render(),h(u,v,r),I({zoom:v,currentPos:u})})},[r,e.topViewInstance,(E=e.topViewInstance)==null?void 0:E.toolInstance]),React.useEffect(()=>{var n,a;(a=(n=e.topViewInstance)==null?void 0:n.pointCloudInstance)==null||a.applyZAxisPoints(L)},[L]),React.useEffect(()=>{var n,a,t,i;m.topViewSelectedChanged({}),(i=(t=(a=(n=e.topViewInstance)==null?void 0:n.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||i.call(t,e.selectedIDs)},[e.selectedIDs]),React.useEffect(()=>(window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}),[]);const R=n=>{const{keyCode:a}=n;a===EKeyCode.Esc&&V()};return React.useEffect(()=>{var n,a,t;(t=(a=(n=e.topViewInstance)==null?void 0:n.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,x)},[e.topViewInstance,x]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","top-view"),title:S?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{V()}}),React__default.default.createElement("span",null,k("TopView")),React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:k("TopView"),onClick:()=>{P(!0)}}),toolbar:React__default.default.createElement(TopViewToolbar,{currentData:o})},React__default.default.createElement("div",{style:{position:"relative",flex:1}},React__default.default.createElement("div",{style:{width:"100%",height:"100%"},ref:p},C==null?void 0:C(g)),!S&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f}),React__default.default.createElement(ZAxisSlider,{checkMode:c,zAxisLimit:L,setZAxisLimit:H}),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"),__async=(s,r,t)=>new Promise((u,a)=>{var e=i=>{try{n(t.next(i))}catch(l){a(l)}},d=i=>{try{n(t.throw(i))}catch(l){a(l)}},n=i=>i.done?u(i.value):Promise.resolve(i.value).then(e,d);n((t=t.apply(s,r)).next())});const useHighlight=({currentData:s})=>{var r;const{mainViewInstance:t,topViewInstance:u,pointCloudBoxList:a,highlight2DDataList:e,setHighlight2DDataList:d}=React.useContext(PointCloudContext.PointCloudContext),n=(r=s==null?void 0:s.mappingImgList)!=null?r:[],i=(o,h)=>__async(void 0,null,function*(){var p;let g=[...e];if(e.find(c=>c.url===o)?g=e.filter(c=>c.url!==o):g.push({url:o,calib:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),PointCloudContext=require("../PointCloudContext.js"),__async=(s,r,t)=>new Promise((u,a)=>{var e=i=>{try{n(t.next(i))}catch(l){a(l)}},d=i=>{try{n(t.throw(i))}catch(l){a(l)}},n=i=>i.done?u(i.value):Promise.resolve(i.value).then(e,d);n((t=t.apply(s,r)).next())});const useHighlight=({currentData:s})=>{var r;const{mainViewInstance:t,topViewInstance:u,pointCloudBoxList:a,highlight2DDataList:e,setHighlight2DDataList:d}=React.useContext(PointCloudContext.PointCloudContext),n=(r=s==null?void 0:s.mappingImgList)!=null?r:[],i=(o,h,f)=>__async(void 0,null,function*(){var p;let g=[...e];if(e.find(c=>c.url===o)?g=e.filter(c=>c.url!==o):g.push({url:o,fallbackUrl:h,calib:f}),d(g),!t||(n==null?void 0:n.length)===0)return;const v=t.pointCloudObject;if(!v)return;const m=yield t.getHighlightIndexByMappingImgList({mappingImgList:g,points:v.geometry.attributes.position.array}),C=yield t.highlightOriginPointCloud(a,m);C&&((p=u==null?void 0:u.pointCloudInstance)==null||p.updateColor(C))}),l=React.useCallback(o=>e.findIndex(h=>h.url===o)>=0,[e]);return{toggle2dVisible:i,isHighlightVisible:l}};exports.useHighlight=useHighlight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),usePointCloudViews=require("./usePointCloudViews.js"),useSingleBox=require("./useSingleBox.js"),PointCloudContext=require("../PointCloudContext.js"),ahooks=require("ahooks"),lbUtils=require("@labelbee/lb-utils");const useRotateEdge=({currentData:t})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:l,updateSelectedBox:d}=useSingleBox.useSingleBox(),{run:c}=ahooks.useThrottleFn(a=>{const{topViewInstance:r,mainViewInstance:i,syncAllViewPointCloudColor:P}=o;if(!r||!i)return;const{pointCloud2dOperation:s}=r,e=l==null?void 0:l.info;if(!e||!(t==null?void 0:t.url)||!o.backViewInstance)return;const n=s.selectedPolygon.pointList||[],g=n.shift();n.push(g);const C=d({newPointList:n,rotation:lbUtils.PointCloudUtils.restrictAngleRange(e.rotation+Number(Math.PI*a)/180),width:e.height,height:e.width});s.rotatePolygonEdge(n);const u=s.selectedPolygon;i.generateBox(e),P(C),usePointCloudViews.synchronizeSideView(e,u,o.sideViewInstance,t.url),usePointCloudViews.synchronizeBackView(e,u,o.backViewInstance,t.url),i.render()},{wait:800});return{updateRotateEdge:c}};exports.useRotateEdge=useRotateEdge;
|
package/dist/index.css
CHANGED
|
@@ -2539,14 +2539,14 @@
|
|
|
2539
2539
|
margin-right: 16px;
|
|
2540
2540
|
background-image: url("../dist/assets/icons/7eadb9c4.svg");
|
|
2541
2541
|
}
|
|
2542
|
-
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-
|
|
2542
|
+
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-90 {
|
|
2543
2543
|
display: inline-block;
|
|
2544
2544
|
height: 24px;
|
|
2545
2545
|
width: 24px;
|
|
2546
2546
|
background-repeat: no-repeat;
|
|
2547
2547
|
cursor: pointer;
|
|
2548
2548
|
flex: none;
|
|
2549
|
-
background-image: url("../dist/assets/icons/
|
|
2549
|
+
background-image: url("../dist/assets/icons/ad33251.svg");
|
|
2550
2550
|
}
|
|
2551
2551
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__next {
|
|
2552
2552
|
font-size: 24px;
|
|
@@ -23,6 +23,7 @@ type UnlinkImageItem = string;
|
|
|
23
23
|
type AttrPanelLayout = '' | 'left' | 'right';
|
|
24
24
|
interface IHighlight2DData {
|
|
25
25
|
url: string;
|
|
26
|
+
fallbackUrl: string;
|
|
26
27
|
calib?: ICalib;
|
|
27
28
|
}
|
|
28
29
|
export interface IPointCloudContext extends IPointCloudContextInstances, IPointCloudStatus, IPointCloudSegment {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { IAnnotationStateProps } from '../../../store/annotation/map';
|
|
7
7
|
import { ICalib } from '@labelbee/lb-utils';
|
|
8
8
|
declare const useHighlight: ({ currentData }: Partial<IAnnotationStateProps>) => {
|
|
9
|
-
toggle2dVisible: (url: string, calib?: ICalib) => Promise<void>;
|
|
9
|
+
toggle2dVisible: (url: string, fallbackUrl: string, calib?: ICalib) => Promise<void>;
|
|
10
10
|
isHighlightVisible: (url: string) => boolean;
|
|
11
11
|
};
|
|
12
12
|
export { useHighlight };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { IAnnotationStateProps } from '@/store/annotation/map';
|
|
3
|
+
/**
|
|
4
|
+
* PointCloud Rotate Hook
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const useRotateEdge: ({ currentData }: IAnnotationStateProps) => {
|
|
8
|
+
updateRotateEdge: import("lodash").DebouncedFunc<(angle: number) => void>;
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../common/index.js"),icon_move_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js"),icon_mouse_left_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js"),icon_mouse_right_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js"),changePointCloudValid=require("../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js"),copy=require("../../../../../../assets/annotation/pointCloudTool/copy.svg.js"),nextBox=require("../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js"),patse=require("../../../../../../assets/annotation/pointCloudTool/patse.svg.js"),prevBox=require("../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js"),rotate90_black=require("../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js"),selectAll=require("../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js"),selectMultiple=require("../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js"),icon_tab_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js"),icon_del_kj=require("../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js"),lassoSelector=require("../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),icon_rect=require("../../../../../../assets/annotation/rectTool/icon_rect.svg.js"),circleSelector=require("../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),addSvg=require("../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js"),clearSvg=require("../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js"),React=require("react"),icons=require("@ant-design/icons"),index$1=require("../polygon/index.js");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var React__default=_interopDefaultLegacy(React);const changePointSize={name:"PointThickness",icon:React__default.default.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},rotateRoundCenter={name:"RotateAroundCenterPoint",icon:React__default.default.createElement(icons.ReloadOutlined,null),shortCut:[icon_mouse_left_kj],noticeInfo:"DragOperation"},Drag3D={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj],noticeInfo:"Drag"},DragTopView={name:"TopViewTranslate",icon:icon_move_kj,shortCut:[icon_mouse_right_kj]},ChangeInvalid={name:"ChangePointCloudValid",icon:changePointCloudValid,shortCut:["V"]},CopyBox={name:"CopyBox",icon:copy,shortCut:["Ctrl","C"]},PasteBox={name:"PasteBox",icon:patse,shortCut:["Ctrl","V"]},LeftRotate={name:"RotateLeft",icon:React__default.default.createElement(icons.RotateLeftOutlined,null),shortCut:["Q"]},RightRotate={name:"RotateRight",icon:React__default.default.createElement(icons.RotateRightOutlined,null),shortCut:["E"]},PrevBox={name:"PreviousBox",icon:prevBox,shortCut:["Shift","Tab"]},NextBox={name:"NextBox",icon:nextBox,shortCut:["Tab"]},Rotate90={name:"Rotate90",icon:rotate90_black,shortCut:["G"],noticeInfo:"SelectedStatus"},CopyPrevPage={name:"CopyPrevPage",icon:copy,shortCut:["Alt","C"]},ChangeBoxInvalid={name:"ChangeBoxValid",icon:icon_tab_kj,shortCut:["F"],noticeInfo:"SelectedStatus"},SelectMulti={name:"MultiSelect",icon:selectMultiple,shortCut:["Ctrl",icon_mouse_right_kj]},SelectAll={name:"SelectAllBox",icon:selectAll,shortCut:["Ctrl","A"]},deleteBox={name:"Delete",icon:icon_del_kj,shortCut:["Del"],noticeInfo:"SelectedStatus"},LassoSelector={name:"LassoSelector",icon:lassoSelector,shortCut:["H"],noticeInfo:"SelectorMsg"},RectSelector={name:"RectSelector",icon:icon_rect,shortCut:["J"],noticeInfo:"SelectorMsg"},CircleSelector={name:"CircleSelector",icon:circleSelector,shortCut:["K"],noticeInfo:"SelectorMsg"},Drag3DBySpace={name:"PointCloudViewTranslate",icon:icon_move_kj,shortCut:["space",icon_mouse_right_kj]},AddMove={name:"AddPoint",icon:addSvg,shortCut:["U"]},DeletePoint={name:"DeletePoint",icon:clearSvg,shortCut:["I"]},pointCloudShortCutTable=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"RectPattern"},CopyBox,PasteBox,LeftRotate,RightRotate,PrevBox,NextBox,Rotate90,CopyPrevPage,ChangeBoxInvalid,deleteBox,SelectMulti,SelectAll,index.fullScreen],pointCloudShortCutTable_POLYGON=[{name:"GeneralOperation"},index.backward,index.forward,changePointSize,index.scale,rotateRoundCenter,Drag3D,DragTopView,ChangeInvalid,{name:"PolygonPattern"},index$1.polygon,index$1.invalidPolygon,index$1.selectedPolygon,index$1.changePolygonAttribute,index$1.deletePolygon,index$1.insertPolygonPoint,index$1.deletePolygonPoint],pointCloudShortCutTable_SEGMENT=[index.backward,index.forward,rotateRoundCenter,Drag3DBySpace,LassoSelector,RectSelector,CircleSelector,AddMove,DeletePoint];exports.default=pointCloudShortCutTable,exports.pointCloudShortCutTable_POLYGON=pointCloudShortCutTable_POLYGON,exports.pointCloudShortCutTable_SEGMENT=pointCloudShortCutTable_SEGMENT;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var a="data:image/svg+xml,%3csvg t='1717751173252' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3511' width='16' height='16'%3e %3cpath d='M490.666667 59.733333C240.896 59.733333 38.4 262.229333 38.4 512c0 249.770667 202.496 452.266667 452.266667 452.266667a452.266667 452.266667 0 0 0 406.954666-254.72 25.6 25.6 0 0 0-46.08-22.4A401.066667 401.066667 0 1 1 891.733333 512a25.6 25.6 0 0 0 51.242667 0c0-249.770667-202.496-452.266667-452.266667-452.266667z' fill='black' p-id='3512' %3e%3c/path%3e %3cpath d='M917.333333 192a21.333333 21.333333 0 0 0-20.992 17.493333L896 213.333333v298.666667a21.333333 21.333333 0 0 0 42.325333 3.84L938.666667 512V213.333333a21.333333 21.333333 0 0 0-21.333334-21.333333z' fill='black' p-id='3513' %3e%3c/path%3e %3cpath d='M322.688 523.093333c-29.568 0-45.696-20.736-45.696-56.832 0-36.864 19.2-58.752 43.392-58.752 30.72 0 51.84 25.344 56.064 81.024-16.896 24.576-36.48 34.56-53.76 34.56z m-82.176 113.28c16.512 16.896 39.552 29.952 72.192 29.952 54.528 0 105.216-44.544 105.216-155.904 0-93.312-43.776-137.088-97.92-137.088-45.696 0-84.096 36.864-84.096 92.928 0 59.136 31.872 88.704 79.104 88.704 21.504 0 45.696-12.672 62.208-33.024-2.688 80.64-32.256 108.288-66.432 108.288-18.048 0-35.328-8.448-46.464-21.12l-23.808 27.264zM547.712 666.325333c55.296 0 91.392-49.152 91.392-147.456 0-97.536-36.096-145.536-91.392-145.536-55.68 0-91.392 47.616-91.392 145.536 0 98.304 35.712 147.456 91.392 147.456z m0-34.944c-28.8 0-49.152-30.72-49.152-112.512 0-81.024 20.352-110.592 49.152-110.592 28.8 0 49.152 29.568 49.152 110.592 0 81.792-20.352 112.512-49.152 112.512zM730.88 480.085333c31.104 0 56.832-23.04 56.832-57.216 0-34.176-25.728-57.216-56.832-57.216-30.336 0-56.448 23.04-56.448 57.216 0 34.176 26.112 57.216 56.448 57.216z m0-23.04c-18.432 0-31.104-14.208-31.104-34.176 0-20.352 12.672-34.56 31.104-34.56 18.816 0 31.488 14.208 31.488 34.56 0 19.968-12.672 34.176-31.488 34.176z' fill='black' p-id='3514' %3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemoizedFn as
|
|
1
|
+
import{useMemoizedFn as w,useLatest as Y}from"ahooks";import{Spin as Z}from"antd/es";import V,{useContext as ee,useRef as z,useState as te,useMemo as re,useEffect as d}from"react";import{connect as ne}from"react-redux";import{usePointCloudViews as oe}from"../pointCloudView/hooks/usePointCloudViews.js";import{PointCloudContext as ie}from"../pointCloudView/PointCloudContext.js";import{a2MapStateToProps as le}from"../../store/annotation/map.js";import{LabelBeeContext as ce}from"../../store/ctx.js";import{PointCloud2DRectOperation as ue,ImgUtils as ae}from"@labelbee/lb-annotation";var se=Object.defineProperty,de=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,J=(c,i,l)=>i in c?se(c,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[i]=l,m=(c,i)=>{for(var l in i||(i={}))pe.call(i,l)&&J(c,l,i[l]);if(F)for(var l of F(i))me.call(i,l)&&J(c,l,i[l]);return c},R=(c,i)=>de(c,fe(i)),T=(c,i,l)=>new Promise((u,f)=>{var v=a=>{try{_(l.next(a))}catch(p){f(p)}},P=a=>{try{_(l.throw(a))}catch(p){f(p)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(v,P);_((l=l.apply(c,i)).next())});const ve=c=>{var i,l;const{mappingData:u,size:f,config:v,checkMode:P,afterImgOnLoad:_,shouldExcludePointCloudBoxListUpdate:a}=c,p=(i=u==null?void 0:u.url)!=null?i:"",b=(l=u==null?void 0:u.fallbackUrl)!=null?l:"",{pointCloudBoxList:I,setPointCloudResult:S,defaultAttribute:h,rectList:C,addRectIn2DView:$,updateRectIn2DView:N,removeRectIn2DView:q}=ee(ie),{update2DViewRect:G,remove2DViewRect:H}=oe(),y=V.useRef(null),n=z(null),j=w(G),B=w(H),O=z(null),[K,E]=te(!0),x=re(()=>C==null?void 0:C.filter(e=>e.imageName===(u==null?void 0:u.path)),[u==null?void 0:u.path,C]),D=Y(u==null?void 0:u.path),U=e=>{const{boxID:o}=e;if(!a&&o){const t=j==null?void 0:j(e);O.current=t,S(t);return}N(e,!0)},A=e=>{D.current&&$(R(m({},e),{imageName:D.current}))},k=e=>{if(!a){const o=e.find(t=>t.boxID);if(o){const t=B==null?void 0:B(o);O.current=t,S(t),g();return}}q(e)},Q=w(()=>{let e=[];return I.forEach(o=>{const{rects:t=[],id:r,attribute:s,trackID:L}=o,M=t.find(X=>X.imageName===D.current),W=r+"_"+D.current;M&&(e=[...e,R(m({},M),{boxID:r,id:W,attribute:s,order:L})])}),e}),g=w(()=>{var e,o,t;const r=a?[]:Q(),s=(e=n.current)==null?void 0:e.selectedRectID;(o=n.current)==null||o.setResult([...r,...x]),s&&((t=n.current)==null||t.setSelectedRectID(s))});return d(()=>{if(y.current){const e=new ue({container:y.current,size:f,config:R(m({},v),{isShowOrder:!0,attributeConfigurable:!0}),checkMode:P});return n.current=e,n.current.init(),n.current.on("updateDragResult",U),n.current.on("afterAddingDrawingRect",A),n.current.on("deleteSelectedRects",k),()=>{var o,t,r,s;(o=n.current)==null||o.unbind("updateDragResult",U),(t=n.current)==null||t.unbind("afterAddingDrawingRect",A),(r=n.current)==null||r.unbind("deleteSelectedRects",k),(s=n.current)==null||s.destroy()}}},[]),d(()=>{const e=t=>T(void 0,null,function*(){try{return yield ae.load(t)}catch(r){return console.error("Error loading image:",r),null}}),o=()=>T(void 0,null,function*(){var t;E(!0);let r=yield e(p);!r&&b&&(r=yield e(b)),r&&((t=n.current)==null||t.setImgNode(r),_(r)),E(!1)});n.current&&(p||b)&&o()},[p,b]),d(()=>{var e;(e=n.current)==null||e.setSize(f)},[f]),d(()=>{I!==O.current&&g()},[I]),d(()=>{var e,o,t;const r=x.find(s=>s.id===n.current.selectedRectID);(o=(e=n.current)==null?void 0:e.setDefaultAttribute)==null||o.call(e,h),r&&N(R(m({},(t=n.current)==null?void 0:t.selectedRect),{attribute:h})),g()},[h]),d(()=>{g()},[x]),d(()=>{g()},[a]),d(()=>{var e,o,t,r;const s=(o=(e=n.current)==null?void 0:e.config)!=null?o:{},L=R(m({},s),{attributeList:(t=v.attributeList)!=null?t:[]});(r=n.current)==null||r.setConfig(JSON.stringify(L))},[v.attributeList]),V.createElement(Z,{spinning:K},V.createElement("div",{ref:y,style:m({position:"relative"},f)}))};var _e=ne(le,null,null,{context:ce})(ve);export{_e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as U}from"../../utils/dom.js";import l,{useRef as j,useState as A,useContext as F,useMemo as M,useCallback as T,useEffect as q}from"react";import w from"../AnnotationView/index.js";import G from"../../hooks/useSize.js";import{useSingleBox as J}from"./hooks/useSingleBox.js";import{useHighlight as K}from"./hooks/useHighlight.js";import Q from"./components/HighlightVisible/index.js";import{PointCloudContext as W}from"./PointCloudContext.js";import X from"./hooks/useDataLinkSwitch.js";import Y from"../pointCloud2DRectOperationView/index.js";var Z=(o,r,e)=>new Promise((s,c)=>{var f=t=>{try{i(e.next(t))}catch(n){c(n)}},u=t=>{try{i(e.throw(t))}catch(n){c(n)}},i=t=>t.done?s(t.value):Promise.resolve(t.value).then(f,u);i((e=e.apply(o,r)).next())});const $=({view2dData:o,setSelectedID:r,currentData:e,showEnlarge:s,checkMode:c=!1,measureVisible:f})=>{var u,i;const t=j(null),n=j(),{selectedBox:d}=J(),g=G(t),{url:k,fallbackUrl:x,calib:b,path:y}=o,{toggle2dVisible:_,isHighlightVisible:v}=K({currentData:e}),[z,C]=A(!1),{cuboidBoxIn2DView:p,cacheImageNodeSize:B}=F(W),I=!o,O=M(()=>({zIndex:s?-1:101,is2DView:!p,imageName:o.path}),[s,p,o.path]),{rendered:R,isLinking:E}=X(O),L=m=>{h(),B({path:y,imgNode:m})},h=T(()=>{var m,S;const V=(m=n.current)==null?void 0:m.toolInstance;if(r(""),!d||!V)return;const a=o.annotations.find(N=>N.annotation.id===d.info.id);let P="";a&&((S=a==null?void 0:a.annotation.pointList)==null?void 0:S.length)>0&&(V.focusPositionByPointList(a==null?void 0:a.annotation.pointList),P=d.info.id,r(P))},[d,n.current,o.annotations]);q(()=>{h()},[h]);const H=()=>Z(void 0,null,function*(){C(!0),yield _(k,x!=null?x:"",b),C(!1)});return l.createElement("div",{className:U("point-cloud-2d-image"),ref:t},p?l.createElement(w,{src:(u=o==null?void 0:o.url)!=null?u:"",fallbackSrc:(i=o==null?void 0:o.fallbackUrl)!=null?i:"",annotations:o.annotations,size:g,ref:n,globalStyle:{display:I?"none":"block"},afterImgOnLoad:L,zoomInfo:{min:.01,max:1e3,ratio:.4},measureVisible:f}):l.createElement(l.Fragment,null,l.createElement(Y,{shouldExcludePointCloudBoxListUpdate:!E,mappingData:o,size:g,checkMode:c,afterImgOnLoad:L}),R),b&&l.createElement(Q,{visible:v(k),onClick:H,loading:z,style:{position:"absolute",right:16,top:16,zIndex:s?-1:101}}))};export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as
|
|
1
|
+
import{PointCloudContext as te}from"./PointCloudContext.js";import{useRotate as oe}from"./hooks/useRotate.js";import{useRotateEdge as re}from"./hooks/useRotateEdge.js";import{useBoxes as ne}from"./hooks/useBoxes.js";import{useSingleBox as se}from"./hooks/useSingleBox.js";import{useSphere as ie}from"./hooks/useSphere.js";import{useContext as ae,useEffect as c}from"react";import{EPointCloudName as ue,CommonToolUtils as le,AttributeUtils as de,EToolName as P,cTool as ce}from"@labelbee/lb-annotation";import{message as h}from"antd";import{connect as pe}from"react-redux";import{a2MapStateToProps as me}from"../../store/annotation/map.js";import{useStatus as ve}from"./hooks/useStatus.js";import{usePointCloudViews as be}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as Pe,useDispatch as ye}from"../../store/ctx.js";import{useHistory as fe}from"./hooks/useHistory.js";import{useAttribute as we}from"./hooks/useAttribute.js";import{useConfig as Ce}from"./hooks/useConfig.js";import{usePolygon as ge}from"./hooks/usePolygon.js";import{useLine as he}from"./hooks/useLine.js";import{useTranslation as Se}from"react-i18next";import{PreDataProcess as ke}from"../../store/annotation/actionCreators.js";var xe=Object.defineProperty,_e=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,I=(l,r,u)=>r in l?xe(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,y=(l,r)=>{for(var u in r||(r={}))Le.call(r,u)&&I(l,u,r[u]);if(E)for(var u of E(r))Be.call(r,u)&&I(l,u,r[u]);return l},f=(l,r)=>_e(l,Ve(r));const{EPolygonPattern:Oe}=ce,je=({currentData:l,config:r,checkMode:u,configString:D,imgIndex:S,toolInstanceRef:i})=>{const t=ae(te),{changeSelectedBoxValid:T,selectNextBox:N,selectPrevBox:H,updateSelectedBox:k,deleteSelectedPointCloudBoxAndPolygon:K}=se(),{selectedSphere:w,updatePointCloudSphere:U}=ie(),{clearAllResult:C,updatePointCloudPattern:R}=ve(),{copySelectedBoxes:z,pasteSelectedBoxes:F,copiedBoxes:q}=ne({config:r}),{updateRotate:x}=oe({currentData:l}),{updateRotateEdge:G}=re({currentData:l}),{updatePointCloudData:v,topViewSelectedChanged:_}=be(),{redo:V,undo:L,pushHistoryWithList:M,pushHistoryUnderUpdatePolygon:W,pushHistoryUnderUpdateLine:Y}=fe(),$=ye(),{syncThreeViewsAttribute:B}=we(),{syncAllViewsConfig:J,reRenderTopViewRange:Q}=Ce(),{selectedPolygon:O}=ge(),{selectedLine:j}=he(),{t:g}=Se(),b=e=>{var o;const{topViewInstance:n}=t;!n||(o=n.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},X=(e,o)=>{var n,a;const{topViewInstance:d,mainViewInstance:s}=t;if(!d)return;const{pointCloud2dOperation:p}=d;switch(e){case"q":{x(t.rectRotateSensitivity);break}case"e":x(-Number(t.rectRotateSensitivity));break;case"g":G(-90);break;case"u":{const m=p.pattern===Oe.Normal?P.Rect:P.Polygon;R(m);const ee={[P.Polygon]:g("PolygonPattern"),[P.Rect]:g("RectPattern")};h.success(g("ChangePatternMsg",{pattern:ee[m]})),p.clearActiveStatus(),p.clearDrawingStatus()}break;case"+":s==null||s.updatePointSize({zoomIn:!0});break;case"-":s==null||s.updatePointSize({zoomIn:!1});break;case"v":t.setPointCloudValid(!t.valid);break;case"tab":if(o.shiftKey){H();break}N(),o.preventDefault();break;case"f":T();break;case"arrowup":b({y:-1});break;case"arrowdown":b({y:1});break;case"arrowleft":b({x:-1});break;case"arrowright":b({x:1});break;case"delete":K();break;default:{if(((n=r.attributeList)==null?void 0:n.length)>0){const m=de.getAttributeByKeycode(o.keyCode,r.attributeList);m!==void 0&&((a=i.current)==null||a.setDefaultAttribute(m))}return}}},Z=(e,o)=>{switch(e){case"c":z();break;case"v":F();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?V():L();break}}},A=e=>{if(!le.hotkeyFilter(e)||u===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){Z(o,e);return}X(o,e)};return c(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[t,q,r,t.pointCloudBoxList,t.polygonList]),c(()=>{J(r)},[D]),c(()=>{(r==null?void 0:r.radius)&&Q(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),c(()=>{v==null||v()},[S,t.mainViewInstance]),c(()=>{t.setHideAttributes([])},[S]),c(()=>{i.current.setDefaultAttribute=e=>{var o,n,a,d;B(e);const s=t.selectedPointCloudBox;if(s){s.attribute=e;const p=$(ke({tool:ue.PointCloud,dataList:[s],stepConfig:r,action:"viewUpdateBox"}));s.valid=p[0].valid;const m=k(s);(a=(n=(o=t==null?void 0:t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:n.setPolygonValidAndRender)==null||a.call(n,s.id,!0,s.valid),t.mainViewInstance&&_({newSelectedBox:s,newPointCloudList:m})}if(O&&W(f(y({},O),{attribute:e})),j&&Y(f(y({},j),{attribute:e})),w){const p=U(f(y({},w),{attribute:e}));t.mainViewInstance&&((d=t.mainViewInstance)==null||d.generateSpheres(p),_({newSelectedSphere:w,newSphereList:p}))}},i.current.setSubAttribute=(e,o)=>{var n;const a=t.selectedPointCloudBox;if(a){const d=(n=a==null?void 0:a.subAttribute)!=null?n:{};a.subAttribute=f(y({},d),{[e]:o}),k(a)}},i.current.clearResult=()=>{C==null||C()},i.current.redo=()=>{V()},i.current.undo=()=>{L()},i.current.setValid=e=>{i.current.valid=e,setTimeout(()=>{t.setPointCloudValid(e),e===!1&&C()})},i.current.setForbidOperation=e=>{var o,n;(n=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||n.setForbidOperation(e),e===!0&&t.setSelectedIDs(void 0)},i.current.setShowDefaultCursor=e=>{var o,n;(n=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||n.setShowDefaultCursor(e)},i.current.asyncData=e=>{setTimeout(()=>{v==null||v(e)})}},[t.pointCloudBoxList,t.pointCloudSphereList,t.selectedID,t.valid,t.polygonList,t.lineList,t.mainViewInstance,t.ptSegmentInstance]),c(()=>{i.current.updateSegmentTool=e=>{var o;(o=t.ptSegmentInstance)==null||o.emit(e)},i.current.segmentInstance=t.ptSegmentInstance},[t.ptSegmentInstance]),c(()=>{i.current.history={pushHistory:e=>{M({pointCloudBoxList:e})},initRecord:()=>{}}},[]),c(()=>{var e;const o=(e=t.topViewInstance)==null?void 0:e.toolInstance;if(!o||u)return;const n=s=>{B(s)},a=s=>{h.error(s)},d=s=>{h.info(s)};return o.on("syncAttribute",n),o.on("messageError",a),o.on("messageInfo",d),()=>{o.unbind("syncAttribute",n),o.unbind("messageError",a),o.unbind("messageInfo",d)}},[t.topViewInstance]),null};var Ae=pe(me,null,null,{context:Pe})(je);export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a2MapStateToProps as
|
|
1
|
+
import{a2MapStateToProps as z}from"../../store/annotation/map.js";import{LabelBeeContext as R}from"../../store/ctx.js";import f,{useContext as V,useRef as m,useState as x,useEffect as v,useCallback as B,useMemo as A}from"react";import W from"../AnnotationView/index.js";import{connect as T}from"react-redux";import{PointCloudContext as U}from"./PointCloudContext.js";import G from"./components/TitleButton/index.js";import{Spin as H}from"antd";import N from"../../_virtual/highlightSegmentWorker.js";import{pointMappingLidar2image as Y}from"@labelbee/lb-annotation";import{debounce as $}from"lodash";var q=Object.defineProperty,J=Object.defineProperties,K=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,k=(t,o,n)=>o in t?q(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,Z=(t,o)=>{for(var n in o||(o={}))Q.call(o,n)&&k(t,n,o[n]);if(D)for(var n of D(o))X.call(o,n)&&k(t,n,o[n]);return t},ee=(t,o)=>J(t,K(o));const te=({path:t,url:o,fallbackUrl:n,calib:c,pcdUrl:s,highlightAttribute:u})=>{const{ptSegmentInstance:e,cacheImageNodeSize:O,imageSizes:E}=V(U),F=m(null),g=m(0),h=m({}),p=m(),[P,_]=x([]),[I,C]=x(!1),S=m(void 0);v(()=>()=>{g.current=0,h.current={},p.current=void 0},[s]);const b=B(()=>{var r,l,i;if(g.current=g.current+1,g.current===2){const a=(r=e==null?void 0:e.store)==null?void 0:r.originPoints;if(!a||!p.current){console.error("cacheMappingPCD2Img Error",{path:t,points:a,filterSize:p.current});return}h.current=(i=(l=Y(a,c,p.current))==null?void 0:l.pcdMapping)!=null?i:{}}},[e]),y=A(()=>$((l,i)=>{var a,w;if(l&&p.current){S.current&&((w=(a=S.current)==null?void 0:a.terminate)==null||w.call(a));const M=h.current,d=new N;d.current=d,C(!0),d.postMessage({cacheMap:M,indexes:l,defaultRGBA:i}),d.onmessage=L=>{_(L.data.annotations),d.terminate(),C(!1),d.current=void 0}}},100),[]);v(()=>{if(!(e==null?void 0:e.store))return;const r=e.store.getHighlightAttribute(u!=null?u:""),l=e==null?void 0:e.getColorFromConfig(u!=null?u:"");y(r.flat(),l.stroke)},[u,e]),v(()=>{if(e){const r=({newAttribute:l})=>{const i=e==null?void 0:e.getColorFromConfig(l);i&&_(P.map(a=>ee(Z({},a),{defaultRGBA:i.stroke})))};return e.on("updateDefaultAttribute",r),()=>{e.unbind("updateDefaultAttribute",r)}}},[e,P]),v(()=>{if(e){const r=l=>{if(l.cacheSegData){const{cacheSegData:i}=l;if(i==null?void 0:i.indexes){const a=e.getColorFromConfig(i.attribute);y(i==null?void 0:i.indexes,a.stroke)}}else _([])};return e.on("syncPointCloudStatus",r),e.on("loadPCDFileEnd",b),()=>{e.unbind("syncPointCloudStatus",r),e.unbind("loadPCDFileEnd",b)}}},[e,s,E]);const j=r=>{O({path:t,imgNode:r}),p.current={width:r.width,height:r.height},b()};return f.createElement("div",{key:t,style:{position:"relative"},ref:F},f.createElement(G,{title:c.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF",position:"absolute",top:10,left:10,zIndex:1}}),f.createElement(H,{spinning:I,delay:1e3},f.createElement(W,{size:{width:300,height:200},key:t,src:o,fallbackSrc:n,annotations:P,afterImgOnLoad:j})))},oe=({currentData:t,highlightAttribute:o})=>{var n;const c=(n=t.mappingImgList)!=null?n:[];return(c==null?void 0:c.length)>0?f.createElement("div",{style:{position:"absolute",height:"100%",overflowY:"scroll",zIndex:100,width:300}},c==null?void 0:c.map((s,u)=>{var e;return s.calib&&f.createElement(te,{key:s.path+u,path:s.path,url:s.url,fallbackUrl:(e=s.fallbackUrl)!=null?e:"",calib:s.calib,pcdUrl:t.url,highlightAttribute:o})})):null};var ne=T(z,null,null,{context:R})(oe);export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as I}from"../../utils/dom.js";import{FooterDivider as z}from"../../views/MainView/toolFooter/index.js";import{ZoomController as ae}from"../../views/MainView/toolFooter/ZoomController/index.js";import{LeftOutlined as ce,UpSquareOutlined as de,DownSquareOutlined as pe}from"@ant-design/icons";import{cKeyCode as ue,PointCloudAnnotation as me,cTool as fe,cAnnotation as ve}from"@labelbee/lb-annotation";import{PointCloudUtils as H}from"@labelbee/lb-utils";import i,{useState as W,useRef as we,useLayoutEffect as Ce,useEffect as x}from"react";import{PointCloudContext as F}from"./PointCloudContext.js";import{useRotate as ge}from"./hooks/useRotate.js";import{useRotateEdge as Pe}from"./hooks/useRotateEdge.js";import{useSingleBox as K}from"./hooks/useSingleBox.js";import{PointCloudContainer as ye}from"./PointCloudLayout.js";import{BoxInfos as X,PointCloudValidity as Ie}from"./PointCloudInfos.js";import{usePolygon as xe}from"./hooks/usePolygon.js";import{useSphere as Y}from"./hooks/useSphere.js";import{useZoom as q}from"./hooks/useZoom.js";import{Slider as he}from"antd";import{a2MapStateToProps as Ve}from"../../store/annotation/map.js";import{connect as Se}from"react-redux";import{usePointCloudViews as _e}from"./hooks/usePointCloudViews.js";import Ee from"../../hooks/useSize.js";import{useTranslation as Le}from"react-i18next";import{LabelBeeContext as Oe}from"../../store/ctx.js";import{jsonParser as be}from"../../utils/index.js";import je from"../../utils/ToolUtils.js";import Te from"lodash";import ke from"./components/PointCloudSizeSlider/index.js";import{useHistory as Ae}from"./hooks/useHistory.js";import Ne from"./components/TitleButton/index.js";var Re=Object.defineProperty,Be=Object.defineProperties,De=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,$=(n,l,r)=>l in n?Re(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r,B=(n,l)=>{for(var r in l||(l={}))Ue.call(l,r)&&$(n,r,l[r]);if(M)for(var r of M(l))Ze.call(l,r)&&$(n,r,l[r]);return n},D=(n,l)=>Be(n,De(l));const{EPolygonPattern:ze,EToolName:G}=fe,{ESortDirection:J}=ve,He=ue.default,Q=(n,l,r=1)=>{const{width:w,height:u}=l,P={x:n.x+w*r/2,y:n.y+u*r/2},y={x:l.width/2,y:l.height/2};return{offsetX:(y.x-P.x)/r,offsetY:-(y.y-P.y)/r}},We=({currentData:n})=>{var l,r;const{zoom:w,zoomIn:u,zoomOut:P,initialPosition:y}=q(),{selectNextBox:E,selectPrevBox:L}=K(),{switchToNextSphere:h}=Y(),{updateRotate:V}=ge({currentData:n}),{updateRotateEdge:O}=Pe({currentData:n}),g=i.useContext(F),{topViewInstance:S}=g,m=(r=(l=g==null?void 0:g.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:r.getCurrentToolName(),e=()=>{V(-Number(g.rectRotateSensitivity))},c=()=>{V(g.rectRotateSensitivity)},f=()=>{O(-90)};return i.createElement(i.Fragment,null,i.createElement(ke,{onChange:b=>{var _;(_=S==null?void 0:S.pointCloudInstance)==null||_.updatePointSize({customSize:b})}}),i.createElement("span",{onClick:c,className:I("point-cloud","rotate-reserve")}),i.createElement("span",{onClick:e,className:I("point-cloud","rotate")}),i.createElement("span",{onClick:f,className:I("point-cloud","rotate-90")}),i.createElement(z,null),i.createElement(de,{onClick:()=>{if(m===G.Point){h(J.descend);return}L(!0)},className:I("point-cloud","prev")}),i.createElement(pe,{onClick:()=>{if(m===G.Point){h(J.ascend);return}E(!0)},className:I("point-cloud","next")}),i.createElement(z,null),i.createElement(ae,{initialPosition:y,zoomIn:u,zoomOut:P,zoom:w}))},Fe=({setZAxisLimit:n,zAxisLimit:l,checkMode:r})=>r?null:i.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},i.createElement(he,{vertical:!0,step:.5,max:10,min:.5,defaultValue:l,onAfterChange:w=>{n(w)}})),Ke=({currentData:n,imgList:l,stepInfo:r,drawLayerSlot:w,checkMode:u,intelligentFit:P,setIsEnlargeTopView:y,isEnlargeTopView:E,onExitZoom:L,highlightAttribute:h})=>{var V,O;const[g,S]=W({zoom:1,currentPos:{x:0,y:0}}),m=we(null),e=i.useContext(F),c=Ee(m),f=be(r.config),{setZoom:b,syncTopviewToolZoom:_}=q(),{hideAttributes:ee}=e,{addPolygon:te,deletePolygon:oe}=xe(),{deletePointCloudSphere:ne}=Y(),{deletePointCloudBox:ie,changeValidByID:se}=K(),[j,le]=W(10),{t:U}=Le(),C=_e(),{pushHistoryWithList:re}=Ae();Ce(()=>{if(!e.topViewInstance&&m.current&&(n==null?void 0:n.url)&&(n==null?void 0:n.result)){const o={width:m.current.clientWidth,height:m.current.clientHeight},a=new me({container:m.current,size:o,pcdPath:n.url,config:D(B({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:u,toolName:je.getPointCloudToolList(),proxyMode:u});e.setTopViewInstance(a)}},[n]),x(()=>{if(!c||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:o}=e.topViewInstance;o.singleOn("dataUpdated",(t,s)=>{const p=Te.cloneDeep(t).map(d=>D(B({},d),{pointList:H.pointListTransferCanvas2World(d.pointList,c)}));e.setSelectedIDs(s),e.setLineList(p),re({lineList:p})}),o.singleOn("pointCreated",(t,s)=>{C.topViewAddSphere({newPoint:t,size:c,trackConfigurable:f.trackConfigurable,zoom:s})}),o.singleOn("pointDeleted",t=>{ne(t)}),o.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),o.singleOn("updatePointByDrag",(t,s)=>{var p;(p=C.topViewUpdatePoint)==null||p.call(C,t,c)}),o.singleOn("polygonCreated",(t,s)=>{if(o.pattern===ze.Normal||!(n==null?void 0:n.url)){const p=D(B({},t),{pointList:t.pointList.map(d=>H.transferCanvas2World(d,c))});te(p),e.setSelectedIDs(ee.includes(t.attribute)?"":t.id);return}C.topViewAddBox({polygon:t,size:c,imgList:l,trackConfigurable:f.trackConfigurable,zoom:s,intelligentFit:P})}),o.singleOn("deletedObject",({id:t})=>{ie(t),oe(t)}),o.singleOn("deleteSelectedIDs",()=>{e.setSelectedIDs([])}),o.singleOn("addSelectedIDs",t=>{e.addSelectedID(t)}),o.singleOn("setSelectedIDs",t=>{e.setSelectedIDs(t)}),o.singleOn("updatePolygonByDrag",t=>{var s;(s=C.topViewUpdateBox)==null||s.call(C,t,c)});const a=t=>{var s;const p=se(t);p&&e.syncAllViewPointCloudColor(p),e.polygonList.find(d=>d.id===t)&&((s=e.topViewInstance)==null||s.toolInstance.setPolygonValidAndRender(t,!0))};return o.on("validUpdate",a),()=>{o.unbind("validUpdate",a)}},[e,c,n,C,e.polygonList,e.lineList,(V=e.topViewInstance)==null?void 0:V.toolInstance]),x(()=>{var o,a;if(!(c==null?void 0:c.width)||!e.topViewInstance)return;const t=(a=(o=f==null?void 0:f.attributeList)==null?void 0:o[0])==null?void 0:a.value;t&&e.topViewInstance.toolInstance.setDefaultAttribute(t),e.topViewInstance.initSize(c),e.topViewInstance.updatePolygonList(e.displayPointCloudList,e.polygonList),e.topViewInstance.updatePointList(e.displaySphereList),e.topViewInstance.updateLineList(e.displayLineList);const{topViewInstance:{pointCloudInstance:s,toolInstance:p}}=e;p.singleOn("renderZoom",(d,v)=>{const{offsetX:T,offsetY:k}=Q(v,c,d);if(s.camera.zoom=d,v){const{x:A,y:N,z:R}=s.initCameraPosition;s.camera.position.set(A+k,N-T,R)}s.camera.updateProjectionMatrix(),s.render(),b(d),_(v,d,c),S({zoom:d,currentPos:v})}),p.singleOn("dragMove",({currentPos:d,zoom:v})=>{const{offsetX:T,offsetY:k}=Q(d,c,v);s.camera.zoom=v;const{x:A,y:N,z:R}=s.initCameraPosition;s.camera.position.set(A+k,N-T,R),s.render(),_(d,v,c),S({zoom:v,currentPos:d})})},[c,e.topViewInstance,(O=e.topViewInstance)==null?void 0:O.toolInstance]),x(()=>{var o,a;(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null||a.applyZAxisPoints(j)},[j]),x(()=>{var o,a,t,s;C.topViewSelectedChanged({}),(s=(t=(a=(o=e.topViewInstance)==null?void 0:o.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||s.call(t,e.selectedIDs)},[e.selectedIDs]),x(()=>(window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}),[]);const Z=o=>{const{keyCode:a}=o;a===He.Esc&&L()};return x(()=>{var o,a,t;(t=(a=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,h)},[e.topViewInstance,h]),i.createElement(ye,{className:I("point-cloud-container","top-view"),title:E?i.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},i.createElement(ce,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{L()}}),i.createElement("span",null,U("TopView")),i.createElement(X,{checkMode:u,config:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):i.createElement(Ne,{title:U("TopView"),onClick:()=>{y(!0)}}),toolbar:i.createElement(We,{currentData:n})},i.createElement("div",{style:{position:"relative",flex:1}},i.createElement("div",{style:{width:"100%",height:"100%"},ref:m},w==null?void 0:w(g)),!E&&i.createElement(X,{checkMode:u,config:f}),i.createElement(Fe,{checkMode:u,zAxisLimit:j,setZAxisLimit:le}),i.createElement(Ie,null)))};var Xe=Se(Ve,null,null,{context:Oe})(Ke);export{Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as I,useCallback as y}from"react";import{PointCloudContext as x}from"../PointCloudContext.js";var L=(s,r,t)=>new Promise((a,u)=>{var n=i=>{try{e(t.next(i))}catch(l){u(l)}},h=i=>{try{e(t.throw(i))}catch(l){u(l)}},e=i=>i.done?a(i.value):Promise.resolve(i.value).then(n,h);e((t=t.apply(s,r)).next())});const b=({currentData:s})=>{var r;const{mainViewInstance:t,topViewInstance:a,pointCloudBoxList:u,highlight2DDataList:n,setHighlight2DDataList:h}=I(x),e=(r=s==null?void 0:s.mappingImgList)!=null?r:[],i=(o,d,f)=>L(void 0,null,function*(){var c;let g=[...n];if(n.find(p=>p.url===o)?g=n.filter(p=>p.url!==o):g.push({url:o,fallbackUrl:d,calib:f}),h(g),!t||(e==null?void 0:e.length)===0)return;const m=t.pointCloudObject;if(!m)return;const C=yield t.getHighlightIndexByMappingImgList({mappingImgList:g,points:m.geometry.attributes.position.array}),v=yield t.highlightOriginPointCloud(u,C);v&&((c=a==null?void 0:a.pointCloudInstance)==null||c.updateColor(v))}),l=y(o=>n.findIndex(d=>d.url===o)>=0,[n]);return{toggle2dVisible:i,isHighlightVisible:l}};export{b as useHighlight};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useContext as m}from"react";import{synchronizeSideView as w,synchronizeBackView as C}from"./usePointCloudViews.js";import{useSingleBox as h}from"./useSingleBox.js";import{PointCloudContext as x}from"../PointCloudContext.js";import{useThrottleFn as f}from"ahooks";import{PointCloudUtils as V}from"@labelbee/lb-utils";const y=({currentData:t})=>{const e=m(x),{selectedBox:l,updateSelectedBox:c}=h(),{run:u}=f(a=>{const{topViewInstance:r,mainViewInstance:i,syncAllViewPointCloudColor:p}=e;if(!r||!i)return;const{pointCloud2dOperation:s}=r,o=l==null?void 0:l.info;if(!o||!(t==null?void 0:t.url)||!e.backViewInstance)return;const n=s.selectedPolygon.pointList||[],P=n.shift();n.push(P);const g=c({newPointList:n,rotation:V.restrictAngleRange(o.rotation+Number(Math.PI*a)/180),width:o.height,height:o.width});s.rotatePolygonEdge(n);const d=s.selectedPolygon;i.generateBox(o),p(g),w(o,d,e.sideViewInstance,t.url),C(o,d,e.backViewInstance,t.url),i.render()},{wait:800});return{updateRotateEdge:u}};export{y as useRotateEdge};
|
package/es/index.css
CHANGED
|
@@ -2539,14 +2539,14 @@
|
|
|
2539
2539
|
margin-right: 16px;
|
|
2540
2540
|
background-image: url("../dist/assets/icons/7eadb9c4.svg");
|
|
2541
2541
|
}
|
|
2542
|
-
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-
|
|
2542
|
+
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-90 {
|
|
2543
2543
|
display: inline-block;
|
|
2544
2544
|
height: 24px;
|
|
2545
2545
|
width: 24px;
|
|
2546
2546
|
background-repeat: no-repeat;
|
|
2547
2547
|
cursor: pointer;
|
|
2548
2548
|
flex: none;
|
|
2549
|
-
background-image: url("../dist/assets/icons/
|
|
2549
|
+
background-image: url("../dist/assets/icons/ad33251.svg");
|
|
2550
2550
|
}
|
|
2551
2551
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__next {
|
|
2552
2552
|
font-size: 24px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{backward as n,forward as e,scale as a,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import S from"../../../../../../assets/annotation/pointCloudTool/
|
|
1
|
+
import{backward as n,forward as e,scale as a,fullScreen as u}from"../common/index.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import d from"../../../../../../assets/annotation/pointCloudTool/changePointCloudValid.svg.js";import l from"../../../../../../assets/annotation/pointCloudTool/copy.svg.js";import p from"../../../../../../assets/annotation/pointCloudTool/nextBox.svg.js";import h from"../../../../../../assets/annotation/pointCloudTool/patse.svg.js";import f from"../../../../../../assets/annotation/pointCloudTool/prevBox.svg.js";import S from"../../../../../../assets/annotation/pointCloudTool/rotate90_black.svg.js";import v from"../../../../../../assets/annotation/pointCloudTool/selectAll.svg.js";import P from"../../../../../../assets/annotation/pointCloudTool/selectMultiple.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import T from"../../../../../../assets/annotation/toolHotKeyIcon/icon_del_kj.svg.js";import y from"../../../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import x from"../../../../../../assets/annotation/rectTool/icon_rect.svg.js";import R from"../../../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import _ from"../../../../../../assets/annotation/pointCloudTool/addSvg.svg.js";import $ from"../../../../../../assets/annotation/pointCloudTool/clearSvg.svg.js";import t from"react";import{ReloadOutlined as I,RotateLeftOutlined as B,RotateRightOutlined as b}from"@ant-design/icons";import{polygon as D,invalidPolygon as k,selectedPolygon as A,changePolygonAttribute as V,deletePolygon as M,insertPolygonPoint as O,deletePolygonPoint as w}from"../polygon/index.js";const r={name:"PointThickness",icon:t.createElement("span",{style:{display:" inline-block",width:14,height:14,borderRadius:"50%",border:"1px solid"}}),shortCut:["+","-"],linkSymbol:""},i={name:"RotateAroundCenterPoint",icon:t.createElement(I,null),shortCut:[C],noticeInfo:"DragOperation"},c={name:"PointCloudViewTranslate",icon:s,shortCut:[o],noticeInfo:"Drag"},m={name:"TopViewTranslate",icon:s,shortCut:[o]},g={name:"ChangePointCloudValid",icon:d,shortCut:["V"]},E={name:"CopyBox",icon:l,shortCut:["Ctrl","C"]},H={name:"PasteBox",icon:h,shortCut:["Ctrl","V"]},K={name:"RotateLeft",icon:t.createElement(B,null),shortCut:["Q"]},L={name:"RotateRight",icon:t.createElement(b,null),shortCut:["E"]},G={name:"PreviousBox",icon:f,shortCut:["Shift","Tab"]},N={name:"NextBox",icon:p,shortCut:["Tab"]},z={name:"Rotate90",icon:S,shortCut:["G"],noticeInfo:"SelectedStatus"},F={name:"CopyPrevPage",icon:l,shortCut:["Alt","C"]},J={name:"ChangeBoxValid",icon:j,shortCut:["F"],noticeInfo:"SelectedStatus"},Q={name:"MultiSelect",icon:P,shortCut:["Ctrl",o]},U={name:"SelectAllBox",icon:v,shortCut:["Ctrl","A"]},Y={name:"Delete",icon:T,shortCut:["Del"],noticeInfo:"SelectedStatus"},q={name:"LassoSelector",icon:y,shortCut:["H"],noticeInfo:"SelectorMsg"},W={name:"RectSelector",icon:x,shortCut:["J"],noticeInfo:"SelectorMsg"},X={name:"CircleSelector",icon:R,shortCut:["K"],noticeInfo:"SelectorMsg"},Z={name:"PointCloudViewTranslate",icon:s,shortCut:["space",o]},oo={name:"AddPoint",icon:_,shortCut:["U"]},to={name:"DeletePoint",icon:$,shortCut:["I"]},no=[{name:"GeneralOperation"},n,e,r,a,i,c,m,g,{name:"RectPattern"},E,H,K,L,G,N,z,F,J,Y,Q,U,u],eo=[{name:"GeneralOperation"},n,e,r,a,i,c,m,g,{name:"PolygonPattern"},D,k,A,V,M,O,w],so=[n,e,i,Z,q,W,X,oo,to];export{no as default,eo as pointCloudShortCutTable_POLYGON,so as pointCloudShortCutTable_SEGMENT};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.46",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.27.0-alpha.
|
|
47
|
-
"@labelbee/lb-utils": "1.19.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.27.0-alpha.23",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.16",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M14.0606 2.74219V5.16642H11.6364' stroke='%23666666' stroke-width='0.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M14.6667 8.50016C14.6667 12.1821 11.6819 15.1668 8.00002 15.1668C4.31812 15.1668 1.33335 12.1821 1.33335 8.50016C1.33335 4.81826 4.31812 1.8335 8.00002 1.8335C10.4674 1.8335 12.6217 3.17387 13.7744 5.1662' stroke='%23666666' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.219 11V6.016H3.281L2.518 6.611V7.661L3.281 7.115V11H4.219ZM7.6968 9.572C7.6968 9.299 7.6758 9.012 7.5638 8.781C7.4938 8.641 7.3958 8.529 7.2628 8.424C7.3818 8.326 7.4658 8.221 7.5288 8.095C7.6408 7.857 7.6618 7.612 7.6618 7.353C7.6618 6.926 7.5918 6.562 7.3048 6.275C7.0878 6.058 6.7798 5.96 6.4438 5.96C6.1078 5.96 5.8138 6.058 5.5968 6.275C5.3098 6.562 5.2398 6.926 5.2398 7.353C5.2398 7.612 5.2608 7.857 5.3728 8.095C5.4358 8.221 5.5198 8.326 5.6388 8.424C5.5058 8.529 5.4078 8.641 5.3378 8.781C5.2258 9.012 5.2048 9.299 5.2048 9.572C5.2048 10.041 5.2328 10.412 5.5618 10.734C5.7858 10.951 6.1148 11.056 6.4508 11.056C6.7868 11.056 7.1158 10.951 7.3398 10.734C7.6688 10.412 7.6968 10.041 7.6968 9.572ZM6.7588 9.523C6.7588 9.656 6.7728 9.978 6.6748 10.111C6.6258 10.174 6.5418 10.216 6.4508 10.216C6.3598 10.216 6.2758 10.181 6.2268 10.111C6.1288 9.971 6.1428 9.656 6.1428 9.523C6.1428 9.39 6.1218 9.061 6.2268 8.921C6.2758 8.851 6.3598 8.816 6.4508 8.816C6.5418 8.816 6.6188 8.851 6.6748 8.921C6.7798 9.061 6.7588 9.39 6.7588 9.523ZM6.7238 7.402C6.7238 7.528 6.7518 7.843 6.6258 7.969C6.5838 8.011 6.5208 8.032 6.4508 8.032C6.3808 8.032 6.3248 8.011 6.2758 7.969C6.1428 7.85 6.1778 7.528 6.1778 7.402C6.1778 7.283 6.1568 7.003 6.2548 6.884C6.3038 6.828 6.3738 6.8 6.4508 6.8C6.5278 6.8 6.5978 6.828 6.6468 6.884C6.7448 7.003 6.7238 7.283 6.7238 7.402ZM10.6496 9.838V7.178C10.6496 6.744 10.5306 6.492 10.3066 6.282C10.0826 6.065 9.75359 5.96 9.41759 5.96C9.08159 5.96 8.75259 6.065 8.52859 6.282C8.30459 6.492 8.18559 6.744 8.18559 7.178V9.838C8.18559 10.272 8.30459 10.524 8.52859 10.734C8.75259 10.951 9.08159 11.056 9.41759 11.056C9.75359 11.056 10.0826 10.951 10.3066 10.734C10.5306 10.524 10.6496 10.272 10.6496 9.838ZM9.71159 9.873C9.71159 10.104 9.58559 10.216 9.41759 10.216C9.24959 10.216 9.12359 10.104 9.12359 9.873V7.143C9.12359 6.912 9.24959 6.8 9.41759 6.8C9.58559 6.8 9.71159 6.912 9.71159 7.143V9.873ZM13.6304 7.129C13.6304 6.443 13.0774 5.89 12.3914 5.89C11.7054 5.89 11.1524 6.443 11.1524 7.129C11.1524 7.815 11.7054 8.368 12.3914 8.368C13.0774 8.368 13.6304 7.815 13.6304 7.129ZM12.8044 7.129C12.8044 7.36 12.6224 7.542 12.3914 7.542C12.1604 7.542 11.9784 7.36 11.9784 7.129C11.9784 6.898 12.1604 6.716 12.3914 6.716C12.6224 6.716 12.8044 6.898 12.8044 7.129Z' fill='%23666666'/%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M21.0908 3.36377V7.00012H17.4544" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
<path d="M22 12C22 17.5229 17.5229 22 12 22C6.47715 22 2 17.5229 2 12C2 6.47715 6.47715 2 12 2C15.701 2 18.9324 4.01056 20.6616 6.99905" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
<path d="M8.536 15V9.304H7.464L6.592 9.984V11.184L7.464 10.56V15H8.536ZM12.5106 13.368C12.5106 13.056 12.4866 12.728 12.3586 12.464C12.2786 12.304 12.1666 12.176 12.0146 12.056C12.1506 11.944 12.2466 11.824 12.3186 11.68C12.4466 11.408 12.4706 11.128 12.4706 10.832C12.4706 10.344 12.3906 9.928 12.0626 9.6C11.8146 9.352 11.4626 9.24 11.0786 9.24C10.6946 9.24 10.3586 9.352 10.1106 9.6C9.78263 9.928 9.70263 10.344 9.70263 10.832C9.70263 11.128 9.72663 11.408 9.85463 11.68C9.92663 11.824 10.0226 11.944 10.1586 12.056C10.0066 12.176 9.89463 12.304 9.81463 12.464C9.68663 12.728 9.66263 13.056 9.66263 13.368C9.66263 13.904 9.69463 14.328 10.0706 14.696C10.3266 14.944 10.7026 15.064 11.0866 15.064C11.4706 15.064 11.8466 14.944 12.1026 14.696C12.4786 14.328 12.5106 13.904 12.5106 13.368ZM11.4386 13.312C11.4386 13.464 11.4546 13.832 11.3426 13.984C11.2866 14.056 11.1906 14.104 11.0866 14.104C10.9826 14.104 10.8866 14.064 10.8306 13.984C10.7186 13.824 10.7346 13.464 10.7346 13.312C10.7346 13.16 10.7106 12.784 10.8306 12.624C10.8866 12.544 10.9826 12.504 11.0866 12.504C11.1906 12.504 11.2786 12.544 11.3426 12.624C11.4626 12.784 11.4386 13.16 11.4386 13.312ZM11.3986 10.888C11.3986 11.032 11.4306 11.392 11.2866 11.536C11.2386 11.584 11.1666 11.608 11.0866 11.608C11.0066 11.608 10.9426 11.584 10.8866 11.536C10.7346 11.4 10.7746 11.032 10.7746 10.888C10.7746 10.752 10.7506 10.432 10.8626 10.296C10.9186 10.232 10.9986 10.2 11.0866 10.2C11.1746 10.2 11.2546 10.232 11.3106 10.296C11.4226 10.432 11.3986 10.752 11.3986 10.888ZM15.8853 13.672V10.632C15.8853 10.136 15.7493 9.848 15.4933 9.608C15.2373 9.36 14.8613 9.24 14.4773 9.24C14.0933 9.24 13.7173 9.36 13.4613 9.608C13.2053 9.848 13.0693 10.136 13.0693 10.632V13.672C13.0693 14.168 13.2053 14.456 13.4613 14.696C13.7173 14.944 14.0933 15.064 14.4773 15.064C14.8613 15.064 15.2373 14.944 15.4933 14.696C15.7493 14.456 15.8853 14.168 15.8853 13.672ZM14.8133 13.712C14.8133 13.976 14.6693 14.104 14.4773 14.104C14.2853 14.104 14.1413 13.976 14.1413 13.712V10.592C14.1413 10.328 14.2853 10.2 14.4773 10.2C14.6693 10.2 14.8133 10.328 14.8133 10.592V13.712ZM19.2919 10.576C19.2919 9.792 18.6599 9.16 17.8759 9.16C17.0919 9.16 16.4599 9.792 16.4599 10.576C16.4599 11.36 17.0919 11.992 17.8759 11.992C18.6599 11.992 19.2919 11.36 19.2919 10.576ZM18.3479 10.576C18.3479 10.84 18.1399 11.048 17.8759 11.048C17.6119 11.048 17.4039 10.84 17.4039 10.576C17.4039 10.312 17.6119 10.104 17.8759 10.104C18.1399 10.104 18.3479 10.312 18.3479 10.576Z" fill="white"/>
|
|
5
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var C="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M14.0606 2.74219V5.16642H11.6364' stroke='%23666666' stroke-width='0.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M14.6667 8.50016C14.6667 12.1821 11.6819 15.1668 8.00002 15.1668C4.31812 15.1668 1.33335 12.1821 1.33335 8.50016C1.33335 4.81826 4.31812 1.8335 8.00002 1.8335C10.4674 1.8335 12.6217 3.17387 13.7744 5.1662' stroke='%23666666' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.219 11V6.016H3.281L2.518 6.611V7.661L3.281 7.115V11H4.219ZM7.6968 9.572C7.6968 9.299 7.6758 9.012 7.5638 8.781C7.4938 8.641 7.3958 8.529 7.2628 8.424C7.3818 8.326 7.4658 8.221 7.5288 8.095C7.6408 7.857 7.6618 7.612 7.6618 7.353C7.6618 6.926 7.5918 6.562 7.3048 6.275C7.0878 6.058 6.7798 5.96 6.4438 5.96C6.1078 5.96 5.8138 6.058 5.5968 6.275C5.3098 6.562 5.2398 6.926 5.2398 7.353C5.2398 7.612 5.2608 7.857 5.3728 8.095C5.4358 8.221 5.5198 8.326 5.6388 8.424C5.5058 8.529 5.4078 8.641 5.3378 8.781C5.2258 9.012 5.2048 9.299 5.2048 9.572C5.2048 10.041 5.2328 10.412 5.5618 10.734C5.7858 10.951 6.1148 11.056 6.4508 11.056C6.7868 11.056 7.1158 10.951 7.3398 10.734C7.6688 10.412 7.6968 10.041 7.6968 9.572ZM6.7588 9.523C6.7588 9.656 6.7728 9.978 6.6748 10.111C6.6258 10.174 6.5418 10.216 6.4508 10.216C6.3598 10.216 6.2758 10.181 6.2268 10.111C6.1288 9.971 6.1428 9.656 6.1428 9.523C6.1428 9.39 6.1218 9.061 6.2268 8.921C6.2758 8.851 6.3598 8.816 6.4508 8.816C6.5418 8.816 6.6188 8.851 6.6748 8.921C6.7798 9.061 6.7588 9.39 6.7588 9.523ZM6.7238 7.402C6.7238 7.528 6.7518 7.843 6.6258 7.969C6.5838 8.011 6.5208 8.032 6.4508 8.032C6.3808 8.032 6.3248 8.011 6.2758 7.969C6.1428 7.85 6.1778 7.528 6.1778 7.402C6.1778 7.283 6.1568 7.003 6.2548 6.884C6.3038 6.828 6.3738 6.8 6.4508 6.8C6.5278 6.8 6.5978 6.828 6.6468 6.884C6.7448 7.003 6.7238 7.283 6.7238 7.402ZM10.6496 9.838V7.178C10.6496 6.744 10.5306 6.492 10.3066 6.282C10.0826 6.065 9.75359 5.96 9.41759 5.96C9.08159 5.96 8.75259 6.065 8.52859 6.282C8.30459 6.492 8.18559 6.744 8.18559 7.178V9.838C8.18559 10.272 8.30459 10.524 8.52859 10.734C8.75259 10.951 9.08159 11.056 9.41759 11.056C9.75359 11.056 10.0826 10.951 10.3066 10.734C10.5306 10.524 10.6496 10.272 10.6496 9.838ZM9.71159 9.873C9.71159 10.104 9.58559 10.216 9.41759 10.216C9.24959 10.216 9.12359 10.104 9.12359 9.873V7.143C9.12359 6.912 9.24959 6.8 9.41759 6.8C9.58559 6.8 9.71159 6.912 9.71159 7.143V9.873ZM13.6304 7.129C13.6304 6.443 13.0774 5.89 12.3914 5.89C11.7054 5.89 11.1524 6.443 11.1524 7.129C11.1524 7.815 11.7054 8.368 12.3914 8.368C13.0774 8.368 13.6304 7.815 13.6304 7.129ZM12.8044 7.129C12.8044 7.36 12.6224 7.542 12.3914 7.542C12.1604 7.542 11.9784 7.36 11.9784 7.129C11.9784 6.898 12.1604 6.716 12.3914 6.716C12.6224 6.716 12.8044 6.898 12.8044 7.129Z' fill='%23666666'/%3e%3c/svg%3e";export{C as default};
|