|
|
@ -10,20 +10,31 @@ export class DrawLine implements Command
|
|
|
|
{
|
|
|
|
{
|
|
|
|
async exec()
|
|
|
|
async exec()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.commandPrompt = "请输入一个点:";
|
|
|
|
app.m_Editor.m_CommandStore.commandPrompt = "请输入一个点:";
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.push({ key: "U", msg: "放弃" });
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入一个点:");
|
|
|
|
let ptRes = await app.m_Editor.GetPoint();
|
|
|
|
let ptRes = await app.m_Editor.GetPoint();
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let i = 1;
|
|
|
|
|
|
|
|
|
|
|
|
let i = 0;
|
|
|
|
let p1 = ptRes.Value;
|
|
|
|
let p1 = ptRes.Value;
|
|
|
|
let p2 = p1;
|
|
|
|
let p2 = p1;
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入点2:");
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入点2:");
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.commandPrompt = "请输入点2:";
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
if (i === 1)
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.push({ key: "U", msg: "放弃" });
|
|
|
|
|
|
|
|
else if (i == 3)
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.push({ key: "C", msg: "闭合" });
|
|
|
|
|
|
|
|
|
|
|
|
ptRes = await app.m_Editor.GetPoint({ BasePoint: p1, AllowDrawRubberBand: true });
|
|
|
|
ptRes = await app.m_Editor.GetPoint({ BasePoint: p1, AllowDrawRubberBand: true });
|
|
|
|
|
|
|
|
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -170,13 +181,23 @@ export class DrawCircle implements Command
|
|
|
|
async exec()
|
|
|
|
async exec()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let cir = new Circle(app.m_Editor.m_MouseCtrl.m_CurMousePointWCS.clone(), 10);
|
|
|
|
let cir = new Circle(app.m_Editor.m_MouseCtrl.m_CurMousePointWCS.clone(), 10);
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("指定圆的圆心:");
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.commandPrompt = "指定圆的圆心";
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.push(
|
|
|
|
|
|
|
|
{ key: "3P", msg: "三点" }, { key: "2P", msg: "二点" }, { key: "T", msg: "切点、切点、半径" }
|
|
|
|
|
|
|
|
)
|
|
|
|
app.m_Editor.UpdateScreen();
|
|
|
|
app.m_Editor.UpdateScreen();
|
|
|
|
let ptRes = await app.m_Editor.GetPoint({
|
|
|
|
let ptRes = await app.m_Editor.GetPoint({
|
|
|
|
Callback: (p) =>
|
|
|
|
Callback: (p) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cir.m_Center.copy(p);
|
|
|
|
cir.m_Center.copy(p);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("指定圆的半径:");
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.commandPrompt = "指定圆的半径:";
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.length = 0;
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.viceCommand.push({ key: "D", msg: "直径" })
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -195,6 +216,8 @@ export class DrawCircle implements Command
|
|
|
|
AllowDrawRubberBand: true
|
|
|
|
AllowDrawRubberBand: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.m_Editor.m_CommandStore.EndCommand();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|