@labelbee/lb-components 1.8.0-alpha.6 → 1.8.0-alpha.7
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/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +4 -2
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js.map +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js.map +1 -1
- package/package.json +4 -4
|
@@ -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=(n,r,a)=>r in n?__defProp(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a,__spreadValues=(n,r)=>{for(var a in r||(r={}))__hasOwnProp.call(r,a)&&__defNormalProp(n,a,r[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(r))__propIsEnum.call(r,a)&&__defNormalProp(n,a,r[a]);return n},__spreadProps=(n,r)=>__defProps(n,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:n,config:r,checkMode:a,configString:m})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:k,selectNextBox:h,selectPrevBox:_,updateSelectedBox:
|
|
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=(n,r,a)=>r in n?__defProp(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a,__spreadValues=(n,r)=>{for(var a in r||(r={}))__hasOwnProp.call(r,a)&&__defNormalProp(n,a,r[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(r))__propIsEnum.call(r,a)&&__defNormalProp(n,a,r[a]);return n},__spreadProps=(n,r)=>__defProps(n,__getOwnPropDescs(r));const{EPolygonPattern}=lbAnnotation.cTool,PointCloudListener=({currentData:n,config:r,checkMode:a,configString:m})=>{const o=React.useContext(PointCloudContext.PointCloudContext),{changeSelectedBoxValid:k,selectNextBox:h,selectPrevBox:_,updateSelectedBox:P,deleteSelectedPointCloudBoxAndPolygon:B}=useSingleBox.useSingleBox(),{clearAllResult:p,updatePointCloudPattern:S}=useStatus.useStatus(),E=index.jsonParser(n.result),{copySelectedBoxes:I,pasteSelectedBoxes:V,copiedBoxes:A}=useBoxes.useBoxes({config:r}),{toolInstanceRef:i}=annotation.useCustomToolInstance({basicInfo:E}),{updateRotate:v}=useRotate.useRotate({currentData:n}),{updatePointCloudData:f,topViewSelectedChanged:q}=usePointCloudViews.usePointCloudViews(),{redo:y,undo:C,pushHistoryWithList:O,pushHistoryUnderUpdatePolygon:j}=useHistory.useHistory(),{syncThreeViewsAttribute:x}=useAttribute.useAttribute(),{syncAllViewsConfig:L,reRenderTopViewRange:R}=useConfig.useConfig(),{selectedPolygon:w}=usePolygon.usePolygon(),{t:b}=reactI18next.useTranslation(),T=(e,t)=>{var s;const{topViewInstance:u,mainViewInstance:l}=o;if(!u)return;const{pointCloud2dOperation:c}=u;switch(e){case"q":{v(2);break}case"e":v(-2);break;case"g":v(180);break;case"u":{const d=c.pattern===EPolygonPattern.Normal?lbAnnotation.EToolName.Rect:lbAnnotation.EToolName.Polygon;S(d);const N={[lbAnnotation.EToolName.Polygon]:b("PolygonPattern"),[lbAnnotation.EToolName.Rect]:b("RectPattern")};antd.message.success(b("ChangePatternMsg",{pattern:N[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){_();break}h(),t.preventDefault();break;case"f":k();break;case"delete":B();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const d=lbAnnotation.AttributeUtils.getAttributeByKeycode(t.keyCode,r.attributeList);d!==void 0&&i.current.setDefaultAttribute(d)}return}}},D=(e,t)=>{switch(e){case"c":I();break;case"v":V();break;case"a":o.selectedAllBoxes();break;case"z":{t.shiftKey?y():C();break}}},g=e=>{if(!lbAnnotation.CommonToolUtils.hotkeyFilter(e)||a===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){D(t,e);return}T(t,e)};return React.useEffect(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g)}},[o,A,r,o.pointCloudBoxList,o.polygonList]),React.useEffect(()=>{L(r)},[m]),React.useEffect(()=>{(r==null?void 0:r.radius)&&R(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),React.useEffect(()=>{f==null||f()},[n,o.mainViewInstance]),React.useEffect(()=>{i.current.exportData=()=>[o.pointCloudBoxList,{valid:o.valid}],i.current.exportCustomData=()=>{var e;return{resultPolygon:(e=o.polygonList)!=null?e:[]}},i.current.setDefaultAttribute=e=>{x(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=P(t);o.mainViewInstance&&q(t,s)}w&&j(__spreadProps(__spreadValues({},w),{attribute:e}))},i.current.setSubAttribute=(e,t)=>{var s;const u=o.selectedPointCloudBox;if(u){const l=(s=u==null?void 0:u.subAttribute)!=null?s:{};u.subAttribute=__spreadProps(__spreadValues({},l),{[e]:t}),P(u)}},i.current.clearResult=()=>{p==null||p()},i.current.redo=()=>{y()},i.current.undo=()=>{C()},i.current.setValid=e=>{i.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&p()})},i.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)},i.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(()=>{i.current.history={pushHistory:e=>{O({pointCloudBoxList:e})},initRecord:()=>{}}},[]),React.useEffect(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||a)return;const s=c=>{x(c)},u=c=>{antd.message.error(c)},l=c=>{antd.message.info(c)};return t.on("syncAttribute",s),t.on("messageError",u),t.on("messageInfo",l),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",u),t.unbind("messageInfo",l)}},[o.topViewInstance]),null};var PointCloudListener$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudListener);module.exports=PointCloudListener$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),_=require("lodash"),antd=require("antd"),usePointCloudViews=require("./usePointCloudViews.js"),PointCloudContext=require("../PointCloudContext.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);const useBoxes=({config:t})=>{const{selectedIDs:l,pointCloudBoxList:o,setPointCloudResult:C,syncAllViewPointCloudColor:p}=React.useContext(PointCloudContext.PointCloudContext),[s,a]=React.useState([]),{pointCloudBoxListUpdated:c}=usePointCloudViews.usePointCloudViews(),{t:r,i18n:d}=reactI18next.useTranslation(),f=n=>t.trackConfigurable!==!0?!1:o.some(u=>n.some(e=>e.trackID===u.trackID)),i=React.useMemo(()=>o.filter(n=>l.includes(n.id)),[l,o]),x=React.useCallback(()=>{i.length>0?a(___default.default.cloneDeep(i)):(a([]),antd.message.error(r("CopyEmptyInPointCloud")))},[l,o,d.language]),D=React.useCallback(()=>{if(s.length===0){antd.message.error(r("PasteEmptyInPointCloud"));return}const n=f(s),u=e=>{C(e),c==null||c(e),a([]),p(e)};if(n)antd.Modal.confirm({title:r("HasDuplicateIDHeader"),content:r("HasDuplicateIDMsg"),onOk:()=>{const e=o.filter(P=>!s.find(g=>g.trackID===P.trackID)).concat(s);u(e)}});else{const e=[...o,...s];u(e)}},[s,o,d.language]);return{copySelectedBoxes:x,pasteSelectedBoxes:D,copiedBoxes:s,selectedBoxes:i}};exports.useBoxes=useBoxes;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { IPointCloudBoxList } from '@labelbee/lb-utils';
|
|
1
|
+
import { IPointCloudBoxList, IPointCloudConfig } from '@labelbee/lb-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Actions for selected boxes
|
|
4
4
|
*/
|
|
5
|
-
export declare const useBoxes: (
|
|
5
|
+
export declare const useBoxes: ({ config }: {
|
|
6
|
+
config: IPointCloudConfig;
|
|
7
|
+
}) => {
|
|
6
8
|
copySelectedBoxes: () => void;
|
|
7
9
|
pasteSelectedBoxes: () => void;
|
|
8
10
|
copiedBoxes: IPointCloudBoxList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudContext as W}from"./PointCloudContext.js";import{useRotate as Y}from"./hooks/useRotate.js";import{useBoxes as $}from"./hooks/useBoxes.js";import{useSingleBox as J}from"./hooks/useSingleBox.js";import{useContext as Q,useEffect as d}from"react";import{CommonToolUtils as X,AttributeUtils as Z,EToolName as m,cTool as ee}from"@labelbee/lb-annotation";import{message as y}from"antd";import{connect as te}from"react-redux";import{a2MapStateToProps as oe}from"../../store/annotation/map.js";import{useCustomToolInstance as re}from"../../hooks/annotation.js";import{useStatus as se}from"./hooks/useStatus.js";import{jsonParser as ne}from"../../utils/index.js";import{usePointCloudViews as ie}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as ae}from"../../store/ctx.js";import{useHistory as le}from"./hooks/useHistory.js";import{useAttribute as ue}from"./hooks/useAttribute.js";import{useConfig as ce}from"./hooks/useConfig.js";import{usePolygon as de}from"./hooks/usePolygon.js";import{useTranslation as pe}from"react-i18next";var me=Object.defineProperty,fe=Object.defineProperties,be=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,B=(n,r,i)=>r in n?me(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i,S=(n,r)=>{for(var i in r||(r={}))Pe.call(r,i)&&B(n,i,r[i]);if(_)for(var i of _(r))ye.call(r,i)&&B(n,i,r[i]);return n},I=(n,r)=>fe(n,be(r));const{EPolygonPattern:ve}=ee,Ce=({currentData:n,config:r,checkMode:i,configString:V})=>{const o=Q(W),{changeSelectedBoxValid:O,selectNextBox:j,selectPrevBox:A,updateSelectedBox:v,deleteSelectedPointCloudBoxAndPolygon:L}=J(),{clearAllResult:f,updatePointCloudPattern:E}=se(),R=ne(n.result),{copySelectedBoxes:T,pasteSelectedBoxes:D,copiedBoxes:K}=$(),{toolInstanceRef:a}=re({basicInfo:R}),{updateRotate:b}=Y({currentData:n}),{updatePointCloudData:C,topViewSelectedChanged:N}=ie(),{redo:w,undo:x,pushHistoryWithList:H,pushHistoryUnderUpdatePolygon:U}=le(),{syncThreeViewsAttribute:g}=ue(),{syncAllViewsConfig:z,reRenderTopViewRange:F}=ce(),{selectedPolygon:k}=de(),{t:P}=pe(),q=(e,t)=>{var s;const{topViewInstance:l,mainViewInstance:u}=o;if(!l)return;const{pointCloud2dOperation:c}=l;switch(e){case"q":{b(2);break}case"e":b(-2);break;case"g":b(180);break;case"u":{const p=c.pattern===ve.Normal?m.Rect:m.Polygon;E(p);const M={[m.Polygon]:P("PolygonPattern"),[m.Rect]:P("RectPattern")};y.success(P("ChangePatternMsg",{pattern:M[p]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":u==null||u.updatePointSize(!0);break;case"-":u==null||u.updatePointSize(!1);break;case"v":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){A();break}j(),t.preventDefault();break;case"f":O();break;case"delete":L();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const p=Z.getAttributeByKeycode(t.keyCode,r.attributeList);p!==void 0&&a.current.setDefaultAttribute(p)}return}}},G=(e,t)=>{switch(e){case"c":T();break;case"v":D();break;case"a":o.selectedAllBoxes();break;case"z":{t.shiftKey?w():x();break}}},h=e=>{if(!X.hotkeyFilter(e)||i===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){G(t,e);return}q(t,e)};return d(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[o,K,r,o.pointCloudBoxList,o.polygonList]),d(()=>{z(r)},[V]),d(()=>{(r==null?void 0:r.radius)&&F(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),d(()=>{C==null||C()},[n,o.mainViewInstance]),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=>{g(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=v(t);o.mainViewInstance&&N(t,s)}k&&U(I(S({},k),{attribute:e}))},a.current.setSubAttribute=(e,t)=>{var s;const l=o.selectedPointCloudBox;if(l){const u=(s=l==null?void 0:l.subAttribute)!=null?s:{};l.subAttribute=I(S({},u),{[e]:t}),v(l)}},a.current.clearResult=()=>{f==null||f()},a.current.redo=()=>{w()},a.current.undo=()=>{x()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&f()})},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=>{H({pointCloudBoxList:e})},initRecord:()=>{}}},[]),d(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||i)return;const s=c=>{g(c)},l=c=>{y.error(c)},u=c=>{y.info(c)};return t.on("syncAttribute",s),t.on("messageError",l),t.on("messageInfo",u),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",l),t.unbind("messageInfo",u)}},[o.topViewInstance]),null};var we=te(oe,null,null,{context:ae})(Ce);export{we as default};
|
|
1
|
+
import{PointCloudContext as W}from"./PointCloudContext.js";import{useRotate as Y}from"./hooks/useRotate.js";import{useBoxes as $}from"./hooks/useBoxes.js";import{useSingleBox as J}from"./hooks/useSingleBox.js";import{useContext as Q,useEffect as d}from"react";import{CommonToolUtils as X,AttributeUtils as Z,EToolName as m,cTool as ee}from"@labelbee/lb-annotation";import{message as y}from"antd";import{connect as te}from"react-redux";import{a2MapStateToProps as oe}from"../../store/annotation/map.js";import{useCustomToolInstance as re}from"../../hooks/annotation.js";import{useStatus as se}from"./hooks/useStatus.js";import{jsonParser as ne}from"../../utils/index.js";import{usePointCloudViews as ie}from"./hooks/usePointCloudViews.js";import{LabelBeeContext as ae}from"../../store/ctx.js";import{useHistory as le}from"./hooks/useHistory.js";import{useAttribute as ue}from"./hooks/useAttribute.js";import{useConfig as ce}from"./hooks/useConfig.js";import{usePolygon as de}from"./hooks/usePolygon.js";import{useTranslation as pe}from"react-i18next";var me=Object.defineProperty,fe=Object.defineProperties,be=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,B=(n,r,i)=>r in n?me(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i,S=(n,r)=>{for(var i in r||(r={}))Pe.call(r,i)&&B(n,i,r[i]);if(_)for(var i of _(r))ye.call(r,i)&&B(n,i,r[i]);return n},I=(n,r)=>fe(n,be(r));const{EPolygonPattern:ve}=ee,Ce=({currentData:n,config:r,checkMode:i,configString:V})=>{const o=Q(W),{changeSelectedBoxValid:O,selectNextBox:j,selectPrevBox:A,updateSelectedBox:v,deleteSelectedPointCloudBoxAndPolygon:L}=J(),{clearAllResult:f,updatePointCloudPattern:E}=se(),R=ne(n.result),{copySelectedBoxes:T,pasteSelectedBoxes:D,copiedBoxes:K}=$({config:r}),{toolInstanceRef:a}=re({basicInfo:R}),{updateRotate:b}=Y({currentData:n}),{updatePointCloudData:C,topViewSelectedChanged:N}=ie(),{redo:w,undo:x,pushHistoryWithList:H,pushHistoryUnderUpdatePolygon:U}=le(),{syncThreeViewsAttribute:g}=ue(),{syncAllViewsConfig:z,reRenderTopViewRange:F}=ce(),{selectedPolygon:k}=de(),{t:P}=pe(),q=(e,t)=>{var s;const{topViewInstance:l,mainViewInstance:u}=o;if(!l)return;const{pointCloud2dOperation:c}=l;switch(e){case"q":{b(2);break}case"e":b(-2);break;case"g":b(180);break;case"u":{const p=c.pattern===ve.Normal?m.Rect:m.Polygon;E(p);const M={[m.Polygon]:P("PolygonPattern"),[m.Rect]:P("RectPattern")};y.success(P("ChangePatternMsg",{pattern:M[p]})),c.clearActiveStatus(),c.clearDrawingStatus()}break;case"+":u==null||u.updatePointSize(!0);break;case"-":u==null||u.updatePointSize(!1);break;case"v":o.setPointCloudValid(!o.valid);break;case"tab":if(t.shiftKey){A();break}j(),t.preventDefault();break;case"f":O();break;case"delete":L();break;default:{if(((s=r.attributeList)==null?void 0:s.length)>0){const p=Z.getAttributeByKeycode(t.keyCode,r.attributeList);p!==void 0&&a.current.setDefaultAttribute(p)}return}}},G=(e,t)=>{switch(e){case"c":T();break;case"v":D();break;case"a":o.selectedAllBoxes();break;case"z":{t.shiftKey?w():x();break}}},h=e=>{if(!X.hotkeyFilter(e)||i===!0)return;const t=e.key.toLocaleLowerCase();if(e.ctrlKey){G(t,e);return}q(t,e)};return d(()=>{const{topViewInstance:e}=o;if(!!e)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[o,K,r,o.pointCloudBoxList,o.polygonList]),d(()=>{z(r)},[V]),d(()=>{(r==null?void 0:r.radius)&&F(r==null?void 0:r.radius)},[r==null?void 0:r.radius]),d(()=>{C==null||C()},[n,o.mainViewInstance]),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=>{g(e);const t=o.selectedPointCloudBox;if(t){t.attribute=e;const s=v(t);o.mainViewInstance&&N(t,s)}k&&U(I(S({},k),{attribute:e}))},a.current.setSubAttribute=(e,t)=>{var s;const l=o.selectedPointCloudBox;if(l){const u=(s=l==null?void 0:l.subAttribute)!=null?s:{};l.subAttribute=I(S({},u),{[e]:t}),v(l)}},a.current.clearResult=()=>{f==null||f()},a.current.redo=()=>{w()},a.current.undo=()=>{x()},a.current.setValid=e=>{a.current.valid=e,setTimeout(()=>{o.setPointCloudValid(e),e===!1&&f()})},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=>{H({pointCloudBoxList:e})},initRecord:()=>{}}},[]),d(()=>{var e;const t=(e=o.topViewInstance)==null?void 0:e.pointCloud2dOperation;if(!t||i)return;const s=c=>{g(c)},l=c=>{y.error(c)},u=c=>{y.info(c)};return t.on("syncAttribute",s),t.on("messageError",l),t.on("messageInfo",u),()=>{t.unbind("syncAttribute",s),t.unbind("messageError",l),t.unbind("messageInfo",u)}},[o.topViewInstance]),null};var we=te(oe,null,null,{context:ae})(Ce);export{we 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 { 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> = ({ currentData, config, checkMode, configString }) => {\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();\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 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 '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 }, [currentData, ptCtx.mainViewInstance]);\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAM5B,MAAM,qBAAuC,CAAC,CAAE,WAAa,EAAA,MAAA,EAAQ,WAAW,YAAmB,CAAA,KAAA;AACjG,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAM,MAAA;AAAA,IACJ,sBAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,qCAAA;AAAA,GACE,GAAA,YAAA,EAAA,CAAA;AACJ,EAAM,MAAA,CAAE,gBAAgB,uBAA4B,CAAA,GAAA,SAAA,EAAA,CAAA;AACpD,EAAM,MAAA,SAAA,GAAY,WAAW,WAAY,CAAA,MAAA,CAAA,CAAA;AACzC,EAAM,MAAA,CAAE,iBAAmB,EAAA,kBAAA,EAAoB,WAAgB,CAAA,GAAA,QAAA,EAAA,CAAA;AAC/D,EAAM,MAAA,CAAE,eAAoB,CAAA,GAAA,qBAAA,CAAsB,CAAE,SAAA,CAAA,CAAA,CAAA;AACpD,EAAM,MAAA,CAAE,YAAiB,CAAA,GAAA,SAAA,CAAU,CAAE,WAAA,CAAA,CAAA,CAAA;AACrC,EAAM,MAAA,CAAE,sBAAsB,sBAA2B,CAAA,GAAA,kBAAA,EAAA,CAAA;AACzD,EAAA,MAAM,CAAE,IAAA,EAAM,IAAM,EAAA,mBAAA,EAAqB,6BAAkC,CAAA,GAAA,UAAA,EAAA,CAAA;AAC3E,EAAA,MAAM,CAAE,uBAA4B,CAAA,GAAA,YAAA,EAAA,CAAA;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AAAA,KAAA,CAAA;AAEhB,IAAM,MAAA,WAAA,GAAc,CAAC,IAAiB,KAAA;AACpC,MAAA,OAAA,CAAQ,IAAK,CAAA,IAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAGf,IAAA,YAAA,CAAa,GAAG,eAAiB,EAAA,aAAA,CAAA,CAAA;AACjC,IAAA,YAAA,CAAa,GAAG,cAAgB,EAAA,YAAA,CAAA,CAAA;AAChC,IAAA,YAAA,CAAa,GAAG,aAAe,EAAA,WAAA,CAAA,CAAA;AAE/B,IAAA,OAAO,MAAM;AACX,MAAA,YAAA,CAAa,OAAO,eAAiB,EAAA,aAAA,CAAA,CAAA;AACrC,MAAA,YAAA,CAAa,OAAO,cAAgB,EAAA,YAAA,CAAA,CAAA;AACpC,MAAA,YAAA,CAAa,OAAO,aAAe,EAAA,WAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAAA,EAEpC,CAAC,KAAM,CAAA,eAAA,CAAA,CAAA,CAAA;AAEV,EAAO,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 { 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> = ({ currentData, config, checkMode, configString }) => {\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 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 '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 }, [currentData, ptCtx.mainViewInstance]);\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,CAAE,eAAoB,CAAA,GAAA,KAAA,CAAA;AAM5B,MAAM,qBAAuC,CAAC,CAAE,WAAa,EAAA,MAAA,EAAQ,WAAW,YA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,YAAA,CAAa,OAAO,eAAiB,EAAA,aAAA,CAAA,CAAA;AACrC,MAAA,YAAA,CAAa,OAAO,cAAgB,EAAA,YAAA,CAAA,CAAA;AACpC,MAAA,YAAA,CAAa,OAAO,aAAe,EAAA,WAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAAA,EAEpC,CAAC,KAAM,CAAA,eAAA,CAAA,CAAA,CAAA;AAEV,EAAO,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 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as k,useState as B,useMemo as h,useCallback as d}from"react";import y from"lodash";import{message as p,Modal as R}from"antd";import{usePointCloudViews as w}from"./usePointCloudViews.js";import{PointCloudContext as H}from"../PointCloudContext.js";import{useTranslation as M}from"react-i18next";const S=({config:m})=>{const{selectedIDs:l,pointCloudBoxList:t,setPointCloudResult:C,syncAllViewPointCloudColor:f}=k(H),[o,i]=B([]),{pointCloudBoxListUpdated:c}=w(),{t:n,i18n:a}=M(),D=s=>m.trackConfigurable!==!0?!1:t.some(r=>s.some(e=>e.trackID===r.trackID)),u=h(()=>t.filter(s=>l.includes(s.id)),[l,t]),x=d(()=>{u.length>0?i(y.cloneDeep(u)):(i([]),p.error(n("CopyEmptyInPointCloud")))},[l,t,a.language]),I=d(()=>{if(o.length===0){p.error(n("PasteEmptyInPointCloud"));return}const s=D(o),r=e=>{C(e),c==null||c(e),i([]),f(e)};if(s)R.confirm({title:n("HasDuplicateIDHeader"),content:n("HasDuplicateIDMsg"),onOk:()=>{const e=t.filter(P=>!o.find(g=>g.trackID===P.trackID)).concat(o);r(e)}});else{const e=[...t,...o];r(e)}},[o,t,a.language]);return{copySelectedBoxes:x,pasteSelectedBoxes:I,copiedBoxes:o,selectedBoxes:u}};export{S as useBoxes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBoxes.js","sources":["../../../../src/components/pointCloudView/hooks/useBoxes.ts"],"sourcesContent":["import { IPointCloudBoxList } from '@labelbee/lb-utils';\nimport { useCallback, useContext, useMemo, useState } from 'react';\nimport _ from 'lodash';\nimport { message } from 'antd';\nimport { usePointCloudViews } from './usePointCloudViews';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Actions for selected boxes\n */\nexport const useBoxes = () => {\n const { selectedIDs, pointCloudBoxList, setPointCloudResult }
|
|
1
|
+
{"version":3,"file":"useBoxes.js","sources":["../../../../src/components/pointCloudView/hooks/useBoxes.ts"],"sourcesContent":["import { IPointCloudBoxList, IPointCloudConfig } from '@labelbee/lb-utils';\nimport { useCallback, useContext, useMemo, useState } from 'react';\nimport _ from 'lodash';\nimport { message, Modal } from 'antd';\nimport { usePointCloudViews } from './usePointCloudViews';\nimport { PointCloudContext } from '../PointCloudContext';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Actions for selected boxes\n */\nexport const useBoxes = ({ config }: { config: IPointCloudConfig }) => {\n const { selectedIDs, pointCloudBoxList, setPointCloudResult, syncAllViewPointCloudColor } =\n useContext(PointCloudContext);\n const [copiedBoxes, setCopiedBoxes] = useState<IPointCloudBoxList>([]);\n const { pointCloudBoxListUpdated } = usePointCloudViews();\n const { t, i18n } = useTranslation();\n\n const hasDuplicateID = (checkBoxList: IPointCloudBoxList) => {\n if (config.trackConfigurable !== true) {\n return false;\n }\n\n return pointCloudBoxList.some((item) => {\n return checkBoxList.some((i) => i.trackID === item.trackID);\n });\n };\n\n const selectedBoxes = useMemo(() => {\n return pointCloudBoxList.filter((i) => selectedIDs.includes(i.id));\n }, [selectedIDs, pointCloudBoxList]);\n\n const copySelectedBoxes = useCallback(() => {\n if (selectedBoxes.length > 0) {\n setCopiedBoxes(_.cloneDeep(selectedBoxes));\n } else {\n setCopiedBoxes([]);\n message.error(t('CopyEmptyInPointCloud'));\n }\n }, [selectedIDs, pointCloudBoxList, i18n.language]);\n\n const pasteSelectedBoxes = useCallback(() => {\n if (copiedBoxes.length === 0) {\n message.error(t('PasteEmptyInPointCloud'));\n return;\n }\n\n const hasDuplicate = hasDuplicateID(copiedBoxes);\n\n const updatePointCloudResult = (newPointCloudBoxList: IPointCloudBoxList) => {\n /** Paste succeed and empty */\n setPointCloudResult(newPointCloudBoxList);\n pointCloudBoxListUpdated?.(newPointCloudBoxList);\n setCopiedBoxes([]);\n\n // TODO: It need to update in global.\n syncAllViewPointCloudColor(newPointCloudBoxList);\n };\n\n if (hasDuplicate) {\n Modal.confirm({\n title: t('HasDuplicateIDHeader'),\n content: t('HasDuplicateIDMsg'),\n onOk: () => {\n /**\n * Filter the same trackID in old-pointCloudBoxList.\n */\n const newPointCloudResult = pointCloudBoxList\n .filter((v) => {\n if (copiedBoxes.find((c) => c.trackID === v.trackID)) {\n return false;\n }\n return true;\n })\n .concat(copiedBoxes);\n\n updatePointCloudResult(newPointCloudResult);\n },\n });\n } else {\n /** Paste succeed and empty */\n const newPointCloudResult = [...pointCloudBoxList, ...copiedBoxes];\n\n updatePointCloudResult(newPointCloudResult);\n }\n }, [copiedBoxes, pointCloudBoxList, i18n.language]);\n\n return { copySelectedBoxes, pasteSelectedBoxes, copiedBoxes, selectedBoxes };\n};\n"],"names":[],"mappings":";;;;;;;AAWa,MAAA,QAAA,GAAW,CAAC,CAAE,MAA4C,CAAA,KAAA;AACrE,EAAA,MAAM,CAAE,WAAA,EAAa,iBAAmB,EAAA,mBAAA,EAAqB,8BAC3D,UAAW,CAAA,iBAAA,CAAA,CAAA;AACb,EAAM,MAAA,CAAC,WAAa,EAAA,cAAA,CAAA,GAAkB,QAA6B,CAAA,EAAA,CAAA,CAAA;AACnE,EAAA,MAAM,CAAE,wBAA6B,CAAA,GAAA,kBAAA,EAAA,CAAA;AACrC,EAAM,MAAA,CAAE,GAAG,IAAS,CAAA,GAAA,cA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|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.8.0-alpha.
|
|
3
|
+
"version": "1.8.0-alpha.7",
|
|
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.12.0-alpha.
|
|
45
|
-
"@labelbee/lb-utils": "^1.5.0-alpha.
|
|
44
|
+
"@labelbee/lb-annotation": "^1.12.0-alpha.7",
|
|
45
|
+
"@labelbee/lb-utils": "^1.5.0-alpha.7",
|
|
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": "47a05462b795baaad6d5ec881545fe6499e63933"
|
|
101
101
|
}
|