清理代码

pull/96/head
cx 6 years ago
parent 585e93eea6
commit 12a7e3a200

@ -50,7 +50,7 @@ export class Command_Array implements Command
}
else if (keyWord.StringResult == "2P")
{
app.m_Editor.m_CommandStore.Prompt("请选择中心点:");
app.m_Editor.Prompt("请选择中心点:");
let ptRes = await app.m_Editor.GetPoint();
if (ptRes.Status != PromptStatus.OK)
{ return; }

@ -50,7 +50,7 @@ export class CMD_Divide implements Command
let divCount = numRes.Value;
if (divCount === 0)
{
app.m_Editor.m_CommandStore.Prompt("您不能等分0");
app.m_Editor.Prompt("您不能等分0");
return;
}
if (enRes.Entity instanceof Curve)
@ -78,7 +78,7 @@ export class CMD_Divide implements Command
let divLen = numRes.Value;
if (divLen === 0)
{
app.m_Editor.m_CommandStore.Prompt("分段长度不能为0");
app.m_Editor.Prompt("分段长度不能为0");
return;
}
if (enRes.Entity instanceof Curve)
@ -87,7 +87,7 @@ export class CMD_Divide implements Command
let len = cu.Length;
if (divLen > len)
{
app.m_Editor.m_CommandStore.Prompt("分段长度不能超过对象长度");
app.m_Editor.Prompt("分段长度不能超过对象长度");
return;
}
let divCount = len / divLen;

@ -52,7 +52,7 @@ export class DrawBehindBoard extends DrawBoardTool
//构建板件
for (let i = 1; i <= count; i++)
{
let b = board.Clone() as Board;
let b = board.Clone();
if (relPos === BrRelativePos.Front)
b.ApplyMatrix(MoveMatrix(newBox.min.clone().add(new Vector3(0, spaceSize * i + (i - 1) * thickness, 0))));
else if (relPos === BrRelativePos.Back)

@ -76,7 +76,7 @@ export abstract class DrawBoardTool implements Command
if (spaceParse.Spaces.length === 0)
{
app.m_Editor.m_CommandStore.Prompt("生成板件失败,没分析出有效空间");
app.m_Editor.Prompt("生成板件失败,没分析出有效空间");
continue;
}
@ -111,7 +111,7 @@ export abstract class DrawBoardTool implements Command
}
else
{
app.m_Editor.m_CommandStore.Prompt("请选择有效的板件,或者周围没有效板件");
app.m_Editor.Prompt("请选择有效的板件,或者周围没有效板件");
}
}
@ -158,7 +158,7 @@ export abstract class DrawBoardTool implements Command
if (spaceParse.Spaces.length === 0)
{
app.m_Editor.m_CommandStore.Prompt("生成板件失败");
app.m_Editor.Prompt("生成板件失败");
return;
}
let mat = spaceParse.SpaceOCS;
@ -170,7 +170,7 @@ export abstract class DrawBoardTool implements Command
}
else
{
app.m_Editor.m_CommandStore.Prompt("请选择板件")
app.m_Editor.Prompt("请选择板件")
}
}
private async DrawInALlBoxes(opt: BoardOption)
@ -188,7 +188,7 @@ export abstract class DrawBoardTool implements Command
if (spaceParse.Spaces.length === 0)
{
app.m_Editor.m_CommandStore.Prompt("生成板件失败");
app.m_Editor.Prompt("生成板件失败");
return;
}
let ro = new Matrix4().extractRotation(spaceParse.SpaceOCS);
@ -201,7 +201,7 @@ export abstract class DrawBoardTool implements Command
}
else
{
app.m_Editor.m_CommandStore.Prompt("请选择板件")
app.m_Editor.Prompt("请选择板件")
}
}

