@labelbee/lb-components 1.17.0-alpha.1 → 1.17.0-alpha.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=({currentData:t,imgList:f,drawLayerSlot:s,checkMode:l,intelligentFit:g,imgIndex:P,loadPCDFileLoading:S,config:v})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:d,setGlobalPattern:p,selectedIDs:c}=e,E=ctx.useDispatch(),[a,m]=React.useState(!1),x=(c==null?void 0:c.length)>0&&a,L=index.jsonParser(t.result),{toolInstanceRef:o,clearToolInstance:q}=annotation.useCustomToolInstance({basicInfo:L});if(React.useEffect(()=>{o.current.setPointCloudGlobalPattern=n=>{n!==d&&(p(n),e.clearAllDetectionInstance(),q())}},[d]),React.useEffect(()=>{var n;if(actionCreators.SetLoadPCDFileLoading(E,!0),t){const{boxParamsList:i,polygonList:r,lineList:u,sphereParamsList:b,segmentation:j}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((n=t==null?void 0:t.result)!=null?n:"");e.setPointCloudResult(i),e.setPolygonList(r),e.setLineList(u),e.setPointCloudSphereList(b),e.setSegmentation(j)}},[P]),React.useEffect(()=>{o.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],o.current.exportCustomData=()=>{var n,i,r,u;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(i=e.lineList)!=null?i:[],resultPoint:(r=e.pointCloudSphereList)!=null?r:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),f.length===0)return null;if(d===lbUtils.EPointCloudPattern.Segmentation)return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegment2DView,null)),React__default.default.createElement(
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=({currentData:t,imgList:f,drawLayerSlot:s,checkMode:l,intelligentFit:g,imgIndex:P,loadPCDFileLoading:S,config:v})=>{const e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:d,setGlobalPattern:p,selectedIDs:c}=e,E=ctx.useDispatch(),[a,m]=React.useState(!1),x=(c==null?void 0:c.length)>0&&a,L=index.jsonParser(t.result),{toolInstanceRef:o,clearToolInstance:q}=annotation.useCustomToolInstance({basicInfo:L});if(React.useEffect(()=>{o.current.setPointCloudGlobalPattern=n=>{n!==d&&(p(n),e.clearAllDetectionInstance(),q())}},[d]),React.useEffect(()=>{var n;if(actionCreators.SetLoadPCDFileLoading(E,!0),t){const{boxParamsList:i,polygonList:r,lineList:u,sphereParamsList:b,segmentation:j}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((n=t==null?void 0:t.result)!=null?n:"");e.setPointCloudResult(i),e.setPolygonList(r),e.setLineList(u),e.setPointCloudSphereList(b),e.setSegmentation(j)}},[P]),React.useEffect(()=>{o.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],o.current.exportCustomData=()=>{var n,i,r,u;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(i=e.lineList)!=null?i:[],resultPoint:(r=e.pointCloudSphereList)!=null?r:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),f.length===0)return null;if(d===lbUtils.EPointCloudPattern.Segmentation)return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegment2DView,null)),React__default.default.createElement(PointCloudSegmentStatus,{config:v}),s==null?void 0:s({direct:!0}));let C=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left-bottom")},React__default.default.createElement(PointCloudBackView,{checkMode:l}),React__default.default.createElement(PointCloudSideView,{checkMode:l}));return a&&(C=React__default.default.createElement(index$2,{selectAndEnlarge:x,checkMode:l})),React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:l,toolInstanceRef:o}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud3DView,null),C),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right")]:!0,[dom.getClassName("point-cloud-container","rightZoom")]:a})},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:s,checkMode:l,intelligentFit:g,setIsEnlargeTopView:m,onExitZoom:()=>{m(!1)},isEnlargeTopView:a}),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right-bottom")]:!a,[dom.getClassName("point-cloud-container","right-bottom-floatLeft")]:a})},React__default.default.createElement(PointCloud2DView,{isEnlargeTopView:a,thumbnailWidth:a?300:455,checkMode:l})))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as
|
|
1
|
+
import{getClassName as n}from"../../utils/dom.js";import t,{useContext as N,useState as h,useEffect as p}from"react";import T from"./PointCloud3DView.js";import I from"./PointCloudBackView.js";import B from"./PointCloudTopView.js";import F from"./PointCloudSideView.js";import y from"./PointCloud2DView.js";import R from"./PointCloudListener.js";import _ from"./PointCloudSegmentListener.js";import G from"./PointCloudSegment.js";import O from"./PointCloudSegmentStatus.js";import Z from"./PointCloudSegmentToolbar.js";import U from"./PointCloudSegment2DView.js";import{connect as W}from"react-redux";import{LabelBeeContext as $,useDispatch as q}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as z,AnnotatedAttributesPanelFixedRight as H}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as J}from"./PointCloudContext.js";import{PointCloudUtils as K,EPointCloudPattern as Q}from"@labelbee/lb-utils";import{useCustomToolInstance as X}from"../../hooks/annotation.js";import{jsonParser as Y}from"../../utils/index.js";import{a2MapStateToProps as k}from"../../store/annotation/map.js";import g from"classnames";import M from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as tt}from"../../store/annotation/actionCreators.js";const et=({currentData:s,imgList:E,drawLayerSlot:d,checkMode:i,intelligentFit:L,imgIndex:S,loadPCDFileLoading:nt,config:j})=>{const e=N(J),{globalPattern:c,setGlobalPattern:v,selectedIDs:C}=e,x=q(),[l,P]=h(!1),b=(C==null?void 0:C.length)>0&&l,w=Y(s.result),{toolInstanceRef:r,clearToolInstance:V}=X({basicInfo:w});if(p(()=>{r.current.setPointCloudGlobalPattern=o=>{o!==c&&(v(o),e.clearAllDetectionInstance(),V())}},[c]),p(()=>{var o;if(tt(x,!0),s){const{boxParamsList:a,polygonList:m,lineList:u,sphereParamsList:A,segmentation:D}=K.parsePointCloudCurrentResult((o=s==null?void 0:s.result)!=null?o:"");e.setPointCloudResult(a),e.setPolygonList(m),e.setLineList(u),e.setPointCloudSphereList(A),e.setSegmentation(D)}},[S]),p(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var o,a,m,u;return{resultPolygon:(o=e.polygonList)!=null?o:[],resultLine:(a=e.lineList)!=null?a:[],resultPoint:(m=e.pointCloudSphereList)!=null?m:[],segmentation:(u=e.segmentation)!=null?u:[]}}},[e.pointCloudBoxList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),E.length===0)return null;if(c===Q.Segmentation)return t.createElement(t.Fragment,null,t.createElement(_,{checkMode:i,toolInstanceRef:r}),t.createElement(Z,null),t.createElement("div",{className:n("point-cloud-layout")},t.createElement(G,{checkMode:i}),t.createElement(U,null)),t.createElement(O,{config:j}),d==null?void 0:d({direct:!0}));let f=t.createElement("div",{className:n("point-cloud-container","left-bottom")},t.createElement(I,{checkMode:i}),t.createElement(F,{checkMode:i}));return l&&(f=t.createElement(M,{selectAndEnlarge:b,checkMode:i})),t.createElement(t.Fragment,null,t.createElement(R,{checkMode:i,toolInstanceRef:r}),t.createElement("div",{className:n("point-cloud-layout"),onContextMenu:o=>o.preventDefault()},t.createElement("div",{className:n("point-cloud-wrapper")},t.createElement(z,null),t.createElement("div",{className:n("point-cloud-content")},t.createElement("div",{className:n("point-cloud-container","left")},t.createElement(T,null),f),t.createElement("div",{className:g({[n("point-cloud-container","right")]:!0,[n("point-cloud-container","rightZoom")]:l})},t.createElement(B,{drawLayerSlot:d,checkMode:i,intelligentFit:L,setIsEnlargeTopView:P,onExitZoom:()=>{P(!1)},isEnlargeTopView:l}),t.createElement("div",{className:g({[n("point-cloud-container","right-bottom")]:!l,[n("point-cloud-container","right-bottom-floatLeft")]:l})},t.createElement(y,{isEnlargeTopView:l,thumbnailWidth:l?300:455,checkMode:i})))),t.createElement(H,null))))};var ot=W(k,null,null,{context:$})(et);export{ot as default};
|