CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

相关分类

正在恢复状态

2022-12-31 21:50| 发布者: admin| 查看: 269| 评论: 0|来自: AutoCAD

如果指定了 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;
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 14:00

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部