@ -15,7 +15,7 @@ export class DrawAlignedDimension implements Command
protected DimType = DimensionType.Align;
async exec()
{
app.m_Editor.m_CommandStore.Prompt("请指定第一条尺寸线原点:");
app.m_Editor.Prompt("请指定第一条尺寸线原点:");
let ptRes = await app.m_Editor.GetPoint({ Msg: "请指定第一条尺寸线原点:" });
if (ptRes.Status != PromptStatus.OK)
{
@ -23,7 +23,7 @@ export class DrawAlignedDimension implements Command
}
let startPt = ptRes.Value;
app.m_Editor.m_CommandStore.Prompt("请输入第二条尺寸线原点:");
app.m_Editor.Prompt("请输入第二条尺寸线原点:");
ptRes = await app.m_Editor.GetPoint({
Msg: "请输入第二条尺寸线原点:",
BasePoint: startPt,
@ -49,7 +49,7 @@ export class DrawAlignedDimension implements Command
app.m_Editor.AddNoSnapEntity(alDim);
app.m_Database.ModelSpace.Append(alDim);
app.m_Editor.m_CommandStore.Prompt("指定尺寸线位置:");
app.m_Editor.Prompt("指定尺寸线位置:");
ptRes = await app.m_Editor.GetPoint({
Msg: "指定尺寸线位置:",
KeyWordList: [{ msg: "多行文字", key: "M" }, { msg: "文字", key: "T" }, { msg: "角度", key: "A" }],

@ -14,7 +14,7 @@ export class DrawEllipse implements Command
{
async exec()
{
app.m_Editor.m_CommandStore.Prompt("指定椭圆中心:");
app.m_Editor.Prompt("指定椭圆中心:");
app.m_Editor.UpdateScreen();
let ptRes = await app.m_Editor.GetPoint({
Msg: "指定椭圆中心",

@ -1,49 +1,49 @@
import * as THREE from 'three';
import { app } from '../ApplicationServices/Application';
import { Command } from '../Editor/CommandMachine';
/**
* .
*
* @export
* @class DrawGripStretch
* @implements {Command}
*/
export class DrawGripStretch implements Command
{
async exec()
{
if (app.m_Viewer.m_OutlinePass.selectedObjects.length === 0)
{
app.m_Editor.m_CommandStore.Prompt("未选择对象:");
return;
}
let geometry = new THREE.Geometry();
let material = new THREE.PointsMaterial({
size: 15,
color: 0x001dfa,
sizeAttenuation: false
});
for (let en of app.m_Viewer.m_OutlinePass.selectedObjects)
{
if (en instanceof THREE.Mesh || en instanceof THREE.Line)
{
if (en.geometry instanceof THREE.Geometry)
{
for (let p of en.geometry.vertices)
{
geometry.vertices.push(p.clone().applyMatrix4(en.matrix));
}
}
}
let pts = new THREE.Points(geometry, material);
app.m_Viewer.Scene.add(pts);
}
}
}
import * as THREE from 'three';
import { app } from '../ApplicationServices/Application';
import { Command } from '../Editor/CommandMachine';
/**
* .
*
* @export
* @class DrawGripStretch
* @implements {Command}
*/
export class DrawGripStretch implements Command
{
async exec()
{
if (app.m_Viewer.m_OutlinePass.selectedObjects.length === 0)
{
app.m_Editor.Prompt("未选择对象:");
return;
}
let geometry = new THREE.Geometry();
let material = new THREE.PointsMaterial({
size: 15,
color: 0x001dfa,
sizeAttenuation: false
});
for (let en of app.m_Viewer.m_OutlinePass.selectedObjects)
{
if (en instanceof THREE.Mesh || en instanceof THREE.Line)
{
if (en.geometry instanceof THREE.Geometry)
{
for (let p of en.geometry.vertices)
{
geometry.vertices.push(p.clone().applyMatrix4(en.matrix));
}
}
}
let pts = new THREE.Points(geometry, material);
app.m_Viewer.Scene.add(pts);
}
}
}

@ -9,7 +9,7 @@ export class DrawSpline implements Command
{
async exec()
{
app.m_Editor.m_CommandStore.Prompt("请输入一个点:");
app.m_Editor.Prompt("请输入一个点:");
let ptRes = await app.m_Editor.GetPoint({ Msg: "请输入第一个点:" });
if (ptRes.Status != PromptStatus.OK)
return;
@ -27,7 +27,7 @@ export class DrawSpline implements Command
{
app.m_Database.ModelSpace.Append(spline);
}
app.m_Editor.m_CommandStore.Prompt("请输入点2:");
app.m_Editor.Prompt("请输入点2:");
ptRes = await app.m_Editor.GetPoint({
Msg: "请输入点2:",
BasePoint: ptLast,

@ -18,7 +18,7 @@ export class Command_Explode implements Command
{
if (en instanceof Line || en instanceof Arc || en instanceof Circle)
{
app.m_Editor.m_CommandStore.Prompt('无法分解');
app.m_Editor.Prompt('无法分解');
continue;
}
let ens = en.Explode();

@ -60,14 +60,14 @@ export class CommandFillet implements Command
let arcP1 = new_cu1.GetClosestPointTo(center, true);
if (!new_cu1.PtOnCurve(arcP1))
{
app.m_Editor.m_CommandStore.Prompt("半径过大");
app.m_Editor.Prompt("半径过大");
return;
}
//圆弧点2
let arcP2 = new_cu2.GetClosestPointTo(center, true);
if (!new_cu2.PtOnCurve(arcP2))
{
app.m_Editor.m_CommandStore.Prompt("半径过大");
app.m_Editor.Prompt("半径过大");
return;
}
@ -200,7 +200,7 @@ export class CommandFillet implements Command
case PromptStatus.OK:
if (enRes.Entity === oldCurve)
{
app.m_Editor.m_CommandStore.Prompt("重复的对象!");
app.m_Editor.Prompt("重复的对象!");
}
else if (enRes.Entity && enRes.Entity instanceof Curve)
{

@ -61,7 +61,7 @@ export class OffsetX implements Command
if (step === 0)
{
app.m_Editor.m_CommandStore.Prompt("步长不能为0,已经帮你转换成" + dis / 10);
app.m_Editor.Prompt("步长不能为0,已经帮你转换成" + dis / 10);
step = dis / 10;
}
let count = dis / step;

@ -52,7 +52,7 @@ export class PasteClip
}
catch (error)
{
app.m_Editor.m_CommandStore.Prompt("黏贴遇到错误:" + error);
app.m_Editor.Prompt("黏贴遇到错误:" + error);
}
}

@ -14,7 +14,7 @@ export class Command_RevPl implements Command
if (en instanceof Curve)
{
en.Reverse();
app.m_Editor.m_CommandStore.Prompt("成功翻转曲线");
app.m_Editor.Prompt("成功翻转曲线");
}
}
app.m_Editor.UpdateScreen();

@ -15,7 +15,7 @@ export class Command_Rotate implements Command
if (ss.Status != PromptStatus.OK)
return;
app.m_Editor.m_CommandStore.Prompt("请输入第一个点:");
app.m_Editor.Prompt("请输入第一个点:");
let ptRes = await app.m_Editor.GetPoint();
if (ptRes.Status != PromptStatus.OK)
{ return; }
@ -23,7 +23,7 @@ export class Command_Rotate implements Command
let pt1 = ptRes.Value;
let ucsInv = new Matrix4().getInverse(app.m_Editor.UCSMatrix);
let pt1Ucs = pt1.clone().applyMatrix4(ucsInv);
app.m_Editor.m_CommandStore.Prompt("请输入第二个点:");
app.m_Editor.Prompt("请输入第二个点:");
let enMap = new Map<Entity, CADFile>();

@ -18,7 +18,7 @@ export class Sweep implements Command
return;
if (!enRes.Entity.IsClose)
{
app.m_Editor.m_CommandStore.Prompt("您选择的多段线没有闭合!");
app.m_Editor.Prompt("您选择的多段线没有闭合!");
return;
}
}
@ -30,7 +30,7 @@ export class Sweep implements Command
{
if (!(enRes.Entity instanceof Curve))
{
app.m_Editor.m_CommandStore.Prompt("您选择的路径不是曲线!");
app.m_Editor.Prompt("您选择的路径不是曲线!");
return;
}

@ -15,7 +15,7 @@ export class Test implements Command
{
constructor()
{
app.m_Editor.m_CommandStore.Prompt("载入成功!");
app.m_Editor.Prompt("载入成功!");
}
async exec()
{

@ -1,7 +1,7 @@
export async function log(msg)
{
let app = (await import("../ApplicationServices/Application")).app;
app.m_Editor.m_CommandStore.Prompt(msg);
app.m_Editor.Prompt(msg);
}
export function IsNumber(keyCode: number)

@ -15,10 +15,10 @@ export class CommandMachine
{
if (this.m_CommandIng)
{
app.m_Editor.m_CommandStore.Prompt('系统正忙!');
app.m_Editor.Prompt('系统正忙!');
return;
}
app.m_Editor.m_CommandStore.Prompt(cmdName);
app.m_Editor.Prompt(cmdName);
if (this.m_CommandList.has(cmdName))
{
if (cmdName !== "SAVE")
@ -37,14 +37,14 @@ export class CommandMachine
}
catch (error)
{
app.m_Editor.m_CommandStore.Prompt("抱歉,命令造成了错误,请联系开发人员.");
app.m_Editor.Prompt("抱歉,命令造成了错误,请联系开发人员.");
console.error(error);
}
this.CommandEnd(cmdName, abort);
}
else
{
app.m_Editor.m_CommandStore.Prompt('输入命令有误');
app.m_Editor.Prompt('输入命令有误');
this.CommandEnd(cmdName);
}
}

@ -131,7 +131,7 @@ export class GetPointServices implements EditorService
}
catch (error)
{
app.m_Editor.m_CommandStore.Prompt("动态拾取点回调错误!");
app.m_Editor.Prompt("动态拾取点回调错误!");
console.log(error);
}
app.m_Editor.UpdateScreen();
@ -239,7 +239,7 @@ export class GetPointServices implements EditorService
if (prompt.Msg)
{
app.m_Editor.m_CommandStore.commandPrompt = prompt.Msg;
// app.m_Editor.m_CommandStore.Prompt(prompt.Msg);
// app.m_Editor.Prompt(prompt.Msg);
this.removeCalls.push(() =>
{
app.m_Editor.m_CommandStore.commandPrompt = "";

@ -49,7 +49,7 @@ export class SnapDragServices implements EditorService
this.DestroyPreLine();
app.m_Viewer.m_bNeedUpdate = true;
app.m_Editor.m_CommandStore.Prompt("拽拖开始:");
app.m_Editor.Prompt("拽拖开始:");
app.m_Editor.m_CommandStore.isCmdIng = true;
app.m_Database.hm.StartCmd("drag");

Loading…
Cancel
Save