Browse Source

根据需求修改:右键取消测量点

dev
刘向辉 3 years ago
parent
commit
24d6b0819b
  1. 20
      src/app/babylon/tool/measure-tool.ts

20
src/app/babylon/tool/measure-tool.ts

@ -16,6 +16,11 @@ export class MeasureTool {
*/ */
currentMeasureInfo: MeasureInfo; currentMeasureInfo: MeasureInfo;
/**
*
*/
allMeasureInfo: MeasureInfo[] = [];
/** /**
* *
*/ */
@ -50,6 +55,9 @@ export class MeasureTool {
* *
*/ */
breakMeasure() { breakMeasure() {
if (this.currentMeasureInfo != null) {
this.allMeasureInfo.push(this.currentMeasureInfo);
}
this.currentMeasureInfo = null; this.currentMeasureInfo = null;
} }
@ -94,6 +102,7 @@ export class MeasureTool {
else if (eventData.event.button == 2) //右键,中断 else if (eventData.event.button == 2) //右键,中断
{ {
instance.breakMeasure(); 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 = [];
}
/** /**
* *
*/ */

Loading…
Cancel
Save