|
|
|
@ -1,13 +1,14 @@
|
|
|
|
|
import * as THREE from 'three';
|
|
|
|
|
import { Vector3 } from 'three';
|
|
|
|
|
import * as xaop from 'xaop';
|
|
|
|
|
|
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
|
import { GetPointPrompt, InputState } from '../Common/InputState';
|
|
|
|
|
import { MouseKey, KeyBoard } from '../Common/KeyEnum';
|
|
|
|
|
import { polar, equaln, fixAngle, Intersect } from '../Geometry/GeUtils';
|
|
|
|
|
import { PromptPointResult, PromptStatus } from './PromptResult';
|
|
|
|
|
import { GetPointPromptBlock } from '../UI/DynamicPrompt/GetPointPromptBlock';
|
|
|
|
|
import { KeyBoard, MouseKey } from '../Common/KeyEnum';
|
|
|
|
|
import { equaln, fixAngle, Intersect, polar } from '../Geometry/GeUtils';
|
|
|
|
|
import { DynamicInputManage } from '../UI/DynamicPrompt/DynamicInputManage';
|
|
|
|
|
import { GetPointPromptBlock } from '../UI/DynamicPrompt/GetPointPromptBlock';
|
|
|
|
|
import { PromptPointResult, PromptStatus } from './PromptResult';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 为拾取点提供服务,提供一个类以供Editor引用.
|
|
|
|
@ -27,6 +28,7 @@ export class GetPointServices
|
|
|
|
|
this.initAppState();
|
|
|
|
|
//点捕捉
|
|
|
|
|
this.initPtSnap();
|
|
|
|
|
this.initUpdateCurPoint();
|
|
|
|
|
//消息显示.
|
|
|
|
|
this.initPrompt(prompt);
|
|
|
|
|
//动态输入框.
|
|
|
|
@ -49,6 +51,20 @@ export class GetPointServices
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新当前点事件,统一使用该方法注入其他服务的更新(aop在此方法中注入)
|
|
|
|
|
UpdateCurPointEvent(pt: Vector3)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//初始化更新当前点的事件
|
|
|
|
|
private initUpdateCurPoint()
|
|
|
|
|
{
|
|
|
|
|
xaop.end(app.m_Editor.m_MouseCtrl,
|
|
|
|
|
app.m_Editor.m_MouseCtrl.onMouseMove,
|
|
|
|
|
() => this.UpdateCurPointEvent(this.GetNowPoint())
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private initHandleKeyDown()
|
|
|
|
|
{
|
|
|
|
|
this.removeCalls.push(xaop.begin(app.m_Editor.m_KeyCtrl, app.m_Editor.m_KeyCtrl.OnKeyDown, (e: KeyboardEvent) =>
|
|
|
|
@ -73,9 +89,8 @@ export class GetPointServices
|
|
|
|
|
{
|
|
|
|
|
if (prompt.Callback)
|
|
|
|
|
{
|
|
|
|
|
this.removeCalls.push(xaop.end(app.m_Editor.m_MouseCtrl, app.m_Editor.m_MouseCtrl.onMouseMove, () =>
|
|
|
|
|
this.removeCalls.push(xaop.end(this, this.UpdateCurPointEvent, (p: Vector3) =>
|
|
|
|
|
{
|
|
|
|
|
let p = this.GetNowPoint();
|
|
|
|
|
prompt.Callback(p);
|
|
|
|
|
app.m_Editor.UpdateScreen();
|
|
|
|
|
}));
|
|
|
|
@ -99,9 +114,9 @@ export class GetPointServices
|
|
|
|
|
this.removeCalls.push(() =>
|
|
|
|
|
{
|
|
|
|
|
preView.Scene.remove(line);
|
|
|
|
|
}, xaop.end(app.m_Editor.m_MouseCtrl, app.m_Editor.m_MouseCtrl.onMouseMove, () =>
|
|
|
|
|
}, xaop.end(this, this.UpdateCurPointEvent, (p: Vector3) =>
|
|
|
|
|
{
|
|
|
|
|
let endP = this.GetNowPoint();
|
|
|
|
|
let endP = p.clone();
|
|
|
|
|
app.m_Viewer.WorldToScreen(endP);
|
|
|
|
|
preView.ScreenPointToViewerPoint(endP);
|
|
|
|
|
let startP = prompt.BasePoint.clone();
|
|
|
|
@ -193,10 +208,10 @@ export class GetPointServices
|
|
|
|
|
{
|
|
|
|
|
dynPrompt.Destroy();
|
|
|
|
|
});
|
|
|
|
|
this.removeCalls.push(xaop.end(app.m_Editor.m_MouseCtrl, app.m_Editor.m_MouseCtrl.onMouseMove, () =>
|
|
|
|
|
this.removeCalls.push(xaop.end(this, this.UpdateCurPointEvent, (p) =>
|
|
|
|
|
{
|
|
|
|
|
dynPrompt.SetPostion(app.m_Editor.m_MouseCtrl.m_CurMousePointVCS);
|
|
|
|
|
dynPrompt.Value = this.GetNowPoint();
|
|
|
|
|
dynPrompt.Value = p;
|
|
|
|
|
}));
|
|
|
|
|
//处理动态输入
|
|
|
|
|
let dynManage = DynamicInputManage.GetManage();
|
|
|
|
@ -502,7 +517,7 @@ export class GetPointServices
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
testSnap();
|
|
|
|
|
let removeCall = xaop.end(app.m_Editor.m_MouseCtrl, app.m_Editor.m_MouseCtrl.onMouseMove, testSnap);
|
|
|
|
|
let removeCall = xaop.end(this, this.UpdateCurPointEvent, testSnap);
|
|
|
|
|
this.removeCalls.push(() =>
|
|
|
|
|
{
|
|
|
|
|
removeCall();
|
|
|
|
|