|
|
@ -3,6 +3,8 @@ import { CADFile } from './CADFile';
|
|
|
|
import { CADObject } from './CADObject';
|
|
|
|
import { CADObject } from './CADObject';
|
|
|
|
import { CommandHistoryRecord } from './CommandHistoryRecord';
|
|
|
|
import { CommandHistoryRecord } from './CommandHistoryRecord';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO:对于空的新建命令,应该支持不清空后续命令. 比如切换相机或者切换视图.
|
|
|
|
|
|
|
|
|
|
|
|
//历史记录管理
|
|
|
|
//历史记录管理
|
|
|
|
@Factory
|
|
|
|
@Factory
|
|
|
|
export class HistoricManage extends CADObject
|
|
|
|
export class HistoricManage extends CADObject
|
|
|
@ -89,16 +91,13 @@ export class HistoricManage extends CADObject
|
|
|
|
this.EndCmd();
|
|
|
|
this.EndCmd();
|
|
|
|
let historyRec = this.historyRecord[this.curIndex];
|
|
|
|
let historyRec = this.historyRecord[this.curIndex];
|
|
|
|
if (!historyRec)
|
|
|
|
if (!historyRec)
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.doing = true;
|
|
|
|
this.doing = true;
|
|
|
|
for (let [id, recList] of historyRec.HistoryList)
|
|
|
|
for (let [id, recList] of historyRec.HistoryList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let obj = id.Object;
|
|
|
|
|
|
|
|
for (let i = recList.length; i--;)
|
|
|
|
for (let i = recList.length; i--;)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
obj.ApplyPartialUndo(recList[i].undoData);
|
|
|
|
id.Object.ApplyPartialUndo(recList[i].undoData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.curIndex--;
|
|
|
|
this.curIndex--;
|
|
|
@ -109,16 +108,13 @@ export class HistoricManage extends CADObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let historyRec = this.historyRecord[this.curIndex + 1];
|
|
|
|
let historyRec = this.historyRecord[this.curIndex + 1];
|
|
|
|
if (!historyRec)
|
|
|
|
if (!historyRec)
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.doing = true;
|
|
|
|
this.doing = true;
|
|
|
|
for (let [id, recList] of historyRec.HistoryList)
|
|
|
|
for (let [id, recList] of historyRec.HistoryList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let obj = id.Object;
|
|
|
|
|
|
|
|
for (let rec of recList)
|
|
|
|
for (let rec of recList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
obj.ApplyPartialUndo(rec.redoData);
|
|
|
|
id.Object.ApplyPartialUndo(rec.redoData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.curIndex++;
|
|
|
|
this.curIndex++;
|
|
|
|