恢复状态
如果指定了 ,则在调用 UNDO 命令时调用对象的函数。该函数是 上的虚函数。派生类可以实现此函数,以解释撤消文件管理器存储的特定于类的信息并读取它。该函数必须确保类执行修改。如果不是,它必须是 super-message,如以下示例所示。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-3-14 05:51
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.