如果指定了 for,则在调用 UNDO 命令时将调用对象的函数。该功能是一个虚拟功能。派生类可以实现此函数来解释撤消文件管理器存储的特定于类的信息并将其读入。该函数必须确保您的类执行了修改。否则,它必须超级消息,如以下示例所示。kFalseautoUndoapplyPartialUndo()applyPartialUndo()AcDbObjectapplyPartialUndo() 如果要实现部分撤消机制,请确保调用以下函数,以便默认情况下不进行录制。 assertWriteEnabled(kFalse, kFalse); 例如,下面是AsdkPoly的函数:applyPartialUndo() Acad::ErrorStatus
AsdkPoly::applyPartialUndo(AcDbDwgFiler* filer,
AcRxClass* classObj)
{
// The first thing to check is whether the class matches
// ours. If it doesn't, we call the base class's
// applyPartialUndo(); hopefully, one of them will
// take care of it.
//
if (classObj != AsdkPoly::desc())
return AcDbCurve::applyPartialUndo(filer, classObj);
// Read the op-code and call the appropriate "set"
// method to undo what was done. The "set" does the
// filing again for redo.
//
Adesk::Int16 shortCode;
filer->readItem(&shortCode);
PolyOpCodeForPartialUndo code;
code = (PolyOpCodeForPartialUndo)shortCode;
Adesk::UInt32 value32;
switch (code) {
case kSetNumSides:
filer->readItem(&value32);
AOK(setNumSides(value32));
break;
default:
assert(Adesk::kFalse);
break;
}
return Acad::eOk;
}
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-11-5 20:42
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.