In OCAF ,Can we save Undo/Redo information & retrieve it while loading the file in next session?

Hi everyone, I am creating a TDocStd_Document doc class with BinOCAF format with SetModificationMode(true) & SetUndoLimit(40); and attached few attributes and modified them and could get undos and redos while on session but when I save this to a .cbf file and reload it, the undo-redo transactions are lost. Is there a way to save and reterive the undo transactions even after the session is closed? Can anyone help

Mikhail MPV's picture

  Hi Kavin,

There is no possibility to store the undo/redo information in the OCCT TDocStd_Document. As I know, this is out of scope of the functionality of most standard applications.

Kavin Prasad's picture

Hi Mikhail,
Thank you very much for the reply. Is there any other possible ways to save and restore changes. Do you have any ideas?

Mikhail MPV's picture


You can take all information about all deltas using GetUndos and GetRedos method of TDocStd_Document. You could store and then retrieve all this data by creation of special file format for them.

Or, of course, there is a common simple but silly way to save the document every time a transaction is committed. So, you will have a ready state of the document with every transaction to restore it.