@labelbee/lb-annotation 1.27.0-alpha.61 → 1.27.0-alpha.62

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 keyCode=require("../../constant/keyCode.js"),rectOperation=require("./rectOperation.js"),reCalcRect=require("./utils/reCalcRect.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));class PointCloud2DRectOperation extends rectOperation.RectOperation{constructor(e){super(e);this.highLightRectList=[],this.checkMode=e.checkMode,this.highLightRectList=[]}setHighLightRectList(e){this.highLightRectList=e}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",__spreadValues({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![keyCode.Delete,keyCode.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:i,altKey:s,shiftKey:c,metaKey:n}=e;switch(t){case keyCode.R:{if(i||s||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,i=!1,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?e:__spreadProps(__spreadValues({},e),{lineDash:[3]}),t,i,s)}renderPointCloud2DHighlight(){const{renderEnhance:e={}}=this;this.highLightRectList&&this.highLightRectList.forEach(t=>{this.renderDrawingRect(t,this.zoom,!1,!0),e.selectedRender&&e.selectedRender(this.canvas,AxisUtils.default.changeRectByZoom(t,this.zoom,this.currentPos),this.getRenderStyle(t))})}resizeRect(e=100,t=100){var i;if(!this.imgNode||!((i=this.selectedRects)==null?void 0:i.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:s,height:c}=this.basicImgInfo,n={width:s,height:c,x:0,y:0},h=reCalcRect(this.selectedRects[0],n,e,t);h.noChange||(this.setRectList(this.rectList.map(o=>this.selectedIDs.includes(o.id)?__spreadValues(__spreadValues({},o),h):o),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}module.exports=PointCloud2DRectOperation;
1
+ "use strict";var keyCode=require("../../constant/keyCode.js"),AxisUtils=require("../../utils/tool/AxisUtils.js"),rectOperation=require("./rectOperation.js"),reCalcRect=require("./utils/reCalcRect.js"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r},__spreadProps=(r,e)=>__defProps(r,__getOwnPropDescs(e));class PointCloud2DRectOperation extends rectOperation.RectOperation{constructor(e){super(e);this.highLightRectList=[],this.checkMode=e.checkMode,this.highLightRectList=[]}setHighLightRectList(e){this.highLightRectList=e}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",__spreadValues({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![keyCode.Delete,keyCode.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:i,altKey:s,shiftKey:c,metaKey:n}=e;switch(t){case keyCode.R:{if(i||s||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,i=!1,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?e:__spreadProps(__spreadValues({},e),{lineDash:[3]}),t,i,s)}renderPointCloud2DHighlight(){const{renderEnhance:e={}}=this;this.highLightRectList&&this.highLightRectList.forEach(t=>{this.renderDrawingRect(t,this.zoom,!1,!0),e.selectedRender&&e.selectedRender(this.canvas,AxisUtils.default.changeRectByZoom(t,this.zoom,this.currentPos),this.getRenderStyle(t))})}resizeRect(e=100,t=100){var i;if(!this.imgNode||!((i=this.selectedRects)==null?void 0:i.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:s,height:c}=this.basicImgInfo,n={width:s,height:c,x:0,y:0},h=reCalcRect(this.selectedRects[0],n,e,t);h.noChange||(this.setRectList(this.rectList.map(o=>this.selectedIDs.includes(o.id)?__spreadValues(__spreadValues({},o),h):o),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}module.exports=PointCloud2DRectOperation;
@@ -1 +1 @@
1
- import d from"../../constant/keyCode.js";import{RectOperation as g}from"./rectOperation.js";import R from"./utils/reCalcRect.js";import f from"../../utils/tool/AxisUtils.js";var p=Object.defineProperty,m=Object.defineProperties,w=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,u=(r,e,t)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,o=(r,e)=>{for(var t in e||(e={}))D.call(e,t)&&u(r,t,e[t]);if(l)for(var t of l(e))y.call(e,t)&&u(r,t,e[t]);return r},_=(r,e)=>m(r,w(e));class v extends g{constructor(e){super(e);this.highLightRectList=[],this.checkMode=e.checkMode,this.highLightRectList=[]}setHighLightRectList(e){this.highLightRectList=e}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",o({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![d.Delete,d.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:i,altKey:s,shiftKey:c,metaKey:n}=e;switch(t){case d.R:{if(i||s||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,i=!1,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?e:_(o({},e),{lineDash:[3]}),t,i,s)}renderPointCloud2DHighlight(){const{renderEnhance:e={}}=this;this.highLightRectList&&this.highLightRectList.forEach(t=>{this.renderDrawingRect(t,this.zoom,!1,!0),e.selectedRender&&e.selectedRender(this.canvas,f.changeRectByZoom(t,this.zoom,this.currentPos),this.getRenderStyle(t))})}resizeRect(e=100,t=100){var i;if(!this.imgNode||!((i=this.selectedRects)==null?void 0:i.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:s,height:c}=this.basicImgInfo,n={width:s,height:c,x:0,y:0},a=R(this.selectedRects[0],n,e,t);a.noChange||(this.setRectList(this.rectList.map(h=>this.selectedIDs.includes(h.id)?o(o({},h),a):h),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}export{v as default};
1
+ import d from"../../constant/keyCode.js";import g from"../../utils/tool/AxisUtils.js";import{RectOperation as R}from"./rectOperation.js";import f from"./utils/reCalcRect.js";var p=Object.defineProperty,m=Object.defineProperties,w=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,u=(r,e,t)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,o=(r,e)=>{for(var t in e||(e={}))D.call(e,t)&&u(r,t,e[t]);if(l)for(var t of l(e))y.call(e,t)&&u(r,t,e[t]);return r},_=(r,e)=>m(r,w(e));class v extends R{constructor(e){super(e);this.highLightRectList=[],this.checkMode=e.checkMode,this.highLightRectList=[]}setHighLightRectList(e){this.highLightRectList=e}createNewDrawingRect(e,t){this.checkMode||super.createNewDrawingRect(e,t)}deleteSelectedRect(e){if(this.checkMode)return;const{selectedRects:t}=this;t.length&&e.stopPropagation(),this.emit("deleteSelectedRects",t)}setSelectedIdAfterAddingDrawingRect(){!this.drawingRect||(this.setSelectedRectID(this.drawingRect.id),this.emit("afterAddingDrawingRect",o({},this.selectedRect)))}setSelectedRectID(e){this.checkMode||super.setSelectedRectID(e)}onKeyDown(e){if(this.checkMode||![d.Delete,d.R].includes(e.keyCode))return;super.onKeyDown(e);const{keyCode:t,ctrlKey:i,altKey:s,shiftKey:c,metaKey:n}=e;switch(t){case d.R:{if(i||s||c||n)return;this.resizeRect();break}}return!0}renderDrawingRect(e,t=this.zoom,i=!1,s=!1){const c=(e==null?void 0:e.boxID)||(e==null?void 0:e.lineDash);super.renderDrawingRect(c?e:_(o({},e),{lineDash:[3]}),t,i,s)}renderPointCloud2DHighlight(){const{renderEnhance:e={}}=this;this.highLightRectList&&this.highLightRectList.forEach(t=>{this.renderDrawingRect(t,this.zoom,!1,!0),e.selectedRender&&e.selectedRender(this.canvas,g.changeRectByZoom(t,this.zoom,this.currentPos),this.getRenderStyle(t))})}resizeRect(e=100,t=100){var i;if(!this.imgNode||!((i=this.selectedRects)==null?void 0:i.length)||e<=0||t<=0||this.selectedRects[0].width<=e&&this.selectedRects[0].height<=t)return;const{width:s,height:c}=this.basicImgInfo,n={width:s,height:c,x:0,y:0},a=f(this.selectedRects[0],n,e,t);a.noChange||(this.setRectList(this.rectList.map(h=>this.selectedIDs.includes(h.id)?o(o({},h),a):h),!0),this.render(),this.updateDragResult())}rightMouseUp(e){const t=super.rightMouseUp(e);return this.emit("onRightClick",{event:e,targetId:t==null?void 0:t.boxID,id:t==null?void 0:t.id}),t}}export{v as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-annotation",
3
- "version": "1.27.0-alpha.61",
3
+ "version": "1.27.0-alpha.62",
4
4
  "description": "Annotation tool collection",
5
5
  "keywords": [
6
6
  "annotation",