|
|
|
@ -2,6 +2,7 @@ import { EventState, Mesh, MeshBuilder, PickingInfo, PointerEventTypes, PointerI
|
|
|
|
|
import { Button, Container, Control, Ellipse, MultiLine, Rectangle, TextBlock } from "@babylonjs/gui"; |
|
|
|
|
import { UIManager } from "../controller/ui-manager"; |
|
|
|
|
import { BabylonUIStyleTool } from "./babylon-ui-style-tool"; |
|
|
|
|
import { TsTool } from "./ts-tool"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 测量工具 |
|
|
|
@ -114,13 +115,24 @@ export class MeasureTool {
|
|
|
|
|
* 清除测量内容 |
|
|
|
|
*/ |
|
|
|
|
clearMeasure() { |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.allMeasureInfo.length; i++) { |
|
|
|
|
this.allMeasureInfo[i].dispose(); |
|
|
|
|
} |
|
|
|
|
this.allMeasureInfo = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 释放某个测量info |
|
|
|
|
* @param info
|
|
|
|
|
*/ |
|
|
|
|
disposeMeasureInfo(info: MeasureInfo) { |
|
|
|
|
TsTool.arrayRemove(MeasureTool.instance.allMeasureInfo, info); |
|
|
|
|
if (this.currentMeasureInfo == info) { |
|
|
|
|
this.currentMeasureInfo = null; |
|
|
|
|
} |
|
|
|
|
info.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加测量点 |
|
|
|
|
*/ |
|
|
|
@ -296,7 +308,7 @@ export class MeasureInfo {
|
|
|
|
|
this.btn_dispose.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; |
|
|
|
|
let instance = this; |
|
|
|
|
this.btn_dispose.onPointerClickObservable.add(() => { |
|
|
|
|
instance.dispose(); |
|
|
|
|
MeasureTool.instance.disposeMeasureInfo(instance); |
|
|
|
|
}); |
|
|
|
|
this.btn_dispose.background = BabylonUIStyleTool.c_color_3d_blueBg; |
|
|
|
|
this.btn_dispose.color = BabylonUIStyleTool.c_color_3d_blue; |
|
|
|
|