From 24d6b0819b4a66cfcdc797743d198951d9d469d1 Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Fri, 24 Dec 2021 08:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=9C=80=E6=B1=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=E5=8F=B3=E9=94=AE=E5=8F=96=E6=B6=88=E6=B5=8B?= =?UTF-8?q?=E9=87=8F=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/tool/measure-tool.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/app/babylon/tool/measure-tool.ts b/src/app/babylon/tool/measure-tool.ts index c47ff70..accef0e 100644 --- a/src/app/babylon/tool/measure-tool.ts +++ b/src/app/babylon/tool/measure-tool.ts @@ -16,6 +16,11 @@ export class MeasureTool { */ currentMeasureInfo: MeasureInfo; + /** + * 所有测量数据 + */ + allMeasureInfo: MeasureInfo[] = []; + /** * 当前所处的测量状态 */ @@ -50,6 +55,9 @@ export class MeasureTool { * 中断测量 */ breakMeasure() { + if (this.currentMeasureInfo != null) { + this.allMeasureInfo.push(this.currentMeasureInfo); + } this.currentMeasureInfo = null; } @@ -94,6 +102,7 @@ export class MeasureTool { else if (eventData.event.button == 2) //右键,中断 { instance.breakMeasure(); + instance.clearMeasure();//2021/12/24需求: 右键清除测量点 } @@ -101,6 +110,17 @@ export class MeasureTool { } } + /** + * 清除测量内容 + */ + clearMeasure() { + + for (let i = 0; i < this.allMeasureInfo.length; i++) { + this.allMeasureInfo[i].dispose(); + } + this.allMeasureInfo = []; + } + /** * 添加测量点 */