|
|
|
@ -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 = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加测量点 |
|
|
|
|
*/ |
|
|
|
|