@labelbee/lb-components 1.23.0-alpha.41 → 1.23.0-alpha.43
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/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -1
- package/dist/index.css +31 -8
- package/dist/index.js +1 -1
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +2 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/store/annotatedBox/index.d.ts +2 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- 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/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -1
- package/es/index.css +31 -8
- package/es/index.js +1 -1
- package/es/store/annotatedBox/index.js +1 -1
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/package.json +3 -3
|
@@ -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 R=f=>{try{I(l.next(f))}catch(b){x(b)}},H=f=>{try{I(l.throw(f))}catch(b){x(b)}},I=f=>f.done?w(f.value):Promise.resolve(f.value).then(R,H);I((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,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{}}),PointCloudProvider=({children:o})=>{const[e,l]=React.useState([]),[w,x]=React.useState([]),[R,H]=React.useState([]),[I,f]=React.useState([]),[b,ut]=React.useState([]),[m,E]=React.useState([]),[A,j]=React.useState([]),[Z,ft]=React.useState(!0),[U,pt]=React.useState(2),[J,gt]=React.useState(!0),[K,vt]=React.useState(1),[p,Q]=React.useState(),[W,X]=React.useState(),[Y,$]=React.useState(),[d,tt]=React.useState(),[et,ht]=React.useState(""),[k,mt]=React.useState(lbAnnotation.EToolName.Rect),Pt=React.useRef(new lbAnnotation.ActionsHistory).current,[g,F]=React.useState([]),[nt,St]=React.useState(""),[q,It]=React.useState(lbUtils.EPointCloudPattern.Detection),[L,it]=React.useState(void 0),[z,bt]=React.useState([]),[M,yt]=React.useState([]),v=index(),[ot,Ct]=React.useState({}),wt=ctx.useDispatch(),Lt=s=>{const{imgNode:r,path:i}=s;i&&r&&Ct(u=>__spreadProps(__spreadValues({},u),{[i]:{width:r.width,height:r.height}}))},st=React.useMemo(()=>m.length===1?m[0]:"",[m]),V=React.useCallback((s,r,i="extId")=>{const u=i||"id",c=new Set(r);return f(h=>{let y=!1;const C=h.filter(O=>{const G=O[u],N=c.has(G)?O.imageName!==s:!0;return N||(y=!0),N});return y?C:h}),!0},[]),rt=React.useCallback(s=>{const r=e.map(i=>i.id);return V(s,r,"extId")},[e,V]),lt=React.useCallback(s=>{if(!s)return!1;const r=e.filter(i=>Array.isArray(i.rects)).map(i=>{const{id:u,attribute:c,trackID:h}=i,y=i.rects.find(C=>C.imageName===s);if(y){const C=___default.default.pick(y,["width","height","x","y","imageName"]);return __spreadProps(__spreadValues({},C),{id:lbAnnotation.uuid(),attribute:c,order:h,extId:u,lineDash:[]})}return null}).filter(i=>i!==null);return r.length?(f(i=>{const u=new Set(i.filter(h=>s===h.imageName).map(h=>h.extId)),c=r.filter(h=>u.has(h.extId)===!1);return c.length?[...i,...c]:i}),!0):!1},[e]),B=React.useMemo(()=>{const s=e.find(t=>t.id===st),r=t=>{const n=e.concat(t);return l(n),n},i=t=>{const n=w.concat(t);return x(n),n},u=t=>{ft(t!==!1)},c=t=>{t===void 0&&E([]),typeof t=="string"&&E([t]),Array.isArray(t)&&E(Array.from(new Set(t)))},h=t=>{m.includes(t)?c(m.filter(n=>n!==t)):c([...m,t])},y=t=>{const n=pickRectObject(t);f(a=>[...a,n])},C=(t,n=!1)=>{const a=pickRectObject(t);f(S=>S.map(P=>P.id===t.id?n?__spreadValues(__spreadValues({},P),a):a:P))},O=t=>{f(n=>n.filter(a=>!t.find(S=>S.id===a.id)))},G=t=>{A.includes(t)?j([]):j([t])},N=()=>{if(k===lbAnnotation.EToolName.Rect){const t=e.map(n=>n.id);c(t),p==null||p.pointCloud2dOperation.setSelectedIDs(t)}},xt=t=>{c(e.filter(n=>n.attribute===t).map(n=>n.id))},T=e.filter(t=>!g.includes(t.attribute)),at=w.filter(t=>!g.includes(t.attribute)),ct=b.filter(t=>t.attribute&&!g.includes(t.attribute)),Rt=t=>{if(g.includes(t))F(g.filter(n=>n!==t));else{const n=g.concat(t);F(n)}},_t=(()=>{const t=T.map(a=>a.id),n=new Set(t);return I.filter(a=>a.extId&&n.has(a.extId)).map(a=>a.imageName)})(),At=(t=T,n=R,a=at,S=ct,P=z)=>{var D;d==null||d.clearAllBox(),d==null||d.clearAllSphere(),p==null||p.updatePolygonList(t,n),p==null||p.updatePointList(a),p==null||p.updateLineList(S),d==null||d.generateBoxes(t),d==null||d.generateSpheres(a),(D=L==null?void 0:L.store)==null||D.updateCurrentSegment(P),dt(t)},Vt=()=>{Q(void 0),X(void 0),$(void 0),tt(void 0)},dt=(t,n)=>__async(void 0,null,function*(){var a;if(!d)return;const S=d.pointCloudObject;if(!!S)try{const P=yield d.getHighlightIndexByMappingImgList({mappingImgList:n!=null?n:M,points:S.geometry.attributes.position.array}),D=yield d==null?void 0:d.highlightOriginPointCloud(t,P);return D&&((a=p==null?void 0:p.pointCloudInstance)==null||a.updateColor(D)),D}catch(P){console.error(P)}});return{selectedID:st,pointCloudBoxList:e,pointCloudSphereList:w,displayPointCloudList:T,displaySphereList:at,displayLineList:ct,selectedIDs:m,setPointCloudResult:l,setSelectedIDs:c,addPointCloudBox:r,addPointCloudSphere:i,setPointCloudSphereList:x,valid:Z,selectedPointCloudBox:s,setPointCloudValid:u,addSelectedID:h,addHighlightID:G,selectedAllBoxes:N,topViewInstance:p,setTopViewInstance:Q,sideViewInstance:W,setSideViewInstance:X,backViewInstance:Y,setBackViewInstance:$,mainViewInstance:d,setMainViewInstance:tt,polygonList:R,setPolygonList:H,rectList:I,setRectList:f,addRectIn2DView:y,removeRectIn2DView:O,updateRectIn2DView:C,lineList:b,setLineList:ut,zoom:K,setZoom:vt,history:Pt,toggleAttributesVisible:Rt,hideAttributes:g,setHideAttributes:F,reRender:At,attrPanelLayout:nt,setAttrPanelLayout:St,syncAllViewPointCloudColor:dt,defaultAttribute:et,setDefaultAttribute:ht,pointCloudPattern:k,setPointCloudPattern:mt,selectSpecAttr:xt,globalPattern:q,setGlobalPattern:t=>{q!==t&&(wt(actionCreators.ChangeSave),It(t),t===lbUtils.EPointCloudPattern.Detection&&it(void 0))},ptSegmentInstance:L,setPtSegmentInstance:it,segmentation:z,setSegmentation:bt,clearAllDetectionInstance:Vt,highlight2DDataList:M,setHighlight2DDataList:yt,cuboidBoxIn2DView:J,setCuboidBoxIn2DView:gt,imageSizes:ot,cacheImageNodeSize:Lt,highlightIDs:A,setHighlightIDs:j,unlinkImageItems:_t,removeRectByPointCloudBoxId:rt,removeRectBySpecifyId:V,addRectFromPointCloudBoxByImageName:lt,rectRotateSensitivity:U,setRectRotateSensitivity:pt}},[Z,m,e,w,R,b,I,p,W,Y,d,K,g,nt,et,k,q,L,z,M,J,ot,A,rt,V,lt,U]);React.useEffect(()=>{var s,r,i;(s=v==null?void 0:v.setPointCloudBoxList)==null||s.call(v,e),(r=v==null?void 0:v.setHighlightIDs)==null||r.call(v,A),(i=v==null?void 0:v.setSelectedIDs)==null||i.call(v,m)},[e,m,A]),React.useEffect(()=>{var s;(s=v==null?void 0:v.setPtCtx)==null||s.call(v,B)},[B]);const Dt=()=>{const s=e.filter(c=>g.includes(c.attribute)),{setSelectedIDs:r,reRender:i}=B,u=s.map(c=>c.id);u.length>0&&r(m.filter(c=>!u.includes(c))),i()};return React.useEffect(()=>{var s,r,i,u;Dt(),(r=(s=p==null?void 0:p.toolInstance)==null?void 0:s.setHiddenAttributes)==null||r.call(s,g),(u=(i=L==null?void 0:L.store)==null?void 0:i.setHiddenAttributes)==null||u.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:m,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:g}=usePointCloudViews.usePointCloudViews(),{redo:S,undo:h,pushHistoryWithList:N,pushHistoryUnderUpdatePolygon:H,pushHistoryUnderUpdateLine:K}=useHistory.useHistory(),U=ctx.useDispatch(),{syncThreeViewsAttribute:x}=useAttribute.useAttribute(),{syncAllViewsConfig:R,reRenderTopViewRange:z}=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(t.rectRotateSensitivity);break}case"e":w(-Number(t.rectRotateSensitivity));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?S():h();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(()=>{R(r)},[B]),React.useEffect(()=>{(r==null?void 0:r.radius)&&z(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;x(e);const n=t.selectedPointCloudBox;if(n){n.attribute=e;const d=U(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[n],stepConfig:r,action:"viewUpdateBox"}));n.valid=d[0].valid;const p=m(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&&g({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),g({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}),m(i)}},a.current.clearResult=()=>{y==null||y()},a.current.redo=()=>{S()},a.current.undo=()=>{h()},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=>{x(n)},i=n=>{antd.message.error(n)},c=n=>{antd.message.info(n)};return o.on("syncAttribute",s),o.on("messageError",i),o.on("messageInfo",c),()=>{o.unbind("syncAttribute",s),o.unbind("messageError",i),o.unbind("messageInfo",c)}},[t.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var 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;
|
|
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 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),ahooks=require("ahooks"),PointCloudContext=require("../PointCloudContext.js"),icon_link=require("../../../assets/annotation/icon_link.svg.js"),icon_unlink=require("../../../assets/annotation/icon_unlink.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const iconSize={width:16,height:16},useDataLinkSwitch=e=>{e.imageName||console.warn("missing imageName");const[
|
|
1
|
+
"use strict";var React=require("react"),ahooks=require("ahooks"),PointCloudContext=require("../PointCloudContext.js"),icon_link=require("../../../assets/annotation/icon_link.svg.js"),icon_unlink=require("../../../assets/annotation/icon_unlink.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const iconSize={width:16,height:16},useDataLinkSwitch=e=>{e.imageName||console.warn("missing imageName");const[n,l]=React.useState(!0),r=React.useRef(e.imageName);r.current=e.imageName;const{unlinkImageItems:c,addRectFromPointCloudBoxByImageName:d,removeRectByPointCloudBoxId:m}=React.useContext(PointCloudContext.PointCloudContext),g=ahooks.useLatest(d),f=ahooks.useLatest(m),i=React.useCallback(t=>{const a=r.current;if(!a){console.warn("invalid image name");return}l(t),t?f.current(a):g.current(a)},[]),u=React.useCallback(()=>{i(!n)},[i,n]),h=React.useMemo(()=>{var t;if(!e.is2DView)return null;const o={zIndex:(t=e.zIndex)!=null?t:999,position:"absolute",top:16,right:16+28+12,background:"rgba(0, 0, 0, 0.74)",color:"white",borderRadius:2,padding:6,display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,cursor:"pointer"};return React__default.default.createElement("div",{style:o,onClick:u},n&&React__default.default.createElement("img",{src:icon_link,style:iconSize}),!n&&React__default.default.createElement("img",{src:icon_unlink,style:iconSize}))},[n,e.is2DView,e.zIndex,u]),s=React.useCallback(()=>{if(!e.is2DView)return;const t=r.current;if(!t){console.warn("invalid image name");return}const o=new Set(c).has(t)===!1;i(o)},[e.is2DView,c,i]);return React.useEffect(()=>{s()},[s]),{rendered:h,isLinking:n,swapSwitch:i,syncIsLinking:s}};module.exports=useDataLinkSwitch;
|
package/dist/index.css
CHANGED
|
@@ -49,13 +49,19 @@
|
|
|
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
|
+
}
|
|
52
58
|
.index-module_container__RwV5P {
|
|
53
59
|
padding: 12px 20px;
|
|
54
60
|
}
|
|
55
61
|
.index-module_container__RwV5P .index-module_content__vHpS9 {
|
|
56
62
|
display: flex;
|
|
57
63
|
justify-content: space-between;
|
|
58
|
-
margin-top:
|
|
64
|
+
margin-top: 16px;
|
|
59
65
|
}
|
|
60
66
|
.index-module_latexEditor__0fK8G {
|
|
61
67
|
line-height: 32px;
|
|
@@ -1511,6 +1517,7 @@
|
|
|
1511
1517
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1512
1518
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1513
1519
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1520
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1514
1521
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1515
1522
|
background: #f5f5f5;
|
|
1516
1523
|
}
|
|
@@ -1520,6 +1527,7 @@
|
|
|
1520
1527
|
.bee-sidebar #style-width .ant-slider .ant-slider-dot,
|
|
1521
1528
|
.bee-sidebar #style-color .ant-slider .ant-slider-dot,
|
|
1522
1529
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-dot,
|
|
1530
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-dot,
|
|
1523
1531
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-dot {
|
|
1524
1532
|
width: 0;
|
|
1525
1533
|
height: 0;
|
|
@@ -1531,6 +1539,7 @@
|
|
|
1531
1539
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle,
|
|
1532
1540
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle,
|
|
1533
1541
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle,
|
|
1542
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle,
|
|
1534
1543
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle {
|
|
1535
1544
|
background-image: url("../dist/assets/icons/cc550fff.svg");
|
|
1536
1545
|
background-repeat: no-repeat;
|
|
@@ -1548,6 +1557,7 @@
|
|
|
1548
1557
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle:focus,
|
|
1549
1558
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle:focus,
|
|
1550
1559
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle:focus,
|
|
1560
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle:focus,
|
|
1551
1561
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle:focus {
|
|
1552
1562
|
box-shadow: none;
|
|
1553
1563
|
}
|
|
@@ -1557,6 +1567,7 @@
|
|
|
1557
1567
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1558
1568
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1559
1569
|
.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,
|
|
1560
1571
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow {
|
|
1561
1572
|
color: inherit;
|
|
1562
1573
|
font-style: normal;
|
|
@@ -1580,6 +1591,7 @@
|
|
|
1580
1591
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1581
1592
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1582
1593
|
.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,
|
|
1583
1595
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header {
|
|
1584
1596
|
position: relative;
|
|
1585
1597
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -1606,6 +1618,9 @@
|
|
|
1606
1618
|
.bee-sidebar #style-fillOpacity .ant-slider-rail,
|
|
1607
1619
|
.bee-sidebar #style-fillOpacity .ant-slider-track,
|
|
1608
1620
|
.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,
|
|
1609
1624
|
.bee-sidebar #style-borderOpacity .ant-slider-rail,
|
|
1610
1625
|
.bee-sidebar #style-borderOpacity .ant-slider-track,
|
|
1611
1626
|
.bee-sidebar #style-borderOpacity .ant-slider-step {
|
|
@@ -1618,38 +1633,46 @@
|
|
|
1618
1633
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1619
1634
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1620
1635
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1636
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1621
1637
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1622
1638
|
background: none;
|
|
1623
1639
|
}
|
|
1624
1640
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot,
|
|
1625
|
-
.bee-sidebar #style-width .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 {
|
|
1626
1643
|
height: 12px;
|
|
1627
1644
|
background: #666666;
|
|
1628
1645
|
border-radius: 0;
|
|
1629
1646
|
margin-left: -2px;
|
|
1630
1647
|
}
|
|
1631
1648
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1633
1651
|
width: 1px;
|
|
1634
1652
|
}
|
|
1635
1653
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1637
1656
|
width: 2px;
|
|
1638
1657
|
}
|
|
1639
1658
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1641
1661
|
width: 3px;
|
|
1642
1662
|
}
|
|
1643
1663
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1645
1666
|
width: 4px;
|
|
1646
1667
|
}
|
|
1647
1668
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1649
1671
|
width: 5px;
|
|
1650
1672
|
}
|
|
1651
1673
|
.bee-sidebar #style-radius .ant-slider:hover .ant-slider-rail,
|
|
1652
|
-
.bee-sidebar #style-width .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 {
|
|
1653
1676
|
background: #f5f5f5;
|
|
1654
1677
|
}
|
|
1655
1678
|
.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/rectRotateSensitivitySlider/index.js"),index$a=require("./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js"),index$b=require("./components/audioPlayer/index.js"),index$c=require("./utils/index.js"),index$d=require("./components/subAttributeList/index.js"),index$e=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.RectRotateSensitivitySlider=index$9,exports.FindTrackIDIndex=index$a.FindTrackIDIndexInCheckMode,exports.AudioPlayer=index$b.WrapAudioPlayer,exports.generatePointCloudBoxRects=index$c.generatePointCloudBoxRects,exports.SubAttributeList=index$d,Object.defineProperty(exports,"EDataFormatType",{enumerable:!0,get:function(){return index$e.EDataFormatType}}),Object.defineProperty(exports,"ELLMDataType",{enumerable:!0,get:function(){return index$e.ELLMDataType}}),Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$e.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$e.ESubmitType}}),exports.componentCls=index$e.componentCls,exports.prefix=index$e.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})),setPtCtx:t=>e(s=>({ptCtx:t}))}));module.exports=useAnnotatedBoxStore;
|
|
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})),rectRotateSensitivity:2,setRectRotateSensitivity:t=>e(s=>({rectRotateSensitivity:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));module.exports=useAnnotatedBoxStore;
|
|
@@ -89,6 +89,8 @@ 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;
|
|
92
94
|
}
|
|
93
95
|
export declare const PointCloudContext: React.Context<IPointCloudContext>;
|
|
94
96
|
export declare const PointCloudProvider: React.FC<{}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ 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';
|
|
15
16
|
import { FindTrackIDIndexInCheckMode as FindTrackIDIndex } from './views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex';
|
|
16
17
|
import { WrapAudioPlayer as AudioPlayer } from './components/audioPlayer';
|
|
17
18
|
import { generatePointCloudBoxRects } from './utils';
|
|
@@ -21,6 +22,6 @@ export declare const store: import("redux").Store<{}, import("redux").Action<any
|
|
|
21
22
|
};
|
|
22
23
|
declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
|
|
23
24
|
export default _default;
|
|
24
|
-
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas, AnnotatedBox, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, };
|
|
25
|
+
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas, AnnotatedBox, RectRotateSensitivitySlider, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, };
|
|
25
26
|
export * from './constant';
|
|
26
27
|
export * from './typeTem';
|
|
@@ -8,6 +8,8 @@ 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;
|
|
11
13
|
setPtCtx: (ptCtx: IPointCloudContext) => void;
|
|
12
14
|
}
|
|
13
15
|
declare const useAnnotatedBoxStore: import("zustand").UseBoundStore<import("zustand").StoreApi<Store>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),index=require("./index.js"),ToolType=require("../data/enums/ToolType.js"),_=require("lodash"),StepUtils=require("./StepUtils.js"),antd=require("antd"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}var ___default=_interopDefaultLegacy(_);class AnnotationDataUtils{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((n,r)=>{this.traverseDF(n,s,r,t)}):Object.keys(t).forEach(n=>{this.traverseDF(t[n],s,n,t)}))}static getNextPath(t){var s,e,i;const{prePath:n,preMappingImgList:r,nextMappingImgList:a}=t,o=(e=(s=r==null?void 0:r.find(u=>u.path===n))==null?void 0:s.calib)==null?void 0:e.calName;return(i=a.find(u=>{var f;return((f=u.calib)==null?void 0:f.calName)===o}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:n,preMappingImgList:r}=t,a=e===void 0?void 0:i[e];return e==="id"&&(i.id=lbAnnotation.uuid(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:n})),{value:e===void 0?void 0:i[e],oldValue:a}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:n,preMappingImgList:r}=t;try{const a=index.jsonParser(s),o=index.jsonParser(i),d=`step_${e}`;if(a[d]){const u=a[d],f=["result","resultRect"],p=new Map,I=(l,c)=>{if(l===void 0||c===void 0){console.warn("invalid id");return}p.set(c,l)};if(f.forEach(l=>{u[l]&&this.traverseDF(u[l],(c,m,h)=>{const{value:R,oldValue:D}=this.copyResultItemHandler({item:c,key:m,parent:h,mappingImgList:n,preMappingImgList:r});l==="result"&&m==="id"&&R!==void 0&&D!==void 0&&p.set(D,R)})}),p.size){const l=u.resultRect;Array.isArray(l)&&l.forEach(c=>{const m=c.extId,h=p.get(m);m!==void 0&&h!==void 0&&(c.extId=h)})}const y=["resultRect","rects"],g=[];return this.traverseDF(u,(l,c,m)=>{___default.default.isString(c)&&y.includes(c)&&Array.isArray(l)&&(m[c]=l.filter(h=>h.imageName?!0:(g.push(h),!1)))}),g.length&&(console.
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),index=require("./index.js"),ToolType=require("../data/enums/ToolType.js"),_=require("lodash"),StepUtils=require("./StepUtils.js"),antd=require("antd"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}var ___default=_interopDefaultLegacy(_);class AnnotationDataUtils{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((n,r)=>{this.traverseDF(n,s,r,t)}):Object.keys(t).forEach(n=>{this.traverseDF(t[n],s,n,t)}))}static getNextPath(t){var s,e,i;const{prePath:n,preMappingImgList:r,nextMappingImgList:a}=t,o=(e=(s=r==null?void 0:r.find(u=>u.path===n))==null?void 0:s.calib)==null?void 0:e.calName;return(i=a.find(u=>{var f;return((f=u.calib)==null?void 0:f.calName)===o}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:n,preMappingImgList:r}=t,a=e===void 0?void 0:i[e];return e==="id"&&(i.id=lbAnnotation.uuid(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:n})),{value:e===void 0?void 0:i[e],oldValue:a}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:n,preMappingImgList:r}=t;try{const a=index.jsonParser(s),o=index.jsonParser(i),d=`step_${e}`;if(a[d]){const u=a[d],f=["result","resultRect"],p=new Map,I=(l,c)=>{if(l===void 0||c===void 0){console.warn("invalid id");return}p.set(c,l)};if(f.forEach(l=>{u[l]&&this.traverseDF(u[l],(c,m,h)=>{const{value:R,oldValue:D}=this.copyResultItemHandler({item:c,key:m,parent:h,mappingImgList:n,preMappingImgList:r});l==="result"&&m==="id"&&R!==void 0&&D!==void 0&&p.set(D,R)})}),p.size){const l=u.resultRect;Array.isArray(l)&&l.forEach(c=>{const m=c.extId,h=p.get(m);m!==void 0&&h!==void 0&&(c.extId=h)})}const y=["resultRect","rects"],g=[];return this.traverseDF(u,(l,c,m)=>{___default.default.isString(c)&&y.includes(c)&&Array.isArray(l)&&(m[c]=l.filter(h=>h.imageName?!0:(g.push(h),!1)))}),g.length&&(console.log(g),antd.message.info(lbUtils.i18n.t("PartialResultsReplicationFailure"))),o[d]=u,JSON.stringify(o)}return s}catch(a){antd.message.info(lbUtils.i18n.t("FailedToCopyResults"))}}static isResultSourceMatchedDependence(t,s){const e=t==null?void 0:t.map(n=>n.sourceID).sort(),i=s==null?void 0:s.map(n=>n.id).sort();return ___default.default.isEqual(e,i)}static deltaUpdateBasicResultList(t,s){const e=t==null?void 0:t.map(i=>i.sourceID).sort();return s.filter(i=>!e.includes(i.id))}static getInitialResultList(t,s,e,i,n){const r=t!=null?t:[];switch(e.tool){case ToolType.EToolName.Tag:case ToolType.EToolName.Text:{if(e.dataSourceStep>0){const a=this.deltaUpdateBasicResultList(r,i);if(a.length>0)return r.concat(s.getInitResultList(e.dataSourceStep,a))}return n!==!0?r:s.getInitResultList(e.dataSourceStep,i)}default:return r}}static dataCorrection(t,s,e,i){var n,r;try{const o=`step_${StepUtils.getStepInfo(e,i).step}`,d=index.jsonParser(t),u=index.jsonParser(s),f=(n=d[o])==null?void 0:n.result,p=(r=u[o])==null?void 0:r.result;if(!p||___default.default.isEqual(f.sort(this.idCmp),p.sort(this.idCmp)))return t;const I=this.findDeletedIds(f,p);if(I.length===0)return t;const y=e,g=this.getStepKeys(d).sort();return this.deleteRes(d,y,I,g),JSON.stringify(d)}catch(a){return console.error(a),t}}static idCmp(t,s){const e=t.id,i=s.id;return e<i?-1:e>i?1:0}static findDeletedIds(t,s){return this.findDeletedItems(s,t).map(e=>e.id)}static findDeletedItems(t,s){const e=[];return t.forEach(i=>{s.some(r=>r.id===i.id)||e.push(i)}),e}static getStepKeys(t){return Object.keys(t).map(s=>parseInt(s.replace("step_",""),10)).filter(s=>!isNaN(s))}static deleteRes(t,s,e,i){i.forEach(n=>{if(n>s){const r=t[`step_${n}`];if([ToolType.EToolName.FolderTag,ToolType.EToolName.Segmentation].includes(r.tool))return;if(r.dataSourceStep===s){const a=[];r.result=r.result.filter(o=>e.includes(o.sourceID)?(a.push(o.id),!1):!0),this.deleteRes(t,n,a,i)}else r.result=r.result.filter(a=>!e.includes(a.sourceID))}})}}module.exports=AnnotationDataUtils;
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var styles={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};module.exports=styles;
|
|
@@ -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$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
|
+
"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 +1 @@
|
|
|
1
|
-
import{EPointCloudPattern as J}from"@labelbee/lb-utils";import
|
|
1
|
+
import{EPointCloudPattern as J}from"@labelbee/lb-utils";import ht,{useState as o,useRef as Jt,useMemo as vt,useCallback as K,useEffect as Q}from"react";import{ActionsHistory as It,EToolName as U,uuid as Kt}from"@labelbee/lb-annotation";import{useDispatch as Qt}from"../../store/ctx.js";import{ChangeSave as Ut}from"../../store/annotation/actionCreators.js";import Wt from"../../store/annotatedBox/index.js";import Pt from"lodash";var Xt=Object.defineProperty,Yt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,bt=(l,e,a)=>e in l?Xt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,N=(l,e)=>{for(var a in e||(e={}))te.call(e,a)&&bt(l,a,e[a]);if(yt)for(var a of yt(e))ee.call(e,a)&&bt(l,a,e[a]);return l},St=(l,e)=>Yt(l,$t(e)),ne=(l,e,a)=>new Promise((L,R)=>{var A=f=>{try{b(a.next(f))}catch(S){R(S)}},j=f=>{try{b(a.throw(f))}catch(S){R(S)}},b=f=>f.done?L(f.value):Promise.resolve(f.value).then(A,j);b((a=a.apply(l,e)).next())});const Ct=l=>Pt.pick(l,["id","attribute","width","height","x","y","imageName"]),wt=ht.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,rectRotateSensitivity:2,setRectRotateSensitivity:()=>{}}),ie=({children:l})=>{const[e,a]=o([]),[L,R]=o([]),[A,j]=o([]),[b,f]=o([]),[S,Lt]=o([]),[I,F]=o([]),[_,k]=o([]),[W,Dt]=o(!0),[X,xt]=o(2),[Y,Rt]=o(!0),[$,At]=o(1),[m,tt]=o(),[et,nt]=o(),[it,ot]=o(),[u,st]=o(),[rt,_t]=o(""),[z,Vt]=o(U.Rect),Bt=Jt(new It).current,[g,E]=o([]),[lt,Ot]=o(""),[G,Ht]=o(J.Detection),[D,at]=o(void 0),[M,Nt]=o([]),[T,jt]=o([]),h=Wt(),[ct,Ft]=o({}),kt=Qt(),zt=s=>{const{imgNode:r,path:i}=s;i&&r&&Ft(p=>St(N({},p),{[i]:{width:r.width,height:r.height}}))},dt=vt(()=>I.length===1?I[0]:"",[I]),V=K((s,r,i="extId")=>{const p=i||"id",d=new Set(r);return f(v=>{let C=!1;const w=v.filter(O=>{const Z=O[p],H=d.has(Z)?O.imageName!==s:!0;return H||(C=!0),H});return C?w:v}),!0},[]),ut=K(s=>{const r=e.map(i=>i.id);return V(s,r,"extId")},[e,V]),pt=K(s=>{if(!s)return!1;const r=e.filter(i=>Array.isArray(i.rects)).map(i=>{const{id:p,attribute:d,trackID:v}=i,C=i.rects.find(w=>w.imageName===s);if(C){const w=Pt.pick(C,["width","height","x","y","imageName"]);return St(N({},w),{id:Kt(),attribute:d,order:v,extId:p,lineDash:[]})}return null}).filter(i=>i!==null);return r.length?(f(i=>{const p=new Set(i.filter(v=>s===v.imageName).map(v=>v.extId)),d=r.filter(v=>p.has(v.extId)===!1);return d.length?[...i,...d]:i}),!0):!1},[e]),B=vt(()=>{const s=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 R(n),n},p=t=>{Dt(t!==!1)},d=t=>{t===void 0&&F([]),typeof t=="string"&&F([t]),Array.isArray(t)&&F(Array.from(new Set(t)))},v=t=>{I.includes(t)?d(I.filter(n=>n!==t)):d([...I,t])},C=t=>{const n=Ct(t);f(c=>[...c,n])},w=(t,n=!1)=>{const c=Ct(t);f(y=>y.map(P=>P.id===t.id?n?N(N({},P),c):c:P))},O=t=>{f(n=>n.filter(c=>!t.find(y=>y.id===c.id)))},Z=t=>{_.includes(t)?k([]):k([t])},H=()=>{if(z===U.Rect){const t=e.map(n=>n.id);d(t),m==null||m.pointCloud2dOperation.setSelectedIDs(t)}},Gt=t=>{d(e.filter(n=>n.attribute===t).map(n=>n.id))},q=e.filter(t=>!g.includes(t.attribute)),ft=L.filter(t=>!g.includes(t.attribute)),mt=S.filter(t=>t.attribute&&!g.includes(t.attribute)),Mt=t=>{if(g.includes(t))E(g.filter(n=>n!==t));else{const n=g.concat(t);E(n)}},Tt=(()=>{const t=q.map(c=>c.id),n=new Set(t);return b.filter(c=>c.extId&&n.has(c.extId)).map(c=>c.imageName)})(),Zt=(t=q,n=A,c=ft,y=mt,P=M)=>{var x;u==null||u.clearAllBox(),u==null||u.clearAllSphere(),m==null||m.updatePolygonList(t,n),m==null||m.updatePointList(c),m==null||m.updateLineList(y),u==null||u.generateBoxes(t),u==null||u.generateSpheres(c),(x=D==null?void 0:D.store)==null||x.updateCurrentSegment(P),gt(t)},qt=()=>{tt(void 0),nt(void 0),ot(void 0),st(void 0)},gt=(t,n)=>ne(void 0,null,function*(){var c;if(!u)return;const y=u.pointCloudObject;if(!!y)try{const P=yield u.getHighlightIndexByMappingImgList({mappingImgList:n!=null?n:T,points:y.geometry.attributes.position.array}),x=yield u==null?void 0:u.highlightOriginPointCloud(t,P);return x&&((c=m==null?void 0:m.pointCloudInstance)==null||c.updateColor(x)),x}catch(P){console.error(P)}});return{selectedID:dt,pointCloudBoxList:e,pointCloudSphereList:L,displayPointCloudList:q,displaySphereList:ft,displayLineList:mt,selectedIDs:I,setPointCloudResult:a,setSelectedIDs:d,addPointCloudBox:r,addPointCloudSphere:i,setPointCloudSphereList:R,valid:W,selectedPointCloudBox:s,setPointCloudValid:p,addSelectedID:v,addHighlightID:Z,selectedAllBoxes:H,topViewInstance:m,setTopViewInstance:tt,sideViewInstance:et,setSideViewInstance:nt,backViewInstance:it,setBackViewInstance:ot,mainViewInstance:u,setMainViewInstance:st,polygonList:A,setPolygonList:j,rectList:b,setRectList:f,addRectIn2DView:C,removeRectIn2DView:O,updateRectIn2DView:w,lineList:S,setLineList:Lt,zoom:$,setZoom:At,history:Bt,toggleAttributesVisible:Mt,hideAttributes:g,setHideAttributes:E,reRender:Zt,attrPanelLayout:lt,setAttrPanelLayout:Ot,syncAllViewPointCloudColor:gt,defaultAttribute:rt,setDefaultAttribute:_t,pointCloudPattern:z,setPointCloudPattern:Vt,selectSpecAttr:Gt,globalPattern:G,setGlobalPattern:t=>{G!==t&&(kt(Ut),Ht(t),t===J.Detection&&at(void 0))},ptSegmentInstance:D,setPtSegmentInstance:at,segmentation:M,setSegmentation:Nt,clearAllDetectionInstance:qt,highlight2DDataList:T,setHighlight2DDataList:jt,cuboidBoxIn2DView:Y,setCuboidBoxIn2DView:Rt,imageSizes:ct,cacheImageNodeSize:zt,highlightIDs:_,setHighlightIDs:k,unlinkImageItems:Tt,removeRectByPointCloudBoxId:ut,removeRectBySpecifyId:V,addRectFromPointCloudBoxByImageName:pt,rectRotateSensitivity:X,setRectRotateSensitivity:xt}},[W,I,e,L,A,S,b,m,et,it,u,$,g,lt,rt,z,G,D,M,T,Y,ct,_,ut,V,pt,X]);Q(()=>{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,_),(i=h==null?void 0:h.setSelectedIDs)==null||i.call(h,I)},[e,I,_]),Q(()=>{var s;(s=h==null?void 0:h.setPtCtx)==null||s.call(h,B)},[B]);const Et=()=>{const s=e.filter(d=>g.includes(d.attribute)),{setSelectedIDs:r,reRender:i}=B,p=s.map(d=>d.id);p.length>0&&r(I.filter(d=>!p.includes(d))),i()};return Q(()=>{var s,r,i,p;Et(),(r=(s=m==null?void 0:m.toolInstance)==null?void 0:s.setHiddenAttributes)==null||r.call(s,g),(p=(i=D==null?void 0:D.store)==null?void 0:i.setHiddenAttributes)==null||p.call(i,g)},[g]),ht.createElement(wt.Provider,{value:B},l)};export{wt as PointCloudContext,ie 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 g}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 ye}from"./hooks/useAttribute.js";import{useConfig as fe}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 Se}from"../../store/annotation/actionCreators.js";var ge=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?ge(l,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[r]=u,y=(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},f=(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:R,copiedBoxes:q}=oe({config:r}),{updateRotate:h}=te({currentData:l}),{updatePointCloudData:v,topViewSelectedChanged:_}=me(),{redo:V,undo:L,pushHistoryWithList:G,pushHistoryUnderUpdatePolygon:M,pushHistoryUnderUpdateLine:W}=Pe(),Y=be(),{syncThreeViewsAttribute:B}=ye(),{syncAllViewsConfig:$,reRenderTopViewRange:J}=fe(),{selectedPolygon:O}=we(),{selectedLine:j}=Ce(),{t:S}=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(t.rectRotateSensitivity);break}case"e":h(-Number(t.rectRotateSensitivity));break;case"g":h(180);break;case"u":{const m=p.pattern===Le.Normal?P.Rect:P.Polygon;z(m);const Z={[P.Polygon]:S("PolygonPattern"),[P.Rect]:S("RectPattern")};g.success(S("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":R();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,q,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(Se({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&&M(f(y({},O),{attribute:e})),j&&W(f(y({},j),{attribute:e})),w){const p=U(f(y({},w),{attribute:e}));t.mainViewInstance&&((d=t.mainViewInstance)==null||d.generateSpheres(p),_({newSelectedSphere:w,newSphereList:p}))}},i.current.setSubAttribute=(e,o)=>{var n;const a=t.selectedPointCloudBox;if(a){const d=(n=a==null?void 0:a.subAttribute)!=null?n:{};a.subAttribute=f(y({},d),{[e]:o}),k(a)}},i.current.clearResult=()=>{C==null||C()},i.current.redo=()=>{V()},i.current.undo=()=>{L()},i.current.setValid=e=>{i.current.valid=e,setTimeout(()=>{t.setPointCloudValid(e),e===!1&&C()})},i.current.setForbidOperation=e=>{var o,n;(n=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||n.setForbidOperation(e),e===!0&&t.setSelectedIDs(void 0)},i.current.setShowDefaultCursor=e=>{var o,n;(n=(o=t.topViewInstance)==null?void 0:o.pointCloud2dOperation)==null||n.setShowDefaultCursor(e)},i.current.asyncData=e=>{setTimeout(()=>{v==null||v(e)})}},[t.pointCloudBoxList,t.pointCloudSphereList,t.selectedID,t.valid,t.polygonList,t.lineList,t.mainViewInstance,t.ptSegmentInstance]),c(()=>{i.current.updateSegmentTool=e=>{var o;(o=t.ptSegmentInstance)==null||o.emit(e)},i.current.segmentInstance=t.ptSegmentInstance},[t.ptSegmentInstance]),c(()=>{i.current.history={pushHistory:e=>{G({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=>{g.error(s)},d=s=>{g.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 Se}from"./hooks/usePointCloudViews.js";import _e 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 Ne=Object.defineProperty,De=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,$=(n,s,r)=>s in n?Ne(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r,D=(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},B=(n,s)=>De(n,Be(s));const{EPolygonPattern:Ze,EToolName:G}=fe,{ESortDirection:J}=ve,ze=ue.default,Q=(n,s,r=1)=>{const{width:v,height:u}=s,g={x:n.x+v*r/2,y:n.y+u*r/2},y={x:s.width/2,y:s.height/2};return{offsetX:(y.x-g.x)/r,offsetY:-(y.y-g.y)/r}},He=({currentData:n})=>{var s,r;const{zoom:v,zoomIn:u,zoomOut:g,initialPosition:y}=q(),{selectNextBox:_,selectPrevBox:E}=K(),{switchToNextSphere:V}=Y(),{updateRotate:I}=Pe({currentData:n}),w=i.useContext(F),{topViewInstance:L}=w,S=(r=(s=w==null?void 0:w.topViewInstance)==null?void 0:s.toolScheduler)==null?void 0:r.getCurrentToolName(),C=()=>{I(-Number(w.rectRotateSensitivity))},e=()=>{I(w.rectRotateSensitivity)},c=()=>{I(180)};return i.createElement(i.Fragment,null,i.createElement(Te,{onChange:m=>{var O;(O=L==null?void 0:L.pointCloudInstance)==null||O.updatePointSize({customSize:m})}}),i.createElement("span",{onClick:e,className:x("point-cloud","rotate-reserve")}),i.createElement("span",{onClick:C,className:x("point-cloud","rotate")}),i.createElement("span",{onClick:c,className:x("point-cloud","rotate-180")}),i.createElement(z,null),i.createElement(de,{onClick:()=>{if(S===G.Point){V(J.descend);return}E(!0)},className:x("point-cloud","prev")}),i.createElement(pe,{onClick:()=>{if(S===G.Point){V(J.ascend);return}_(!0)},className:x("point-cloud","next")}),i.createElement(z,null),i.createElement(ae,{initialPosition:y,zoomIn:u,zoomOut:g,zoom:v}))},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:v=>{n(v)}})),Fe=({currentData:n,imgList:s,stepInfo:r,drawLayerSlot:v,checkMode:u,intelligentFit:g,setIsEnlargeTopView:y,isEnlargeTopView:_,onExitZoom:E,highlightAttribute:V})=>{var I,w;const[L,S]=W({zoom:1,currentPos:{x:0,y:0}}),C=we(null),e=i.useContext(F),c=_e(C),m=Oe(r.config),{setZoom:O,syncTopviewToolZoom:R}=q(),{hideAttributes:ee}=e,{addPolygon:te,deletePolygon:oe}=Ie(),{deletePointCloudSphere:ne}=Y(),{deletePointCloudBox:ie,changeValidByID:le}=K(),[b,se]=W(10),{t:U}=Ee(),P=Se(),{pushHistoryWithList:re}=ke();Ce(()=>{if(!e.topViewInstance&&C.current&&(n==null?void 0:n.url)&&(n==null?void 0:n.result)){const o={width:C.current.clientWidth,height:C.current.clientHeight},a=new me({container:C.current,size:o,pcdPath:n.url,config:B(D({},m),{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=>B(D({},d),{pointList:H.pointListTransferCanvas2World(d.pointList,c)}));e.setSelectedIDs(l),e.setLineList(p),re({lineList:p})}),o.singleOn("pointCreated",(t,l)=>{P.topViewAddSphere({newPoint:t,size:c,trackConfigurable:m.trackConfigurable,zoom:l})}),o.singleOn("pointDeleted",t=>{ne(t)}),o.singleOn("pointSelected",t=>{e.setSelectedIDs([t])}),o.singleOn("updatePointByDrag",(t,l)=>{var p;(p=P.topViewUpdatePoint)==null||p.call(P,t,c)}),o.singleOn("polygonCreated",(t,l)=>{if(o.pattern===Ze.Normal||!(n==null?void 0:n.url)){const p=B(D({},t),{pointList:t.pointList.map(d=>H.transferCanvas2World(d,c))});te(p),e.setSelectedIDs(ee.includes(t.attribute)?"":t.id);return}P.topViewAddBox({polygon:t,size:c,imgList:s,trackConfigurable:m.trackConfigurable,zoom:l,intelligentFit:g})}),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=P.topViewUpdateBox)==null||l.call(P,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,P,e.polygonList,e.lineList,(I=e.topViewInstance)==null?void 0:I.toolInstance]),h(()=>{var o,a;if(!(c==null?void 0:c.width)||!e.topViewInstance)return;const t=(a=(o=m==null?void 0:m.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,f)=>{const{offsetX:j,offsetY:T}=Q(f,c,d);if(l.camera.zoom=d,f){const{x:k,y:A,z:N}=l.initCameraPosition;l.camera.position.set(k+T,A-j,N)}l.camera.updateProjectionMatrix(),l.render(),O(d),R(f,d,c),S({zoom:d,currentPos:f})}),p.singleOn("dragMove",({currentPos:d,zoom:f})=>{const{offsetX:j,offsetY:T}=Q(d,c,f);l.camera.zoom=f;const{x:k,y:A,z:N}=l.initCameraPosition;l.camera.position.set(k+T,A-j,N),l.render(),R(d,f,c),S({zoom:f,currentPos:d})})},[c,e.topViewInstance,(w=e.topViewInstance)==null?void 0:w.toolInstance]),h(()=>{var o,a;(a=(o=e.topViewInstance)==null?void 0:o.pointCloudInstance)==null||a.applyZAxisPoints(b)},[b]),h(()=>{var o,a,t,l;P.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&&E()};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:_?i.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},i.createElement(ce,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{E()}}),i.createElement("span",null,U("TopView")),i.createElement(X,{checkMode:u,config:m,style:{display:"flex",position:"initial",margin:"0px 20px"}})):i.createElement(Ae,{title:U("TopView"),onClick:()=>{y(!0)}}),toolbar:i.createElement(He,{currentData:n})},i.createElement("div",{style:{position:"relative",flex:1}},i.createElement("div",{style:{width:"100%",height:"100%"},ref:C},v==null?void 0:v(L)),!_&&i.createElement(X,{checkMode:u,config:m}),i.createElement(We,{checkMode:u,zAxisLimit:b,setZAxisLimit:se}),i.createElement(ye,null)))};var Ke=Ve(he,null,null,{context:Le})(Fe);export{Ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c,{useState as C,useRef as v,useContext as y,useCallback as m,useMemo as N,useEffect as R}from"react";import{useLatest as d}from"ahooks";import{PointCloudContext as
|
|
1
|
+
import c,{useState as C,useRef as v,useContext as y,useCallback as m,useMemo as N,useEffect as R}from"react";import{useLatest as d}from"ahooks";import{PointCloudContext as S}from"../PointCloudContext.js";import b from"../../../assets/annotation/icon_link.svg.js";import z from"../../../assets/annotation/icon_unlink.svg.js";const g={width:16,height:16},D=e=>{e.imageName||console.warn("missing imageName");const[n,f]=C(!0),s=v(e.imageName);s.current=e.imageName;const{unlinkImageItems:l,addRectFromPointCloudBoxByImageName:w,removeRectByPointCloudBoxId:h}=y(S),I=d(w),k=d(h),i=m(t=>{const o=s.current;if(!o){console.warn("invalid image name");return}f(t),t?k.current(o):I.current(o)},[]),u=m(()=>{i(!n)},[i,n]),x=N(()=>{var t;if(!e.is2DView)return null;const r={zIndex:(t=e.zIndex)!=null?t:999,position:"absolute",top:16,right:16+28+12,background:"rgba(0, 0, 0, 0.74)",color:"white",borderRadius:2,padding:6,display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,cursor:"pointer"};return c.createElement("div",{style:r,onClick:u},n&&c.createElement("img",{src:b,style:g}),!n&&c.createElement("img",{src:z,style:g}))},[n,e.is2DView,e.zIndex,u]),a=m(()=>{if(!e.is2DView)return;const t=s.current;if(!t){console.warn("invalid image name");return}const r=new Set(l).has(t)===!1;i(r)},[e.is2DView,l,i]);return R(()=>{a()},[a]),{rendered:x,isLinking:n,swapSwitch:i,syncIsLinking:a}};export{D as default};
|
package/es/index.css
CHANGED
|
@@ -49,13 +49,19 @@
|
|
|
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
|
+
}
|
|
52
58
|
.index-module_container__RwV5P {
|
|
53
59
|
padding: 12px 20px;
|
|
54
60
|
}
|
|
55
61
|
.index-module_container__RwV5P .index-module_content__vHpS9 {
|
|
56
62
|
display: flex;
|
|
57
63
|
justify-content: space-between;
|
|
58
|
-
margin-top:
|
|
64
|
+
margin-top: 16px;
|
|
59
65
|
}
|
|
60
66
|
.index-module_latexEditor__0fK8G {
|
|
61
67
|
line-height: 32px;
|
|
@@ -1511,6 +1517,7 @@
|
|
|
1511
1517
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1512
1518
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1513
1519
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1520
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1514
1521
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1515
1522
|
background: #f5f5f5;
|
|
1516
1523
|
}
|
|
@@ -1520,6 +1527,7 @@
|
|
|
1520
1527
|
.bee-sidebar #style-width .ant-slider .ant-slider-dot,
|
|
1521
1528
|
.bee-sidebar #style-color .ant-slider .ant-slider-dot,
|
|
1522
1529
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-dot,
|
|
1530
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-dot,
|
|
1523
1531
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-dot {
|
|
1524
1532
|
width: 0;
|
|
1525
1533
|
height: 0;
|
|
@@ -1531,6 +1539,7 @@
|
|
|
1531
1539
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle,
|
|
1532
1540
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle,
|
|
1533
1541
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle,
|
|
1542
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle,
|
|
1534
1543
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle {
|
|
1535
1544
|
background-image: url("../dist/assets/icons/cc550fff.svg");
|
|
1536
1545
|
background-repeat: no-repeat;
|
|
@@ -1548,6 +1557,7 @@
|
|
|
1548
1557
|
.bee-sidebar #style-width .ant-slider .ant-slider-handle:focus,
|
|
1549
1558
|
.bee-sidebar #style-color .ant-slider .ant-slider-handle:focus,
|
|
1550
1559
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-handle:focus,
|
|
1560
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-handle:focus,
|
|
1551
1561
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-handle:focus {
|
|
1552
1562
|
box-shadow: none;
|
|
1553
1563
|
}
|
|
@@ -1557,6 +1567,7 @@
|
|
|
1557
1567
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1558
1568
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow,
|
|
1559
1569
|
.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,
|
|
1560
1571
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow {
|
|
1561
1572
|
color: inherit;
|
|
1562
1573
|
font-style: normal;
|
|
@@ -1580,6 +1591,7 @@
|
|
|
1580
1591
|
.bee-sidebar #style-width .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1581
1592
|
.bee-sidebar #style-color .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header,
|
|
1582
1593
|
.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,
|
|
1583
1595
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-collapse > .ant-collapse-item > .ant-collapse-header {
|
|
1584
1596
|
position: relative;
|
|
1585
1597
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -1606,6 +1618,9 @@
|
|
|
1606
1618
|
.bee-sidebar #style-fillOpacity .ant-slider-rail,
|
|
1607
1619
|
.bee-sidebar #style-fillOpacity .ant-slider-track,
|
|
1608
1620
|
.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,
|
|
1609
1624
|
.bee-sidebar #style-borderOpacity .ant-slider-rail,
|
|
1610
1625
|
.bee-sidebar #style-borderOpacity .ant-slider-track,
|
|
1611
1626
|
.bee-sidebar #style-borderOpacity .ant-slider-step {
|
|
@@ -1618,38 +1633,46 @@
|
|
|
1618
1633
|
.bee-sidebar #style-width .ant-slider .ant-slider-track,
|
|
1619
1634
|
.bee-sidebar #style-color .ant-slider .ant-slider-track,
|
|
1620
1635
|
.bee-sidebar #style-fillOpacity .ant-slider .ant-slider-track,
|
|
1636
|
+
.bee-sidebar #style-rectRotateSensitivity .ant-slider .ant-slider-track,
|
|
1621
1637
|
.bee-sidebar #style-borderOpacity .ant-slider .ant-slider-track {
|
|
1622
1638
|
background: none;
|
|
1623
1639
|
}
|
|
1624
1640
|
.bee-sidebar #style-radius .ant-slider-step .ant-slider-dot,
|
|
1625
|
-
.bee-sidebar #style-width .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 {
|
|
1626
1643
|
height: 12px;
|
|
1627
1644
|
background: #666666;
|
|
1628
1645
|
border-radius: 0;
|
|
1629
1646
|
margin-left: -2px;
|
|
1630
1647
|
}
|
|
1631
1648
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1633
1651
|
width: 1px;
|
|
1634
1652
|
}
|
|
1635
1653
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1637
1656
|
width: 2px;
|
|
1638
1657
|
}
|
|
1639
1658
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1641
1661
|
width: 3px;
|
|
1642
1662
|
}
|
|
1643
1663
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1645
1666
|
width: 4px;
|
|
1646
1667
|
}
|
|
1647
1668
|
.bee-sidebar #style-radius .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)
|
|
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) {
|
|
1649
1671
|
width: 5px;
|
|
1650
1672
|
}
|
|
1651
1673
|
.bee-sidebar #style-radius .ant-slider:hover .ant-slider-rail,
|
|
1652
|
-
.bee-sidebar #style-width .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 {
|
|
1653
1676
|
background: #f5f5f5;
|
|
1654
1677
|
}
|
|
1655
1678
|
.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 b}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{default as RectRotateSensitivitySlider}from"./views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/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 g=Object.defineProperty,_=Object.defineProperties,C=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,d=(o,e,t)=>e in o?g(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,S=(o,e)=>{for(var t in e||(e={}))I.call(e,t)&&d(o,t,e[t]);if(s)for(var t of s(e))V.call(e,t)&&d(o,t,e[t]);return o},A=(o,e)=>_(o,C(e));const n=w(),y=(o,e)=>{const[t,p]=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(b,null,r.createElement(x,A(S({},o),{setToolInstance:a=>{var i;p(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var L=r.forwardRef(y);export{L as default,n as store};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as
|
|
1
|
+
import{create as i}from"zustand";const o=i(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),rectRotateSensitivity:2,setRectRotateSensitivity:t=>e(s=>({rectRotateSensitivity:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{uuid as E}from"@labelbee/lb-annotation";import{jsonParser as v}from"./index.js";import{EToolName as I}from"../data/enums/ToolType.js";import S from"lodash";import L from"./StepUtils.js";import{message as N}from"antd";import{i18n as F}from"@labelbee/lb-utils";class _{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((n,r)=>{this.traverseDF(n,s,r,t)}):Object.keys(t).forEach(n=>{this.traverseDF(t[n],s,n,t)}))}static getNextPath(t){var s,e,i;const{prePath:n,preMappingImgList:r,nextMappingImgList:
|
|
1
|
+
import{uuid as E}from"@labelbee/lb-annotation";import{jsonParser as v}from"./index.js";import{EToolName as I}from"../data/enums/ToolType.js";import S from"lodash";import L from"./StepUtils.js";import{message as N}from"antd";import{i18n as F}from"@labelbee/lb-utils";class _{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((n,r)=>{this.traverseDF(n,s,r,t)}):Object.keys(t).forEach(n=>{this.traverseDF(t[n],s,n,t)}))}static getNextPath(t){var s,e,i;const{prePath:n,preMappingImgList:r,nextMappingImgList:o}=t,a=(e=(s=r==null?void 0:r.find(c=>c.path===n))==null?void 0:s.calib)==null?void 0:e.calName;return(i=o.find(c=>{var f;return((f=c.calib)==null?void 0:f.calName)===a}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:n,preMappingImgList:r}=t,o=e===void 0?void 0:i[e];return e==="id"&&(i.id=E(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:n})),{value:e===void 0?void 0:i[e],oldValue:o}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:n,preMappingImgList:r}=t;try{const o=v(s),a=v(i),d=`step_${e}`;if(o[d]){const c=o[d],f=["result","resultRect"],p=new Map,R=(l,u)=>{if(l===void 0||u===void 0){console.warn("invalid id");return}p.set(u,l)};if(f.forEach(l=>{c[l]&&this.traverseDF(c[l],(u,m,h)=>{const{value:y,oldValue:x}=this.copyResultItemHandler({item:u,key:m,parent:h,mappingImgList:n,preMappingImgList:r});l==="result"&&m==="id"&&y!==void 0&&x!==void 0&&p.set(x,y)})}),p.size){const l=c.resultRect;Array.isArray(l)&&l.forEach(u=>{const m=u.extId,h=p.get(m);m!==void 0&&h!==void 0&&(u.extId=h)})}const D=["resultRect","rects"],g=[];return this.traverseDF(c,(l,u,m)=>{S.isString(u)&&D.includes(u)&&Array.isArray(l)&&(m[u]=l.filter(h=>h.imageName?!0:(g.push(h),!1)))}),g.length&&(console.log(g),N.info(F.t("PartialResultsReplicationFailure"))),a[d]=c,JSON.stringify(a)}return s}catch(o){N.info(F.t("FailedToCopyResults"))}}static isResultSourceMatchedDependence(t,s){const e=t==null?void 0:t.map(n=>n.sourceID).sort(),i=s==null?void 0:s.map(n=>n.id).sort();return S.isEqual(e,i)}static deltaUpdateBasicResultList(t,s){const e=t==null?void 0:t.map(i=>i.sourceID).sort();return s.filter(i=>!e.includes(i.id))}static getInitialResultList(t,s,e,i,n){const r=t!=null?t:[];switch(e.tool){case I.Tag:case I.Text:{if(e.dataSourceStep>0){const o=this.deltaUpdateBasicResultList(r,i);if(o.length>0)return r.concat(s.getInitResultList(e.dataSourceStep,o))}return n!==!0?r:s.getInitResultList(e.dataSourceStep,i)}default:return r}}static dataCorrection(t,s,e,i){var n,r;try{const a=`step_${L.getStepInfo(e,i).step}`,d=v(t),c=v(s),f=(n=d[a])==null?void 0:n.result,p=(r=c[a])==null?void 0:r.result;if(!p||S.isEqual(f.sort(this.idCmp),p.sort(this.idCmp)))return t;const R=this.findDeletedIds(f,p);if(R.length===0)return t;const D=e,g=this.getStepKeys(d).sort();return this.deleteRes(d,D,R,g),JSON.stringify(d)}catch(o){return console.error(o),t}}static idCmp(t,s){const e=t.id,i=s.id;return e<i?-1:e>i?1:0}static findDeletedIds(t,s){return this.findDeletedItems(s,t).map(e=>e.id)}static findDeletedItems(t,s){const e=[];return t.forEach(i=>{s.some(r=>r.id===i.id)||e.push(i)}),e}static getStepKeys(t){return Object.keys(t).map(s=>parseInt(s.replace("step_",""),10)).filter(s=>!isNaN(s))}static deleteRes(t,s,e,i){i.forEach(n=>{if(n>s){const r=t[`step_${n}`];if([I.FolderTag,I.Segmentation].includes(r.tool))return;if(r.dataSourceStep===s){const o=[];r.result=r.result.filter(a=>e.includes(a.sourceID)?(o.push(a.id),!1):!0),this.deleteRes(t,n,o,i)}else r.result=r.result.filter(o=>!e.includes(o.sourceID))}})}}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as y,useContext as
|
|
1
|
+
import e,{useState as y,useContext as j,useEffect as D}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 h}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as I,Input as it,message as w}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 R}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as $}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as mt,useDispatch as dt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import gt from"./components/rectRotateSensitivitySlider/index.js";import vt from"./components/findTrackIDIndex/index.js";import{EPointCloudSegmentStatus as L,EPointCloudPattern as St}from"@labelbee/lb-utils";import bt from"../../../../components/attributeList/index.js";import{useAttribute as Ct}from"../../../../components/pointCloudView/hooks/useAttribute.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import Pt from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Et from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import yt from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import It from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as T}from"../index.js";import{SetTaskStepList as wt}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as Lt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Tt from"../../../../components/subAttributeList/index.js";var jt=Object.defineProperty,Dt=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,z=(o,t,n)=>t in o?jt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))kt.call(t,n)&&z(o,n,t[n]);if(U)for(var n of U(t))At.call(t,n)&&z(o,n,t[n]);return o},V=(o,t)=>Dt(o,ht(t));const Vt=()=>{const[o,t]=y(!1),n=j(h),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:r}=$(),[u,m]=y(""),{t:g}=k(),p=c==null?void 0:c.info.trackID,s=d=>!!a.find(b=>b.trackID===d&&b.id!==(c==null?void 0:c.info.id)),i=(d=!1)=>{const f=parseInt(u,10);if(d&&t(!1),isNaN(f)){w.error(g("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){w.error(g("NotAllowDecimalPointsInTrackID"));return}if(s(f)){w.error(g("DuplicateTrackIDsExist"));return}if(!(f>0)){w.error(g("PositiveIntegerCheck"));return}S(f)};D(()=>{t(!1)},[p]);const S=d=>{var f;const b=r({trackID:d});(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:d=>S(d)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:d=>{m(d.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===St.Segmentation&&![L.Edit,L.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[m,g]=y({segmentStatus:L.Ready}),{selectedBox:p}=$(),s=j(h),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:d}=Ct(),f=Lt(),{isPointCloudSegmentationPattern:b}=R(),H=dt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};D(()=>{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(wt({stepList:et}))},Y=l=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(l)},q=l=>{F({globalPattern:s.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(l)},G=(l,C)=>{F({globalPattern:s.globalPattern,segmentStatus:m.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||m.cacheSegData&&m.segmentStatus===L.Edit,Z=b;return e.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},e.createElement("div",{style:J},S("Attribute")),e.createElement(bt,{list:K,forbidDefault:!0,selectedAttribute:d!=null?d:"",attributeChanged:l=>q(l),updateColorConfig:X,enableColorPicker:u,updateSize:Y,forbidShowLimitPopover:Z}),e.createElement(I,{style:{margin:0}}),Q&&e.createElement(Tt,{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=m.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:x[l.value])}}))},Bt=[{toolName:"LassoSelector",commonSvg:_t,selectedSvg:Pt},{toolName:"RectSelector",commonSvg:yt,selectedSvg:It},{toolName:"CircleSelector",commonSvg:xt,selectedSvg:Et}],W=({toolInstance:o})=>{const{ptSegmentInstance:t}=j(h),[n,a]=y("LassoSelector"),{t:c}=k();return D(()=>{if(!t)return;const r=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},m=()=>{a("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",m),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",m)}},[t]),e.createElement("div",{className:`${T}__level`},Bt.map(r=>{const u=n===r.toolName;return e.createElement("span",{className:`${T}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${T}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ut({[`${T}__toolOption__selected`]:u})},c(r.toolName)))}))},Nt=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:r})=>{var u,m;const{updatePointCloudPattern:g,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=R(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],d=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(m=i==null?void 0:i.inputList)!=null?m:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:d,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:d,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(Vt,null),e.createElement(I,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(I,{style:{margin:0}}),e.createElement(vt,{imgList:n,imgIndex:a}),e.createElement(I,{style:{margin:0}}),e.createElement(gt,null)))},Ot=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,m=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:m}};var Rt=at(Ot,null,null,{context:mt})(Nt);export{W as PointCloudSegToolIcon,Rt 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.43",
|
|
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.21",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.15",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|