新增绘制捕捉点光标

pull/7/head
ChenX 7 years ago
parent abe24d16bf
commit a6155ec56b

@ -8,7 +8,6 @@ import { Line } from '../DatabaseServices/Entity';
import { angle, equaln, fixAngle, Intersect } from '../Geometry/GeUtils'; import { angle, equaln, fixAngle, Intersect } from '../Geometry/GeUtils';
import { PromptPointResult, PromptStatus } from './PromptResult'; import { PromptPointResult, PromptStatus } from './PromptResult';
/** /**
* ,Editor. * ,Editor.
* *
@ -156,8 +155,31 @@ export class GetPointServices
{ {
//清理原先画的辅助线 //清理原先画的辅助线
this.DestroySnapLine(); this.DestroySnapLine();
let preView = app.m_Viewer.m_PreViewer; let preView = app.m_Viewer.m_PreViewer;
//绘制捕捉光标列表
for (let snapP of this.m_SnapPtList)
{
let lines = preView.DrawCross(5, preView.m_BlueDashMaterial);
let p = snapP.clone();
app.m_Viewer.WorldToScreen(p);
preView.ScreenPointToViewerPoint(p);
let move = new THREE.Matrix4();
move.setPosition(p);
for (let l of lines)
{
l.applyMatrix(move);
this.m_SnapAxisBlueLine.push(l);
preView.Scene.add(l);
}
}
//如果存在捕捉 //如果存在捕捉
if (app.m_Viewer.m_PreViewer.m_LastSnapPoint) if (app.m_Viewer.m_PreViewer.m_LastSnapPoint)
{ {

@ -172,6 +172,17 @@ export class PreViewer
geometry.computeLineDistances(); geometry.computeLineDistances();
return new THREE.Line(geometry, material); return new THREE.Line(geometry, material);
} }
//绘制×光标
DrawCross(size: number, material?: THREE.LineBasicMaterial | THREE.LineDashedMaterial): THREE.Line[]
{
return [
this.DrawLine(new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, -size, 0), material),
this.DrawLine(new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, size, 0), material),
this.DrawLine(new THREE.Vector3(0, 0, 0), new THREE.Vector3(size, 0, 0), material),
this.DrawLine(new THREE.Vector3(0, 0, 0), new THREE.Vector3(-size, 0, 0), material)
]
}
DrawLineFromWcs(p1: THREE.Vector3, p2: THREE.Vector3, material?: THREE.LineBasicMaterial | THREE.LineDashedMaterial): THREE.Line DrawLineFromWcs(p1: THREE.Vector3, p2: THREE.Vector3, material?: THREE.LineBasicMaterial | THREE.LineDashedMaterial): THREE.Line
{ {
material = material ? material : this.m_LineMaterial; material = material ? material : this.m_LineMaterial;

Loading…
Cancel
Save