@labelbee/lb-components 1.23.0-alpha.39 → 1.23.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/index.css +8 -31
- package/dist/index.js +1 -1
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +0 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/types/store/annotatedBox/index.d.ts +0 -2
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/index.css +8 -31
- package/es/index.js +1 -1
- package/es/store/annotatedBox/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/package.json +3 -3
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +0 -3
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +0 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +0 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +0 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash");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,e,l)=>e in o?__defProp(o,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[e]=l,__spreadValues=(o,e)=>{for(var l in e||(e={}))__hasOwnProp.call(e,l)&&__defNormalProp(o,l,e[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(e))__propIsEnum.call(e,l)&&__defNormalProp(o,l,e[l]);return o},__spreadProps=(o,e)=>__defProps(o,__getOwnPropDescs(e)),__async=(o,e,l)=>new Promise((w,x)=>{var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),actionCreators=require("../../store/annotation/actionCreators.js"),index=require("../../store/annotatedBox/index.js"),_=require("lodash");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,e,l)=>e in o?__defProp(o,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[e]=l,__spreadValues=(o,e)=>{for(var l in e||(e={}))__hasOwnProp.call(e,l)&&__defNormalProp(o,l,e[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(e))__propIsEnum.call(e,l)&&__defNormalProp(o,l,e[l]);return o},__spreadProps=(o,e)=>__defProps(o,__getOwnPropDescs(e)),__async=(o,e,l)=>new Promise((w,x)=>{var A=f=>{try{S(l.next(f))}catch(b){x(b)}},H=f=>{try{S(l.throw(f))}catch(b){x(b)}},S=f=>f.done?w(f.value):Promise.resolve(f.value).then(A,H);S((l=l.apply(o,e)).next())});const pickRectObject=o=>___default.default.pick(o,["id","attribute","width","height","x","y","imageName"]),PointCloudContext=React__default.default.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new lbAnnotation.ActionsHistory,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:lbAnnotation.EToolName.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:lbUtils.EPointCloudPattern.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:o=>{},imageSizes:{},cacheImageNodeSize:()=>{},unlinkImageItems:[],addRectFromPointCloudBoxByImageName:o=>!1,removeRectBySpecifyId:(o,e,l)=>!1,removeRectByPointCloudBoxId:o=>!1}),PointCloudProvider=({children:o})=>{const[e,l]=React.useState([]),[w,x]=React.useState([]),[A,H]=React.useState([]),[S,f]=React.useState([]),[b,ut]=React.useState([]),[m,E]=React.useState([]),[R,j]=React.useState([]),[Z,ct]=React.useState(!0),[U,ft]=React.useState(!0),[J,pt]=React.useState(1),[p,K]=React.useState(),[Q,W]=React.useState(),[X,Y]=React.useState(),[u,$]=React.useState(),[tt,gt]=React.useState(""),[k,ht]=React.useState(lbAnnotation.EToolName.Rect),vt=React.useRef(new lbAnnotation.ActionsHistory).current,[g,F]=React.useState([]),[et,mt]=React.useState(""),[q,Pt]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,nt]=React.useState(void 0),[z,It]=React.useState([]),[M,St]=React.useState([]),h=index(),[it,bt]=React.useState({}),Ct=ctx.useDispatch(),yt=s=>{const{imgNode:r,path:i}=s;i&&r&&bt(c=>__spreadProps(__spreadValues({},c),{[i]:{width:r.width,height:r.height}}))},ot=React.useMemo(()=>m.length===1?m[0]:"",[m]),V=React.useCallback((s,r,i="extId")=>{const c=i||"id",d=new Set(r);return f(v=>{let C=!1;const y=v.filter(O=>{const G=O[c],N=d.has(G)?O.imageName!==s:!0;return N||(C=!0),N});return C?y:v}),!0},[]),st=React.useCallback(s=>{const r=e.map(i=>i.id);return V(s,r,"extId")},[e,V]),rt=React.useCallback(s=>{if(!s)return!1;const r=e.filter(i=>Array.isArray(i.rects)).map(i=>{const{id:c,attribute:d,trackID:v}=i,C=i.rects.find(y=>y.imageName===s);if(C){const y=___default.default.pick(C,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},y),{id:lbAnnotation.uuid(),attribute:d,order:v,extId:c,lineDash:[]})}return null}).filter(i=>i!==null);return r.length?(f(i=>{const c=new Set(i.filter(v=>s===v.imageName).map(v=>v.extId)),d=r.filter(v=>c.has(v.extId)===!1);return d.length?[...i,...d]:i}),!0):!1},[e]),B=React.useMemo(()=>{const s=e.find(t=>t.id===ot),r=t=>{const n=e.concat(t);return l(n),n},i=t=>{const n=w.concat(t);return x(n),n},c=t=>{ct(t!==!1)},d=t=>{t===void 0&&E([]),typeof t=="string"&&E([t]),Array.isArray(t)&&E(Array.from(new Set(t)))},v=t=>{m.includes(t)?d(m.filter(n=>n!==t)):d([...m,t])},C=t=>{const n=pickRectObject(t);f(a=>[...a,n])},y=(t,n=!1)=>{const a=pickRectObject(t);f(I=>I.map(P=>P.id===t.id?n?__spreadValues(__spreadValues({},P),a):a:P))},O=t=>{f(n=>n.filter(a=>!t.find(I=>I.id===a.id)))},G=t=>{R.includes(t)?j([]):j([t])},N=()=>{if(k===lbAnnotation.EToolName.Rect){const t=e.map(n=>n.id);d(t),p==null||p.pointCloud2dOperation.setSelectedIDs(t)}},Lt=t=>{d(e.filter(n=>n.attribute===t).map(n=>n.id))},T=e.filter(t=>!g.includes(t.attribute)),lt=w.filter(t=>!g.includes(t.attribute)),at=b.filter(t=>t.attribute&&!g.includes(t.attribute)),Dt=t=>{if(g.includes(t))F(g.filter(n=>n!==t));else{const n=g.concat(t);F(n)}},xt=(()=>{const t=T.map(a=>a.id),n=new Set(t);return S.filter(a=>a.extId&&n.has(a.extId)).map(a=>a.imageName)})(),_t=(t=T,n=A,a=lt,I=at,P=z)=>{var D;u==null||u.clearAllBox(),u==null||u.clearAllSphere(),p==null||p.updatePolygonList(t,n),p==null||p.updatePointList(a),p==null||p.updateLineList(I),u==null||u.generateBoxes(t),u==null||u.generateSpheres(a),(D=L==null?void 0:L.store)==null||D.updateCurrentSegment(P),dt(t)},At=()=>{K(void 0),W(void 0),Y(void 0),$(void 0)},dt=(t,n)=>__async(void 0,null,function*(){var a;if(!u)return;const I=u.pointCloudObject;if(!!I)try{const P=yield u.getHighlightIndexByMappingImgList({mappingImgList:n!=null?n:M,points:I.geometry.attributes.position.array}),D=yield u==null?void 0:u.highlightOriginPointCloud(t,P);return D&&((a=p==null?void 0:p.pointCloudInstance)==null||a.updateColor(D)),D}catch(P){console.error(P)}});return{selectedID:ot,pointCloudBoxList:e,pointCloudSphereList:w,displayPointCloudList:T,displaySphereList:lt,displayLineList:at,selectedIDs:m,setPointCloudResult:l,setSelectedIDs:d,addPointCloudBox:r,addPointCloudSphere:i,setPointCloudSphereList:x,valid:Z,selectedPointCloudBox:s,setPointCloudValid:c,addSelectedID:v,addHighlightID:G,selectedAllBoxes:N,topViewInstance:p,setTopViewInstance:K,sideViewInstance:Q,setSideViewInstance:W,backViewInstance:X,setBackViewInstance:Y,mainViewInstance:u,setMainViewInstance:$,polygonList:A,setPolygonList:H,rectList:S,setRectList:f,addRectIn2DView:C,removeRectIn2DView:O,updateRectIn2DView:y,lineList:b,setLineList:ut,zoom:J,setZoom:pt,history:vt,toggleAttributesVisible:Dt,hideAttributes:g,setHideAttributes:F,reRender:_t,attrPanelLayout:et,setAttrPanelLayout:mt,syncAllViewPointCloudColor:dt,defaultAttribute:tt,setDefaultAttribute:gt,pointCloudPattern:k,setPointCloudPattern:ht,selectSpecAttr:Lt,globalPattern:q,setGlobalPattern:t=>{q!==t&&(Ct(actionCreators.ChangeSave),Pt(t),t===lbUtils.EPointCloudPattern.Detection&&nt(void 0))},ptSegmentInstance:L,setPtSegmentInstance:nt,segmentation:z,setSegmentation:It,clearAllDetectionInstance:At,highlight2DDataList:M,setHighlight2DDataList:St,cuboidBoxIn2DView:U,setCuboidBoxIn2DView:ft,imageSizes:it,cacheImageNodeSize:yt,highlightIDs:R,setHighlightIDs:j,unlinkImageItems:xt,removeRectByPointCloudBoxId:st,removeRectBySpecifyId:V,addRectFromPointCloudBoxByImageName:rt}},[Z,m,e,w,A,b,S,p,Q,X,u,J,g,et,tt,k,q,L,z,M,U,it,R,st,V,rt]);React.useEffect(()=>{var s,r,i;(s=h==null?void 0:h.setPointCloudBoxList)==null||s.call(h,e),(r=h==null?void 0:h.setHighlightIDs)==null||r.call(h,R),(i=h==null?void 0:h.setSelectedIDs)==null||i.call(h,m)},[e,m,R]),React.useEffect(()=>{var s;(s=h==null?void 0:h.setPtCtx)==null||s.call(h,B)},[B]);const wt=()=>{const s=e.filter(d=>g.includes(d.attribute)),{setSelectedIDs:r,reRender:i}=B,c=s.map(d=>d.id);c.length>0&&r(m.filter(d=>!c.includes(d))),i()};return React.useEffect(()=>{var s,r,i,c;wt(),(r=(s=p==null?void 0:p.toolInstance)==null?void 0:s.setHiddenAttributes)==null||r.call(s,g),(c=(i=L==null?void 0:L.store)==null?void 0:i.setHiddenAttributes)==null||c.call(i,g)},[g]),React__default.default.createElement(PointCloudContext.Provider,{value:B},o)};exports.PointCloudContext=PointCloudContext,exports.PointCloudProvider=PointCloudProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),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:B,imgIndex:f,toolInstanceRef:a})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:L,selectNextBox:E,selectPrevBox:O,updateSelectedBox:
|
|
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:B,imgIndex:f,toolInstanceRef:a})=>{const t=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:L,selectNextBox:E,selectPrevBox:O,updateSelectedBox:g,deleteSelectedPointCloudBoxAndPolygon:q}=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:w}=useRotate.useRotate({currentData:l}),{updatePointCloudData:v,topViewSelectedChanged:m}=usePointCloudViews.usePointCloudViews(),{redo:h,undo:x,pushHistoryWithList:N,pushHistoryUnderUpdatePolygon:H,pushHistoryUnderUpdateLine:K}=useHistory.useHistory(),U=ctx.useDispatch(),{syncThreeViewsAttribute:S}=useAttribute.useAttribute(),{syncAllViewsConfig:z,reRenderTopViewRange:R}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{selectedLine:_}=useLine.useLine(),{t:C}=reactI18next.useTranslation(),b=e=>{var o;const{topViewInstance:s}=t;!s||(o=s.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},F=(e,o)=>{var s,i;const{topViewInstance:c,mainViewInstance:n}=t;if(!c)return;const{pointCloud2dOperation:d}=c;switch(e){case"q":{w(2);break}case"e":w(-2);break;case"g":w(180);break;case"u":{const p=d.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;j(p);const M={[lbAnnotation.EToolName.Polygon]:C("PolygonPattern"),[lbAnnotation.EToolName.Rect]:C("RectPattern")};antd.message.success(C("ChangePatternMsg",{pattern:M[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){O();break}E(),o.preventDefault();break;case"f":L();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":q();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}}},G=(e,o)=>{switch(e){case"c":I();break;case"v":T();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?h():x();break}}},V=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||u===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){G(o,e);return}F(o,e)};return React.useEffect(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",V),()=>{window.removeEventListener("keydown",V)}},[t,D,r,t.pointCloudBoxList,t.polygonList]),React.useEffect(()=>{z(r)},[B]),React.useEffect(()=>{(r==null?void 0:r.radius)&&R(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{v==null||v()},[f,t.mainViewInstance]),React.useEffect(()=>{t.setHideAttributes([])},[f]),React.useEffect(()=>{a.current.setDefaultAttribute=e=>{var o,s,i,c;S(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=g(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}),g(i)}},a.current.clearResult=()=>{y==null||y()},a.current.redo=()=>{h()},a.current.undo=()=>{x()},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=>{N({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const o=(e=t.topViewInstance)==null?void 0:e.toolInstance;if(!o||u)return;const s=n=>{S(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 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"),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},g={x:l.width/2,y:l.height/2};return{offsetX:(g.x-w.x)/s,offsetY:-(g.y-w.y)/s}},TopViewToolbar=({currentData:o})=>{var l,s;const{zoom:C,zoomIn:c,zoomOut:w,initialPosition:g}=useZoom.useZoom(),{selectNextBox:V,selectPrevBox:S}=useSingleBox.useSingleBox(),{switchToNextSphere:y}=useSphere.useSphere(),{updateRotate:P}=useRotate.useRotate({currentData:o}),x=React__default.default.useContext(PointCloudContext.PointCloudContext),{topViewInstance:E}=x,I=(s=(l=x==null?void 0:x.topViewInstance)==null?void 0:l.toolScheduler)==null?void 0:s.getCurrentToolName(),p=2,e=()=>{P(-p)},r=()=>{P(p)},f=()=>{P(180)};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$2,{onChange:L=>{var h;(h=E==null?void 0:E.pointCloudInstance)==null||h.updatePointSize({customSize:L})}}),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-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}V(!0)},className:dom.getClassName("point-cloud","next")}),React__default.default.createElement(index$3.FooterDivider,null),React__default.default.createElement(index$4.ZoomController,{initialPosition:g,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:g,isEnlargeTopView:V,onExitZoom:S,highlightAttribute:y})=>{var P,x;const[E,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:L,syncTopviewToolZoom:h}=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(),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(D.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),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=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,(P=e.topViewInstance)==null?void 0:P.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(),L(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,(x=e.topViewInstance)==null?void 0:x.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;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",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:V?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:f,style:{display:"flex",position:"initial",margin:"0px 20px"}})):React__default.default.createElement(index$1,{title:k("TopView"),onClick:()=>{g(!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(E)),!V&&React__default.default.createElement(PointCloudInfos.BoxInfos,{checkMode:c,config:f}),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;
|
package/dist/index.css
CHANGED
|
@@ -49,19 +49,13 @@
|
|
|
49
49
|
right: -5px;
|
|
50
50
|
top: -5px;
|
|
51
51
|
}
|
|
52
|
-
.index-module_rectRotateSensitivitySlider__tGjUn {
|
|
53
|
-
padding: 12px 20px;
|
|
54
|
-
}
|
|
55
|
-
.index-module_rectRotateSensitivitySlider__tGjUn .index-module_title__aAJW6 {
|
|
56
|
-
margin-bottom: 16px;
|
|
57
|
-
}
|
|
58
52
|
.index-module_container__RwV5P {
|
|
59
53
|
padding: 12px 20px;
|
|
60
54
|
}
|
|
61
55
|
.index-module_container__RwV5P .index-module_content__vHpS9 {
|
|
62
56
|
display: flex;
|
|
63
57
|
justify-content: space-between;
|
|
64
|
-
margin-top:
|
|
58
|
+
margin-top: 4px;
|
|
65
59
|
}
|
|
66
60
|
.index-module_latexEditor__0fK8G {
|
|
67
61
|
line-height: 32px;
|
|
@@ -1517,7 +1511,6 @@
|
|
|
1517
1511
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1518
1512
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1519
1513
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1520
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1521
1514
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1522
1515
|
background: #f5f5f5;
|
|
1523
1516
|
}
|
|
@@ -1527,7 +1520,6 @@
|
|
|
1527
1520
|
.bee-sidebar #style-width .ant-slider .ant-slider-dot,
|
|
1528
1521
|
.bee-sidebar #style-color .ant-slider .ant-slider-dot,
|
|
1529
1522
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-dot,
|
|
1530
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-dot,
|
|
1531
1523
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-dot {
|
|
1532
1524
|
width: 0;
|
|
1533
1525
|
height: 0;
|
|
@@ -1539,7 +1531,6 @@
|
|
|
1539
1531
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle,
|
|
1540
1532
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle,
|
|
1541
1533
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle,
|
|
1542
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle,
|
|
1543
1534
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle {
|
|
1544
1535
|
background-image: url("../dist/assets/icons/cc550fff.svg");
|
|
1545
1536
|
background-repeat: no-repeat;
|
|
@@ -1557,7 +1548,6 @@
|
|
|
1557
1548
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle:focus,
|
|
1558
1549
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle:focus,
|
|
1559
1550
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle:focus,
|
|
1560
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle:focus,
|
|
1561
1551
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle:focus {
|
|
1562
1552
|
box-shadow: none;
|
|
1563
1553
|
}
|
|
@@ -1567,7 +1557,6 @@
|
|
|
1567
1557
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1568
1558
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1569
1559
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1570
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1571
1560
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow {
|
|
1572
1561
|
color: inherit;
|
|
1573
1562
|
font-style: normal;
|
|
@@ -1591,7 +1580,6 @@
|
|
|
1591
1580
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1592
1581
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1593
1582
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1594
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1595
1583
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header {
|
|
1596
1584
|
position: relative;
|
|
1597
1585
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -1618,9 +1606,6 @@
|
|
|
1618
1606
|
.bee-sidebar #style-fillOpacity .ant-slider-rail,
|
|
1619
1607
|
.bee-sidebar #style-fillOpacity .ant-slider-track,
|
|
1620
1608
|
.bee-sidebar #style-fillOpacity .ant-slider-step,
|
|
1621
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-rail,
|
|
1622
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-track,
|
|
1623
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step,
|
|
1624
1609
|
.bee-sidebar #style-borderOpacity .ant-slider-rail,
|
|
1625
1610
|
.bee-sidebar #style-borderOpacity .ant-slider-track,
|
|
1626
1611
|
.bee-sidebar #style-borderOpacity .ant-slider-step {
|
|
@@ -1633,46 +1618,38 @@
|
|
|
1633
1618
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1634
1619
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1635
1620
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1636
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1637
1621
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1638
1622
|
background: none;
|
|
1639
1623
|
}
|
|
1640
1624
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot,
|
|
1641
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot
|
|
1642
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot {
|
|
1625
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot {
|
|
1643
1626
|
height: 12px;
|
|
1644
1627
|
background: #666666;
|
|
1645
1628
|
border-radius: 0;
|
|
1646
1629
|
margin-left: -2px;
|
|
1647
1630
|
}
|
|
1648
1631
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(1),
|
|
1649
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1)
|
|
1650
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(1) {
|
|
1632
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1) {
|
|
1651
1633
|
width: 1px;
|
|
1652
1634
|
}
|
|
1653
1635
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(2),
|
|
1654
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2)
|
|
1655
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(2) {
|
|
1636
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2) {
|
|
1656
1637
|
width: 2px;
|
|
1657
1638
|
}
|
|
1658
1639
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(3),
|
|
1659
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3)
|
|
1660
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(3) {
|
|
1640
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3) {
|
|
1661
1641
|
width: 3px;
|
|
1662
1642
|
}
|
|
1663
1643
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(4),
|
|
1664
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4)
|
|
1665
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(4) {
|
|
1644
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4) {
|
|
1666
1645
|
width: 4px;
|
|
1667
1646
|
}
|
|
1668
1647
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(5),
|
|
1669
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5)
|
|
1670
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(5) {
|
|
1648
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5) {
|
|
1671
1649
|
width: 5px;
|
|
1672
1650
|
}
|
|
1673
1651
|
.bee-sidebar #style-radius .ant-slider:hover .ant-slider-rail,
|
|
1674
|
-
.bee-sidebar #style-width .ant-slider:hover .ant-slider-rail
|
|
1675
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider:hover .ant-slider-rail {
|
|
1652
|
+
.bee-sidebar #style-width .ant-slider:hover .ant-slider-rail {
|
|
1676
1653
|
background: #f5f5f5;
|
|
1677
1654
|
}
|
|
1678
1655
|
.bee-sidebar #style-color .ant-slider-rail {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),index$3=require("./components/NLPToolView/textContent/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$5=require("./components/predictTracking/predictTrackingIcon/index.js"),index$4=require("./components/LLMToolView/index.js"),index$6=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$7=require("./components/measureCanvas/index.js"),index$8=require("./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js"),index$9=require("./views/MainView/sidebar/PointCloudToolSidebar/components/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),index$3=require("./components/NLPToolView/textContent/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$5=require("./components/predictTracking/predictTrackingIcon/index.js"),index$4=require("./components/LLMToolView/index.js"),index$6=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$7=require("./components/measureCanvas/index.js"),index$8=require("./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js"),index$9=require("./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js"),index$a=require("./components/audioPlayer/index.js"),index$b=require("./utils/index.js"),index$c=require("./components/subAttributeList/index.js"),index$d=require("./constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const store=configureStore(),OutputApp=(e,t)=>{const[r,i]=React.useState();return React.useImperativeHandle(t,()=>({toolInstance:r,annotationEngine:store.getState().annotation.annotationEngine,pageBackwardActions:()=>store.dispatch(actionCreators.PageBackward()),pageForwardActions:()=>store.dispatch(actionCreators.PageForward()),pageJump:o=>{const n=~~o-1;store.dispatch(actionCreators.PageJump(n))},hello:()=>alert("hello labelBee!!!")}),[r]),React__default.default.createElement(reactRedux.Provider,{store,context:ctx.LabelBeeContext},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(PointCloudContext.PointCloudProvider,null,React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:o=>{var n;i(o),(n=e.onLoad)==null||n.call(e,{toolInstance:o})}})))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,exports.PointCloudAnnotationView=pointCloudAnnotationView,exports.QuestionView=index$2.default,exports.TextContent=index$3,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.PredictTracking=index$5,exports.LLMToolView=index$4,exports.SwitchCuboidBoxIn2DView=index$6,exports.MeasureCanvas=index$7,exports.AnnotatedBox=index$8,exports.FindTrackIDIndex=index$9.FindTrackIDIndexInCheckMode,exports.AudioPlayer=index$a.WrapAudioPlayer,exports.generatePointCloudBoxRects=index$b.generatePointCloudBoxRects,exports.SubAttributeList=index$c,Object.defineProperty(exports,"EDataFormatType",{enumerable:!0,get:function(){return index$d.EDataFormatType}}),Object.defineProperty(exports,"ELLMDataType",{enumerable:!0,get:function(){return index$d.ELLMDataType}}),Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$d.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$d.ESubmitType}}),exports.componentCls=index$d.componentCls,exports.prefix=index$d.prefix,exports.default=index,exports.store=store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var zustand=require("zustand");const useAnnotatedBoxStore=zustand.create(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),
|
|
1
|
+
"use strict";var zustand=require("zustand");const useAnnotatedBoxStore=zustand.create(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));module.exports=useAnnotatedBoxStore;
|
|
@@ -89,8 +89,6 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
89
89
|
addRectFromPointCloudBoxByImageName: (imageName: string) => boolean;
|
|
90
90
|
removeRectBySpecifyId: (imageName: string, ids: string[], idField?: keyof IPointCloudBoxRect) => boolean;
|
|
91
91
|
removeRectByPointCloudBoxId: (imageName: string) => boolean;
|
|
92
|
-
rectRotateSensitivity: number;
|
|
93
|
-
setRectRotateSensitivity: (sensitivity: number) => void;
|
|
94
92
|
}
|
|
95
93
|
export declare const PointCloudContext: React.Context<IPointCloudContext>;
|
|
96
94
|
export declare const PointCloudProvider: React.FC<{}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import LLMToolView from '@/components/LLMToolView';
|
|
|
12
12
|
import SwitchCuboidBoxIn2DView from '@/views/MainView/toolFooter/SwitchCuboidBoxIn2DView';
|
|
13
13
|
import MeasureCanvas from './components/measureCanvas';
|
|
14
14
|
import AnnotatedBox from './views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox';
|
|
15
|
-
import RectRotateSensitivitySlider from './views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider';
|
|
16
15
|
import { FindTrackIDIndexInCheckMode as FindTrackIDIndex } from './views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex';
|
|
17
16
|
import { WrapAudioPlayer as AudioPlayer } from './components/audioPlayer';
|
|
18
17
|
import { generatePointCloudBoxRects } from './utils';
|
|
@@ -22,6 +21,6 @@ export declare const store: import("redux").Store<{}, import("redux").Action<any
|
|
|
22
21
|
};
|
|
23
22
|
declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
|
|
24
23
|
export default _default;
|
|
25
|
-
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas, AnnotatedBox,
|
|
24
|
+
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas, AnnotatedBox, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, };
|
|
26
25
|
export * from './constant';
|
|
27
26
|
export * from './typeTem';
|
|
@@ -8,8 +8,6 @@ interface Store {
|
|
|
8
8
|
setHighlightIDs: (highlightIDs: number[]) => void;
|
|
9
9
|
selectedIDs: string[];
|
|
10
10
|
setSelectedIDs: (selectedIDs: string[]) => void;
|
|
11
|
-
rectRotateSensitivity: number;
|
|
12
|
-
setRectRotateSensitivity: (sensitivity: number) => void;
|
|
13
11
|
setPtCtx: (ptCtx: IPointCloudContext) => void;
|
|
14
12
|
}
|
|
15
13
|
declare const useAnnotatedBoxStore: import("zustand").UseBoundStore<import("zustand").StoreApi<Store>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),ToolType=require("../../../../data/enums/ToolType.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$4=require("./components/batchUpdateModal/index.js"),index$1=require("./components/annotatedBox/index.js"),index$3=require("./components/rectRotateSensitivitySlider/index.js"),index$2=require("./components/findTrackIDIndex/index.js"),lbUtils=require("@labelbee/lb-utils"),index$5=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),icon_rect=require("../../../../assets/annotation/rectTool/icon_rect.svg.js"),icon_rect_a=require("../../../../assets/annotation/rectTool/icon_rect_a.svg.js"),index$7=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js"),index$6=require("../../../../components/subAttributeList/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const BoxTrackIDInput=()=>{const[t,e]=React.useState(!1),n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:s}=n,{selectedBox:i,updateSelectedBox:o}=useSingleBox.useSingleBox(),[u,c]=React.useState(""),{t:v}=reactI18next.useTranslation(),m=i==null?void 0:i.info.trackID,a=d=>!!s.find(g=>g.trackID===d&&g.id!==(i==null?void 0:i.info.id)),l=(d=!1)=>{const p=parseInt(u,10);if(d&&e(!1),isNaN(p)){antd.message.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(v("NotAllowDecimalPointsInTrackID"));return}if(a(p)){antd.message.error(v("DuplicateTrackIDsExist"));return}if(!(p>0)){antd.message.error(v("PositiveIntegerCheck"));return}S(p)};React.useEffect(()=>{e(!1)},[m]);const S=d=>{var p;const g=o({trackID:d});(p=n==null?void 0:n.topViewInstance)==null||p.updatePolygonList(g!=null?g:[])};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,v("CurrentBoxTrackIDs")),m&&React__default.default.createElement(index$4,{id:m,updateCurrentPolygonList:d=>S(d)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},t&&m?React__default.default.createElement(antd.Input,{defaultValue:m,onChange:d=>{c(d.target.value)},disabled:!m,size:"small",onBlur:()=>{l()},onPressEnter:()=>{l(!0)}}):React__default.default.createElement("span",null,m),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof m!="undefined"?"pointer":"not-allowed"},onClick:()=>{m&&e(!t)}})))},isAllowUpdateInSegment=({segmentStatus:t,globalPattern:e})=>e===lbUtils.EPointCloudPattern.Segmentation&&![lbUtils.EPointCloudSegmentStatus.Edit,lbUtils.EPointCloudSegmentStatus.Ready].includes(t),AttributeUpdater=({attributeList:t,subAttributeList:e,toolInstance:n,config:s,stepList:i,stepInfo:o,enableColorPicker:u})=>{const[c,v]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready}),{selectedBox:m}=useSingleBox.useSingleBox(),a=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:l}=a,{t:S}=reactI18next.useTranslation(),{defaultAttribute:d}=useAttribute.useAttribute(),p=usePointCloudViews.usePointCloudViews(),{isPointCloudSegmentationPattern:g}=useStatus.useStatus(),T=ctx.useDispatch(),w={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};React.useEffect(()=>{if(!!l)return l.on("syncPointCloudStatus",v),()=>{l.unbind("syncPointCloudStatus",v)}},[l]);const j=(r,C)=>{var b,x,_,E,y;const P=(b=s==null?void 0:s.attributeList)==null?void 0:b.map(f=>f.value===r?__spreadProps(__spreadValues({},f),{color:C}):f),I=__spreadProps(__spreadValues({},s),{attributeList:P}),A=JSON.stringify(I),B=i==null?void 0:i.map(f=>(f==null?void 0:f.step)===(o==null?void 0:o.step)?__spreadProps(__spreadValues({},f),{config:A}):f);(x=a==null?void 0:a.topViewInstance)==null||x.updateAttributeList(P),(_=a==null?void 0:a.sideViewInstance)==null||_.updateAttributeList(P),(E=a==null?void 0:a.backViewInstance)==null||E.updateAttributeList(P),(y=a==null?void 0:a.mainViewInstance)==null||y.setConfig(I),T(actionCreators.SetTaskStepList({stepList:B}))},D=r=>{p.updateViewsByDefaultSize&&p.updateViewsByDefaultSize(r)},L=r=>{isAllowUpdateInSegment({globalPattern:a.globalPattern,segmentStatus:c.segmentStatus})||n.setDefaultAttribute(r)},q=(r,C)=>{isAllowUpdateInSegment({globalPattern:a.globalPattern,segmentStatus:c.segmentStatus})||n.setSubAttribute(r,C)},h=t.map(r=>({label:r.key,value:r.value,color:r==null?void 0:r.color,limit:r==null?void 0:r.limit,isDefault:r==null?void 0:r.isDefault})),k=m||c.cacheSegData&&c.segmentStatus===lbUtils.EPointCloudSegmentStatus.Edit,V=g;return React__default.default.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},React__default.default.createElement("div",{style:w},S("Attribute")),React__default.default.createElement(index$5.default,{list:h,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:r=>L(r),updateColorConfig:j,enableColorPicker:u,updateSize:D,forbidShowLimitPopover:V}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),k&&React__default.default.createElement(index$6,{subAttributeList:e,setSubAttribute:q,getValue:r=>{var C,b,x,_;return((b=(C=a.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:b[r.value])||((_=(x=c.cacheSegData)==null?void 0:x.subAttribute)==null?void 0:_[r.value])}}))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"RectSelector",commonSvg:icon_rect,selectedSvg:icon_rect_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:t})=>{const{ptSegmentInstance:e}=React.useContext(PointCloudContext.PointCloudContext),[n,s]=React.useState("LassoSelector"),{t:i}=reactI18next.useTranslation();return React.useEffect(()=>{if(!e)return;const o=()=>{s("LassoSelector")},u=()=>{s("RectSelector")},c=()=>{s("CircleSelector")};return e.on("LassoSelector",o),e.on("RectSelector",u),e.on("CircleSelector",c),()=>{e.unbind("LassoSelector",o),e.unbind("RectSelector",u),e.unbind("CircleSelector",c)}},[e]),React__default.default.createElement("div",{className:`${index$7.sidebarCls}__level`},renderSegmentTools.map(o=>{const u=n===o.toolName;return React__default.default.createElement("span",{className:`${index$7.sidebarCls}__toolOption`,key:o.toolName,onClick:()=>e==null?void 0:e.emit(o.toolName)},React__default.default.createElement("img",{className:`${index$7.sidebarCls}__singleTool`,src:u?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$7.sidebarCls}__toolOption__selected`]:u})},i(o.toolName)))}))},PointCloudToolSidebar=({stepInfo:t,toolInstance:e,imgList:n,imgIndex:s,stepList:i,enableColorPicker:o})=>{var u,c;const{updatePointCloudPattern:v,pointCloudPattern:m,isPointCloudSegmentationPattern:a}=useStatus.useStatus(),l=index.jsonParser(t.config),S=(u=l==null?void 0:l.attributeList)!=null?u:[],d=(l==null?void 0:l.secondaryAttributeConfigurable)===!0?(c=l==null?void 0:l.inputList)!=null?c:[]:[];return a?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:e}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:S,subAttributeList:d,config:l,stepList:i,stepInfo:t,enableColorPicker:o})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:m,onChange:p=>v==null?void 0:v(p)}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:S,subAttributeList:d,config:l,stepList:i,stepInfo:t,enableColorPicker:o}),(l==null?void 0:l.trackConfigurable)===!0&&m===ToolType.EToolName.Rect&&React__default.default.createElement("div",{style:{flexShrink:0,height:280,overflow:"auto"}},React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$1,{imgList:n,imgIndex:s}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$2.default,{imgList:n,imgIndex:s}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$3,null)))},mapStateToProps=t=>{var e,n,s,i;const o=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList),u=(s=t.annotation)==null?void 0:s.toolInstance,c=(i=t.annotation)==null?void 0:i.stepList;return{stepInfo:o,toolInstance:u,imgList:t.annotation.imgList,imgIndex:t.annotation.imgIndex,stepList:c}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),ToolType=require("../../../../data/enums/ToolType.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$3=require("./components/batchUpdateModal/index.js"),index$1=require("./components/annotatedBox/index.js"),index$2=require("./components/findTrackIDIndex/index.js"),lbUtils=require("@labelbee/lb-utils"),index$4=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),icon_rect=require("../../../../assets/annotation/rectTool/icon_rect.svg.js"),icon_rect_a=require("../../../../assets/annotation/rectTool/icon_rect_a.svg.js"),index$6=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js"),index$5=require("../../../../components/subAttributeList/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const BoxTrackIDInput=()=>{const[t,e]=React.useState(!1),n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:s}=n,{selectedBox:i,updateSelectedBox:o}=useSingleBox.useSingleBox(),[u,c]=React.useState(""),{t:v}=reactI18next.useTranslation(),p=i==null?void 0:i.info.trackID,a=d=>!!s.find(g=>g.trackID===d&&g.id!==(i==null?void 0:i.info.id)),l=(d=!1)=>{const m=parseInt(u,10);if(d&&e(!1),isNaN(m)){antd.message.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(v("NotAllowDecimalPointsInTrackID"));return}if(a(m)){antd.message.error(v("DuplicateTrackIDsExist"));return}if(!(m>0)){antd.message.error(v("PositiveIntegerCheck"));return}S(m)};React.useEffect(()=>{e(!1)},[p]);const S=d=>{var m;const g=o({trackID:d});(m=n==null?void 0:n.topViewInstance)==null||m.updatePolygonList(g!=null?g:[])};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,v("CurrentBoxTrackIDs")),p&&React__default.default.createElement(index$3,{id:p,updateCurrentPolygonList:d=>S(d)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},t&&p?React__default.default.createElement(antd.Input,{defaultValue:p,onChange:d=>{c(d.target.value)},disabled:!p,size:"small",onBlur:()=>{l()},onPressEnter:()=>{l(!0)}}):React__default.default.createElement("span",null,p),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{p&&e(!t)}})))},isAllowUpdateInSegment=({segmentStatus:t,globalPattern:e})=>e===lbUtils.EPointCloudPattern.Segmentation&&![lbUtils.EPointCloudSegmentStatus.Edit,lbUtils.EPointCloudSegmentStatus.Ready].includes(t),AttributeUpdater=({attributeList:t,subAttributeList:e,toolInstance:n,config:s,stepList:i,stepInfo:o,enableColorPicker:u})=>{const[c,v]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready}),{selectedBox:p}=useSingleBox.useSingleBox(),a=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:l}=a,{t:S}=reactI18next.useTranslation(),{defaultAttribute:d}=useAttribute.useAttribute(),m=usePointCloudViews.usePointCloudViews(),{isPointCloudSegmentationPattern:g}=useStatus.useStatus(),T=ctx.useDispatch(),w={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};React.useEffect(()=>{if(!!l)return l.on("syncPointCloudStatus",v),()=>{l.unbind("syncPointCloudStatus",v)}},[l]);const j=(r,C)=>{var b,x,_,E,y;const P=(b=s==null?void 0:s.attributeList)==null?void 0:b.map(f=>f.value===r?__spreadProps(__spreadValues({},f),{color:C}):f),I=__spreadProps(__spreadValues({},s),{attributeList:P}),A=JSON.stringify(I),B=i==null?void 0:i.map(f=>(f==null?void 0:f.step)===(o==null?void 0:o.step)?__spreadProps(__spreadValues({},f),{config:A}):f);(x=a==null?void 0:a.topViewInstance)==null||x.updateAttributeList(P),(_=a==null?void 0:a.sideViewInstance)==null||_.updateAttributeList(P),(E=a==null?void 0:a.backViewInstance)==null||E.updateAttributeList(P),(y=a==null?void 0:a.mainViewInstance)==null||y.setConfig(I),T(actionCreators.SetTaskStepList({stepList:B}))},L=r=>{m.updateViewsByDefaultSize&&m.updateViewsByDefaultSize(r)},D=r=>{isAllowUpdateInSegment({globalPattern:a.globalPattern,segmentStatus:c.segmentStatus})||n.setDefaultAttribute(r)},q=(r,C)=>{isAllowUpdateInSegment({globalPattern:a.globalPattern,segmentStatus:c.segmentStatus})||n.setSubAttribute(r,C)},h=t.map(r=>({label:r.key,value:r.value,color:r==null?void 0:r.color,limit:r==null?void 0:r.limit,isDefault:r==null?void 0:r.isDefault})),k=p||c.cacheSegData&&c.segmentStatus===lbUtils.EPointCloudSegmentStatus.Edit,V=g;return React__default.default.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},React__default.default.createElement("div",{style:w},S("Attribute")),React__default.default.createElement(index$4.default,{list:h,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:r=>D(r),updateColorConfig:j,enableColorPicker:u,updateSize:L,forbidShowLimitPopover:V}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),k&&React__default.default.createElement(index$5,{subAttributeList:e,setSubAttribute:q,getValue:r=>{var C,b,x,_;return((b=(C=a.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:b[r.value])||((_=(x=c.cacheSegData)==null?void 0:x.subAttribute)==null?void 0:_[r.value])}}))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"RectSelector",commonSvg:icon_rect,selectedSvg:icon_rect_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:t})=>{const{ptSegmentInstance:e}=React.useContext(PointCloudContext.PointCloudContext),[n,s]=React.useState("LassoSelector"),{t:i}=reactI18next.useTranslation();return React.useEffect(()=>{if(!e)return;const o=()=>{s("LassoSelector")},u=()=>{s("RectSelector")},c=()=>{s("CircleSelector")};return e.on("LassoSelector",o),e.on("RectSelector",u),e.on("CircleSelector",c),()=>{e.unbind("LassoSelector",o),e.unbind("RectSelector",u),e.unbind("CircleSelector",c)}},[e]),React__default.default.createElement("div",{className:`${index$6.sidebarCls}__level`},renderSegmentTools.map(o=>{const u=n===o.toolName;return React__default.default.createElement("span",{className:`${index$6.sidebarCls}__toolOption`,key:o.toolName,onClick:()=>e==null?void 0:e.emit(o.toolName)},React__default.default.createElement("img",{className:`${index$6.sidebarCls}__singleTool`,src:u?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$6.sidebarCls}__toolOption__selected`]:u})},i(o.toolName)))}))},PointCloudToolSidebar=({stepInfo:t,toolInstance:e,imgList:n,imgIndex:s,stepList:i,enableColorPicker:o})=>{var u,c;const{updatePointCloudPattern:v,pointCloudPattern:p,isPointCloudSegmentationPattern:a}=useStatus.useStatus(),l=index.jsonParser(t.config),S=(u=l==null?void 0:l.attributeList)!=null?u:[],d=(l==null?void 0:l.secondaryAttributeConfigurable)===!0?(c=l==null?void 0:l.inputList)!=null?c:[]:[];return a?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:e}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:S,subAttributeList:d,config:l,stepList:i,stepInfo:t,enableColorPicker:o})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:p,onChange:m=>v==null?void 0:v(m)}),React__default.default.createElement(AttributeUpdater,{toolInstance:e,attributeList:S,subAttributeList:d,config:l,stepList:i,stepInfo:t,enableColorPicker:o}),(l==null?void 0:l.trackConfigurable)===!0&&p===ToolType.EToolName.Rect&&React__default.default.createElement("div",{style:{flexShrink:0,height:280,overflow:"auto"}},React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$1,{imgList:n,imgIndex:s}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$2.default,{imgList:n,imgIndex:s})))},mapStateToProps=t=>{var e,n,s,i;const o=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList),u=(s=t.annotation)==null?void 0:s.toolInstance,c=(i=t.annotation)==null?void 0:i.stepList;return{stepInfo:o,toolInstance:u,imgList:t.annotation.imgList,imgIndex:t.annotation.imgIndex,stepList:c}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudPattern as J}from"@labelbee/lb-utils";import
|
|
1
|
+
import{EPointCloudPattern as J}from"@labelbee/lb-utils";import gt,{useState as s,useRef as Zt,useMemo as ht,useCallback as K,useEffect as Q}from"react";import{ActionsHistory as It,EToolName as U,uuid as qt}from"@labelbee/lb-annotation";import{useDispatch as Jt}from"../../store/ctx.js";import{ChangeSave as Kt}from"../../store/annotation/actionCreators.js";import Qt from"../../store/annotatedBox/index.js";import vt from"lodash";var Ut=Object.defineProperty,Wt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,bt=(l,e,a)=>e in l?Ut(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,N=(l,e)=>{for(var a in e||(e={}))Yt.call(e,a)&&bt(l,a,e[a]);if(Pt)for(var a of Pt(e))$t.call(e,a)&&bt(l,a,e[a]);return l},yt=(l,e)=>Wt(l,Xt(e)),te=(l,e,a)=>new Promise((L,A)=>{var _=f=>{try{y(a.next(f))}catch(C){A(C)}},j=f=>{try{y(a.throw(f))}catch(C){A(C)}},y=f=>f.done?L(f.value):Promise.resolve(f.value).then(_,j);y((a=a.apply(l,e)).next())});const Ct=l=>vt.pick(l,["id","attribute","width","height","x","y","imageName"]),wt=gt.createContext({rectList:[],pointCloudBoxList:[],pointCloudSphereList:[],displayPointCloudList:[],displaySphereList:[],displayLineList:[],polygonList:[],lineList:[],selectedID:"",selectedIDs:[],highlightIDs:[],setHighlightIDs:()=>{},valid:!0,setSelectedIDs:()=>{},setPointCloudResult:()=>{},setPointCloudSphereList:()=>{},setPointCloudValid:()=>{},setTopViewInstance:()=>{},setSideViewInstance:()=>{},setBackViewInstance:()=>{},setMainViewInstance:()=>{},addSelectedID:()=>{},addHighlightID:()=>{},selectedAllBoxes:()=>{},addPointCloudBox:()=>[],addPointCloudSphere:()=>[],setPolygonList:()=>{},setRectList:()=>{},addRectIn2DView:()=>{},removeRectIn2DView:()=>{},updateRectIn2DView:()=>{},setLineList:()=>{},zoom:1,setZoom:()=>{},history:new It,hideAttributes:[],setHideAttributes:()=>{},toggleAttributesVisible:()=>{},reRender:()=>{},setAttrPanelLayout:()=>{},attrPanelLayout:"",syncAllViewPointCloudColor:()=>Promise.resolve(),defaultAttribute:"",setDefaultAttribute:()=>{},pointCloudPattern:U.Rect,setPointCloudPattern:()=>{},selectSpecAttr:()=>{},globalPattern:J.Detection,setGlobalPattern:()=>{},setPtSegmentInstance:()=>{},segmentation:[],setSegmentation:()=>{},clearAllDetectionInstance:()=>{},highlight2DDataList:[],setHighlight2DDataList:()=>{},cuboidBoxIn2DView:!0,setCuboidBoxIn2DView:l=>{},imageSizes:{},cacheImageNodeSize:()=>{},unlinkImageItems:[],addRectFromPointCloudBoxByImageName:l=>!1,removeRectBySpecifyId:(l,e,a)=>!1,removeRectByPointCloudBoxId:l=>!1}),ee=({children:l})=>{const[e,a]=s([]),[L,A]=s([]),[_,j]=s([]),[y,f]=s([]),[C,St]=s([]),[v,F]=s([]),[R,k]=s([]),[W,Lt]=s(!0),[X,Dt]=s(!0),[Y,xt]=s(1),[m,$]=s(),[tt,et]=s(),[nt,it]=s(),[u,ot]=s(),[st,At]=s(""),[z,_t]=s(U.Rect),Rt=Zt(new It).current,[g,E]=s([]),[rt,Vt]=s(""),[G,Bt]=s(J.Detection),[D,lt]=s(void 0),[M,Ot]=s([]),[T,Ht]=s([]),h=Qt(),[at,Nt]=s({}),jt=Jt(),Ft=o=>{const{imgNode:r,path:i}=o;i&&r&&Nt(p=>yt(N({},p),{[i]:{width:r.width,height:r.height}}))},dt=ht(()=>v.length===1?v[0]:"",[v]),V=K((o,r,i="extId")=>{const p=i||"id",c=new Set(r);return f(I=>{let w=!1;const S=I.filter(O=>{const Z=O[p],H=c.has(Z)?O.imageName!==o:!0;return H||(w=!0),H});return w?S:I}),!0},[]),ct=K(o=>{const r=e.map(i=>i.id);return V(o,r,"extId")},[e,V]),ut=K(o=>{if(!o)return!1;const r=e.filter(i=>Array.isArray(i.rects)).map(i=>{const{id:p,attribute:c,trackID:I}=i,w=i.rects.find(S=>S.imageName===o);if(w){const S=vt.pick(w,["width","height","x","y","imageName"]);return yt(N({},S),{id:qt(),attribute:c,order:I,extId:p,lineDash:[]})}return null}).filter(i=>i!==null);return r.length?(f(i=>{const p=new Set(i.filter(I=>o===I.imageName).map(I=>I.extId)),c=r.filter(I=>p.has(I.extId)===!1);return c.length?[...i,...c]:i}),!0):!1},[e]),B=ht(()=>{const o=e.find(t=>t.id===dt),r=t=>{const n=e.concat(t);return a(n),n},i=t=>{const n=L.concat(t);return A(n),n},p=t=>{Lt(t!==!1)},c=t=>{t===void 0&&F([]),typeof t=="string"&&F([t]),Array.isArray(t)&&F(Array.from(new Set(t)))},I=t=>{v.includes(t)?c(v.filter(n=>n!==t)):c([...v,t])},w=t=>{const n=Ct(t);f(d=>[...d,n])},S=(t,n=!1)=>{const d=Ct(t);f(b=>b.map(P=>P.id===t.id?n?N(N({},P),d):d:P))},O=t=>{f(n=>n.filter(d=>!t.find(b=>b.id===d.id)))},Z=t=>{R.includes(t)?k([]):k([t])},H=()=>{if(z===U.Rect){const t=e.map(n=>n.id);c(t),m==null||m.pointCloud2dOperation.setSelectedIDs(t)}},zt=t=>{c(e.filter(n=>n.attribute===t).map(n=>n.id))},q=e.filter(t=>!g.includes(t.attribute)),pt=L.filter(t=>!g.includes(t.attribute)),ft=C.filter(t=>t.attribute&&!g.includes(t.attribute)),Et=t=>{if(g.includes(t))E(g.filter(n=>n!==t));else{const n=g.concat(t);E(n)}},Gt=(()=>{const t=q.map(d=>d.id),n=new Set(t);return y.filter(d=>d.extId&&n.has(d.extId)).map(d=>d.imageName)})(),Mt=(t=q,n=_,d=pt,b=ft,P=M)=>{var x;u==null||u.clearAllBox(),u==null||u.clearAllSphere(),m==null||m.updatePolygonList(t,n),m==null||m.updatePointList(d),m==null||m.updateLineList(b),u==null||u.generateBoxes(t),u==null||u.generateSpheres(d),(x=D==null?void 0:D.store)==null||x.updateCurrentSegment(P),mt(t)},Tt=()=>{$(void 0),et(void 0),it(void 0),ot(void 0)},mt=(t,n)=>te(void 0,null,function*(){var d;if(!u)return;const b=u.pointCloudObject;if(!!b)try{const P=yield u.getHighlightIndexByMappingImgList({mappingImgList:n!=null?n:T,points:b.geometry.attributes.position.array}),x=yield u==null?void 0:u.highlightOriginPointCloud(t,P);return x&&((d=m==null?void 0:m.pointCloudInstance)==null||d.updateColor(x)),x}catch(P){console.error(P)}});return{selectedID:dt,pointCloudBoxList:e,pointCloudSphereList:L,displayPointCloudList:q,displaySphereList:pt,displayLineList:ft,selectedIDs:v,setPointCloudResult:a,setSelectedIDs:c,addPointCloudBox:r,addPointCloudSphere:i,setPointCloudSphereList:A,valid:W,selectedPointCloudBox:o,setPointCloudValid:p,addSelectedID:I,addHighlightID:Z,selectedAllBoxes:H,topViewInstance:m,setTopViewInstance:$,sideViewInstance:tt,setSideViewInstance:et,backViewInstance:nt,setBackViewInstance:it,mainViewInstance:u,setMainViewInstance:ot,polygonList:_,setPolygonList:j,rectList:y,setRectList:f,addRectIn2DView:w,removeRectIn2DView:O,updateRectIn2DView:S,lineList:C,setLineList:St,zoom:Y,setZoom:xt,history:Rt,toggleAttributesVisible:Et,hideAttributes:g,setHideAttributes:E,reRender:Mt,attrPanelLayout:rt,setAttrPanelLayout:Vt,syncAllViewPointCloudColor:mt,defaultAttribute:st,setDefaultAttribute:At,pointCloudPattern:z,setPointCloudPattern:_t,selectSpecAttr:zt,globalPattern:G,setGlobalPattern:t=>{G!==t&&(jt(Kt),Bt(t),t===J.Detection&<(void 0))},ptSegmentInstance:D,setPtSegmentInstance:lt,segmentation:M,setSegmentation:Ot,clearAllDetectionInstance:Tt,highlight2DDataList:T,setHighlight2DDataList:Ht,cuboidBoxIn2DView:X,setCuboidBoxIn2DView:Dt,imageSizes:at,cacheImageNodeSize:Ft,highlightIDs:R,setHighlightIDs:k,unlinkImageItems:Gt,removeRectByPointCloudBoxId:ct,removeRectBySpecifyId:V,addRectFromPointCloudBoxByImageName:ut}},[W,v,e,L,_,C,y,m,tt,nt,u,Y,g,rt,st,z,G,D,M,T,X,at,R,ct,V,ut]);Q(()=>{var o,r,i;(o=h==null?void 0:h.setPointCloudBoxList)==null||o.call(h,e),(r=h==null?void 0:h.setHighlightIDs)==null||r.call(h,R),(i=h==null?void 0:h.setSelectedIDs)==null||i.call(h,v)},[e,v,R]),Q(()=>{var o;(o=h==null?void 0:h.setPtCtx)==null||o.call(h,B)},[B]);const kt=()=>{const o=e.filter(c=>g.includes(c.attribute)),{setSelectedIDs:r,reRender:i}=B,p=o.map(c=>c.id);p.length>0&&r(v.filter(c=>!p.includes(c))),i()};return Q(()=>{var o,r,i,p;kt(),(r=(o=m==null?void 0:m.toolInstance)==null?void 0:o.setHiddenAttributes)==null||r.call(o,g),(p=(i=D==null?void 0:D.store)==null?void 0:i.setHiddenAttributes)==null||p.call(i,g)},[g]),gt.createElement(wt.Provider,{value:B},l)};export{wt as PointCloudContext,ee as PointCloudProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as ee}from"./PointCloudContext.js";import{useRotate as te}from"./hooks/useRotate.js";import{useBoxes as oe}from"./hooks/useBoxes.js";import{useSingleBox as re}from"./hooks/useSingleBox.js";import{useSphere as ne}from"./hooks/useSphere.js";import{useContext as se,useEffect as c}from"react";import{EPointCloudName as ie,CommonToolUtils as ae,AttributeUtils as ue,EToolName as P,cTool as le}from"@labelbee/lb-annotation";import{message as
|
|
1
|
+
import{PointCloudContext as ee}from"./PointCloudContext.js";import{useRotate as te}from"./hooks/useRotate.js";import{useBoxes as oe}from"./hooks/useBoxes.js";import{useSingleBox as re}from"./hooks/useSingleBox.js";import{useSphere as ne}from"./hooks/useSphere.js";import{useContext as se,useEffect as c}from"react";import{EPointCloudName as ie,CommonToolUtils as ae,AttributeUtils as ue,EToolName as P,cTool as le}from"@labelbee/lb-annotation";import{message as S}from"antd";import{connect as de}from"react-redux";import{a2MapStateToProps as ce}from"../../store/annotation/map.js";import{useStatus as pe}from"./hooks/useStatus.js";import{usePointCloudViews as me}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as ve,useDispatch as be}from"../../store/ctx.js";import{useHistory as Pe}from"./hooks/useHistory.js";import{useAttribute as fe}from"./hooks/useAttribute.js";import{useConfig as ye}from"./hooks/useConfig.js";import{usePolygon as we}from"./hooks/usePolygon.js";import{useLine as Ce}from"./hooks/useLine.js";import{useTranslation as he}from"react-i18next";import{PreDataProcess as ge}from"../../store/annotation/actionCreators.js";var Se=Object.defineProperty,xe=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,I=(l,r,u)=>r in l?Se(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,f=(l,r)=>{for(var u in r||(r={}))_e.call(r,u)&&I(l,u,r[u]);if(D)for(var u of D(r))Ve.call(r,u)&&I(l,u,r[u]);return l},y=(l,r)=>xe(l,ke(r));const{EPolygonPattern:Le}=le,Be=({currentData:l,config:r,checkMode:u,configString:E,imgIndex:x,toolInstanceRef:i})=>{const t=se(ee),{changeSelectedBoxValid:T,selectNextBox:N,selectPrevBox:H,updateSelectedBox:k,deleteSelectedPointCloudBoxAndPolygon:K}=re(),{selectedSphere:w,updatePointCloudSphere:U}=ne(),{clearAllResult:C,updatePointCloudPattern:z}=pe(),{copySelectedBoxes:F,pasteSelectedBoxes:q,copiedBoxes:G}=oe({config:r}),{updateRotate:h}=te({currentData:l}),{updatePointCloudData:v,topViewSelectedChanged:_}=me(),{redo:V,undo:L,pushHistoryWithList:M,pushHistoryUnderUpdatePolygon:R,pushHistoryUnderUpdateLine:W}=Pe(),Y=be(),{syncThreeViewsAttribute:B}=fe(),{syncAllViewsConfig:$,reRenderTopViewRange:J}=ye(),{selectedPolygon:O}=we(),{selectedLine:j}=Ce(),{t:g}=he(),b=e=>{var o;const{topViewInstance:n}=t;!n||(o=n.pointCloud2dOperation)==null||o.updateSelectedPolygonsPoints(e)},Q=(e,o)=>{var n,a;const{topViewInstance:d,mainViewInstance:s}=t;if(!d)return;const{pointCloud2dOperation:p}=d;switch(e){case"q":{h(2);break}case"e":h(-2);break;case"g":h(180);break;case"u":{const m=p.pattern===Le.Normal?P.Rect:P.Polygon;z(m);const Z={[P.Polygon]:g("PolygonPattern"),[P.Rect]:g("RectPattern")};S.success(g("ChangePatternMsg",{pattern:Z[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=ue.getAttributeByKeycode(o.keyCode,r.attributeList);m!==void 0&&((a=i.current)==null||a.setDefaultAttribute(m))}return}}},X=(e,o)=>{switch(e){case"c":F();break;case"v":q();break;case"a":o.preventDefault(),t.selectedAllBoxes();break;case"z":{o.shiftKey?V():L();break}}},A=e=>{if(!ae.hotkeyFilter(e)||u===!0)return;const o=e.key.toLocaleLowerCase();if(e.ctrlKey){X(o,e);return}Q(o,e)};return c(()=>{const{topViewInstance:e}=t;if(!!e)return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[t,G,r,t.pointCloudBoxList,t.polygonList]),c(()=>{$(r)},[E]),c(()=>{(r==null?void 0:r.radius)&&J(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),c(()=>{v==null||v()},[x,t.mainViewInstance]),c(()=>{t.setHideAttributes([])},[x]),c(()=>{i.current.setDefaultAttribute=e=>{var o,n,a,d;B(e);const s=t.selectedPointCloudBox;if(s){s.attribute=e;const p=Y(ge({tool:ie.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&&R(y(f({},O),{attribute:e})),j&&W(y(f({},j),{attribute:e})),w){const p=U(y(f({},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=y(f({},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=>{S.error(s)},d=s=>{S.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 Oe=de(ce,null,null,{context:ve})(Be);export{Oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as x}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 h}from"react";import{PointCloudContext as F}from"./PointCloudContext.js";import{useRotate as Pe}from"./hooks/useRotate.js";import{useSingleBox as K}from"./hooks/useSingleBox.js";import{PointCloudContainer as ge}from"./PointCloudLayout.js";import{BoxInfos as X,PointCloudValidity as ye}from"./PointCloudInfos.js";import{usePolygon as Ie}from"./hooks/usePolygon.js";import{useSphere as Y}from"./hooks/useSphere.js";import{useZoom as q}from"./hooks/useZoom.js";import{Slider as xe}from"antd";import{a2MapStateToProps as he}from"../../store/annotation/map.js";import{connect as Ve}from"react-redux";import{usePointCloudViews as
|
|
1
|
+
import{getClassName as x}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 h}from"react";import{PointCloudContext as F}from"./PointCloudContext.js";import{useRotate as Pe}from"./hooks/useRotate.js";import{useSingleBox as K}from"./hooks/useSingleBox.js";import{PointCloudContainer as ge}from"./PointCloudLayout.js";import{BoxInfos as X,PointCloudValidity as ye}from"./PointCloudInfos.js";import{usePolygon as Ie}from"./hooks/usePolygon.js";import{useSphere as Y}from"./hooks/useSphere.js";import{useZoom as q}from"./hooks/useZoom.js";import{Slider as xe}from"antd";import{a2MapStateToProps as he}from"../../store/annotation/map.js";import{connect as Ve}from"react-redux";import{usePointCloudViews as _e}from"./hooks/usePointCloudViews.js";import Se from"../../hooks/useSize.js";import{useTranslation as Ee}from"react-i18next";import{LabelBeeContext as Le}from"../../store/ctx.js";import{jsonParser as Oe}from"../../utils/index.js";import be from"../../utils/ToolUtils.js";import je from"lodash";import Te from"./components/PointCloudSizeSlider/index.js";import{useHistory as ke}from"./hooks/useHistory.js";import Ae from"./components/TitleButton/index.js";var De=Object.defineProperty,Ne=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,$=(n,s,r)=>s in n?De(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r,B=(n,s)=>{for(var r in s||(s={}))Re.call(s,r)&&$(n,r,s[r]);if(M)for(var r of M(s))Ue.call(s,r)&&$(n,r,s[r]);return n},R=(n,s)=>Ne(n,Be(s));const{EPolygonPattern:Ze,EToolName:G}=fe,{ESortDirection:J}=ve,ze=ue.default,Q=(n,s,r=1)=>{const{width:w,height:u}=s,P={x:n.x+w*r/2,y:n.y+u*r/2},g={x:s.width/2,y:s.height/2};return{offsetX:(g.x-P.x)/r,offsetY:-(g.y-P.y)/r}},He=({currentData:n})=>{var s,r;const{zoom:w,zoomIn:u,zoomOut:P,initialPosition:g}=q(),{selectNextBox:E,selectPrevBox:L}=K(),{switchToNextSphere:V}=Y(),{updateRotate:y}=Pe({currentData:n}),I=i.useContext(F),{topViewInstance:O}=I,_=(r=(s=I==null?void 0:I.topViewInstance)==null?void 0:s.toolScheduler)==null?void 0:r.getCurrentToolName(),m=2,e=()=>{y(-m)},c=()=>{y(m)},f=()=>{y(180)};return i.createElement(i.Fragment,null,i.createElement(Te,{onChange:b=>{var S;(S=O==null?void 0:O.pointCloudInstance)==null||S.updatePointSize({customSize:b})}}),i.createElement("span",{onClick:c,className:x("point-cloud","rotate-reserve")}),i.createElement("span",{onClick:e,className:x("point-cloud","rotate")}),i.createElement("span",{onClick:f,className:x("point-cloud","rotate-180")}),i.createElement(z,null),i.createElement(de,{onClick:()=>{if(_===G.Point){V(J.descend);return}L(!0)},className:x("point-cloud","prev")}),i.createElement(pe,{onClick:()=>{if(_===G.Point){V(J.ascend);return}E(!0)},className:x("point-cloud","next")}),i.createElement(z,null),i.createElement(ae,{initialPosition:g,zoomIn:u,zoomOut:P,zoom:w}))},We=({setZAxisLimit:n,zAxisLimit:s,checkMode:r})=>r?null:i.createElement("div",{style:{position:"absolute",top:128,right:8,height:"50%",zIndex:20}},i.createElement(xe,{vertical:!0,step:.5,max:10,min:.5,defaultValue:s,onAfterChange:w=>{n(w)}})),Fe=({currentData:n,imgList:s,stepInfo:r,drawLayerSlot:w,checkMode:u,intelligentFit:P,setIsEnlargeTopView:g,isEnlargeTopView:E,onExitZoom:L,highlightAttribute:V})=>{var y,I;const[O,_]=W({zoom:1,currentPos:{x:0,y:0}}),m=we(null),e=i.useContext(F),c=Se(m),f=Oe(r.config),{setZoom:b,syncTopviewToolZoom:S}=q(),{hideAttributes:ee}=e,{addPolygon:te,deletePolygon:oe}=Ie(),{deletePointCloudSphere:ne}=Y(),{deletePointCloudBox:ie,changeValidByID:le}=K(),[j,se]=W(10),{t:U}=Ee(),C=_e(),{pushHistoryWithList:re}=ke();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:R(B({},f),{pointCloudPattern:e.pointCloudPattern}),checkMode:u,toolName:be.getPointCloudToolList(),proxyMode:u});e.setTopViewInstance(a)}},[n]),h(()=>{if(!c||!e.topViewInstance||!e.sideViewInstance)return;const{toolInstance:o}=e.topViewInstance;o.singleOn("dataUpdated",(t,l)=>{const p=je.cloneDeep(t).map(d=>R(B({},d),{pointList:H.pointListTransferCanvas2World(d.pointList,c)}));e.setSelectedIDs(l),e.setLineList(p),re({lineList:p})}),o.singleOn("pointCreated",(t,l)=>{C.topViewAddSphere({newPoint:t,size:c,trackConfigurable:f.trackConfigurable,zoom:l})}),o.singleOn("pointDeleted",t=>{ne(t)}),o.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),o.singleOn("updatePointByDrag",(t,l)=>{var p;(p=C.topViewUpdatePoint)==null||p.call(C,t,c)}),o.singleOn("polygonCreated",(t,l)=>{if(o.pattern===Ze.Normal||!(n==null?void 0:n.url)){const p=R(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:s,trackConfigurable:f.trackConfigurable,zoom:l,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 l;(l=C.topViewUpdateBox)==null||l.call(C,t,c)});const a=t=>{var l;const p=le(t);p&&e.syncAllViewPointCloudColor(p),e.polygonList.find(d=>d.id===t)&&((l=e.topViewInstance)==null||l.toolInstance.setPolygonValidAndRender(t,!0))};return o.on("validUpdate",a),()=>{o.unbind("validUpdate",a)}},[e,c,n,C,e.polygonList,e.lineList,(y=e.topViewInstance)==null?void 0:y.toolInstance]),h(()=>{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:l,toolInstance:p}}=e;p.singleOn("renderZoom",(d,v)=>{const{offsetX:T,offsetY:k}=Q(v,c,d);if(l.camera.zoom=d,v){const{x:A,y:D,z:N}=l.initCameraPosition;l.camera.position.set(A+k,D-T,N)}l.camera.updateProjectionMatrix(),l.render(),b(d),S(v,d,c),_({zoom:d,currentPos:v})}),p.singleOn("dragMove",({currentPos:d,zoom:v})=>{const{offsetX:T,offsetY:k}=Q(d,c,v);l.camera.zoom=v;const{x:A,y:D,z:N}=l.initCameraPosition;l.camera.position.set(A+k,D-T,N),l.render(),S(d,v,c),_({zoom:v,currentPos:d})})},[c,e.topViewInstance,(I=e.topViewInstance)==null?void 0:I.toolInstance]),h(()=>{var o,a;(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null||a.applyZAxisPoints(j)},[j]),h(()=>{var o,a,t,l;C.topViewSelectedChanged({}),(l=(t=(a=(o=e.topViewInstance)==null?void 0:o.toolInstance)==null?void 0:a.selection)==null?void 0:t.hardSetSelectedIDs)==null||l.call(t,e.selectedIDs)},[e.selectedIDs]),h(()=>(window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}),[]);const Z=o=>{const{keyCode:a}=o;a===ze.Esc&&L()};return h(()=>{var o,a,t;(t=(a=(o=e.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null?void 0:a.setHighlightAttribute)==null||t.call(a,V)},[e.topViewInstance,V]),i.createElement(ge,{className:x("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(Ae,{title:U("TopView"),onClick:()=>{g(!0)}}),toolbar:i.createElement(He,{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(O)),!E&&i.createElement(X,{checkMode:u,config:f}),i.createElement(We,{checkMode:u,zAxisLimit:j,setZAxisLimit:se}),i.createElement(ye,null)))};var Ke=Ve(he,null,null,{context:Le})(Fe);export{Ke as default};
|
package/es/index.css
CHANGED
|
@@ -49,19 +49,13 @@
|
|
|
49
49
|
right: -5px;
|
|
50
50
|
top: -5px;
|
|
51
51
|
}
|
|
52
|
-
.index-module_rectRotateSensitivitySlider__tGjUn {
|
|
53
|
-
padding: 12px 20px;
|
|
54
|
-
}
|
|
55
|
-
.index-module_rectRotateSensitivitySlider__tGjUn .index-module_title__aAJW6 {
|
|
56
|
-
margin-bottom: 16px;
|
|
57
|
-
}
|
|
58
52
|
.index-module_container__RwV5P {
|
|
59
53
|
padding: 12px 20px;
|
|
60
54
|
}
|
|
61
55
|
.index-module_container__RwV5P .index-module_content__vHpS9 {
|
|
62
56
|
display: flex;
|
|
63
57
|
justify-content: space-between;
|
|
64
|
-
margin-top:
|
|
58
|
+
margin-top: 4px;
|
|
65
59
|
}
|
|
66
60
|
.index-module_latexEditor__0fK8G {
|
|
67
61
|
line-height: 32px;
|
|
@@ -1517,7 +1511,6 @@
|
|
|
1517
1511
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1518
1512
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1519
1513
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1520
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1521
1514
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1522
1515
|
background: #f5f5f5;
|
|
1523
1516
|
}
|
|
@@ -1527,7 +1520,6 @@
|
|
|
1527
1520
|
.bee-sidebar #style-width .ant-slider .ant-slider-dot,
|
|
1528
1521
|
.bee-sidebar #style-color .ant-slider .ant-slider-dot,
|
|
1529
1522
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-dot,
|
|
1530
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-dot,
|
|
1531
1523
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-dot {
|
|
1532
1524
|
width: 0;
|
|
1533
1525
|
height: 0;
|
|
@@ -1539,7 +1531,6 @@
|
|
|
1539
1531
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle,
|
|
1540
1532
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle,
|
|
1541
1533
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle,
|
|
1542
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle,
|
|
1543
1534
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle {
|
|
1544
1535
|
background-image: url("../dist/assets/icons/cc550fff.svg");
|
|
1545
1536
|
background-repeat: no-repeat;
|
|
@@ -1557,7 +1548,6 @@
|
|
|
1557
1548
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle:focus,
|
|
1558
1549
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle:focus,
|
|
1559
1550
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle:focus,
|
|
1560
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle:focus,
|
|
1561
1551
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle:focus {
|
|
1562
1552
|
box-shadow: none;
|
|
1563
1553
|
}
|
|
@@ -1567,7 +1557,6 @@
|
|
|
1567
1557
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1568
1558
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1569
1559
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1570
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1571
1560
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow {
|
|
1572
1561
|
color: inherit;
|
|
1573
1562
|
font-style: normal;
|
|
@@ -1591,7 +1580,6 @@
|
|
|
1591
1580
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1592
1581
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1593
1582
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1594
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1595
1583
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header {
|
|
1596
1584
|
position: relative;
|
|
1597
1585
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -1618,9 +1606,6 @@
|
|
|
1618
1606
|
.bee-sidebar #style-fillOpacity .ant-slider-rail,
|
|
1619
1607
|
.bee-sidebar #style-fillOpacity .ant-slider-track,
|
|
1620
1608
|
.bee-sidebar #style-fillOpacity .ant-slider-step,
|
|
1621
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-rail,
|
|
1622
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-track,
|
|
1623
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step,
|
|
1624
1609
|
.bee-sidebar #style-borderOpacity .ant-slider-rail,
|
|
1625
1610
|
.bee-sidebar #style-borderOpacity .ant-slider-track,
|
|
1626
1611
|
.bee-sidebar #style-borderOpacity .ant-slider-step {
|
|
@@ -1633,46 +1618,38 @@
|
|
|
1633
1618
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1634
1619
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1635
1620
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1636
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1637
1621
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1638
1622
|
background: none;
|
|
1639
1623
|
}
|
|
1640
1624
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot,
|
|
1641
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot
|
|
1642
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot {
|
|
1625
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot {
|
|
1643
1626
|
height: 12px;
|
|
1644
1627
|
background: #666666;
|
|
1645
1628
|
border-radius: 0;
|
|
1646
1629
|
margin-left: -2px;
|
|
1647
1630
|
}
|
|
1648
1631
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(1),
|
|
1649
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1)
|
|
1650
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(1) {
|
|
1632
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(1) {
|
|
1651
1633
|
width: 1px;
|
|
1652
1634
|
}
|
|
1653
1635
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(2),
|
|
1654
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2)
|
|
1655
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(2) {
|
|
1636
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(2) {
|
|
1656
1637
|
width: 2px;
|
|
1657
1638
|
}
|
|
1658
1639
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(3),
|
|
1659
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3)
|
|
1660
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(3) {
|
|
1640
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(3) {
|
|
1661
1641
|
width: 3px;
|
|
1662
1642
|
}
|
|
1663
1643
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(4),
|
|
1664
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4)
|
|
1665
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(4) {
|
|
1644
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(4) {
|
|
1666
1645
|
width: 4px;
|
|
1667
1646
|
}
|
|
1668
1647
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot:nth-of-type(5),
|
|
1669
|
-
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5)
|
|
1670
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider-step .ant-slider-dot:nth-of-type(5) {
|
|
1648
|
+
.bee-sidebar #style-width .ant-slider-step .ant-slider-dot:nth-of-type(5) {
|
|
1671
1649
|
width: 5px;
|
|
1672
1650
|
}
|
|
1673
1651
|
.bee-sidebar #style-radius .ant-slider:hover .ant-slider-rail,
|
|
1674
|
-
.bee-sidebar #style-width .ant-slider:hover .ant-slider-rail
|
|
1675
|
-
.bee-sidebar #style-rectRotateSensitivity .ant-slider:hover .ant-slider-rail {
|
|
1652
|
+
.bee-sidebar #style-width .ant-slider:hover .ant-slider-rail {
|
|
1676
1653
|
background: #f5f5f5;
|
|
1677
1654
|
}
|
|
1678
1655
|
.bee-sidebar #style-color .ant-slider-rail {
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as l}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as c,useImperativeHandle as m}from"react";import{I18nextProvider as u}from"react-i18next";import{Provider as f}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as v,PageJump as T}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as
|
|
1
|
+
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as l}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import r,{useState as c,useImperativeHandle as m}from"react";import{I18nextProvider as u}from"react-i18next";import{Provider as f}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as v,PageJump as T}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as g}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as j}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{default as AnnotatedBox}from"./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js";export{FindTrackIDIndexInCheckMode as FindTrackIDIndex}from"./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js";export{WrapAudioPlayer as AudioPlayer}from"./components/audioPlayer/index.js";export{generatePointCloudBoxRects}from"./utils/index.js";export{default as SubAttributeList}from"./components/subAttributeList/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var b=Object.defineProperty,_=Object.defineProperties,I=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,p=(o,e,t)=>e in o?b(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,A=(o,e)=>{for(var t in e||(e={}))C.call(e,t)&&p(o,t,e[t]);if(s)for(var t of s(e))V.call(e,t)&&p(o,t,e[t]);return o},y=(o,e)=>_(o,I(e));const n=w(),L=(o,e)=>{const[t,d]=c();return m(e,()=>({toolInstance:t,annotationEngine:n.getState().annotation.annotationEngine,pageBackwardActions:()=>n.dispatch(P()),pageForwardActions:()=>n.dispatch(v()),pageJump:a=>{const i=~~a-1;n.dispatch(T(i))},hello:()=>alert("hello labelBee!!!")}),[t]),r.createElement(f,{store:n,context:j},r.createElement(u,{i18n:l},r.createElement(g,null,r.createElement(x,y(A({},o),{setToolInstance:a=>{var i;d(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var O=r.forwardRef(L);export{O as default,n as store};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as
|
|
1
|
+
import{create as o}from"zustand";const a=o(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as y,useContext as
|
|
1
|
+
import e,{useState as y,useContext as T,useEffect as j}from"react";import{EditFilled as ot}from"@ant-design/icons";import{ToolIcons as nt}from"../ToolIcons.js";import{EToolName as rt}from"../../../../data/enums/ToolType.js";import{cTool as lt}from"@labelbee/lb-annotation";import{PointCloudContext as D}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as h,Input as it,message as I}from"antd";import st from"../../../../utils/StepUtils.js";import{connect as at}from"react-redux";import{jsonParser as ct,classnames as ut}from"../../../../utils/index.js";import{useStatus as $}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as R}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as dt,useDispatch as mt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import gt from"./components/findTrackIDIndex/index.js";import{EPointCloudSegmentStatus as w,EPointCloudPattern as vt}from"@labelbee/lb-utils";import St from"../../../../components/attributeList/index.js";import{useAttribute as bt}from"../../../../components/pointCloudView/hooks/useAttribute.js";import Ct from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Pt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import Et from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import yt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as L}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as wt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";var Tt=Object.defineProperty,jt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,z=(o,t,n)=>t in o?Tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))ht.call(t,n)&&z(o,n,t[n]);if(U)for(var n of U(t))kt.call(t,n)&&z(o,n,t[n]);return o},V=(o,t)=>jt(o,Dt(t));const At=()=>{const[o,t]=y(!1),n=T(D),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:r}=R(),[u,d]=y(""),{t:g}=k(),p=c==null?void 0:c.info.trackID,s=m=>!!a.find(b=>b.trackID===m&&b.id!==(c==null?void 0:c.info.id)),i=(m=!1)=>{const f=parseInt(u,10);if(m&&t(!1),isNaN(f)){I.error(g("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){I.error(g("NotAllowDecimalPointsInTrackID"));return}if(s(f)){I.error(g("DuplicateTrackIDsExist"));return}if(!(f>0)){I.error(g("PositiveIntegerCheck"));return}S(f)};j(()=>{t(!1)},[p]);const S=m=>{var f;const b=r({trackID:m});(f=n==null?void 0:n.topViewInstance)==null||f.updatePolygonList(b!=null?b:[])};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,g("CurrentBoxTrackIDs")),p&&e.createElement(pt,{id:p,updateCurrentPolygonList:m=>S(m)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:m=>{d(m.target.value)},disabled:!p,size:"small",onBlur:()=>{i()},onPressEnter:()=>{i(!0)}}):e.createElement("span",null,p),e.createElement(ot,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{p&&t(!o)}})))},F=({segmentStatus:o,globalPattern:t})=>t===vt.Segmentation&&![w.Edit,w.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[d,g]=y({segmentStatus:w.Ready}),{selectedBox:p}=R(),s=T(D),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:m}=bt(),f=wt(),{isPointCloudSegmentationPattern:b}=$(),H=mt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};j(()=>{if(!!i)return i.on("syncPointCloudStatus",g),()=>{i.unbind("syncPointCloudStatus",g)}},[i]);const X=(l,C)=>{var _,P,x,B,N;const E=(_=a==null?void 0:a.attributeList)==null?void 0:_.map(v=>v.value===l?V(A({},v),{color:C}):v),O=V(A({},a),{attributeList:E}),tt=JSON.stringify(O),et=c==null?void 0:c.map(v=>(v==null?void 0:v.step)===(r==null?void 0:r.step)?V(A({},v),{config:tt}):v);(P=s==null?void 0:s.topViewInstance)==null||P.updateAttributeList(E),(x=s==null?void 0:s.sideViewInstance)==null||x.updateAttributeList(E),(B=s==null?void 0:s.backViewInstance)==null||B.updateAttributeList(E),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),H(It({stepList:et}))},Y=l=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(l)},q=l=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setDefaultAttribute(l)},G=(l,C)=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setSubAttribute(l,C)},K=o.map(l=>({label:l.key,value:l.value,color:l==null?void 0:l.color,limit:l==null?void 0:l.limit,isDefault:l==null?void 0:l.isDefault})),Q=p||d.cacheSegData&&d.segmentStatus===w.Edit,Z=b;return e.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},e.createElement("div",{style:J},S("Attribute")),e.createElement(St,{list:K,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:l=>q(l),updateColorConfig:X,enableColorPicker:u,updateSize:Y,forbidShowLimitPopover:Z}),e.createElement(h,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:G,getValue:l=>{var C,_,P,x;return((_=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:_[l.value])||((x=(P=d.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:x[l.value])}}))},Vt=[{toolName:"LassoSelector",commonSvg:Ct,selectedSvg:_t},{toolName:"RectSelector",commonSvg:Et,selectedSvg:yt},{toolName:"CircleSelector",commonSvg:Pt,selectedSvg:xt}],W=({toolInstance:o})=>{const{ptSegmentInstance:t}=T(D),[n,a]=y("LassoSelector"),{t:c}=k();return j(()=>{if(!t)return;const r=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},d=()=>{a("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",d),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",d)}},[t]),e.createElement("div",{className:`${L}__level`},Vt.map(r=>{const u=n===r.toolName;return e.createElement("span",{className:`${L}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${L}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ut({[`${L}__toolOption__selected`]:u})},c(r.toolName)))}))},Bt=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:r})=>{var u,d;const{updatePointCloudPattern:g,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=$(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],m=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(d=i==null?void 0:i.inputList)!=null?d:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:lt.EPointCloudName.PointCloud,selectedToolName:p,onChange:f=>g==null?void 0:g(f)}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r}),(i==null?void 0:i.trackConfigurable)===!0&&p===rt.Rect&&e.createElement("div",{style:{flexShrink:0,height:280,overflow:"auto"}},e.createElement(At,null),e.createElement(h,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(h,{style:{margin:0}}),e.createElement(gt,{imgList:n,imgIndex:a})))},Nt=o=>{var t,n,a,c;const r=st.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(n=o.annotation)==null?void 0:n.stepList),u=(a=o.annotation)==null?void 0:a.toolInstance,d=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:d}};var Ot=at(Nt,null,null,{context:dt})(Bt);export{W as PointCloudSegToolIcon,Ot as default};
|
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.40",
|
|
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.20",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.14",
|
|
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";var React=require("react"),antd=require("antd"),PointCloudContext=require("../../../../../../components/pointCloudView/PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),index_module=require("./index.module.scss.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const marks={.5:.5,1:1,2:2,3:3,4:4},RectRotateSensitivitySlider=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),t=i=>{e.setRectRotateSensitivity(i)};return React__default.default.createElement("div",{className:index_module.rectRotateSensitivitySlider},React__default.default.createElement("div",{className:index_module.title},lbUtils.i18n.t("RotationAngleSensitivity")),React__default.default.createElement("div",{className:"toolStyle"},React__default.default.createElement("div",{id:"style-rectRotateSensitivity"},React__default.default.createElement(antd.Slider,{min:.5,max:4,step:null,value:e.rectRotateSensitivity,onChange:t,marks}))))};module.exports=RectRotateSensitivitySlider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var styles={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};module.exports=styles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"react";import{Slider as l}from"antd";import{PointCloudContext as s}from"../../../../../../components/pointCloudView/PointCloudContext.js";import{i18n as a}from"@labelbee/lb-utils";import i from"./index.module.scss.js";const r={.5:.5,1:1,2:2,3:3,4:4},m=()=>{const e=t.useContext(s),o=n=>{e.setRectRotateSensitivity(n)};return t.createElement("div",{className:i.rectRotateSensitivitySlider},t.createElement("div",{className:i.title},a.t("RotationAngleSensitivity")),t.createElement("div",{className:"toolStyle"},t.createElement("div",{id:"style-rectRotateSensitivity"},t.createElement(l,{min:.5,max:4,step:null,value:e.rectRotateSensitivity,onChange:o,marks:r}))))};export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};export{t as default};
|