|
|
|
@ -35,10 +35,10 @@ export class DBClickPolyline
|
|
|
|
|
{ key: "U", msg: "放弃" }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
//操作记录数,用于撤销双击后的操作
|
|
|
|
|
let totalRecCount = 0;
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartMark();
|
|
|
|
|
|
|
|
|
|
let pl = this.entity as Polyline;
|
|
|
|
|
|
|
|
|
|
defaultKW[0].key = pl.CloseMark ? "O" : "C";
|
|
|
|
@ -57,24 +57,15 @@ export class DBClickPolyline
|
|
|
|
|
switch (res.StringResult)
|
|
|
|
|
{
|
|
|
|
|
case "C": //闭合
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
totalRecCount++;
|
|
|
|
|
pl.CloseMark = true;
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
break;
|
|
|
|
|
case "O": //打开
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
totalRecCount++;
|
|
|
|
|
pl.CloseMark = false;
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
break;
|
|
|
|
|
case "J": //合并
|
|
|
|
|
if (!pl.CloseMark)
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
totalRecCount++;
|
|
|
|
|
execStatus = await this.Join();
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
log("无法合并闭合多段线")
|
|
|
|
@ -85,22 +76,13 @@ export class DBClickPolyline
|
|
|
|
|
JigUtils.Destroy();
|
|
|
|
|
break;
|
|
|
|
|
case "D": //非曲线化
|
|
|
|
|
totalRecCount++;
|
|
|
|
|
this.TransfromNonCurve();
|
|
|
|
|
break;
|
|
|
|
|
case "R": //反转
|
|
|
|
|
totalRecCount++;
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
pl.Reverse();
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
break;
|
|
|
|
|
case "U": //放弃
|
|
|
|
|
if (totalRecCount > 0)
|
|
|
|
|
{
|
|
|
|
|
totalRecCount--;
|
|
|
|
|
app.m_Database.hm.Undo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
app.m_Editor.UpdateScreen();
|
|
|
|
@ -133,6 +115,8 @@ export class DBClickPolyline
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartMark();
|
|
|
|
|
|
|
|
|
|
app.m_Editor.UpdateScreen();
|
|
|
|
|
|
|
|
|
|
let res = await app.m_Editor.GetKeyWords({
|
|
|
|
@ -161,14 +145,10 @@ export class DBClickPolyline
|
|
|
|
|
execStatus = await this.ExecEditor(vertex, indexList, "B");
|
|
|
|
|
break;
|
|
|
|
|
case "I": //插入
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
execStatus = await this.ChangeVertex(vertex, false);
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
break;
|
|
|
|
|
case "M": //移动
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
execStatus = await this.ChangeVertex(vertex, true);
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
break;
|
|
|
|
|
case "S": //拉直
|
|
|
|
|
indexList.push(vertex.index);
|
|
|
|
@ -195,6 +175,8 @@ export class DBClickPolyline
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartMark();
|
|
|
|
|
|
|
|
|
|
let res = await app.m_Editor.GetKeyWords({
|
|
|
|
|
Msg: "请输入选项",
|
|
|
|
|
KeyWordList: execKW
|
|
|
|
@ -323,7 +305,6 @@ export class DBClickPolyline
|
|
|
|
|
}
|
|
|
|
|
private ExecSAndBCommand(indexList: number[], vertex: IVertex, editorCommand: string)
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartCmd("");
|
|
|
|
|
if (!equaln(indexList[0], vertex.index))
|
|
|
|
|
indexList.push(vertex.index);
|
|
|
|
|
//执行并更新顶点信息
|
|
|
|
@ -339,11 +320,9 @@ export class DBClickPolyline
|
|
|
|
|
}
|
|
|
|
|
vertex.index = indexList[0];
|
|
|
|
|
vertex.point.Position = this.entity.GetPointAtParam(indexList[0]);
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
}
|
|
|
|
|
private TransfromNonCurve()
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartCmd("d");
|
|
|
|
|
let pl = this.entity;
|
|
|
|
|
if (pl instanceof Polyline)
|
|
|
|
|
{
|
|
|
|
@ -369,11 +348,9 @@ export class DBClickPolyline
|
|
|
|
|
this.entity = new Polyline(data);
|
|
|
|
|
app.m_Database.ModelSpace.Append(this.entity);
|
|
|
|
|
}
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
}
|
|
|
|
|
private TransfromSpline()
|
|
|
|
|
{
|
|
|
|
|
app.m_Database.hm.StartCmd("s");
|
|
|
|
|
let pl = this.entity;
|
|
|
|
|
if (pl instanceof Polyline)
|
|
|
|
|
{
|
|
|
|
@ -384,6 +361,5 @@ export class DBClickPolyline
|
|
|
|
|
spl.CloseMark = pl.CloseMark;
|
|
|
|
|
this.entity = spl;
|
|
|
|
|
}
|
|
|
|
|
app.m_Database.hm.EndCmd();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|