|
|
@ -1,4 +1,4 @@
|
|
|
|
import { Object3D, Points, Vector3 } from 'three';
|
|
|
|
import { BufferGeometry, Line as TLine, Points, Vector3 } from 'three';
|
|
|
|
import { end } from 'xaop';
|
|
|
|
import { end } from 'xaop';
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
@ -7,7 +7,9 @@ import { MouseKey } from '../Common/KeyEnum';
|
|
|
|
import { GetEntity } from '../Common/Utils';
|
|
|
|
import { GetEntity } from '../Common/Utils';
|
|
|
|
import { Entity } from '../DatabaseServices/Entity/Entity';
|
|
|
|
import { Entity } from '../DatabaseServices/Entity/Entity';
|
|
|
|
import { Line } from '../DatabaseServices/Entity/Line';
|
|
|
|
import { Line } from '../DatabaseServices/Entity/Line';
|
|
|
|
|
|
|
|
import { BufferGeometryUtils } from '../Geometry/BufferGeometryUtils';
|
|
|
|
import { isParallelTo, isPerpendicularityTo, SnapPoint } from '../Geometry/GeUtils';
|
|
|
|
import { isParallelTo, isPerpendicularityTo, SnapPoint } from '../Geometry/GeUtils';
|
|
|
|
|
|
|
|
import { PointShapeUtils } from '../Geometry/PointShapeUtils';
|
|
|
|
import { DrawMode } from '../GraphicsSystem/PreViewer';
|
|
|
|
import { DrawMode } from '../GraphicsSystem/PreViewer';
|
|
|
|
import { CommandWrap } from './CommandMachine';
|
|
|
|
import { CommandWrap } from './CommandMachine';
|
|
|
|
import { Editor, EditorService } from './Editor';
|
|
|
|
import { Editor, EditorService } from './Editor';
|
|
|
@ -23,7 +25,7 @@ export class GripDragServices implements EditorService
|
|
|
|
//最后捕捉的点的位置(在WCS中)
|
|
|
|
//最后捕捉的点的位置(在WCS中)
|
|
|
|
lastSnapPoint: Vector3;
|
|
|
|
lastSnapPoint: Vector3;
|
|
|
|
private mouseCtrl: MouseControls;
|
|
|
|
private mouseCtrl: MouseControls;
|
|
|
|
SnapSize = 15;
|
|
|
|
private _SnapSize = 15;
|
|
|
|
constructor(private ed: Editor)
|
|
|
|
constructor(private ed: Editor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.mouseCtrl = ed.MouseCtrl;
|
|
|
|
this.mouseCtrl = ed.MouseCtrl;
|
|
|
@ -35,6 +37,20 @@ export class GripDragServices implements EditorService
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get SnapSize() { return this._SnapSize; }
|
|
|
|
|
|
|
|
set SnapSize(size: number)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (size !== this._SnapSize)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this._SnapSize = size;
|
|
|
|
|
|
|
|
if (this.previewCrossLine)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let geo = this.previewCrossLine.geometry as BufferGeometry;
|
|
|
|
|
|
|
|
BufferGeometryUtils.UpdatePts(geo, PointShapeUtils.CrossLinePts(this._SnapSize));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
get IsReady()
|
|
|
|
get IsReady()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return this.lastSnapPoint && this.ed.InputState === InputState.None;
|
|
|
|
return this.lastSnapPoint && this.ed.InputState === InputState.None;
|
|
|
@ -222,7 +238,7 @@ export class GripDragServices implements EditorService
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 前视图中的光标对象
|
|
|
|
* 前视图中的光标对象
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
previewCrossLine: Object3D = undefined;
|
|
|
|
previewCrossLine: TLine = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 在前视图中绘制捕捉光标
|
|
|
|
* 在前视图中绘制捕捉光标
|
|
|
|