@labelbee/lb-components 1.9.0-alpha.2 → 1.9.0-alpha.3
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/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/index.css +1 -0
- package/dist/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js.map +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js.map +1 -1
- package/es/index.css +1 -0
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js +1 -1
- package/es/views/MainView/toolFooter/AnnotatedAttributes/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:e})=>{const{isActive:t,setTarget3DView:n}=React.useContext(PointCloud3DContext),
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),classNames=require("classnames"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),map=require("../../store/annotation/map.js"),reactRedux=require("react-redux"),index=require("../../utils/index.js"),useSingleBox=require("./hooks/useSingleBox.js"),antd=require("antd"),useSize=require("../../hooks/useSize.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var classNames__default=_interopDefaultLegacy(classNames),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const pointCloudID="LABELBEE-POINTCLOUD",PointCloud3DContext=React__default.default.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),PointCloudViewIcon=({perspectiveView:e})=>{const{isActive:t,setTarget3DView:n}=React.useContext(PointCloud3DContext),a=m=>classNames__default.default({[dom.getClassName("point-cloud-3d-view",m)]:!0,active:t});return React__default.default.createElement("span",{onClick:()=>{n(lbUtils.EPerspectiveView[e])},className:a(e.toLocaleLowerCase())})},PointCloud3DSideBar=()=>{const{reset3DView:e,followTopView:t}=React.useContext(PointCloud3DContext),{t:n}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-sidebar")},React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Top"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Front"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Left"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Back"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"Right"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"LFT"}),React__default.default.createElement(PointCloudViewIcon,{perspectiveView:"RBT"}),React__default.default.createElement(antd.Tooltip,{title:n("CameraFollowTopView")},React__default.default.createElement("span",{onClick:()=>{t()},className:dom.getClassName("point-cloud-3d-view","followTop")})),React__default.default.createElement("span",{onClick:()=>{e()},className:dom.getClassName("point-cloud-3d-view","reset")}))},PointCloud3D=({currentData:e,config:t})=>{var n;const a=React.useContext(PointCloudContext.PointCloudContext),[m,w]=React.useState(!0),u=React.useRef(null),{initPointCloud3d:p}=usePointCloudViews.usePointCloudViews(),l=useSize(u),{t:v}=reactI18next.useTranslation();React.useEffect(()=>{!a.mainViewInstance||p==null||p(l)},[l]);const{selectedBox:s}=useSingleBox.useSingleBox(),f=o=>{var i;const r=s==null?void 0:s.info;r&&((i=a.mainViewInstance)==null||i.updateCameraByBox(r,o))},C=()=>{var o;(o=a.mainViewInstance)==null||o.resetCamera()},V=()=>{var o,i;const r=(o=a.topViewInstance)==null?void 0:o.pointCloudInstance.camera;r&&((i=a.mainViewInstance)==null||i.applyCameraTarget(r))};React.useEffect(()=>{if(u.current&&(e==null?void 0:e.url)){let o=a.mainViewInstance;if(!o&&l.width){const i={left:-l.width/2,right:l.width/2,top:l.height/2,bottom:-l.height/2,near:100,far:-100};o=new lbAnnotation.PointCloud({container:u.current,isOrthographicCamera:!0,orthographicParams:i,config:t}),a.setMainViewInstance(o)}}},[l]),React.useEffect(()=>{var o;if(u.current&&(e==null?void 0:e.url)&&e.result&&a.mainViewInstance){let i=a.mainViewInstance;const r=lbUtils.PointCloudUtils.getBoxParamsFromResultList(e.result);r.forEach(c=>{var d;const _=(d=lbUtils.toolStyleConverter.getColorFromConfig({attribute:c.attribute},__spreadProps(__spreadValues({},t),{attributeConfigurable:!0}),{}))==null?void 0:d.hex;i==null||i.generateBox(c,_)}),a.setPointCloudResult(r),a.setPointCloudValid((o=index.jsonParser(e.result))==null?void 0:o.valid)}},[e,a.mainViewInstance]),React.useEffect(()=>{var o,i,r,c;if(s){f(lbUtils.EPerspectiveView.Top);const d=(r=(i=(o=a.topViewInstance)==null?void 0:o.pointCloudInstance)==null?void 0:i.camera.zoom)!=null?r:1;(c=a.mainViewInstance)==null||c.updateCameraZoom(d)}},[s]);const g=React.useMemo(()=>({reset3DView:C,setTarget3DView:f,isActive:!!s,followTopView:V}),[s,a.mainViewInstance]),P=React__default.default.createElement("div",null,React__default.default.createElement("span",{style:{marginRight:8}},v("ShowArrows")),React__default.default.createElement(antd.Switch,{size:"small",checked:m,onChange:o=>{var i;w(o),(i=a.mainViewInstance)==null||i.setShowDirection(o)}}));return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-3d-container"),title:v("3DView"),toolbar:P,style:{height:e.mappingImgList&&((n=e.mappingImgList)==null?void 0:n.length)>0?"55%":"100%"}},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-content")},React__default.default.createElement(PointCloud3DContext.Provider,{value:g},React__default.default.createElement(PointCloud3DSideBar,null)),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-3d-view"),id:pointCloudID,ref:u})))};var PointCloud3DView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud3D);module.exports=PointCloud3DView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(
|
|
1
|
+
"use strict";var PointCloudContext=require("./PointCloudContext.js"),useRotate=require("./hooks/useRotate.js"),useBoxes=require("./hooks/useBoxes.js"),useSingleBox=require("./hooks/useSingleBox.js"),React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),antd=require("antd"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),annotation=require("../../hooks/annotation.js"),useStatus=require("./hooks/useStatus.js"),index=require("../../utils/index.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),ctx=require("../../store/ctx.js"),useHistory=require("./hooks/useHistory.js"),useAttribute=require("./hooks/useAttribute.js"),useConfig=require("./hooks/useConfig.js"),usePolygon=require("./hooks/usePolygon.js"),reactI18next=require("react-i18next"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(u,r,n)=>r in u?__defProp(u,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):u[r]=n,__spreadValues=(u,r)=>{for(var n in r||(r={}))__hasOwnProp.call(r,n)&&__defNormalProp(u,n,r[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(r))__propIsEnum.call(r,n)&&__defNormalProp(u,n,r[n]);return u},__spreadProps=(u,r)=>__defProps(u,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:u,config:r,checkMode:n,configString:h,imgIndex:P})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:_,selectNextBox:B,selectPrevBox:S,updateSelectedBox:y,deleteSelectedPointCloudBoxAndPolygon:E}=useSingleBox.useSingleBox(),{clearAllResult:v,updatePointCloudPattern:V}=useStatus.useStatus(),A=index.jsonParser(u.result),{copySelectedBoxes:I,pasteSelectedBoxes:O,copiedBoxes:q}=useBoxes.useBoxes({config:r}),{toolInstanceRef:a}=annotation.useCustomToolInstance({basicInfo:A}),{updateRotate:b}=useRotate.useRotate({currentData:u}),{updatePointCloudData:C,topViewSelectedChanged:j}=usePointCloudViews.usePointCloudViews(),{redo:w,undo:x,pushHistoryWithList:L,pushHistoryUnderUpdatePolygon:R}=useHistory.useHistory(),{syncThreeViewsAttribute:g}=useAttribute.useAttribute(),{syncAllViewsConfig:T,reRenderTopViewRange:D}=useConfig.useConfig(),{selectedPolygon:k}=usePolygon.usePolygon(),{t:f}=reactI18next.useTranslation(),p=e=>{var t;const{topViewInstance:s}=o;!s||(t=s.pointCloud2dOperation)==null||t.updateSelectedPolygonsPoints(e)},N=(e,t)=>{var s;const{topViewInstance:i,mainViewInstance:l}=o;if(!i)return;const{pointCloud2dOperation:c}=i;switch(e){case"q":{b(2);break}case"e":b(-2);break;case"g":b(180);break;case"u":{const d=c.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;V(d);const K={[lbAnnotation.EToolName.Polygon]:f("PolygonPattern"),[lbAnnotation.EToolName.Rect]:f("RectPattern")};antd.message.success(f("ChangePatternMsg",{pattern:K[d]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize(!0);break;case"-":l==null||l.updatePointSize(!1);break;case"v":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){S();break}B(),t.preventDefault();break;case"f":_();break;case"arrowup":p({y:-1});break;case"arrowdown":p({y:1});break;case"arrowleft":p({x:-1});break;case"arrowright":p({x:1});break;case"delete":E();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(t.keyCode,r.attributeList);d!==void 0&&a.current.setDefaultAttribute(d)}return}}},H=(e,t)=>{switch(e){case"c":I();break;case"v":O();break;case"a":t.preventDefault(),o.selectedAllBoxes();break;case"z":{t.shiftKey?w():x();break}}},m=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||n===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){H(t,e);return}N(t,e)};return React.useEffect(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[o,q,r,o.pointCloudBoxList,o.polygonList]),React.useEffect(()=>{T(r)},[h]),React.useEffect(()=>{(r==null?void 0:r.radius)&&D(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{C==null||C()},[P,o.mainViewInstance]),React.useEffect(()=>{o.setHideAttributes([])},[P]),React.useEffect(()=>{a.current.exportData=()=>[o.pointCloudBoxList,{valid:o.valid}],a.current.exportCustomData=()=>{var e;return{resultPolygon:(e=o.polygonList)!=null?e:[]}},a.current.setDefaultAttribute=e=>{g(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=y(t);o.mainViewInstance&&j(t,s)}k&&R(__spreadProps(__spreadValues({},k),{attribute:e}))},a.current.setSubAttribute=(e,t)=>{var s;const i=o.selectedPointCloudBox;if(i){const l=(s=i==null?void 0:i.subAttribute)!=null?s:{};i.subAttribute=__spreadProps(__spreadValues({},l),{[e]:t}),y(i)}},a.current.clearResult=()=>{v==null||v()},a.current.redo=()=>{w()},a.current.undo=()=>{x()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&v()})},a.current.setForbidOperation=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&o.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)}},[o.pointCloudBoxList,o.selectedID,o.valid,o.polygonList,o.mainViewInstance]),React.useEffect(()=>{a.current.history={pushHistory:e=>{L({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||n)return;const s=c=>{g(c)},i=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return t.on("syncAttribute",s),t.on("messageError",i),t.on("messageInfo",l),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",i),t.unbind("messageInfo",l)}},[o.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),React=require("react"),selectors=require("../../../../store/annotation/selectors.js"),ctx=require("../../../../store/ctx.js"),lbUtils=require("@labelbee/lb-utils"),icons=require("@ant-design/icons"),useHistory=require("../../../../components/pointCloudView/hooks/useHistory.js"),dom=require("../../../../utils/dom.js"),StepUtils=require("../../../../utils/StepUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),FooterPopover=require("../FooterPopover.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),React=require("react"),selectors=require("../../../../store/annotation/selectors.js"),ctx=require("../../../../store/ctx.js"),lbUtils=require("@labelbee/lb-utils"),icons=require("@ant-design/icons"),useHistory=require("../../../../components/pointCloudView/hooks/useHistory.js"),dom=require("../../../../utils/dom.js"),StepUtils=require("../../../../utils/StepUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),FooterPopover=require("../FooterPopover.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const AnnotatedAttributesItem=({attribute:t})=>{const s=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:a,hideAttributes:n,toggleAttributesVisible:o,polygonList:l,setPolygonList:u,setPointCloudResult:d,reRender:r}=s,[c,x]=React.useState(!0),{pushHistoryWithList:g}=useHistory.useHistory(),p=[...a,...l].filter(e=>e.attribute===t.value),C=()=>{o(t.value)},v=n.includes(t.value),b=({trackID:e,order:i})=>e||i,y=({trackID:e,order:i})=>e?`trackID_${e}`:`order_${i}`,E=e=>{if(p.length===0)return;const i=l.filter(f=>e!==f.attribute),m=a.filter(f=>e!==f.attribute);r(m,i),u(i),d(m),g({pointCloudBoxList:m,polygonList:i})},A=e=>{antd.Modal.confirm({content:lbUtils.i18n.t("onDeleteGraphByAttr",{attribute:e.key}),onOk:()=>{E(e.value)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")})};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","item")},v?React__default.default.createElement(icons.EyeInvisibleFilled,{onClick:C}):React__default.default.createElement(icons.EyeFilled,{onClick:C}),React__default.default.createElement(icons.CaretDownFilled,{rotate:c?0:270,onClick:()=>{x(!c)}}),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","item","text")},t.key),React__default.default.createElement(icons.DeleteOutlined,{onClick:()=>A(t)})),c&&p.map(e=>React__default.default.createElement("div",{key:y(e),style:{paddingLeft:54}},`${b(e)}.${t.key}`)))},AnnotatedAttributesPanel=()=>{const t=ctx.useSelector(selectors.stepConfigSelector),{attrPanelLayout:s,setAttrPanelLayout:a,pointCloudBoxList:n,polygonList:o}=React.useContext(PointCloudContext.PointCloudContext),{t:l}=reactI18next.useTranslation(),u=React.useMemo(()=>[...n,...o].map(r=>r.attribute),[n,o]),d=React.useMemo(()=>t.attributeList.filter(r=>u.includes(r.value)),[u]);return React.useEffect(()=>{console.log(n)},[n]),console.log(n,o,u,d),React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute")},s?React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",null,l("AnnotatedResult")),React__default.default.createElement("span",{className:dom.getClassName("annotated-attribute","pin"),onClick:()=>{a("")}},React__default.default.createElement(icons.PushpinFilled,null),l("CancelFixed"))):React__default.default.createElement("div",{className:dom.getClassName("annotated-attribute","text")},React__default.default.createElement("span",{onClick:()=>{a("left")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),l("FixedOnLeft")),React__default.default.createElement("span",{onClick:()=>{a("right")},className:dom.getClassName("annotated-attribute","pin")},React__default.default.createElement(icons.PushpinFilled,null),l("FixedOnRight"))),React__default.default.createElement("div",null,d.length>0?d.map(r=>React__default.default.createElement(AnnotatedAttributesItem,{attribute:r,key:r.value})):React__default.default.createElement("div",{style:{textAlign:"center",height:200,lineHeight:"200px"}},l("NoData"))))},AnnotatedAttributesPanelFixedLeft=()=>{const{attrPanelLayout:t}=React.useContext(PointCloudContext.PointCloudContext);return t==="left"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesPanelFixedRight=()=>{const{attrPanelLayout:t}=React.useContext(PointCloudContext.PointCloudContext);return t==="right"?React__default.default.createElement(AnnotatedAttributesPanel,null):null},AnnotatedAttributesIcon=()=>{const{attrPanelLayout:t}=React.useContext(PointCloudContext.PointCloudContext),{t:s}=reactI18next.useTranslation(),a=ctx.useSelector(n=>{var o,l;return StepUtils.getCurrentStepInfo((o=n==null?void 0:n.annotation)==null?void 0:o.step,(l=n.annotation)==null?void 0:l.stepList)});return(a==null?void 0:a.tool)!==lbAnnotation.EPointCloudName.PointCloud||t?null:React__default.default.createElement(FooterPopover,{hoverIcon:React__default.default.createElement(icons.UnorderedListOutlined,{style:{marginRight:4}}),icon:React__default.default.createElement(icons.UnorderedListOutlined,{style:{marginRight:4}}),title:s("AnnotatedList"),content:React__default.default.createElement(AnnotatedAttributesPanel,null)})};exports.AnnotatedAttributesIcon=AnnotatedAttributesIcon,exports.AnnotatedAttributesPanel=AnnotatedAttributesPanel,exports.AnnotatedAttributesPanelFixedLeft=AnnotatedAttributesPanelFixedLeft,exports.AnnotatedAttributesPanelFixedRight=AnnotatedAttributesPanelFixedRight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as c}from"../../utils/dom.js";import{PointCloud as
|
|
1
|
+
import{getClassName as c}from"../../utils/dom.js";import{PointCloud as B}from"@labelbee/lb-annotation";import{PointCloudUtils as L,toolStyleConverter as N,EPerspectiveView as _}from"@labelbee/lb-utils";import D from"classnames";import t,{useContext as C,useState as R,useRef as k,useEffect as v,useMemo as z}from"react";import{PointCloudContainer as A}from"./PointCloudLayout.js";import{PointCloudContext as F}from"./PointCloudContext.js";import{a2MapStateToProps as M}from"../../store/annotation/map.js";import{connect as U}from"react-redux";import{jsonParser as Z}from"../../utils/index.js";import{useSingleBox as q}from"./hooks/useSingleBox.js";import{Switch as G,Tooltip as H}from"antd";import J from"../../hooks/useSize.js";import{usePointCloudViews as K}from"./hooks/usePointCloudViews.js";import{useTranslation as E}from"react-i18next";import{LabelBeeContext as Q}from"../../store/ctx.js";var W=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,I=(e,o,r)=>o in e?W(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,te=(e,o)=>{for(var r in o||(o={}))$.call(o,r)&&I(e,r,o[r]);if(x)for(var r of x(o))ee.call(o,r)&&I(e,r,o[r]);return e},oe=(e,o)=>X(e,Y(o));const ie="LABELBEE-POINTCLOUD",V=t.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),m=({perspectiveView:e})=>{const{isActive:o,setTarget3DView:r}=C(V),n=f=>D({[c("point-cloud-3d-view",f)]:!0,active:o});return t.createElement("span",{onClick:()=>{r(_[e])},className:n(e.toLocaleLowerCase())})},ne=()=>{const{reset3DView:e,followTopView:o}=C(V),{t:r}=E();return t.createElement("div",{className:c("point-cloud-3d-sidebar")},t.createElement(m,{perspectiveView:"Top"}),t.createElement(m,{perspectiveView:"Front"}),t.createElement(m,{perspectiveView:"Left"}),t.createElement(m,{perspectiveView:"Back"}),t.createElement(m,{perspectiveView:"Right"}),t.createElement(m,{perspectiveView:"LFT"}),t.createElement(m,{perspectiveView:"RBT"}),t.createElement(H,{title:r("CameraFollowTopView")},t.createElement("span",{onClick:()=>{o()},className:c("point-cloud-3d-view","followTop")})),t.createElement("span",{onClick:()=>{e()},className:c("point-cloud-3d-view","reset")}))},re=({currentData:e,config:o})=>{var r;const n=C(F),[f,b]=R(!0),p=k(null),{initPointCloud3d:P}=K(),s=J(p),{t:g}=E();v(()=>{!n.mainViewInstance||P==null||P(s)},[s]);const{selectedBox:u}=q(),h=i=>{var a;const l=u==null?void 0:u.info;l&&((a=n.mainViewInstance)==null||a.updateCameraByBox(l,i))},T=()=>{var i;(i=n.mainViewInstance)==null||i.resetCamera()},O=()=>{var i,a;const l=(i=n.topViewInstance)==null?void 0:i.pointCloudInstance.camera;l&&((a=n.mainViewInstance)==null||a.applyCameraTarget(l))};v(()=>{if(p.current&&(e==null?void 0:e.url)){let i=n.mainViewInstance;if(!i&&s.width){const a={left:-s.width/2,right:s.width/2,top:s.height/2,bottom:-s.height/2,near:100,far:-100};i=new B({container:p.current,isOrthographicCamera:!0,orthographicParams:a,config:o}),n.setMainViewInstance(i)}}},[s]),v(()=>{var i;if(p.current&&(e==null?void 0:e.url)&&e.result&&n.mainViewInstance){let a=n.mainViewInstance;const l=L.getBoxParamsFromResultList(e.result);l.forEach(d=>{var w;const y=(w=N.getColorFromConfig({attribute:d.attribute},oe(te({},o),{attributeConfigurable:!0}),{}))==null?void 0:w.hex;a==null||a.generateBox(d,y)}),n.setPointCloudResult(l),n.setPointCloudValid((i=Z(e.result))==null?void 0:i.valid)}},[e,n.mainViewInstance]),v(()=>{var i,a,l,d;if(u){h(_.Top);const w=(l=(a=(i=n.topViewInstance)==null?void 0:i.pointCloudInstance)==null?void 0:a.camera.zoom)!=null?l:1;(d=n.mainViewInstance)==null||d.updateCameraZoom(w)}},[u]);const j=z(()=>({reset3DView:T,setTarget3DView:h,isActive:!!u,followTopView:O}),[u,n.mainViewInstance]),S=t.createElement("div",null,t.createElement("span",{style:{marginRight:8}},g("ShowArrows")),t.createElement(G,{size:"small",checked:f,onChange:i=>{var a;b(i),(a=n.mainViewInstance)==null||a.setShowDirection(i)}}));return t.createElement(A,{className:c("point-cloud-3d-container"),title:g("3DView"),toolbar:S,style:{height:e.mappingImgList&&((r=e.mappingImgList)==null?void 0:r.length)>0?"55%":"100%"}},t.createElement("div",{className:c("point-cloud-3d-content")},t.createElement(V.Provider,{value:j},t.createElement(ne,null)),t.createElement("div",{className:c("point-cloud-3d-view"),id:ie,ref:p})))};var ae=U(M,null,null,{context:Q})(re);export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloud3DView.js","sources":["../../../src/components/pointCloudView/PointCloud3DView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-13 19:31:36\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-06-27 19:43:25\n */\n\nimport { getClassName } from '@/utils/dom';\nimport { PointCloud } from '@labelbee/lb-annotation';\nimport {\n EPerspectiveView,\n IPointCloudBox,\n PointCloudUtils,\n toolStyleConverter,\n} from '@labelbee/lb-utils';\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { PointCloudContext } from './PointCloudContext';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { jsonParser } from '@/utils';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { Switch } from 'antd';\nimport useSize from '@/hooks/useSize';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst pointCloudID = 'LABELBEE-POINTCLOUD';\nconst PointCloud3DContext = React.createContext<{\n isActive: boolean;\n setTarget3DView: (perspectiveView: EPerspectiveView) => void;\n reset3DView: () => void;\n followTopView: () => void;\n}>({\n isActive: false,\n setTarget3DView: () => {},\n reset3DView: () => {},\n followTopView: () => {},\n});\n\nconst PointCloudViewIcon = ({\n perspectiveView,\n}: {\n perspectiveView: keyof typeof EPerspectiveView;\n}) => {\n const { isActive, setTarget3DView } = useContext(PointCloud3DContext);\n\n const getTarget3DViewClassName = (position: string) => {\n return classNames({\n [getClassName('point-cloud-3d-view', position)]: true,\n active: isActive,\n });\n };\n\n return (\n <span\n onClick={() => {\n setTarget3DView(EPerspectiveView[perspectiveView]);\n }}\n className={getTarget3DViewClassName(perspectiveView.toLocaleLowerCase())}\n />\n );\n};\n\nconst PointCloud3DSideBar = () => {\n const { reset3DView, followTopView } = useContext(PointCloud3DContext);\n return (\n <div className={getClassName('point-cloud-3d-sidebar')}>\n <PointCloudViewIcon perspectiveView='Top' />\n <PointCloudViewIcon perspectiveView='Front' />\n <PointCloudViewIcon perspectiveView='Left' />\n <PointCloudViewIcon perspectiveView='Back' />\n <PointCloudViewIcon perspectiveView='Right' />\n <PointCloudViewIcon perspectiveView='LFT' />\n <PointCloudViewIcon perspectiveView='RBT' />\n\n <span\n onClick={() => {\n followTopView();\n }}\n className={getClassName('point-cloud-3d-view', 'followTop')}\n />\n\n <span\n onClick={() => {\n reset3DView();\n }}\n className={getClassName('point-cloud-3d-view', 'reset')}\n />\n </div>\n );\n};\n\nconst PointCloud3D: React.FC<IA2MapStateProps> = ({ currentData, config }) => {\n const ptCtx = useContext(PointCloudContext);\n const [showDirection, setShowDirection] = useState(true);\n const ref = useRef<HTMLDivElement>(null);\n const { initPointCloud3d } = usePointCloudViews();\n const size = useSize(ref);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!ptCtx.mainViewInstance) {\n return;\n }\n initPointCloud3d?.(size);\n }, [size]);\n const { selectedBox } = useSingleBox();\n\n const setTarget3DView = (perspectiveView: EPerspectiveView) => {\n const box = selectedBox?.info;\n\n if (box) {\n ptCtx.mainViewInstance?.updateCameraByBox(box, perspectiveView);\n }\n };\n\n const reset3DView = () => {\n ptCtx.mainViewInstance?.resetCamera();\n };\n\n const followTopView = () => {\n const topViewCamera = ptCtx.topViewInstance?.pointCloudInstance.camera;\n if (topViewCamera) {\n ptCtx.mainViewInstance?.applyCameraTarget(topViewCamera);\n }\n };\n\n /**\n * Listen for data changes.\n */\n useEffect(() => {\n if (ref.current && currentData?.url) {\n let pointCloud = ptCtx.mainViewInstance;\n if (!pointCloud && size.width) {\n const orthographicParams = {\n left: -size.width / 2,\n right: size.width / 2,\n top: size.height / 2,\n bottom: -size.height / 2,\n near: 100,\n far: -100,\n };\n\n // Need to be showed\n pointCloud = new PointCloud({\n container: ref.current,\n isOrthographicCamera: true,\n orthographicParams,\n config,\n });\n ptCtx.setMainViewInstance(pointCloud);\n }\n\n if (currentData.result) {\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n const hex = toolStyleConverter.getColorFromConfig(\n { attribute: v.attribute },\n { ...config, attributeConfigurable: true },\n {},\n )?.hex;\n\n pointCloud?.generateBox(v, hex);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n ptCtx.setPointCloudValid(jsonParser(currentData.result)?.valid);\n }\n }\n }, [currentData, size]);\n\n /**\n * Observe selectedID and reset camera to target top-view\n */\n useEffect(() => {\n if (selectedBox) {\n setTarget3DView(EPerspectiveView.Top);\n\n /**\n * 3DView's zoom synchronizes with topView' zoom.\n */\n const zoom = ptCtx.topViewInstance?.pointCloudInstance?.camera.zoom ?? 1;\n ptCtx.mainViewInstance?.updateCameraZoom(zoom);\n }\n }, [selectedBox]);\n\n const ptCloud3DCtx = useMemo(() => {\n return { reset3DView, setTarget3DView, isActive: !!selectedBox, followTopView };\n }, [selectedBox, ptCtx.mainViewInstance]);\n\n const PointCloud3DTitle = (\n <div>\n <span style={{ marginRight: 8 }}>{t('ShowArrows')}</span>\n <Switch\n size='small'\n checked={showDirection}\n onChange={(showDirection) => {\n setShowDirection(showDirection);\n ptCtx.mainViewInstance?.setShowDirection(showDirection);\n }}\n />\n </div>\n );\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-3d-container')}\n title={t('3DView')}\n toolbar={PointCloud3DTitle}\n style={{\n height:\n currentData.mappingImgList && currentData.mappingImgList?.length > 0 ? '55%' : '100%',\n }}\n >\n <div className={getClassName('point-cloud-3d-content')}>\n <PointCloud3DContext.Provider value={ptCloud3DCtx}>\n <PointCloud3DSideBar />\n </PointCloud3DContext.Provider>\n <div className={getClassName('point-cloud-3d-view')} id={pointCloudID} ref={ref} />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(PointCloud3D);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,YAAe,GAAA,qBAAA,CAAA;AACrB,MAAM,mBAAA,GAAsB,MAAM,aAK/B,CAAA;AAAA,EACD,QAAU,EAAA,KAAA;AAAA,EACV,iBAAiB,MAAM;AAAA,GAAA;AAAA,EACvB,aAAa,MAAM;AAAA,GAAA;AAAA,EACnB,eAAe,MAAM;AAAA,GAAA;AAAA,CAAA,CAAA,CAAA;AAGvB,MAAM,qBAAqB,CAAC;AAAA,EAC1B,eAAA;AAAA,CAGI,KAAA;AACJ,EAAM,MAAA,CAAE,QAAU,EAAA,eAAA,CAAA,GAAoB,UAAW,CAAA,mBAAA,CAAA,CAAA;AAEjD,EAAM,MAAA,wBAAA,GAA2B,CAAC,QAAqB,KAAA;AACrD,IAAA,OAAO,UAAW,CAAA;AAAA,MACf,CAAA,YAAA,CAAa,uBAAuB,QAAY,CAAA,GAAA,IAAA;AAAA,MACjD,MAAQ,EAAA,QAAA;AAAA,KAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAIZ,EAAA,2CACG,MAAD,EAAA;AAAA,IACE,SAAS,MAAM;AACb,MAAA,eAAA,CAAgB,gBAAiB,CAAA,eAAA,CAAA,CAAA,CAAA;AAAA,KAAA;AAAA,IAEnC,SAAA,EAAW,yBAAyB,eAAgB,CAAA,iBAAA,EAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAK1D,MAAM,sBAAsB,MAAM;AAChC,EAAM,MAAA,CAAE,WAAa,EAAA,aAAA,CAAA,GAAkB,UAAW,CAAA,mBAA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F,KAAD,EAAA;AAAA,IAAK,WAAW,YAAa,CAAA,wBAAA,CAAA;AAAA,GAC3B,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAoB,QAArB,EAAA;AAAA,IAA8B,KAAO,EAAA,YAAA;AAAA,GAAA,kBAClC,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAD,IAEF,CAAA,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAD,EAAA;AAAA,IAAK,WAAW,YAAa,CAAA,qBAAA,CAAA;AAAA,IAAwB,EAAI,EAAA,YAAA;AAAA,IAAc,GAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAM/E,uBAAe,QAAQ,iBAAmB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,YAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"PointCloud3DView.js","sources":["../../../src/components/pointCloudView/PointCloud3DView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-13 19:31:36\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-06-27 19:43:25\n */\n\nimport { getClassName } from '@/utils/dom';\nimport { PointCloud } from '@labelbee/lb-annotation';\nimport {\n EPerspectiveView,\n IPointCloudBox,\n PointCloudUtils,\n toolStyleConverter,\n} from '@labelbee/lb-utils';\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport { PointCloudContext } from './PointCloudContext';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { connect } from 'react-redux';\nimport { jsonParser } from '@/utils';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { Switch, Tooltip } from 'antd';\nimport useSize from '@/hooks/useSize';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst pointCloudID = 'LABELBEE-POINTCLOUD';\nconst PointCloud3DContext = React.createContext<{\n isActive: boolean;\n setTarget3DView: (perspectiveView: EPerspectiveView) => void;\n reset3DView: () => void;\n followTopView: () => void;\n}>({\n isActive: false,\n setTarget3DView: () => {},\n reset3DView: () => {},\n followTopView: () => {},\n});\n\nconst PointCloudViewIcon = ({\n perspectiveView,\n}: {\n perspectiveView: keyof typeof EPerspectiveView;\n}) => {\n const { isActive, setTarget3DView } = useContext(PointCloud3DContext);\n\n const getTarget3DViewClassName = (position: string) => {\n return classNames({\n [getClassName('point-cloud-3d-view', position)]: true,\n active: isActive,\n });\n };\n\n return (\n <span\n onClick={() => {\n setTarget3DView(EPerspectiveView[perspectiveView]);\n }}\n className={getTarget3DViewClassName(perspectiveView.toLocaleLowerCase())}\n />\n );\n};\n\nconst PointCloud3DSideBar = () => {\n const { reset3DView, followTopView } = useContext(PointCloud3DContext);\n const { t } = useTranslation();\n return (\n <div className={getClassName('point-cloud-3d-sidebar')}>\n <PointCloudViewIcon perspectiveView='Top' />\n <PointCloudViewIcon perspectiveView='Front' />\n <PointCloudViewIcon perspectiveView='Left' />\n <PointCloudViewIcon perspectiveView='Back' />\n <PointCloudViewIcon perspectiveView='Right' />\n <PointCloudViewIcon perspectiveView='LFT' />\n <PointCloudViewIcon perspectiveView='RBT' />\n\n <Tooltip title={t('CameraFollowTopView')}>\n <span\n onClick={() => {\n followTopView();\n }}\n className={getClassName('point-cloud-3d-view', 'followTop')}\n />\n </Tooltip>\n\n <span\n onClick={() => {\n reset3DView();\n }}\n className={getClassName('point-cloud-3d-view', 'reset')}\n />\n </div>\n );\n};\n\nconst PointCloud3D: React.FC<IA2MapStateProps> = ({ currentData, config }) => {\n const ptCtx = useContext(PointCloudContext);\n const [showDirection, setShowDirection] = useState(true);\n const ref = useRef<HTMLDivElement>(null);\n const { initPointCloud3d } = usePointCloudViews();\n const size = useSize(ref);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!ptCtx.mainViewInstance) {\n return;\n }\n initPointCloud3d?.(size);\n }, [size]);\n const { selectedBox } = useSingleBox();\n\n const setTarget3DView = (perspectiveView: EPerspectiveView) => {\n const box = selectedBox?.info;\n\n if (box) {\n ptCtx.mainViewInstance?.updateCameraByBox(box, perspectiveView);\n }\n };\n\n const reset3DView = () => {\n ptCtx.mainViewInstance?.resetCamera();\n };\n\n const followTopView = () => {\n const topViewCamera = ptCtx.topViewInstance?.pointCloudInstance.camera;\n if (topViewCamera) {\n ptCtx.mainViewInstance?.applyCameraTarget(topViewCamera);\n }\n };\n\n useEffect(() => {\n if (ref.current && currentData?.url) {\n let pointCloud = ptCtx.mainViewInstance;\n if (!pointCloud && size.width) {\n const orthographicParams = {\n left: -size.width / 2,\n right: size.width / 2,\n top: size.height / 2,\n bottom: -size.height / 2,\n near: 100,\n far: -100,\n };\n\n // Need to be showed\n pointCloud = new PointCloud({\n container: ref.current,\n isOrthographicCamera: true,\n orthographicParams,\n config,\n });\n ptCtx.setMainViewInstance(pointCloud);\n }\n }\n }, [size]);\n\n /**\n * Listen for data changes.\n */\n useEffect(() => {\n if (ref.current && currentData?.url) {\n if (currentData.result && ptCtx.mainViewInstance) {\n let pointCloud = ptCtx.mainViewInstance;\n const boxParamsList = PointCloudUtils.getBoxParamsFromResultList(currentData.result);\n\n // Add Init Box\n boxParamsList.forEach((v: IPointCloudBox) => {\n const hex = toolStyleConverter.getColorFromConfig(\n { attribute: v.attribute },\n { ...config, attributeConfigurable: true },\n {},\n )?.hex;\n\n pointCloud?.generateBox(v, hex);\n });\n\n ptCtx.setPointCloudResult(boxParamsList);\n ptCtx.setPointCloudValid(jsonParser(currentData.result)?.valid);\n }\n }\n }, [currentData, ptCtx.mainViewInstance]);\n\n /**\n * Observe selectedID and reset camera to target top-view\n */\n useEffect(() => {\n if (selectedBox) {\n setTarget3DView(EPerspectiveView.Top);\n\n /**\n * 3DView's zoom synchronizes with topView' zoom.\n */\n const zoom = ptCtx.topViewInstance?.pointCloudInstance?.camera.zoom ?? 1;\n ptCtx.mainViewInstance?.updateCameraZoom(zoom);\n }\n }, [selectedBox]);\n\n const ptCloud3DCtx = useMemo(() => {\n return { reset3DView, setTarget3DView, isActive: !!selectedBox, followTopView };\n }, [selectedBox, ptCtx.mainViewInstance]);\n\n const PointCloud3DTitle = (\n <div>\n <span style={{ marginRight: 8 }}>{t('ShowArrows')}</span>\n <Switch\n size='small'\n checked={showDirection}\n onChange={(showDirection) => {\n setShowDirection(showDirection);\n ptCtx.mainViewInstance?.setShowDirection(showDirection);\n }}\n />\n </div>\n );\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-3d-container')}\n title={t('3DView')}\n toolbar={PointCloud3DTitle}\n style={{\n height:\n currentData.mappingImgList && currentData.mappingImgList?.length > 0 ? '55%' : '100%',\n }}\n >\n <div className={getClassName('point-cloud-3d-content')}>\n <PointCloud3DContext.Provider value={ptCloud3DCtx}>\n <PointCloud3DSideBar />\n </PointCloud3DContext.Provider>\n <div className={getClassName('point-cloud-3d-view')} id={pointCloudID} ref={ref} />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(PointCloud3D);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,YAAe,GAAA,qBAAA,CAAA;AACrB,MAAM,mBAAA,GAAsB,MAAM,aAK/B,CAAA;AAAA,EACD,QAAU,EAAA,KAAA;AAAA,EACV,iBAAiB,MAAM;AAAA,GAAA;AAAA,EACvB,aAAa,MAAM;AAAA,GAAA;AAAA,EACnB,eAAe,MAAM;AAAA,GAAA;AAAA,CAAA,CAAA,CAAA;AAGvB,MAAM,qBAAqB,CAAC;AAAA,EAC1B,eAAA;AAAA,CAGI,KAAA;AACJ,EAAM,MAAA,CAAE,QAAU,EAAA,eAAA,CAAA,GAAoB,UAAW,CAAA,mBAAA,CAAA,CAAA;AAEjD,EAAM,MAAA,wBAAA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A;AAAA,IAAK,WAAW,YAAa,CAAA,qBAAA,CAAA;AAAA,IAAwB,EAAI,EAAA,YAAA;AAAA,IAAc,GAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAM/E,uBAAe,QAAQ,iBAAmB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,YAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as $}from"./PointCloudContext.js";import{useRotate as J}from"./hooks/useRotate.js";import{useBoxes as Q}from"./hooks/useBoxes.js";import{useSingleBox as X}from"./hooks/useSingleBox.js";import{useContext as Z,useEffect as d}from"react";import{CommonToolUtils as ee,AttributeUtils as te,EToolName as
|
|
1
|
+
import{PointCloudContext as $}from"./PointCloudContext.js";import{useRotate as J}from"./hooks/useRotate.js";import{useBoxes as Q}from"./hooks/useBoxes.js";import{useSingleBox as X}from"./hooks/useSingleBox.js";import{useContext as Z,useEffect as d}from"react";import{CommonToolUtils as ee,AttributeUtils as te,EToolName as m,cTool as oe}from"@labelbee/lb-annotation";import{message as v}from"antd";import{connect as re}from"react-redux";import{a2MapStateToProps as se}from"../../store/annotation/map.js";import{useCustomToolInstance as ne}from"../../hooks/annotation.js";import{useStatus as ae}from"./hooks/useStatus.js";import{jsonParser as ie}from"../../utils/index.js";import{usePointCloudViews as ue}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as le}from"../../store/ctx.js";import{useHistory as ce}from"./hooks/useHistory.js";import{useAttribute as de}from"./hooks/useAttribute.js";import{useConfig as pe}from"./hooks/useConfig.js";import{usePolygon as fe}from"./hooks/usePolygon.js";import{useTranslation as me}from"react-i18next";var be=Object.defineProperty,Pe=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,O=(i,r,n)=>r in i?be(i,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[r]=n,V=(i,r)=>{for(var n in r||(r={}))ve.call(r,n)&&O(i,n,r[n]);if(S)for(var n of S(r))we.call(r,n)&&O(i,n,r[n]);return i},I=(i,r)=>Pe(i,ye(r));const{EPolygonPattern:Ce}=oe,xe=({currentData:i,config:r,checkMode:n,configString:A,imgIndex:w})=>{const o=Z($),{changeSelectedBoxValid:j,selectNextBox:L,selectPrevBox:D,updateSelectedBox:C,deleteSelectedPointCloudBoxAndPolygon:E}=X(),{clearAllResult:b,updatePointCloudPattern:R}=ae(),T=ie(i.result),{copySelectedBoxes:K,pasteSelectedBoxes:N,copiedBoxes:H}=Q({config:r}),{toolInstanceRef:a}=ne({basicInfo:T}),{updateRotate:P}=J({currentData:i}),{updatePointCloudData:x,topViewSelectedChanged:U}=ue(),{redo:g,undo:k,pushHistoryWithList:z,pushHistoryUnderUpdatePolygon:F}=ce(),{syncThreeViewsAttribute:h}=de(),{syncAllViewsConfig:q,reRenderTopViewRange:G}=pe(),{selectedPolygon:_}=fe(),{t:y}=me(),f=e=>{var t;const{topViewInstance:s}=o;!s||(t=s.pointCloud2dOperation)==null||t.updateSelectedPolygonsPoints(e)},M=(e,t)=>{var s;const{topViewInstance:u,mainViewInstance:l}=o;if(!u)return;const{pointCloud2dOperation:c}=u;switch(e){case"q":{P(2);break}case"e":P(-2);break;case"g":P(180);break;case"u":{const p=c.pattern===Ce.Normal?m.Rect:m.Polygon;R(p);const Y={[m.Polygon]:y("PolygonPattern"),[m.Rect]:y("RectPattern")};v.success(y("ChangePatternMsg",{pattern:Y[p]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":l==null||l.updatePointSize(!0);break;case"-":l==null||l.updatePointSize(!1);break;case"v":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){D();break}L(),t.preventDefault();break;case"f":j();break;case"arrowup":f({y:-1});break;case"arrowdown":f({y:1});break;case"arrowleft":f({x:-1});break;case"arrowright":f({x:1});break;case"delete":E();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const p=te.getAttributeByKeycode(t.keyCode,r.attributeList);p!==void 0&&a.current.setDefaultAttribute(p)}return}}},W=(e,t)=>{switch(e){case"c":K();break;case"v":N();break;case"a":t.preventDefault(),o.selectedAllBoxes();break;case"z":{t.shiftKey?g():k();break}}},B=e=>{if(!ee.hotkeyFilter(e)||n===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){W(t,e);return}M(t,e)};return d(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}},[o,H,r,o.pointCloudBoxList,o.polygonList]),d(()=>{q(r)},[A]),d(()=>{(r==null?void 0:r.radius)&&G(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),d(()=>{x==null||x()},[w,o.mainViewInstance]),d(()=>{o.setHideAttributes([])},[w]),d(()=>{a.current.exportData=()=>[o.pointCloudBoxList,{valid:o.valid}],a.current.exportCustomData=()=>{var e;return{resultPolygon:(e=o.polygonList)!=null?e:[]}},a.current.setDefaultAttribute=e=>{h(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=C(t);o.mainViewInstance&&U(t,s)}_&&F(I(V({},_),{attribute:e}))},a.current.setSubAttribute=(e,t)=>{var s;const u=o.selectedPointCloudBox;if(u){const l=(s=u==null?void 0:u.subAttribute)!=null?s:{};u.subAttribute=I(V({},l),{[e]:t}),C(u)}},a.current.clearResult=()=>{b==null||b()},a.current.redo=()=>{g()},a.current.undo=()=>{k()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&b()})},a.current.setForbidOperation=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setForbidOperation(e),e===!0&&o.setSelectedIDs(void 0)},a.current.setShowDefaultCursor=e=>{var t,s;(s=(t=o.topViewInstance)==null?void 0:t.pointCloud2dOperation)==null||s.setShowDefaultCursor(e)}},[o.pointCloudBoxList,o.selectedID,o.valid,o.polygonList,o.mainViewInstance]),d(()=>{a.current.history={pushHistory:e=>{z({pointCloudBoxList:e})},initRecord:()=>{}}},[]),d(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||n)return;const s=c=>{h(c)},u=c=>{v.error(c)},l=c=>{v.info(c)};return t.on("syncAttribute",s),t.on("messageError",u),t.on("messageInfo",l),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",u),t.unbind("messageInfo",l)}},[o.topViewInstance]),null};var ge=re(se,null,null,{context:le})(xe);export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudListener.js","sources":["../../../src/components/pointCloudView/PointCloudListener.tsx"],"sourcesContent":["import { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useBoxes } from './hooks/useBoxes';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport React, { useContext, useEffect } from 'react';\nimport { cTool, AttributeUtils, CommonToolUtils, EToolName } from '@labelbee/lb-annotation';\nimport { message } from 'antd';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { useCustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from './hooks/useStatus';\nimport { jsonParser } from '@/utils';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { LabelBeeContext } from '@/store/ctx';\nimport { useHistory } from './hooks/useHistory';\nimport { useAttribute } from './hooks/useAttribute';\nimport { ICoordinate } from '@labelbee/lb-utils/dist/types/types/common';\nimport { useConfig } from './hooks/useConfig';\nimport { usePolygon } from './hooks/usePolygon';\nimport { useTranslation } from 'react-i18next';\n\nconst { EPolygonPattern } = cTool;\n\ninterface IProps extends IA2MapStateProps {\n checkMode?: boolean;\n}\n\nconst PointCloudListener: React.FC<IProps> = ({\n currentData,\n config,\n checkMode,\n configString,\n imgIndex,\n}) => {\n const ptCtx = useContext(PointCloudContext);\n const {\n changeSelectedBoxValid,\n selectNextBox,\n selectPrevBox,\n updateSelectedBox,\n deleteSelectedPointCloudBoxAndPolygon,\n } = useSingleBox();\n const { clearAllResult, updatePointCloudPattern } = useStatus();\n const basicInfo = jsonParser(currentData.result);\n const { copySelectedBoxes, pasteSelectedBoxes, copiedBoxes } = useBoxes({ config });\n const { toolInstanceRef } = useCustomToolInstance({ basicInfo });\n const { updateRotate } = useRotate({ currentData });\n const { updatePointCloudData, topViewSelectedChanged } = usePointCloudViews();\n const { redo, undo, pushHistoryWithList, pushHistoryUnderUpdatePolygon } = useHistory();\n const { syncThreeViewsAttribute } = useAttribute();\n const { syncAllViewsConfig, reRenderTopViewRange } = useConfig();\n const { selectedPolygon } = usePolygon();\n const { t } = useTranslation();\n\n const updatePolygonOffset = (offset: Partial<ICoordinate>) => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n topViewInstance.pointCloud2dOperation?.updateSelectedPolygonsPoints(offset);\n };\n\n const keydownEvents = (lowerCaseKey: string, e: KeyboardEvent) => {\n const { topViewInstance, mainViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopPointCloudPolygonOperation } = topViewInstance;\n\n switch (lowerCaseKey) {\n case 'q': {\n // Q - anticlockwise\n updateRotate(2);\n break;\n }\n\n case 'e':\n // E - closewise\n updateRotate(-2);\n\n break;\n\n case 'g':\n // G , overturn 180\n updateRotate(180);\n\n break;\n\n case 'u':\n {\n // U , change TopOpereation Pattern\n const newToolName =\n TopPointCloudPolygonOperation.pattern === EPolygonPattern.Normal\n ? EToolName.Rect\n : EToolName.Polygon;\n updatePointCloudPattern(newToolName);\n\n // Tips\n const POLYGON_PATTERN = {\n [EToolName.Polygon]: t('PolygonPattern'),\n [EToolName.Rect]: t('RectPattern'),\n };\n message.success(t('ChangePatternMsg', { pattern: POLYGON_PATTERN[newToolName] }));\n\n // Clear Status\n TopPointCloudPolygonOperation.clearActiveStatus();\n TopPointCloudPolygonOperation.clearDrawingStatus();\n }\n\n break;\n\n // +: Increase points size\n case '+':\n mainViewInstance?.updatePointSize(true);\n break;\n\n // -: Reduce points size\n case '-':\n mainViewInstance?.updatePointSize(false);\n break;\n\n case 'v':\n ptCtx.setPointCloudValid(!ptCtx.valid);\n break;\n\n case 'tab':\n if (e.shiftKey) {\n selectPrevBox();\n break;\n }\n selectNextBox();\n e.preventDefault();\n break;\n\n case 'f':\n changeSelectedBoxValid();\n break;\n\n case 'arrowup':\n updatePolygonOffset({ y: -1 });\n break;\n\n case 'arrowdown':\n updatePolygonOffset({ y: 1 });\n break;\n\n case 'arrowleft':\n updatePolygonOffset({ x: -1 });\n break;\n\n case 'arrowright':\n updatePolygonOffset({ x: 1 });\n break;\n\n case 'delete':\n deleteSelectedPointCloudBoxAndPolygon();\n break;\n\n default: {\n if (config.attributeList?.length > 0) {\n const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(\n e.keyCode,\n config.attributeList,\n );\n\n if (keyCode2Attribute !== undefined) {\n toolInstanceRef.current.setDefaultAttribute(keyCode2Attribute);\n }\n }\n return;\n }\n }\n };\n\n const ctrlKeydownEvents = (lowerCaseKey: string, e: KeyboardEvent) => {\n switch (lowerCaseKey) {\n case 'c':\n copySelectedBoxes();\n break;\n case 'v':\n pasteSelectedBoxes();\n break;\n case 'a':\n ptCtx.selectedAllBoxes();\n break;\n case 'z': {\n if (e.shiftKey) {\n redo();\n } else {\n undo();\n }\n break;\n }\n\n default:\n break;\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (!CommonToolUtils.hotkeyFilter(e) || checkMode === true) {\n return;\n }\n\n const lowerCaseKey = e.key.toLocaleLowerCase();\n\n if (e.ctrlKey) {\n ctrlKeydownEvents(lowerCaseKey, e);\n return;\n }\n\n keydownEvents(lowerCaseKey, e);\n };\n\n useEffect(() => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n window.addEventListener('keydown', onKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [ptCtx, copiedBoxes, config, ptCtx.pointCloudBoxList, ptCtx.polygonList]);\n\n useEffect(() => {\n syncAllViewsConfig(config);\n }, [configString]);\n\n useEffect(() => {\n if (config?.radius) {\n reRenderTopViewRange(config?.radius);\n }\n }, [config?.radius]);\n\n // Page switch data initialization\n useEffect(() => {\n updatePointCloudData?.();\n }, [imgIndex, ptCtx.mainViewInstance]);\n\n useEffect(() => {\n ptCtx.setHideAttributes([]);\n }, [imgIndex]);\n\n // Update the listener of toolInstance.\n useEffect(() => {\n toolInstanceRef.current.exportData = () => {\n return [ptCtx.pointCloudBoxList, { valid: ptCtx.valid }];\n };\n\n toolInstanceRef.current.exportCustomData = () => {\n return {\n resultPolygon: ptCtx.polygonList ?? [],\n };\n };\n\n toolInstanceRef.current.setDefaultAttribute = (newAttribute: string) => {\n syncThreeViewsAttribute(newAttribute);\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n selectBox.attribute = newAttribute;\n\n const newPointCloudList = updateSelectedBox(selectBox);\n\n if (ptCtx.mainViewInstance) {\n // TODO: Poor performance.\n topViewSelectedChanged(selectBox, newPointCloudList);\n }\n }\n if (selectedPolygon) {\n pushHistoryUnderUpdatePolygon({ ...selectedPolygon, attribute: newAttribute });\n }\n };\n\n toolInstanceRef.current.setSubAttribute = (key: string, value: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n const originSubAttribute = selectBox?.subAttribute ?? {};\n\n selectBox.subAttribute = {\n ...originSubAttribute,\n [key]: value,\n };\n\n updateSelectedBox(selectBox);\n }\n };\n toolInstanceRef.current.clearResult = () => {\n clearAllResult?.();\n };\n\n toolInstanceRef.current.redo = () => {\n redo();\n };\n\n toolInstanceRef.current.undo = () => {\n undo();\n };\n\n toolInstanceRef.current.setValid = (valid: boolean) => {\n toolInstanceRef.current.valid = valid;\n\n // Avoid triggering SetState operations in the reducer phase\n setTimeout(() => {\n ptCtx.setPointCloudValid(valid);\n\n if (valid === false) {\n clearAllResult();\n }\n });\n };\n\n /**\n * TopView forbid all operations.\n * @param forbidOperation\n */\n toolInstanceRef.current.setForbidOperation = (forbidOperation: boolean) => {\n ptCtx.topViewInstance?.pointCloud2dOperation?.setForbidOperation(forbidOperation);\n if (forbidOperation === true) {\n // Clear Selected Status.\n ptCtx.setSelectedIDs(undefined);\n }\n };\n\n toolInstanceRef.current.setShowDefaultCursor = (showDefaultCursor: boolean) => {\n ptCtx.topViewInstance?.pointCloud2dOperation?.setShowDefaultCursor(showDefaultCursor);\n };\n }, [\n ptCtx.pointCloudBoxList,\n ptCtx.selectedID,\n ptCtx.valid,\n ptCtx.polygonList,\n ptCtx.mainViewInstance,\n ]);\n\n useEffect(() => {\n toolInstanceRef.current.history = {\n // Origin Result\n pushHistory: (result: any[]) => {\n // Rewrite\n // TODO, The polygon is out of range.\n pushHistoryWithList({ pointCloudBoxList: result });\n },\n initRecord: () => {},\n };\n }, []);\n\n useEffect(() => {\n const toolInstance = ptCtx.topViewInstance?.pointCloud2dOperation;\n\n if (!toolInstance || checkMode) {\n return;\n }\n // TopViewOperation Emitter\n const syncAttribute = (newAttribute: string) => {\n syncThreeViewsAttribute(newAttribute);\n };\n\n const messageError = (error: string) => {\n message.error(error);\n };\n const messageInfo = (info: string) => {\n message.info(info);\n };\n\n toolInstance.on('syncAttribute', syncAttribute);\n toolInstance.on('messageError', messageError);\n toolInstance.on('messageInfo', messageInfo);\n\n return () => {\n toolInstance.unbind('syncAttribute', syncAttribute);\n toolInstance.unbind('messageError', messageError);\n toolInstance.unbind('messageInfo', messageInfo);\n };\n }, [ptCtx.topViewInstance]);\n\n return null;\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudListener,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAM5B,MAAM,qBAAuC,CAAC;AAAA,EAC5C,WAAA;AAAA,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AAO,OAAA,IAAA,CAAA;AAAA,CAAA,CAAA;AAGT,2BAAe,QAAQ,iBAAmB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC/D,CAAA,CAAA,CAAA,kBAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"PointCloudListener.js","sources":["../../../src/components/pointCloudView/PointCloudListener.tsx"],"sourcesContent":["import { PointCloudContext } from './PointCloudContext';\nimport { useRotate } from './hooks/useRotate';\nimport { useBoxes } from './hooks/useBoxes';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport React, { useContext, useEffect } from 'react';\nimport { cTool, AttributeUtils, CommonToolUtils, EToolName } from '@labelbee/lb-annotation';\nimport { message } from 'antd';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { useCustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from './hooks/useStatus';\nimport { jsonParser } from '@/utils';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { LabelBeeContext } from '@/store/ctx';\nimport { useHistory } from './hooks/useHistory';\nimport { useAttribute } from './hooks/useAttribute';\nimport { ICoordinate } from '@labelbee/lb-utils/dist/types/types/common';\nimport { useConfig } from './hooks/useConfig';\nimport { usePolygon } from './hooks/usePolygon';\nimport { useTranslation } from 'react-i18next';\n\nconst { EPolygonPattern } = cTool;\n\ninterface IProps extends IA2MapStateProps {\n checkMode?: boolean;\n}\n\nconst PointCloudListener: React.FC<IProps> = ({\n currentData,\n config,\n checkMode,\n configString,\n imgIndex,\n}) => {\n const ptCtx = useContext(PointCloudContext);\n const {\n changeSelectedBoxValid,\n selectNextBox,\n selectPrevBox,\n updateSelectedBox,\n deleteSelectedPointCloudBoxAndPolygon,\n } = useSingleBox();\n const { clearAllResult, updatePointCloudPattern } = useStatus();\n const basicInfo = jsonParser(currentData.result);\n const { copySelectedBoxes, pasteSelectedBoxes, copiedBoxes } = useBoxes({ config });\n const { toolInstanceRef } = useCustomToolInstance({ basicInfo });\n const { updateRotate } = useRotate({ currentData });\n const { updatePointCloudData, topViewSelectedChanged } = usePointCloudViews();\n const { redo, undo, pushHistoryWithList, pushHistoryUnderUpdatePolygon } = useHistory();\n const { syncThreeViewsAttribute } = useAttribute();\n const { syncAllViewsConfig, reRenderTopViewRange } = useConfig();\n const { selectedPolygon } = usePolygon();\n const { t } = useTranslation();\n\n const updatePolygonOffset = (offset: Partial<ICoordinate>) => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n topViewInstance.pointCloud2dOperation?.updateSelectedPolygonsPoints(offset);\n };\n\n const keydownEvents = (lowerCaseKey: string, e: KeyboardEvent) => {\n const { topViewInstance, mainViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation: TopPointCloudPolygonOperation } = topViewInstance;\n\n switch (lowerCaseKey) {\n case 'q': {\n // Q - anticlockwise\n updateRotate(2);\n break;\n }\n\n case 'e':\n // E - closewise\n updateRotate(-2);\n\n break;\n\n case 'g':\n // G , overturn 180\n updateRotate(180);\n\n break;\n\n case 'u':\n {\n // U , change TopOpereation Pattern\n const newToolName =\n TopPointCloudPolygonOperation.pattern === EPolygonPattern.Normal\n ? EToolName.Rect\n : EToolName.Polygon;\n updatePointCloudPattern(newToolName);\n\n // Tips\n const POLYGON_PATTERN = {\n [EToolName.Polygon]: t('PolygonPattern'),\n [EToolName.Rect]: t('RectPattern'),\n };\n message.success(t('ChangePatternMsg', { pattern: POLYGON_PATTERN[newToolName] }));\n\n // Clear Status\n TopPointCloudPolygonOperation.clearActiveStatus();\n TopPointCloudPolygonOperation.clearDrawingStatus();\n }\n\n break;\n\n // +: Increase points size\n case '+':\n mainViewInstance?.updatePointSize(true);\n break;\n\n // -: Reduce points size\n case '-':\n mainViewInstance?.updatePointSize(false);\n break;\n\n case 'v':\n ptCtx.setPointCloudValid(!ptCtx.valid);\n break;\n\n case 'tab':\n if (e.shiftKey) {\n selectPrevBox();\n break;\n }\n selectNextBox();\n e.preventDefault();\n break;\n\n case 'f':\n changeSelectedBoxValid();\n break;\n\n case 'arrowup':\n updatePolygonOffset({ y: -1 });\n break;\n\n case 'arrowdown':\n updatePolygonOffset({ y: 1 });\n break;\n\n case 'arrowleft':\n updatePolygonOffset({ x: -1 });\n break;\n\n case 'arrowright':\n updatePolygonOffset({ x: 1 });\n break;\n\n case 'delete':\n deleteSelectedPointCloudBoxAndPolygon();\n break;\n\n default: {\n if (config.attributeList?.length > 0) {\n const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(\n e.keyCode,\n config.attributeList,\n );\n\n if (keyCode2Attribute !== undefined) {\n toolInstanceRef.current.setDefaultAttribute(keyCode2Attribute);\n }\n }\n return;\n }\n }\n };\n\n const ctrlKeydownEvents = (lowerCaseKey: string, e: KeyboardEvent) => {\n switch (lowerCaseKey) {\n case 'c':\n copySelectedBoxes();\n break;\n case 'v':\n pasteSelectedBoxes();\n break;\n case 'a':\n e.preventDefault();\n ptCtx.selectedAllBoxes();\n break;\n case 'z': {\n if (e.shiftKey) {\n redo();\n } else {\n undo();\n }\n break;\n }\n\n default:\n break;\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (!CommonToolUtils.hotkeyFilter(e) || checkMode === true) {\n return;\n }\n\n const lowerCaseKey = e.key.toLocaleLowerCase();\n\n if (e.ctrlKey) {\n ctrlKeydownEvents(lowerCaseKey, e);\n return;\n }\n\n keydownEvents(lowerCaseKey, e);\n };\n\n useEffect(() => {\n const { topViewInstance } = ptCtx;\n if (!topViewInstance) {\n return;\n }\n\n window.addEventListener('keydown', onKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [ptCtx, copiedBoxes, config, ptCtx.pointCloudBoxList, ptCtx.polygonList]);\n\n useEffect(() => {\n syncAllViewsConfig(config);\n }, [configString]);\n\n useEffect(() => {\n if (config?.radius) {\n reRenderTopViewRange(config?.radius);\n }\n }, [config?.radius]);\n\n // Page switch data initialization\n useEffect(() => {\n updatePointCloudData?.();\n }, [imgIndex, ptCtx.mainViewInstance]);\n\n useEffect(() => {\n ptCtx.setHideAttributes([]);\n }, [imgIndex]);\n\n // Update the listener of toolInstance.\n useEffect(() => {\n toolInstanceRef.current.exportData = () => {\n return [ptCtx.pointCloudBoxList, { valid: ptCtx.valid }];\n };\n\n toolInstanceRef.current.exportCustomData = () => {\n return {\n resultPolygon: ptCtx.polygonList ?? [],\n };\n };\n\n toolInstanceRef.current.setDefaultAttribute = (newAttribute: string) => {\n syncThreeViewsAttribute(newAttribute);\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n selectBox.attribute = newAttribute;\n\n const newPointCloudList = updateSelectedBox(selectBox);\n\n if (ptCtx.mainViewInstance) {\n // TODO: Poor performance.\n topViewSelectedChanged(selectBox, newPointCloudList);\n }\n }\n if (selectedPolygon) {\n pushHistoryUnderUpdatePolygon({ ...selectedPolygon, attribute: newAttribute });\n }\n };\n\n toolInstanceRef.current.setSubAttribute = (key: string, value: string) => {\n const selectBox = ptCtx.selectedPointCloudBox;\n if (selectBox) {\n const originSubAttribute = selectBox?.subAttribute ?? {};\n\n selectBox.subAttribute = {\n ...originSubAttribute,\n [key]: value,\n };\n\n updateSelectedBox(selectBox);\n }\n };\n toolInstanceRef.current.clearResult = () => {\n clearAllResult?.();\n };\n\n toolInstanceRef.current.redo = () => {\n redo();\n };\n\n toolInstanceRef.current.undo = () => {\n undo();\n };\n\n toolInstanceRef.current.setValid = (valid: boolean) => {\n toolInstanceRef.current.valid = valid;\n\n // Avoid triggering SetState operations in the reducer phase\n setTimeout(() => {\n ptCtx.setPointCloudValid(valid);\n\n if (valid === false) {\n clearAllResult();\n }\n });\n };\n\n /**\n * TopView forbid all operations.\n * @param forbidOperation\n */\n toolInstanceRef.current.setForbidOperation = (forbidOperation: boolean) => {\n ptCtx.topViewInstance?.pointCloud2dOperation?.setForbidOperation(forbidOperation);\n if (forbidOperation === true) {\n // Clear Selected Status.\n ptCtx.setSelectedIDs(undefined);\n }\n };\n\n toolInstanceRef.current.setShowDefaultCursor = (showDefaultCursor: boolean) => {\n ptCtx.topViewInstance?.pointCloud2dOperation?.setShowDefaultCursor(showDefaultCursor);\n };\n }, [\n ptCtx.pointCloudBoxList,\n ptCtx.selectedID,\n ptCtx.valid,\n ptCtx.polygonList,\n ptCtx.mainViewInstance,\n ]);\n\n useEffect(() => {\n toolInstanceRef.current.history = {\n // Origin Result\n pushHistory: (result: any[]) => {\n // Rewrite\n // TODO, The polygon is out of range.\n pushHistoryWithList({ pointCloudBoxList: result });\n },\n initRecord: () => {},\n };\n }, []);\n\n useEffect(() => {\n const toolInstance = ptCtx.topViewInstance?.pointCloud2dOperation;\n\n if (!toolInstance || checkMode) {\n return;\n }\n // TopViewOperation Emitter\n const syncAttribute = (newAttribute: string) => {\n syncThreeViewsAttribute(newAttribute);\n };\n\n const messageError = (error: string) => {\n message.error(error);\n };\n const messageInfo = (info: string) => {\n message.info(info);\n };\n\n toolInstance.on('syncAttribute', syncAttribute);\n toolInstance.on('messageError', messageError);\n toolInstance.on('messageInfo', messageInfo);\n\n return () => {\n toolInstance.unbind('syncAttribute', syncAttribute);\n toolInstance.unbind('messageError', messageError);\n toolInstance.unbind('messageInfo', messageInfo);\n };\n }, [ptCtx.topViewInstance]);\n\n return null;\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudListener,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAM5B,MAAM,qBAAuC,CAAC;AAAA,EAC5C,WAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,CACI,KAAA;AACJ,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAM,MAAA;AAAA,IACJ,sBAAA;AAAA,IACA,aAAA;AAAA,IAC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}
|
package/es/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as
|
|
1
|
+
import{PointCloudContext as p}from"../../../../components/pointCloudView/PointCloudContext.js";import{Modal as w}from"antd";import t,{useContext as f,useMemo as A,useEffect as D,useState as H}from"react";import{stepConfigSelector as O}from"../../../../store/annotation/selectors.js";import{useSelector as h}from"../../../../store/ctx.js";import{i18n as b}from"@labelbee/lb-utils";import{UnorderedListOutlined as P,PushpinFilled as x,EyeInvisibleFilled as V,EyeFilled as _,CaretDownFilled as $,DeleteOutlined as G}from"@ant-design/icons";import{useHistory as T}from"../../../../components/pointCloudView/hooks/useHistory.js";import{getClassName as s}from"../../../../utils/dom.js";import U from"../../../../utils/StepUtils.js";import{EPointCloudName as M}from"@labelbee/lb-annotation";import{useTranslation as k}from"react-i18next";import K from"../FooterPopover.js";const W=({attribute:n})=>{const u=f(p),{pointCloudBoxList:r,hideAttributes:o,toggleAttributesVisible:i,polygonList:l,setPolygonList:m,setPointCloudResult:d,reRender:a}=u,[g,F]=H(!0),{pushHistoryWithList:N}=T(),L=[...r,...l].filter(e=>e.attribute===n.value),v=()=>{i(n.value)},B=o.includes(n.value),R=({trackID:e,order:c})=>e||c,j=({trackID:e,order:c})=>e?`trackID_${e}`:`order_${c}`,S=e=>{if(L.length===0)return;const c=l.filter(y=>e!==y.attribute),E=r.filter(y=>e!==y.attribute);a(E,c),m(c),d(E),N({pointCloudBoxList:E,polygonList:c})},I=e=>{w.confirm({content:b.t("onDeleteGraphByAttr",{attribute:e.key}),onOk:()=>{S(e.value)},okText:b.t("Confirm"),cancelText:b.t("Cancel")})};return t.createElement(t.Fragment,null,t.createElement("div",{className:s("annotated-attribute","item")},B?t.createElement(V,{onClick:v}):t.createElement(_,{onClick:v}),t.createElement($,{rotate:g?0:270,onClick:()=>{F(!g)}}),t.createElement("span",{className:s("annotated-attribute","item","text")},n.key),t.createElement(G,{onClick:()=>I(n)})),g&&L.map(e=>t.createElement("div",{key:j(e),style:{paddingLeft:54}},`${R(e)}.${n.key}`)))},C=()=>{const n=h(O),{attrPanelLayout:u,setAttrPanelLayout:r,pointCloudBoxList:o,polygonList:i}=f(p),{t:l}=k(),m=A(()=>[...o,...i].map(a=>a.attribute),[o,i]),d=A(()=>n.attributeList.filter(a=>m.includes(a.value)),[m]);return D(()=>{console.log(o)},[o]),console.log(o,i,m,d),t.createElement("div",{className:s("annotated-attribute")},u?t.createElement("div",{className:s("annotated-attribute","text")},t.createElement("span",null,l("AnnotatedResult")),t.createElement("span",{className:s("annotated-attribute","pin"),onClick:()=>{r("")}},t.createElement(x,null),l("CancelFixed"))):t.createElement("div",{className:s("annotated-attribute","text")},t.createElement("span",{onClick:()=>{r("left")},className:s("annotated-attribute","pin")},t.createElement(x,null),l("FixedOnLeft")),t.createElement("span",{onClick:()=>{r("right")},className:s("annotated-attribute","pin")},t.createElement(x,null),l("FixedOnRight"))),t.createElement("div",null,d.length>0?d.map(a=>t.createElement(W,{attribute:a,key:a.value})):t.createElement("div",{style:{textAlign:"center",height:200,lineHeight:"200px"}},l("NoData"))))},q=()=>{const{attrPanelLayout:n}=f(p);return n==="left"?t.createElement(C,null):null},z=()=>{const{attrPanelLayout:n}=f(p);return n==="right"?t.createElement(C,null):null},J=()=>{const{attrPanelLayout:n}=f(p),{t:u}=k(),r=h(o=>{var i,l;return U.getCurrentStepInfo((i=o==null?void 0:o.annotation)==null?void 0:i.step,(l=o.annotation)==null?void 0:l.stepList)});return(r==null?void 0:r.tool)!==M.PointCloud||n?null:t.createElement(K,{hoverIcon:t.createElement(P,{style:{marginRight:4}}),icon:t.createElement(P,{style:{marginRight:4}}),title:u("AnnotatedList"),content:t.createElement(C,null)})};export{J as AnnotatedAttributesIcon,C as AnnotatedAttributesPanel,q as AnnotatedAttributesPanelFixedLeft,z as AnnotatedAttributesPanelFixedRight};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/toolFooter/AnnotatedAttributes/index.tsx"],"sourcesContent":["import { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { Modal } from 'antd';\nimport React, { useContext, useState } from 'react';\nimport { stepConfigSelector } from '@/store/annotation/selectors';\nimport { useSelector } from '@/store/ctx';\nimport { i18n, IPointCloudConfig } from '@labelbee/lb-utils';\nimport {\n CaretDownFilled,\n DeleteOutlined,\n EyeFilled,\n EyeInvisibleFilled,\n PushpinFilled,\n UnorderedListOutlined,\n} from '@ant-design/icons';\nimport { IInputList } from '@/types/main';\nimport { useHistory } from '@/components/pointCloudView/hooks/useHistory';\nimport { getClassName } from '@/utils/dom';\nimport StepUtils from '@/utils/StepUtils';\nimport { EPointCloudName } from '@labelbee/lb-annotation';\nimport { useTranslation } from 'react-i18next';\nimport FooterPopover from '../FooterPopover';\n\nconst AnnotatedAttributesItem = ({ attribute }: { attribute: IInputList }) => {\n const pointCloudCtx = useContext(PointCloudContext);\n const { t } = useTranslation();\n const {\n pointCloudBoxList,\n hideAttributes,\n toggleAttributesVisible,\n polygonList,\n setPolygonList,\n setPointCloudResult,\n reRender,\n } = pointCloudCtx;\n\n const [expanded, setExpanded] = useState(false);\n\n const { pushHistoryWithList } = useHistory();\n\n const pointCloudListForSpecAttribute = [...pointCloudBoxList, ...polygonList].filter(\n (i) => i.attribute === attribute.value,\n );\n\n const onVisibleChange = () => {\n toggleAttributesVisible(attribute.value);\n };\n\n const isHidden = hideAttributes.includes(attribute.value);\n\n const getBoxID = ({ trackID, order }: { trackID?: number; order?: number }) => {\n return trackID ? trackID : order;\n };\n\n const getBoxKey = ({ trackID, order }: { trackID?: number; order?: number }) => {\n return trackID ? `trackID_${trackID}` : `order_${order}`;\n };\n\n const deleteGraphByAttr = (attribute: string) => {\n if (pointCloudListForSpecAttribute.length === 0) {\n return;\n }\n\n const newPolygonList = polygonList.filter((i) => attribute !== i.attribute);\n const newPointCloudList = pointCloudBoxList.filter((i) => attribute !== i.attribute);\n\n reRender(newPointCloudList, newPolygonList);\n\n setPolygonList(newPolygonList);\n setPointCloudResult(newPointCloudList);\n\n pushHistoryWithList({ pointCloudBoxList: newPointCloudList, polygonList: newPolygonList });\n };\n\n const onDeleteGraphByAttr = (attribute: IInputList) => {\n Modal.confirm({\n content: i18n.t('onDeleteGraphByAttr', { attribute: attribute.key }),\n onOk: () => {\n deleteGraphByAttr(attribute.value);\n },\n okText: i18n.t('Confirm'),\n cancelText: i18n.t('Cancel'),\n });\n };\n\n return (\n <>\n <div className={getClassName('annotated-attribute', 'item')}>\n {isHidden ? (\n <EyeInvisibleFilled onClick={onVisibleChange} />\n ) : (\n <EyeFilled onClick={onVisibleChange} />\n )}\n <CaretDownFilled\n rotate={expanded ? 0 : 270}\n onClick={() => {\n setExpanded(!expanded);\n }}\n />\n <span className={getClassName('annotated-attribute', 'item', 'text')}>{attribute.key}</span>\n\n <DeleteOutlined onClick={() => onDeleteGraphByAttr(attribute)} />\n </div>\n\n {expanded &&\n (pointCloudListForSpecAttribute.length > 0 ? (\n pointCloudListForSpecAttribute.map((box) => {\n return (\n <div key={getBoxKey(box)} style={{ paddingLeft: 54 }}>\n {`${getBoxID(box)}.${attribute.key}`}\n </div>\n );\n })\n ) : (\n <div style={{ textAlign: 'center' }}>{t('NoData')}</div>\n ))}\n </>\n );\n};\n\nexport const AnnotatedAttributesPanel = () => {\n const stepConfig: IPointCloudConfig = useSelector(stepConfigSelector);\n const { attrPanelLayout, setAttrPanelLayout } = useContext(PointCloudContext);\n const { t } = useTranslation();\n\n return (\n <div className={getClassName('annotated-attribute')}>\n {attrPanelLayout ? (\n <div className={getClassName('annotated-attribute', 'text')}>\n <span>{t('AnnotatedResult')}</span>\n <span\n className={getClassName('annotated-attribute', 'pin')}\n onClick={() => {\n setAttrPanelLayout('');\n }}\n >\n <PushpinFilled />\n {t('CancelFixed')}\n </span>\n </div>\n ) : (\n <div className={getClassName('annotated-attribute', 'text')}>\n <span\n onClick={() => {\n setAttrPanelLayout('left');\n }}\n className={getClassName('annotated-attribute', 'pin')}\n >\n <PushpinFilled />\n {t('FixedOnLeft')}\n </span>\n <span\n onClick={() => {\n setAttrPanelLayout('right');\n }}\n className={getClassName('annotated-attribute', 'pin')}\n >\n <PushpinFilled />\n {t('FixedOnRight')}\n </span>\n </div>\n )}\n\n <div>\n {stepConfig.attributeList.map((i) => (\n <AnnotatedAttributesItem attribute={i} key={i.value} />\n ))}\n </div>\n </div>\n );\n};\n\nexport const AnnotatedAttributesPanelFixedLeft = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n if (attrPanelLayout === 'left') {\n return <AnnotatedAttributesPanel />;\n }\n\n return null;\n};\n\nexport const AnnotatedAttributesPanelFixedRight = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n\n if (attrPanelLayout === 'right') {\n return <AnnotatedAttributesPanel />;\n }\n\n return null;\n};\n\nexport const AnnotatedAttributesIcon = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n const { t } = useTranslation();\n const stepInfo = useSelector((state) =>\n // @ts-ignore\n StepUtils.getCurrentStepInfo(state?.annotation?.step, state.annotation?.stepList),\n );\n\n if (stepInfo?.tool !== EPointCloudName.PointCloud) {\n return null;\n }\n\n if (attrPanelLayout) {\n return null;\n }\n\n return (\n <FooterPopover\n hoverIcon={<UnorderedListOutlined style={{ marginRight: 4 }} />}\n icon={<UnorderedListOutlined style={{ marginRight: 4 }} />}\n title={t('AnnotatedList')}\n content={<AnnotatedAttributesPanel />}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,uBAAA,GAA0B,CAAC,CAAE,SAA2C,CAAA,KAAA;AAC5E,EAAA,MAAM,gBAAgB,UAAW,CAAA,iBAAA,CAAA,CAAA;AACjC,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AACd,EAAM,MAAA;AAAA,IACJ,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,uBAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA;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AA,EAAO,CAAE,WAAa,EAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IACnD,OAAO,CAAE,CAAA,eAAA,CAAA;AAAA,IACT,OAAA,sCAAU,wBAAD,EAAA,IAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/toolFooter/AnnotatedAttributes/index.tsx"],"sourcesContent":["import { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { Modal } from 'antd';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { stepConfigSelector } from '@/store/annotation/selectors';\nimport { useSelector } from '@/store/ctx';\nimport { i18n, IPointCloudConfig } from '@labelbee/lb-utils';\nimport {\n CaretDownFilled,\n DeleteOutlined,\n EyeFilled,\n EyeInvisibleFilled,\n PushpinFilled,\n UnorderedListOutlined,\n} from '@ant-design/icons';\nimport { IInputList } from '@/types/main';\nimport { useHistory } from '@/components/pointCloudView/hooks/useHistory';\nimport { getClassName } from '@/utils/dom';\nimport StepUtils from '@/utils/StepUtils';\nimport { EPointCloudName } from '@labelbee/lb-annotation';\nimport { useTranslation } from 'react-i18next';\nimport FooterPopover from '../FooterPopover';\n\nconst AnnotatedAttributesItem = ({ attribute }: { attribute: IInputList }) => {\n const pointCloudCtx = useContext(PointCloudContext);\n const {\n pointCloudBoxList,\n hideAttributes,\n toggleAttributesVisible,\n polygonList,\n setPolygonList,\n setPointCloudResult,\n reRender,\n } = pointCloudCtx;\n\n const [expanded, setExpanded] = useState(true);\n\n const { pushHistoryWithList } = useHistory();\n\n const pointCloudListForSpecAttribute = [...pointCloudBoxList, ...polygonList].filter(\n (i) => i.attribute === attribute.value,\n );\n\n const onVisibleChange = () => {\n toggleAttributesVisible(attribute.value);\n };\n\n const isHidden = hideAttributes.includes(attribute.value);\n\n const getBoxID = ({ trackID, order }: { trackID?: number; order?: number }) => {\n return trackID ? trackID : order;\n };\n\n const getBoxKey = ({ trackID, order }: { trackID?: number; order?: number }) => {\n return trackID ? `trackID_${trackID}` : `order_${order}`;\n };\n\n const deleteGraphByAttr = (attribute: string) => {\n if (pointCloudListForSpecAttribute.length === 0) {\n return;\n }\n\n const newPolygonList = polygonList.filter((i) => attribute !== i.attribute);\n const newPointCloudList = pointCloudBoxList.filter((i) => attribute !== i.attribute);\n\n reRender(newPointCloudList, newPolygonList);\n\n setPolygonList(newPolygonList);\n setPointCloudResult(newPointCloudList);\n\n pushHistoryWithList({ pointCloudBoxList: newPointCloudList, polygonList: newPolygonList });\n };\n\n const onDeleteGraphByAttr = (attribute: IInputList) => {\n Modal.confirm({\n content: i18n.t('onDeleteGraphByAttr', { attribute: attribute.key }),\n onOk: () => {\n deleteGraphByAttr(attribute.value);\n },\n okText: i18n.t('Confirm'),\n cancelText: i18n.t('Cancel'),\n });\n };\n\n return (\n <>\n <div className={getClassName('annotated-attribute', 'item')}>\n {isHidden ? (\n <EyeInvisibleFilled onClick={onVisibleChange} />\n ) : (\n <EyeFilled onClick={onVisibleChange} />\n )}\n <CaretDownFilled\n rotate={expanded ? 0 : 270}\n onClick={() => {\n setExpanded(!expanded);\n }}\n />\n <span className={getClassName('annotated-attribute', 'item', 'text')}>{attribute.key}</span>\n\n <DeleteOutlined onClick={() => onDeleteGraphByAttr(attribute)} />\n </div>\n\n {expanded &&\n pointCloudListForSpecAttribute.map((box) => {\n return (\n <div key={getBoxKey(box)} style={{ paddingLeft: 54 }}>\n {`${getBoxID(box)}.${attribute.key}`}\n </div>\n );\n })}\n </>\n );\n};\n\nexport const AnnotatedAttributesPanel = () => {\n const stepConfig: IPointCloudConfig = useSelector(stepConfigSelector);\n const { attrPanelLayout, setAttrPanelLayout, pointCloudBoxList, polygonList } =\n useContext(PointCloudContext);\n const { t } = useTranslation();\n\n const existAttributes = useMemo(() => {\n return [...pointCloudBoxList, ...polygonList].map((i) => i.attribute);\n }, [pointCloudBoxList, polygonList]);\n\n const displayAttrList = useMemo(() => {\n return (stepConfig.attributeList as IInputList[]).filter((i) =>\n existAttributes.includes(i.value),\n );\n }, [existAttributes]);\n\n useEffect(() => {\n console.log(pointCloudBoxList);\n }, [pointCloudBoxList]);\n\n console.log(pointCloudBoxList, polygonList, existAttributes, displayAttrList);\n\n return (\n <div className={getClassName('annotated-attribute')}>\n {attrPanelLayout ? (\n <div className={getClassName('annotated-attribute', 'text')}>\n <span>{t('AnnotatedResult')}</span>\n <span\n className={getClassName('annotated-attribute', 'pin')}\n onClick={() => {\n setAttrPanelLayout('');\n }}\n >\n <PushpinFilled />\n {t('CancelFixed')}\n </span>\n </div>\n ) : (\n <div className={getClassName('annotated-attribute', 'text')}>\n <span\n onClick={() => {\n setAttrPanelLayout('left');\n }}\n className={getClassName('annotated-attribute', 'pin')}\n >\n <PushpinFilled />\n {t('FixedOnLeft')}\n </span>\n <span\n onClick={() => {\n setAttrPanelLayout('right');\n }}\n className={getClassName('annotated-attribute', 'pin')}\n >\n <PushpinFilled />\n {t('FixedOnRight')}\n </span>\n </div>\n )}\n\n <div>\n {displayAttrList.length > 0 ? (\n displayAttrList.map((i) => <AnnotatedAttributesItem attribute={i} key={i.value} />)\n ) : (\n <div style={{ textAlign: 'center', height: 200, lineHeight: '200px' }}>{t('NoData')}</div>\n )}\n </div>\n </div>\n );\n};\n\nexport const AnnotatedAttributesPanelFixedLeft = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n if (attrPanelLayout === 'left') {\n return <AnnotatedAttributesPanel />;\n }\n\n return null;\n};\n\nexport const AnnotatedAttributesPanelFixedRight = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n\n if (attrPanelLayout === 'right') {\n return <AnnotatedAttributesPanel />;\n }\n\n return null;\n};\n\nexport const AnnotatedAttributesIcon = () => {\n const { attrPanelLayout } = useContext(PointCloudContext);\n const { t } = useTranslation();\n const stepInfo = useSelector((state) =>\n // @ts-ignore\n StepUtils.getCurrentStepInfo(state?.annotation?.step, state.annotation?.stepList),\n );\n\n if (stepInfo?.tool !== EPointCloudName.PointCloud) {\n return null;\n }\n\n if (attrPanelLayout) {\n return null;\n }\n\n return (\n <FooterPopover\n hoverIcon={<UnorderedListOutlined style={{ marginRight: 4 }} />}\n icon={<UnorderedListOutlined style={{ marginRight: 4 }} />}\n title={t('AnnotatedList')}\n content={<AnnotatedAttributesPanel />}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,uBAAA,GAA0B,CAAC,CAAE,SAA2C,CAAA,KAAA;AAC5E,EAAA,MAAM,gBAAgB,UAAW,CAAA,iBAAA,CAAA,CAAA;AACjC,EAAM,MAAA;AAAA,IACJ,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,uBAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA;AAAA,IACA,QAAA;AAAA,GACE,GAAA,aAAA,CAAA;AAEJ,EAAM,MAAA,CAAC,QAAU,EAAA,WAAA,CAAA,GAAe,QAAS,CAAA,IAAA,CAAA,CAAA;AAEzC,EAAA,MAAM,CAAE,mBAAwB,CAAA,GAAA,UAAA,EAAA,CAAA;AAEhC,EAAM,MAAA,8BAAA,GAAiC,CAAC,GAAG,iBAAmB,EAAA,GAAG,WAAa,CAAA,CAAA,MAAA,CAC5E,CAAC,CAAA,KAAM,CAAE,CAAA,SAAA,KAAc,SAAU,CAAA,KAAA,CAAA,CAAA;AAGnC,EAAA,MAAM,kBAAkB,MAAM;AAC5B,IAAA,uBAAA,CAAwB,SAAU,CAAA,KAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAGpC,EAAM,MAAA,QAAA,GAAW,cAAe,CAAA,QAAA,CAAS,SAAU,CAAA,KAAA,CAAA,CAAA;AAEnD,EAAA,MAAM,QAAW,GAAA,CAAC,CAAE,OAAA,EAAS,KAAkD,CAAA,KAAA;AAC7E,IAAA,OAAO,UAAU,OAAU,GAAA,KAAA,CAAA;AAAA,GAAA,CAAA;AAG7B,EAAA,MAAM,SAAY,GAAA,CAAC,CAAE,OA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ACnD,OAAO,CAAE,CAAA,eAAA,CAAA;AAAA,IACT,OAAA,sCAAU,wBAAD,EAAA,IAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.9.0-alpha.
|
|
3
|
+
"version": "1.9.0-alpha.3",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ant-design/icons": "^4.6.2",
|
|
44
|
-
"@labelbee/lb-annotation": "^1.13.0-alpha.
|
|
45
|
-
"@labelbee/lb-utils": "^1.6.0-alpha.
|
|
44
|
+
"@labelbee/lb-annotation": "^1.13.0-alpha.3",
|
|
45
|
+
"@labelbee/lb-utils": "^1.6.0-alpha.3",
|
|
46
46
|
"ahooks": "^3.4.0",
|
|
47
47
|
"classnames": "^2.3.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"path": "node_modules/cz-conventional-changelog"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "72e958227d63e56a652f1525bb2e6e7dd33839f0"
|
|
101
101
|
}
|