|
|
|
@ -1,28 +1,29 @@
|
|
|
|
|
import * as THREE from 'three';
|
|
|
|
|
import { Math, Matrix4, Vector3 } from 'three';
|
|
|
|
|
import * as xaop from 'xaop';
|
|
|
|
|
import { ApplicationService } from '../ApplicationServices/Application';
|
|
|
|
|
import { InputState } from '../Common/InputState';
|
|
|
|
|
import { GetDistendPrompt, GetEntityPrompt, GetKeyWordPrommpt, GetPointPrompt, GetSelectionPrompt, PromptRectPointOptions } from "./PromptOptions";
|
|
|
|
|
import { Entity } from '../DatabaseServices/Entity';
|
|
|
|
|
import { angle } from '../Geometry/GeUtils';
|
|
|
|
|
import { CommandInputManage } from '../UI/Components/CommandInput/CommandInputManage';
|
|
|
|
|
import { MaskManage } from '../UI/Components/Modal/MaskManage';
|
|
|
|
|
import { ModalManage } from '../UI/Components/Modal/ModalsManage';
|
|
|
|
|
import { CommandStore } from '../UI/Store/CommandStore';
|
|
|
|
|
import { ContextMenuServices } from './ContextMenu';
|
|
|
|
|
import { GetDistanceServices } from './GetDistanceServices';
|
|
|
|
|
import { GetEntityServices } from './GetEntityServices';
|
|
|
|
|
import { GetKeyWordsServices } from './GetKeyWordService';
|
|
|
|
|
import { GetPointServices } from './GetPointServices';
|
|
|
|
|
import { GetRectPointServices } from './GetRectServices';
|
|
|
|
|
import { SsgetServiecs } from './GetSelectionServices';
|
|
|
|
|
import { GripDragServices } from './GripDragServices';
|
|
|
|
|
import { KeyBoardControls } from './KeyBoardControls';
|
|
|
|
|
import { MouseControls } from './MouseControls';
|
|
|
|
|
import { PromptDistendResult, PromptEntityResult, PromptPointResult, PromptResult, PromptSsgetResult, PromptRectResult } from './PromptResult';
|
|
|
|
|
import { GetDistendPrompt, GetEntityPrompt, GetKeyWordPrommpt, GetPointPrompt, GetSelectionPrompt, PromptRectPointOptions } from "./PromptOptions";
|
|
|
|
|
import { PromptDistendResult, PromptEntityResult, PromptPointResult, PromptRectResult, PromptResult, PromptSsgetResult } from './PromptResult';
|
|
|
|
|
import { SelectControls } from './SelectControls';
|
|
|
|
|
import { GripDragServices } from './GripDragServices';
|
|
|
|
|
import { TransformServicess } from './TranstrolControl/TransformServices';
|
|
|
|
|
import { UCSServices } from './UCSServices';
|
|
|
|
|
import { angle } from '../Geometry/GeUtils';
|
|
|
|
|
import { Vector3, Math, Matrix4 } from 'three';
|
|
|
|
|
import { MaskManage } from '../UI/Components/Modal/MaskManage';
|
|
|
|
|
import { GetRectPointServices } from './GetRectServices';
|
|
|
|
|
import { CommandInputManage } from '../UI/Components/CommandInput/CommandInputManage';
|
|
|
|
|
|
|
|
|
|
//用户交互编辑工具
|
|
|
|
|
|
|
|
|
@ -35,7 +36,7 @@ export class Editor
|
|
|
|
|
m_App: ApplicationService;
|
|
|
|
|
m_InputState: InputState = InputState.None;
|
|
|
|
|
m_CommandStore: CommandStore;
|
|
|
|
|
m_GetpointServices: GetPointServices;
|
|
|
|
|
GetPointServices: GetPointServices;
|
|
|
|
|
m_GetDistanceServices: GetDistanceServices;
|
|
|
|
|
getRectPointServices: GetRectPointServices;
|
|
|
|
|
m_GetEntitytServices: GetEntityServices;
|
|
|
|
@ -48,6 +49,8 @@ export class Editor
|
|
|
|
|
m_SsgetServices: SsgetServiecs;
|
|
|
|
|
|
|
|
|
|
m_KeywordsServices: GetKeyWordsServices;
|
|
|
|
|
ContextMenuServices: ContextMenuServices;
|
|
|
|
|
InteractiveServices: EditorService[] = [];
|
|
|
|
|
|
|
|
|
|
//用户坐标系
|
|
|
|
|
constructor(app: ApplicationService)
|
|
|
|
@ -57,7 +60,7 @@ export class Editor
|
|
|
|
|
this.m_KeyCtrl = new KeyBoardControls();
|
|
|
|
|
this.m_SelectCtrl = new SelectControls(app.m_Viewer, this)
|
|
|
|
|
this.m_CommandStore = new CommandStore(this);
|
|
|
|
|
this.m_GetpointServices = new GetPointServices();
|
|
|
|
|
this.GetPointServices = new GetPointServices();
|
|
|
|
|
this.m_GetDistanceServices = new GetDistanceServices();
|
|
|
|
|
this.getRectPointServices = new GetRectPointServices();
|
|
|
|
|
|
|
|
|
@ -67,6 +70,7 @@ export class Editor
|
|
|
|
|
this.m_SsgetServices = new SsgetServiecs(this);
|
|
|
|
|
|
|
|
|
|
this.m_KeywordsServices = new GetKeyWordsServices(this);
|
|
|
|
|
this.ContextMenuServices = new ContextMenuServices(this);
|
|
|
|
|
|
|
|
|
|
xaop.end(this.m_MouseCtrl, this.m_MouseCtrl.onMouseMove, () =>
|
|
|
|
|
{
|
|
|
|
@ -78,6 +82,16 @@ export class Editor
|
|
|
|
|
this.m_MaskManage = new MaskManage();
|
|
|
|
|
this.m_ModalManage = new ModalManage(this);
|
|
|
|
|
this.m_CommandInput = new CommandInputManage();
|
|
|
|
|
|
|
|
|
|
this.InteractiveServices = [
|
|
|
|
|
this.m_SnapDragServices,
|
|
|
|
|
this.m_GetEntitytServices,
|
|
|
|
|
this.GetPointServices,
|
|
|
|
|
this.transCtrl,
|
|
|
|
|
this.m_SelectCtrl,
|
|
|
|
|
this.m_KeywordsServices,
|
|
|
|
|
this.ContextMenuServices
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -105,14 +119,12 @@ export class Editor
|
|
|
|
|
//尝试取消当前的操作
|
|
|
|
|
Canel()
|
|
|
|
|
{
|
|
|
|
|
[this.m_GetpointServices, this.m_GetDistanceServices, this.m_GetEntitytServices, this.m_SsgetServices, this.m_KeywordsServices].forEach(ser =>
|
|
|
|
|
{
|
|
|
|
|
ser.Cancel();
|
|
|
|
|
})
|
|
|
|
|
for (let service of this.InteractiveServices)
|
|
|
|
|
service.Cancel();
|
|
|
|
|
}
|
|
|
|
|
GetPoint(prompt?: GetPointPrompt): Promise<PromptPointResult>
|
|
|
|
|
{
|
|
|
|
|
return this.m_GetpointServices.Start(prompt);
|
|
|
|
|
return this.GetPointServices.Start(prompt);
|
|
|
|
|
}
|
|
|
|
|
GetDistance(prompt?: GetDistendPrompt): Promise<PromptDistendResult>
|
|
|
|
|
{
|
|
|
|
@ -180,4 +192,5 @@ export interface EditorService
|
|
|
|
|
IsReady: boolean;
|
|
|
|
|
//开始执行,交给服务. 返回布尔值, 如果为真 那么继续执行.
|
|
|
|
|
Doit: (e: MouseEvent) => Promise<boolean>;
|
|
|
|
|
Cancel: () => void;
|
|
|
|
|
}
|
|
|
|
|