From b27c8a657dd54e430b4267d70407c669ee92b161 Mon Sep 17 00:00:00 2001 From: qq55341701 <55341701@qq.com> Date: Sat, 18 Feb 2023 19:11:39 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=A0=87=E7=BB=98=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../image-label2/image-label2.component.ts | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/src/app/system-management/image-label2/image-label2.component.ts b/src/app/system-management/image-label2/image-label2.component.ts index b0a7499..49cb389 100644 --- a/src/app/system-management/image-label2/image-label2.component.ts +++ b/src/app/system-management/image-label2/image-label2.component.ts @@ -13,7 +13,7 @@ export class ImageLabel2Component implements OnInit { private http: HttpClient, private message: NzMessageService, private modal: NzModalService - ) {} + ) { } @Input() data: any; //传递id camerasData: any; //摄像头Data @@ -27,7 +27,7 @@ export class ImageLabel2Component implements OnInit { history.go(-1); } - ngOnInit(): void {} + ngOnInit(): void { } //获取 摄像头图片/标注点位 getImgMarkData() { @@ -68,8 +68,8 @@ export class ImageLabel2Component implements OnInit { '向边缘设备发送请求成功,请过一段时间手动刷新页面!' ); }, - error: (error: HttpErrorResponse) => {}, - complete: () => {}, + error: (error: HttpErrorResponse) => { }, + complete: () => { }, }); } @@ -378,6 +378,18 @@ export class ImageLabel2Component implements OnInit { this.arrowPointsOfNorth, ]; this.drawLine(arr, context); + + this.redrawPolygon( + this.pointsOfmonitor, + this.allpointsOfmonitor, + this.circlesOfmonitor, + context, + 'black' + ); + + + + } if ( this.isDrawArrow && @@ -404,6 +416,16 @@ export class ImageLabel2Component implements OnInit { this.arrowPointsOfNorth, ]; this.drawLine(arr, context); + + this.redrawPolygon( + this.pointsOfmonitor, + this.allpointsOfmonitor, + this.circlesOfmonitor, + context, + 'black' + ); + + } if ( this.isDrawArrow && @@ -430,6 +452,17 @@ export class ImageLabel2Component implements OnInit { this.arrowPointsOfNorth, ]; this.drawLine(arr, context); + + + this.redrawPolygon( + this.pointsOfmonitor, + this.allpointsOfmonitor, + this.circlesOfmonitor, + context, + 'black' + ); + + } if ( this.isDrawArrow && @@ -762,9 +795,9 @@ export class ImageLabel2Component implements OnInit { ((poly[i].y <= pt.y && pt.y < poly[j].y) || (poly[j].y <= pt.y && pt.y < poly[i].y)) && pt.x < - ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / - (poly[j].y - poly[i].y) + - poly[i].x && + ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / + (poly[j].y - poly[i].y) + + poly[i].x && (c = !c); return c; } @@ -902,9 +935,9 @@ export class ImageLabel2Component implements OnInit { ((poly[i].y <= pt.y && pt.y < poly[j].y) || (poly[j].y <= pt.y && pt.y < poly[i].y)) && pt.x < - ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / - (poly[j].y - poly[i].y) + - poly[i].x && + ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / + (poly[j].y - poly[i].y) + + poly[i].x && (c = !c); return c; }